1328 lines
1006 KiB
JavaScript
1328 lines
1006 KiB
JavaScript
var Yw=Object.defineProperty;var Gw=(i,t,e)=>t in i?Yw(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var x=(i,t,e)=>Gw(i,typeof t!="symbol"?t+"":t,e);/**
|
||
* @vue/shared v3.5.41
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function Qm(i){const t=Object.create(null);for(const e of i.split(","))t[e]=1;return e=>e in t}const ue={},Sa=[],Gr=()=>{},ob=()=>!1,wc=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Tc=i=>i.startsWith("onUpdate:"),We=Object.assign,tp=(i,t)=>{const e=i.indexOf(t);e>-1&&i.splice(e,1)},$w=Object.prototype.hasOwnProperty,oe=(i,t)=>$w.call(i,t),Mt=Array.isArray,Ea=i=>wl(i)==="[object Map]",Za=i=>wl(i)==="[object Set]",Eg=i=>wl(i)==="[object Date]",Ot=i=>typeof i=="function",Te=i=>typeof i=="string",Xs=i=>typeof i=="symbol",le=i=>i!==null&&typeof i=="object",lb=i=>(le(i)||Ot(i))&&Ot(i.then)&&Ot(i.catch),hb=Object.prototype.toString,wl=i=>hb.call(i),Hw=i=>wl(i).slice(8,-1),cb=i=>wl(i)==="[object Object]",Sc=i=>Te(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,Io=Qm(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ec=i=>{const t=Object.create(null);return(e=>t[e]||(t[e]=i(e)))},Ww=/-\w/g,mr=Ec(i=>i.replace(Ww,t=>t.slice(1).toUpperCase())),zw=/\B([A-Z])/g,ln=Ec(i=>i.replace(zw,"-$1").toLowerCase()),ub=Ec(i=>i.charAt(0).toUpperCase()+i.slice(1)),Zu=Ec(i=>i?`on${ub(i)}`:""),Xr=(i,t)=>!Object.is(i,t),yh=(i,...t)=>{for(let e=0;e<i.length;e++)i[e](...t)},db=(i,t,e,s=!1)=>{Object.defineProperty(i,t,{configurable:!0,enumerable:!1,writable:s,value:e})},Ac=i=>{const t=parseFloat(i);return isNaN(t)?i:t},jw=i=>{const t=Te(i)?Number(i):NaN;return isNaN(t)?i:t};let Ag;const Cc=()=>Ag||(Ag=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ep(i){if(Mt(i)){const t={};for(let e=0;e<i.length;e++){const s=i[e],r=Te(s)?Jw(s):ep(s);if(r)for(const n in r)t[n]=r[n]}return t}else if(Te(i)||le(i))return i}const qw=/;(?![^(]*\))/g,Kw=/:([^]+)/,Zw=/\/\*[^]*?\*\//g;function Jw(i){const t={};return i.replace(Zw,"").split(qw).forEach(e=>{if(e){const s=e.split(Kw);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function sp(i){let t="";if(Te(i))t=i;else if(Mt(i))for(let e=0;e<i.length;e++){const s=sp(i[e]);s&&(t+=s+" ")}else if(le(i))for(const e in i)i[e]&&(t+=e+" ");return t.trim()}const Qw="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",tT=Qm(Qw);function fb(i){return!!i||i===""}function eT(i,t){if(i.length!==t.length)return!1;let e=!0;for(let s=0;e&&s<i.length;s++)e=Ja(i[s],t[s]);return e}function Ja(i,t){if(i===t)return!0;let e=Eg(i),s=Eg(t);if(e||s)return e&&s?i.getTime()===t.getTime():!1;if(e=Xs(i),s=Xs(t),e||s)return i===t;if(e=Mt(i),s=Mt(t),e||s)return e&&s?eT(i,t):!1;if(e=le(i),s=le(t),e||s){if(!e||!s)return!1;const r=Object.keys(i).length,n=Object.keys(t).length;if(r!==n)return!1;for(const a in i){const o=i.hasOwnProperty(a),h=t.hasOwnProperty(a);if(o&&!h||!o&&h||!Ja(i[a],t[a]))return!1}}return String(i)===String(t)}function rp(i,t){return i.findIndex(e=>Ja(e,t))}const mb=i=>!!(i&&i.__v_isRef===!0),sT=i=>Te(i)?i:i==null?"":Mt(i)||le(i)&&(i.toString===hb||!Ot(i.toString))?mb(i)?sT(i.value):JSON.stringify(i,pb,2):String(i),pb=(i,t)=>mb(t)?pb(i,t.value):Ea(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[s,r],n)=>(e[Ju(s,n)+" =>"]=r,e),{})}:Za(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ju(e))}:Xs(t)?Ju(t):le(t)&&!Mt(t)&&!cb(t)?String(t):t,Ju=(i,t="")=>{var e;return Xs(i)?`Symbol(${(e=i.description)!=null?e:t})`:i};/**
|
||
* @vue/reactivity v3.5.41
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Ge;class gb{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ge&&(Ge.active?(this.parent=Ge,this.index=(Ge.scopes||(Ge.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,e;if(this.scopes){const s=this.scopes.slice();for(t=0,e=s.length;t<e;t++)s[t].pause()}for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,e;if(this.scopes){const r=this.scopes.slice();for(t=0,e=r.length;t<e;t++)r[t].resume()}const s=this.effects.slice();for(t=0,e=s.length;t<e;t++)s[t].resume()}}run(t){if(this._active){const e=Ge;try{return Ge=this,t()}finally{Ge=e}}}on(){++this._on===1&&(this.prevScope=Ge,Ge=this)}off(){if(this._on>0&&--this._on===0){if(Ge===this)Ge=this.prevScope;else{let t=Ge;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(this.effects.length=0,e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.cleanups.length=0,this.scopes){const r=this.scopes.slice();for(e=0,s=r.length;e<s;e++)r[e].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function ip(i){return new gb(i)}function np(){return Ge}function yb(i,t=!1){Ge&&Ge.cleanups.push(i)}let ge;const Qu=new WeakSet;class xb{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ge&&(Ge.active?Ge.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Qu.has(this)&&(Qu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||vb(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Cg(this),_b(this);const t=ge,e=pr;ge=this,pr=!0;try{return this.fn()}finally{wb(this),ge=t,pr=e,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)lp(t);this.deps=this.depsTail=void 0,Cg(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Qu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Yf(this)&&this.run()}get dirty(){return Yf(this)}}let bb=0,Po,Mo;function vb(i,t=!1){if(i.flags|=8,t){i.next=Mo,Mo=i;return}i.next=Po,Po=i}function ap(){bb++}function op(){if(--bb>0)return;if(Mo){let t=Mo;for(Mo=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let i;for(;Po;){let t=Po;for(Po=void 0;t;){const e=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){i||(i=s)}t=e}}if(i)throw i}function _b(i){for(let t=i.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function wb(i){let t,e=i.depsTail,s=e;for(;s;){const r=s.prevDep;s.version===-1?(s===e&&(e=r),lp(s),rT(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}i.deps=t,i.depsTail=e}function Yf(i){for(let t=i.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Tb(t.dep.computed)||t.dep.version!==t.version))return!0;return!!i._dirty}function Tb(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===Uo)||(i.globalVersion=Uo,!i.isSSR&&i.flags&128&&(!i.deps&&!i._dirty||!Yf(i))))return;i.flags|=2;const t=i.dep,e=ge,s=pr;ge=i,pr=!0;try{_b(i);const r=i.fn(i._value);(t.version===0||Xr(r,i._value))&&(i.flags|=128,i._value=r,t.version++)}catch(r){throw t.version++,r}finally{ge=e,pr=s,wb(i),i.flags&=-3}}function lp(i,t=!1){const{dep:e,prevSub:s,nextSub:r}=i;if(s&&(s.nextSub=r,i.prevSub=void 0),r&&(r.prevSub=s,i.nextSub=void 0),e.subs===i&&(e.subs=s,!s&&e.computed)){e.computed.flags&=-5;for(let n=e.computed.deps;n;n=n.nextDep)lp(n,!0)}!t&&!--e.sc&&e.map&&e.map.delete(e.key)}function rT(i){const{prevDep:t,nextDep:e}=i;t&&(t.nextDep=e,i.prevDep=void 0),e&&(e.prevDep=t,i.nextDep=void 0)}let pr=!0;const Sb=[];function Si(){Sb.push(pr),pr=!1}function Ei(){const i=Sb.pop();pr=i===void 0?!0:i}function Cg(i){const{cleanup:t}=i;if(i.cleanup=void 0,t){const e=ge;ge=void 0;try{t()}finally{ge=e}}}let Uo=0;class iT{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hp{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ge||!pr||ge===this.computed)return;let e=this.activeLink;if(e===void 0||e.sub!==ge)e=this.activeLink=new iT(ge,this),ge.deps?(e.prevDep=ge.depsTail,ge.depsTail.nextDep=e,ge.depsTail=e):ge.deps=ge.depsTail=e,Eb(e);else if(e.version===-1&&(e.version=this.version,e.nextDep)){const s=e.nextDep;s.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=s),e.prevDep=ge.depsTail,e.nextDep=void 0,ge.depsTail.nextDep=e,ge.depsTail=e,ge.deps===e&&(ge.deps=s)}return e}trigger(t){this.version++,Uo++,this.notify(t)}notify(t){ap();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{op()}}}function Eb(i){if(i.dep.sc++,i.sub.flags&4){const t=i.dep.computed;if(t&&!i.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Eb(s)}const e=i.dep.subs;e!==i&&(i.prevSub=e,e&&(e.nextSub=i)),i.dep.subs=i}}const Ph=new WeakMap,Dn=Symbol(""),Gf=Symbol(""),Xo=Symbol("");function ls(i,t,e){if(pr&&ge){let s=Ph.get(i);s||Ph.set(i,s=new Map);let r=s.get(e);r||(s.set(e,r=new hp),r.map=s,r.key=e),r.track()}}function hi(i,t,e,s,r,n){const a=Ph.get(i);if(!a){Uo++;return}const o=h=>{h&&h.trigger()};if(ap(),t==="clear")a.forEach(o);else{const h=Mt(i),l=h&&Sc(e);if(h&&e==="length"){const c=Number(s);a.forEach((u,d)=>{(d==="length"||d===Xo||!Xs(d)&&d>=c)&&o(u)})}else switch((e!==void 0||a.has(void 0))&&o(a.get(e)),l&&o(a.get(Xo)),t){case"add":h?l&&o(a.get("length")):(o(a.get(Dn)),Ea(i)&&o(a.get(Gf)));break;case"delete":h||(o(a.get(Dn)),Ea(i)&&o(a.get(Gf)));break;case"set":Ea(i)&&o(a.get(Dn));break}}op()}function nT(i,t){const e=Ph.get(i);return e&&e.get(t)}function ia(i){const t=re(i);return t===i?t:(ls(t,"iterate",Xo),Us(i)?t:t.map(br))}function Ic(i){return ls(i=re(i),"iterate",Xo),i}function Or(i,t){return Ai(i)?Na(vi(i)?br(t):t):br(t)}const aT={__proto__:null,[Symbol.iterator](){return td(this,Symbol.iterator,i=>Or(this,i))},concat(...i){return ia(this).concat(...i.map(t=>Mt(t)?ia(t):t))},entries(){return td(this,"entries",i=>(i[1]=Or(this,i[1]),i))},every(i,t){return Zr(this,"every",i,t,void 0,arguments)},filter(i,t){return Zr(this,"filter",i,t,e=>e.map(s=>Or(this,s)),arguments)},find(i,t){return Zr(this,"find",i,t,e=>Or(this,e),arguments)},findIndex(i,t){return Zr(this,"findIndex",i,t,void 0,arguments)},findLast(i,t){return Zr(this,"findLast",i,t,e=>Or(this,e),arguments)},findLastIndex(i,t){return Zr(this,"findLastIndex",i,t,void 0,arguments)},forEach(i,t){return Zr(this,"forEach",i,t,void 0,arguments)},includes(...i){return ed(this,"includes",i)},indexOf(...i){return ed(this,"indexOf",i)},join(i){return ia(this).join(i)},lastIndexOf(...i){return ed(this,"lastIndexOf",i)},map(i,t){return Zr(this,"map",i,t,void 0,arguments)},pop(){return lo(this,"pop")},push(...i){return lo(this,"push",i)},reduce(i,...t){return Ig(this,"reduce",i,t)},reduceRight(i,...t){return Ig(this,"reduceRight",i,t)},shift(){return lo(this,"shift")},some(i,t){return Zr(this,"some",i,t,void 0,arguments)},splice(...i){return lo(this,"splice",i)},toReversed(){return ia(this).toReversed()},toSorted(i){return ia(this).toSorted(i)},toSpliced(...i){return ia(this).toSpliced(...i)},unshift(...i){return lo(this,"unshift",i)},values(){return td(this,"values",i=>Or(this,i))}};function td(i,t,e){const s=Ic(i),r=s[t]();return s!==i&&!Us(i)&&(r._next=r.next,r.next=()=>{const n=r._next();return n.done||(n.value=e(n.value)),n}),r}const oT=Array.prototype;function Zr(i,t,e,s,r,n){const a=Ic(i),o=a!==i&&!Us(i),h=a[t];if(h!==oT[t]){const u=h.apply(i,n);return o?br(u):u}let l=e;a!==i&&(o?l=function(u,d){return e.call(this,Or(i,u),d,i)}:e.length>2&&(l=function(u,d){return e.call(this,u,d,i)}));const c=h.call(a,l,s);return o&&r?r(c):c}function Ig(i,t,e,s){const r=Ic(i),n=r!==i&&!Us(i);let a=e,o=!1;r!==i&&(n?(o=s.length===0,a=function(l,c,u){return o&&(o=!1,l=Or(i,l)),e.call(this,l,Or(i,c),u,i)}):e.length>3&&(a=function(l,c,u){return e.call(this,l,c,u,i)}));const h=r[t](a,...s);return o?Or(i,h):h}function ed(i,t,e){const s=re(i);ls(s,"iterate",Xo);const r=s[t](...e);return(r===-1||r===!1)&&Mc(e[0])?(e[0]=re(e[0]),s[t](...e)):r}function lo(i,t,e=[]){Si(),ap();const s=re(i)[t].apply(i,e);return op(),Ei(),s}const lT=Qm("__proto__,__v_isRef,__isVue"),Ab=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Xs));function hT(i){Xs(i)||(i=String(i));const t=re(this);return ls(t,"has",i),t.hasOwnProperty(i)}class Cb{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){if(e==="__v_skip")return t.__v_skip;const r=this._isReadonly,n=this._isShallow;if(e==="__v_isReactive")return!r;if(e==="__v_isReadonly")return r;if(e==="__v_isShallow")return n;if(e==="__v_raw")return s===(r?n?bT:Rb:n?Mb:Pb).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=Mt(t);if(!r){let h;if(a&&(h=aT[e]))return h;if(e==="hasOwnProperty")return hT}const o=Reflect.get(t,e,Ce(t)?t:s);if((Xs(e)?Ab.has(e):lT(e))||(r||ls(t,"get",e),n))return o;if(Ce(o)){const h=a&&Sc(e)?o:o.value;return r&&le(h)?Hf(h):h}return le(o)?r?Hf(o):Pc(o):o}}class Ib extends Cb{constructor(t=!1){super(!1,t)}set(t,e,s,r){let n=t[e];const a=Mt(t)&&Sc(e);if(!this._isShallow){const l=Ai(n);if(!Us(s)&&!Ai(s)&&(n=re(n),s=re(s)),!a&&Ce(n)&&!Ce(s))return l||(n.value=s),!0}const o=a?Number(e)<t.length:oe(t,e),h=Reflect.set(t,e,s,Ce(t)?t:r);return t===re(r)&&h&&(o?Xr(s,n)&&hi(t,"set",e,s):hi(t,"add",e,s)),h}deleteProperty(t,e){const s=oe(t,e);t[e];const r=Reflect.deleteProperty(t,e);return r&&s&&hi(t,"delete",e,void 0),r}has(t,e){const s=Reflect.has(t,e);return(!Xs(e)||!Ab.has(e))&&ls(t,"has",e),s}ownKeys(t){return ls(t,"iterate",Mt(t)?"length":Dn),Reflect.ownKeys(t)}}class cT extends Cb{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const uT=new Ib,dT=new cT,fT=new Ib(!0);const $f=i=>i,Ul=i=>Reflect.getPrototypeOf(i);function mT(i,t,e){return function(...s){const r=this.__v_raw,n=re(r),a=Ea(n),o=i==="entries"||i===Symbol.iterator&&a,h=i==="keys"&&a,l=r[i](...s),c=e?$f:t?Na:br;return!t&&ls(n,"iterate",h?Gf:Dn),We(Object.create(l),{next(){const{value:u,done:d}=l.next();return d?{value:u,done:d}:{value:o?[c(u[0]),c(u[1])]:c(u),done:d}}})}}function Xl(i){return function(...t){return i==="delete"?!1:i==="clear"?void 0:this}}function pT(i,t){const e={get(r){const n=this.__v_raw,a=re(n),o=re(r);i||(Xr(r,o)&&ls(a,"get",r),ls(a,"get",o));const{has:h}=Ul(a),l=t?$f:i?Na:br;if(h.call(a,r))return l(n.get(r));if(h.call(a,o))return l(n.get(o));n!==a&&n.get(r)},get size(){const r=this.__v_raw;return!i&&ls(re(r),"iterate",Dn),r.size},has(r){const n=this.__v_raw,a=re(n),o=re(r);return i||(Xr(r,o)&&ls(a,"has",r),ls(a,"has",o)),r===o?n.has(r):n.has(r)||n.has(o)},forEach(r,n){const a=this,o=a.__v_raw,h=re(o),l=t?$f:i?Na:br;return!i&&ls(h,"iterate",Dn),o.forEach((c,u)=>r.call(n,l(c),l(u),a))}};return We(e,i?{add:Xl("add"),set:Xl("set"),delete:Xl("delete"),clear:Xl("clear")}:{add(r){const n=re(this),a=Ul(n),o=re(r),h=!t&&!Us(r)&&!Ai(r)?o:r;return a.has.call(n,h)||Xr(r,h)&&a.has.call(n,r)||Xr(o,h)&&a.has.call(n,o)||(n.add(h),hi(n,"add",h,h)),this},set(r,n){!t&&!Us(n)&&!Ai(n)&&(n=re(n));const a=re(this),{has:o,get:h}=Ul(a);let l=o.call(a,r);l||(r=re(r),l=o.call(a,r));const c=h.call(a,r);return a.set(r,n),l?Xr(n,c)&&hi(a,"set",r,n):hi(a,"add",r,n),this},delete(r){const n=re(this),{has:a,get:o}=Ul(n);let h=a.call(n,r);h||(r=re(r),h=a.call(n,r)),o&&o.call(n,r);const l=n.delete(r);return h&&hi(n,"delete",r,void 0),l},clear(){const r=re(this),n=r.size!==0,a=r.clear();return n&&hi(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{e[r]=mT(r,i,t)}),e}function cp(i,t){const e=pT(i,t);return(s,r,n)=>r==="__v_isReactive"?!i:r==="__v_isReadonly"?i:r==="__v_raw"?s:Reflect.get(oe(e,r)&&r in s?e:s,r,n)}const gT={get:cp(!1,!1)},yT={get:cp(!1,!0)},xT={get:cp(!0,!1)};const Pb=new WeakMap,Mb=new WeakMap,Rb=new WeakMap,bT=new WeakMap;function vT(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Pc(i){return Ai(i)?i:up(i,!1,uT,gT,Pb)}function _T(i){return up(i,!1,fT,yT,Mb)}function Hf(i){return up(i,!0,dT,xT,Rb)}function up(i,t,e,s,r){if(!le(i)||i.__v_raw&&!(t&&i.__v_isReactive)||i.__v_skip||!Object.isExtensible(i))return i;const n=r.get(i);if(n)return n;const a=vT(Hw(i));if(a===0)return i;const o=new Proxy(i,a===2?s:e);return r.set(i,o),o}function vi(i){return Ai(i)?vi(i.__v_raw):!!(i&&i.__v_isReactive)}function Ai(i){return!!(i&&i.__v_isReadonly)}function Us(i){return!!(i&&i.__v_isShallow)}function Mc(i){return i?!!i.__v_raw:!1}function re(i){const t=i&&i.__v_raw;return t?re(t):i}function dp(i){return!oe(i,"__v_skip")&&Object.isExtensible(i)&&db(i,"__v_skip",!0),i}const br=i=>le(i)?Pc(i):i,Na=i=>le(i)?Hf(i):i;function Ce(i){return i?i.__v_isRef===!0:!1}function Fb(i){return kb(i,!1)}function wT(i){return kb(i,!0)}function kb(i,t){return Ce(i)?i:new TT(i,t)}class TT{constructor(t,e){this.dep=new hp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:re(t),this._value=e?t:br(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Us(t)||Ai(t);t=s?t:re(t),Xr(t,e)&&(this._rawValue=t,this._value=s?t:br(t),this.dep.trigger())}}function Lb(i){return Ce(i)?i.value:i}const ST={get:(i,t,e)=>t==="__v_raw"?i:Lb(Reflect.get(i,t,e)),set:(i,t,e,s)=>{const r=i[t];return Ce(r)&&!Ce(e)?(r.value=e,!0):Reflect.set(i,t,e,s)}};function Bb(i){return vi(i)?i:new Proxy(i,ST)}function ET(i){const t=Mt(i)?new Array(i.length):{};for(const e in i)t[e]=CT(i,e);return t}class AT{constructor(t,e,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=Xs(e)?e:String(e),this._raw=re(t);let r=!0,n=t;if(!Mt(t)||Xs(this._key)||!Sc(this._key))do r=!Mc(n)||Us(n);while(r&&(n=n.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=Lb(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ce(this._raw[this._key])){const e=this._object[this._key];if(Ce(e)){e.value=t;return}}this._object[this._key]=t}get dep(){return nT(this._raw,this._key)}}function CT(i,t,e){return new AT(i,t,e)}class IT{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new hp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Uo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return vb(this,!0),!0}get value(){const t=this.dep.track();return Tb(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function PT(i,t,e=!1){let s,r;return Ot(i)?s=i:(s=i.get,r=i.set),new IT(s,r,e)}const Vl={},Mh=new WeakMap;let wn;function MT(i,t=!1,e=wn){if(e){let s=Mh.get(e);s||Mh.set(e,s=[]),s.push(i)}}function RT(i,t,e=ue){const{immediate:s,deep:r,once:n,scheduler:a,augmentJob:o,call:h}=e,l=b=>r?b:Us(b)||r===!1||r===0?ci(b,1):ci(b);let c,u,d,f,m=!1,p=!1;if(Ce(i)?(u=()=>i.value,m=Us(i)):vi(i)?(u=()=>l(i),m=!0):Mt(i)?(p=!0,m=i.some(b=>vi(b)||Us(b)),u=()=>i.map(b=>{if(Ce(b))return b.value;if(vi(b))return l(b);if(Ot(b))return h?h(b,2):b()})):Ot(i)?t?u=h?()=>h(i,2):i:u=()=>{if(d){Si();try{d()}finally{Ei()}}const b=wn;wn=c;try{return h?h(i,3,[f]):i(f)}finally{wn=b}}:u=Gr,t&&r){const b=u,T=r===!0?1/0:r;u=()=>ci(b(),T)}const g=np(),y=()=>{c.stop(),g&&g.active&&tp(g.effects,c)};if(n&&t){const b=t;t=(...T)=>{const S=b(...T);return y(),S}}let _=p?new Array(i.length).fill(Vl):Vl;const v=b=>{if(!(!(c.flags&1)||!c.dirty&&!b))if(t){const T=c.run();if(b||r||m||(p?T.some((S,w)=>Xr(S,_[w])):Xr(T,_))){d&&d();const S=wn;wn=c;try{const w=[T,_===Vl?void 0:p&&_[0]===Vl?[]:_,f];_=T,h?h(t,3,w):t(...w)}finally{wn=S}}}else c.run()};return o&&o(v),c=new xb(u),c.scheduler=a?()=>a(v,!1):v,f=b=>MT(b,!1,c),d=c.onStop=()=>{const b=Mh.get(c);if(b){if(h)h(b,4);else for(const T of b)T();Mh.delete(c)}},t?s?v(!0):_=c.run():a?a(v.bind(null,!0),!0):c.run(),y.pause=c.pause.bind(c),y.resume=c.resume.bind(c),y.stop=y,y}function ci(i,t=1/0,e){if(t<=0||!le(i)||i.__v_skip||(e=e||new Map,(e.get(i)||0)>=t))return i;if(e.set(i,t),t--,Ce(i))ci(i.value,t,e);else if(Mt(i))for(let s=0;s<i.length;s++)ci(i[s],t,e);else if(Za(i)||Ea(i))i.forEach(s=>{ci(s,t,e)});else if(cb(i)){for(const s in i)ci(i[s],t,e);for(const s of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,s)&&ci(i[s],t,e)}return i}/**
|
||
* @vue/runtime-core v3.5.41
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function Tl(i,t,e,s){try{return s?i(...s):i()}catch(r){Rc(r,t,e)}}function tr(i,t,e,s){if(Ot(i)){const r=Tl(i,t,e,s);return r&&lb(r)&&r.catch(n=>{Rc(n,t,e)}),r}if(Mt(i)){const r=[];for(let n=0;n<i.length;n++)r.push(tr(i[n],t,e,s));return r}}function Rc(i,t,e,s=!0){const r=t?t.vnode:null,{errorHandler:n,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||ue;if(t){let o=t.parent;const h=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${e}`;for(;o;){const c=o.ec;if(c){for(let u=0;u<c.length;u++)if(c[u](i,h,l)===!1)return}o=o.parent}if(n){Si(),Tl(n,null,10,[i,h,l]),Ei();return}}FT(i,e,r,s,a)}function FT(i,t,e,s=!0,r=!1){if(r)throw i;console.error(i)}const xs=[];let Rr=-1;const Aa=[];let Gi=null,ha=0;const Ob=Promise.resolve();let Rh=null;function fp(i){const t=Rh||Ob;return i?t.then(this?i.bind(this):i):t}function kT(i){let t=Rr+1,e=xs.length;for(;t<e;){const s=t+e>>>1,r=xs[s],n=Vo(r);n<i||n===i&&r.flags&2?t=s+1:e=s}return t}function mp(i){if(!(i.flags&1)){const t=Vo(i),e=xs[xs.length-1];!e||!(i.flags&2)&&t>=Vo(e)?xs.push(i):xs.splice(kT(t),0,i),i.flags|=1,Db()}}function Db(){Rh||(Rh=Ob.then(Ub))}function LT(i){if(!Mt(i))Gi&&i.id===-1?Gi.splice(ha+1,0,i):i.flags&1||(Aa.push(i),i.flags|=1);else for(let t=0;t<i.length;t++)Aa.push(i[t]);Db()}function Pg(i,t,e=Rr+1){for(;e<xs.length;e++){const s=xs[e];if(s&&s.flags&2){if(i&&s.id!==i.uid)continue;xs.splice(e,1),e--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Nb(i){if(Aa.length){const t=[...new Set(Aa)].sort((e,s)=>Vo(e)-Vo(s));if(Aa.length=0,Gi){for(let e=0;e<t.length;e++)Gi.push(t[e]);return}for(Gi=t,ha=0;ha<Gi.length;ha++){const e=Gi[ha];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Gi=null,ha=0}}const Vo=i=>i.id==null?i.flags&2?-1:1/0:i.id;function Ub(i){try{for(Rr=0;Rr<xs.length;Rr++){const t=xs[Rr];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Tl(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Rr<xs.length;Rr++){const t=xs[Rr];t&&(t.flags&=-2)}Rr=-1,xs.length=0,Nb(),Rh=null,(xs.length||Aa.length)&&Ub()}}let us=null,Xb=null;function Fh(i){const t=us;return us=i,Xb=i&&i.type.__scopeId||null,t}function BT(i,t=us,e){if(!t||i._n)return i;const s=(...r)=>{s._d&&Oh(-1);const n=Fh(t),a=_i.length;let o;try{o=i(...r)}finally{for(let h=_i.length;h>a;h--)wp();Fh(n),s._d&&Oh(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function bL(i,t){if(us===null)return i;const e=Dc(us),s=i.dirs||(i.dirs=[]);for(let r=0;r<t.length;r++){let[n,a,o,h=ue]=t[r];n&&(Ot(n)&&(n={mounted:n,updated:n}),n.deep&&ci(a),s.push({dir:n,instance:e,value:a,oldValue:void 0,arg:o,modifiers:h}))}return i}function pn(i,t,e,s){const r=i.dirs,n=t&&t.dirs;for(let a=0;a<r.length;a++){const o=r[a];n&&(o.oldValue=n[a].value);let h=o.dir[s];h&&(Si(),tr(h,e,8,[i.el,o,i,t]),Ei())}}function OT(i,t){if(vs){let e=vs.provides;const s=vs.parent&&vs.parent.provides;s===e&&(e=vs.provides=Object.create(s)),e[i]=t}}function Ca(i,t,e=!1){const s=Oc();if(s||Nn){let r=Nn?Nn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&i in r)return r[i];if(arguments.length>1)return e&&Ot(t)?t.call(s&&s.proxy):t}}function DT(){return!!(Oc()||Nn)}const NT=Symbol.for("v-scx"),UT=()=>Ca(NT);function vL(i,t){return pp(i,null,t)}function tn(i,t,e){return pp(i,t,e)}function pp(i,t,e=ue){const{immediate:s,deep:r,flush:n,once:a}=e,o=We({},e),h=t&&s||!t&&n!=="post";let l;if(Wo){if(n==="sync"){const f=UT();l=f.__watcherHandles||(f.__watcherHandles=[])}else if(!h){const f=()=>{};return f.stop=Gr,f.resume=Gr,f.pause=Gr,f}}const c=vs;o.call=(f,m,p)=>tr(f,c,m,p);let u=!1;n==="post"?o.scheduler=f=>{ps(f,c&&c.suspense)}:n!=="sync"&&(u=!0,o.scheduler=(f,m)=>{m?f():mp(f)}),o.augmentJob=f=>{t&&(f.flags|=4),u&&(f.flags|=2,c&&(f.id=c.uid,f.i=c))};const d=RT(i,t,o);return Wo&&(l?l.push(d):h&&d()),d}function XT(i,t,e){const s=this.proxy,r=Te(i)?i.includes(".")?Vb(s,i):()=>s[i]:i.bind(s,s);let n;Ot(t)?n=t:(n=t.handler,e=t);const a=El(this),o=pp(r,n.bind(s),e);return a(),o}function Vb(i,t){const e=t.split(".");return()=>{let s=i;for(let r=0;r<e.length&&s;r++)s=s[e[r]];return s}}const Ui=new WeakMap,Yb=Symbol("_vte"),Fc=i=>i.__isTeleport,In=i=>i&&(i.disabled||i.disabled===""),VT=i=>i&&(i.defer||i.defer===""),Mg=i=>typeof SVGElement<"u"&&i instanceof SVGElement,Rg=i=>typeof MathMLElement=="function"&&i instanceof MathMLElement,Wf=(i,t)=>{const e=i&&i.to;return Te(e)?t?t(e):null:e},YT={name:"Teleport",__isTeleport:!0,process(i,t,e,s,r,n,a,o,h,l){const{mc:c,pc:u,pbc:d,o:{insert:f,querySelector:m,createText:p,createComment:g,parentNode:y}}=l,_=In(t.props);let{dynamicChildren:v}=t;const b=(w,E,A)=>{w.shapeFlag&16&&c(w.children,E,A,r,n,a,o,h)},T=(w=t)=>{const E=In(w.props),A=w.target=Wf(w.props,m),P=zf(A,w,p,f);A&&(a!=="svg"&&Mg(A)?a="svg":a!=="mathml"&&Rg(A)&&(a="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(A),E||(b(w,A,P),yo(w,!1)))},S=w=>{const E=()=>{if(Ui.get(w)===E){if(Ui.delete(w),In(w.props)){const A=y(w.el)||e;b(w,A,w.anchor),yo(w,!0)}T(w)}};Ui.set(w,E),ps(E,n)};if(i==null){const w=t.el=p(""),E=t.anchor=p("");if(f(w,e,s),f(E,e,s),VT(t.props)||n&&n.pendingBranch){S(t);return}_&&(b(t,e,E),yo(t,!0)),T()}else{t.el=i.el;const w=t.anchor=i.anchor,E=Ui.get(i);if(E){E.flags|=8,Ui.delete(i),S(t);return}t.targetStart=i.targetStart;const A=t.target=i.target,P=t.targetAnchor=i.targetAnchor,I=In(i.props),C=I?e:A,R=I?w:P;if(a==="svg"||Mg(A)?a="svg":(a==="mathml"||Rg(A))&&(a="mathml"),v?(d(i.dynamicChildren,v,C,r,n,a,o),_p(i,t,!0)):h||u(i,t,C,R,r,n,a,o,!1),_)I?t.props&&i.props&&t.props.to!==i.props.to&&(t.props.to=i.props.to):Yl(t,e,w,l,1);else if((t.props&&t.props.to)!==(i.props&&i.props.to)){const F=Wf(t.props,m);F&&(t.target=F,Yl(t,F,null,l,0))}else I&&Yl(t,A,P,l,1);yo(t,_)}},remove(i,t,e,{um:s,o:{remove:r}},n){const{shapeFlag:a,children:o,anchor:h,targetStart:l,targetAnchor:c,target:u,props:d}=i,f=In(d),m=n||!f,p=Ui.get(i);if(p&&(p.flags|=8,Ui.delete(i)),u&&(r(l),r(c)),n&&r(h),!p&&(f||u)&&a&16)for(let g=0;g<o.length;g++){const y=o[g];s(y,t,e,m,!!y.dynamicChildren)}},move:Yl,hydrate:GT};function Yl(i,t,e,{o:{insert:s},m:r},n=2){n===0&&s(i.targetAnchor,t,e);const{el:a,anchor:o,shapeFlag:h,children:l,props:c}=i,u=n===2;if(u&&s(a,t,e),!Ui.has(i)&&(!u||In(c))&&h&16)for(let d=0;d<l.length;d++)r(l[d],t,e,2);u&&s(o,t,e)}function GT(i,t,e,s,r,n,{o:{nextSibling:a,parentNode:o,querySelector:h,insert:l,createText:c}},u){function d(g,y){let _=y;for(;_;){if(_&&_.nodeType===8){if(_.data==="teleport start anchor")t.targetStart=_;else if(_.data==="teleport anchor"){t.targetAnchor=_,g._lpa=t.targetAnchor&&a(t.targetAnchor);break}}_=a(_)}}function f(g,y){y.anchor=u(a(g),y,o(g),e,s,r,n)}const m=t.target=Wf(t.props,h),p=In(t.props);if(m){const g=m._lpa||m.firstChild;t.shapeFlag&16&&(p?(f(i,t),d(m,g),t.targetAnchor||zf(m,t,c,l,o(i)===m?i:null)):(t.anchor=a(i),d(m,g),t.targetAnchor||zf(m,t,c,l),u(g&&a(g),t,m,e,s,r,n))),yo(t,p)}else p&&t.shapeFlag&16&&(f(i,t),t.targetStart=i,t.targetAnchor=a(i));return t.anchor&&a(t.anchor)}const _L=YT;function yo(i,t){const e=i.ctx;if(e&&e.ut){let s,r;for(t?(s=i.el,r=i.anchor):(s=i.targetStart,r=i.targetAnchor);s&&s!==r;)s.nodeType===1&&s.setAttribute("data-v-owner",e.uid),s=s.nextSibling;e.ut()}}function zf(i,t,e,s,r=null){const n=t.targetStart=e(""),a=t.targetAnchor=e("");return n[Yb]=a,i&&(s(n,i,r),s(a,i,r)),a}const Ws=Symbol("_leaveCb"),ho=Symbol("_enterCb");function $T(){const i={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return yp(()=>{i.isMounted=!0}),Kb(()=>{i.isUnmounting=!0}),i}const Ys=[Function,Array],Gb={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ys,onEnter:Ys,onAfterEnter:Ys,onEnterCancelled:Ys,onBeforeLeave:Ys,onLeave:Ys,onAfterLeave:Ys,onLeaveCancelled:Ys,onBeforeAppear:Ys,onAppear:Ys,onAfterAppear:Ys,onAppearCancelled:Ys},$b=i=>{const t=i.subTree;return t.component?$b(t.component):t},HT={name:"BaseTransition",props:Gb,setup(i,{slots:t}){const e=Oc(),s=$T();return()=>{const r=t.default&&zb(t.default(),!0),n=r&&r.length?Hb(r):e.subTree?kS():void 0;if(!n)return;const a=re(i),{mode:o}=a;if(s.isLeaving)return sd(n);const h=kh(n);if(!h)return sd(n);let l=jf(h,a,s,e,u=>l=u);h.type!==cs&&Yo(h,l);let c=e.subTree&&kh(e.subTree);if(c&&c.type!==cs&&!Pn(c,h)&&$b(e).type!==cs){let u=jf(c,a,s,e);if(Yo(c,u),o==="out-in"&&h.type!==cs)return s.isLeaving=!0,u.afterLeave=()=>{s.isLeaving=!1,e.job.flags&8||e.update(),delete u.afterLeave,c=void 0},sd(n);o==="in-out"&&h.type!==cs?u.delayLeave=(d,f,m)=>{const p=Wb(s,c);p[String(c.key)]=c,d[Ws]=()=>{f(),d[Ws]=void 0,delete l.delayedLeave,c=void 0},l.delayedLeave=()=>{m(),delete l.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return n}}};function Hb(i){let t=i[0];if(i.length>1){for(const e of i)if(e.type!==cs){t=e;break}}return t}const WT=HT;function Wb(i,t){const{leavingVNodes:e}=i;let s=e.get(t.type);return s||(s=Object.create(null),e.set(t.type,s)),s}function jf(i,t,e,s,r){const{appear:n,mode:a,persisted:o=!1,onBeforeEnter:h,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:m,onLeaveCancelled:p,onBeforeAppear:g,onAppear:y,onAfterAppear:_,onAppearCancelled:v}=t,b=String(i.key),T=Wb(e,i),S=(A,P)=>{A&&tr(A,s,9,P)},w=(A,P)=>{const I=P[1];S(A,P),Mt(A)?A.every(C=>C.length<=1)&&I():A.length<=1&&I()},E={mode:a,persisted:o,beforeEnter(A){let P=h;if(!e.isMounted)if(n)P=g||h;else return;A[Ws]&&A[Ws](!0);const I=T[b];I&&Pn(i,I)&&I.el[Ws]&&I.el[Ws](),S(P,[A])},enter(A){if(T[b]===i)return;let P=l,I=c,C=u;if(!e.isMounted)if(n)P=y||l,I=_||c,C=v||u;else return;let R=!1;A[ho]=D=>{R||(R=!0,D?S(C,[A]):S(I,[A]),E.delayedLeave&&E.delayedLeave(),A[ho]=void 0)};const F=A[ho].bind(null,!1);P?w(P,[A,F]):F()},leave(A,P){const I=String(i.key);if(A[ho]&&A[ho](!0),e.isUnmounting)return P();S(d,[A]);let C=!1;A[Ws]=F=>{C||(C=!0,P(),F?S(p,[A]):S(m,[A]),A[Ws]=void 0,T[I]===i&&delete T[I])};const R=A[Ws].bind(null,!1);T[I]=i,f?w(f,[A,R]):R()},clone(A){const P=jf(A,t,e,s,r);return r&&r(P),P}};return E}function sd(i){if(kc(i))return i=sn(i),i.children=null,i}function kh(i){if(!kc(i))return Fc(i.type)&&i.children?Hb(i.children):i;if(i.component)return i.component.subTree;const{shapeFlag:t,children:e}=i;if(e){if(t&16)return e[0];if(t&32&&Ot(e.default))return e.default()}}function Yo(i,t){if(i.shapeFlag&6&&i.component){i.transition=t;const e=i.component.subTree;Yo(Fc(e.type)&&kh(e)||e,t)}else i.shapeFlag&128?(i.ssContent.transition=t.clone(i.ssContent),i.ssFallback.transition=t.clone(i.ssFallback)):i.transition=t}function zb(i,t=!1,e){let s=[],r=0;for(let n=0;n<i.length;n++){let a=i[n];const o=e==null?a.key:String(e)+String(a.key!=null?a.key:n);a.type===bs?(a.patchFlag&128&&r++,s=s.concat(zb(a.children,t,o))):(t||a.type!==cs)&&s.push(o!=null?sn(a,{key:o}):a)}if(r>1)for(let n=0;n<s.length;n++)s[n].patchFlag=-2;return s}function gp(i,t){return Ot(i)?We({name:i.name},t,{setup:i}):i}function jb(i){i.ids=[i.ids[0]+i.ids[2]+++"-",0,0]}function Fg(i,t){let e;return!!((e=Object.getOwnPropertyDescriptor(i,t))&&!e.configurable)}const Lh=new WeakMap;function Ro(i,t,e,s,r=!1){if(Mt(i)){i.forEach((p,g)=>Ro(p,t&&(Mt(t)?t[g]:t),e,s,r));return}if(Ia(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ro(i,t,e,s.component.subTree);return}const n=s.shapeFlag&4?Dc(s.component):s.el,a=r?null:n,{i:o,r:h}=i,l=t&&t.r,c=o.refs===ue?o.refs={}:o.refs,u=o.setupState,d=re(u),f=u===ue?ob:p=>Fg(c,p)?!1:oe(d,p),m=(p,g)=>!(g&&Fg(c,g));if(l!=null&&l!==h){if(kg(t),Te(l))c[l]=null,f(l)&&(u[l]=null);else if(Ce(l)){const p=t;m(l,p.k)&&(l.value=null),p.k&&(c[p.k]=null)}}if(Ot(h))Tl(h,o,12,[a,c]);else{const p=Te(h),g=Ce(h);if(p||g){const y=()=>{if(i.f){const _=p?f(h)?u[h]:c[h]:m()||!i.k?h.value:c[i.k];if(r)Mt(_)&&tp(_,n);else if(Mt(_))_.includes(n)||_.push(n);else if(p)c[h]=[n],f(h)&&(u[h]=c[h]);else{const v=[n];m(h,i.k)&&(h.value=v),i.k&&(c[i.k]=v)}}else p?(c[h]=a,f(h)&&(u[h]=a)):g&&(m(h,i.k)&&(h.value=a),i.k&&(c[i.k]=a))};if(a){const _=()=>{y(),Lh.delete(i)};_.id=-1,Lh.set(i,_),ps(_,e)}else kg(i),y()}}}function kg(i){const t=Lh.get(i);t&&(t.flags|=8,Lh.delete(i))}Cc().requestIdleCallback;Cc().cancelIdleCallback;const Ia=i=>!!i.type.__asyncLoader,kc=i=>i.type.__isKeepAlive;function zT(i,t){qb(i,"a",t)}function jT(i,t){qb(i,"da",t)}function qb(i,t,e=vs){const s=i.__wdc||(i.__wdc=()=>{let r=e;for(;r;){if(r.isDeactivated)return;r=r.parent}return i()});if(Lc(t,s,e),e){let r=e.parent;for(;r&&r.parent;)kc(r.parent.vnode)&&qT(s,t,e,r),r=r.parent}}function qT(i,t,e,s){const r=Lc(t,i,s,!0);xp(()=>{tp(s[t],r)},e)}function Lc(i,t,e=vs,s=!1){if(e){const r=e[i]||(e[i]=[]),n=t.__weh||(t.__weh=(...a)=>{Si();const o=El(e),h=tr(t,e,i,a);return o(),Ei(),h});return s?r.unshift(n):r.push(n),n}}const Ri=i=>(t,e=vs)=>{(!Wo||i==="sp")&&Lc(i,(...s)=>t(...s),e)},KT=Ri("bm"),yp=Ri("m"),ZT=Ri("bu"),JT=Ri("u"),Kb=Ri("bum"),xp=Ri("um"),QT=Ri("sp"),tS=Ri("rtg"),eS=Ri("rtc");function sS(i,t=vs){Lc("ec",i,t)}const rS=Symbol.for("v-ndc");function wL(i,t,e,s){let r;const n=e,a=Mt(i);if(a||Te(i)){const o=a&&vi(i);let h=!1,l=!1;o&&(h=!Us(i),l=Ai(i),i=Ic(i)),r=new Array(i.length);for(let c=0,u=i.length;c<u;c++)r[c]=t(h?l?Na(br(i[c])):br(i[c]):i[c],c,void 0,n)}else if(typeof i=="number"){r=new Array(i);for(let o=0;o<i;o++)r[o]=t(o+1,o,void 0,n)}else if(le(i))if(i[Symbol.iterator])r=Array.from(i,(o,h)=>t(o,h,void 0,n));else{const o=Object.keys(i);r=new Array(o.length);for(let h=0,l=o.length;h<l;h++){const c=o[h];r[h]=t(i[c],c,h,n)}}else r=[];return r}function TL(i,t,e,s,r,n){if(e==null&&(e={}),us.ce||us.parent&&Ia(us.parent)&&us.parent.ce){const l=e,c=Object.keys(l).length>0;return Qf(),tm(bs,null,[ds("slot",l,s)],c?-2:64)}let a=i[t];a&&a._c&&(a._d=!1);const o=_i.length;Qf();let h;try{const l=a&&Zb(a(e)),c=e.key||n||l&&l.key;h=tm(bs,{key:(c&&!Xs(c)?c:`_${t}`)+(!l&&s?"_fb":"")},l||(s?s():[]),l&&i._===1?64:-2)}catch(l){for(let c=_i.length;c>o;c--)wp();throw l}finally{a&&a._c&&(a._d=!0)}return h}function Zb(i){return i.some(t=>$o(t)?!(t.type===cs||t.type===bs&&!Zb(t.children)):!0)?i:null}const qf=i=>i?yv(i)?Dc(i):qf(i.parent):null,Fo=We(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>qf(i.parent),$root:i=>qf(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>Qb(i),$forceUpdate:i=>i.f||(i.f=()=>{mp(i.update)}),$nextTick:i=>i.n||(i.n=fp.bind(i.proxy)),$watch:i=>XT.bind(i)}),rd=(i,t)=>i!==ue&&!i.__isScriptSetup&&oe(i,t),iS={get({_:i},t){if(t==="__v_skip")return!0;const{ctx:e,setupState:s,data:r,props:n,accessCache:a,type:o,appContext:h}=i;if(t[0]!=="$"){const d=a[t];if(d!==void 0)switch(d){case 1:return s[t];case 2:return r[t];case 4:return e[t];case 3:return n[t]}else{if(rd(s,t))return a[t]=1,s[t];if(r!==ue&&oe(r,t))return a[t]=2,r[t];if(oe(n,t))return a[t]=3,n[t];if(e!==ue&&oe(e,t))return a[t]=4,e[t];Kf&&(a[t]=0)}}const l=Fo[t];let c,u;if(l)return t==="$attrs"&&ls(i.attrs,"get",""),l(i);if((c=o.__cssModules)&&(c=c[t]))return c;if(e!==ue&&oe(e,t))return a[t]=4,e[t];if(u=h.config.globalProperties,oe(u,t))return u[t]},set({_:i},t,e){const{data:s,setupState:r,ctx:n}=i;return rd(r,t)?(r[t]=e,!0):s!==ue&&oe(s,t)?(s[t]=e,!0):oe(i.props,t)||t[0]==="$"&&t.slice(1)in i?!1:(n[t]=e,!0)},has({_:{data:i,setupState:t,accessCache:e,ctx:s,appContext:r,props:n,type:a}},o){let h;return!!(e[o]||i!==ue&&o[0]!=="$"&&oe(i,o)||rd(t,o)||oe(n,o)||oe(s,o)||oe(Fo,o)||oe(r.config.globalProperties,o)||(h=a.__cssModules)&&h[o])},defineProperty(i,t,e){return e.get!=null?i._.accessCache[t]=0:oe(e,"value")&&this.set(i,t,e.value,null),Reflect.defineProperty(i,t,e)}};function Lg(i){return Mt(i)?i.reduce((t,e)=>(t[e]=null,t),{}):i}let Kf=!0;function nS(i){const t=Qb(i),e=i.proxy,s=i.ctx;Kf=!1,t.beforeCreate&&Bg(t.beforeCreate,i,"bc");const{data:r,computed:n,methods:a,watch:o,provide:h,inject:l,created:c,beforeMount:u,mounted:d,beforeUpdate:f,updated:m,activated:p,deactivated:g,beforeDestroy:y,beforeUnmount:_,destroyed:v,unmounted:b,render:T,renderTracked:S,renderTriggered:w,errorCaptured:E,serverPrefetch:A,expose:P,inheritAttrs:I,components:C,directives:R,filters:F}=t;if(l&&aS(l,s,null),a)for(const O in a){const k=a[O];Ot(k)&&(s[O]=k.bind(e))}if(r){const O=r.call(e,e);le(O)&&(i.data=Pc(O))}if(Kf=!0,n)for(const O in n){const k=n[O],N=Ot(k)?k.bind(e,e):Ot(k.get)?k.get.bind(e,e):Gr,B=!Ot(k)&&Ot(k.set)?k.set.bind(e):Gr,L=Mn({get:N,set:B});Object.defineProperty(s,O,{enumerable:!0,configurable:!0,get:()=>L.value,set:G=>L.value=G})}if(o)for(const O in o)Jb(o[O],s,e,O);if(h){const O=Ot(h)?h.call(e):h;Reflect.ownKeys(O).forEach(k=>{OT(k,O[k])})}c&&Bg(c,i,"c");function M(O,k){Mt(k)?k.forEach(N=>O(N.bind(e))):k&&O(k.bind(e))}if(M(KT,u),M(yp,d),M(ZT,f),M(JT,m),M(zT,p),M(jT,g),M(sS,E),M(eS,S),M(tS,w),M(Kb,_),M(xp,b),M(QT,A),Mt(P))if(P.length){const O=i.exposed||(i.exposed={});P.forEach(k=>{Object.defineProperty(O,k,{get:()=>e[k],set:N=>e[k]=N,enumerable:!0})})}else i.exposed||(i.exposed={});T&&i.render===Gr&&(i.render=T),I!=null&&(i.inheritAttrs=I),C&&(i.components=C),R&&(i.directives=R),A&&jb(i)}function aS(i,t,e=Gr){Mt(i)&&(i=Zf(i));for(const s in i){const r=i[s];let n;le(r)?"default"in r?n=Ca(r.from||s,r.default,!0):n=Ca(r.from||s):n=Ca(r),Ce(n)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>n.value,set:a=>n.value=a}):t[s]=n}}function Bg(i,t,e){tr(Mt(i)?i.map(s=>s.bind(t.proxy)):i.bind(t.proxy),t,e)}function Jb(i,t,e,s){let r=s.includes(".")?Vb(e,s):()=>e[s];if(Te(i)){const n=t[i];Ot(n)&&tn(r,n)}else if(Ot(i))tn(r,i.bind(e));else if(le(i))if(Mt(i))i.forEach(n=>Jb(n,t,e,s));else{const n=Ot(i.handler)?i.handler.bind(e):t[i.handler];Ot(n)&&tn(r,n,i)}}function Qb(i){const t=i.type,{mixins:e,extends:s}=t,{mixins:r,optionsCache:n,config:{optionMergeStrategies:a}}=i.appContext,o=n.get(t);let h;return o?h=o:!r.length&&!e&&!s?h=t:(h={},r.length&&r.forEach(l=>Bh(h,l,a,!0)),Bh(h,t,a)),le(t)&&n.set(t,h),h}function Bh(i,t,e,s=!1){const{mixins:r,extends:n}=t;n&&Bh(i,n,e,!0),r&&r.forEach(a=>Bh(i,a,e,!0));for(const a in t)if(!(s&&a==="expose")){const o=oS[a]||e&&e[a];i[a]=o?o(i[a],t[a]):t[a]}return i}const oS={data:Og,props:Dg,emits:Dg,methods:xo,computed:xo,beforeCreate:ms,created:ms,beforeMount:ms,mounted:ms,beforeUpdate:ms,updated:ms,beforeDestroy:ms,beforeUnmount:ms,destroyed:ms,unmounted:ms,activated:ms,deactivated:ms,errorCaptured:ms,serverPrefetch:ms,components:xo,directives:xo,watch:hS,provide:Og,inject:lS};function Og(i,t){return t?i?function(){return We(Ot(i)?i.call(this,this):i,Ot(t)?t.call(this,this):t)}:t:i}function lS(i,t){return xo(Zf(i),Zf(t))}function Zf(i){if(Mt(i)){const t={};for(let e=0;e<i.length;e++)t[i[e]]=i[e];return t}return i}function ms(i,t){return i?[...new Set([].concat(i,t))]:t}function xo(i,t){return i?We(Object.create(null),i,t):t}function Dg(i,t){return i?Mt(i)&&Mt(t)?[...new Set([...i,...t])]:We(Object.create(null),Lg(i),Lg(t??{})):t}function hS(i,t){if(!i)return t;if(!t)return i;const e=We(Object.create(null),i);for(const s in t)e[s]=ms(i[s],t[s]);return e}function tv(){return{app:null,config:{isNativeTag:ob,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let cS=0;function uS(i,t){return function(s,r=null){Ot(s)||(s=We({},s)),r!=null&&!le(r)&&(r=null);const n=tv(),a=new WeakSet,o=[];let h=!1;const l=n.app={_uid:cS++,_component:s,_props:r,_container:null,_context:n,_instance:null,version:GS,get config(){return n.config},set config(c){},use(c,...u){return a.has(c)||(c&&Ot(c.install)?(a.add(c),c.install(l,...u)):Ot(c)&&(a.add(c),c(l,...u))),l},mixin(c){return n.mixins.includes(c)||n.mixins.push(c),l},component(c,u){return u?(n.components[c]=u,l):n.components[c]},directive(c,u){return u?(n.directives[c]=u,l):n.directives[c]},mount(c,u,d){if(!h){const f=l._ceVNode||ds(s,r);return f.appContext=n,d===!0?d="svg":d===!1&&(d=void 0),i(f,c,d),h=!0,l._container=c,c.__vue_app__=l,Dc(f.component)}},onUnmount(c){o.push(c)},unmount(){h&&(tr(o,l._instance,16),i(null,l._container),delete l._container.__vue_app__)},provide(c,u){return n.provides[c]=u,l},runWithContext(c){const u=Nn;Nn=l;try{return c()}finally{Nn=u}}};return l}}let Nn=null;const dS=(i,t)=>t==="modelValue"||t==="model-value"?i.modelModifiers:i[`${t}Modifiers`]||i[`${mr(t)}Modifiers`]||i[`${ln(t)}Modifiers`];function fS(i,t,...e){if(i.isUnmounted)return;const s=i.vnode.props||ue;let r=e;const n=t.startsWith("update:"),a=n&&dS(s,t.slice(7));a&&(a.trim&&(r=e.map(c=>Te(c)?c.trim():c)),a.number&&(r=e.map(Ac)));let o,h=s[o=Zu(t)]||s[o=Zu(mr(t))];!h&&n&&(h=s[o=Zu(ln(t))]),h&&tr(h,i,6,r);const l=s[o+"Once"];if(l){if(!i.emitted)i.emitted={};else if(i.emitted[o])return;i.emitted[o]=!0,tr(l,i,6,r)}}const mS=new WeakMap;function ev(i,t,e=!1){const s=e?mS:t.emitsCache,r=s.get(i);if(r!==void 0)return r;const n=i.emits;let a={},o=!1;if(!Ot(i)){const h=l=>{const c=ev(l,t,!0);c&&(o=!0,We(a,c))};!e&&t.mixins.length&&t.mixins.forEach(h),i.extends&&h(i.extends),i.mixins&&i.mixins.forEach(h)}return!n&&!o?(le(i)&&s.set(i,null),null):(Mt(n)?n.forEach(h=>a[h]=null):We(a,n),le(i)&&s.set(i,a),a)}function Bc(i,t){return!i||!wc(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),oe(i,t[0].toLowerCase()+t.slice(1))||oe(i,ln(t))||oe(i,t))}function Ng(i){const{type:t,vnode:e,proxy:s,withProxy:r,propsOptions:[n],slots:a,attrs:o,emit:h,render:l,renderCache:c,props:u,data:d,setupState:f,ctx:m,inheritAttrs:p}=i,g=Fh(i);let y,_;try{if(e.shapeFlag&4){const b=r||s,T=b;y=Dr(l.call(T,b,c,u,f,d,m)),_=o}else{const b=t;y=Dr(b.length>1?b(u,{attrs:o,slots:a,emit:h}):b(u,null)),_=t.props?o:pS(o)}}catch(b){_i.length=0,Rc(b,i,1),y=ds(cs)}let v=y;if(_&&p!==!1){const b=Object.keys(_),{shapeFlag:T}=v;b.length&&T&7&&(n&&b.some(Tc)&&(_=gS(_,n)),v=sn(v,_,!1,!0))}if(e.dirs&&(v=sn(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(e.dirs):e.dirs),e.transition){const b=Fc(v.type)&&kh(v)||v;Yo(b,e.transition)}return y=v,Fh(g),y}const pS=i=>{let t;for(const e in i)(e==="class"||e==="style"||wc(e))&&((t||(t={}))[e]=i[e]);return t},gS=(i,t)=>{const e={};for(const s in i)(!Tc(s)||!(s.slice(9)in t))&&(e[s]=i[s]);return e};function yS(i,t,e){const{props:s,children:r,component:n}=i,{props:a,children:o,patchFlag:h}=t,l=n.emitsOptions;if(t.dirs||t.transition)return!0;if(e&&h>=0){if(h&1024)return!0;if(h&16)return s?Ug(s,a,l):!!a;if(h&8){const c=t.dynamicProps;for(let u=0;u<c.length;u++){const d=c[u];if(sv(a,s,d)&&!Bc(l,d))return!0}}}else return(r||o)&&(!o||!o.$stable)?!0:s===a?!1:s?a?Ug(s,a,l):!0:!!a;return!1}function Ug(i,t,e){const s=Object.keys(t);if(s.length!==Object.keys(i).length)return!0;for(let r=0;r<s.length;r++){const n=s[r];if(sv(t,i,n)&&!Bc(e,n))return!0}return!1}function sv(i,t,e){const s=i[e],r=t[e];return e==="style"&&le(s)&&le(r)?!Ja(s,r):s!==r}function xS({vnode:i,parent:t,suspense:e},s){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===i&&(r.suspense.vnode.el=r.el=s,i=r),r===i)(i=t.vnode).el=s,t=t.parent;else break}e&&e.activeBranch===i&&(e.vnode.el=s)}const rv={},iv=()=>Object.create(rv),nv=i=>Object.getPrototypeOf(i)===rv;function bS(i,t,e,s=!1){const r={},n=iv();i.propsDefaults=Object.create(null),av(i,t,r,n);for(const a in i.propsOptions[0])a in r||(r[a]=void 0);e?i.props=s?r:_T(r):i.type.props?i.props=r:i.props=n,i.attrs=n}function vS(i,t,e,s){const{props:r,attrs:n,vnode:{patchFlag:a}}=i,o=re(r),[h]=i.propsOptions;let l=!1;if((s||a>0)&&!(a&16)){if(a&8){const c=i.vnode.dynamicProps;for(let u=0;u<c.length;u++){let d=c[u];if(Bc(i.emitsOptions,d))continue;const f=t[d];if(h)if(oe(n,d))f!==n[d]&&(n[d]=f,l=!0);else{const m=mr(d);r[m]=Jf(h,o,m,f,i,!1)}else f!==n[d]&&(n[d]=f,l=!0)}}}else{av(i,t,r,n)&&(l=!0);let c;for(const u in o)(!t||!oe(t,u)&&((c=ln(u))===u||!oe(t,c)))&&(h?e&&(e[u]!==void 0||e[c]!==void 0)&&(r[u]=Jf(h,o,u,void 0,i,!0)):delete r[u]);if(n!==o)for(const u in n)(!t||!oe(t,u))&&(delete n[u],l=!0)}l&&hi(i.attrs,"set","")}function av(i,t,e,s){const[r,n]=i.propsOptions;let a=!1,o;if(t)for(let h in t){if(Io(h))continue;const l=t[h];let c;r&&oe(r,c=mr(h))?!n||!n.includes(c)?e[c]=l:(o||(o={}))[c]=l:Bc(i.emitsOptions,h)||(!(h in s)||l!==s[h])&&(s[h]=l,a=!0)}if(n){const h=re(e),l=o||ue;for(let c=0;c<n.length;c++){const u=n[c];e[u]=Jf(r,h,u,l[u],i,!oe(l,u))}}return a}function Jf(i,t,e,s,r,n){const a=i[e];if(a!=null){const o=oe(a,"default");if(o&&s===void 0){const h=a.default;if(a.type!==Function&&!a.skipFactory&&Ot(h)){const{propsDefaults:l}=r;if(e in l)s=l[e];else{const c=El(r);s=l[e]=h.call(null,t),c()}}else s=h;r.ce&&r.ce._setProp(e,s)}a[0]&&(n&&!o?s=!1:a[1]&&(s===""||s===ln(e))&&(s=!0))}return s}const _S=new WeakMap;function ov(i,t,e=!1){const s=e?_S:t.propsCache,r=s.get(i);if(r)return r;const n=i.props,a={},o=[];let h=!1;if(!Ot(i)){const c=u=>{h=!0;const[d,f]=ov(u,t,!0);We(a,d),f&&o.push(...f)};!e&&t.mixins.length&&t.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}if(!n&&!h)return le(i)&&s.set(i,Sa),Sa;if(Mt(n))for(let c=0;c<n.length;c++){const u=mr(n[c]);Xg(u)&&(a[u]=ue)}else if(n)for(const c in n){const u=mr(c);if(Xg(u)){const d=n[c],f=a[u]=Mt(d)||Ot(d)?{type:d}:We({},d),m=f.type;let p=!1,g=!0;if(Mt(m))for(let y=0;y<m.length;++y){const _=m[y],v=Ot(_)&&_.name;if(v==="Boolean"){p=!0;break}else v==="String"&&(g=!1)}else p=Ot(m)&&m.name==="Boolean";f[0]=p,f[1]=g,(p||oe(f,"default"))&&o.push(u)}}const l=[a,o];return le(i)&&s.set(i,l),l}function Xg(i){return i[0]!=="$"&&!Io(i)}const bp=i=>i==="_"||i==="_ctx"||i==="$stable",vp=i=>Mt(i)?i.map(Dr):[Dr(i)],wS=(i,t,e)=>{if(t._n)return t;const s=BT((...r)=>vp(t(...r)),e);return s._c=!1,s},lv=(i,t,e)=>{const s=i._ctx;for(const r in i){if(bp(r))continue;const n=i[r];if(Ot(n))t[r]=wS(r,n,s);else if(n!=null){const a=vp(n);t[r]=()=>a}}},hv=(i,t)=>{const e=vp(t);i.slots.default=()=>e},cv=(i,t,e)=>{for(const s in t)(e||!bp(s))&&(i[s]=t[s])},TS=(i,t,e)=>{const s=i.slots=iv();if(i.vnode.shapeFlag&32){const r=t._;r?(cv(s,t,e),e&&db(s,"_",r,!0)):lv(t,s)}else t&&hv(i,t)},SS=(i,t,e)=>{const{vnode:s,slots:r}=i;let n=!0,a=ue;if(s.shapeFlag&32){const o=t._;o?e&&o===1?n=!1:cv(r,t,e):(n=!t.$stable,lv(t,r)),a=t}else t&&(hv(i,t),a={default:1});if(n)for(const o in r)!bp(o)&&a[o]==null&&delete r[o]},ps=PS;function ES(i){return AS(i)}function AS(i,t){const e=Cc();e.__VUE__=!0;const{insert:s,remove:r,patchProp:n,createElement:a,createText:o,createComment:h,setText:l,setElementText:c,parentNode:u,nextSibling:d,setScopeId:f=Gr,insertStaticContent:m}=i,p=(X,$,K,J=null,Q=null,it=null,U=void 0,Y=null,W=!!$.dynamicChildren)=>{if(X===$)return;X&&!Pn(X,$)&&(J=et(X),G(X,Q,it,!0),X=null),$.patchFlag===-2&&(W=!1,$.dynamicChildren=null);const{type:j,ref:mt,shapeFlag:ut}=$;switch(j){case Sl:g(X,$,K,J);break;case cs:y(X,$,K,J);break;case xh:X==null&&_($,K,J,U);break;case bs:C(X,$,K,J,Q,it,U,Y,W);break;default:ut&1?T(X,$,K,J,Q,it,U,Y,W):ut&6?R(X,$,K,J,Q,it,U,Y,W):(ut&64||ut&128)&&j.process(X,$,K,J,Q,it,U,Y,W,rt)}mt!=null&&Q?Ro(mt,X&&X.ref,it,$||X,!$):mt==null&&X&&X.ref!=null&&Ro(X.ref,null,it,X,!0)},g=(X,$,K,J)=>{if(X==null)s($.el=o($.children),K,J);else{const Q=$.el=X.el;$.children!==X.children&&l(Q,$.children)}},y=(X,$,K,J)=>{X==null?s($.el=h($.children||""),K,J):$.el=X.el},_=(X,$,K,J)=>{[X.el,X.anchor]=m(X.children,$,K,J,X.el,X.anchor)},v=({el:X,anchor:$},K,J)=>{let Q;for(;X&&X!==$;)Q=d(X),s(X,K,J),X=Q;s($,K,J)},b=({el:X,anchor:$})=>{let K;for(;X&&X!==$;)K=d(X),r(X),X=K;r($)},T=(X,$,K,J,Q,it,U,Y,W)=>{if($.type==="svg"?U="svg":$.type==="math"&&(U="mathml"),X==null)S($,K,J,Q,it,U,Y,W);else{const j=X.el&&X.el._isVueCE?X.el:null;try{j&&j._beginPatch(),A(X,$,Q,it,U,Y,W)}finally{j&&j._endPatch()}}},S=(X,$,K,J,Q,it,U,Y)=>{let W,j;const{props:mt,shapeFlag:ut,transition:vt,dirs:Rt}=X;if(W=X.el=a(X.type,it,mt&&mt.is,mt),ut&8?c(W,X.children):ut&16&&E(X.children,W,null,J,Q,id(X,it),U,Y),Rt&&pn(X,null,J,"created"),w(W,X,X.scopeId,U,J),mt){for(const st in mt)st!=="value"&&!Io(st)&&n(W,st,null,mt[st],it,J);"value"in mt&&n(W,"value",null,mt.value,it),(j=mt.onVnodeBeforeMount)&&Tr(j,J,X)}Rt&&pn(X,null,J,"beforeMount");const Pt=CS(Q,vt);Pt&&vt.beforeEnter(W),s(W,$,K),((j=mt&&mt.onVnodeMounted)||Pt||Rt)&&ps(()=>{try{j&&Tr(j,J,X),Pt&&vt.enter(W),Rt&&pn(X,null,J,"mounted")}finally{}},Q)},w=(X,$,K,J,Q)=>{if(K&&f(X,K),J)for(let it=0;it<J.length;it++)f(X,J[it]);if(Q){let it=Q.subTree;if($===it||fv(it.type)&&(it.ssContent===$||it.ssFallback===$)){const U=Q.vnode;w(X,U,U.scopeId,U.slotScopeIds,Q.parent)}}},E=(X,$,K,J,Q,it,U,Y,W=0)=>{for(let j=W;j<X.length;j++){const mt=X[j]=Y?oi(X[j]):Dr(X[j]);p(null,mt,$,K,J,Q,it,U,Y)}},A=(X,$,K,J,Q,it,U)=>{const Y=$.el=X.el;let{patchFlag:W,dynamicChildren:j,dirs:mt}=$;W|=X.patchFlag&16;const ut=X.props||ue,vt=$.props||ue;let Rt;if(K&&gn(K,!1),(Rt=vt.onVnodeBeforeUpdate)&&Tr(Rt,K,$,X),mt&&pn($,X,K,"beforeUpdate"),K&&gn(K,!0),j&&(!X.dynamicChildren||X.dynamicChildren.length!==j.length)&&(W=0,U=!1,j=null),(ut.innerHTML&&vt.innerHTML==null||ut.textContent&&vt.textContent==null)&&c(Y,""),j?P(X.dynamicChildren,j,Y,K,J,id($,Q),it):U||k(X,$,Y,null,K,J,id($,Q),it,!1),W>0){if(W&16)I(Y,ut,vt,K,Q);else if(W&2&&ut.class!==vt.class&&n(Y,"class",null,vt.class,Q),W&4&&n(Y,"style",ut.style,vt.style,Q),W&8){const Pt=$.dynamicProps;for(let st=0;st<Pt.length;st++){const lt=Pt[st],kt=ut[lt],Xt=vt[lt];(Xt!==kt||lt==="value")&&n(Y,lt,kt,Xt,Q,K)}}W&1&&X.children!==$.children&&c(Y,$.children)}else!U&&j==null&&I(Y,ut,vt,K,Q);((Rt=vt.onVnodeUpdated)||mt)&&ps(()=>{Rt&&Tr(Rt,K,$,X),mt&&pn($,X,K,"updated")},J)},P=(X,$,K,J,Q,it,U)=>{for(let Y=0;Y<$.length;Y++){const W=X[Y],j=$[Y],mt=W.el&&(W.type===bs||!Pn(W,j)||W.shapeFlag&198)?u(W.el):K;p(W,j,mt,null,J,Q,it,U,!0)}},I=(X,$,K,J,Q)=>{if($!==K){if($!==ue)for(const it in $)!Io(it)&&!(it in K)&&n(X,it,$[it],null,Q,J);for(const it in K){if(Io(it))continue;const U=K[it],Y=$[it];U!==Y&&it!=="value"&&n(X,it,Y,U,Q,J)}"value"in K&&n(X,"value",$.value,K.value,Q)}},C=(X,$,K,J,Q,it,U,Y,W)=>{const j=$.el=X?X.el:o(""),mt=$.anchor=X?X.anchor:o("");let{patchFlag:ut,dynamicChildren:vt,slotScopeIds:Rt}=$;Rt&&(Y=Y?Y.concat(Rt):Rt),X==null?(s(j,K,J),s(mt,K,J),E($.children||[],K,mt,Q,it,U,Y,W)):ut>0&&ut&64&&vt&&X.dynamicChildren&&X.dynamicChildren.length===vt.length?(P(X.dynamicChildren,vt,K,Q,it,U,Y),($.key!=null||Q&&$===Q.subTree)&&_p(X,$,!0)):k(X,$,K,mt,Q,it,U,Y,W)},R=(X,$,K,J,Q,it,U,Y,W)=>{$.slotScopeIds=Y,X==null?$.shapeFlag&512?Q.ctx.activate($,K,J,U,W):F($,K,J,Q,it,U,W):D(X,$,W)},F=(X,$,K,J,Q,it,U)=>{const Y=X.component=DS(X,J,Q);if(kc(X)&&(Y.ctx.renderer=rt),NS(Y,!1,U),Y.asyncDep){if(Q&&Q.registerDep(Y,M,U),!X.el){const W=Y.subTree=ds(cs);y(null,W,$,K),X.placeholder=W.el}}else M(Y,X,$,K,Q,it,U)},D=(X,$,K)=>{const J=$.component=X.component;if(yS(X,$,K))if(J.asyncDep&&!J.asyncResolved){O(J,$,K);return}else J.next=$,J.update();else $.el=X.el,J.vnode=$},M=(X,$,K,J,Q,it,U)=>{const Y=()=>{if(X.isMounted){let{next:ut,bu:vt,u:Rt,parent:Pt,vnode:st}=X;{const Ss=uv(X);if(Ss){ut&&(ut.el=st.el,O(X,ut,U)),Ss.asyncDep.then(()=>{ps(()=>{X.isUnmounted||j()},Q)});return}}let lt=ut,kt;gn(X,!1),ut?(ut.el=st.el,O(X,ut,U)):ut=st,vt&&yh(vt),(kt=ut.props&&ut.props.onVnodeBeforeUpdate)&&Tr(kt,Pt,ut,st),gn(X,!0);const Xt=Ng(X),Pe=X.subTree;X.subTree=Xt,p(Pe,Xt,u(Pe.el),et(Pe),X,Q,it),ut.el=Xt.el,lt===null&&xS(X,Xt.el),Rt&&ps(Rt,Q),(kt=ut.props&&ut.props.onVnodeUpdated)&&ps(()=>Tr(kt,Pt,ut,st),Q)}else{let ut;const{el:vt,props:Rt}=$,{bm:Pt,m:st,parent:lt,root:kt,type:Xt}=X,Pe=Ia($);gn(X,!1),Pt&&yh(Pt),!Pe&&(ut=Rt&&Rt.onVnodeBeforeMount)&&Tr(ut,lt,$),gn(X,!0);{kt.ce&&kt.ce._hasShadowRoot()&&kt.ce._injectChildStyle(Xt,X.parent?X.parent.type:void 0);const Ss=X.subTree=Ng(X);p(null,Ss,K,J,X,Q,it),$.el=Ss.el}if(st&&ps(st,Q),!Pe&&(ut=Rt&&Rt.onVnodeMounted)){const Ss=$;ps(()=>Tr(ut,lt,Ss),Q)}($.shapeFlag&256||lt&&Ia(lt.vnode)&<.vnode.shapeFlag&256)&&X.a&&ps(X.a,Q),X.isMounted=!0,$=K=J=null}};X.scope.on();const W=X.effect=new xb(Y);X.scope.off();const j=X.update=W.run.bind(W),mt=X.job=W.runIfDirty.bind(W);mt.i=X,mt.id=X.uid,W.scheduler=()=>mp(mt),gn(X,!0),j()},O=(X,$,K)=>{$.component=X;const J=X.vnode.props;X.vnode=$,X.next=null,vS(X,$.props,J,K),SS(X,$.children,K),Si(),Pg(X),Ei()},k=(X,$,K,J,Q,it,U,Y,W=!1)=>{const j=X&&X.children,mt=X?X.shapeFlag:0,ut=$.children,{patchFlag:vt,shapeFlag:Rt}=$;if(vt>0){if(vt&128){B(j,ut,K,J,Q,it,U,Y,W);return}else if(vt&256){N(j,ut,K,J,Q,it,U,Y,W);return}}Rt&8?(mt&16&&at(j,Q,it),ut!==j&&c(K,ut)):mt&16?Rt&16?B(j,ut,K,J,Q,it,U,Y,W):at(j,Q,it,!0):(mt&8&&c(K,""),Rt&16&&E(ut,K,J,Q,it,U,Y,W))},N=(X,$,K,J,Q,it,U,Y,W)=>{X=X||Sa,$=$||Sa;const j=X.length,mt=$.length,ut=Math.min(j,mt);let vt;for(vt=0;vt<ut;vt++){const Rt=$[vt]=W?oi($[vt]):Dr($[vt]);p(X[vt],Rt,K,null,Q,it,U,Y,W)}j>mt?at(X,Q,it,!0,!1,ut):E($,K,J,Q,it,U,Y,W,ut)},B=(X,$,K,J,Q,it,U,Y,W)=>{let j=0;const mt=$.length;let ut=X.length-1,vt=mt-1;for(;j<=ut&&j<=vt;){const Rt=X[j],Pt=$[j]=W?oi($[j]):Dr($[j]);if(Pn(Rt,Pt))p(Rt,Pt,K,null,Q,it,U,Y,W);else break;j++}for(;j<=ut&&j<=vt;){const Rt=X[ut],Pt=$[vt]=W?oi($[vt]):Dr($[vt]);if(Pn(Rt,Pt))p(Rt,Pt,K,null,Q,it,U,Y,W);else break;ut--,vt--}if(j>ut){if(j<=vt){const Rt=vt+1,Pt=Rt<mt?$[Rt].el:J;for(;j<=vt;)p(null,$[j]=W?oi($[j]):Dr($[j]),K,Pt,Q,it,U,Y,W),j++}}else if(j>vt)for(;j<=ut;)G(X[j],Q,it,!0),j++;else{const Rt=j,Pt=j,st=new Map;for(j=Pt;j<=vt;j++){const Xe=$[j]=W?oi($[j]):Dr($[j]);Xe.key!=null&&st.set(Xe.key,j)}let lt,kt=0;const Xt=vt-Pt+1;let Pe=!1,Ss=0;const Es=new Array(Xt);for(j=0;j<Xt;j++)Es[j]=0;for(j=Rt;j<=ut;j++){const Xe=X[j];if(kt>=Xt){G(Xe,Q,it,!0);continue}let tt;if(Xe.key!=null)tt=st.get(Xe.key);else for(lt=Pt;lt<=vt;lt++)if(Es[lt-Pt]===0&&Pn(Xe,$[lt])){tt=lt;break}tt===void 0?G(Xe,Q,it,!0):(Es[tt-Pt]=j+1,tt>=Ss?Ss=tt:Pe=!0,p(Xe,$[tt],K,null,Q,it,U,Y,W),kt++)}const Li=Pe?IS(Es):Sa;for(lt=Li.length-1,j=Xt-1;j>=0;j--){const Xe=Pt+j,tt=$[Xe],nt=$[Xe+1],ee=Xe+1<mt?nt.el||dv(nt):J;Es[j]===0?p(null,tt,K,ee,Q,it,U,Y,W):Pe&&(lt<0||j!==Li[lt]?L(tt,K,ee,2):lt--)}}},L=(X,$,K,J,Q=null)=>{const{el:it,type:U,transition:Y,children:W,shapeFlag:j}=X;if(j&6){L(X.component.subTree,$,K,J);return}if(j&128){X.suspense.move($,K,J);return}if(j&64){U.move(X,$,K,rt);return}if(U===bs){s(it,$,K);for(let ut=0;ut<W.length;ut++)L(W[ut],$,K,J);s(X.anchor,$,K);return}if(U===xh){v(X,$,K);return}if(J!==2&&j&1&&Y)if(J===0)Y.persisted&&!it[Ws]?s(it,$,K):(Y.beforeEnter(it),s(it,$,K),ps(()=>Y.enter(it),Q));else{const{leave:ut,delayLeave:vt,afterLeave:Rt}=Y,Pt=()=>{X.ctx.isUnmounted?r(it):s(it,$,K)},st=()=>{const lt=it._isLeaving||!!it[Ws];it._isLeaving&&it[Ws](!0),Y.persisted&&!lt?Pt():ut(it,()=>{Pt(),Rt&&Rt()})};vt?vt(it,Pt,st):st()}else s(it,$,K)},G=(X,$,K,J=!1,Q=!1)=>{const{type:it,props:U,ref:Y,children:W,dynamicChildren:j,shapeFlag:mt,patchFlag:ut,dirs:vt,cacheIndex:Rt,memo:Pt}=X;if(ut===-2&&(Q=!1),Y!=null&&(Si(),Ro(Y,null,K,X,!0),Ei()),Rt!=null&&($.renderCache[Rt]=void 0),mt&256){$.ctx.deactivate(X);return}const st=mt&1&&vt,lt=!Ia(X);let kt;if(lt&&(kt=U&&U.onVnodeBeforeUnmount)&&Tr(kt,$,X),mt&6)H(X.component,K,J);else{if(mt&128){X.suspense.unmount(K,J);return}st&&pn(X,null,$,"beforeUnmount"),mt&64?X.type.remove(X,$,K,rt,J):j&&!j.hasOnce&&(it!==bs||ut>0&&ut&64)?at(j,$,K,!1,!0):(it===bs&&ut&384||!Q&&mt&16)&&at(W,$,K),J&&V(X)}const Xt=Pt!=null&&Rt==null;(lt&&(kt=U&&U.onVnodeUnmounted)||st||Xt)&&ps(()=>{kt&&Tr(kt,$,X),st&&pn(X,null,$,"unmounted"),Xt&&(X.el=null)},K)},V=X=>{const{type:$,el:K,anchor:J,transition:Q}=X;if($===bs){q(K,J);return}if($===xh){b(X);return}const it=()=>{r(K),Q&&!Q.persisted&&Q.afterLeave&&Q.afterLeave()};if(X.shapeFlag&1&&Q&&!Q.persisted){const{leave:U,delayLeave:Y}=Q,W=()=>U(K,it);Y?Y(X.el,it,W):W()}else it()},q=(X,$)=>{let K;for(;X!==$;)K=d(X),r(X),X=K;r($)},H=(X,$,K)=>{const{bum:J,scope:Q,job:it,subTree:U,um:Y,m:W,a:j}=X;Vg(W),Vg(j),J&&yh(J),Q.stop(),it&&(it.flags|=8,G(U,X,$,K)),Y&&ps(Y,$),ps(()=>{X.isUnmounted=!0},$)},at=(X,$,K,J=!1,Q=!1,it=0)=>{for(let U=it;U<X.length;U++)G(X[U],$,K,J,Q)},et=X=>{if(X.shapeFlag&6)return et(X.component.subTree);if(X.shapeFlag&128)return X.suspense.next();const $=d(X.anchor||X.el),K=$&&$[Yb];return K?d(K):$};let ot=!1;const ct=(X,$,K)=>{let J;X==null?$._vnode&&(G($._vnode,null,null,!0),J=$._vnode.component):p($._vnode||null,X,$,null,null,null,K),$._vnode=X,ot||(ot=!0,Pg(J),Nb(),ot=!1)},rt={p,um:G,m:L,r:V,mt:F,mc:E,pc:k,pbc:P,n:et,o:i};return{render:ct,hydrate:void 0,createApp:uS(ct)}}function id({type:i,props:t},e){return e==="svg"&&i==="foreignObject"||e==="mathml"&&i==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:e}function gn({effect:i,job:t},e){e?(i.flags|=32,t.flags|=4):(i.flags&=-33,t.flags&=-5)}function CS(i,t){return(!i||i&&!i.pendingBranch)&&t&&!t.persisted}function _p(i,t,e=!1){const s=i.children,r=t.children;if(Mt(s)&&Mt(r))for(let n=0;n<s.length;n++){const a=s[n];let o=r[n];o.shapeFlag&1&&!o.dynamicChildren&&((o.patchFlag<=0||o.patchFlag===32)&&(o=r[n]=oi(r[n]),o.el=a.el),!e&&o.patchFlag!==-2&&_p(a,o)),o.type===Sl&&(o.patchFlag===-1&&(o=r[n]=oi(o)),o.el=a.el),o.type===cs&&!o.el&&(o.el=a.el)}}function IS(i){const t=i.slice(),e=[0];let s,r,n,a,o;const h=i.length;for(s=0;s<h;s++){const l=i[s];if(l!==0){if(r=e[e.length-1],i[r]<l){t[s]=r,e.push(s);continue}for(n=0,a=e.length-1;n<a;)o=n+a>>1,i[e[o]]<l?n=o+1:a=o;l<i[e[n]]&&(n>0&&(t[s]=e[n-1]),e[n]=s)}}for(n=e.length,a=e[n-1];n-- >0;)e[n]=a,a=t[a];return e}function uv(i){const t=i.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:uv(t)}function Vg(i){if(i)for(let t=0;t<i.length;t++)i[t].flags|=8}function dv(i){if(i.placeholder)return i.placeholder;const t=i.component;return t?dv(t.subTree):null}const fv=i=>i.__isSuspense;function PS(i,t){t&&t.pendingBranch?Mt(i)?t.effects.push(...i):t.effects.push(i):LT(i)}const bs=Symbol.for("v-fgt"),Sl=Symbol.for("v-txt"),cs=Symbol.for("v-cmt"),xh=Symbol.for("v-stc"),_i=[];let Ds=null;function Qf(i=!1){_i.push(Ds=i?null:[])}function wp(){_i.pop(),Ds=_i[_i.length-1]||null}let Go=1;function Oh(i,t=!1){Go+=i,i<0&&Ds&&t&&(Ds.hasOnce=!0)}function mv(i){return i.dynamicChildren=Go>0?Ds||Sa:null,wp(),Go>0&&Ds&&Ds.push(i),i}function SL(i,t,e,s,r,n){return mv(gv(i,t,e,s,r,n,!0))}function tm(i,t,e,s,r){return mv(ds(i,t,e,s,r,!0))}function $o(i){return i?i.__v_isVNode===!0:!1}function Pn(i,t){return i.type===t.type&&i.key===t.key}const pv=({key:i})=>i??null,bh=({ref:i,ref_key:t,ref_for:e})=>(typeof i=="number"&&(i=""+i),i!=null?Te(i)||Ce(i)||Ot(i)?{i:us,r:i,k:t,f:!!e}:i:null);function gv(i,t=null,e=null,s=0,r=null,n=i===bs?0:1,a=!1,o=!1){const h={__v_isVNode:!0,__v_skip:!0,type:i,props:t,key:t&&pv(t),ref:t&&bh(t),scopeId:Xb,slotScopeIds:null,children:e,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:n,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:us};return o?(Dh(h,e),n&128&&i.normalize(h)):e&&(h.shapeFlag|=Te(e)?8:16),Go>0&&!a&&Ds&&(h.patchFlag>0||n&6)&&h.patchFlag!==32&&Ds.push(h),h}const ds=MS;function MS(i,t=null,e=null,s=0,r=null,n=!1){if((!i||i===rS)&&(i=cs),$o(i)){const o=sn(i,t,!0);return e&&Dh(o,e),Go>0&&!n&&Ds&&(o.shapeFlag&6?Ds[Ds.indexOf(i)]=o:Ds.push(o)),o.patchFlag=-2,o}if(YS(i)&&(i=i.__vccOpts),t){t=RS(t);let{class:o,style:h}=t;o&&!Te(o)&&(t.class=sp(o)),le(h)&&(Mc(h)&&!Mt(h)&&(h=We({},h)),t.style=ep(h))}const a=Te(i)?1:fv(i)?128:Fc(i)?64:le(i)?4:Ot(i)?2:0;return gv(i,t,e,s,r,a,n,!0)}function RS(i){return i?Mc(i)||nv(i)?We({},i):i:null}function sn(i,t,e=!1,s=!1){const{props:r,ref:n,patchFlag:a,children:o,transition:h}=i,l=t?LS(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:i.type,props:l,key:l&&pv(l),ref:t&&t.ref?e&&n?Mt(n)?n.concat(bh(t)):[n,bh(t)]:bh(t):n,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:o,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:t&&i.type!==bs?a===-1?16:a|16:a,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:h,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&sn(i.ssContent),ssFallback:i.ssFallback&&sn(i.ssFallback),placeholder:i.placeholder,el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return h&&s&&Yo(c,h.clone(c)),c}function FS(i=" ",t=0){return ds(Sl,null,i,t)}function EL(i,t){const e=ds(xh,null,i);return e.staticCount=t,e}function kS(i="",t=!1){return t?(Qf(),tm(cs,null,i)):ds(cs,null,i)}function Dr(i){return i==null||typeof i=="boolean"?ds(cs):Mt(i)?ds(bs,null,i.slice()):$o(i)?oi(i):ds(Sl,null,String(i))}function oi(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:sn(i)}function Dh(i,t){let e=0;const{shapeFlag:s}=i;if(t==null)t=null;else if(Mt(t))e=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Dh(i,r()),r._c&&(r._d=!0));return}else{e=32;const r=t._;!r&&!nv(t)?t._ctx=us:r===3&&us&&(us.slots._===1?t._=1:(t._=2,i.patchFlag|=1024))}else if(Ot(t)){if(s&65){Dh(i,{default:t});return}t={default:t,_ctx:us},e=32}else t=String(t),s&64?(e=16,t=[FS(t)]):e=8;i.children=t,i.shapeFlag|=e}function LS(...i){const t={};for(let e=0;e<i.length;e++){const s=i[e];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=sp([t.class,s.class]));else if(r==="style")t.style=ep([t.style,s.style]);else if(wc(r)){const n=t[r],a=s[r];a&&n!==a&&!(Mt(n)&&n.includes(a))?t[r]=n?[].concat(n,a):a:a==null&&n==null&&!Tc(r)&&(t[r]=a)}else r!==""&&(t[r]=s[r])}return t}function Tr(i,t,e,s=null){tr(i,t,7,[e,s])}const BS=tv();let OS=0;function DS(i,t,e){const s=i.type,r=(t?t.appContext:i.appContext)||BS,n={uid:OS++,vnode:i,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new gb(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ov(s,r),emitsOptions:ev(s,r),emit:null,emitted:null,propsDefaults:ue,inheritAttrs:s.inheritAttrs,ctx:ue,data:ue,props:ue,attrs:ue,slots:ue,refs:ue,setupState:ue,setupContext:null,suspense:e,suspenseId:e?e.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return n.ctx={_:n},n.root=t?t.root:n,n.emit=fS.bind(null,n),i.ce&&i.ce(n),n}let vs=null;const Oc=()=>vs||us;let Nh,Ho;{const i=Cc(),t=(e,s)=>{let r;return(r=i[e])||(r=i[e]=[]),r.push(s),n=>{r.length>1?r.forEach(a=>a(n)):r[0](n)}};Nh=t("__VUE_INSTANCE_SETTERS__",e=>vs=e),Ho=t("__VUE_SSR_SETTERS__",e=>Wo=e)}const El=i=>{const t=vs;return Nh(i),i.scope.on(),()=>{i.scope.off(),Nh(t)}},Yg=()=>{vs&&vs.scope.off(),Nh(null)};function yv(i){return i.vnode.shapeFlag&4}let Wo=!1;function NS(i,t=!1,e=!1){t&&Ho(t);const{props:s,children:r}=i.vnode,n=yv(i);bS(i,s,n,t),TS(i,r,e||t);const a=n?US(i,t):void 0;return t&&Ho(!1),a}function US(i,t){const e=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,iS);const{setup:s}=e;if(s){Si();const r=i.setupContext=s.length>1?VS(i):null,n=El(i),a=Tl(s,i,0,[i.props,r]),o=lb(a);if(Ei(),n(),(o||i.sp)&&!Ia(i)&&jb(i),o){if(a.then(Yg,Yg),t)return a.then(h=>{Ho(!0);try{Gg(i,h,t)}finally{Ho(!1)}}).catch(h=>{Rc(h,i,0)});i.asyncDep=a}else Gg(i,a)}else xv(i)}function Gg(i,t,e){Ot(t)?i.type.__ssrInlineRender?i.ssrRender=t:i.render=t:le(t)&&(i.setupState=Bb(t)),xv(i)}function xv(i,t,e){const s=i.type;i.render||(i.render=s.render||Gr);{const r=El(i);Si();try{nS(i)}finally{Ei(),r()}}}const XS={get(i,t){return ls(i,"get",""),i[t]}};function VS(i){const t=e=>{i.exposed=e||{}};return{attrs:new Proxy(i.attrs,XS),slots:i.slots,emit:i.emit,expose:t}}function Dc(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(Bb(dp(i.exposed)),{get(t,e){if(e in t)return t[e];if(e in Fo)return Fo[e](i)},has(t,e){return e in t||e in Fo}})):i.proxy}function YS(i){return Ot(i)&&"__vccOpts"in i}const Mn=(i,t)=>PT(i,t,Wo);function zo(i,t,e){try{Oh(-1);const s=arguments.length;return s===2?le(t)&&!Mt(t)?$o(t)?ds(i,null,[t]):ds(i,t):ds(i,null,t):(s>3?e=Array.prototype.slice.call(arguments,2):s===3&&$o(e)&&(e=[e]),ds(i,t,e))}finally{Oh(1)}}const GS="3.5.41";/**
|
||
* @vue/runtime-dom v3.5.41
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let em;const $g=typeof window<"u"&&window.trustedTypes;if($g)try{em=$g.createPolicy("vue",{createHTML:i=>i})}catch{}const bv=em?i=>em.createHTML(i):i=>i,$S="http://www.w3.org/2000/svg",HS="http://www.w3.org/1998/Math/MathML",si=typeof document<"u"?document:null,Hg=si&&si.createElement("template"),WS={insert:(i,t,e)=>{t.insertBefore(i,e||null)},remove:i=>{const t=i.parentNode;t&&t.removeChild(i)},createElement:(i,t,e,s)=>{const r=t==="svg"?si.createElementNS($S,i):t==="mathml"?si.createElementNS(HS,i):e?si.createElement(i,{is:e}):si.createElement(i);return i==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:i=>si.createTextNode(i),createComment:i=>si.createComment(i),setText:(i,t)=>{i.nodeValue=t},setElementText:(i,t)=>{i.textContent=t},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>si.querySelector(i),setScopeId(i,t){i.setAttribute(t,"")},insertStaticContent(i,t,e,s,r,n){const a=e?e.previousSibling:t.lastChild;if(r&&(r===n||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),e),!(r===n||!(r=r.nextSibling)););else{Hg.innerHTML=bv(s==="svg"?`<svg>${i}</svg>`:s==="mathml"?`<math>${i}</math>`:i);const o=Hg.content;if(s==="svg"||s==="mathml"){const h=o.firstChild;for(;h.firstChild;)o.appendChild(h.firstChild);o.removeChild(h)}t.insertBefore(o,e)}return[a?a.nextSibling:t.firstChild,e?e.previousSibling:t.lastChild]}},Di="transition",co="animation",jo=Symbol("_vtc"),vv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},zS=We({},Gb,vv),jS=i=>(i.displayName="Transition",i.props=zS,i),AL=jS((i,{slots:t})=>zo(WT,qS(i),t)),yn=(i,t=[])=>{Mt(i)?i.forEach(e=>e(...t)):i&&i(...t)},Wg=i=>i?Mt(i)?i.some(t=>t.length>1):i.length>1:!1;function qS(i){const t={};for(const C in i)C in vv||(t[C]=i[C]);if(i.css===!1)return t;const{name:e="v",type:s,duration:r,enterFromClass:n=`${e}-enter-from`,enterActiveClass:a=`${e}-enter-active`,enterToClass:o=`${e}-enter-to`,appearFromClass:h=n,appearActiveClass:l=a,appearToClass:c=o,leaveFromClass:u=`${e}-leave-from`,leaveActiveClass:d=`${e}-leave-active`,leaveToClass:f=`${e}-leave-to`}=i,m=KS(r),p=m&&m[0],g=m&&m[1],{onBeforeEnter:y,onEnter:_,onEnterCancelled:v,onLeave:b,onLeaveCancelled:T,onBeforeAppear:S=y,onAppear:w=_,onAppearCancelled:E=v}=t,A=(C,R,F,D)=>{C._enterCancelled=D,xn(C,R?c:o),xn(C,R?l:a),F&&F()},P=(C,R)=>{C._isLeaving=!1,xn(C,u),xn(C,f),xn(C,d),R&&R()},I=C=>(R,F)=>{const D=C?w:_,M=()=>A(R,C,F);yn(D,[R,M]),zg(()=>{xn(R,C?h:n),Jr(R,C?c:o),Wg(D)||jg(R,s,p,M)})};return We(t,{onBeforeEnter(C){yn(y,[C]),Jr(C,n),Jr(C,a)},onBeforeAppear(C){yn(S,[C]),Jr(C,h),Jr(C,l)},onEnter:I(!1),onAppear:I(!0),onLeave(C,R){C._isLeaving=!0;const F=()=>P(C,R);Jr(C,u),C._enterCancelled?(Jr(C,d),Zg(C)):(Zg(C),Jr(C,d)),zg(()=>{C._isLeaving&&(xn(C,u),Jr(C,f),Wg(b)||jg(C,s,g,F))}),yn(b,[C,F])},onEnterCancelled(C){A(C,!1,void 0,!0),yn(v,[C])},onAppearCancelled(C){A(C,!0,void 0,!0),yn(E,[C])},onLeaveCancelled(C){P(C),yn(T,[C])}})}function KS(i){if(i==null)return null;if(le(i))return[nd(i.enter),nd(i.leave)];{const t=nd(i);return[t,t]}}function nd(i){return jw(i)}function Jr(i,t){t.split(/\s+/).forEach(e=>e&&i.classList.add(e)),(i[jo]||(i[jo]=new Set)).add(t)}function xn(i,t){t.split(/\s+/).forEach(s=>s&&i.classList.remove(s));const e=i[jo];e&&(e.delete(t),e.size||(i[jo]=void 0))}function zg(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let ZS=0;function jg(i,t,e,s){const r=i._endId=++ZS,n=()=>{r===i._endId&&s()};if(e!=null)return setTimeout(n,e);const{type:a,timeout:o,propCount:h}=JS(i,t);if(!a)return s();const l=a+"end";let c=0;const u=()=>{i.removeEventListener(l,d),n()},d=f=>{f.target===i&&++c>=h&&u()};setTimeout(()=>{c<h&&u()},o+1),i.addEventListener(l,d)}function JS(i,t){const e=window.getComputedStyle(i),s=m=>(e[m]||"").split(", "),r=s(`${Di}Delay`),n=s(`${Di}Duration`),a=qg(r,n),o=s(`${co}Delay`),h=s(`${co}Duration`),l=qg(o,h);let c=null,u=0,d=0;t===Di?a>0&&(c=Di,u=a,d=n.length):t===co?l>0&&(c=co,u=l,d=h.length):(u=Math.max(a,l),c=u>0?a>l?Di:co:null,d=c?c===Di?n.length:h.length:0);const f=c===Di&&/\b(?:transform|all)(?:,|$)/.test(s(`${Di}Property`).toString());return{type:c,timeout:u,propCount:d,hasTransform:f}}function qg(i,t){for(;i.length<t.length;)i=i.concat(i);return Math.max(...t.map((e,s)=>Kg(e)+Kg(i[s])))}function Kg(i){return i==="auto"?0:Number(i.slice(0,-1).replace(",","."))*1e3}function Zg(i){return(i?i.ownerDocument:document).body.offsetHeight}function QS(i,t,e){const s=i[jo];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?i.removeAttribute("class"):e?i.setAttribute("class",t):i.className=t}const Uh=Symbol("_vod"),_v=Symbol("_vsh"),CL={name:"show",beforeMount(i,{value:t},{transition:e}){i[Uh]=i.style.display==="none"?"":i.style.display,e&&t?e.beforeEnter(i):uo(i,t)},mounted(i,{value:t},{transition:e}){e&&t&&e.enter(i)},updated(i,{value:t,oldValue:e},{transition:s}){!t!=!e&&(s?t?(s.beforeEnter(i),uo(i,!0),s.enter(i)):s.leave(i,()=>{uo(i,!1)}):uo(i,t))},beforeUnmount(i,{value:t}){uo(i,t)}};function uo(i,t){i.style.display=t?i[Uh]:"none",i[_v]=!t}const tE=Symbol(""),eE=/(?:^|;)\s*display\s*:/;function sE(i,t,e){const s=i.style,r=Te(e);let n=!1;if(e&&!r){if(t)if(Te(t))for(const a of t.split(";")){const o=a.slice(0,a.indexOf(":")).trim();e[o]==null&&bo(s,o,"")}else for(const a in t)e[a]==null&&bo(s,a,"");for(const a in e){a==="display"&&(n=!0);const o=e[a];o!=null?iE(i,a,!Te(t)&&t?t[a]:void 0,o)||bo(s,a,o):bo(s,a,"")}}else if(r){if(t!==e){const a=s[tE];a&&(e+=";"+a),s.cssText=e,n=eE.test(e)}}else t&&i.removeAttribute("style");Uh in i&&(i[Uh]=n?s.display:"",i[_v]&&(s.display="none"))}const Jg=/\s*!important$/;function bo(i,t,e){if(Mt(e))e.forEach(s=>bo(i,t,s));else if(e==null&&(e=""),t.startsWith("--"))i.setProperty(t,e);else{const s=rE(i,t);Jg.test(e)?i.setProperty(ln(s),e.replace(Jg,""),"important"):i[s]=e}}const Qg=["Webkit","Moz","ms"],ad={};function rE(i,t){const e=ad[t];if(e)return e;let s=mr(t);if(s!=="filter"&&s in i)return ad[t]=s;s=ub(s);for(let r=0;r<Qg.length;r++){const n=Qg[r]+s;if(n in i)return ad[t]=n}return t}function iE(i,t,e,s){return i.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Te(s)&&e===s}const t0="http://www.w3.org/1999/xlink";function e0(i,t,e,s,r,n=tT(t)){s&&t.startsWith("xlink:")?e==null?i.removeAttributeNS(t0,t.slice(6,t.length)):i.setAttributeNS(t0,t,e):e==null||n&&!fb(e)?i.removeAttribute(t):i.setAttribute(t,n?"":Xs(e)?String(e):e)}function s0(i,t,e,s,r){if(t==="innerHTML"||t==="textContent"){e!=null&&(i[t]=t==="innerHTML"?bv(e):e);return}const n=i.tagName;if(t==="value"&&n!=="PROGRESS"&&!n.includes("-")){const o=n==="OPTION"?i.getAttribute("value")||"":i.value,h=e==null?i.type==="checkbox"?"on":"":String(e);(o!==h||!("_value"in i))&&(i.value=h),e==null&&i.removeAttribute(t),i._value=e;return}let a=!1;if(e===""||e==null){const o=typeof i[t];o==="boolean"?e=fb(e):e==null&&o==="string"?(e="",a=!0):o==="number"&&(e=0,a=!0)}try{i[t]=e}catch{}a&&i.removeAttribute(r||t)}function zi(i,t,e,s){i.addEventListener(t,e,s)}function nE(i,t,e,s){i.removeEventListener(t,e,s)}const r0=Symbol("_vei");function aE(i,t,e,s,r=null){const n=i[r0]||(i[r0]={}),a=n[t];if(s&&a)a.value=s;else{const[o,h]=hE(t);if(s){const l=n[t]=dE(s,r);zi(i,o,l,h)}else a&&(nE(i,o,a,h),n[t]=void 0)}}const oE=/(Once|Passive|Capture)$/,lE=/^on:?(?:Once|Passive|Capture)$/;function hE(i){let t,e;for(;(e=i.match(oE))&&!lE.test(i);)t||(t={}),i=i.slice(0,i.length-e[1].length),t[e[1].toLowerCase()]=!0;return[i[2]===":"?i.slice(3):ln(i.slice(2)),t]}let od=0;const cE=Promise.resolve(),uE=()=>od||(cE.then(()=>od=0),od=Date.now());function dE(i,t){const e=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=e.attached)return;const r=e.value;if(Mt(r)){const n=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{n.call(s),s._stopped=!0};const a=r.slice(),o=[s];for(let h=0;h<a.length&&!s._stopped;h++){const l=a[h];l&&tr(l,t,5,o)}}else tr(r,t,5,[s])};return e.value=i,e.attached=uE(),e}const i0=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,fE=(i,t,e,s,r,n)=>{const a=r==="svg";t==="class"?QS(i,s,a):t==="style"?sE(i,e,s):wc(t)?Tc(t)||aE(i,t,e,s,n):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):mE(i,t,s,a))?(s0(i,t,s),!i.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&e0(i,t,s,a,n,t!=="value")):i._isVueCE&&(pE(i,t)||i._def.__asyncLoader&&(/[A-Z]/.test(t)||!Te(s)))?s0(i,mr(t),s,n,t):(t==="true-value"?i._trueValue=s:t==="false-value"&&(i._falseValue=s),e0(i,t,s,a))};function mE(i,t,e,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in i&&i0(t)&&Ot(e));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&i.tagName==="IFRAME"||t==="form"||t==="list"&&i.tagName==="INPUT"||t==="type"&&i.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=i.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return i0(t)&&Te(e)?!1:t in i}function pE(i,t){const e=i._def.props;if(!e)return!1;const s=mr(t);return Array.isArray(e)?e.some(r=>mr(r)===s):Object.keys(e).some(r=>mr(r)===s)}const Ua=i=>{const t=i.props["onUpdate:modelValue"]||!1;return Mt(t)?e=>yh(t,e):t};function gE(i){i.target.composing=!0}function n0(i){const t=i.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Vr=Symbol("_assign"),Gl=Symbol("_initialValue");function ld(i,t,e){return t&&(i=i.trim()),e&&(i=Ac(i)),i}const IL={created(i,{modifiers:{lazy:t,trim:e,number:s}},r){i.parentNode&&(i.type==="text"?i[Gl]=i.defaultValue.replace(/[\r\n]/g,""):i.type==="textarea"&&(i[Gl]=i.defaultValue.replace(/\r\n?/g,`
|
||
`))),i[Vr]=Ua(r);const n=s||r.props&&r.props.type==="number";zi(i,t?"change":"input",a=>{a.target.composing||i[Vr](ld(i.value,e,n))}),(e||n)&&zi(i,"change",()=>{i.value=ld(i.value,e,n)}),t||(zi(i,"compositionstart",gE),zi(i,"compositionend",n0),zi(i,"change",n0))},mounted(i,{value:t,modifiers:{trim:e,number:s}}){const r=t??"",n=i[Gl];delete i[Gl],n!==void 0&&(i.type==="text"||i.type==="textarea")&&i.value!==n?i[Vr](ld(i.value,e,s)):i.value=r},beforeUpdate(i,{value:t,oldValue:e,modifiers:{lazy:s,trim:r,number:n}},a){if(i[Vr]=Ua(a),i.composing)return;const o=(n||i.type==="number")&&!/^0\d/.test(i.value)?Ac(i.value):i.value,h=t??"";if(o===h)return;const l=i.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===i&&i.type!=="range"&&(s&&t===e||r&&i.value.trim()===h)||(i.value=h)}},PL={deep:!0,created(i,t,e){i[Vr]=Ua(e),zi(i,"change",()=>{const s=i._modelValue,r=qo(i),n=i.checked,a=i[Vr];if(Mt(s)){const o=rp(s,r),h=o!==-1;if(n&&!h)a(s.concat(r));else if(!n&&h){const l=[...s];l.splice(o,1),a(l)}}else if(Za(s)){const o=new Set(s);n?o.add(r):o.delete(r),a(o)}else a(wv(i,n))})},mounted:a0,beforeUpdate(i,t,e){i[Vr]=Ua(e),a0(i,t,e)}};function a0(i,{value:t,oldValue:e},s){i._modelValue=t;let r;if(Mt(t))r=rp(t,s.props.value)>-1;else if(Za(t))r=t.has(s.props.value);else{if(t===e)return;r=Ja(t,wv(i,!0))}i.checked!==r&&(i.checked=r)}const ML={deep:!0,created(i,{value:t,modifiers:{number:e}},s){i._modelValue=t,zi(i,"change",()=>{const r=Array.prototype.filter.call(i.options,n=>n.selected).map(n=>e?Ac(qo(n)):qo(n));i[Vr](i.multiple?Za(i._modelValue)?new Set(r):r:r[0]),i._assigning=!0,fp(()=>{i._assigning=!1})}),i[Vr]=Ua(s)},mounted(i,{value:t}){o0(i,t)},beforeUpdate(i,{value:t},e){i._modelValue=t,i[Vr]=Ua(e)},updated(i,{value:t}){i._assigning||o0(i,t)}};function o0(i,t){const e=i.multiple,s=Mt(t);if(!(e&&!s&&!Za(t))){for(let r=0,n=i.options.length;r<n;r++){const a=i.options[r],o=qo(a);if(e)if(s){const h=typeof o;h==="string"||h==="number"?a.selected=t.some(l=>String(l)===String(o)):a.selected=rp(t,o)>-1}else a.selected=t.has(o);else if(Ja(qo(a),t)){i.selectedIndex!==r&&(i.selectedIndex=r);return}}!e&&i.selectedIndex!==-1&&(i.selectedIndex=-1)}}function qo(i){return"_value"in i?i._value:i.value}function wv(i,t){const e=t?"_trueValue":"_falseValue";return e in i?i[e]:t}const yE=["ctrl","shift","alt","meta"],xE={stop:i=>i.stopPropagation(),prevent:i=>i.preventDefault(),self:i=>i.target!==i.currentTarget,ctrl:i=>!i.ctrlKey,shift:i=>!i.shiftKey,alt:i=>!i.altKey,meta:i=>!i.metaKey,left:i=>"button"in i&&i.button!==0,middle:i=>"button"in i&&i.button!==1,right:i=>"button"in i&&i.button!==2,exact:(i,t)=>yE.some(e=>i[`${e}Key`]&&!t.includes(e))},RL=(i,t)=>{if(!i)return i;const e=i._withMods||(i._withMods={}),s=t.join(".");return e[s]||(e[s]=((r,...n)=>{for(let a=0;a<t.length;a++){const o=xE[t[a]];if(o&&o(r,t))return}return i(r,...n)}))},bE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},FL=(i,t)=>{const e=i._withKeys||(i._withKeys={}),s=t.join(".");return e[s]||(e[s]=(r=>{if(!("key"in r))return;const n=ln(r.key);if(t.some(a=>a===n||bE[a]===n))return i(r)}))},vE=We({patchProp:fE},WS);let l0;function _E(){return l0||(l0=ES(vE))}const kL=((...i)=>{const t=_E().createApp(...i),{mount:e}=t;return t.mount=s=>{const r=TE(s);if(!r)return;const n=t._component;!Ot(n)&&!n.render&&!n.template&&(n.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=e(r,!1,wE(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t});function wE(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function TE(i){return Te(i)?document.querySelector(i):i}/*!
|
||
* pinia v4.0.3
|
||
* (c) 2026 Eduardo San Martin Morote
|
||
* @license MIT
|
||
*/let Tv;const Nc=i=>Tv=i,Sv=Symbol();function h0(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}function LL(){const i=ip(!0),t=i.run(()=>Fb({}));let e=[],s=[];const r=dp({install(n){Nc(r),r._a=n,n.provide(Sv,r),n.config.globalProperties.$pinia=r,s.forEach(a=>e.push(a)),s=[]},use(n){return this._a?e.push(n):s.push(n),this},_p:e,_a:null,_e:i,_s:new Map,state:t});return r}const sm=()=>{};function c0(i,t,e,s=sm){i.add(t);const r=()=>{i.delete(t)&&s()};return!e&&np()&&yb(r),r}function na(i,...t){i.forEach(e=>{e(...t)})}const SE=i=>i(),u0=Symbol(),hd=Symbol();function rm(i,t){i instanceof Map&&t instanceof Map?t.forEach((e,s)=>i.set(s,e)):i instanceof Set&&t instanceof Set&&t.forEach(i.add,i);for(const e in t){if(!Object.hasOwn(t,e))continue;const s=t[e],r=i[e];h0(r)&&h0(s)&&Object.hasOwn(i,e)&&!Ce(s)&&!vi(s)?i[e]=rm(r,s):i[e]=s}return i}const EE=Symbol();function AE(i){return!i||typeof i!="object"||!Object.hasOwn(i,EE)}const{assign:Xi}=Object;function CE(i){return!!(Ce(i)&&i.effect)}function IE(i,t,e,s){const{state:r,actions:n,getters:a}=t,o=e.state.value[i];let h;function l(){o||(e.state.value[i]=r?r():{});const c=ET(e.state.value[i]);return Xi(c,n,Object.keys(a||{}).reduce((u,d)=>(u[d]=dp(Mn(()=>{Nc(e);const f=e._s.get(i);return a[d].call(f,f)})),u),{}))}return h=Ev(i,l,t,e,s,!0),h}function Ev(i,t,e={},s,r,n){let a;const o=Xi({actions:{}},e),h={deep:!0};let l,c,u=new Set,d=new Set,f;const m=s.state.value[i];!n&&!m&&(s.state.value[i]={});let p;function g(w){let E;l=c=!1,typeof w=="function"?(w(s.state.value[i]),E={type:"patch function",storeId:i,events:f}):(rm(s.state.value[i],w),E={type:"patch object",payload:w,storeId:i,events:f});const A=p=Symbol();fp().then(()=>{p===A&&(l=!0)}),c=!0,na(u,E,s.state.value[i])}const y=n?function(){const{state:E}=e,A=E?E():{};this.$patch(P=>{Xi(P,A)})}:sm;function _(){a.stop(),u.clear(),d.clear(),s._s.delete(i)}const v=(w,E="")=>{if(u0 in w)return w[hd]=E,w;const A=function(){Nc(s);const P=Array.from(arguments),I=new Set,C=new Set;function R(M){I.add(M)}function F(M){C.add(M)}na(d,{args:P,name:A[hd],store:T,after:R,onError:F});let D;try{D=w.apply(this&&this.$id===i?this:T,P)}catch(M){throw na(C,M),M}return D instanceof Promise?D.then(M=>(na(I,M),M)).catch(M=>(na(C,M),Promise.reject(M))):(na(I,D),D)};return A[u0]=!0,A[hd]=E,A},b={_p:s,$id:i,$onAction:c0.bind(null,d),$patch:g,$reset:y,$subscribe(w,E={}){if(u.has(w))return sm;const A=c0(u,w,E.detached,()=>P()),P=a.run(()=>tn(()=>s.state.value[i],I=>{(E.flush==="sync"?c:l)&&w({storeId:i,type:"direct",events:f},I)},Xi({},h,E)));return A},$dispose:_},T=Pc(b);s._s.set(i,T);const S=(s._a&&s._a.runWithContext||SE)(()=>s._e.run(()=>(a=ip()).run(()=>t({action:v}))));for(const w in S){const E=S[w];Ce(E)&&!CE(E)||vi(E)?n||(m&&AE(E)&&(Ce(E)?E.value=m[w]:((E instanceof Set||E instanceof Map)&&E.clear(),rm(E,m[w]))),s.state.value[i][w]=E):typeof E=="function"&&(S[w]=v(E,w),o.actions[w]=E)}return Xi(T,S),Xi(re(T),S),Object.defineProperty(T,"$state",{get:()=>s.state.value[i],set:w=>{g(E=>{Xi(E,w)})}}),s._p.forEach(w=>{const E=a.run(()=>w({store:T,app:s._a,pinia:s,options:o}));Xi(T,E)}),m&&n&&e.hydrate&&e.hydrate(T.$state,m),l=!0,c=!0,T}/*! #__NO_SIDE_EFFECTS__ */function BL(i,t,e){let s;const r=typeof t=="function";s=r?e:t;function n(a,o){const h=DT();return a=a||(h?Ca(Sv,null):null),a&&Nc(a),a=Tv,a._s.has(i)||(r?Ev(i,t,s,a):IE(i,s,a)),a._s.get(i)}return n.$id=i,n}/*!
|
||
* shared v11.4.16
|
||
* (c) 2026 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/const Xh=typeof window<"u",hn=(i,t=!1)=>t?Symbol.for(i):Symbol(i),PE=(i,t,e)=>ME({l:i,k:t,s:e}),ME=i=>JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ne=i=>typeof i=="number"&&isFinite(i),Av=i=>Sp(i)==="[object Date]",Xa=i=>Sp(i)==="[object RegExp]",Tp=i=>de(i)&&Object.keys(i).length===0,Le=Object.assign,RE=Object.create,he=(i=null)=>RE(i);let d0;const Ki=()=>d0||(d0=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:he()),FE=Object.prototype.hasOwnProperty;function qs(i,t){return FE.call(i,t)}function qe(i,t){const e=i[t];return qs(i,t)?e:void 0}function Cv(i){return qs(Object.prototype,i)}const _e=Array.isArray,ve=i=>typeof i=="function",Et=i=>typeof i=="string",ie=i=>typeof i=="boolean",se=i=>i!==null&&typeof i=="object",kE=i=>se(i)&&ve(i.then)&&ve(i.catch),Iv=Object.prototype.toString,Sp=i=>Iv.call(i),de=i=>Sp(i)==="[object Object]",LE=i=>i==null?"":_e(i)||de(i)&&i.toString===Iv?JSON.stringify(i,null,2):String(i);function Ep(i,t=""){return i.reduce((e,s,r)=>r===0?e+s:e+t+s,"")}function BE(i,t){typeof console<"u"&&(console.warn("[intlify] "+i),t&&console.warn(t.stack))}function f0(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function OE(i){return i.replace(/&(?![a-z0-9#]{2,6};)/gi,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const DE=/^javascript:/i,NE=/^(?:href|src|action|formaction)$/i,UE=/&#(?:x([0-9a-f]+)|(\d+));?/gi,XE=/&(?:Tab|NewLine);/g,VE=/:?/gi,YE=/[\u0000-\u0020\u007f-\u009f]/g,GE=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,$E=/(^|[\s"'<>/])on(\w+\s*=)/gi,HE=/(?:^|[\s"'<>/])srcdoc\s*=/i,WE=/(^|[\s"'<>/])s(rcdoc\s*=)/gi,zE=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function jE(i,t,e){const s=t||e;if(!s)return i;const r=Number.parseInt(s,t?16:10);return r<=127?String.fromCharCode(r):i}function Ap(i){const t=i.replace(UE,jE).replace(XE,"").replace(VE,":").replace(YE,"");return DE.test(t)}function qE(i){const t=/url\s*\(/gi;let e="",s=0,r;for(;(r=t.exec(i))!==null;){const n=r.index,a=t.lastIndex-1;let o=a+1,h=1,l=null;for(;o<i.length;o++){const d=i[o];if(l){d===l&&(l=null);continue}if(d==='"'||d==="'")l=d;else if(d==="(")h++;else if(d===")"&&(h--,h===0))break}if(h!==0)break;const c=i.slice(a+1,o).trim(),u=c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'")?c.slice(1,-1).trim():c;e+=i.slice(s,n),e+=Ap(u)?"url(about:blank)":i.slice(n,o+1),s=o+1}return e+i.slice(s)}function m0(i,t){if(NE.test(i)&&Ap(t))return"about:blank";const e=i.toLowerCase()==="style"?qE(t):t;return OE(e)}function KE(i){return i=i.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(t,e,s)=>`${e}="${m0(e,s)}"`),i=i.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(t,e,s)=>`${e}='${m0(e,s)}'`),GE.test(i)&&(i=i.replace($E,"$1on$2")),HE.test(i)&&(i=i.replace(WE,"$1s$2")),i=i.replace(zE,(t,e,s,r)=>Ap(r)?`${e}${s}about:blank`:t),i}const p0=i=>!se(i)||_e(i);function vh(i,t){if(p0(i)||p0(t)||t===Object.prototype)throw new Error("Invalid value");const e=[{src:i,des:t}];for(;e.length;){const{src:s,des:r}=e.pop();Object.keys(s).forEach(n=>{if(n==="__proto__")return;const a=s[n];if(_e(a)){const o=[];o.length=a.length,r[n]=o,e.push({src:a,des:o})}else se(a)?((!se(r[n])||_e(r[n]))&&(r[n]=he()),e.push({src:a,des:r[n]})):r[n]=a})}}/*!
|
||
* message-compiler v11.4.16
|
||
* (c) 2026 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/function ZE(i,t,e){return{line:i,column:t,offset:e}}function im(i,t,e){return{start:i,end:t}}const ae={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},JE=17;function Uc(i,t,e={}){const{domain:s,messages:r,args:n}=e,a=i,o=new SyntaxError(String(a));return o.code=i,t&&(o.location=t),o.domain=s,o}function QE(i){throw i}const Sr=" ",tA="\r",is=`
|
||
`,eA="\u2028",sA="\u2029";function rA(i){const t=i;let e=0,s=1,r=1,n=0;const a=w=>t[w]===tA&&t[w+1]===is,o=w=>t[w]===is,h=w=>t[w]===sA,l=w=>t[w]===eA,c=w=>a(w)||o(w)||h(w)||l(w),u=()=>e,d=()=>s,f=()=>r,m=()=>n,p=w=>a(w)||h(w)||l(w)?is:t[w],g=()=>p(e),y=()=>p(e+n);function _(){return n=0,c(e)&&(s++,r=0),a(e)&&e++,e++,r++,t[e]}function v(){return a(e+n)&&n++,n++,t[e+n]}function b(){e=0,s=1,r=1,n=0}function T(w=0){n=w}function S(){const w=e+n;for(;w!==e;)_();n=0}return{index:u,line:d,column:f,peekOffset:m,charAt:p,currentChar:g,currentPeek:y,next:_,peek:v,reset:b,resetPeek:T,skipToPeek:S}}const Qr=void 0,iA=".",g0="'",nA="tokenizer";function aA(i,t={}){const e=t.location!==!1,s=rA(i),r=()=>s.index(),n=()=>ZE(s.line(),s.column(),s.index()),a=n(),o=r(),h={currentType:13,offset:o,startLoc:a,endLoc:a,lastType:13,lastOffset:o,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>h,{onError:c}=t;function u(U,Y,W,...j){const mt=l();if(Y.column+=W,Y.offset+=W,c){const ut=e?im(mt.startLoc,Y):null,vt=Uc(U,ut,{domain:nA,args:j});c(vt)}}function d(U,Y,W){U.endLoc=n(),U.currentType=Y;const j={type:Y};return e&&(j.loc=im(U.startLoc,U.endLoc)),W!=null&&(j.value=W),j}const f=U=>d(U,13);function m(U,Y){return U.currentChar()===Y?(U.next(),Y):(u(ae.EXPECTED_TOKEN,n(),0,Y),"")}function p(U){let Y="";for(;U.currentPeek()===Sr||U.currentPeek()===is;)Y+=U.currentPeek(),U.peek();return Y}function g(U){const Y=p(U);return U.skipToPeek(),Y}function y(U){if(U===Qr)return!1;const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y===95}function _(U){if(U===Qr)return!1;const Y=U.charCodeAt(0);return Y>=48&&Y<=57}function v(U,Y){const{currentType:W}=Y;if(W!==2)return!1;p(U);const j=y(U.currentPeek());return U.resetPeek(),j}function b(U,Y){const{currentType:W}=Y;if(W!==2)return!1;p(U);const j=U.currentPeek()==="-"?U.peek():U.currentPeek(),mt=_(j);return U.resetPeek(),mt}function T(U,Y){const{currentType:W}=Y;if(W!==2)return!1;p(U);const j=U.currentPeek()===g0;return U.resetPeek(),j}function S(U,Y){const{currentType:W}=Y;if(W!==7)return!1;p(U);const j=U.currentPeek()===".";return U.resetPeek(),j}function w(U,Y){const{currentType:W}=Y;if(W!==8)return!1;p(U);const j=y(U.currentPeek());return U.resetPeek(),j}function E(U,Y){const{currentType:W}=Y;if(!(W===7||W===11))return!1;p(U);const j=U.currentPeek()===":";return U.resetPeek(),j}function A(U,Y){const{currentType:W}=Y;if(W!==9)return!1;const j=()=>{const ut=U.currentPeek();return ut==="{"?y(U.peek()):ut==="@"||ut==="|"||ut===":"||ut==="."||ut===Sr||!ut?!1:ut===is?(U.peek(),j()):I(U,!1)},mt=j();return U.resetPeek(),mt}function P(U){p(U);const Y=U.currentPeek()==="|";return U.resetPeek(),Y}function I(U,Y=!0){const W=(mt=!1,ut="")=>{const vt=U.currentPeek();return vt==="{"||vt==="@"||!vt?mt:vt==="|"?!(ut===Sr||ut===is):vt===Sr?(U.peek(),W(!0,Sr)):vt===is?(U.peek(),W(!0,is)):!0},j=W();return Y&&U.resetPeek(),j}function C(U,Y){const W=U.currentChar();return W===Qr?Qr:Y(W)?(U.next(),W):null}function R(U){const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36}function F(U){return C(U,R)}function D(U){const Y=U.charCodeAt(0);return Y>=97&&Y<=122||Y>=65&&Y<=90||Y>=48&&Y<=57||Y===95||Y===36||Y===45}function M(U){return C(U,D)}function O(U){const Y=U.charCodeAt(0);return Y>=48&&Y<=57}function k(U){return C(U,O)}function N(U){const Y=U.charCodeAt(0);return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function B(U){return C(U,N)}function L(U){let Y="",W="";for(;Y=k(U);)W+=Y;return W}function G(U){let Y="";for(;;){const W=U.currentChar();if(W==="\\"){const j=U.peek();j==="{"||j==="}"||j==="@"||j==="|"||j==="\\"?(Y+=W+j,U.next(),U.next()):(U.resetPeek(),Y+=W,U.next())}else{if(W==="{"||W==="}"||W==="@"||W==="|"||!W)break;if(W===Sr||W===is)if(I(U))Y+=W,U.next();else{if(P(U))break;Y+=W,U.next()}else Y+=W,U.next()}}return Y}function V(U){g(U);let Y="",W="";for(;Y=M(U);)W+=Y;const j=U.currentChar();if(j&&j!=="}"&&j!==Qr&&j!==Sr&&j!==is&&j!==" "){const mt=rt(U);return u(ae.INVALID_TOKEN_IN_PLACEHOLDER,n(),0,W+mt),W+mt}return U.currentChar()===Qr&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),W}function q(U){g(U);let Y="";return U.currentChar()==="-"?(U.next(),Y+=`-${L(U)}`):Y+=L(U),U.currentChar()===Qr&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),Y}function H(U){return U!==g0&&U!==is}function at(U){g(U),m(U,"'");let Y="",W="";for(;Y=C(U,H);)Y==="\\"?W+=et(U):W+=Y;const j=U.currentChar();return j===is||j===Qr?(u(ae.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,n(),0),j===is&&(U.next(),m(U,"'")),W):(m(U,"'"),W)}function et(U){const Y=U.currentChar();switch(Y){case"\\":case"'":return U.next(),`\\${Y}`;case"u":return ot(U,Y,4);case"U":return ot(U,Y,6);default:return u(ae.UNKNOWN_ESCAPE_SEQUENCE,n(),0,Y),""}}function ot(U,Y,W){m(U,Y);let j="";for(let mt=0;mt<W;mt++){const ut=B(U);if(!ut){u(ae.INVALID_UNICODE_ESCAPE_SEQUENCE,n(),0,`\\${Y}${j}${U.currentChar()}`);break}j+=ut}return`\\${Y}${j}`}function ct(U){return U!=="{"&&U!=="}"&&U!==Sr&&U!==is}function rt(U){g(U);let Y="",W="";for(;Y=C(U,ct);)W+=Y;return W}function dt(U){let Y="",W="";for(;Y=F(U);)W+=Y;return W}function X(U){const Y=W=>{const j=U.currentChar();return j==="{"||j==="@"||j==="|"||j==="("||j===")"||!j||j===Sr?W:(W+=j,U.next(),Y(W))};return Y("")}function $(U){g(U);const Y=m(U,"|");return g(U),Y}function K(U,Y){let W=null;switch(U.currentChar()){case"{":return Y.braceNest>=1&&u(ae.NOT_ALLOW_NEST_PLACEHOLDER,n(),0),U.next(),W=d(Y,2,"{"),g(U),Y.braceNest++,W;case"}":return Y.braceNest>0&&Y.currentType===2&&u(ae.EMPTY_PLACEHOLDER,n(),0),U.next(),W=d(Y,3,"}"),Y.braceNest--,Y.braceNest>0&&g(U),Y.inLinked&&Y.braceNest===0&&(Y.inLinked=!1),W;case"@":return Y.braceNest>0&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),W=J(U,Y)||f(Y),Y.braceNest=0,W;default:{let mt=!0,ut=!0,vt=!0;if(P(U))return Y.braceNest>0&&u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),W=d(Y,1,$(U)),Y.braceNest=0,Y.inLinked=!1,W;if(Y.braceNest>0&&(Y.currentType===4||Y.currentType===5||Y.currentType===6))return u(ae.UNTERMINATED_CLOSING_BRACE,n(),0),Y.braceNest=0,Q(U,Y);if(mt=v(U,Y))return W=d(Y,4,V(U)),g(U),W;if(ut=b(U,Y))return W=d(Y,5,q(U)),g(U),W;if(vt=T(U,Y))return W=d(Y,6,at(U)),g(U),W;if(!mt&&!ut&&!vt)return W=d(Y,12,rt(U)),u(ae.INVALID_TOKEN_IN_PLACEHOLDER,n(),0,W.value),g(U),W;break}}return W}function J(U,Y){const{currentType:W}=Y;let j=null;const mt=U.currentChar();switch((W===7||W===8||W===11||W===9)&&(mt===is||mt===Sr)&&u(ae.INVALID_LINKED_FORMAT,n(),0),mt){case"@":return U.next(),j=d(Y,7,"@"),Y.inLinked=!0,j;case".":return g(U),U.next(),d(Y,8,".");case":":return g(U),U.next(),d(Y,9,":");default:return P(U)?(j=d(Y,1,$(U)),Y.braceNest=0,Y.inLinked=!1,j):S(U,Y)||E(U,Y)?(g(U),J(U,Y)):w(U,Y)?(g(U),d(Y,11,dt(U))):A(U,Y)?(g(U),mt==="{"?K(U,Y)||j:d(Y,10,X(U))):(W===7&&u(ae.INVALID_LINKED_FORMAT,n(),0),Y.braceNest=0,Y.inLinked=!1,Q(U,Y))}}function Q(U,Y){let W={type:13};if(Y.braceNest>0)return K(U,Y)||f(Y);if(Y.inLinked)return J(U,Y)||f(Y);switch(U.currentChar()){case"{":return K(U,Y)||f(Y);case"}":return u(ae.UNBALANCED_CLOSING_BRACE,n(),0),U.next(),d(Y,3,"}");case"@":return J(U,Y)||f(Y);default:{if(P(U))return W=d(Y,1,$(U)),Y.braceNest=0,Y.inLinked=!1,W;if(I(U))return d(Y,0,G(U));break}}return W}function it(){const{currentType:U,offset:Y,startLoc:W,endLoc:j}=h;return h.lastType=U,h.lastOffset=Y,h.lastStartLoc=W,h.lastEndLoc=j,h.offset=r(),h.startLoc=n(),s.currentChar()===Qr?d(h,13):Q(s,h)}return{nextToken:it,currentOffset:r,currentPosition:n,context:l}}const oA="parser",lA=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,hA=/\\([\\@{}|])/g;function cA(i,t){return t}function uA(i,t,e){switch(i){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||e,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function dA(i={}){const t=i.location!==!1,{onError:e}=i;function s(y,_,v,b,...T){const S=y.currentPosition();if(S.offset+=b,S.column+=b,e){const w=t?im(v,S):null,E=Uc(_,w,{domain:oA,args:T});e(E)}}function r(y,_,v){const b={type:y};return t&&(b.start=_,b.end=_,b.loc={start:v,end:v}),b}function n(y,_,v,b){t&&(y.end=_,y.loc&&(y.loc.end=v))}function a(y,_){const v=y.context(),b=r(3,v.offset,v.startLoc);return b.value=_.replace(hA,cA),n(b,y.currentOffset(),y.currentPosition()),b}function o(y,_){const v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(5,b,T);return S.index=parseInt(_,10),y.nextToken(),n(S,y.currentOffset(),y.currentPosition()),S}function h(y,_){const v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(4,b,T);return S.key=_,y.nextToken(),n(S,y.currentOffset(),y.currentPosition()),S}function l(y,_){const v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(9,b,T);return S.value=_.replace(lA,uA),y.nextToken(),n(S,y.currentOffset(),y.currentPosition()),S}function c(y){const _=y.nextToken(),v=y.context(),{lastOffset:b,lastStartLoc:T}=v,S=r(8,b,T);return _.type!==11?(s(y,ae.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),S.value="",n(S,b,T),{nextConsumeToken:_,node:S}):(_.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,Er(_)),S.value=_.value||"",n(S,y.currentOffset(),y.currentPosition()),{node:S})}function u(y,_){const v=y.context(),b=r(7,v.offset,v.startLoc);return b.value=_,n(b,y.currentOffset(),y.currentPosition()),b}function d(y){const _=y.context(),v=r(6,_.offset,_.startLoc);let b=y.nextToken();if(b.type===8){const T=c(y);v.modifier=T.node,b=T.nextConsumeToken||y.nextToken()}switch(b.type!==9&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),b=y.nextToken(),b.type===2&&(b=y.nextToken()),b.type){case 10:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=u(y,b.value||"");break;case 4:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=h(y,b.value||"");break;case 5:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=o(y,b.value||"");break;case 6:b.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(b)),v.key=l(y,b.value||"");break;default:{s(y,ae.UNEXPECTED_EMPTY_LINKED_KEY,_.lastStartLoc,0);const T=y.context(),S=r(7,T.offset,T.startLoc);return S.value="",n(S,T.offset,T.startLoc),v.key=S,n(v,T.offset,T.startLoc),{nextConsumeToken:b,node:v}}}return n(v,y.currentOffset(),y.currentPosition()),{node:v}}function f(y){const _=y.context(),v=_.currentType===1?y.currentOffset():_.offset,b=_.currentType===1?_.endLoc:_.startLoc,T=r(2,v,b);T.items=[];let S=null;do{const A=S||y.nextToken();switch(S=null,A.type){case 0:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(a(y,A.value||""));break;case 5:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(o(y,A.value||""));break;case 4:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(h(y,A.value||""));break;case 6:A.value==null&&s(y,ae.UNEXPECTED_LEXICAL_ANALYSIS,_.lastStartLoc,0,Er(A)),T.items.push(l(y,A.value||""));break;case 7:{const P=d(y);T.items.push(P.node),S=P.nextConsumeToken||null;break}}}while(_.currentType!==13&&_.currentType!==1);const w=_.currentType===1?_.lastOffset:y.currentOffset(),E=_.currentType===1?_.lastEndLoc:y.currentPosition();return n(T,w,E),T}function m(y,_,v,b){const T=y.context();let S=b.items.length===0;const w=r(1,_,v);w.cases=[],w.cases.push(b);do{const E=f(y);S||(S=E.items.length===0),w.cases.push(E)}while(T.currentType!==13);return S&&s(y,ae.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),n(w,y.currentOffset(),y.currentPosition()),w}function p(y){const _=y.context(),{offset:v,startLoc:b}=_,T=f(y);return _.currentType===13?T:m(y,v,b,T)}function g(y){const _=aA(y,Le({},i)),v=_.context(),b=r(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=y),b.body=p(_),i.onCacheKey&&(b.cacheKey=i.onCacheKey(y)),v.currentType!==13&&s(_,ae.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,y[v.offset]||""),n(b,_.currentOffset(),_.currentPosition()),b}return{parse:g}}function Er(i){if(i.type===13)return"EOF";const t=(i.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function fA(i,t={}){const e={ast:i,helpers:new Set};return{context:()=>e,helper:n=>(e.helpers.add(n),n)}}function y0(i,t){for(let e=0;e<i.length;e++)Cp(i[e],t)}function Cp(i,t){switch(i.type){case 1:y0(i.cases,t),t.helper("plural");break;case 2:y0(i.items,t);break;case 6:{Cp(i.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function mA(i,t={}){const e=fA(i);e.helper("normalize"),i.body&&Cp(i.body,e);const s=e.context();i.helpers=Array.from(s.helpers)}function pA(i){const t=i.body;return t.type===2?x0(t):t.cases.forEach(e=>x0(e)),i}function x0(i){if(i.items.length===1){const t=i.items[0];(t.type===3||t.type===9)&&(i.static=t.value,delete t.value)}else{const t=[];for(let e=0;e<i.items.length;e++){const s=i.items[e];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===i.items.length){i.static=Ep(t);for(let e=0;e<i.items.length;e++){const s=i.items[e];(s.type===3||s.type===9)&&delete s.value}}}}function ca(i){switch(i.t=i.type,i.type){case 0:{const t=i;ca(t.body),t.b=t.body,delete t.body;break}case 1:{const t=i,e=t.cases;for(let s=0;s<e.length;s++)ca(e[s]);t.c=e,delete t.cases;break}case 2:{const t=i,e=t.items;for(let s=0;s<e.length;s++)ca(e[s]);t.i=e,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=i;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=i;ca(t.key),t.k=t.key,delete t.key,t.modifier&&(ca(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=i;t.i=t.index,delete t.index;break}case 4:{const t=i;t.k=t.key,delete t.key;break}}delete i.type}function gA(i,t){const{filename:e,breakLineCode:s,needIndent:r}=t,n=t.location!==!1,a={filename:e,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:r,indentLevel:0};n&&i.loc&&(a.source=i.loc.source);const o=()=>a;function h(p,g){a.code+=p}function l(p,g=!0){const y=g?s:"";h(r?y+" ".repeat(p):y)}function c(p=!0){const g=++a.indentLevel;p&&l(g)}function u(p=!0){const g=--a.indentLevel;p&&l(g)}function d(){l(a.indentLevel)}return{context:o,push:h,indent:c,deindent:u,newline:d,helper:p=>`_${p}`,needIndent:()=>a.needIndent}}function yA(i,t){const{helper:e}=i;i.push(`${e("linked")}(`),Va(i,t.key),t.modifier?(i.push(", "),Va(i,t.modifier),i.push(", _type")):i.push(", undefined, _type"),i.push(")")}function xA(i,t){const{helper:e,needIndent:s}=i;i.push(`${e("normalize")}([`),i.indent(s());const r=t.items.length;for(let n=0;n<r&&(Va(i,t.items[n]),n!==r-1);n++)i.push(", ");i.deindent(s()),i.push("])")}function bA(i,t){const{helper:e,needIndent:s}=i;if(t.cases.length>1){i.push(`${e("plural")}([`),i.indent(s());const r=t.cases.length;for(let n=0;n<r&&(Va(i,t.cases[n]),n!==r-1);n++)i.push(", ");i.deindent(s()),i.push("])")}}function vA(i,t){t.body?Va(i,t.body):i.push("null")}function Va(i,t){const{helper:e}=i;switch(t.type){case 0:vA(i,t);break;case 1:bA(i,t);break;case 2:xA(i,t);break;case 6:yA(i,t);break;case 8:i.push(JSON.stringify(t.value),t);break;case 7:i.push(JSON.stringify(t.value),t);break;case 5:i.push(`${e("interpolate")}(${e("list")}(${t.index}))`,t);break;case 4:i.push(`${e("interpolate")}(${e("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:i.push(JSON.stringify(t.value),t);break;case 3:i.push(JSON.stringify(t.value),t);break}}const _A=(i,t={})=>{const e=Et(t.mode)?t.mode:"normal",s=Et(t.filename)?t.filename:"message.intl";t.sourceMap;const r=t.breakLineCode!=null?t.breakLineCode:e==="arrow"?";":`
|
||
`,n=t.needIndent?t.needIndent:e!=="arrow",a=i.helpers||[],o=gA(i,{filename:s,breakLineCode:r,needIndent:n});o.push(e==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),o.indent(n),a.length>0&&(o.push(`const { ${Ep(a.map(c=>`${c}: _${c}`),", ")} } = ctx`),o.newline()),o.push("return "),Va(o,i),o.deindent(n),o.push("}"),delete i.helpers;const{code:h,map:l}=o.context();return{ast:i,code:h,map:l?l.toJSON():void 0}};function wA(i,t={}){const e=Le({},t),s=!!e.jit,r=!!e.minify,n=e.optimize==null?!0:e.optimize,o=dA(e).parse(i);return s?(n&&pA(o),r&&ca(o),{ast:o,code:""}):(mA(o,e),_A(o,e))}/*!
|
||
* core-base v11.4.16
|
||
* (c) 2026 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/function TA(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ki().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ki().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function $n(i){return se(i)&&Ip(i)===0&&(qs(i,"b")||qs(i,"body"))}const Pv=["b","body"];function SA(i){return cn(i,Pv)}const Mv=["c","cases"];function EA(i){return cn(i,Mv,[])}const Rv=["s","static"];function AA(i){return cn(i,Rv)}const Fv=["i","items"];function CA(i){return cn(i,Fv,[])}const kv=["t","type"];function Ip(i){return cn(i,kv)}const Lv=["v","value"];function $l(i,t){const e=cn(i,Lv);if(e!=null)return e;throw Ko(t)}const Bv=["m","modifier"];function IA(i){return cn(i,Bv)}const Ov=["k","key"];function PA(i){const t=cn(i,Ov);if(t)return t;throw Ko(6)}function cn(i,t,e){for(let s=0;s<t.length;s++){const r=t[s];if(qs(i,r)&&i[r]!=null)return i[r]}return e}const Dv=[...Pv,...Mv,...Rv,...Fv,...Ov,...Bv,...Lv,...kv];function Ko(i){return new Error(`unhandled node type: ${i}`)}function cd(i){return e=>MA(e,i)}function MA(i,t){const e=SA(t);if(e==null)throw Ko(0);if(Ip(e)===1){const n=EA(e);return i.plural(n.reduce((a,o)=>[...a,b0(i,o)],[]))}else return b0(i,e)}function b0(i,t){const e=AA(t);if(e!=null)return i.type==="text"?e:i.normalize([e]);{const s=CA(t).reduce((r,n)=>[...r,nm(i,n)],[]);return i.normalize(s)}}function nm(i,t){const e=Ip(t);switch(e){case 3:return $l(t,e);case 9:return $l(t,e);case 4:{const s=t;if(qs(s,"k")&&s.k)return i.interpolate(i.named(s.k));if(qs(s,"key")&&s.key)return i.interpolate(i.named(s.key));throw Ko(e)}case 5:{const s=t;if(qs(s,"i")&&Ne(s.i))return i.interpolate(i.list(s.i));if(qs(s,"index")&&Ne(s.index))return i.interpolate(i.list(s.index));throw Ko(e)}case 6:{const s=t,r=IA(s),n=PA(s);return i.linked(nm(i,n),r?nm(i,r):void 0,i.type)}case 7:return $l(t,e);case 8:return $l(t,e);default:throw new Error(`unhandled node on format message part: ${e}`)}}const RA=i=>i;let Hl=he();function FA(i,t={}){let e=!1;const s=t.onError||QE;return t.onError=r=>{e=!0,s(r)},{...wA(i,t),detectError:e}}function kA(i,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Et(i)){ie(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||RA)(i),r=Hl[s];if(r)return r;const{ast:n,detectError:a}=FA(i,{...t,location:!1,jit:!0}),o=cd(n);return a?o:Hl[s]=o}else{if(!$n(i))return(()=>i);const e=i.cacheKey;if(e){const s=Hl[e];return s||(Hl[e]=cd(i))}else return cd(i)}}let Zo=null;function LA(i){Zo=i}function BA(i,t,e){Zo&&Zo.emit("i18n:init",{timestamp:Date.now(),i18n:i,version:t,meta:e})}const OA=DA("function:translate");function DA(i){return t=>Zo&&Zo.emit(i,t)}const di={INVALID_ARGUMENT:JE,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},NA=24;function fi(i){return Uc(i,null,void 0)}function Pp(i,t){return t.locale!=null?v0(t.locale):v0(i.locale)}let ud;function v0(i){if(Et(i))return i;if(ve(i)){if(i.resolvedOnce&&ud!=null)return ud;if(i.constructor.name==="Function"){const t=i();if(kE(t))throw fi(di.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return ud=t}else throw fi(di.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw fi(di.NOT_SUPPORT_LOCALE_TYPE)}function UA(i,t,e){return[...new Set([e,..._e(t)?t:se(t)?Object.keys(t).filter(s=>s!=="default"):Et(t)?[t]:[e]])]}function XA(i,t,e){const s=Et(e)?e:Jo,r=i;let n;se(t)?(r.__localeChainObjectCache||(r.__localeChainObjectCache=new WeakMap),n=r.__localeChainObjectCache.get(t),n||(n=new Map,r.__localeChainObjectCache.set(t,n))):(r.__localeChainCache||(r.__localeChainCache=new Map),n=r.__localeChainCache.get(t),n||(n=new Map,r.__localeChainCache.set(t,n)));const a=n.get(s);if(a)return a;const o=[];let h=[e];for(;_e(h);)h=_0(o,h,t);const l=_e(t)||!de(t)?t:t.default?t.default:null;return h=Et(l)?[l]:l,_e(h)&&_0(o,h,!1),n.set(s,o),o}function _0(i,t,e){let s=!0;for(let r=0;r<t.length&&ie(s);r++){const n=t[r];Et(n)&&(s=VA(i,t[r],e))}return s}function VA(i,t,e){let s;const r=t.split("-");do{const n=r.join("-");s=YA(i,n,e),r.splice(-1,1)}while(r.length&&s===!0);return s}function YA(i,t,e){let s=!1;if(!i.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const r=t.replace(/!/g,"");i.push(r),(_e(e)||de(e))&&e[r]&&(s=e[r])}return s}const un=[];un[0]={w:[0],i:[3,0],"[":[4],o:[7]};un[1]={w:[1],".":[2],"[":[4],o:[7]};un[2]={w:[2],i:[3,0],0:[3,0]};un[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};un[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};un[5]={"'":[4,0],o:8,l:[5,0]};un[6]={'"':[4,0],o:8,l:[6,0]};const GA=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function $A(i){return GA.test(i)}function HA(i){const t=i.charCodeAt(0),e=i.charCodeAt(i.length-1);return t===e&&(t===34||t===39)?i.slice(1,-1):i}function WA(i){if(i==null)return"o";switch(i.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return i;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function zA(i){const t=i.trim();return i.charAt(0)==="0"&&isNaN(parseInt(i))?!1:$A(t)?HA(t):"*"+t}function jA(i){const t=[];let e=-1,s=0,r=0,n,a,o,h,l,c,u;const d=[];d[0]=()=>{a===void 0?a=o:a+=o},d[1]=()=>{a!==void 0&&(t.push(a),a=void 0)},d[2]=()=>{d[0](),r++},d[3]=()=>{if(r>0)r--,s=4,d[0]();else{if(r=0,a===void 0||(a=zA(a),a===!1))return!1;d[1]()}};function f(){const m=i[e+1];if(s===5&&m==="'"||s===6&&m==='"')return e++,o="\\"+m,d[0](),!0}for(;s!==null;)if(e++,n=i[e],!(n==="\\"&&f())){if(h=WA(n),u=un[s],l=u[h]||u.l||8,l===8||(s=l[0],l[1]!==void 0&&(c=d[l[1]],c&&(o=n,c()===!1))))return;if(s===7)return t}}const w0=new Map;function qA(i,t){return se(i)?qe(i,t):null}function KA(i,t){if(!se(i))return null;let e=w0.get(t);if(e||(e=jA(t),e&&w0.set(t,e)),!e)return null;const s=e.length;let r=i,n=0;for(;n<s;){const a=e[n];if(Dv.includes(a)&&$n(r)||!se(r)||!qs(r,a))return null;const o=r[a];if(o===void 0||ve(r))return null;r=o,n++}return r}const ZA="11.4.16",Xc=-1,Jo="en-US",Vh="",T0=i=>`${i.charAt(0).toLocaleUpperCase()}${i.substr(1)}`;function JA(){return{upper:(i,t)=>t==="text"&&Et(i)?i.toUpperCase():t==="vnode"&&se(i)&&"__v_isVNode"in i?i.children.toUpperCase():i,lower:(i,t)=>t==="text"&&Et(i)?i.toLowerCase():t==="vnode"&&se(i)&&"__v_isVNode"in i?i.children.toLowerCase():i,capitalize:(i,t)=>t==="text"&&Et(i)?T0(i):t==="vnode"&&se(i)&&"__v_isVNode"in i?T0(i.children):i}}let Nv;function QA(i){Nv=i}let Uv;function tC(i){Uv=i}let Xv;function eC(i){Xv=i}let Vv=null;const sC=i=>{Vv=i},rC=()=>Vv;let Yv=null;const S0=i=>{Yv=i},iC=()=>Yv;let E0=0;function nC(i={}){const t=ve(i.onWarn)?i.onWarn:BE,e=Et(i.version)?i.version:ZA,s=Et(i.locale)||ve(i.locale)?i.locale:Jo,r=ve(s)?Jo:s,n=_e(i.fallbackLocale)||de(i.fallbackLocale)||Et(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:r,a=de(i.messages)?i.messages:dd(r),o=de(i.datetimeFormats)?i.datetimeFormats:dd(r),h=de(i.numberFormats)?i.numberFormats:dd(r),l=Le(he(),i.modifiers,JA()),c=i.pluralRules||he(),u=ve(i.missing)?i.missing:null,d=ie(i.missingWarn)||Xa(i.missingWarn)?i.missingWarn:!0,f=ie(i.fallbackWarn)||Xa(i.fallbackWarn)?i.fallbackWarn:!0,m=!!i.fallbackFormat,p=!!i.unresolving,g=ve(i.postTranslation)?i.postTranslation:null,y=de(i.processor)?i.processor:null,_=ie(i.warnHtmlMessage)?i.warnHtmlMessage:!0,v=!!i.escapeParameter,b=ve(i.messageCompiler)?i.messageCompiler:Nv,T=ve(i.messageResolver)?i.messageResolver:Uv||qA,S=ve(i.localeFallbacker)?i.localeFallbacker:Xv||UA,w=se(i.fallbackContext)?i.fallbackContext:void 0,E=i,A=se(E.__datetimeFormatters)?E.__datetimeFormatters:new Map,P=se(E.__numberFormatters)?E.__numberFormatters:new Map,I=se(E.__meta)?E.__meta:{};E0++;const C={version:e,cid:E0,locale:s,fallbackLocale:n,messages:a,modifiers:l,pluralRules:c,missing:u,missingWarn:d,fallbackWarn:f,fallbackFormat:m,unresolving:p,postTranslation:g,processor:y,warnHtmlMessage:_,escapeParameter:v,messageCompiler:b,messageResolver:T,localeFallbacker:S,fallbackContext:w,onWarn:t,__meta:I};return C.datetimeFormats=o,C.numberFormats=h,C.__datetimeFormatters=A,C.__numberFormatters=P,__INTLIFY_PROD_DEVTOOLS__&&BA(C,e,I),C}const dd=i=>({[i]:he()});function Gv(i,t,e,s,r){const{missing:n,onWarn:a}=i;if(n!==null){const o=n(i,e,t,r);return Et(o)?o:t}else return t}function A0(i,t){var s,r;const e=i;se(t)?(s=e.__localeChainObjectCache)==null||s.delete(t):(r=e.__localeChainCache)==null||r.delete(t)}function Wl(i,t,e){A0(i,e),i.fallbackContext&&A0(i.fallbackContext,e),i.localeFallbacker(i,e,t)}function aC(i,t){return i===t?!1:i.split("-")[0]===t.split("-")[0]}function oC(i,t){const e=t.indexOf(i);if(e===-1)return!1;for(let s=e+1;s<t.length;s++)if(aC(i,t[s]))return!0;return!1}function $v(i,t,e,s,r,n,a){const{fallbackLocale:o,localeFallbacker:h,onWarn:l}=i,c=h(i,o,e);for(let u=0;u<c.length;u++){const d=c[u],f=qe(qe(s,d)||{},t);if(de(f)&&Et(d))return d;Gv(i,t,d,r,a)}return null}function Hv(i,t,e){let s=`${i}__${t}`;return de(e)&&!Tp(e)&&(s=`${s}__${JSON.stringify(e)}`),s}function Wv(i,t,e){for(const s in e){const r=`${t}__${s}`;for(const n of i.keys())(n===r||n.startsWith(`${r}__`))&&i.delete(n)}}function zv(i,t,e,s){const[,r,n,a]=i;let o=e;return Et(r)?t.key=r:de(r)&&Object.keys(r).forEach(h=>{s.includes(h)?o[h]=r[h]:t[h]=r[h]}),Et(n)?t.locale=n:de(n)&&(o=n),de(a)&&(o=a),o}function C0(i,...t){const{datetimeFormats:e,unresolving:s,onWarn:r}=i,{__datetimeFormatters:n}=i;if(!Et(t[0])&&!Av(t[0])&&!Ne(t[0]))return Vh;const[a,o,h,l]=am(...t),c=ie(h.missingWarn)?h.missingWarn:i.missingWarn,u=ie(h.fallbackWarn)?h.fallbackWarn:i.fallbackWarn,d=!!h.part,f=Pp(i,h);if(!Et(a)||a===""){const _=new Intl.DateTimeFormat(f.replace(/!/g,""),l);return d?_.formatToParts(o):_.format(o)}const m=$v(i,a,f,e,c,u,"datetime format");if(!Et(m))return s?Xc:a;const p=e[m][a],g=Hv(m,a,l);let y=n.get(g);return y||(y=new Intl.DateTimeFormat(m,Le({},p,l)),n.set(g,y)),d?y.formatToParts(o):y.format(o)}const jv=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function am(...i){const[t]=i,e=he(),s=he();let r;if(Et(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw fi(di.INVALID_ISO_DATE_ARGUMENT);const o=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();r=new Date(o);try{r.toISOString()}catch{throw fi(di.INVALID_ISO_DATE_ARGUMENT)}}else if(Av(t)){if(isNaN(t.getTime()))throw fi(di.INVALID_DATE_ARGUMENT);r=t}else if(Ne(t))r=t;else throw fi(di.INVALID_ARGUMENT);const n=zv(i,e,s,jv);return[e.key||"",r,e,n]}function I0(i,t,e){Wv(i.__datetimeFormatters,t,e)}function P0(i,...t){const{numberFormats:e,unresolving:s,onWarn:r}=i,{__numberFormatters:n}=i;if(!Ne(t[0]))return Vh;const[a,o,h,l]=om(...t),c=ie(h.missingWarn)?h.missingWarn:i.missingWarn,u=ie(h.fallbackWarn)?h.fallbackWarn:i.fallbackWarn,d=!!h.part,f=Pp(i,h);if(!Et(a)||a===""){const _=new Intl.NumberFormat(f.replace(/!/g,""),l);return d?_.formatToParts(o):_.format(o)}const m=$v(i,a,f,e,c,u,"number format");if(!Et(m))return s?Xc:a;const p=e[m][a],g=Hv(m,a,l);let y=n.get(g);return y||(y=new Intl.NumberFormat(m,Le({},p,l)),n.set(g,y)),d?y.formatToParts(o):y.format(o)}const qv=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function om(...i){const[t]=i,e=he(),s=he();if(!Ne(t))throw fi(di.INVALID_ARGUMENT);const r=t,n=zv(i,e,s,qv);return[e.key||"",r,e,n]}function M0(i,t,e){Wv(i.__numberFormatters,t,e)}const lC=i=>i,hC=i=>"",cC="text",uC=i=>i.length===0?"":Ep(i),dC=LE;function fd(i,t){return i=Math.abs(i),t===2?i===1?0:1:Math.min(i,2)}function fC(i){var e,s;const t=Ne(i.pluralIndex)?i.pluralIndex:-1;return Ne((e=i.named)==null?void 0:e.count)?i.named.count:Ne((s=i.named)==null?void 0:s.n)?i.named.n:t}function mC(i={}){var _,v,b;const t=i.locale,e=fC(i),s=Et(t)&&i.pluralRules&&ve(qe(i.pluralRules,t))?i.pluralRules[t]:fd,r=s===fd?void 0:fd,n=T=>T[s(e,T.length,r)],a=i.list||[],o=T=>a[T],h=i.named||he(),l=Ne(i.pluralIndex),c=T=>{const S=Cv(T)?qe(h,T):h[T];return l&&!S&&(T==="count"||T==="n")?i.pluralIndex:S};function u(T,S){const w=ve(i.messages)?i.messages(T,!!S):se(i.messages)?i.messages[T]:!1;return w||(i.parent?i.parent.message(T):hC)}const d=T=>i.modifiers?qe(i.modifiers,T):lC,f=ve((_=i.processor)==null?void 0:_.normalize)?i.processor.normalize:uC,m=ve((v=i.processor)==null?void 0:v.interpolate)?i.processor.interpolate:dC,p=Et((b=i.processor)==null?void 0:b.type)?i.processor.type:cC,y={list:o,named:c,plural:n,linked:(T,...S)=>{const[w,E]=S;let A="text",P="";S.length===1?se(w)?(P=w.modifier||P,A=w.type||A):Et(w)&&(P=w||P):S.length===2&&(Et(w)&&(P=w||P),Et(E)&&(A=E||A));const I=u(T,!0)(y),C=I===""||I===void 0?T:I,R=A==="vnode"&&_e(C)&&P?C[0]:C;if(!P)return R;const F=d(P);return ve(F)?F(R,A):R},message:u,type:p,interpolate:m,normalize:f,values:Le(he(),a,h,l?{count:c("count"),n:c("n")}:{})};return y}const R0=()=>"",mi=i=>ve(i),Yh=i=>Et(i)||$n(i)||mi(i);function F0(i,...t){const{fallbackFormat:e,postTranslation:s,unresolving:r,messageCompiler:n,fallbackLocale:a,messages:o}=i,[h,l]=lm(...t),c=ie(l.missingWarn)?l.missingWarn:i.missingWarn,u=ie(l.fallbackWarn)?l.fallbackWarn:i.fallbackWarn,d=ie(l.escapeParameter)?l.escapeParameter:i.escapeParameter,f=!!l.resolvedMessage,m=Et(l.default)||ie(l.default)?ie(l.default)?n?h:()=>h:l.default:e?n?h:()=>h:null,p=e||m!=null&&(Et(m)||ve(m)),g=Pp(i,l);d&&pC(l);let[y,_,v]=f?[h,g,qe(o,g)||he()]:Kv(i,h,g,a,u,c),b=y,T=h;if(!f&&!Yh(b)&&p&&(b=m,T=b),!f&&(!Yh(b)||!Et(_)))return r?Xc:h;let S=!1;const w=()=>{S=!0},E=mi(b)?b:Zv(i,h,_,b,T,w);if(S)return b;const A=xC(i,_,v,l),P=mC(A),I=gC(i,E,P);let C=s?s(I,h):I;if(d&&Et(C)&&(C=KE(C)),__INTLIFY_PROD_DEVTOOLS__){const R={timestamp:Date.now(),key:Et(h)?h:mi(b)?b.key:"",locale:_||(mi(b)?b.locale:""),format:Et(b)?b:mi(b)?b.source:"",message:C};R.meta=Le({},i.__meta,rC()||{}),OA(R)}return C}function pC(i){if(_e(i.list)&&(i.list=i.list.map(t=>Et(t)?f0(t):t)),se(i.named)){const t=i.named,e=he();for(const s of Object.keys(t)){const r=t[s];e[s]=Et(r)?f0(r):r}i.named=e}}function Kv(i,t,e,s,r,n){const{messages:a,onWarn:o,messageResolver:h,localeFallbacker:l}=i,c=l(i,s,e);let u=he(),d,f=null;const m="translate";for(let p=0;p<c.length&&(d=c[p],u=qe(a,d)||he(),(f=h(u,t))===null&&(f=qe(u,t)),!Yh(f));p++)if(!oC(d,c)){const g=Gv(i,t,d,n,m);g!==t&&(f=g)}return[f,d,u]}function Zv(i,t,e,s,r,n){const{messageCompiler:a,warnHtmlMessage:o}=i;if(mi(s)){const l=s;return l.locale=l.locale||e,l.key=l.key||t,l}if(a==null){const l=(()=>s);return l.locale=e,l.key=t,l}const h=a(s,yC(i,e,r,s,o,n));return h.locale=e,h.key=t,h.source=s,h}function gC(i,t,e){return t(e)}function lm(...i){const[t,e,s]=i,r=he();if(!Et(t)&&!Ne(t)&&!mi(t)&&!$n(t))throw fi(di.INVALID_ARGUMENT);const n=Ne(t)?String(t):(mi(t),t);return Ne(e)?r.plural=e:Et(e)?r.default=e:de(e)&&!Tp(e)?r.named=e:_e(e)&&(r.list=e),Ne(s)?r.plural=s:Et(s)?r.default=s:de(s)&&Le(r,s),[n,r]}function yC(i,t,e,s,r,n){return{locale:t,key:e,warnHtmlMessage:r,onError:a=>{throw n&&n(a),a},onCacheKey:a=>PE(t,e,a)}}function xC(i,t,e,s){const{modifiers:r,pluralRules:n,messageResolver:a,fallbackLocale:o,fallbackWarn:h,missingWarn:l,fallbackContext:c}=i,d={locale:t,modifiers:r,pluralRules:n,messages:(f,m)=>{let p=a(e,f);if(p==null&&(c||m)){const[g,,y]=Kv(c||i,f,t,o,h,l);p=g??a(y,f)}if(Et(p)||$n(p)){let g=!1;const _=Zv(i,f,t,p,f,()=>{g=!0});return g?R0:_}else return mi(p)?p:R0}};return i.processor&&(d.processor=i.processor),s.list&&(d.list=s.list),s.named&&(d.named=s.named),Ne(s.plural)&&(d.pluralIndex=s.plural),d}TA();/*!
|
||
* vue-i18n v11.4.16
|
||
* (c) 2026 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/const bC="11.4.16";function vC(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ki().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ki().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ki().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ki().__INTLIFY_PROD_DEVTOOLS__=!1)}const ws={UNEXPECTED_RETURN_TYPE:NA,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Is(i,...t){return Uc(i,null,void 0)}const hm=hn("__translateVNode"),cm=hn("__datetimeParts"),um=hn("__numberParts"),Jv=hn("__setPluralRules"),Qv=hn("__injectWithOption"),ya=hn("__dispose");let t_=null;{const i=Ki().__VUE_INSTANCE_SETTERS__;_e(i)&&i.push(t=>{t_=t})}function $i(i){return!!Cv(i)}function Qo(i){if(!se(i)||$n(i))return i;for(const t in i)if(qs(i,t))if(!t.includes("."))se(i[t])&&Qo(i[t]);else{const e=t.split("."),s=e.length-1;let r=i,n=!1;for(let o=0;o<s;o++){if(e[o]==="__proto__")throw new Error(`unsafe key: ${e[o]}`);if(e[o]in r||(r[e[o]]=he()),!se(r[e[o]])){n=!0;break}if($n(r[e[o]])&&(Dv.includes(e[o+1])||e[o+1]==="cacheKey")){n=!0;break}r=r[e[o]]}n||(r[e[s]]=i[t],delete i[t]);const a=r[e[s]];se(a)&&Qo(a)}return i}function Mp(i,t){const{messages:e,__i18n:s,messageResolver:r,flatJson:n}=t,a=de(e)?e:_e(s)?he():{[i]:he()};if(_e(s)&&s.forEach(o=>{if("locale"in o&&"resource"in o){const{locale:h,resource:l}=o;if(h){if($i(h))return;a[h]=qe(a,h)||he(),vh(l,a[h])}else vh(l,a)}else Et(o)&&vh(JSON.parse(o),a)}),r==null&&n)for(const o in a)qs(a,o)&&Qo(a[o]);return a}function e_(i){return i.type}function s_(i,t,e){let s=se(t.messages)?t.messages:he();"__i18nGlobal"in e&&(s=Mp(i.locale.value,{messages:s,__i18n:e.__i18nGlobal}));const r=Object.keys(s);r.length&&r.forEach(n=>{i.mergeLocaleMessage(n,s[n])});{if(se(t.datetimeFormats)){const n=Object.keys(t.datetimeFormats);n.length&&n.forEach(a=>{i.mergeDateTimeFormat(a,t.datetimeFormats[a])})}if(se(t.numberFormats)){const n=Object.keys(t.numberFormats);n.length&&n.forEach(a=>{i.mergeNumberFormat(a,t.numberFormats[a])})}}}function k0(i){return ds(Sl,null,i,0)}function tl(){return t_??Oc()}const L0="__INTLIFY_META__",B0=()=>[],_C=()=>!1;let O0=0;function D0(i){return((t,e,s,r)=>i(e,s,tl()||void 0,r))}const wC=()=>{const i=tl();let t=null;return i&&(t=e_(i)[L0])?{[L0]:t}:null};function Gh(i={}){const{__root:t,__injectWithOption:e}=i,s=t===void 0,r=i.flatJson,n=Xh?Fb:wT;let a=ie(i.inheritLocale)?i.inheritLocale:!0;const o=n(t&&a?t.locale.value:Et(i.locale)?i.locale:Jo),h=n(t&&a?t.fallbackLocale.value:Et(i.fallbackLocale)||_e(i.fallbackLocale)||de(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:o.value),l=n(Mp(o.value,i)),c=n(de(i.datetimeFormats)?i.datetimeFormats:{[o.value]:{}}),u=n(de(i.numberFormats)?i.numberFormats:{[o.value]:{}});let d=t?t.missingWarn:ie(i.missingWarn)||Xa(i.missingWarn)?i.missingWarn:!0,f=t?t.fallbackWarn:ie(i.fallbackWarn)||Xa(i.fallbackWarn)?i.fallbackWarn:!0,m=t?t.fallbackRoot:ie(i.fallbackRoot)?i.fallbackRoot:!0,p=!!i.fallbackFormat,g=ve(i.missing)?i.missing:null,y=ve(i.missing)?D0(i.missing):null,_=ve(i.postTranslation)?i.postTranslation:null,v=t?t.warnHtmlMessage:ie(i.warnHtmlMessage)?i.warnHtmlMessage:!0,b=!!i.escapeParameter;const T=t?t.modifiers:de(i.modifiers)?i.modifiers:{};let S=i.pluralRules||t&&t.pluralRules,w;w=(()=>{s&&S0(null);const st={version:bC,locale:o.value,fallbackLocale:h.value,messages:l.value,modifiers:T,pluralRules:S,missing:y===null?void 0:y,missingWarn:d,fallbackWarn:f,fallbackFormat:p,unresolving:!0,postTranslation:_===null?void 0:_,warnHtmlMessage:v,escapeParameter:b,messageResolver:i.messageResolver,messageCompiler:i.messageCompiler,__meta:{framework:"vue"}};st.datetimeFormats=c.value,st.numberFormats=u.value;const lt=nC(st);return s&&S0(lt),lt})(),Wl(w,o.value,h.value);function A(){return[o.value,h.value,l.value,c.value,u.value]}const P=Mn({get:()=>o.value,set:st=>{w.locale=st,o.value=st}});function I(st){s||(w.fallbackContext=iC());try{return st()}finally{s||(w.fallbackContext=void 0)}}function C(st){I(()=>Wl(w,o.value,st))}const R=Mn({get:()=>h.value,set:st=>{h.value=st,w.fallbackLocale=h.value,C(h.value)}}),F=Mn(()=>l.value),D=Mn(()=>c.value),M=Mn(()=>u.value);function O(){return ve(_)?_:null}function k(st){_=st,w.postTranslation=st}function N(){return g}function B(st){st!==null&&(y=D0(st)),g=st,w.missing=y}const L=(st,lt,kt,Xt,Pe,Ss)=>{A();let Es;try{__INTLIFY_PROD_DEVTOOLS__,Es=I(()=>st(w))}finally{__INTLIFY_PROD_DEVTOOLS__}if(kt!=="translate exists"&&Ne(Es)&&Es===Xc||kt==="translate exists"&&!Es){const[Li,Xe]=lt();return t&&m?Xt(t):Pe(Li)}else{if(Ss(Es))return Es;throw Is(ws.UNEXPECTED_RETURN_TYPE)}};function G(...st){return L(lt=>Reflect.apply(F0,null,[lt,...st]),()=>lm(...st),"translate",lt=>Reflect.apply(lt.t,lt,[...st]),lt=>lt,lt=>Et(lt))}function V(...st){const[lt,kt,Xt]=st;if(Xt&&!se(Xt))throw Is(ws.INVALID_ARGUMENT);return G(lt,kt,Le({resolvedMessage:!0},Xt||{}))}function q(...st){return L(lt=>Reflect.apply(C0,null,[lt,...st]),()=>am(...st),"datetime format",lt=>Reflect.apply(lt.d,lt,[...st]),()=>Vh,lt=>Et(lt)||_e(lt))}function H(...st){return L(lt=>Reflect.apply(P0,null,[lt,...st]),()=>om(...st),"number format",lt=>Reflect.apply(lt.n,lt,[...st]),()=>Vh,lt=>Et(lt)||_e(lt))}function at(st){return st.map(lt=>Et(lt)||Ne(lt)||ie(lt)?k0(String(lt)):lt)}const ot={normalize:at,interpolate:st=>st,type:"vnode"};function ct(...st){return L(lt=>{let kt;const Xt=lt;try{Xt.processor=ot,kt=Reflect.apply(F0,null,[Xt,...st])}finally{Xt.processor=null}return kt},()=>lm(...st),"translate",lt=>lt[hm](...st),lt=>[k0(lt)],lt=>_e(lt))}function rt(...st){return L(lt=>Reflect.apply(P0,null,[lt,...st]),()=>om(...st),"number format",lt=>lt[um](...st),B0,lt=>Et(lt)||_e(lt))}function dt(...st){return L(lt=>Reflect.apply(C0,null,[lt,...st]),()=>am(...st),"datetime format",lt=>lt[cm](...st),B0,lt=>Et(lt)||_e(lt))}function X(st){S=st,w.pluralRules=S}function $(st,lt){const kt=it(st),Xt=w.messageResolver(kt,lt);return Xt===null?qe(kt,lt):Xt}function K(st,lt){return L(()=>{if(!st)return!1;const kt=Et(lt)?lt:o.value,Xt=Et(lt)?[kt]:w.localeFallbacker(w,h.value,kt);for(let Pe=0;Pe<Xt.length;Pe++)if(Yh($(Xt[Pe],st)))return!0;return!1},()=>[st],"translate exists",kt=>Reflect.apply(kt.te,kt,[st,lt]),_C,kt=>ie(kt))}function J(st){let lt=null;const kt=w.localeFallbacker(w,h.value,o.value);for(let Xt=0;Xt<kt.length;Xt++){const Pe=$(kt[Xt],st);if(Pe!=null){lt=Pe;break}}return lt}function Q(st){const lt=J(st);return lt??(t?t.tm(st)||{}:{})}function it(st){return qe(l.value,st)||{}}function U(st,lt){$i(st)||(r&&Qo(lt),l.value[st]=lt,w.messages=l.value)}function Y(st,lt){$i(st)||(l.value[st]=qe(l.value,st)||{},r&&Qo(lt),vh(lt,l.value[st]),w.messages=l.value)}function W(st){return qe(c.value,st)||{}}function j(st,lt){$i(st)||(c.value[st]=lt,w.datetimeFormats=c.value,I0(w,st,lt))}function mt(st,lt){$i(st)||(c.value[st]=Le(qe(c.value,st)||{},lt),w.datetimeFormats=c.value,I0(w,st,lt))}function ut(st){return qe(u.value,st)||{}}function vt(st,lt){$i(st)||(u.value[st]=lt,w.numberFormats=u.value,M0(w,st,lt))}function Rt(st,lt){$i(st)||(u.value[st]=Le(qe(u.value,st)||{},lt),w.numberFormats=u.value,M0(w,st,lt))}O0++,tn(h,()=>C(h.value),{deep:!0,flush:"sync"}),t&&Xh&&(tn(t.locale,st=>{a&&(o.value=st,w.locale=st,Wl(w,o.value,h.value))}),tn(t.fallbackLocale,st=>{a&&(h.value=st,w.fallbackLocale=h.value,Wl(w,o.value,h.value))}));const Pt={id:O0,locale:P,fallbackLocale:R,get inheritLocale(){return a},set inheritLocale(st){a=st,st&&t&&(P.value=t.locale.value,R.value=t.fallbackLocale.value)},get availableLocales(){return Object.keys(l.value).sort()},messages:F,get modifiers(){return T},get pluralRules(){return S||{}},get isGlobal(){return s},get missingWarn(){return d},set missingWarn(st){d=st,w.missingWarn=d},get fallbackWarn(){return f},set fallbackWarn(st){f=st,w.fallbackWarn=f},get fallbackRoot(){return m},set fallbackRoot(st){m=st},get fallbackFormat(){return p},set fallbackFormat(st){p=st,w.fallbackFormat=p},get warnHtmlMessage(){return v},set warnHtmlMessage(st){v=st,w.warnHtmlMessage=st},get escapeParameter(){return b},set escapeParameter(st){b=st,w.escapeParameter=st},t:G,getLocaleMessage:it,setLocaleMessage:U,mergeLocaleMessage:Y,getPostTranslationHandler:O,setPostTranslationHandler:k,getMissingHandler:N,setMissingHandler:B,[Jv]:X};return Pt.datetimeFormats=D,Pt.numberFormats=M,Pt.rt=V,Pt.te=K,Pt.tm=Q,Pt.d=q,Pt.n=H,Pt.getDateTimeFormat=W,Pt.setDateTimeFormat=j,Pt.mergeDateTimeFormat=mt,Pt.getNumberFormat=ut,Pt.setNumberFormat=vt,Pt.mergeNumberFormat=Rt,Pt[Qv]=e,Pt[hm]=ct,Pt[cm]=dt,Pt[um]=rt,Pt}function TC(i){const t=Et(i.locale)?i.locale:Jo,e=Et(i.fallbackLocale)||_e(i.fallbackLocale)||de(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:t,s=ve(i.missing)?i.missing:void 0,r=ie(i.silentTranslationWarn)||Xa(i.silentTranslationWarn)?!i.silentTranslationWarn:!0,n=ie(i.silentFallbackWarn)||Xa(i.silentFallbackWarn)?!i.silentFallbackWarn:!0,a=ie(i.fallbackRoot)?i.fallbackRoot:!0,o=!!i.formatFallbackMessages,h=de(i.modifiers)?i.modifiers:{},l=i.pluralizationRules,c=ve(i.postTranslation)?i.postTranslation:void 0,u=Et(i.warnHtmlInMessage)?i.warnHtmlInMessage!=="off":!0,d=!!i.escapeParameterHtml,f=ie(i.sync)?i.sync:!0;let m=i.messages;if(de(i.sharedMessages)){const T=i.sharedMessages;m=Object.keys(T).reduce((w,E)=>{if($i(E))return w;const A=qe(w,E)||(w[E]={});return Le(A,T[E]),w},m||{})}const{__i18n:p,__root:g,__injectWithOption:y}=i,_=i.datetimeFormats,v=i.numberFormats,b=i.flatJson;return{locale:t,fallbackLocale:e,messages:m,flatJson:b,datetimeFormats:_,numberFormats:v,missing:s,missingWarn:r,fallbackWarn:n,fallbackRoot:a,fallbackFormat:o,modifiers:h,pluralRules:l,postTranslation:c,warnHtmlMessage:u,escapeParameter:d,messageResolver:i.messageResolver,inheritLocale:f,__i18n:p,__root:g,__injectWithOption:y}}function dm(i={}){const t=Gh(TC(i)),{__extender:e}=i,s={id:t.id,get locale(){return t.locale.value},set locale(r){t.locale.value=r},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(r){t.fallbackLocale.value=r},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(r){t.setMissingHandler(r)},get silentTranslationWarn(){return ie(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(r){t.missingWarn=ie(r)?!r:r},get silentFallbackWarn(){return ie(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(r){t.fallbackWarn=ie(r)?!r:r},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(r){t.fallbackFormat=r},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(r){t.setPostTranslationHandler(r)},get sync(){return t.inheritLocale},set sync(r){t.inheritLocale=r},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){t.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(r){t.escapeParameter=r},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...r){return Reflect.apply(t.t,t,[...r])},rt(...r){return Reflect.apply(t.rt,t,[...r])},te(r,n){return t.te(r,n)},tm(r){return t.tm(r)},getLocaleMessage(r){return t.getLocaleMessage(r)},setLocaleMessage(r,n){t.setLocaleMessage(r,n)},mergeLocaleMessage(r,n){t.mergeLocaleMessage(r,n)},d(...r){return Reflect.apply(t.d,t,[...r])},getDateTimeFormat(r){return t.getDateTimeFormat(r)},setDateTimeFormat(r,n){t.setDateTimeFormat(r,n)},mergeDateTimeFormat(r,n){t.mergeDateTimeFormat(r,n)},n(...r){return Reflect.apply(t.n,t,[...r])},getNumberFormat(r){return t.getNumberFormat(r)},setNumberFormat(r,n){t.setNumberFormat(r,n)},mergeNumberFormat(r,n){t.mergeNumberFormat(r,n)}};return s.__extender=e,s}function SC(i,t,e){return{beforeCreate(){const s=tl();if(!s)throw Is(ws.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const n=Le({},r.i18n);if(r.__i18n&&(n.__i18n=r.__i18n),n.__root=t,this===this.$root)this.$i18n=N0(i,n);else{n.__injectWithOption=!0,n.__extender=e.__vueI18nExtend,this.$i18n=dm(n);const a=this.$i18n;a.__extender&&(a.__disposer=a.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=N0(i,r);else{this.$i18n=dm({__i18n:r.__i18n,__injectWithOption:!0,__extender:e.__vueI18nExtend,__root:t});const n=this.$i18n;n.__extender&&(n.__disposer=n.__extender(this.$i18n))}else this.$i18n=i;r.__i18nGlobal&&s_(t,r,r),this.$t=(...n)=>this.$i18n.t(...n),this.$rt=(...n)=>this.$i18n.rt(...n),this.$te=(n,a)=>this.$i18n.te(n,a),this.$d=(...n)=>this.$i18n.d(...n),this.$n=(...n)=>this.$i18n.n(...n),this.$tm=n=>this.$i18n.tm(n),e.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=tl();if(!s)throw Is(ws.UNEXPECTED_ERROR);const r=this.$i18n;r&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r!=null&&r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),e.__deleteInstance(s),delete this.$i18n)}}}function N0(i,t){i.locale=t.locale||i.locale,i.fallbackLocale=t.fallbackLocale||i.fallbackLocale,i.missing=t.missing||i.missing,i.silentTranslationWarn=t.silentTranslationWarn||i.silentFallbackWarn,i.silentFallbackWarn=t.silentFallbackWarn||i.silentFallbackWarn,i.formatFallbackMessages=t.formatFallbackMessages||i.formatFallbackMessages,i.postTranslation=t.postTranslation||i.postTranslation,i.warnHtmlInMessage=t.warnHtmlInMessage||i.warnHtmlInMessage,i.escapeParameterHtml=t.escapeParameterHtml||i.escapeParameterHtml,i.sync=t.sync||i.sync,i.__composer[Jv](t.pluralizationRules||i.pluralizationRules);const e=Mp(i.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(e).forEach(s=>i.mergeLocaleMessage(s,e[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>i.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>i.mergeNumberFormat(s,t.numberFormats[s])),i}const Rp={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:i=>i==="parent"||i==="global",default:"parent"},i18n:{type:Object}};function EC({slots:i},t){return t.length===1&&t[0]==="default"?(i.default?i.default():[]).reduce((s,r)=>[...s,...r.type===bs?r.children:[r]],[]):t.reduce((e,s)=>{const r=i[s];return r&&(e[s]=r()),e},he())}function r_(){return bs}const AC=gp({name:"i18n-t",props:Le({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:i=>Ne(i)||!isNaN(i)}},Rp),setup(i,t){const{slots:e,attrs:s}=t,r=i.i18n||Fp({useScope:i.scope,__useComponent:!0});return()=>{const n=()=>{const h=Object.keys(e).filter(u=>u[0]!=="_"),l=he();i.locale&&(l.locale=i.locale),i.plural!==void 0&&(l.plural=Et(i.plural)?+i.plural:i.plural);const c=EC(t,h);return r[hm](i.keypath,c,l)},a=Le(he(),s),o=Et(i.tag)||se(i.tag)?i.tag:r_();return se(o)?zo(o,a,{default:n}):zo(o,a,n())}}}),U0=AC;function CC(i){return _e(i)&&!Et(i[0])}function i_(i,t,e,s){const{slots:r,attrs:n}=t;return()=>{const a=()=>{const l={part:!0};let c=he();i.locale&&(l.locale=i.locale),Et(i.format)?l.key=i.format:se(i.format)&&(Et(i.format.key)&&(l.key=i.format.key),c=Object.keys(i.format).reduce((f,m)=>e.includes(m)?Le(he(),f,{[m]:i.format[m]}):f,he()));const u=s(i.value,l,c);let d=[l.key];return _e(u)?d=u.map((f,m)=>{const p=r[f.type],g=p?p({[f.type]:f.value,index:m,parts:u}):[f.value];return CC(g)&&(g[0].key=`${f.type}-${m}`),g}):Et(u)&&(d=[u]),d},o=Le(he(),n),h=Et(i.tag)||se(i.tag)?i.tag:r_();return se(h)?zo(h,o,{default:a}):zo(h,o,a())}}const IC=gp({name:"i18n-n",props:Le({value:{type:Number,required:!0},format:{type:[String,Object]}},Rp),setup(i,t){const e=i.i18n||Fp({useScope:i.scope,__useComponent:!0});return i_(i,t,qv,(...s)=>e[um](...s))}}),X0=IC;function PC(i,t){const e=i;if(i.mode==="composition")return e.__getInstance(t)||i.global;{const s=e.__getInstance(t);return s!=null?s.__composer:i.global.__composer}}function MC(i){const t=a=>{const{instance:o,value:h}=a;if(!o||!o.$)throw Is(ws.UNEXPECTED_ERROR);const l=PC(i,o.$),c=V0(h);return[Reflect.apply(l.t,l,[...Y0(c)]),l]};return{created:(a,o)=>{const[h,l]=t(o);Xh&&(a.__i18nWatcher=tn(l.locale,()=>{o.instance&&o.instance.$forceUpdate()})),a.__composer=l,a.textContent=h},unmounted:a=>{Xh&&a.__i18nWatcher&&(a.__i18nWatcher(),a.__i18nWatcher=void 0,delete a.__i18nWatcher),a.__composer&&(a.__composer=void 0,delete a.__composer)},beforeUpdate:(a,{value:o})=>{if(a.__composer){const h=a.__composer,l=V0(o);a.textContent=Reflect.apply(h.t,h,[...Y0(l)])}},getSSRProps:a=>{const[o]=t(a);return{textContent:o}}}}function V0(i){if(Et(i))return{path:i};if(de(i)){if(!("path"in i))throw Is(ws.REQUIRED_VALUE,"path");return i}else throw Is(ws.INVALID_VALUE)}function Y0(i){const{path:t,locale:e,args:s,choice:r,plural:n}=i,a={},o=s||{};return Et(e)&&(a.locale=e),Ne(r)&&(a.plural=r),Ne(n)&&(a.plural=n),[t,o,a]}function RC(i,t,...e){const s=de(e[0])?e[0]:{};(ie(s.globalInstall)?s.globalInstall:!0)&&([U0.name,"I18nT"].forEach(n=>i.component(n,U0)),[X0.name,"I18nN"].forEach(n=>i.component(n,X0)),[H0.name,"I18nD"].forEach(n=>i.component(n,H0))),i.directive("t",MC(t))}const FC=hn("global-vue-i18n");function OL(i={}){const t=__VUE_I18N_LEGACY_API__&&ie(i.legacy)?i.legacy:__VUE_I18N_LEGACY_API__,e=ie(i.globalInjection)?i.globalInjection:!0,s=new Map,[r,n]=kC(i,t),a=hn("");function o(u){return s.get(u)||null}function h(u,d){s.set(u,d)}function l(u){s.delete(u)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(u,...d){if(u.__VUE_I18N_SYMBOL__=a,u.provide(u.__VUE_I18N_SYMBOL__,c),de(d[0])){const p=d[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let f=null;!t&&e&&(f=XC(u,c.global)),__VUE_I18N_FULL_INSTALL__&&RC(u,c,...d),__VUE_I18N_LEGACY_API__&&t&&u.mixin(SC(n,n.__composer,c));const m=u.unmount;u.unmount=()=>{f&&f(),c.dispose(),m()}},get global(){return n},dispose(){r.stop()},__instances:s,__getInstance:o,__setInstance:h,__deleteInstance:l};return c}function Fp(i={}){const t=tl();if(t==null)throw Is(ws.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Is(ws.NOT_INSTALLED);const e=LC(t),s=OC(e),r=e_(t),n=BC(i,r);if(n==="global")return s_(s,i,r),s;if(n==="parent"){let h=G0(e,t,i.__useComponent);return h==null&&(h=s),h}if(n==="isolated"){if(e.mode!=="composition")throw Is(ws.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const h=e,l=Le({},i),c=G0(e,t);l.__root=c||s;const u=Gh(l);return h.__composerExtend&&(u[ya]=h.__composerExtend(u)),np()&&yb(()=>{const f=u[ya];f&&(f(),delete u[ya])}),u}const a=e;let o=a.__getInstance(t);if(o==null){const h=Le({},i);"__i18n"in r&&(h.__i18n=r.__i18n),s&&(h.__root=s),o=Gh(h),a.__composerExtend&&(o[ya]=a.__composerExtend(o)),NC(a,t,o),a.__setInstance(t,o)}return o}function kC(i,t){const e=ip(),s=__VUE_I18N_LEGACY_API__&&t?e.run(()=>dm(i)):e.run(()=>Gh(i));if(s==null)throw Is(ws.UNEXPECTED_ERROR);return[e,s]}function LC(i){const t=Ca(i.isCE?FC:i.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Is(i.isCE?ws.NOT_INSTALLED_WITH_PROVIDE:ws.UNEXPECTED_ERROR);return t}function BC(i,t){return Tp(i)?"__i18n"in t?"local":"global":i.useScope?i.useScope:"local"}function OC(i){return i.mode==="composition"?i.global:i.global.__composer}function G0(i,t,e=!1){let s=null;const r=t.root;let n=DC(t,e);for(;n!=null;){const a=i;if(i.mode==="composition")s=a.__getInstance(n);else if(__VUE_I18N_LEGACY_API__){const o=a.__getInstance(n);o!=null&&(s=o.__composer,e&&s&&!s[Qv]&&(s=null))}if(s!=null||r===n)break;n=n.parent}return s}function DC(i,t=!1){return i==null?null:t&&i.vnode.ctx||i.parent}function NC(i,t,e){yp(()=>{},t),xp(()=>{const s=e;i.__deleteInstance(t);const r=s[ya];r&&(r(),delete s[ya])},t)}const UC=["locale","fallbackLocale","availableLocales"],$0=["t","rt","d","n","tm","te"];function XC(i,t){const e=Object.create(null);return UC.forEach(r=>{const n=Object.getOwnPropertyDescriptor(t,r);if(!n)throw Is(ws.UNEXPECTED_ERROR);const a=Ce(n.value)?{get(){return n.value.value},set(o){n.value.value=o}}:{get(){return n.get&&n.get()}};Object.defineProperty(e,r,a)}),i.config.globalProperties.$i18n=e,$0.forEach(r=>{const n=Object.getOwnPropertyDescriptor(t,r);if(!n||!n.value)throw Is(ws.UNEXPECTED_ERROR);Object.defineProperty(i.config.globalProperties,`$${r}`,n)}),()=>{delete i.config.globalProperties.$i18n,$0.forEach(r=>{delete i.config.globalProperties[`$${r}`]})}}const VC=gp({name:"i18n-d",props:Le({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rp),setup(i,t){const e=i.i18n||Fp({useScope:i.scope,__useComponent:!0});return i_(i,t,jv,(...s)=>e[cm](...s))}}),H0=VC;vC();QA(kA);tC(KA);eC(XA);if(__INTLIFY_PROD_DEVTOOLS__){const i=Ki();i.__INTLIFY__=!0,LA(i.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}var Kn=(i=>(i[i.WEBGL_LEGACY=0]="WEBGL_LEGACY",i[i.WEBGL=1]="WEBGL",i[i.WEBGL2=2]="WEBGL2",i))(Kn||{}),n_=(i=>(i[i.UNKNOWN=0]="UNKNOWN",i[i.WEBGL=1]="WEBGL",i[i.CANVAS=2]="CANVAS",i))(n_||{}),fm=(i=>(i[i.COLOR=16384]="COLOR",i[i.DEPTH=256]="DEPTH",i[i.STENCIL=1024]="STENCIL",i))(fm||{}),It=(i=>(i[i.NORMAL=0]="NORMAL",i[i.ADD=1]="ADD",i[i.MULTIPLY=2]="MULTIPLY",i[i.SCREEN=3]="SCREEN",i[i.OVERLAY=4]="OVERLAY",i[i.DARKEN=5]="DARKEN",i[i.LIGHTEN=6]="LIGHTEN",i[i.COLOR_DODGE=7]="COLOR_DODGE",i[i.COLOR_BURN=8]="COLOR_BURN",i[i.HARD_LIGHT=9]="HARD_LIGHT",i[i.SOFT_LIGHT=10]="SOFT_LIGHT",i[i.DIFFERENCE=11]="DIFFERENCE",i[i.EXCLUSION=12]="EXCLUSION",i[i.HUE=13]="HUE",i[i.SATURATION=14]="SATURATION",i[i.COLOR=15]="COLOR",i[i.LUMINOSITY=16]="LUMINOSITY",i[i.NORMAL_NPM=17]="NORMAL_NPM",i[i.ADD_NPM=18]="ADD_NPM",i[i.SCREEN_NPM=19]="SCREEN_NPM",i[i.NONE=20]="NONE",i[i.SRC_OVER=0]="SRC_OVER",i[i.SRC_IN=21]="SRC_IN",i[i.SRC_OUT=22]="SRC_OUT",i[i.SRC_ATOP=23]="SRC_ATOP",i[i.DST_OVER=24]="DST_OVER",i[i.DST_IN=25]="DST_IN",i[i.DST_OUT=26]="DST_OUT",i[i.DST_ATOP=27]="DST_ATOP",i[i.ERASE=26]="ERASE",i[i.SUBTRACT=28]="SUBTRACT",i[i.XOR=29]="XOR",i))(It||{}),Yr=(i=>(i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i))(Yr||{}),ft=(i=>(i[i.RGBA=6408]="RGBA",i[i.RGB=6407]="RGB",i[i.RG=33319]="RG",i[i.RED=6403]="RED",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.ALPHA=6406]="ALPHA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i))(ft||{}),Pa=(i=>(i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i))(Pa||{}),wt=(i=>(i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.BYTE=5120]="BYTE",i[i.SHORT=5122]="SHORT",i[i.INT=5124]="INT",i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.HALF_FLOAT=36193]="HALF_FLOAT",i))(wt||{}),Tt=(i=>(i[i.FLOAT=0]="FLOAT",i[i.INT=1]="INT",i[i.UINT=2]="UINT",i))(Tt||{}),Ns=(i=>(i[i.NEAREST=0]="NEAREST",i[i.LINEAR=1]="LINEAR",i))(Ns||{}),Ps=(i=>(i[i.CLAMP=33071]="CLAMP",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i))(Ps||{}),Ms=(i=>(i[i.OFF=0]="OFF",i[i.POW2=1]="POW2",i[i.ON=2]="ON",i[i.ON_MANUAL=3]="ON_MANUAL",i))(Ms||{}),Ke=(i=>(i[i.NPM=0]="NPM",i[i.UNPACK=1]="UNPACK",i[i.PMA=2]="PMA",i[i.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",i[i.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",i[i.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",i))(Ke||{}),Nr=(i=>(i[i.NO=0]="NO",i[i.YES=1]="YES",i[i.AUTO=2]="AUTO",i[i.BLEND=0]="BLEND",i[i.CLEAR=1]="CLEAR",i[i.BLIT=2]="BLIT",i))(Nr||{}),kp=(i=>(i[i.AUTO=0]="AUTO",i[i.MANUAL=1]="MANUAL",i))(kp||{}),Ks=(i=>(i.LOW="lowp",i.MEDIUM="mediump",i.HIGH="highp",i))(Ks||{}),Ye=(i=>(i[i.NONE=0]="NONE",i[i.SCISSOR=1]="SCISSOR",i[i.STENCIL=2]="STENCIL",i[i.SPRITE=3]="SPRITE",i[i.COLOR=4]="COLOR",i))(Ye||{}),De=(i=>(i[i.NONE=0]="NONE",i[i.LOW=2]="LOW",i[i.MEDIUM=4]="MEDIUM",i[i.HIGH=8]="HIGH",i))(De||{}),$r=(i=>(i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i))($r||{});const YC={createCanvas:(i,t)=>{const e=document.createElement("canvas");return e.width=i,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,t)=>fetch(i,t),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")},_t={ADAPTER:YC,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var md=/iPhone/i,W0=/iPod/i,z0=/iPad/i,j0=/\biOS-universal(?:.+)Mac\b/i,pd=/\bAndroid(?:.+)Mobile\b/i,q0=/Android/i,aa=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,zl=/Silk/i,ti=/Windows Phone/i,K0=/\bWindows(?:.+)ARM\b/i,Z0=/BlackBerry/i,J0=/BB10/i,Q0=/Opera Mini/i,ty=/\b(CriOS|Chrome)(?:.+)Mobile/i,ey=/Mobile(?:.+)Firefox\b/i,sy=function(i){return typeof i<"u"&&i.platform==="MacIntel"&&typeof i.maxTouchPoints=="number"&&i.maxTouchPoints>1&&typeof MSStream>"u"};function GC(i){return function(t){return t.test(i)}}function ry(i){var t={userAgent:"",platform:"",maxTouchPoints:0};!i&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof i=="string"?t.userAgent=i:i&&i.userAgent&&(t={userAgent:i.userAgent,platform:i.platform,maxTouchPoints:i.maxTouchPoints||0});var e=t.userAgent,s=e.split("[FBAN");typeof s[1]<"u"&&(e=s[0]),s=e.split("Twitter"),typeof s[1]<"u"&&(e=s[0]);var r=GC(e),n={apple:{phone:r(md)&&!r(ti),ipod:r(W0),tablet:!r(md)&&(r(z0)||sy(t))&&!r(ti),universal:r(j0),device:(r(md)||r(W0)||r(z0)||r(j0)||sy(t))&&!r(ti)},amazon:{phone:r(aa),tablet:!r(aa)&&r(zl),device:r(aa)||r(zl)},android:{phone:!r(ti)&&r(aa)||!r(ti)&&r(pd),tablet:!r(ti)&&!r(aa)&&!r(pd)&&(r(zl)||r(q0)),device:!r(ti)&&(r(aa)||r(zl)||r(pd)||r(q0))||r(/\bokhttp\b/i)},windows:{phone:r(ti),tablet:r(K0),device:r(ti)||r(K0)},other:{blackberry:r(Z0),blackberry10:r(J0),opera:r(Q0),firefox:r(ey),chrome:r(ty),device:r(Z0)||r(J0)||r(Q0)||r(ey)||r(ty)},any:!1,phone:!1,tablet:!1};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}const $C=ry.default??ry,pi=$C(globalThis.navigator);_t.RETINA_PREFIX=/@([0-9\.]+)x/;_t.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var $h=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function a_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function HC(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var t=i.default;if(typeof t=="function"){var e=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),e}var gd={exports:{}},iy;function WC(){return iy||(iy=1,(function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,u||h,d),m=e?e+l:l;return h._events[m]?h._events[m].fn?h._events[m]=[h._events[m],f]:h._events[m].push(f):(h._events[m]=f,h._eventsCount++),h}function a(h,l){--h._eventsCount===0?h._events=new s:delete h._events[l]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,m=new Array(f);d<f;d++)m[d]=u[d].fn;return m},o.prototype.listenerCount=function(l){var c=e?e+l:l,u=this._events[c];return u?u.fn?1:u.length:0},o.prototype.emit=function(l,c,u,d,f,m){var p=e?e+l:l;if(!this._events[p])return!1;var g=this._events[p],y=arguments.length,_,v;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,u),!0;case 4:return g.fn.call(g.context,c,u,d),!0;case 5:return g.fn.call(g.context,c,u,d,f),!0;case 6:return g.fn.call(g.context,c,u,d,f,m),!0}for(v=1,_=new Array(y-1);v<y;v++)_[v-1]=arguments[v];g.fn.apply(g.context,_)}else{var b=g.length,T;for(v=0;v<b;v++)switch(g[v].once&&this.removeListener(l,g[v].fn,void 0,!0),y){case 1:g[v].fn.call(g[v].context);break;case 2:g[v].fn.call(g[v].context,c);break;case 3:g[v].fn.call(g[v].context,c,u);break;case 4:g[v].fn.call(g[v].context,c,u,d);break;default:if(!_)for(T=1,_=new Array(y-1);T<y;T++)_[T-1]=arguments[T];g[v].fn.apply(g[v].context,_)}}return!0},o.prototype.on=function(l,c,u){return n(this,l,c,u,!1)},o.prototype.once=function(l,c,u){return n(this,l,c,u,!0)},o.prototype.removeListener=function(l,c,u,d){var f=e?e+l:l;if(!this._events[f])return this;if(!c)return a(this,f),this;var m=this._events[f];if(m.fn)m.fn===c&&(!d||m.once)&&(!u||m.context===u)&&a(this,f);else{for(var p=0,g=[],y=m.length;p<y;p++)(m[p].fn!==c||d&&!m[p].once||u&&m[p].context!==u)&&g.push(m[p]);g.length?this._events[f]=g.length===1?g[0]:g:a(this,f)}return this},o.prototype.removeAllListeners=function(l){var c;return l?(c=e?e+l:l,this._events[c]&&a(this,c)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,i.exports=o})(gd)),gd.exports}var zC=WC();const Al=a_(zC);var jl={exports:{}},ny;function jC(){if(ny)return jl.exports;ny=1,jl.exports=i,jl.exports.default=i;function i(M,O,k){k=k||2;var N=O&&O.length,B=N?O[0]*k:M.length,L=t(M,0,B,k,!0),G=[];if(!L||L.next===L.prev)return G;var V,q,H,at,et,ot,ct;if(N&&(L=h(M,O,L,k)),M.length>80*k){V=H=M[0],q=at=M[1];for(var rt=k;rt<B;rt+=k)et=M[rt],ot=M[rt+1],et<V&&(V=et),ot<q&&(q=ot),et>H&&(H=et),ot>at&&(at=ot);ct=Math.max(H-V,at-q),ct=ct!==0?32767/ct:0}return s(L,G,k,V,q,ct,0),G}function t(M,O,k,N,B){var L,G;if(B===D(M,O,k,N)>0)for(L=O;L<k;L+=N)G=C(L,M[L],M[L+1],G);else for(L=k-N;L>=O;L-=N)G=C(L,M[L],M[L+1],G);return G&&b(G,G.next)&&(R(G),G=G.next),G}function e(M,O){if(!M)return M;O||(O=M);var k=M,N;do if(N=!1,!k.steiner&&(b(k,k.next)||v(k.prev,k,k.next)===0)){if(R(k),k=O=k.prev,k===k.next)break;N=!0}else k=k.next;while(N||k!==O);return O}function s(M,O,k,N,B,L,G){if(M){!G&&L&&f(M,N,B,L);for(var V=M,q,H;M.prev!==M.next;){if(q=M.prev,H=M.next,L?n(M,N,B,L):r(M)){O.push(q.i/k|0),O.push(M.i/k|0),O.push(H.i/k|0),R(M),M=H.next,V=H.next;continue}if(M=H,M===V){G?G===1?(M=a(e(M),O,k),s(M,O,k,N,B,L,2)):G===2&&o(M,O,k,N,B,L):s(e(M),O,k,N,B,L,1);break}}}}function r(M){var O=M.prev,k=M,N=M.next;if(v(O,k,N)>=0)return!1;for(var B=O.x,L=k.x,G=N.x,V=O.y,q=k.y,H=N.y,at=B<L?B<G?B:G:L<G?L:G,et=V<q?V<H?V:H:q<H?q:H,ot=B>L?B>G?B:G:L>G?L:G,ct=V>q?V>H?V:H:q>H?q:H,rt=N.next;rt!==O;){if(rt.x>=at&&rt.x<=ot&&rt.y>=et&&rt.y<=ct&&y(B,V,L,q,G,H,rt.x,rt.y)&&v(rt.prev,rt,rt.next)>=0)return!1;rt=rt.next}return!0}function n(M,O,k,N){var B=M.prev,L=M,G=M.next;if(v(B,L,G)>=0)return!1;for(var V=B.x,q=L.x,H=G.x,at=B.y,et=L.y,ot=G.y,ct=V<q?V<H?V:H:q<H?q:H,rt=at<et?at<ot?at:ot:et<ot?et:ot,dt=V>q?V>H?V:H:q>H?q:H,X=at>et?at>ot?at:ot:et>ot?et:ot,$=p(ct,rt,O,k,N),K=p(dt,X,O,k,N),J=M.prevZ,Q=M.nextZ;J&&J.z>=$&&Q&&Q.z<=K;){if(J.x>=ct&&J.x<=dt&&J.y>=rt&&J.y<=X&&J!==B&&J!==G&&y(V,at,q,et,H,ot,J.x,J.y)&&v(J.prev,J,J.next)>=0||(J=J.prevZ,Q.x>=ct&&Q.x<=dt&&Q.y>=rt&&Q.y<=X&&Q!==B&&Q!==G&&y(V,at,q,et,H,ot,Q.x,Q.y)&&v(Q.prev,Q,Q.next)>=0))return!1;Q=Q.nextZ}for(;J&&J.z>=$;){if(J.x>=ct&&J.x<=dt&&J.y>=rt&&J.y<=X&&J!==B&&J!==G&&y(V,at,q,et,H,ot,J.x,J.y)&&v(J.prev,J,J.next)>=0)return!1;J=J.prevZ}for(;Q&&Q.z<=K;){if(Q.x>=ct&&Q.x<=dt&&Q.y>=rt&&Q.y<=X&&Q!==B&&Q!==G&&y(V,at,q,et,H,ot,Q.x,Q.y)&&v(Q.prev,Q,Q.next)>=0)return!1;Q=Q.nextZ}return!0}function a(M,O,k){var N=M;do{var B=N.prev,L=N.next.next;!b(B,L)&&T(B,N,N.next,L)&&A(B,L)&&A(L,B)&&(O.push(B.i/k|0),O.push(N.i/k|0),O.push(L.i/k|0),R(N),R(N.next),N=M=L),N=N.next}while(N!==M);return e(N)}function o(M,O,k,N,B,L){var G=M;do{for(var V=G.next.next;V!==G.prev;){if(G.i!==V.i&&_(G,V)){var q=I(G,V);G=e(G,G.next),q=e(q,q.next),s(G,O,k,N,B,L,0),s(q,O,k,N,B,L,0);return}V=V.next}G=G.next}while(G!==M)}function h(M,O,k,N){var B=[],L,G,V,q,H;for(L=0,G=O.length;L<G;L++)V=O[L]*N,q=L<G-1?O[L+1]*N:M.length,H=t(M,V,q,N,!1),H===H.next&&(H.steiner=!0),B.push(g(H));for(B.sort(l),L=0;L<B.length;L++)k=c(B[L],k);return k}function l(M,O){return M.x-O.x}function c(M,O){var k=u(M,O);if(!k)return O;var N=I(k,M);return e(N,N.next),e(k,k.next)}function u(M,O){var k=O,N=M.x,B=M.y,L=-1/0,G;do{if(B<=k.y&&B>=k.next.y&&k.next.y!==k.y){var V=k.x+(B-k.y)*(k.next.x-k.x)/(k.next.y-k.y);if(V<=N&&V>L&&(L=V,G=k.x<k.next.x?k:k.next,V===N))return G}k=k.next}while(k!==O);if(!G)return null;var q=G,H=G.x,at=G.y,et=1/0,ot;k=G;do N>=k.x&&k.x>=H&&N!==k.x&&y(B<at?N:L,B,H,at,B<at?L:N,B,k.x,k.y)&&(ot=Math.abs(B-k.y)/(N-k.x),A(k,M)&&(ot<et||ot===et&&(k.x>G.x||k.x===G.x&&d(G,k)))&&(G=k,et=ot)),k=k.next;while(k!==q);return G}function d(M,O){return v(M.prev,M,O.prev)<0&&v(O.next,M,M.next)<0}function f(M,O,k,N){var B=M;do B.z===0&&(B.z=p(B.x,B.y,O,k,N)),B.prevZ=B.prev,B.nextZ=B.next,B=B.next;while(B!==M);B.prevZ.nextZ=null,B.prevZ=null,m(B)}function m(M){var O,k,N,B,L,G,V,q,H=1;do{for(k=M,M=null,L=null,G=0;k;){for(G++,N=k,V=0,O=0;O<H&&(V++,N=N.nextZ,!!N);O++);for(q=H;V>0||q>0&&N;)V!==0&&(q===0||!N||k.z<=N.z)?(B=k,k=k.nextZ,V--):(B=N,N=N.nextZ,q--),L?L.nextZ=B:M=B,B.prevZ=L,L=B;k=N}L.nextZ=null,H*=2}while(G>1);return M}function p(M,O,k,N,B){return M=(M-k)*B|0,O=(O-N)*B|0,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,M|O<<1}function g(M){var O=M,k=M;do(O.x<k.x||O.x===k.x&&O.y<k.y)&&(k=O),O=O.next;while(O!==M);return k}function y(M,O,k,N,B,L,G,V){return(B-G)*(O-V)>=(M-G)*(L-V)&&(M-G)*(N-V)>=(k-G)*(O-V)&&(k-G)*(L-V)>=(B-G)*(N-V)}function _(M,O){return M.next.i!==O.i&&M.prev.i!==O.i&&!E(M,O)&&(A(M,O)&&A(O,M)&&P(M,O)&&(v(M.prev,M,O.prev)||v(M,O.prev,O))||b(M,O)&&v(M.prev,M,M.next)>0&&v(O.prev,O,O.next)>0)}function v(M,O,k){return(O.y-M.y)*(k.x-O.x)-(O.x-M.x)*(k.y-O.y)}function b(M,O){return M.x===O.x&&M.y===O.y}function T(M,O,k,N){var B=w(v(M,O,k)),L=w(v(M,O,N)),G=w(v(k,N,M)),V=w(v(k,N,O));return!!(B!==L&&G!==V||B===0&&S(M,k,O)||L===0&&S(M,N,O)||G===0&&S(k,M,N)||V===0&&S(k,O,N))}function S(M,O,k){return O.x<=Math.max(M.x,k.x)&&O.x>=Math.min(M.x,k.x)&&O.y<=Math.max(M.y,k.y)&&O.y>=Math.min(M.y,k.y)}function w(M){return M>0?1:M<0?-1:0}function E(M,O){var k=M;do{if(k.i!==M.i&&k.next.i!==M.i&&k.i!==O.i&&k.next.i!==O.i&&T(k,k.next,M,O))return!0;k=k.next}while(k!==M);return!1}function A(M,O){return v(M.prev,M,M.next)<0?v(M,O,M.next)>=0&&v(M,M.prev,O)>=0:v(M,O,M.prev)<0||v(M,M.next,O)<0}function P(M,O){var k=M,N=!1,B=(M.x+O.x)/2,L=(M.y+O.y)/2;do k.y>L!=k.next.y>L&&k.next.y!==k.y&&B<(k.next.x-k.x)*(L-k.y)/(k.next.y-k.y)+k.x&&(N=!N),k=k.next;while(k!==M);return N}function I(M,O){var k=new F(M.i,M.x,M.y),N=new F(O.i,O.x,O.y),B=M.next,L=O.prev;return M.next=O,O.prev=M,k.next=B,B.prev=k,N.next=k,k.prev=N,L.next=N,N.prev=L,N}function C(M,O,k,N){var B=new F(M,O,k);return N?(B.next=N.next,B.prev=N,N.next.prev=B,N.next=B):(B.prev=B,B.next=B),B}function R(M){M.next.prev=M.prev,M.prev.next=M.next,M.prevZ&&(M.prevZ.nextZ=M.nextZ),M.nextZ&&(M.nextZ.prevZ=M.prevZ)}function F(M,O,k){this.i=M,this.x=O,this.y=k,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}i.deviation=function(M,O,k,N){var B=O&&O.length,L=B?O[0]*k:M.length,G=Math.abs(D(M,0,L,k));if(B)for(var V=0,q=O.length;V<q;V++){var H=O[V]*k,at=V<q-1?O[V+1]*k:M.length;G-=Math.abs(D(M,H,at,k))}var et=0;for(V=0;V<N.length;V+=3){var ot=N[V]*k,ct=N[V+1]*k,rt=N[V+2]*k;et+=Math.abs((M[ot]-M[rt])*(M[ct+1]-M[ot+1])-(M[ot]-M[ct])*(M[rt+1]-M[ot+1]))}return G===0&&et===0?0:Math.abs((et-G)/G)};function D(M,O,k,N){for(var B=0,L=O,G=k-N;L<k;L+=N)B+=(M[G]-M[L])*(M[L+1]+M[G+1]),G=L;return B}return i.flatten=function(M){for(var O=M[0][0].length,k={vertices:[],holes:[],dimensions:O},N=0,B=0;B<M.length;B++){for(var L=0;L<M[B].length;L++)for(var G=0;G<O;G++)k.vertices.push(M[B][L][G]);B>0&&(N+=M[B-1].length,k.holes.push(N))}return k},jl.exports}var qC=jC();const KC=a_(qC);var bn={},vo={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var ZC=vo.exports,ay;function JC(){return ay||(ay=1,(function(i,t){(function(e){var s=t&&!t.nodeType&&t,r=i&&!i.nodeType&&i,n=typeof $h=="object"&&$h;(n.global===n||n.window===n||n.self===n)&&(e=n);var a,o=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,m=128,p="-",g=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-l,T=Math.floor,S=String.fromCharCode,w;function E(B){throw new RangeError(v[B])}function A(B,L){for(var G=B.length,V=[];G--;)V[G]=L(B[G]);return V}function P(B,L){var G=B.split("@"),V="";G.length>1&&(V=G[0]+"@",B=G[1]),B=B.replace(_,".");var q=B.split("."),H=A(q,L).join(".");return V+H}function I(B){for(var L=[],G=0,V=B.length,q,H;G<V;)q=B.charCodeAt(G++),q>=55296&&q<=56319&&G<V?(H=B.charCodeAt(G++),(H&64512)==56320?L.push(((q&1023)<<10)+(H&1023)+65536):(L.push(q),G--)):L.push(q);return L}function C(B){return A(B,function(L){var G="";return L>65535&&(L-=65536,G+=S(L>>>10&1023|55296),L=56320|L&1023),G+=S(L),G}).join("")}function R(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:h}function F(B,L){return B+22+75*(B<26)-((L!=0)<<5)}function D(B,L,G){var V=0;for(B=G?T(B/d):B>>1,B+=T(B/L);B>b*c>>1;V+=h)B=T(B/b);return T(V+(b+1)*B/(B+u))}function M(B){var L=[],G=B.length,V,q=0,H=m,at=f,et,ot,ct,rt,dt,X,$,K,J;for(et=B.lastIndexOf(p),et<0&&(et=0),ot=0;ot<et;++ot)B.charCodeAt(ot)>=128&&E("not-basic"),L.push(B.charCodeAt(ot));for(ct=et>0?et+1:0;ct<G;){for(rt=q,dt=1,X=h;ct>=G&&E("invalid-input"),$=R(B.charCodeAt(ct++)),($>=h||$>T((o-q)/dt))&&E("overflow"),q+=$*dt,K=X<=at?l:X>=at+c?c:X-at,!($<K);X+=h)J=h-K,dt>T(o/J)&&E("overflow"),dt*=J;V=L.length+1,at=D(q-rt,V,rt==0),T(q/V)>o-H&&E("overflow"),H+=T(q/V),q%=V,L.splice(q++,0,H)}return C(L)}function O(B){var L,G,V,q,H,at,et,ot,ct,rt,dt,X=[],$,K,J,Q;for(B=I(B),$=B.length,L=m,G=0,H=f,at=0;at<$;++at)dt=B[at],dt<128&&X.push(S(dt));for(V=q=X.length,q&&X.push(p);V<$;){for(et=o,at=0;at<$;++at)dt=B[at],dt>=L&&dt<et&&(et=dt);for(K=V+1,et-L>T((o-G)/K)&&E("overflow"),G+=(et-L)*K,L=et,at=0;at<$;++at)if(dt=B[at],dt<L&&++G>o&&E("overflow"),dt==L){for(ot=G,ct=h;rt=ct<=H?l:ct>=H+c?c:ct-H,!(ot<rt);ct+=h)Q=ot-rt,J=h-rt,X.push(S(F(rt+Q%J,0))),ot=T(Q/J);X.push(S(F(ot,0))),H=D(G,K,V==q),G=0,++V}++G,++L}return X.join("")}function k(B){return P(B,function(L){return g.test(L)?M(L.slice(4).toLowerCase()):L})}function N(B){return P(B,function(L){return y.test(L)?"xn--"+O(L):L})}if(a={version:"1.4.1",ucs2:{decode:I,encode:C},decode:M,encode:O,toASCII:N,toUnicode:k},s&&r)if(i.exports==s)r.exports=a;else for(w in a)a.hasOwnProperty(w)&&(s[w]=a[w]);else e.punycode=a})(ZC)})(vo,vo.exports)),vo.exports}var yd,oy;function Qa(){return oy||(oy=1,yd=TypeError),yd}const QC={},tI=Object.freeze(Object.defineProperty({__proto__:null,default:QC},Symbol.toStringTag,{value:"Module"})),eI=HC(tI);var xd,ly;function Vc(){if(ly)return xd;ly=1;var i=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,e=i&&t&&typeof t.get=="function"?t.get:null,s=i&&Map.prototype.forEach,r=typeof Set=="function"&&Set.prototype,n=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=r&&n&&typeof n.get=="function"?n.get:null,o=r&&Set.prototype.forEach,h=typeof WeakMap=="function"&&WeakMap.prototype,l=h?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,u=c?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,f=d?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,p=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,v=String.prototype.replace,b=String.prototype.toUpperCase,T=String.prototype.toLowerCase,S=RegExp.prototype.test,w=Array.prototype.concat,E=Array.prototype.join,A=Array.prototype.slice,P=Math.floor,I=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,R=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,F=typeof Symbol=="function"&&typeof Symbol.iterator=="object",D=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===F||!0)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,O=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(tt){return tt.__proto__}:null);function k(tt,nt){if(tt===1/0||tt===-1/0||tt!==tt||tt&&tt>-1e3&&tt<1e3||S.call(/e/,nt))return nt;var ee=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof tt=="number"){var me=tt<0?-P(-tt):P(tt);if(me!==tt){var xe=String(me),Yt=_.call(nt,xe.length+1);return v.call(xe,ee,"$&_")+"."+v.call(v.call(Yt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(nt,ee,"$&_")}var N=eI,B=N.custom,L=K(B)?B:null,G={__proto__:null,double:'"',single:"'"},V={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};xd=function tt(nt,ee,me,xe){var Yt=ee||{};if(it(Yt,"quoteStyle")&&!it(G,Yt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(it(Yt,"maxStringLength")&&(typeof Yt.maxStringLength=="number"?Yt.maxStringLength<0&&Yt.maxStringLength!==1/0:Yt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Bi=it(Yt,"customInspect")?Yt.customInspect:!0;if(typeof Bi!="boolean"&&Bi!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(it(Yt,"indent")&&Yt.indent!==null&&Yt.indent!==" "&&!(parseInt(Yt.indent,10)===Yt.indent&&Yt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(it(Yt,"numericSeparator")&&typeof Yt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var mn=Yt.numericSeparator;if(typeof nt>"u")return"undefined";if(nt===null)return"null";if(typeof nt=="boolean")return nt?"true":"false";if(typeof nt=="string")return st(nt,Yt);if(typeof nt=="number"){if(nt===0)return 1/0/nt>0?"0":"-0";var Rs=String(nt);return mn?k(nt,Rs):Rs}if(typeof nt=="bigint"){var Oi=String(nt)+"n";return mn?k(nt,Oi):Oi}var $u=typeof Yt.depth>"u"?5:Yt.depth;if(typeof me>"u"&&(me=0),me>=$u&&$u>0&&typeof nt=="object")return et(nt)?"[Array]":"[Object]";var sa=Es(Yt,me);if(typeof xe>"u")xe=[];else if(W(xe,nt)>=0)return"[Circular]";function sr(ra,Nl,Vw){if(Nl&&(xe=A.call(xe),xe.push(Nl)),Vw){var Sg={depth:Yt.depth};return it(Yt,"quoteStyle")&&(Sg.quoteStyle=Yt.quoteStyle),tt(ra,Sg,me+1,xe)}return tt(ra,Yt,me+1,xe)}if(typeof nt=="function"&&!ct(nt)){var yg=Y(nt),xg=Xe(nt,sr);return"[Function"+(yg?": "+yg:" (anonymous)")+"]"+(xg.length>0?" { "+E.call(xg,", ")+" }":"")}if(K(nt)){var bg=F?v.call(String(nt),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(nt);return typeof nt=="object"&&!F?kt(bg):bg}if(Pt(nt)){for(var oo="<"+T.call(String(nt.nodeName)),Hu=nt.attributes||[],Dl=0;Dl<Hu.length;Dl++)oo+=" "+Hu[Dl].name+"="+q(H(Hu[Dl].value),"double",Yt);return oo+=">",nt.childNodes&&nt.childNodes.length&&(oo+="..."),oo+="</"+T.call(String(nt.nodeName))+">",oo}if(et(nt)){if(nt.length===0)return"[]";var Wu=Xe(nt,sr);return sa&&!Ss(Wu)?"["+Li(Wu,sa)+"]":"[ "+E.call(Wu,", ")+" ]"}if(rt(nt)){var zu=Xe(nt,sr);return!("cause"in Error.prototype)&&"cause"in nt&&!M.call(nt,"cause")?"{ ["+String(nt)+"] "+E.call(w.call("[cause]: "+sr(nt.cause),zu),", ")+" }":zu.length===0?"["+String(nt)+"]":"{ ["+String(nt)+"] "+E.call(zu,", ")+" }"}if(typeof nt=="object"&&Bi){if(L&&typeof nt[L]=="function"&&N)return N(nt,{depth:$u-me});if(Bi!=="symbol"&&typeof nt.inspect=="function")return nt.inspect()}if(j(nt)){var vg=[];return s&&s.call(nt,function(ra,Nl){vg.push(sr(Nl,nt,!0)+" => "+sr(ra,nt))}),Pe("Map",e.call(nt),vg,sa)}if(vt(nt)){var _g=[];return o&&o.call(nt,function(ra){_g.push(sr(ra,nt))}),Pe("Set",a.call(nt),_g,sa)}if(mt(nt))return Xt("WeakMap");if(Rt(nt))return Xt("WeakSet");if(ut(nt))return Xt("WeakRef");if(X(nt))return kt(sr(Number(nt)));if(J(nt))return kt(sr(I.call(nt)));if($(nt))return kt(m.call(nt));if(dt(nt))return kt(sr(String(nt)));if(typeof window<"u"&&nt===window)return"{ [object Window] }";if(typeof globalThis<"u"&&nt===globalThis||typeof $h<"u"&&nt===$h)return"{ [object globalThis] }";if(!ot(nt)&&!ct(nt)){var ju=Xe(nt,sr),wg=O?O(nt)===Object.prototype:nt instanceof Object||nt.constructor===Object,qu=nt instanceof Object?"":"null prototype",Tg=!wg&&D&&Object(nt)===nt&&D in nt?_.call(U(nt),8,-1):qu?"Object":"",Xw=wg||typeof nt.constructor!="function"?"":nt.constructor.name?nt.constructor.name+" ":"",Ku=Xw+(Tg||qu?"["+E.call(w.call([],Tg||[],qu||[]),": ")+"] ":"");return ju.length===0?Ku+"{}":sa?Ku+"{"+Li(ju,sa)+"}":Ku+"{ "+E.call(ju,", ")+" }"}return String(nt)};function q(tt,nt,ee){var me=ee.quoteStyle||nt,xe=G[me];return xe+tt+xe}function H(tt){return v.call(String(tt),/"/g,""")}function at(tt){return!D||!(typeof tt=="object"&&(D in tt||typeof tt[D]<"u"))}function et(tt){return U(tt)==="[object Array]"&&at(tt)}function ot(tt){return U(tt)==="[object Date]"&&at(tt)}function ct(tt){return U(tt)==="[object RegExp]"&&at(tt)}function rt(tt){return U(tt)==="[object Error]"&&at(tt)}function dt(tt){return U(tt)==="[object String]"&&at(tt)}function X(tt){return U(tt)==="[object Number]"&&at(tt)}function $(tt){return U(tt)==="[object Boolean]"&&at(tt)}function K(tt){if(F)return tt&&typeof tt=="object"&&tt instanceof Symbol;if(typeof tt=="symbol")return!0;if(!tt||typeof tt!="object"||!R)return!1;try{return R.call(tt),!0}catch{}return!1}function J(tt){if(!tt||typeof tt!="object"||!I)return!1;try{return I.call(tt),!0}catch{}return!1}var Q=Object.prototype.hasOwnProperty||function(tt){return tt in this};function it(tt,nt){return Q.call(tt,nt)}function U(tt){return p.call(tt)}function Y(tt){if(tt.name)return tt.name;var nt=y.call(g.call(tt),/^function\s*([\w$]+)/);return nt?nt[1]:null}function W(tt,nt){if(tt.indexOf)return tt.indexOf(nt);for(var ee=0,me=tt.length;ee<me;ee++)if(tt[ee]===nt)return ee;return-1}function j(tt){if(!e||!tt||typeof tt!="object")return!1;try{e.call(tt);try{a.call(tt)}catch{return!0}return tt instanceof Map}catch{}return!1}function mt(tt){if(!l||!tt||typeof tt!="object")return!1;try{l.call(tt,l);try{u.call(tt,u)}catch{return!0}return tt instanceof WeakMap}catch{}return!1}function ut(tt){if(!f||!tt||typeof tt!="object")return!1;try{return f.call(tt),!0}catch{}return!1}function vt(tt){if(!a||!tt||typeof tt!="object")return!1;try{a.call(tt);try{e.call(tt)}catch{return!0}return tt instanceof Set}catch{}return!1}function Rt(tt){if(!u||!tt||typeof tt!="object")return!1;try{u.call(tt,u);try{l.call(tt,l)}catch{return!0}return tt instanceof WeakSet}catch{}return!1}function Pt(tt){return!tt||typeof tt!="object"?!1:typeof HTMLElement<"u"&&tt instanceof HTMLElement?!0:typeof tt.nodeName=="string"&&typeof tt.getAttribute=="function"}function st(tt,nt){if(tt.length>nt.maxStringLength){var ee=tt.length-nt.maxStringLength,me="... "+ee+" more character"+(ee>1?"s":"");return st(_.call(tt,0,nt.maxStringLength),nt)+me}var xe=V[nt.quoteStyle||"single"];xe.lastIndex=0;var Yt=v.call(v.call(tt,xe,"\\$1"),/[\x00-\x1f]/g,lt);return q(Yt,"single",nt)}function lt(tt){var nt=tt.charCodeAt(0),ee={8:"b",9:"t",10:"n",12:"f",13:"r"}[nt];return ee?"\\"+ee:"\\x"+(nt<16?"0":"")+b.call(nt.toString(16))}function kt(tt){return"Object("+tt+")"}function Xt(tt){return tt+" { ? }"}function Pe(tt,nt,ee,me){var xe=me?Li(ee,me):E.call(ee,", ");return tt+" ("+nt+") {"+xe+"}"}function Ss(tt){for(var nt=0;nt<tt.length;nt++)if(W(tt[nt],`
|
||
`)>=0)return!1;return!0}function Es(tt,nt){var ee;if(tt.indent===" ")ee=" ";else if(typeof tt.indent=="number"&&tt.indent>0)ee=E.call(Array(tt.indent+1)," ");else return null;return{base:ee,prev:E.call(Array(nt+1),ee)}}function Li(tt,nt){if(tt.length===0)return"";var ee=`
|
||
`+nt.prev+nt.base;return ee+E.call(tt,","+ee)+`
|
||
`+nt.prev}function Xe(tt,nt){var ee=et(tt),me=[];if(ee){me.length=tt.length;for(var xe=0;xe<tt.length;xe++)me[xe]=it(tt,xe)?nt(tt[xe],tt):""}var Yt=typeof C=="function"?C(tt):[],Bi;if(F){Bi={};for(var mn=0;mn<Yt.length;mn++)Bi["$"+Yt[mn]]=Yt[mn]}for(var Rs in tt)it(tt,Rs)&&(ee&&String(Number(Rs))===Rs&&Rs<tt.length||F&&Bi["$"+Rs]instanceof Symbol||(S.call(/[^\w$]/,Rs)?me.push(nt(Rs,tt)+": "+nt(tt[Rs],tt)):me.push(Rs+": "+nt(tt[Rs],tt))));if(typeof C=="function")for(var Oi=0;Oi<Yt.length;Oi++)M.call(tt,Yt[Oi])&&me.push("["+nt(Yt[Oi])+"]: "+nt(tt[Yt[Oi]],tt));return me}return xd}var bd,hy;function sI(){if(hy)return bd;hy=1;var i=Vc(),t=Qa(),e=function(o,h,l){for(var c=o,u;(u=c.next)!=null;c=u)if(u.key===h)return c.next=u.next,l||(u.next=o.next,o.next=u),u},s=function(o,h){if(o){var l=e(o,h);return l&&l.value}},r=function(o,h,l){var c=e(o,h);c?c.value=l:o.next={key:h,next:o.next,value:l}},n=function(o,h){return o?!!e(o,h):!1},a=function(o,h){if(o)return e(o,h,!0)};return bd=function(){var h,l={assert:function(c){if(!l.has(c))throw new t("Side channel does not contain "+i(c))},delete:function(c){var u=a(h,c);return u&&h&&!h.next&&(h=void 0),!!u},get:function(c){return s(h,c)},has:function(c){return n(h,c)},set:function(c,u){h||(h={next:void 0}),r(h,c,u)}};return l},bd}var vd,cy;function o_(){return cy||(cy=1,vd=Object),vd}var _d,uy;function rI(){return uy||(uy=1,_d=Error),_d}var wd,dy;function iI(){return dy||(dy=1,wd=EvalError),wd}var Td,fy;function nI(){return fy||(fy=1,Td=RangeError),Td}var Sd,my;function aI(){return my||(my=1,Sd=ReferenceError),Sd}var Ed,py;function oI(){return py||(py=1,Ed=SyntaxError),Ed}var Ad,gy;function lI(){return gy||(gy=1,Ad=URIError),Ad}var Cd,yy;function hI(){return yy||(yy=1,Cd=Math.abs),Cd}var Id,xy;function cI(){return xy||(xy=1,Id=Math.floor),Id}var Pd,by;function uI(){return by||(by=1,Pd=Math.max),Pd}var Md,vy;function dI(){return vy||(vy=1,Md=Math.min),Md}var Rd,_y;function fI(){return _y||(_y=1,Rd=Math.pow),Rd}var Fd,wy;function mI(){return wy||(wy=1,Fd=Math.round),Fd}var kd,Ty;function pI(){return Ty||(Ty=1,kd=Number.isNaN||function(t){return t!==t}),kd}var Ld,Sy;function gI(){if(Sy)return Ld;Sy=1;var i=pI();return Ld=function(e){return i(e)||e===0?e:e<0?-1:1},Ld}var Bd,Ey;function yI(){return Ey||(Ey=1,Bd=Object.getOwnPropertyDescriptor),Bd}var Od,Ay;function l_(){if(Ay)return Od;Ay=1;var i=yI();if(i)try{i([],"length")}catch{i=null}return Od=i,Od}var Dd,Cy;function h_(){if(Cy)return Dd;Cy=1;var i=Object.defineProperty||!1;if(i)try{i({},"a",{value:1})}catch{i=!1}return Dd=i,Dd}var Nd,Iy;function xI(){return Iy||(Iy=1,Nd=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),s=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var r=42;t[e]=r;for(var n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,e);if(o.value!==r||o.enumerable!==!0)return!1}return!0}),Nd}var Ud,Py;function bI(){if(Py)return Ud;Py=1;var i=typeof Symbol<"u"&&Symbol,t=xI();return Ud=function(){return typeof i!="function"||typeof Symbol!="function"||typeof i("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Ud}var Xd,My;function c_(){return My||(My=1,Xd=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xd}var Vd,Ry;function u_(){if(Ry)return Vd;Ry=1;var i=o_();return Vd=i.getPrototypeOf||null,Vd}var Yd,Fy;function vI(){if(Fy)return Yd;Fy=1;var i="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,s="[object Function]",r=function(h,l){for(var c=[],u=0;u<h.length;u+=1)c[u]=h[u];for(var d=0;d<l.length;d+=1)c[d+h.length]=l[d];return c},n=function(h,l){for(var c=[],u=l,d=0;u<h.length;u+=1,d+=1)c[d]=h[u];return c},a=function(o,h){for(var l="",c=0;c<o.length;c+=1)l+=o[c],c+1<o.length&&(l+=h);return l};return Yd=function(h){var l=this;if(typeof l!="function"||t.apply(l)!==s)throw new TypeError(i+l);for(var c=n(arguments,1),u,d=function(){if(this instanceof u){var y=l.apply(this,r(c,arguments));return Object(y)===y?y:this}return l.apply(h,r(c,arguments))},f=e(0,l.length-c.length),m=[],p=0;p<f;p++)m[p]="$"+p;if(u=Function("binder","return function ("+a(m,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var g=function(){};g.prototype=l.prototype,u.prototype=new g,g.prototype=null}return u},Yd}var Gd,ky;function Yc(){if(ky)return Gd;ky=1;var i=vI();return Gd=Function.prototype.bind||i,Gd}var $d,Ly;function Lp(){return Ly||(Ly=1,$d=Function.prototype.call),$d}var Hd,By;function d_(){return By||(By=1,Hd=Function.prototype.apply),Hd}var Wd,Oy;function _I(){return Oy||(Oy=1,Wd=typeof Reflect<"u"&&Reflect&&Reflect.apply),Wd}var zd,Dy;function wI(){if(Dy)return zd;Dy=1;var i=Yc(),t=d_(),e=Lp(),s=_I();return zd=s||i.call(e,t),zd}var jd,Ny;function f_(){if(Ny)return jd;Ny=1;var i=Yc(),t=Qa(),e=Lp(),s=wI();return jd=function(n){if(n.length<1||typeof n[0]!="function")throw new t("a function is required");return s(i,e,n)},jd}var qd,Uy;function TI(){if(Uy)return qd;Uy=1;var i=f_(),t=l_(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var s=!!e&&t&&t(Object.prototype,"__proto__"),r=Object,n=r.getPrototypeOf;return qd=s&&typeof s.get=="function"?i([s.get]):typeof n=="function"?function(o){return n(o==null?o:r(o))}:!1,qd}var Kd,Xy;function SI(){if(Xy)return Kd;Xy=1;var i=c_(),t=u_(),e=TI();return Kd=i?function(r){return i(r)}:t?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return t(r)}:e?function(r){return e(r)}:null,Kd}var Zd,Vy;function EI(){if(Vy)return Zd;Vy=1;var i=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=Yc();return Zd=e.call(i,t),Zd}var Jd,Yy;function Bp(){if(Yy)return Jd;Yy=1;var i,t=o_(),e=rI(),s=iI(),r=nI(),n=aI(),a=oI(),o=Qa(),h=lI(),l=hI(),c=cI(),u=uI(),d=dI(),f=fI(),m=mI(),p=gI(),g=Function,y=function(ct){try{return g('"use strict"; return ('+ct+").constructor;")()}catch{}},_=l_(),v=h_(),b=function(){throw new o},T=_?(function(){try{return arguments.callee,b}catch{try{return _(arguments,"callee").get}catch{return b}}})():b,S=bI()(),w=SI(),E=u_(),A=c_(),P=d_(),I=Lp(),C={},R=typeof Uint8Array>"u"||!w?i:w(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?i:ArrayBuffer,"%ArrayIteratorPrototype%":S&&w?w([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?i:Atomics,"%BigInt%":typeof BigInt>"u"?i:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?i:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":s,"%Float16Array%":typeof Float16Array>"u"?i:Float16Array,"%Float32Array%":typeof Float32Array>"u"?i:Float32Array,"%Float64Array%":typeof Float64Array>"u"?i:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?i:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?i:Int8Array,"%Int16Array%":typeof Int16Array>"u"?i:Int16Array,"%Int32Array%":typeof Int32Array>"u"?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&w?w(w([][Symbol.iterator]())):i,"%JSON%":typeof JSON=="object"?JSON:i,"%Map%":typeof Map>"u"?i:Map,"%MapIteratorPrototype%":typeof Map>"u"||!S||!w?i:w(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?i:Promise,"%Proxy%":typeof Proxy>"u"?i:Proxy,"%RangeError%":r,"%ReferenceError%":n,"%Reflect%":typeof Reflect>"u"?i:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?i:Set,"%SetIteratorPrototype%":typeof Set>"u"||!S||!w?i:w(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&w?w(""[Symbol.iterator]()):i,"%Symbol%":S?Symbol:i,"%SyntaxError%":a,"%ThrowTypeError%":T,"%TypedArray%":R,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?i:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?i:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?i:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?i:Uint32Array,"%URIError%":h,"%WeakMap%":typeof WeakMap>"u"?i:WeakMap,"%WeakRef%":typeof WeakRef>"u"?i:WeakRef,"%WeakSet%":typeof WeakSet>"u"?i:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":P,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":E,"%Math.abs%":l,"%Math.floor%":c,"%Math.max%":u,"%Math.min%":d,"%Math.pow%":f,"%Math.round%":m,"%Math.sign%":p,"%Reflect.getPrototypeOf%":A};if(w)try{null.error}catch(ct){var D=w(w(ct));F["%Error.prototype%"]=D}var M=function ct(rt){var dt;if(rt==="%AsyncFunction%")dt=y("async function () {}");else if(rt==="%GeneratorFunction%")dt=y("function* () {}");else if(rt==="%AsyncGeneratorFunction%")dt=y("async function* () {}");else if(rt==="%AsyncGenerator%"){var X=ct("%AsyncGeneratorFunction%");X&&(dt=X.prototype)}else if(rt==="%AsyncIteratorPrototype%"){var $=ct("%AsyncGenerator%");$&&w&&(dt=w($.prototype))}return F[rt]=dt,dt},O={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=Yc(),N=EI(),B=k.call(I,Array.prototype.concat),L=k.call(P,Array.prototype.splice),G=k.call(I,String.prototype.replace),V=k.call(I,String.prototype.slice),q=k.call(I,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,at=/\\(\\)?/g,et=function(rt){var dt=V(rt,0,1),X=V(rt,-1);if(dt==="%"&&X!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(X==="%"&&dt!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var $=[];return G(rt,H,function(K,J,Q,it){$[$.length]=Q?G(it,at,"$1"):J||K}),$},ot=function(rt,dt){var X=rt,$;if(N(O,X)&&($=O[X],X="%"+$[0]+"%"),N(F,X)){var K=F[X];if(K===C&&(K=M(X)),typeof K>"u"&&!dt)throw new o("intrinsic "+rt+" exists, but is not available. Please file an issue!");return{alias:$,name:X,value:K}}throw new a("intrinsic "+rt+" does not exist!")};return Jd=function(rt,dt){if(typeof rt!="string"||rt.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof dt!="boolean")throw new o('"allowMissing" argument must be a boolean');if(q(/^%?[^%]*%?$/,rt)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var X=et(rt),$=X.length>0?X[0]:"",K=ot("%"+$+"%",dt),J=K.name,Q=K.value,it=!1,U=K.alias;U&&($=U[0],L(X,B([0,1],U)));for(var Y=1,W=!0;Y<X.length;Y+=1){var j=X[Y],mt=V(j,0,1),ut=V(j,-1);if((mt==='"'||mt==="'"||mt==="`"||ut==='"'||ut==="'"||ut==="`")&&mt!==ut)throw new a("property names with quotes must have matching quotes");if((j==="constructor"||!W)&&(it=!0),$+="."+j,J="%"+$+"%",N(F,J))Q=F[J];else if(Q!=null){if(!(j in Q)){if(!dt)throw new o("base intrinsic for "+rt+" exists, but the property is not available.");return}if(_&&Y+1>=X.length){var vt=_(Q,j);W=!!vt,W&&"get"in vt&&!("originalValue"in vt.get)?Q=vt.get:Q=Q[j]}else W=N(Q,j),Q=Q[j];W&&!it&&(F[J]=Q)}}return Q},Jd}var Qd,Gy;function m_(){if(Gy)return Qd;Gy=1;var i=Bp(),t=f_(),e=t([i("%String.prototype.indexOf%")]);return Qd=function(r,n){var a=i(r,!!n);return typeof a=="function"&&e(r,".prototype.")>-1?t([a]):a},Qd}var tf,$y;function p_(){if($y)return tf;$y=1;var i=Bp(),t=m_(),e=Vc(),s=Qa(),r=i("%Map%",!0),n=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),o=t("Map.prototype.has",!0),h=t("Map.prototype.delete",!0),l=t("Map.prototype.size",!0);return tf=!!r&&function(){var u,d={assert:function(f){if(!d.has(f))throw new s("Side channel does not contain "+e(f))},delete:function(f){if(u){var m=h(u,f);return l(u)===0&&(u=void 0),m}return!1},get:function(f){if(u)return n(u,f)},has:function(f){return u?o(u,f):!1},set:function(f,m){u||(u=new r),a(u,f,m)}};return d},tf}var ef,Hy;function AI(){if(Hy)return ef;Hy=1;var i=Bp(),t=m_(),e=Vc(),s=p_(),r=Qa(),n=i("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),o=t("WeakMap.prototype.set",!0),h=t("WeakMap.prototype.has",!0),l=t("WeakMap.prototype.delete",!0);return ef=n?function(){var u,d,f={assert:function(m){if(!f.has(m))throw new r("Side channel does not contain "+e(m))},delete:function(m){if(n&&m&&(typeof m=="object"||typeof m=="function")){if(u)return l(u,m)}else if(s&&d)return d.delete(m);return!1},get:function(m){return n&&m&&(typeof m=="object"||typeof m=="function")&&u?a(u,m):d&&d.get(m)},has:function(m){return n&&m&&(typeof m=="object"||typeof m=="function")&&u?h(u,m):!!d&&d.has(m)},set:function(m,p){n&&m&&(typeof m=="object"||typeof m=="function")?(u||(u=new n),o(u,m,p)):s&&(d||(d=s()),d.set(m,p))}};return f}:s,ef}var sf,Wy;function g_(){if(Wy)return sf;Wy=1;var i=Qa(),t=Vc(),e=sI(),s=p_(),r=AI(),n=r||s||e;return sf=function(){var o,h={assert:function(l){if(!h.has(l)){var c=l&&Object(l)===l?"the given object key":t(l);throw new i("Side channel does not contain "+c)}},delete:function(l){return!!o&&o.delete(l)},get:function(l){return o&&o.get(l)},has:function(l){return!!o&&o.has(l)},set:function(l,c){o||(o=n()),o.set(l,c)}};return h},sf}var rf,zy;function Op(){if(zy)return rf;zy=1;var i=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return rf={default:e.RFC3986,formatters:{RFC1738:function(s){return i.call(s,t,"+")},RFC3986:function(s){return String(s)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},rf}var nf,jy;function y_(){if(jy)return nf;jy=1;var i=Op(),t=g_(),e=h_(),s=Object.prototype.hasOwnProperty,r=Array.isArray,n=t(),a=function(A,P){return n.set(A,P),A},o=function(A){return n.has(A)},h=function(A){return n.get(A)},l=function(A,P){n.set(A,P)},c=(function(){for(var E=[],A=0;A<256;++A)E[E.length]="%"+((A<16?"0":"")+A.toString(16)).toUpperCase();return E})(),u=function(A){for(;A.length>1;){var P=A.pop(),I=P.obj[P.prop];if(r(I)){for(var C=[],R=0;R<I.length;++R)typeof I[R]<"u"&&(C[C.length]=I[R]);P.obj[P.prop]=C}}},d=function(A,P){for(var I=P&&P.plainObjects?{__proto__:null}:{},C=0;C<A.length;++C)typeof A[C]<"u"&&(I[C]=A[C]);return I},f=function(A,P,I){P==="__proto__"&&e?e(A,P,{configurable:!0,enumerable:!0,value:I,writable:!0}):A[P]=I},m=function E(A,P,I){if(!P)return A;if(typeof P!="object"&&typeof P!="function"){if(r(A)){var C=A.length;if(I&&typeof I.arrayLimit=="number"&&C>=I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(A.concat(P),I),C)}A[C]=P}else if(A&&typeof A=="object")if(o(A)){var R=h(A)+1;A[R]=P,l(A,R)}else{if(I&&I.strictMerge)return[A,P];(I&&(I.plainObjects||I.allowPrototypes)||!s.call(Object.prototype,P))&&(A[P]=!0)}else return[A,P];return A}if(!A||typeof A!="object"){if(o(P)){for(var F=Object.keys(P),D=I&&I.plainObjects?{__proto__:null,0:A}:{0:A},M=0;M<F.length;M++){var O=parseInt(F[M],10);D[O+1]=P[F[M]]}return a(D,h(P)+1)}var k=[A].concat(P);if(I&&typeof I.arrayLimit=="number"&&k.length>I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(k,I),k.length-1)}return k}var N=A;if(r(A)&&!r(P)&&(N=d(A,I)),r(A)&&r(P)){if(P.forEach(function(B,L){if(s.call(A,L)){var G=A[L];G&&typeof G=="object"&&B&&typeof B=="object"?A[L]=E(G,B,I):A[A.length]=B}else A[L]=B}),I&&typeof I.arrayLimit=="number"&&A.length>I.arrayLimit){if(I.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+I.arrayLimit+" element"+(I.arrayLimit===1?"":"s")+" allowed in an array.");return a(d(A,I),A.length-1)}return A}return Object.keys(P).reduce(function(B,L){var G=P[L];if(s.call(B,L)?f(B,L,E(B[L],G,I)):f(B,L,G),o(P)&&!o(B)&&a(B,h(P)),o(B)){var V=parseInt(L,10);String(V)===L&&V>=0&&V>h(B)&&l(B,V)}return B},N)},p=function(A,P){return Object.keys(P).reduce(function(I,C){return f(I,C,P[C]),I},A)},g=function(E,A,P){var I=E.replace(/\+/g," ");if(P==="iso-8859-1")return I.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(I)}catch{return I}},y=1024,_=function(A,P,I,C,R){if(A.length===0)return A;var F=A;if(typeof A=="symbol"?F=Symbol.prototype.toString.call(A):typeof A!="string"&&(F=String(A)),I==="iso-8859-1")return escape(F).replace(/%u[0-9a-f]{4}/gi,function(G){return"%26%23"+parseInt(G.slice(2),16)+"%3B"});for(var D="",M=0;M<F.length;M+=y){var O=F.length>=y?F.slice(M,M+y):F;if(M+y<F.length){var k=O.charCodeAt(O.length-1);k>=55296&&k<=56319&&(O=O.slice(0,-1),M-=1)}for(var N=[],B=0;B<O.length;++B){var L=O.charCodeAt(B);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||R===i.RFC1738&&(L===40||L===41)){N[N.length]=O.charAt(B);continue}if(L<128){N[N.length]=c[L];continue}if(L<2048){N[N.length]=c[192|L>>6]+c[128|L&63];continue}if(L<55296||L>=57344){N[N.length]=c[224|L>>12]+c[128|L>>6&63]+c[128|L&63];continue}B+=1,L=65536+((L&1023)<<10|O.charCodeAt(B)&1023),N[N.length]=c[240|L>>18]+c[128|L>>12&63]+c[128|L>>6&63]+c[128|L&63]}D+=N.join("")}return D},v=function(A){for(var P=[{obj:{o:A},prop:"o"}],I=t(),C=0;C<P.length;++C)for(var R=P[C],F=R.obj[R.prop],D=Object.keys(F),M=0;M<D.length;++M){var O=D[M],k=F[O];typeof k=="object"&&k!==null&&!I.has(k)&&(P[P.length]={obj:F,prop:O},I.set(k,!0))}return u(P),A},b=function(A){return Object.prototype.toString.call(A)==="[object RegExp]"},T=function(A){return!A||typeof A!="object"?!1:!!(A.constructor&&A.constructor.isBuffer&&A.constructor.isBuffer(A))},S=function(A,P,I,C,R){if(o(A)){if(R)throw new RangeError("Array limit exceeded. Only "+I+" element"+(I===1?"":"s")+" allowed in an array.");var F=h(A)+1;return A[F]=P,l(A,F),A}var D=[].concat(A,P);if(D.length>I){if(R)throw new RangeError("Array limit exceeded. Only "+I+" element"+(I===1?"":"s")+" allowed in an array.");return a(d(D,{plainObjects:C}),D.length-1)}return D},w=function(A,P){if(r(A)){for(var I=[],C=0;C<A.length;C+=1)I[I.length]=P(A[C]);return I}return P(A)};return nf={arrayToObject:d,assign:p,combine:S,compact:v,decode:g,encode:_,isBuffer:T,isOverflow:o,isRegExp:b,markOverflow:a,maybeMap:w,merge:m},nf}var af,qy;function CI(){if(qy)return af;qy=1;var i=g_(),t=y_(),e=Op(),s=Object.prototype.hasOwnProperty,r={brackets:function(g){return g+"[]"},comma:"comma",indices:function(g,y){return g+"["+y+"]"},repeat:function(g){return g}},n=Array.isArray,a=Array.prototype.push,o=function(p,g){a.apply(p,n(g)?g:[g])},h=Date.prototype.toISOString,l=e.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,filter:void 0,format:l,formatter:e.formatters[l],indices:!1,serializeDate:function(g){return h.call(g)},skipNulls:!1,strictNullHandling:!1},u=function(g){return typeof g=="string"||typeof g=="number"||typeof g=="boolean"||typeof g=="symbol"||typeof g=="bigint"},d={},f=function p(g,y,_,v,b,T,S,w,E,A,P,I,C,R,F,D,M,O){for(var k=g,N=O,B=0,L=!1;(N=N.get(d))!==void 0&&!L;){var G=N.get(g);if(B+=1,typeof G<"u"){if(G===B)throw new RangeError("Cyclic object value");L=!0}typeof N.get(d)>"u"&&(B=0)}if(typeof A=="function"?k=A(y,k):k instanceof Date?k=C(k):_==="comma"&&n(k)&&(k=t.maybeMap(k,function(J){return J instanceof Date?C(J):J})),k===null){if(T)return F(E&&!D?E(y,c.encoder,M,"key",R):y);k=""}if(u(k)||t.isBuffer(k)){if(E){var V=D?y:E(y,c.encoder,M,"key",R);return[F(V)+"="+F(E(k,c.encoder,M,"value",R))]}return[F(y)+"="+F(String(k))]}var q=[];if(typeof k>"u")return q;var H;if(_==="comma"&&n(k))D&&E&&(k=t.maybeMap(k,function(J){return J==null?J:E(J)})),H=[{value:k.length>0?k.join(",")||null:void 0}];else if(n(A))H=A;else{var at=Object.keys(k);H=P?at.sort(P):at}var et=w?String(y).replace(/\./g,"%2E"):String(y),ot=v&&n(k)&&k.length===1?et+"[]":et;if(b&&n(k)&&k.length===0)return ot+"[]";for(var ct=0;ct<H.length;++ct){var rt=H[ct],dt=typeof rt=="object"&&rt&&typeof rt.value<"u"?rt.value:k[rt];if(!(S&&dt===null)){var X=I&&w?String(rt).replace(/\./g,"%2E"):String(rt),$=n(k)?typeof _=="function"?_(ot,X):ot:ot+(I?"."+X:"["+X+"]");O.set(g,B);var K=i();K.set(d,O),o(q,p(dt,$,_,v,b,T,S,w,_==="comma"&&D&&n(k)?null:E,A,P,I,C,R,F,D,M,K))}}return q},m=function(g){if(!g)return c;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.encodeDotInKeys<"u"&&typeof g.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(g.encoder!==null&&typeof g.encoder<"u"&&typeof g.encoder!="function")throw new TypeError("Encoder has to be a function.");var y=g.charset||c.charset;if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var _=e.default;if(typeof g.format<"u"){if(!s.call(e.formatters,g.format))throw new TypeError("Unknown format option provided.");_=g.format}var v=e.formatters[_],b=c.filter;(typeof g.filter=="function"||n(g.filter))&&(b=g.filter);var T;if(g.arrayFormat in r?T=g.arrayFormat:"indices"in g?T=g.indices?"indices":"repeat":T=c.arrayFormat,"commaRoundTrip"in g&&typeof g.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var S=typeof g.allowDots>"u"?g.encodeDotInKeys===!0?!0:c.allowDots:!!g.allowDots;return{addQueryPrefix:typeof g.addQueryPrefix=="boolean"?g.addQueryPrefix:c.addQueryPrefix,allowDots:S,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:T,charset:y,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!g.commaRoundTrip,delimiter:typeof g.delimiter>"u"?c.delimiter:g.delimiter,encode:typeof g.encode=="boolean"?g.encode:c.encode,encodeDotInKeys:typeof g.encodeDotInKeys=="boolean"?g.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof g.encoder=="function"?g.encoder:c.encoder,encodeValuesOnly:typeof g.encodeValuesOnly=="boolean"?g.encodeValuesOnly:c.encodeValuesOnly,filter:b,format:_,formatter:v,serializeDate:typeof g.serializeDate=="function"?g.serializeDate:c.serializeDate,skipNulls:typeof g.skipNulls=="boolean"?g.skipNulls:c.skipNulls,sort:typeof g.sort=="function"?g.sort:null,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:c.strictNullHandling}};return af=function(p,g){var y=p,_=m(g),v,b;typeof _.filter=="function"?(b=_.filter,y=b("",y)):n(_.filter)&&(b=_.filter,v=b);var T=[];if(typeof y!="object"||y===null)return"";var S=r[_.arrayFormat],w=S==="comma"&&_.commaRoundTrip;v||(v=Object.keys(y)),_.sort&&v.sort(_.sort);for(var E=i(),A=0;A<v.length;++A){var P=v[A];if(!(typeof P>"u"||P===null)){var I=y[P];_.skipNulls&&I===null||o(T,f(I,P,S,w,_.allowEmptyArrays,_.strictNullHandling,_.skipNulls,_.encodeDotInKeys,_.encode?_.encoder:null,_.filter,_.sort,_.allowDots,_.serializeDate,_.format,_.formatter,_.encodeValuesOnly,_.charset,E))}}var C=T.join(_.delimiter),R=_.addQueryPrefix===!0?"?":"";return _.charsetSentinel&&(_.charset==="iso-8859-1"?R+="utf8=%26%2310003%3B"+_.delimiter:R+="utf8=%E2%9C%93"+_.delimiter),C.length>0?R+C:""},af}var of,Ky;function II(){if(Ky)return of;Ky=1;var i=y_(),t=Object.prototype.hasOwnProperty,e=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},r=function(f){return f.replace(/&#(\d+);/g,function(m,p){return String.fromCharCode(parseInt(p,10))})},n=function(f,m,p,g){if(f&&typeof f=="string"&&m.comma&&f.indexOf(",")>-1){if(g&&m.throwOnLimitExceeded)for(var y=0,_=f.indexOf(",");_>-1;){if(y+=1,y>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");_=f.indexOf(",",_+1)}return f.split(",")}if(m.throwOnLimitExceeded&&p>=m.arrayLimit)throw new RangeError("Array limit exceeded. Only "+m.arrayLimit+" element"+(m.arrayLimit===1?"":"s")+" allowed in an array.");return f},a="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",h=function(m,p){var g={__proto__:null},y=p.ignoreQueryPrefix?m.replace(/^\?/,""):m;y=y.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=p.parameterLimit===1/0?void 0:p.parameterLimit,v=y.split(p.delimiter,p.throwOnLimitExceeded&&typeof _<"u"?_+1:_);if(p.throwOnLimitExceeded&&typeof _<"u"&&v.length>_)throw new RangeError("Parameter limit exceeded. Only "+_+" parameter"+(_===1?"":"s")+" allowed.");var b=-1,T,S=p.charset;if(p.charsetSentinel)for(T=0;T<v.length;++T)v[T].indexOf("utf8=")===0&&(v[T]===o?S="utf-8":v[T]===a&&(S="iso-8859-1"),b=T,T=v.length);for(T=0;T<v.length;++T)if(T!==b){var w=v[T],E=w.indexOf("]="),A=E===-1?w.indexOf("="):E+1,P,I;if(A===-1?(P=p.decoder(w,s.decoder,S,"key"),I=p.strictNullHandling?null:""):(P=p.decoder(w.slice(0,A),s.decoder,S,"key"),P!==null&&(I=i.maybeMap(n(w.slice(A+1),p,e(g[P])?g[P].length:0,w.indexOf("[]=")===-1),function(R){return p.decoder(R,s.decoder,S,"value")}))),I&&p.interpretNumericEntities&&S==="iso-8859-1"&&(I=r(String(I))),w.indexOf("[]=")>-1&&(I=e(I)?[I]:I),p.comma&&e(I)&&I.length>p.arrayLimit&&(I=i.combine([],I,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded)),P!==null){var C=t.call(g,P);C&&(p.duplicates==="combine"||w.indexOf("[]=")>-1)?g[P]=i.combine(g[P],I,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded):(!C||p.duplicates==="last")&&(g[P]=I)}}return g},l=function(f,m,p,g){var y=0;if(f.length>0&&f[f.length-1]==="[]"){var _=f.slice(0,-1).join("");y=Array.isArray(m)&&m[_]?m[_].length:0}for(var v=g?m:n(m,p,y),b=f.length-1;b>=0;--b){var T,S=f[b];if(S==="[]"&&p.parseArrays)i.isOverflow(v)?T=v:T=p.allowEmptyArrays&&(v===""||p.strictNullHandling&&v===null)?[]:i.combine([],v,p.arrayLimit,p.plainObjects,p.throwOnLimitExceeded);else{T=p.plainObjects?{__proto__:null}:{};var w=S.charAt(0)==="["&&S.charAt(S.length-1)==="]"?S.slice(1,-1):S,E=p.decodeDotInKeys?w.replace(/%2E/g,"."):w,A=parseInt(E,10),P=!isNaN(A)&&S!==E&&String(A)===E&&A>=0&&p.parseArrays;if(!p.parseArrays&&E==="")T={0:v};else if(P&&A<p.arrayLimit)T=[],T[A]=v;else{if(P&&p.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");P?(T[A]=v,i.markOverflow(T,A)):E!=="__proto__"&&(T[E]=v)}}v=T}return v},c=function(m,p){var g=p.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m;if(p.depth<=0)return!p.plainObjects&&t.call(Object.prototype,g)&&!p.allowPrototypes?void 0:[g];var y=[],_=g.indexOf("["),v=_>=0?g.slice(0,_):g;if(v){if(!p.plainObjects&&t.call(Object.prototype,v)&&!p.allowPrototypes)return;y[y.length]=v}for(var b=g.length,T=_,S=0;T>=0&&S<p.depth;){for(var w=1,E=T+1,A=-1;E<b&&A<0;){var P=g.charCodeAt(E);P===91?w+=1:P===93&&(w-=1,w===0&&(A=E)),E+=1}if(A<0)return y[y.length]="["+g.slice(T)+"]",y;var I=g.slice(T,A+1),C=I.slice(1,-1);if(!p.plainObjects&&t.call(Object.prototype,C)&&!p.allowPrototypes)return;y[y.length]=I,S+=1,T=g.indexOf("[",A+1)}if(T>=0){if(p.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+p.depth+" and strictDepth is true");y[y.length]="["+g.slice(T)+"]"}return y},u=function(m,p,g,y){if(m){var _=c(m,g);if(_)return l(_,p,g,y)}},d=function(m){if(!m)return s;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof m.throwOnLimitExceeded<"u"&&typeof m.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var p=typeof m.charset>"u"?s.charset:m.charset,g=typeof m.duplicates>"u"?s.duplicates:m.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var y=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:s.allowDots:!!m.allowDots;return{allowDots:y,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:s.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:s.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:s.arrayLimit,charset:p,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:s.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:s.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:s.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:s.decoder,delimiter:typeof m.delimiter=="string"||i.isRegExp(m.delimiter)?m.delimiter:s.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:s.depth,duplicates:g,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:s.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:s.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:s.strictDepth,strictMerge:typeof m.strictMerge=="boolean"?!!m.strictMerge:s.strictMerge,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:typeof m.throwOnLimitExceeded=="boolean"?m.throwOnLimitExceeded:!1}};return of=function(f,m){var p=d(m);if(f===""||f===null||typeof f>"u")return p.plainObjects?{__proto__:null}:{};for(var g=typeof f=="string"?h(f,p):f,y=p.plainObjects?{__proto__:null}:{},_=Object.keys(g),v=0;v<_.length;++v){var b=_[v],T=u(b,g[b],p,typeof f=="string");y=i.merge(y,T,p)}return p.allowSparse===!0?y:i.compact(y)},of}var lf,Zy;function PI(){if(Zy)return lf;Zy=1;var i=CI(),t=II(),e=Op();return lf={formats:e,parse:t,stringify:i},lf}var Jy;function MI(){if(Jy)return bn;Jy=1;var i=JC();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var e=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,r=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,n=["<",">",'"',"`"," ","\r",`
|
||
`," "],a=["{","}","|","\\","^","`"].concat(n),o=["'"].concat(a),h=["%","/","?",";","#"].concat(o),l=["/","?","#"],c=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=PI();function y(T,S,w){if(T&&typeof T=="object"&&T instanceof t)return T;var E=new t;return E.parse(T,S,w),E}t.prototype.parse=function(T,S,w){if(typeof T!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof T);var E=T.indexOf("?"),A=E!==-1&&E<T.indexOf("#")?"?":"#",P=T.split(A),I=/\\/g;P[0]=P[0].replace(I,"/"),T=P.join(A);var C=T;if(C=C.trim(),!w&&T.split("#").length===1){var R=r.exec(C);if(R)return this.path=C,this.href=C,this.pathname=R[1],R[2]?(this.search=R[2],S?this.query=g.parse(this.search.substr(1)):this.query=this.search.substr(1)):S&&(this.search="",this.query={}),this}var F=e.exec(C);if(F){F=F[0];var D=F.toLowerCase();this.protocol=D,C=C.substr(F.length)}if(w||F||C.match(/^\/\/[^@/]+@[^@/]+/)){var M=C.substr(0,2)==="//";M&&!(F&&m[F])&&(C=C.substr(2),this.slashes=!0)}if(!m[F]&&(M||F&&!p[F])){for(var O=-1,k=0;k<l.length;k++){var N=C.indexOf(l[k]);N!==-1&&(O===-1||N<O)&&(O=N)}var B,L;O===-1?L=C.lastIndexOf("@"):L=C.lastIndexOf("@",O),L!==-1&&(B=C.slice(0,L),C=C.slice(L+1),this.auth=decodeURIComponent(B)),O=-1;for(var k=0;k<h.length;k++){var N=C.indexOf(h[k]);N!==-1&&(O===-1||N<O)&&(O=N)}O===-1&&(O=C.length),this.host=C.slice(0,O),C=C.slice(O),this.parseHost(),this.hostname=this.hostname||"";var G=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!G)for(var V=this.hostname.split(/\./),k=0,q=V.length;k<q;k++){var H=V[k];if(H&&!H.match(u)){for(var at="",et=0,ot=H.length;et<ot;et++)H.charCodeAt(et)>127?at+="x":at+=H[et];if(!at.match(u)){var ct=V.slice(0,k),rt=V.slice(k+1),dt=H.match(d);dt&&(ct.push(dt[1]),rt.unshift(dt[2])),rt.length&&(C="/"+rt.join(".")+C),this.hostname=ct.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),G||(this.hostname=i.toASCII(this.hostname));var X=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+X,this.href+=this.host,G&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!f[D])for(var k=0,q=o.length;k<q;k++){var K=o[k];if(C.indexOf(K)!==-1){var J=encodeURIComponent(K);J===K&&(J=escape(K)),C=C.split(K).join(J)}}var Q=C.indexOf("#");Q!==-1&&(this.hash=C.substr(Q),C=C.slice(0,Q));var it=C.indexOf("?");if(it!==-1?(this.search=C.substr(it),this.query=C.substr(it+1),S&&(this.query=g.parse(this.query)),C=C.slice(0,it)):S&&(this.search="",this.query={}),C&&(this.pathname=C),p[D]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var X=this.pathname||"",U=this.search||"";this.path=X+U}return this.href=this.format(),this};function _(T){return typeof T=="string"&&(T=y(T)),T instanceof t?T.format():t.prototype.format.call(T)}t.prototype.format=function(){var T=this.auth||"";T&&(T=encodeURIComponent(T),T=T.replace(/%3A/i,":"),T+="@");var S=this.protocol||"",w=this.pathname||"",E=this.hash||"",A=!1,P="";this.host?A=T+this.host:this.hostname&&(A=T+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(A+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(P=g.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var I=this.search||P&&"?"+P||"";return S&&S.substr(-1)!==":"&&(S+=":"),this.slashes||(!S||p[S])&&A!==!1?(A="//"+(A||""),w&&w.charAt(0)!=="/"&&(w="/"+w)):A||(A=""),E&&E.charAt(0)!=="#"&&(E="#"+E),I&&I.charAt(0)!=="?"&&(I="?"+I),w=w.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),I=I.replace("#","%23"),S+A+w+I+E};function v(T,S){return y(T,!1,!0).resolve(S)}t.prototype.resolve=function(T){return this.resolveObject(y(T,!1,!0)).format()};function b(T,S){return T?y(T,!1,!0).resolveObject(S):S}return t.prototype.resolveObject=function(T){if(typeof T=="string"){var S=new t;S.parse(T,!1,!0),T=S}for(var w=new t,E=Object.keys(this),A=0;A<E.length;A++){var P=E[A];w[P]=this[P]}if(w.hash=T.hash,T.href==="")return w.href=w.format(),w;if(T.slashes&&!T.protocol){for(var I=Object.keys(T),C=0;C<I.length;C++){var R=I[C];R!=="protocol"&&(w[R]=T[R])}return p[w.protocol]&&w.hostname&&!w.pathname&&(w.pathname="/",w.path=w.pathname),w.href=w.format(),w}if(T.protocol&&T.protocol!==w.protocol){if(!p[T.protocol]){for(var F=Object.keys(T),D=0;D<F.length;D++){var M=F[D];w[M]=T[M]}return w.href=w.format(),w}if(w.protocol=T.protocol,!T.host&&!m[T.protocol]){for(var q=(T.pathname||"").split("/");q.length&&!(T.host=q.shift()););T.host||(T.host=""),T.hostname||(T.hostname=""),q[0]!==""&&q.unshift(""),q.length<2&&q.unshift(""),w.pathname=q.join("/")}else w.pathname=T.pathname;if(w.search=T.search,w.query=T.query,w.host=T.host||"",w.auth=T.auth,w.hostname=T.hostname||T.host,w.port=T.port,w.pathname||w.search){var O=w.pathname||"",k=w.search||"";w.path=O+k}return w.slashes=w.slashes||T.slashes,w.href=w.format(),w}var N=w.pathname&&w.pathname.charAt(0)==="/",B=T.host||T.pathname&&T.pathname.charAt(0)==="/",L=B||N||w.host&&T.pathname,G=L,V=w.pathname&&w.pathname.split("/")||[],q=T.pathname&&T.pathname.split("/")||[],H=w.protocol&&!p[w.protocol];if(H&&(w.hostname="",w.port=null,w.host&&(V[0]===""?V[0]=w.host:V.unshift(w.host)),w.host="",T.protocol&&(T.hostname=null,T.port=null,T.host&&(q[0]===""?q[0]=T.host:q.unshift(T.host)),T.host=null),L=L&&(q[0]===""||V[0]==="")),B)w.host=T.host||T.host===""?T.host:w.host,w.hostname=T.hostname||T.hostname===""?T.hostname:w.hostname,w.search=T.search,w.query=T.query,V=q;else if(q.length)V||(V=[]),V.pop(),V=V.concat(q),w.search=T.search,w.query=T.query;else if(T.search!=null){if(H){w.host=V.shift(),w.hostname=w.host;var at=w.host&&w.host.indexOf("@")>0?w.host.split("@"):!1;at&&(w.auth=at.shift(),w.hostname=at.shift(),w.host=w.hostname)}return w.search=T.search,w.query=T.query,(w.pathname!==null||w.search!==null)&&(w.path=(w.pathname?w.pathname:"")+(w.search?w.search:"")),w.href=w.format(),w}if(!V.length)return w.pathname=null,w.search?w.path="/"+w.search:w.path=null,w.href=w.format(),w;for(var et=V.slice(-1)[0],ot=(w.host||T.host||V.length>1)&&(et==="."||et==="..")||et==="",ct=0,rt=V.length;rt>=0;rt--)et=V[rt],et==="."?V.splice(rt,1):et===".."?(V.splice(rt,1),ct++):ct&&(V.splice(rt,1),ct--);if(!L&&!G)for(;ct--;ct)V.unshift("..");L&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),ot&&V.join("/").substr(-1)!=="/"&&V.push("");var dt=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(H){w.hostname=dt?"":V.length?V.shift():"",w.host=w.hostname;var at=w.host&&w.host.indexOf("@")>0?w.host.split("@"):!1;at&&(w.auth=at.shift(),w.hostname=at.shift(),w.host=w.hostname)}return L=L||w.host&&V.length,L&&!dt&&V.unshift(""),V.length>0?w.pathname=V.join("/"):(w.pathname=null,w.path=null),(w.pathname!==null||w.search!==null)&&(w.path=(w.pathname?w.pathname:"")+(w.search?w.search:"")),w.auth=T.auth||w.auth,w.slashes=w.slashes||T.slashes,w.href=w.format(),w},t.prototype.parseHost=function(){var T=this.host,S=s.exec(T);S&&(S=S[0],S!==":"&&(this.port=S.substr(1)),T=T.substr(0,T.length-S.length)),T&&(this.hostname=T)},bn.parse=y,bn.resolve=v,bn.resolveObject=b,bn.format=_,bn.Url=t,bn}MI();const Qy={};function Ht(i,t,e=3){if(Qy[t])return;let s=new Error().stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
|
||
Deprecated since v${i}`):(s=s.split(`
|
||
`).splice(e).join(`
|
||
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
|
||
Deprecated since v${i}`),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t}
|
||
Deprecated since v${i}`),console.warn(s))),Qy[t]=!0}function rr(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function fo(i){return i.split("?")[0].split("#")[0]}function RI(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FI(i,t,e){return i.replace(new RegExp(RI(t),"g"),e)}function kI(i,t){let e="",s=0,r=-1,n=0,a=-1;for(let o=0;o<=i.length;++o){if(o<i.length)a=i.charCodeAt(o);else{if(a===47)break;a=47}if(a===47){if(!(r===o-1||n===1))if(r!==o-1&&n===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",s=0):(e=e.slice(0,h),s=e.length-1-e.lastIndexOf("/")),r=o,n=0;continue}}else if(e.length===2||e.length===1){e="",s=0,r=o,n=0;continue}}}else e.length>0?e+=`/${i.slice(r+1,o)}`:e=i.slice(r+1,o),s=o-r-1;r=o,n=0}else a===46&&n!==-1?++n:n=-1}return e}const ye={toPosix(i){return FI(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){rr(i),i=this.toPosix(i);const t=/^file:\/\/\//.exec(i);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(i);return e?e[0]:""},toAbsolute(i,t,e){if(rr(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=fo(this.toPosix(t??_t.ADAPTER.getBaseUrl())),r=fo(this.toPosix(e??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?ye.join(r,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(rr(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let t="";const e=i.startsWith("/");this.hasProtocol(i)&&(t=this.rootname(i),i=i.slice(t.length));const s=i.endsWith("/");return i=kI(i),i.length>0&&s&&(i+="/"),e?`/${i}`:t+i},isAbsolute(i){return rr(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let t;for(let e=0;e<i.length;++e){const s=i[e];if(rr(s),s.length>0)if(t===void 0)t=s;else{const r=i[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(i){if(rr(i),i.length===0)return".";i=this.toPosix(i);let t=i.charCodeAt(0);const e=t===47;let s=-1,r=!0;const n=this.getProtocol(i),a=i;i=i.slice(n.length);for(let o=i.length-1;o>=1;--o)if(t=i.charCodeAt(o),t===47){if(!r){s=o;break}}else r=!1;return s===-1?e?"/":this.isUrl(a)?n+i:n:e&&s===1?"//":n+i.slice(0,s)},rootname(i){rr(i),i=this.toPosix(i);let t="";if(i.startsWith("/")?t="/":t=this.getProtocol(i),this.isUrl(i)){const e=i.indexOf("/",t.length);e!==-1?t=i.slice(0,e):t=i,t.endsWith("/")||(t+="/")}return t},basename(i,t){rr(i),t&&rr(t),i=fo(this.toPosix(i));let e=0,s=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=i.length){if(t.length===i.length&&t===i)return"";let a=t.length-1,o=-1;for(n=i.length-1;n>=0;--n){const h=i.charCodeAt(n);if(h===47){if(!r){e=n+1;break}}else o===-1&&(r=!1,o=n+1),a>=0&&(h===t.charCodeAt(a)?--a===-1&&(s=n):(a=-1,s=o))}return e===s?s=o:s===-1&&(s=i.length),i.slice(e,s)}for(n=i.length-1;n>=0;--n)if(i.charCodeAt(n)===47){if(!r){e=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":i.slice(e,s)},extname(i){rr(i),i=fo(this.toPosix(i));let t=-1,e=0,s=-1,r=!0,n=0;for(let a=i.length-1;a>=0;--a){const o=i.charCodeAt(a);if(o===47){if(!r){e=a+1;break}continue}s===-1&&(r=!1,s=a+1),o===46?t===-1?t=a:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||s===-1||n===0||n===1&&t===s-1&&t===e+1?"":i.slice(t,s)},parse(i){rr(i);const t={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return t;i=fo(this.toPosix(i));let e=i.charCodeAt(0);const s=this.isAbsolute(i);let r;t.root=this.rootname(i),s||this.hasProtocol(i)?r=1:r=0;let n=-1,a=0,o=-1,h=!0,l=i.length-1,c=0;for(;l>=r;--l){if(e=i.charCodeAt(l),e===47){if(!h){a=l+1;break}continue}o===-1&&(h=!1,o=l+1),e===46?n===-1?n=l:c!==1&&(c=1):n!==-1&&(c=-1)}return n===-1||o===-1||c===0||c===1&&n===o-1&&n===a+1?o!==-1&&(a===0&&s?t.base=t.name=i.slice(1,o):t.base=t.name=i.slice(a,o)):(a===0&&s?(t.name=i.slice(1,n),t.base=i.slice(1,o)):(t.name=i.slice(a,n),t.base=i.slice(a,o)),t.ext=i.slice(n,o)),t.dir=this.dirname(i),t},sep:"/",delimiter:":",joinExtensions:[".html"]};let hf;async function LI(){return hf??(hf=(async()=>{var n;const i=document.createElement("canvas").getContext("webgl");if(!i)return Ke.UNPACK;const t=await new Promise(a=>{const o=document.createElement("video");o.onloadeddata=()=>a(o),o.onerror=()=>a(null),o.autoplay=!1,o.crossOrigin="anonymous",o.preload="auto",o.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",o.load()});if(!t)return Ke.UNPACK;const e=i.createTexture();i.bindTexture(i.TEXTURE_2D,e);const s=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,s),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,t);const r=new Uint8Array(4);return i.readPixels(0,0,1,1,i.RGBA,i.UNSIGNED_BYTE,r),i.deleteFramebuffer(s),i.deleteTexture(e),(n=i.getExtension("WEBGL_lose_context"))==null||n.loseContext(),r[0]<=r[3]?Ke.PMA:Ke.UNPACK})()),hf}let cf;function BI(){return typeof cf>"u"&&(cf=(function(){var t;const i={stencil:!0,failIfMajorPerformanceCaveat:_t.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!_t.ADAPTER.getWebGLRenderingContext())return!1;const e=_t.ADAPTER.createCanvas();let s=e.getContext("webgl",i)||e.getContext("experimental-webgl",i);const r=!!((t=s==null?void 0:s.getContextAttributes())!=null&&t.stencil);if(s){const n=s.getExtension("WEBGL_lose_context");n&&n.loseContext()}return s=null,r}catch{return!1}})()),cf}var OI={grad:.9,turn:360,rad:360/(2*Math.PI)},ei=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},je=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},Zs=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},x_=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},tx=function(i){return{r:Zs(i.r,0,255),g:Zs(i.g,0,255),b:Zs(i.b,0,255),a:Zs(i.a)}},uf=function(i){return{r:je(i.r),g:je(i.g),b:je(i.b),a:je(i.a,3)}},DI=/^#([0-9a-f]{3,8})$/i,ql=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},b_=function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=Math.max(t,e,s),a=n-Math.min(t,e,s),o=a?n===t?(e-s)/a:n===e?2+(s-t)/a:4+(t-e)/a:0;return{h:60*(o<0?o+6:o),s:n?a/n*100:0,v:n/255*100,a:r}},v_=function(i){var t=i.h,e=i.s,s=i.v,r=i.a;t=t/360*6,e/=100,s/=100;var n=Math.floor(t),a=s*(1-e),o=s*(1-(t-n)*e),h=s*(1-(1-t+n)*e),l=n%6;return{r:255*[s,o,a,a,h,s][l],g:255*[h,s,s,o,a,a][l],b:255*[a,a,h,s,s,o][l],a:r}},ex=function(i){return{h:x_(i.h),s:Zs(i.s,0,100),l:Zs(i.l,0,100),a:Zs(i.a)}},sx=function(i){return{h:je(i.h),s:je(i.s),l:je(i.l),a:je(i.a,3)}},rx=function(i){return v_((e=(t=i).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},ko=function(i){return{h:(t=b_(i)).h,s:(r=(200-(e=t.s))*(s=t.v)/100)>0&&r<200?e*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,s,r},NI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,UI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,XI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,VI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mm={string:[[function(i){var t=DI.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?je(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?je(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=XI.exec(i)||VI.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:tx({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(i){var t=NI.exec(i)||UI.exec(i);if(!t)return null;var e,s,r=ex({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(OI[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return rx(r)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,s=i.b,r=i.a,n=r===void 0?1:r;return ei(t)&&ei(e)&&ei(s)?tx({r:Number(t),g:Number(e),b:Number(s),a:Number(n)}):null},"rgb"],[function(i){var t=i.h,e=i.s,s=i.l,r=i.a,n=r===void 0?1:r;if(!ei(t)||!ei(e)||!ei(s))return null;var a=ex({h:Number(t),s:Number(e),l:Number(s),a:Number(n)});return rx(a)},"hsl"],[function(i){var t=i.h,e=i.s,s=i.v,r=i.a,n=r===void 0?1:r;if(!ei(t)||!ei(e)||!ei(s))return null;var a=(function(o){return{h:x_(o.h),s:Zs(o.s,0,100),v:Zs(o.v,0,100),a:Zs(o.a)}})({h:Number(t),s:Number(e),v:Number(s),a:Number(n)});return v_(a)},"hsv"]]},ix=function(i,t){for(var e=0;e<t.length;e++){var s=t[e][0](i);if(s)return[s,t[e][1]]}return[null,void 0]},YI=function(i){return typeof i=="string"?ix(i.trim(),mm.string):typeof i=="object"&&i!==null?ix(i,mm.object):[null,void 0]},df=function(i,t){var e=ko(i);return{h:e.h,s:Zs(e.s+100*t,0,100),l:e.l,a:e.a}},ff=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},nx=function(i,t){var e=ko(i);return{h:e.h,s:e.s,l:Zs(e.l+100*t,0,100),a:e.a}},pm=(function(){function i(t){this.parsed=YI(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return je(ff(this.rgba),2)},i.prototype.isDark=function(){return ff(this.rgba)<.5},i.prototype.isLight=function(){return ff(this.rgba)>=.5},i.prototype.toHex=function(){return t=uf(this.rgba),e=t.r,s=t.g,r=t.b,a=(n=t.a)<1?ql(je(255*n)):"","#"+ql(e)+ql(s)+ql(r)+a;var t,e,s,r,n,a},i.prototype.toRgb=function(){return uf(this.rgba)},i.prototype.toRgbString=function(){return t=uf(this.rgba),e=t.r,s=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+s+", "+r+", "+n+")":"rgb("+e+", "+s+", "+r+")";var t,e,s,r,n},i.prototype.toHsl=function(){return sx(ko(this.rgba))},i.prototype.toHslString=function(){return t=sx(ko(this.rgba)),e=t.h,s=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+s+"%, "+r+"%, "+n+")":"hsl("+e+", "+s+"%, "+r+"%)";var t,e,s,r,n},i.prototype.toHsv=function(){return t=b_(this.rgba),{h:je(t.h),s:je(t.s),v:je(t.v),a:je(t.a,3)};var t},i.prototype.invert=function(){return Ar({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},i.prototype.saturate=function(t){return t===void 0&&(t=.1),Ar(df(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),Ar(df(this.rgba,-t))},i.prototype.grayscale=function(){return Ar(df(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),Ar(nx(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),Ar(nx(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?Ar({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):je(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=ko(this.rgba);return typeof t=="number"?Ar({h:t,s:e.s,l:e.l,a:e.a}):je(e.h)},i.prototype.isEqual=function(t){return this.toHex()===Ar(t).toHex()},i})(),Ar=function(i){return i instanceof pm?i:new pm(i)},ax=[],GI=function(i){i.forEach(function(t){ax.indexOf(t)<0&&(t(pm,mm),ax.push(t))})};function $I(i,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in e)s[e[r]]=r;var n={};i.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,h,l=s[this.toHex()];if(l)return l;if(a!=null&&a.closest){var c=this.toRgb(),u=1/0,d="black";if(!n.length)for(var f in e)n[f]=new i(e[f]).toRgb();for(var m in e){var p=(o=c,h=n[m],Math.pow(o.r-h.r,2)+Math.pow(o.g-h.g,2)+Math.pow(o.b-h.b,2));p<u&&(u=p,d=m)}return d}},t.string.push([function(a){var o=a.toLowerCase(),h=o==="transparent"?"#0000":e[o];return h?new i(h).toRgb():null},"name"])}GI([$I]);const ua=class _h{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof _h)this._value=this.cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,t))&&(this.normalize(t),this._value=this.cloneSource(t))}}get value(){return this._value}cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}isSourceEqual(t,e){const s=typeof t;if(s!==typeof e)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((r,n)=>r===e[n]);if(t!==null&&e!==null){const r=Object.keys(t),n=Object.keys(e);return r.length!==n.length?!1:r.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,s,r]=this._components;return{r:t,g:e,b:s,a:r}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,r]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(r*255),t}toRgbArray(t){t=t??[];const[e,s,r]=this._components;return t[0]=e,t[1]=s,t[2]=r,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,s,r,n]=_h.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=r,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(s=s*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(s<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,s,r]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(s*t)/t,this._components[2]=Math.round(r*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,s,r,n]=this._components;return t[0]=e,t[1]=s,t[2]=r,t[3]=n,t}normalize(t){let e,s,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const a=t;e=(a>>16&255)/255,s=(a>>8&255)/255,r=(a&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,r,n=255]=t,e/=255,s/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const o=_h.HEX_PATTERN.exec(t);o&&(t=`#${o[2]}`)}const a=Ar(t);a.isValid()&&({r:e,g:s,b:r,a:n}=a.rgba,e/=255,s/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=r,this._components[3]=n,this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),s)}),t)}};ua.shared=new ua,ua.temp=new ua,ua.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Wt=ua;function HI(i){return Ht("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),Wt.shared.setValue(i).toHex()}function WI(i){return Ht("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),Wt.shared.setValue(i).toNumber()}function zI(){const i=[],t=[];for(let s=0;s<32;s++)i[s]=s,t[s]=s;i[It.NORMAL_NPM]=It.NORMAL,i[It.ADD_NPM]=It.ADD,i[It.SCREEN_NPM]=It.SCREEN,t[It.NORMAL]=It.NORMAL_NPM,t[It.ADD]=It.ADD_NPM,t[It.SCREEN]=It.SCREEN_NPM;const e=[];return e.push(t),e.push(i),e}const __=zI();function w_(i,t){return __[t?1:0][i]}function jI(i,t=null){const e=i*6;if(t=t||new Uint16Array(e),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let s=0,r=0;s<e;s+=6,r+=4)t[s+0]=r+0,t[s+1]=r+1,t[s+2]=r+2,t[s+3]=r+0,t[s+4]=r+2,t[s+5]=r+3;return t}function T_(i){if(i.BYTES_PER_ELEMENT===4)return i instanceof Float32Array?"Float32Array":i instanceof Uint32Array?"Uint32Array":"Int32Array";if(i.BYTES_PER_ELEMENT===2){if(i instanceof Uint16Array)return"Uint16Array"}else if(i.BYTES_PER_ELEMENT===1&&i instanceof Uint8Array)return"Uint8Array";return null}function Hh(i){return i+=i===0?1:0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function ox(i){return!(i&i-1)&&!!i}function lx(i){let t=(i>65535?1:0)<<4;i>>>=t;let e=(i>255?1:0)<<3;return i>>>=e,t|=e,e=(i>15?1:0)<<2,i>>>=e,t|=e,e=(i>3?1:0)<<1,i>>>=e,t|=e,t|i>>1}function Ma(i,t,e){const s=i.length;let r;if(t>=s||e===0)return;e=t+e>s?s-t:e;const n=s-e;for(r=t;r<n;++r)i[r]=i[r+e];i.length=n}function Zi(i){return i===0?0:i<0?-1:1}let qI=0;function Hn(){return++qI}const gm=class{constructor(i,t,e,s){this.left=i,this.top=t,this.right=e,this.bottom=s}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};gm.EMPTY=new gm(0,0,0,0);let hx=gm;const cx={},Cr=Object.create(null),Ni=Object.create(null);class KI{constructor(t,e,s){this._canvas=_t.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=s||_t.RESOLUTION,this.resize(t,e)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(t,e){this._checkDestroyed(),this._canvas.width=Math.round(t*this.resolution),this._canvas.height=Math.round(e*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(t){this._checkDestroyed(),this._canvas.width=Math.round(t)}get height(){return this._checkDestroyed(),this._canvas.height}set height(t){this._checkDestroyed(),this._canvas.height=Math.round(t)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(this._canvas===null)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function ux(i,t,e){for(let s=0,r=4*e*t;s<t;++s,r+=4)if(i[r+3]!==0)return!1;return!0}function dx(i,t,e,s,r){const n=4*t;for(let a=s,o=s*n+4*e;a<=r;++a,o+=n)if(i[o+3]!==0)return!1;return!0}function ZI(i){const{width:t,height:e}=i,s=i.getContext("2d",{willReadFrequently:!0});if(s===null)throw new TypeError("Failed to get canvas 2D context");const r=s.getImageData(0,0,t,e).data;let n=0,a=0,o=t-1,h=e-1;for(;a<e&&ux(r,t,a);)++a;if(a===e)return hx.EMPTY;for(;ux(r,t,h);)--h;for(;dx(r,t,n,a,h);)++n;for(;dx(r,t,o,a,h);)--o;return++o,++h,new hx(n,a,o,h)}function JI(i){const t=ZI(i),{width:e,height:s}=t;let r=null;if(!t.isEmpty()){const n=i.getContext("2d");if(n===null)throw new TypeError("Failed to get canvas 2D context");r=n.getImageData(t.left,t.top,e,s)}return{width:e,height:s,data:r}}function QI(i,t=globalThis.location){if(i.startsWith("data:"))return"";t=t||globalThis.location;const e=new URL(i,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function Ci(i,t=1){var s;const e=(s=_t.RETINA_PREFIX)==null?void 0:s.exec(i);return e?parseFloat(e[1]):t}var gt=(i=>(i.Renderer="renderer",i.Application="application",i.RendererSystem="renderer-webgl-system",i.RendererPlugin="renderer-webgl-plugin",i.CanvasRendererSystem="renderer-canvas-system",i.CanvasRendererPlugin="renderer-canvas-plugin",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i))(gt||{});const ym=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},fx=(i,t)=>ym(i).priority??t,St={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(ym).forEach(t=>{t.type.forEach(e=>{var s,r;return(r=(s=this._removeHandlers)[e])==null?void 0:r.call(s,t)})}),this},add(...i){return i.map(ym).forEach(t=>{t.type.forEach(e=>{var n,a;const s=this._addHandlers,r=this._queue;s[e]?(n=s[e])==null||n.call(s,t):(r[e]=r[e]||[],(a=r[e])==null||a.push(t))})}),this},handle(i,t,e){var a;const s=this._addHandlers,r=this._removeHandlers;if(s[i]||r[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=t,r[i]=e;const n=this._queue;return n[i]&&((a=n[i])==null||a.forEach(o=>t(o)),delete n[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByList(i,t,e=-1){return this.handle(i,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((r,n)=>fx(n,e)-fx(r,e)))},s=>{const r=t.indexOf(s.ref);r!==-1&&t.splice(r,1)})}};class xm{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const tP=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
||
`);function eP(i){let t="";for(let e=0;e<i;++e)e>0&&(t+=`
|
||
else `),e<i-1&&(t+=`if(test == ${e}.0){}`);return t}function sP(i,t){if(i===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const e=t.createShader(t.FRAGMENT_SHADER);for(;;){const s=tP.replace(/%forloop%/gi,eP(i));if(t.shaderSource(e,s),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))i=i/2|0;else break}return i}const mf=0,pf=1,gf=2,yf=3,xf=4,bf=5;class jr{constructor(){this.data=0,this.blendMode=It.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<mf)}set blend(t){!!(this.data&1<<mf)!==t&&(this.data^=1<<mf)}get offsets(){return!!(this.data&1<<pf)}set offsets(t){!!(this.data&1<<pf)!==t&&(this.data^=1<<pf)}get culling(){return!!(this.data&1<<gf)}set culling(t){!!(this.data&1<<gf)!==t&&(this.data^=1<<gf)}get depthTest(){return!!(this.data&1<<yf)}set depthTest(t){!!(this.data&1<<yf)!==t&&(this.data^=1<<yf)}get depthMask(){return!!(this.data&1<<bf)}set depthMask(t){!!(this.data&1<<bf)!==t&&(this.data^=1<<bf)}get clockwiseFrontFace(){return!!(this.data&1<<xf)}set clockwiseFrontFace(t){!!(this.data&1<<xf)!==t&&(this.data^=1<<xf)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==It.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new jr;return t.depthTest=!1,t.blend=!0,t}}jr.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const bm=[];function S_(i,t){if(!i)return null;let e="";if(typeof i=="string"){const s=/\.(\w{3,4})(?:$|\?|#)/i.exec(i);s&&(e=s[1].toLowerCase())}for(let s=bm.length-1;s>=0;--s){const r=bm[s];if(r.test&&r.test(i,e))return new r(i,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class gr{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,s,r,n,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.length;u<d;u++)c[u][l](t,e,s,r,n,a,o,h);return c===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(gr.prototype,{dispatch:{value:gr.prototype.emit},run:{value:gr.prototype.emit}});class el{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new gr("setRealSize"),this.onUpdate=new gr("update"),this.onError=new gr("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,s){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class Gc extends el{constructor(t,e){const{width:s,height:r}=e||{};if(!s||!r)throw new Error("BufferResource width or height invalid");super(s,r),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,s){const r=t.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,this.unpackAlignment),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Ke.UNPACK);const n=e.realWidth,a=e.realHeight;return s.width===n&&s.height===a?r.texSubImage2D(e.target,0,0,0,n,a,e.format,s.type,this.data):(s.width=n,s.height=a,r.texImage2D(e.target,0,s.internalFormat,n,a,0,e.format,s.type,this.data)),!0}dispose(){this.data=null}static test(t){return t===null||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const rP={scaleMode:Ns.NEAREST,alphaMode:Ke.NPM},vm=class da extends Al{constructor(t=null,e=null){super(),e=Object.assign({},da.defaultOptions,e);const{alphaMode:s,mipmap:r,anisotropicLevel:n,scaleMode:a,width:o,height:h,wrapMode:l,format:c,type:u,target:d,resolution:f,resourceOptions:m}=e;t&&!(t instanceof el)&&(t=S_(t,m),t.internal=!0),this.resolution=f||_t.RESOLUTION,this.width=Math.round((o||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=r,this.anisotropicLevel=n,this._wrapMode=l,this._scaleMode=a,this.format=c,this.type=u,this.target=d,this.alphaMode=s,this.uid=Hn(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=o>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let s;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,s=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,s=!0),s&&this.dirtyStyleId++,this}setSize(t,e,s){return s=s||this.resolution,this.setRealSize(t*s,e*s,s)}setRealSize(t,e,s){return this.resolution=s||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=ox(this.realWidth)&&ox(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ni[this.cacheId],delete Cr[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),da.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,s=_t.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else{if(!t._pixiId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Hn()}`}n=t._pixiId}let a=Ni[n];if(r&&s&&!a)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return a||(a=new da(t,e),a.cacheId=n,da.addToCache(a,n)),a}static fromBuffer(t,e,s,r){t=t||new Float32Array(e*s*4);const n=new Gc(t,{width:e,height:s,...r==null?void 0:r.resourceOptions});let a,o;return t instanceof Float32Array?(a=ft.RGBA,o=wt.FLOAT):t instanceof Int32Array?(a=ft.RGBA_INTEGER,o=wt.INT):t instanceof Uint32Array?(a=ft.RGBA_INTEGER,o=wt.UNSIGNED_INT):t instanceof Int16Array?(a=ft.RGBA_INTEGER,o=wt.SHORT):t instanceof Uint16Array?(a=ft.RGBA_INTEGER,o=wt.UNSIGNED_SHORT):t instanceof Int8Array?(a=ft.RGBA,o=wt.BYTE):(a=ft.RGBA,o=wt.UNSIGNED_BYTE),n.internal=!0,new da(n,Object.assign({},rP,{type:o,format:a},r))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Ni[e]&&Ni[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Ni[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Ni[t];if(e){const s=e.textureCacheIds.indexOf(t);return s>-1&&e.textureCacheIds.splice(s,1),delete Ni[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Ni[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};vm.defaultOptions={mipmap:Ms.POW2,anisotropicLevel:0,scaleMode:Ns.LINEAR,wrapMode:Ps.CLAMP,alphaMode:Ke.UNPACK,target:Pa.TEXTURE_2D,format:ft.RGBA,type:wt.UNSIGNED_BYTE},vm._globalBatch=0;let Lt=vm;class _m{constructor(){this.texArray=null,this.blend=0,this.type=Yr.TRIANGLES,this.start=0,this.size=0,this.data=null}}let iP=0;class ne{constructor(t,e=!0,s=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=s,this.static=e,this.id=iP++,this.disposeRunner=new gr("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?$r.ELEMENT_ARRAY_BUFFER:$r.ARRAY_BUFFER}get index(){return this.type===$r.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new ne(t)}}class Wh{constructor(t,e=0,s=!1,r=wt.FLOAT,n,a,o,h=1){this.buffer=t,this.size=e,this.normalized=s,this.type=r,this.stride=n,this.start=a,this.instance=o,this.divisor=h}destroy(){this.buffer=null}static from(t,e,s,r,n){return new Wh(t,e,s,r,n)}}const nP={Float32Array,Uint32Array,Int32Array,Uint8Array};function aP(i,t){let e=0,s=0;const r={};for(let h=0;h<i.length;h++)s+=t[h],e+=i[h].length;const n=new ArrayBuffer(e*4);let a=null,o=0;for(let h=0;h<i.length;h++){const l=t[h],c=i[h],u=T_(c);r[u]||(r[u]=new nP[u](n)),a=r[u];for(let d=0;d<c.length;d++){const f=(d/l|0)*s+o,m=d%l;a[f+m]=c[d]}o+=l}return new Float32Array(n)}const mx={5126:4,5123:2,5121:1};let oP=0;const lP={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class er{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=oP++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new gr("disposeGeometry"),this.refCount=0}addAttribute(t,e,s=0,r=!1,n,a,o,h=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof ne||(e instanceof Array&&(e=new Float32Array(e)),e=new ne(e));const l=t.split("|");if(l.length>1){for(let u=0;u<l.length;u++)this.addAttribute(l[u],e,s,r,n);return this}let c=this.buffers.indexOf(e);return c===-1&&(this.buffers.push(e),c=this.buffers.length-1),this.attributes[t]=new Wh(c,s,r,n,a,o,h),this.instanced=this.instanced||h,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof ne||(t instanceof Array&&(t=new Uint16Array(t)),t=new ne(t)),t.type=$r.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const t=[],e=[],s=new ne;let r;for(r in this.attributes){const n=this.attributes[r],a=this.buffers[n.buffer];t.push(a.data),e.push(n.size*mx[n.type]/4),n.buffer=0}for(s.data=aP(t,e),r=0;r<this.buffers.length;r++)this.buffers[r]!==this.indexBuffer&&this.buffers[r].destroy();return this.buffers=[s],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new er;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new ne(this.buffers[e].data.slice(0));for(const e in this.attributes){const s=this.attributes[e];t.attributes[e]=new Wh(s.buffer,s.size,s.normalized,s.type,s.stride,s.start,s.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=$r.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new er,s=[],r=[],n=[];let a;for(let o=0;o<t.length;o++){a=t[o];for(let h=0;h<a.buffers.length;h++)r[h]=r[h]||0,r[h]+=a.buffers[h].data.length,n[h]=0}for(let o=0;o<a.buffers.length;o++)s[o]=new lP[T_(a.buffers[o].data)](r[o]),e.buffers[o]=new ne(s[o]);for(let o=0;o<t.length;o++){a=t[o];for(let h=0;h<a.buffers.length;h++)s[h].set(a.buffers[h].data,n[h]),n[h]+=a.buffers[h].data.length}if(e.attributes=a.attributes,a.indexBuffer){e.indexBuffer=e.buffers[a.buffers.indexOf(a.indexBuffer)],e.indexBuffer.type=$r.ELEMENT_ARRAY_BUFFER;let o=0,h=0,l=0,c=0;for(let u=0;u<a.buffers.length;u++)if(a.buffers[u]!==a.indexBuffer){c=u;break}for(const u in a.attributes){const d=a.attributes[u];(d.buffer|0)===c&&(h+=d.size*mx[d.type]/4)}for(let u=0;u<t.length;u++){const d=t[u].indexBuffer.data;for(let f=0;f<d.length;f++)e.indexBuffer.data[f+l]+=o;o+=t[u].buffers[c].data.length/h,l+=d.length}}return e}}class E_ extends er{constructor(t=!1){super(),this._buffer=new ne(null,t,!1),this._indexBuffer=new ne(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,wt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,wt.FLOAT).addAttribute("aColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,wt.FLOAT).addIndex(this._indexBuffer)}}const zh=Math.PI*2,hP=180/Math.PI,cP=Math.PI/180;var ts=(i=>(i[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC",i))(ts||{});class Kt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Kt(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}Kt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Kl=[new Kt,new Kt,new Kt,new Kt];class Ut{constructor(t=0,e=0,s=0,r=0){this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(r),this.type=ts.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Ut(0,0,0,0)}clone(){return new Ut(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}intersects(t,e){if(!e){const E=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=E)return!1;const A=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>A}const s=this.left,r=this.right,n=this.top,a=this.bottom;if(r<=s||a<=n)return!1;const o=Kl[0].set(t.left,t.top),h=Kl[1].set(t.left,t.bottom),l=Kl[2].set(t.right,t.top),c=Kl[3].set(t.right,t.bottom);if(l.x<=o.x||h.y<=o.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(o,o),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(o.x,h.x,l.x,c.x)<=s||Math.min(o.x,h.x,l.x,c.x)>=r||Math.max(o.y,h.y,l.y,c.y)<=n||Math.min(o.y,h.y,l.y,c.y)>=a))return!1;const d=u*(h.y-o.y),f=u*(o.x-h.x),m=d*s+f*n,p=d*r+f*n,g=d*s+f*a,y=d*r+f*a;if(Math.max(m,p,g,y)<=d*o.x+f*o.y||Math.min(m,p,g,y)>=d*c.x+f*c.y)return!1;const _=u*(o.y-l.y),v=u*(l.x-o.x),b=_*s+v*n,T=_*r+v*n,S=_*s+v*a,w=_*r+v*a;return!(Math.max(b,T,S,w)<=_*o.x+v*o.y||Math.min(b,T,S,w)>=_*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=r,this.height=n-r,this}}Ut.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class $c{constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.radius=s,this.type=ts.CIRC}clone(){return new $c(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=s}getBounds(){return new Ut(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}$c.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Hc{constructor(t=0,e=0,s=0,r=0){this.x=t,this.y=e,this.width=s,this.height=r,this.type=ts.ELIP}clone(){return new Hc(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let s=(t-this.x)/this.width,r=(e-this.y)/this.height;return s*=s,r*=r,s+r<=1}getBounds(){return new Ut(this.x-this.width,this.y-this.height,this.width,this.height)}}Hc.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Un{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let r=0,n=e.length;r<n;r++)s.push(e[r].x,e[r].y);e=s}this.points=e,this.type=ts.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new Un(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let s=!1;const r=this.points.length/2;for(let n=0,a=r-1;n<r;a=n++){const o=this.points[n*2],h=this.points[n*2+1],l=this.points[a*2],c=this.points[a*2+1];h>e!=c>e&&t<(l-o)*((e-h)/(c-h))+o&&(s=!s)}return s}}Un.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((i,t)=>`${i}, ${t}`,"")}]`};class Wc{constructor(t=0,e=0,s=0,r=0,n=20){this.x=t,this.y=e,this.width=s,this.height=r,this.radius=n,this.type=ts.RREC}clone(){return new Wc(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let r=t-(this.x+s),n=e-(this.y+s);const a=s*s;if(r*r+n*n<=a||(r=t-(this.x+this.width-s),r*r+n*n<=a)||(n=e-(this.y+this.height-s),r*r+n*n<=a)||(r=t-(this.x+s),r*r+n*n<=a))return!0}return!1}}Wc.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class fe{constructor(t=1,e=0,s=0,r=1,n=0,a=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=r,this.tx=n,this.ty=a}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,r,n,a){return this.a=t,this.b=e,this.c=s,this.d=r,this.tx=n,this.ty=a,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new Kt;const s=t.x,r=t.y;return e.x=this.a*s+this.c*r+this.tx,e.y=this.b*s+this.d*r+this.ty,e}applyInverse(t,e){e=e||new Kt;const s=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*s*r+-this.c*s*n+(this.ty*this.c-this.tx*this.d)*s,e.y=this.a*s*n+-this.b*s*r+(-this.ty*this.a+this.tx*this.b)*s,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),r=this.a,n=this.c,a=this.tx;return this.a=r*e-this.b*s,this.b=r*s+this.b*e,this.c=n*e-this.d*s,this.d=n*s+this.d*e,this.tx=a*e-this.ty*s,this.ty=a*s+this.ty*e,this}append(t){const e=this.a,s=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*s+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*s+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this}setTransform(t,e,s,r,n,a,o,h,l){return this.a=Math.cos(o+l)*n,this.b=Math.sin(o+l)*n,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,this.tx=t-(s*this.a+r*this.c),this.ty=e-(s*this.b+r*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,r=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,r=this.c,n=this.d,a=t.pivot,o=-Math.atan2(-r,n),h=Math.atan2(s,e),l=Math.abs(o+h);return l<1e-5||Math.abs(zh-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=h),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(a.x*e+a.y*r),t.position.y=this.ty+(a.x*s+a.y*n),t}invert(){const t=this.a,e=this.b,s=this.c,r=this.d,n=this.tx,a=t*r-e*s;return this.a=r/a,this.b=-e/a,this.c=-s/a,this.d=t/a,this.tx=(s*this.ty-r*n)/a,this.ty=-(t*this.ty-e*n)/a,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new fe;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new fe}static get TEMP_MATRIX(){return new fe}}fe.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const Tn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Sn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],En=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],An=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],wm=[],A_=[],Zl=Math.sign;function uP(){for(let i=0;i<16;i++){const t=[];wm.push(t);for(let e=0;e<16;e++){const s=Zl(Tn[i]*Tn[e]+En[i]*Sn[e]),r=Zl(Sn[i]*Tn[e]+An[i]*Sn[e]),n=Zl(Tn[i]*En[e]+En[i]*An[e]),a=Zl(Sn[i]*En[e]+An[i]*An[e]);for(let o=0;o<16;o++)if(Tn[o]===s&&Sn[o]===r&&En[o]===n&&An[o]===a){t.push(o);break}}}for(let i=0;i<16;i++){const t=new fe;t.set(Tn[i],Sn[i],En[i],An[i],0,0),A_.push(t)}}uP();const Ee={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>Tn[i],uY:i=>Sn[i],vX:i=>En[i],vY:i=>An[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>wm[i][t],sub:(i,t)=>wm[i][Ee.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?Ee.S:Ee.N:Math.abs(t)*2<=Math.abs(i)?i>0?Ee.E:Ee.W:t>0?i>0?Ee.SE:Ee.SW:i>0?Ee.NE:Ee.NW,matrixAppendRotationInv:(i,t,e=0,s=0)=>{const r=A_[Ee.inv(t)];r.tx=e,r.ty=s,i.append(r)}};class gi{constructor(t,e,s=0,r=0){this._x=s,this._y=r,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new gi(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}gi.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Tm=class{constructor(){this.worldTransform=new fe,this.localTransform=new fe,this.position=new gi(this.onChange,this,0,0),this.scale=new gi(this.onChange,this,1,1),this.pivot=new gi(this.onChange,this,0,0),this.skew=new gi(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const i=this.localTransform;this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(i){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==i._worldID){const e=i.worldTransform,s=this.worldTransform;s.a=t.a*e.a+t.b*e.c,s.b=t.a*e.b+t.b*e.d,s.c=t.c*e.a+t.d*e.c,s.d=t.c*e.b+t.d*e.d,s.tx=t.tx*e.a+t.ty*e.c+e.tx,s.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=i._worldID,this._worldID++}}setFromMatrix(i){i.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(i){this._rotation!==i&&(this._rotation=i,this.updateSkew())}};Tm.IDENTITY=new Tm;let Dp=Tm;Dp.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var dP=`varying vec2 vTextureCoord;
|
||
|
||
uniform sampler2D uSampler;
|
||
|
||
void main(void){
|
||
gl_FragColor *= texture2D(uSampler, vTextureCoord);
|
||
}`,fP=`attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void){
|
||
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
vTextureCoord = aTextureCoord;
|
||
}
|
||
`;function px(i,t,e){const s=i.createShader(t);return i.shaderSource(s,e),i.compileShader(s),s}function vf(i){const t=new Array(i);for(let e=0;e<t.length;e++)t[e]=!1;return t}function C_(i,t){switch(i){case"float":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*t);case"ivec3":return new Int32Array(3*t);case"ivec4":return new Int32Array(4*t);case"uvec2":return new Uint32Array(2*t);case"uvec3":return new Uint32Array(3*t);case"uvec4":return new Uint32Array(4*t);case"bool":return!1;case"bvec2":return vf(2*t);case"bvec3":return vf(3*t);case"bvec4":return vf(4*t);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Ra=[{test:i=>i.type==="float"&&i.size===1&&!i.isArray,code:i=>`
|
||
if(uv["${i}"] !== ud["${i}"].value)
|
||
{
|
||
ud["${i}"].value = uv["${i}"]
|
||
gl.uniform1f(ud["${i}"].location, uv["${i}"])
|
||
}
|
||
`},{test:(i,t)=>(i.type==="sampler2D"||i.type==="samplerCube"||i.type==="sampler2DArray")&&i.size===1&&!i.isArray&&(t==null||t.castToBaseTexture!==void 0),code:i=>`t = syncData.textureCount++;
|
||
|
||
renderer.texture.bind(uv["${i}"], t);
|
||
|
||
if(ud["${i}"].value !== t)
|
||
{
|
||
ud["${i}"].value = t;
|
||
gl.uniform1i(ud["${i}"].location, t);
|
||
; // eslint-disable-line max-len
|
||
}`},{test:(i,t)=>i.type==="mat3"&&i.size===1&&!i.isArray&&t.a!==void 0,code:i=>`
|
||
gl.uniformMatrix3fv(ud["${i}"].location, false, uv["${i}"].toArray(true));
|
||
`,codeUbo:i=>`
|
||
var ${i}_matrix = uv.${i}.toArray(true);
|
||
|
||
data[offset] = ${i}_matrix[0];
|
||
data[offset+1] = ${i}_matrix[1];
|
||
data[offset+2] = ${i}_matrix[2];
|
||
|
||
data[offset + 4] = ${i}_matrix[3];
|
||
data[offset + 5] = ${i}_matrix[4];
|
||
data[offset + 6] = ${i}_matrix[5];
|
||
|
||
data[offset + 8] = ${i}_matrix[6];
|
||
data[offset + 9] = ${i}_matrix[7];
|
||
data[offset + 10] = ${i}_matrix[8];
|
||
`},{test:(i,t)=>i.type==="vec2"&&i.size===1&&!i.isArray&&t.x!==void 0,code:i=>`
|
||
cv = ud["${i}"].value;
|
||
v = uv["${i}"];
|
||
|
||
if(cv[0] !== v.x || cv[1] !== v.y)
|
||
{
|
||
cv[0] = v.x;
|
||
cv[1] = v.y;
|
||
gl.uniform2f(ud["${i}"].location, v.x, v.y);
|
||
}`,codeUbo:i=>`
|
||
v = uv.${i};
|
||
|
||
data[offset] = v.x;
|
||
data[offset+1] = v.y;
|
||
`},{test:i=>i.type==="vec2"&&i.size===1&&!i.isArray,code:i=>`
|
||
cv = ud["${i}"].value;
|
||
v = uv["${i}"];
|
||
|
||
if(cv[0] !== v[0] || cv[1] !== v[1])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
gl.uniform2f(ud["${i}"].location, v[0], v[1]);
|
||
}
|
||
`},{test:(i,t)=>i.type==="vec4"&&i.size===1&&!i.isArray&&t.width!==void 0,code:i=>`
|
||
cv = ud["${i}"].value;
|
||
v = uv["${i}"];
|
||
|
||
if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
|
||
{
|
||
cv[0] = v.x;
|
||
cv[1] = v.y;
|
||
cv[2] = v.width;
|
||
cv[3] = v.height;
|
||
gl.uniform4f(ud["${i}"].location, v.x, v.y, v.width, v.height)
|
||
}`,codeUbo:i=>`
|
||
v = uv.${i};
|
||
|
||
data[offset] = v.x;
|
||
data[offset+1] = v.y;
|
||
data[offset+2] = v.width;
|
||
data[offset+3] = v.height;
|
||
`},{test:(i,t)=>i.type==="vec4"&&i.size===1&&!i.isArray&&t.red!==void 0,code:i=>`
|
||
cv = ud["${i}"].value;
|
||
v = uv["${i}"];
|
||
|
||
if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)
|
||
{
|
||
cv[0] = v.red;
|
||
cv[1] = v.green;
|
||
cv[2] = v.blue;
|
||
cv[3] = v.alpha;
|
||
gl.uniform4f(ud["${i}"].location, v.red, v.green, v.blue, v.alpha)
|
||
}`,codeUbo:i=>`
|
||
v = uv.${i};
|
||
|
||
data[offset] = v.red;
|
||
data[offset+1] = v.green;
|
||
data[offset+2] = v.blue;
|
||
data[offset+3] = v.alpha;
|
||
`},{test:(i,t)=>i.type==="vec3"&&i.size===1&&!i.isArray&&t.red!==void 0,code:i=>`
|
||
cv = ud["${i}"].value;
|
||
v = uv["${i}"];
|
||
|
||
if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)
|
||
{
|
||
cv[0] = v.red;
|
||
cv[1] = v.green;
|
||
cv[2] = v.blue;
|
||
|
||
gl.uniform3f(ud["${i}"].location, v.red, v.green, v.blue)
|
||
}`,codeUbo:i=>`
|
||
v = uv.${i};
|
||
|
||
data[offset] = v.red;
|
||
data[offset+1] = v.green;
|
||
data[offset+2] = v.blue;
|
||
`},{test:i=>i.type==="vec4"&&i.size===1&&!i.isArray,code:i=>`
|
||
cv = ud["${i}"].value;
|
||
v = uv["${i}"];
|
||
|
||
if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
cv[3] = v[3];
|
||
|
||
gl.uniform4f(ud["${i}"].location, v[0], v[1], v[2], v[3])
|
||
}`}],mP={float:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
gl.uniform1f(location, v);
|
||
}`,vec2:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
|
||
gl.uniform2f(location, v[0], v[1])
|
||
}`,vec3:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
|
||
gl.uniform3f(location, v[0], v[1], v[2])
|
||
}`,vec4:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
cv[3] = v[3];
|
||
|
||
gl.uniform4f(location, v[0], v[1], v[2], v[3]);
|
||
}`,int:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
|
||
gl.uniform1i(location, v);
|
||
}`,ivec2:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
|
||
gl.uniform2i(location, v[0], v[1]);
|
||
}`,ivec3:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
|
||
gl.uniform3i(location, v[0], v[1], v[2]);
|
||
}`,ivec4:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
cv[3] = v[3];
|
||
|
||
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
||
}`,uint:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
|
||
gl.uniform1ui(location, v);
|
||
}`,uvec2:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
|
||
gl.uniform2ui(location, v[0], v[1]);
|
||
}`,uvec3:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
|
||
gl.uniform3ui(location, v[0], v[1], v[2]);
|
||
}`,uvec4:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
cv[3] = v[3];
|
||
|
||
gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
|
||
}`,bool:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
gl.uniform1i(location, v);
|
||
}`,bvec2:`
|
||
if (cv[0] != v[0] || cv[1] != v[1])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
|
||
gl.uniform2i(location, v[0], v[1]);
|
||
}`,bvec3:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
|
||
gl.uniform3i(location, v[0], v[1], v[2]);
|
||
}`,bvec4:`
|
||
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
|
||
{
|
||
cv[0] = v[0];
|
||
cv[1] = v[1];
|
||
cv[2] = v[2];
|
||
cv[3] = v[3];
|
||
|
||
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
||
}`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
|
||
gl.uniform1i(location, v);
|
||
}`,samplerCube:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
|
||
gl.uniform1i(location, v);
|
||
}`,sampler2DArray:`
|
||
if (cv !== v)
|
||
{
|
||
cu.value = v;
|
||
|
||
gl.uniform1i(location, v);
|
||
}`},pP={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function gP(i,t){var s;const e=[`
|
||
var v = null;
|
||
var cv = null;
|
||
var cu = null;
|
||
var t = 0;
|
||
var gl = renderer.gl;
|
||
`];for(const r in i.uniforms){const n=t[r];if(!n){((s=i.uniforms[r])==null?void 0:s.group)===!0&&(i.uniforms[r].ubo?e.push(`
|
||
renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}');
|
||
`):e.push(`
|
||
renderer.shader.syncUniformGroup(uv.${r}, syncData);
|
||
`));continue}const a=i.uniforms[r];let o=!1;for(let h=0;h<Ra.length;h++)if(Ra[h].test(n,a)){e.push(Ra[h].code(r,a)),o=!0;break}if(!o){const h=(n.size===1&&!n.isArray?mP:pP)[n.type].replace("location",`ud["${r}"].location`);e.push(`
|
||
cu = ud["${r}"];
|
||
cv = cu.value;
|
||
v = uv["${r}"];
|
||
${h};`)}}return new Function("ud","uv","renderer","syncData",e.join(`
|
||
`))}const I_={};let oa=I_;function yP(){if(oa===I_||oa!=null&&oa.isContextLost()){const i=_t.ADAPTER.createCanvas();let t;_t.PREFER_ENV>=Kn.WEBGL2&&(t=i.getContext("webgl2",{})),t||(t=i.getContext("webgl",{})||i.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),oa=t}return oa}let Jl;function xP(){if(!Jl){Jl=Ks.MEDIUM;const i=yP();if(i&&i.getShaderPrecisionFormat){const t=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);t&&(Jl=t.precision?Ks.HIGH:Ks.MEDIUM)}}return Jl}function gx(i,t){const e=i.getShaderSource(t).split(`
|
||
`).map((l,c)=>`${c}: ${l}`),s=i.getShaderInfoLog(t),r=s.split(`
|
||
`),n={},a=r.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!n[l]?(n[l]=!0,!0):!1),o=[""];a.forEach(l=>{e[l-1]=`%c${e[l-1]}%c`,o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=e.join(`
|
||
`);o[0]=h,console.error(s),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function bP(i,t,e,s){i.getProgramParameter(t,i.LINK_STATUS)||(i.getShaderParameter(e,i.COMPILE_STATUS)||gx(i,e),i.getShaderParameter(s,i.COMPILE_STATUS)||gx(i,s),console.error("PixiJS Error: Could not initialize shader."),i.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",i.getProgramInfoLog(t)))}const vP={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function P_(i){return vP[i]}let Ql=null;const yx={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function M_(i,t){if(!Ql){const e=Object.keys(yx);Ql={};for(let s=0;s<e.length;++s){const r=e[s];Ql[i[r]]=yx[r]}}return Ql[t]}function xx(i,t,e){if(i.substring(0,9)!=="precision"){let s=t;return t===Ks.HIGH&&e!==Ks.HIGH&&(s=Ks.MEDIUM),`precision ${s} float;
|
||
${i}`}else if(e!==Ks.HIGH&&i.substring(0,15)==="precision highp")return i.replace("precision highp","precision mediump");return i}let mo;function _P(){if(typeof mo=="boolean")return mo;try{mo=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{mo=!1}return mo}let wP=0;const th={},Sm=class fa{constructor(t,e,s="pixi-shader",r={}){this.extra={},this.id=wP++,this.vertexSrc=t||fa.defaultVertexSrc,this.fragmentSrc=e||fa.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=r,this.vertexSrc.substring(0,8)!=="#version"&&(s=s.replace(/\s+/g,"-"),th[s]?(th[s]++,s+=`-${th[s]}`):th[s]=1,this.vertexSrc=`#define SHADER_NAME ${s}
|
||
${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${s}
|
||
${this.fragmentSrc}`,this.vertexSrc=xx(this.vertexSrc,fa.defaultVertexPrecision,Ks.HIGH),this.fragmentSrc=xx(this.fragmentSrc,fa.defaultFragmentPrecision,xP())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return fP}static get defaultFragmentSrc(){return dP}static from(t,e,s){const r=t+e;let n=cx[r];return n||(cx[r]=n=new fa(t,e,s)),n}};Sm.defaultVertexPrecision=Ks.HIGH,Sm.defaultFragmentPrecision=pi.apple.device?Ks.HIGH:Ks.MEDIUM;let ur=Sm,TP=0;class yr{constructor(t,e,s){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=TP++,this.static=!!e,this.ubo=!!s,t instanceof ne?(this.buffer=t,this.buffer.type=$r.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new ne(new Float32Array(1)),this.buffer.type=$r.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,e,s){if(!this.ubo)this.uniforms[t]=new yr(e,s);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(t,e,s){return new yr(t,e,s)}static uboFrom(t,e){return new yr(t,e??!0,!0)}}class Js{constructor(t,e){this.uniformBindCount=0,this.program=t,e?e instanceof yr?this.uniformGroup=e:this.uniformGroup=new yr(e):this.uniformGroup=new yr({}),this.disposeRunner=new gr("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const s in e.uniforms){const r=e.uniforms[s];if(r.group===!0&&this.checkUniformExists(t,r))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,e,s){const r=ur.from(t,e);return new Js(r,s)}}class Np{constructor(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},!e.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!e.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const s=new Int32Array(t);for(let n=0;n<t;n++)s[n]=n;this.defaultGroupCache[t]=yr.from({uSamplers:s},!0);let r=this.fragTemplate;r=r.replace(/%count%/gi,`${t}`),r=r.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new ur(this.vertexSrc,r)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new fe,default:this.defaultGroupCache[t]};return new Js(this.programCache[t],e)}generateSampleSrc(t){let e="";e+=`
|
||
`,e+=`
|
||
`;for(let s=0;s<t;s++)s>0&&(e+=`
|
||
else `),s<t-1&&(e+=`if(vTextureId < ${s}.5)`),e+=`
|
||
{`,e+=`
|
||
color = texture2D(uSamplers[${s}], vTextureCoord);`,e+=`
|
||
}`;return e+=`
|
||
`,e+=`
|
||
`,e}}class Em{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}function SP(){return!pi.apple.device}function EP(i){let t=!0;const e=_t.ADAPTER.getNavigator();if(pi.tablet||pi.phone){if(pi.apple.device){const s=e.userAgent.match(/OS (\d+)_(\d+)?/);s&&parseInt(s[1],10)<11&&(t=!1)}if(pi.android.device){const s=e.userAgent.match(/Android\s([0-9.]*)/);s&&parseInt(s[1],10)<7&&(t=!1)}}return t?i:4}class zc{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var AP=`varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
varying float vTextureId;
|
||
uniform sampler2D uSamplers[%count%];
|
||
|
||
void main(void){
|
||
vec4 color;
|
||
%forloop%
|
||
gl_FragColor = color * vColor;
|
||
}
|
||
`,CP=`precision highp float;
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
attribute vec4 aColor;
|
||
attribute float aTextureId;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform vec4 tint;
|
||
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
varying float vTextureId;
|
||
|
||
void main(void){
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = aTextureCoord;
|
||
vTextureId = aTextureId;
|
||
vColor = aColor * tint;
|
||
}
|
||
`;const _o=class ar extends zc{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=E_,this.vertexSize=6,this.state=jr.for2d(),this.size=ar.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),t.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??EP(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??SP(),this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return Ht("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return CP}static get defaultFragmentTemplate(){return AP}setShaderGenerator({vertex:t=ar.defaultVertexSrc,fragment:e=ar.defaultFragmentTemplate}={}){this.shaderGenerator=new Np(t,e)}contextChange(){const t=this.renderer.gl;_t.PREFER_ENV===Kn.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),ar.defaultMaxTextures),this.maxTextures=sP(this.maxTextures,t)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:t,_textureArrayPool:e}=ar,s=this.size/4,r=Math.floor(s/this.maxTextures)+1;for(;t.length<s;)t.push(new _m);for(;e.length<r;)e.push(new Em);for(let n=0;n<this.maxTextures;n++)this._tempBoundTextures[n]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,s=ar._textureArrayPool,r=this.renderer.batch,n=this._tempBoundTextures,a=this.renderer.textureGC.count;let o=++Lt._globalBatch,h=0,l=s[0],c=0;r.copyBoundTextures(n,e);for(let u=0;u<this._bufferSize;++u){const d=t[u];t[u]=null,d._batchEnabled!==o&&(l.count>=e&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,c,u),c=u,l=s[++h],++o),d._batchEnabled=o,d.touched=a,l.elements[l.count++]=d)}l.count>0&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,c,this._bufferSize),++h,++o);for(let u=0;u<n.length;u++)n[u]=null;Lt._globalBatch=o}buildDrawCalls(t,e,s){const{_bufferedElements:r,_attributeBuffer:n,_indexBuffer:a,vertexSize:o}=this,h=ar._drawCallPool;let l=this._dcIndex,c=this._aIndex,u=this._iIndex,d=h[l];d.start=this._iIndex,d.texArray=t;for(let f=e;f<s;++f){const m=r[f],p=m._texture.baseTexture,g=__[p.alphaMode?1:0][m.blendMode];r[f]=null,e<f&&d.blend!==g&&(d.size=u-d.start,e=f,d=h[++l],d.texArray=t,d.start=u),this.packInterleavedGeometry(m,n,a,c,u),c+=m.vertexData.length/2*o,u+=m.indices.length,d.blend=g}e<s&&(d.size=u-d.start,++l),this._dcIndex=l,this._aIndex=c,this._iIndex=u}bindAndClearTexArray(t){const e=this.renderer.texture;for(let s=0;s<t.count;s++)e.bind(t.elements[s],t.ids[s]),t.elements[s]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:s}=this;ar.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(s),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(s),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:s}=this.renderer,r=ar._drawCallPool;let n=null;for(let a=0;a<t;a++){const{texArray:o,type:h,size:l,start:c,blend:u}=r[a];n!==o&&(n=o,this.bindAndClearTexArray(o)),this.state.blendMode=u,s.set(this.state),e.drawElements(h,l,e.UNSIGNED_SHORT,c*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),ar.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=Hh(Math.ceil(t/8)),s=lx(e),r=e*8;this._aBuffers.length<=s&&(this._iBuffers.length=s+1);let n=this._aBuffers[r];return n||(this._aBuffers[r]=n=new xm(r*this.vertexSize*4)),n}getIndexBuffer(t){const e=Hh(Math.ceil(t/12)),s=lx(e),r=e*12;this._iBuffers.length<=s&&(this._iBuffers.length=s+1);let n=this._iBuffers[s];return n||(this._iBuffers[s]=n=new Uint16Array(r)),n}packInterleavedGeometry(t,e,s,r,n){const{uint32View:a,float32View:o}=e,h=r/this.vertexSize,l=t.uvs,c=t.indices,u=t.vertexData,d=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),m=Wt.shared.setValue(t._tintRGB).toPremultiplied(f,t._texture.baseTexture.alphaMode>0);for(let p=0;p<u.length;p+=2)o[r++]=u[p],o[r++]=u[p+1],o[r++]=l[p],o[r++]=l[p+1],a[r++]=m,o[r++]=d;for(let p=0;p<c.length;p++)s[n++]=h+c[p]}};_o.defaultBatchSize=4096,_o.extension={name:"batch",type:gt.RendererPlugin},_o._drawCallPool=[],_o._textureArrayPool=[];let li=_o;St.add(li);var IP=`varying vec2 vTextureCoord;
|
||
|
||
uniform sampler2D uSampler;
|
||
|
||
void main(void){
|
||
gl_FragColor = texture2D(uSampler, vTextureCoord);
|
||
}
|
||
`,PP=`attribute vec2 aVertexPosition;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
uniform vec4 inputSize;
|
||
uniform vec4 outputFrame;
|
||
|
||
vec4 filterVertexPosition( void )
|
||
{
|
||
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
|
||
|
||
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
||
}
|
||
|
||
vec2 filterTextureCoord( void )
|
||
{
|
||
return aVertexPosition * (outputFrame.zw * inputSize.zw);
|
||
}
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = filterVertexPosition();
|
||
vTextureCoord = filterTextureCoord();
|
||
}
|
||
`;const Am=class wo extends Js{constructor(t,e,s){const r=ur.from(t||wo.defaultVertexSrc,e||wo.defaultFragmentSrc);super(r,s),this.padding=0,this.resolution=wo.defaultResolution,this.multisample=wo.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new jr}apply(t,e,s,r,n){t.applyFilter(this,e,s,r)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return PP}static get defaultFragmentSrc(){return IP}};Am.defaultResolution=1,Am.defaultMultisample=De.NONE;let _s=Am;class jh{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Wt(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:s,backgroundAlpha:r}=t,n=s??e;n!==void 0&&(this.color=n),this.alpha=r}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}jh.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},jh.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"background"};St.add(jh);class R_{constructor(t){this.renderer=t,this.emptyRenderer=new zc(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,e){const{boundTextures:s}=this.renderer.texture;for(let r=e-1;r>=0;--r)t[r]=s[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,e,s,r){const{elements:n,ids:a,count:o}=t;let h=0;for(let l=0;l<o;l++){const c=n[l],u=c._batchLocation;if(u>=0&&u<r&&e[u]===c){a[l]=u;continue}for(;h<r;){const d=e[h];if(d&&d._batchEnabled===s&&d._batchLocation===h){h++;continue}a[l]=h,c._batchLocation=h,e[h]=c;break}}}destroy(){this.renderer=null}}R_.extension={type:gt.RendererSystem,name:"batch"};St.add(R_);let bx=0;class qh{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=bx++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,s=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:s,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=bx++,this.renderer.runners.contextChange.emit(t);const e=this.renderer.view;e.addEventListener!==void 0&&(e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const e=this.createContext(this.renderer.view,t);this.initFromContext(e)}createContext(t,e){let s;if(_t.PREFER_ENV>=Kn.WEBGL2&&(s=t.getContext("webgl2",e)),s)this.webGLVersion=2;else if(this.webGLVersion=1,s=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!s)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=s,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),s="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;s&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=s||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}qh.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},qh.extension={type:gt.RendererSystem,name:"context"};St.add(qh);class Cm{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new gr("disposeFramebuffer"),this.multisample=De.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new Lt(null,{scaleMode:Ns.NEAREST,resolution:1,mipmap:Ms.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new Lt(null,{scaleMode:Ns.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ms.OFF,format:ft.DEPTH_COMPONENT,type:wt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let s=0;s<this.colorTextures.length;s++){const r=this.colorTextures[s],n=r.resolution;r.setSize(t/n,e/n)}if(this.depthTexture){const s=this.depthTexture.resolution;this.depthTexture.setSize(t/s,e/s)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class F_ extends Lt{constructor(t={}){if(typeof t=="number"){const e=arguments[0],s=arguments[1],r=arguments[2],n=arguments[3];t={width:e,height:s,scaleMode:r,resolution:n}}t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=De.NONE),super(null,t),this.mipmap=Ms.OFF,this.valid=!0,this._clear=new Wt([0,0,0,0]),this.framebuffer=new Cm(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class Ii extends el{constructor(t){const e=t,s=e.naturalWidth||e.videoWidth||e.displayWidth||e.width,r=e.naturalHeight||e.videoHeight||e.displayHeight||e.height;super(s,r),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,s){s===void 0&&!e.startsWith("data:")?t.crossOrigin=QI(e):s!==!1&&(t.crossOrigin=typeof s=="string"?s:"anonymous")}upload(t,e,s,r){const n=t.gl,a=e.realWidth,o=e.realHeight;if(r=r||this.source,typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement){if(!r.complete||r.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement&&r.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Ke.UNPACK),!this.noSubImage&&e.target===n.TEXTURE_2D&&s.width===a&&s.height===o?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,s.type,r):(s.width=a,s.height=o,n.texImage2D(e.target,0,s.internalFormat,e.format,s.type,r)),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,s=t.naturalHeight||t.videoHeight||t.height;this.resize(e,s),super.update()}dispose(){this.source=null}}class k_ extends Ii{constructor(t,e){if(e=e||{},typeof t=="string"){const s=new Image;Ii.crossOrigin(s,t,e.crossorigin),s.src=t,t=s}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(e.createBitmap??_t.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof e.alphaMode=="number"?e.alphaMode:null,this.bitmap=null,this._load=null,e.autoLoad!==!1&&this.load()}load(t){return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise((e,s)=>{const r=this.source;this.url=r.src;const n=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.update(),this._load=null,this.createBitmap?e(this.process()):e(this))};r.complete&&r.src?n():(r.onload=n,r.onerror=a=>{s(a),this.onError.emit(a)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,s=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:s?"cors":"no-cors"}).then(r=>r.blob()).then(r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ke.UNPACK?"premultiply":"none"})).then(r=>this.destroyed?Promise.reject():(this.bitmap=r,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,e,s){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,s);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,s,this.bitmap),!this.preserveBitmap){let r=!0;const n=e._glTextures;for(const a in n){const o=n[a];if(o!==s&&o.dirtyId!==e.dirtyId){r=!1;break}}r&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class Up{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,s){const r=e.width,n=e.height;if(s){const a=t.width/2/r,o=t.height/2/n,h=t.x/r+a,l=t.y/n+o;s=Ee.add(s,Ee.NW),this.x0=h+a*Ee.uX(s),this.y0=l+o*Ee.uY(s),s=Ee.add(s,2),this.x1=h+a*Ee.uX(s),this.y1=l+o*Ee.uY(s),s=Ee.add(s,2),this.x2=h+a*Ee.uX(s),this.y2=l+o*Ee.uY(s),s=Ee.add(s,2),this.x3=h+a*Ee.uX(s),this.y3=l+o*Ee.uY(s)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Up.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const vx=new Up;function eh(i){i.destroy=function(){},i.on=function(){},i.once=function(){},i.emit=function(){}}let Nt=class pe extends Al{constructor(t,e,s,r,n,a,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new Ut(0,0,1,1)),t instanceof pe&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=r,this.valid=!1,this.destroyed=!1,this._uvs=vx,this.uvMatrix=null,this.orig=s||e,this._rotate=Number(n||0),n===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new Kt(a.x,a.y):new Kt(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:e}=this.baseTexture;e!=null&&e.url&&Cr[e.url]&&pe.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,pe.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var r;const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),s=new pe(this.baseTexture,!this.noFrame&&t,e,(r=this.trim)==null?void 0:r.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(s._frame=t),s}updateUvs(){this._uvs===vx&&(this._uvs=new Up),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},s=_t.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else if(t instanceof Lt){if(!t.cacheId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${Hn()}`,Lt.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${Hn()}`}n=t._pixiId}let a=Cr[n];if(r&&s&&!a)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!a&&!(t instanceof Lt)?(e.resolution||(e.resolution=Ci(t)),a=new pe(new Lt(t,e)),a.baseTexture.cacheId=n,Lt.addToCache(a.baseTexture,n),pe.addToCache(a,n)):!a&&t instanceof Lt&&(a=new pe(t),pe.addToCache(a,n)),a}static fromURL(t,e){const s=Object.assign({autoLoad:!1},e==null?void 0:e.resourceOptions),r=pe.from(t,Object.assign({resourceOptions:s},e),!1),n=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):n.load().then(()=>Promise.resolve(r))}static fromBuffer(t,e,s,r){return new pe(Lt.fromBuffer(t,e,s,r))}static fromLoader(t,e,s,r){const n=new Lt(t,Object.assign({scaleMode:Lt.defaultOptions.scaleMode,resolution:Ci(e)},r)),{resource:a}=n;a instanceof k_&&(a.url=e);const o=new pe(n);return s||(s=e),Lt.addToCache(o.baseTexture,s),pe.addToCache(o,s),s!==e&&(Lt.addToCache(o.baseTexture,e),pe.addToCache(o,e)),o.baseTexture.valid?Promise.resolve(o):new Promise(h=>{o.baseTexture.once("loaded",()=>h(o))})}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Cr[e]&&Cr[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),Cr[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Cr[t];if(e){const s=e.textureCacheIds.indexOf(t);return s>-1&&e.textureCacheIds.splice(s,1),delete Cr[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)Cr[t.textureCacheIds[e]]===t&&delete Cr[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:e,y:s,width:r,height:n}=t,a=e+r>this.baseTexture.width,o=s+n>this.baseTexture.height;if(a||o){const h=a&&o?"and":"or",l=`X: ${e} + ${r} = ${e+r} > ${this.baseTexture.width}`,c=`Y: ${s} + ${n} = ${s+n} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}this.valid=r&&n&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return pe._EMPTY||(pe._EMPTY=new pe(new Lt),eh(pe._EMPTY),eh(pe._EMPTY.baseTexture)),pe._EMPTY}static get WHITE(){if(!pe._WHITE){const t=_t.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),pe._WHITE=new pe(Lt.from(t)),eh(pe._WHITE),eh(pe._WHITE.baseTexture)}return pe._WHITE}};class Zn extends Nt{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,s=!0){const r=this.baseTexture.resolution,n=Math.round(t*r)/r,a=Math.round(e*r)/r;this.valid=n>0&&a>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=a,s&&this.baseTexture.resize(n,a),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new Zn(new F_(t))}}class L_{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,s=De.NONE){const r=new F_(Object.assign({width:t,height:e,resolution:1,multisample:s},this.textureOptions));return new Zn(r)}getOptimalTexture(t,e,s=1,r=De.NONE){let n;t=Math.max(Math.ceil(t*s-1e-6),1),e=Math.max(Math.ceil(e*s-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=Hh(t),e=Hh(e),n=((t&65535)<<16|e&65535)>>>0,r>1&&(n+=r*4294967296)):n=r>1?-r:-1,this.texturePool[n]||(this.texturePool[n]=[]);let a=this.texturePool[n].pop();return a||(a=this.createTexture(t,e,r)),a.filterPoolKey=n,a.setResolution(s),a}getFilterTexture(t,e,s){const r=this.getOptimalTexture(t.width,t.height,e||t.resolution,s||De.NONE);return r.filterFrame=t.filterFrame,r}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const e in this.texturePool){const s=this.texturePool[e];if(s)for(let r=0;r<s.length;r++)s[r].destroy(!0)}this.texturePool={}}setScreenSize(t){if(!(t.width===this._pixelsWidth&&t.height===this._pixelsHeight)){this.enableFullScreen=t.width>0&&t.height>0;for(const e in this.texturePool){if(!(Number(e)<0))continue;const s=this.texturePool[e];if(s)for(let r=0;r<s.length;r++)s[r].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}L_.SCREEN_KEY=-1;class MP extends er{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class B_ extends er{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new ne(this.vertices),this.uvBuffer=new ne(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let s=0,r=0;return this.uvs[0]=s,this.uvs[1]=r,this.uvs[2]=s+e.width/t.width,this.uvs[3]=r,this.uvs[4]=s+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=s,this.uvs[7]=r+e.height/t.height,s=e.x,r=e.y,this.vertices[0]=s,this.vertices[1]=r,this.vertices[2]=s+e.width,this.vertices[3]=r,this.vertices[4]=s+e.width,this.vertices[5]=r+e.height,this.vertices[6]=s,this.vertices[7]=r+e.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class RP{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=De.NONE,this.sourceFrame=new Ut,this.destinationFrame=new Ut,this.bindingSourceFrame=new Ut,this.bindingDestinationFrame=new Ut,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const sh=[new Kt,new Kt,new Kt,new Kt],_f=new fe;class O_{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new L_,this.statePool=[],this.quad=new MP,this.quadUv=new B_,this.tempRect=new Ut,this.activeState={},this.globalUniforms=new yr({outputFrame:new Ut,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,e){const s=this.renderer,r=this.defaultFilterStack,n=this.statePool.pop()||new RP,a=s.renderTexture;let o,h;if(a.current){const g=a.current;o=g.resolution,h=g.multisample}else o=s.resolution,h=s.multisample;let l=e[0].resolution||o,c=e[0].multisample??h,u=e[0].padding,d=e[0].autoFit,f=e[0].legacy??!0;for(let g=1;g<e.length;g++){const y=e[g];l=Math.min(l,y.resolution||o),c=Math.min(c,y.multisample??h),u=this.useMaxPadding?Math.max(u,y.padding):u+y.padding,d=d&&y.autoFit,f=f||(y.legacy??!0)}r.length===1&&(this.defaultFilterStack[0].renderTexture=a.current),r.push(n),n.resolution=l,n.multisample=c,n.legacy=f,n.target=t,n.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),n.sourceFrame.pad(u);const m=this.tempRect.copyFrom(a.sourceFrame);s.projection.transform&&this.transformAABB(_f.copyFrom(s.projection.transform).invert(),m),d?(n.sourceFrame.fit(m),(n.sourceFrame.width<=0||n.sourceFrame.height<=0)&&(n.sourceFrame.width=0,n.sourceFrame.height=0)):n.sourceFrame.intersects(m)||(n.sourceFrame.width=0,n.sourceFrame.height=0),this.roundFrame(n.sourceFrame,a.current?a.current.resolution:s.resolution,a.sourceFrame,a.destinationFrame,s.projection.transform),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,l,c),n.filters=e,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height;const p=this.tempRect;p.x=0,p.y=0,p.width=n.sourceFrame.width,p.height=n.sourceFrame.height,n.renderTexture.filterFrame=n.sourceFrame,n.bindingSourceFrame.copyFrom(a.sourceFrame),n.bindingDestinationFrame.copyFrom(a.destinationFrame),n.transform=s.projection.transform,s.projection.transform=null,a.bind(n.renderTexture,n.sourceFrame,p),s.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),s=e.filters;this.activeState=e;const r=this.globalUniforms.uniforms;r.outputFrame=e.sourceFrame,r.resolution=e.resolution;const n=r.inputSize,a=r.inputPixel,o=r.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],a[0]=Math.round(n[0]*e.resolution),a[1]=Math.round(n[1]*e.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=e.sourceFrame.width*n[2]-.5*a[2],o[3]=e.sourceFrame.height*n[3]-.5*a[3],e.legacy){const l=r.filterArea;l[0]=e.destinationFrame.width,l[1]=e.destinationFrame.height,l[2]=e.sourceFrame.x,l[3]=e.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();const h=t[t.length-1];if(this.renderer.framebuffer.blit(),s.length===1)s[0].apply(this,e.renderTexture,h.renderTexture,Nr.BLEND,e),this.returnFilterTexture(e.renderTexture);else{let l=e.renderTexture,c=this.getOptimalFilterTexture(l.width,l.height,e.resolution);c.filterFrame=l.filterFrame;let u=0;for(u=0;u<s.length-1;++u){u===1&&e.multisample>1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),s[u].apply(this,l,c,Nr.CLEAR,e);const d=l;l=c,c=d}s[u].apply(this,l,h.renderTexture,Nr.BLEND,e),u>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=Nr.CLEAR){const{renderTexture:s,state:r}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t==null?void 0:t.filterFrame){const a=this.tempRect;a.x=0,a.y=0,a.width=t.filterFrame.width,a.height=t.filterFrame.height,s.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?s.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=r.stateId&1||this.forceClear;(e===Nr.CLEAR||e===Nr.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,s,r){const n=this.renderer;n.state.set(t.state),this.bindAndClear(s,r),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(Yr.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(Yr.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:s,destinationFrame:r}=this.activeState,{orig:n}=e._texture,a=t.set(r.width,0,0,r.height,s.x,s.y),o=e.worldTransform.copyTo(fe.TEMP_MATRIX);return o.invert(),a.prepend(o),a.scale(1/n.width,1/n.height),a.translate(e.anchor.x,e.anchor.y),a}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,s=1,r=De.NONE){return this.texturePool.getOptimalTexture(t,e,s,r)}getFilterTexture(t,e,s){if(typeof t=="number"){const n=t;t=e,e=n}t=t||this.activeState.renderTexture;const r=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,s||De.NONE);return r.filterFrame=t.filterFrame,r}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const s=sh[0],r=sh[1],n=sh[2],a=sh[3];s.set(e.left,e.top),r.set(e.left,e.bottom),n.set(e.right,e.top),a.set(e.right,e.bottom),t.apply(s,s),t.apply(r,r),t.apply(n,n),t.apply(a,a);const o=Math.min(s.x,r.x,n.x,a.x),h=Math.min(s.y,r.y,n.y,a.y),l=Math.max(s.x,r.x,n.x,a.x),c=Math.max(s.y,r.y,n.y,a.y);e.x=o,e.y=h,e.width=l-o,e.height=c-h}roundFrame(t,e,s,r,n){if(!(t.width<=0||t.height<=0||s.width<=0||s.height<=0)){if(n){const{a,b:o,c:h,d:l}=n;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(l)>1e-4))return}n=n?_f.copyFrom(n):_f.identity(),n.translate(-s.x,-s.y).scale(r.width/s.width,r.height/s.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}}}O_.extension={type:gt.RendererSystem,name:"filter"};St.add(O_);class FP{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=De.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const kP=new Ut;class D_{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Cm(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ut,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,s=this.renderer.context.extensions.depthTexture;_t.PREFER_ENV===Kn.WEBGL_LEGACY&&(e=null,s=null),e?t.drawBuffers=r=>e.drawBuffersWEBGL(r):(this.hasMRT=!1,t.drawBuffers=()=>{}),s||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,s=0){const{gl:r}=this;if(t){const n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==s&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=s),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,s)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let a=0;a<t.colorTextures.length;a++){const o=t.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){const a=e.width>>s,o=e.height>>s,h=a/e.width;this.setViewport(e.x*h,e.y*h,a,o)}else{const a=t.width>>s,o=t.height>>s;this.setViewport(0,0,a,o)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,s,r){const n=this.viewport;t=Math.round(t),e=Math.round(e),s=Math.round(s),r=Math.round(r),(n.width!==s||n.height!==r||n.x!==t||n.y!==e)&&(n.x=t,n.y=e,n.width=s,n.height=r,this.gl.viewport(t,e,s,r))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,s,r,n=fm.COLOR|fm.DEPTH){const{gl:a}=this;a.clearColor(t,e,s,r),a.clear(n)}initFramebuffer(t){const{gl:e}=this,s=new FP(e.createFramebuffer());return s.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=s,this.managedFramebuffers.push(t),t.disposeRunner.add(this),s}resizeFramebuffer(t){const{gl:e}=this,s=t.glFramebuffers[this.CONTEXT_UID];if(s.stencil){e.bindRenderbuffer(e.RENDERBUFFER,s.stencil);let a;this.renderer.context.webGLVersion===1?a=e.DEPTH_STENCIL:t.depth&&t.stencil?a=e.DEPTH24_STENCIL8:t.depth?a=e.DEPTH_COMPONENT24:a=e.STENCIL_INDEX8,s.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,s.multisample,a,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,a,t.width,t.height)}const r=t.colorTextures;let n=r.length;e.drawBuffers||(n=Math.min(n,1));for(let a=0;a<n;a++){const o=r[a],h=o.parentTextureArray||o;this.renderer.texture.bind(h,0),a===0&&s.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,s.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,s.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,e){const{gl:s}=this,r=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures;let a=n.length;s.drawBuffers||(a=Math.min(a,1)),r.multisample>1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||s.createRenderbuffer():r.msaaBuffer&&(s.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));const o=[];for(let h=0;h<a;h++){const l=n[h],c=l.parentTextureArray||l;this.renderer.texture.bind(c,0),h===0&&r.msaaBuffer?(s.bindRenderbuffer(s.RENDERBUFFER,r.msaaBuffer),s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,r.msaaBuffer)):(s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+h,l.target,c._glTextures[this.CONTEXT_UID].texture,e),o.push(s.COLOR_ATTACHMENT0+h))}if(o.length>1&&s.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){r.stencil=r.stencil||s.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=s.DEPTH_STENCIL_ATTACHMENT,l=s.DEPTH_STENCIL):t.depth&&t.stencil?(h=s.DEPTH_STENCIL_ATTACHMENT,l=s.DEPTH24_STENCIL8):t.depth?(h=s.DEPTH_ATTACHMENT,l=s.DEPTH_COMPONENT24):(h=s.STENCIL_ATTACHMENT,l=s.STENCIL_INDEX8),s.bindRenderbuffer(s.RENDERBUFFER,r.stencil),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,l,t.width,t.height):s.renderbufferStorage(s.RENDERBUFFER,l,t.width,t.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,h,s.RENDERBUFFER,r.stencil)}else r.stencil&&(s.deleteRenderbuffer(r.stencil),r.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let s=De.NONE;if(t<=1||e===null)return s;for(let r=0;r<e.length;r++)if(e[r]<=t){s=e[r];break}return s===1&&(s=De.NONE),s}blit(t,e,s){const{current:r,renderer:n,gl:a,CONTEXT_UID:o}=this;if(n.context.webGLVersion!==2||!r)return;const h=r.glFramebuffers[o];if(!h)return;if(!t){if(!h.msaaBuffer)return;const c=r.colorTextures[0];if(!c)return;h.blitFramebuffer||(h.blitFramebuffer=new Cm(r.width,r.height),h.blitFramebuffer.addColorTexture(0,c)),t=h.blitFramebuffer,t.colorTextures[0]!==c&&(t.colorTextures[0]=c,t.dirtyId++,t.dirtyFormat++),(t.width!==r.width||t.height!==r.height)&&(t.width=r.width,t.height=r.height,t.dirtyId++,t.dirtySize++)}e||(e=kP,e.width=r.width,e.height=r.height),s||(s=e);const l=e.width===s.width&&e.height===s.height;this.bind(t),a.bindFramebuffer(a.READ_FRAMEBUFFER,h.framebuffer),a.blitFramebuffer(e.left,e.top,e.right,e.bottom,s.left,s.top,s.right,s.bottom,a.COLOR_BUFFER_BIT,l?a.NEAREST:a.LINEAR),a.bindFramebuffer(a.READ_FRAMEBUFFER,t.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(t,e){const s=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(!s)return;delete t.glFramebuffers[this.CONTEXT_UID];const n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(s.framebuffer),s.msaaBuffer&&r.deleteRenderbuffer(s.msaaBuffer),s.stencil&&r.deleteRenderbuffer(s.stencil)),s.blitFramebuffer&&this.disposeFramebuffer(s.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let s=0;s<e.length;s++)this.disposeFramebuffer(e[s],t)}forceStencil(){const t=this.current;if(!t)return;const e=t.glFramebuffers[this.CONTEXT_UID];if(!e||e.stencil&&t.stencil)return;t.stencil=!0;const s=t.width,r=t.height,n=this.gl,a=e.stencil=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,a);let o,h;this.renderer.context.webGLVersion===1?(o=n.DEPTH_STENCIL_ATTACHMENT,h=n.DEPTH_STENCIL):t.depth?(o=n.DEPTH_STENCIL_ATTACHMENT,h=n.DEPTH24_STENCIL8):(o=n.STENCIL_ATTACHMENT,h=n.STENCIL_INDEX8),e.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,e.multisample,h,s,r):n.renderbufferStorage(n.RENDERBUFFER,h,s,r),n.framebufferRenderbuffer(n.FRAMEBUFFER,o,n.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new Ut}destroy(){this.renderer=null}}D_.extension={type:gt.RendererSystem,name:"framebuffer"};St.add(D_);const wf={5126:4,5123:2,5121:1};class N_{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,e.webGLVersion!==2){let s=this.renderer.context.extensions.vertexArrayObject;_t.PREFER_ENV===Kn.WEBGL_LEGACY&&(s=null),s?(t.createVertexArray=()=>s.createVertexArrayOES(),t.bindVertexArray=r=>s.bindVertexArrayOES(r),t.deleteVertexArray=r=>s.deleteVertexArrayOES(r)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const s=t.getExtension("ANGLE_instanced_arrays");s?(t.vertexAttribDivisor=(r,n)=>s.vertexAttribDivisorANGLE(r,n),t.drawElementsInstanced=(r,n,a,o,h)=>s.drawElementsInstancedANGLE(r,n,a,o,h),t.drawArraysInstanced=(r,n,a,o)=>s.drawArraysInstancedANGLE(r,n,a,o)):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:s}=this;let r=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={},n=!0);const a=r[e.program.id]||this.initGeometryVao(t,e,n);this._activeGeometry=t,this._activeVao!==a&&(this._activeVao=a,this.hasVao?s.bindVertexArray(a):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let s=0;s<t.buffers.length;s++){const r=t.buffers[s];e.update(r)}}checkCompatibility(t,e){const s=t.attributes,r=e.attributeData;for(const n in r)if(!s[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(t,e){const s=t.attributes,r=e.attributeData,n=["g",t.id];for(const a in s)r[a]&&n.push(a,r[a].location);return n.join("-")}initGeometryVao(t,e,s=!0){const r=this.gl,n=this.CONTEXT_UID,a=this.renderer.buffer,o=e.program;o.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,o);const h=this.getSignature(t,o),l=t.glVertexArrayObjects[this.CONTEXT_UID];let c=l[h];if(c)return l[o.id]=c,c;const u=t.buffers,d=t.attributes,f={},m={};for(const p in u)f[p]=0,m[p]=0;for(const p in d)!d[p].size&&o.attributeData[p]?d[p].size=o.attributeData[p].size:d[p].size||console.warn(`PIXI Geometry attribute '${p}' size cannot be determined (likely the bound shader does not have the attribute)`),f[d[p].buffer]+=d[p].size*wf[d[p].type];for(const p in d){const g=d[p],y=g.size;g.stride===void 0&&(f[g.buffer]===y*wf[g.type]?g.stride=0:g.stride=f[g.buffer]),g.start===void 0&&(g.start=m[g.buffer],m[g.buffer]+=y*wf[g.type])}c=r.createVertexArray(),r.bindVertexArray(c);for(let p=0;p<u.length;p++){const g=u[p];a.bind(g),s&&g._glBuffers[n].refCount++}return this.activateVao(t,o),l[o.id]=c,l[h]=c,r.bindVertexArray(null),a.unbind($r.ARRAY_BUFFER),c}disposeGeometry(t,e){var o;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const s=t.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,n=t.buffers,a=(o=this.renderer)==null?void 0:o.buffer;if(t.disposeRunner.remove(this),!!s){if(a)for(let h=0;h<n.length;h++){const l=n[h]._glBuffers[this.CONTEXT_UID];l&&(l.refCount--,l.refCount===0&&!e&&a.dispose(n[h],e))}if(!e){for(const h in s)if(h[0]==="g"){const l=s[h];this._activeVao===l&&this.unbind(),r.deleteVertexArray(l)}}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const e=Object.keys(this.managedGeometries);for(let s=0;s<e.length;s++)this.disposeGeometry(this.managedGeometries[e[s]],t)}activateVao(t,e){const s=this.gl,r=this.CONTEXT_UID,n=this.renderer.buffer,a=t.buffers,o=t.attributes;t.indexBuffer&&n.bind(t.indexBuffer);let h=null;for(const l in o){const c=o[l],u=a[c.buffer],d=u._glBuffers[r];if(e.attributeData[l]){h!==d&&(n.bind(u),h=d);const f=e.attributeData[l].location;if(s.enableVertexAttribArray(f),s.vertexAttribPointer(f,c.size,c.type||s.FLOAT,c.normalized,c.stride,c.start),c.instance)if(this.hasInstance)s.vertexAttribDivisor(f,c.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,e,s,r){const{gl:n}=this,a=this._activeGeometry;if(a.indexBuffer){const o=a.indexBuffer.data.BYTES_PER_ELEMENT,h=o===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?n.drawElementsInstanced(t,e||a.indexBuffer.data.length,h,(s||0)*o,r||1):n.drawElements(t,e||a.indexBuffer.data.length,h,(s||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?n.drawArraysInstanced(t,s,e||a.getSize(),r||1):n.drawArrays(t,s,e||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}N_.extension={type:gt.RendererSystem,name:"geometry"};St.add(N_);const _x=new fe;class jc{constructor(t,e){this._texture=t,this.mapCoord=new fe,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e>"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){e===void 0&&(e=t);const s=this.mapCoord;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];e[r]=n*s.a+a*s.c+s.tx,e[r+1]=n*s.b+a*s.d+s.ty}return e}update(t){const e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;const s=e._uvs;this.mapCoord.set(s.x1-s.x0,s.y1-s.y0,s.x3-s.x0,s.y3-s.y0,s.x0,s.y0);const r=e.orig,n=e.trim;n&&(_x.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(_x));const a=e.baseTexture,o=this.uClampFrame,h=this.clampMargin/a.resolution,l=this.clampOffset;return o[0]=(e._frame.x+h+l)/a.width,o[1]=(e._frame.y+h+l)/a.height,o[2]=(e._frame.x+e._frame.width-h+l)/a.width,o[3]=(e._frame.y+e._frame.height-h+l)/a.height,this.uClampOffset[0]=l/a.realWidth,this.uClampOffset[1]=l/a.realHeight,this.isSimple=e._frame.width===a.width&&e._frame.height===a.height&&e.rotate===0,!0}}var LP=`varying vec2 vMaskCoord;
|
||
varying vec2 vTextureCoord;
|
||
|
||
uniform sampler2D uSampler;
|
||
uniform sampler2D mask;
|
||
uniform float alpha;
|
||
uniform float npmAlpha;
|
||
uniform vec4 maskClamp;
|
||
|
||
void main(void)
|
||
{
|
||
float clip = step(3.5,
|
||
step(maskClamp.x, vMaskCoord.x) +
|
||
step(maskClamp.y, vMaskCoord.y) +
|
||
step(vMaskCoord.x, maskClamp.z) +
|
||
step(vMaskCoord.y, maskClamp.w));
|
||
|
||
vec4 original = texture2D(uSampler, vTextureCoord);
|
||
vec4 masky = texture2D(mask, vMaskCoord);
|
||
float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
|
||
|
||
original *= (alphaMul * masky.r * alpha * clip);
|
||
|
||
gl_FragColor = original;
|
||
}
|
||
`,BP=`attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 otherMatrix;
|
||
|
||
varying vec2 vMaskCoord;
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = aTextureCoord;
|
||
vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
|
||
}
|
||
`;class OP extends _s{constructor(t,e,s){let r=null;typeof t!="string"&&e===void 0&&s===void 0&&(r=t,t=void 0,e=void 0,s=void 0),super(t||BP,e||LP,s),this.maskSprite=r,this.maskMatrix=new fe}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,s,r){const n=this._maskSprite,a=n._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new jc(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,t.applyFilter(this,e,s,r))}}class DP{constructor(t=null){this.type=Ye.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=_s.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ye.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class U_{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,e){let s=e;if(!s.isMaskData){const n=this.maskDataPool.pop()||new DP;n.pooled=!0,n.maskObject=e,s=n}const r=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(s.copyCountersOrReset(r),s._colorMask=r?r._colorMask:15,s.autoDetect&&this.detect(s),s._target=t,s.type!==Ye.SPRITE&&this.maskStack.push(s),s.enabled)switch(s.type){case Ye.SCISSOR:this.renderer.scissor.push(s);break;case Ye.STENCIL:this.renderer.stencil.push(s);break;case Ye.SPRITE:s.copyCountersOrReset(null),this.pushSpriteMask(s);break;case Ye.COLOR:this.pushColorMask(s);break}s.type===Ye.SPRITE&&this.maskStack.push(s)}pop(t){const e=this.maskStack.pop();if(!(!e||e._target!==t)){if(e.enabled)switch(e.type){case Ye.SCISSOR:this.renderer.scissor.pop(e);break;case Ye.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case Ye.SPRITE:this.popSpriteMask(e);break;case Ye.COLOR:this.popColorMask(e);break}if(e.reset(),e.pooled&&this.maskDataPool.push(e),this.maskStack.length!==0){const s=this.maskStack[this.maskStack.length-1];s.type===Ye.SPRITE&&s._filters&&(s._filters[0].maskSprite=s.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=Ye.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Ye.SCISSOR:t.type=Ye.STENCIL:t.type=Ye.COLOR}pushSpriteMask(t){const{maskObject:e}=t,s=t._target;let r=t._filters;r||(r=this.alphaMaskPool[this.alphaMaskIndex],r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new OP])),r[0].resolution=t.resolution,r[0].multisample=t.multisample,r[0].maskSprite=e;const n=s.filterArea;s.filterArea=e.getBounds(!0),this.renderer.filter.push(s,r),s.filterArea=n,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const e=t._colorMask,s=t._colorMask=e&t.colorMask;s!==e&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}popColorMask(t){const e=t._colorMask,s=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;s!==e&&this.renderer.gl.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)}destroy(){this.renderer=null}}U_.extension={type:gt.RendererSystem,name:"mask"};St.add(U_);class X_{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,s=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==s&&(r===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const wx=new fe,Tx=[],V_=class wh extends X_{constructor(t){super(t),this.glConst=_t.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:s}=t,{renderer:r}=this,n=r.renderTexture,a=s.getBounds(!0,Tx.pop()??new Ut);this.roundFrameToPixels(a,n.current?n.current.resolution:r.resolution,n.sourceFrame,n.destinationFrame,r.projection.transform),e&&a.fit(e),t._scissorRectLocal=a}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:s,c:r,d:n}=t;return(Math.abs(s)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||wh.isMatrixRotated(e.worldTransform)||wh.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const s=t._scissorRectLocal;return s.width>0&&s.height>0}roundFrameToPixels(t,e,s,r,n){wh.isMatrixRotated(n)||(n=n?wx.copyFrom(n):wx.identity(),n.translate(-s.x,-s.y).scale(r.width/s.width,r.height/s.height).translate(r.x,r.y),this.renderer.filter.transformAABB(n,t),t.fit(r),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Tx.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};V_.extension={type:gt.RendererSystem,name:"scissor"};let NP=V_;St.add(NP);class Y_ extends X_{constructor(t){super(t),this.glConst=_t.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:s}=this.renderer,r=t._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),s.clearStencil(0),s.clear(s.STENCIL_BUFFER_BIT),s.enable(s.STENCIL_TEST)),t._stencilCounter++;const n=t._colorMask;n!==0&&(t._colorMask=0,s.colorMask(!1,!1,!1,!1)),s.stencilFunc(s.EQUAL,r,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(t._colorMask=n,s.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}pop(t){const e=this.renderer.gl;if(this.getStackLength()===0)e.disable(e.STENCIL_TEST);else{const s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,r=s?s._colorMask:15;r!==0&&(s._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,r!==0&&(s._colorMask=r,e.colorMask((r&1)!==0,(r&2)!==0,(r&4)!==0,(r&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Y_.extension={type:gt.RendererSystem,name:"stencil"};St.add(Y_);class G_{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Ht("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return Ht("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return Ht("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}G_.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"_plugin"};St.add(G_);class $_{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new fe,this.transform=null}update(t,e,s,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,s,r),this.transform&&this.projectionMatrix.append(this.transform);const n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)}calculateProjection(t,e,s,r){const n=this.projectionMatrix,a=r?-1:1;n.identity(),n.a=1/e.width*2,n.d=a*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-a-e.y*n.d}setTransform(t){}destroy(){this.renderer=null}}$_.extension={type:gt.RendererSystem,name:"projection"};St.add($_);const UP=new Dp,Sx=new Ut;class H_{constructor(t){this.renderer=t,this._tempMatrix=new fe}generateTexture(t,e){const{region:s,...r}=e||{},n=(s==null?void 0:s.copyTo(Sx))||t.getLocalBounds(Sx,!0),a=r.resolution||this.renderer.resolution;n.width=Math.max(n.width,1/a),n.height=Math.max(n.height,1/a),r.width=n.width,r.height=n.height,r.resolution=a,r.multisample??(r.multisample=this.renderer.multisample);const o=Zn.create(r);this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const h=t.transform;return t.transform=UP,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=h,o}destroy(){}}H_.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"textureGenerator"};St.add(H_);const vn=new Ut,po=new Ut;class W_{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ut,this.destinationFrame=new Ut,this.viewportFrame=new Ut}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,s){const r=this.renderer;this.current=t;let n,a,o;t?(n=t.baseTexture,o=n.resolution,e||(vn.width=t.frame.width,vn.height=t.frame.height,e=vn),s||(po.x=t.frame.x,po.y=t.frame.y,po.width=e.width,po.height=e.height,s=po),a=n.framebuffer):(o=r.resolution,e||(vn.width=r._view.screen.width,vn.height=r._view.screen.height,e=vn),s||(s=vn,s.width=e.width,s.height=e.height));const h=this.viewportFrame;h.x=s.x*o,h.y=s.y*o,h.width=s.width*o,h.height=s.height*o,t||(h.y=r.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(s,e,o,!a),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(s)}clear(t,e){const s=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=Wt.shared.setValue(t||s);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&r.premultiply(r.alpha);const n=this.destinationFrame,a=this.current?this.current.baseTexture:this.renderer._view.screen,o=n.width!==a.width||n.height!==a.height;if(o){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(r.red,r.green,r.blue,r.alpha,e),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}W_.extension={type:gt.RendererSystem,name:"renderTexture"};St.add(W_);class XP{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function VP(i,t){const e={},s=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES);for(let r=0;r<s;r++){const n=t.getActiveAttrib(i,r);if(n.name.startsWith("gl_"))continue;const a=M_(t,n.type),o={type:a,name:n.name,size:P_(a),location:t.getAttribLocation(i,n.name)};e[n.name]=o}return e}function YP(i,t){const e={},s=t.getProgramParameter(i,t.ACTIVE_UNIFORMS);for(let r=0;r<s;r++){const n=t.getActiveUniform(i,r),a=n.name.replace(/\[.*?\]$/,""),o=!!n.name.match(/\[.*?\]$/),h=M_(t,n.type);e[a]={name:a,index:r,type:h,size:n.size,isArray:o,value:C_(h,n.size)}}return e}function GP(i,t){var o;const e=px(i,i.VERTEX_SHADER,t.vertexSrc),s=px(i,i.FRAGMENT_SHADER,t.fragmentSrc),r=i.createProgram();i.attachShader(r,e),i.attachShader(r,s);const n=(o=t.extra)==null?void 0:o.transformFeedbackVaryings;if(n&&(typeof i.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):i.transformFeedbackVaryings(r,n.names,n.bufferMode==="separate"?i.SEPARATE_ATTRIBS:i.INTERLEAVED_ATTRIBS)),i.linkProgram(r),i.getProgramParameter(r,i.LINK_STATUS)||bP(i,r,e,s),t.attributeData=VP(r,i),t.uniformData=YP(r,i),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(t.vertexSrc)){const h=Object.keys(t.attributeData);h.sort((l,c)=>l>c?1:-1);for(let l=0;l<h.length;l++)t.attributeData[h[l]].location=l,i.bindAttribLocation(r,l,h[l]);i.linkProgram(r)}i.deleteShader(e),i.deleteShader(s);const a={};for(const h in t.uniformData){const l=t.uniformData[h];a[h]={location:i.getUniformLocation(r,h),value:C_(l.type,l.size)}}return new XP(r,a)}function $P(i,t,e,s,r){e.buffer.update(r)}const HP={float:`
|
||
data[offset] = v;
|
||
`,vec2:`
|
||
data[offset] = v[0];
|
||
data[offset+1] = v[1];
|
||
`,vec3:`
|
||
data[offset] = v[0];
|
||
data[offset+1] = v[1];
|
||
data[offset+2] = v[2];
|
||
|
||
`,vec4:`
|
||
data[offset] = v[0];
|
||
data[offset+1] = v[1];
|
||
data[offset+2] = v[2];
|
||
data[offset+3] = v[3];
|
||
`,mat2:`
|
||
data[offset] = v[0];
|
||
data[offset+1] = v[1];
|
||
|
||
data[offset+4] = v[2];
|
||
data[offset+5] = v[3];
|
||
`,mat3:`
|
||
data[offset] = v[0];
|
||
data[offset+1] = v[1];
|
||
data[offset+2] = v[2];
|
||
|
||
data[offset + 4] = v[3];
|
||
data[offset + 5] = v[4];
|
||
data[offset + 6] = v[5];
|
||
|
||
data[offset + 8] = v[6];
|
||
data[offset + 9] = v[7];
|
||
data[offset + 10] = v[8];
|
||
`,mat4:`
|
||
for(var i = 0; i < 16; i++)
|
||
{
|
||
data[offset + i] = v[i];
|
||
}
|
||
`},z_={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function WP(i){const t=i.map(n=>({data:n,offset:0,dataLen:0,dirty:0}));let e=0,s=0,r=0;for(let n=0;n<t.length;n++){const a=t[n];if(e=z_[a.data.type],a.data.size>1&&(e=Math.max(e,16)*a.data.size),a.dataLen=e,s%e!==0&&s<16){const o=s%e%16;s+=o,r+=o}s+e>16?(r=Math.ceil(r/16)*16,a.offset=r,r+=e,s=e):(a.offset=r,s+=e,r+=e)}return r=Math.ceil(r/16)*16,{uboElements:t,size:r}}function zP(i,t){const e=[];for(const s in i)t[s]&&e.push(t[s]);return e.sort((s,r)=>s.index-r.index),e}function jP(i,t){if(!i.autoManage)return{size:0,syncFunc:$P};const e=zP(i.uniforms,t),{uboElements:s,size:r}=WP(e),n=[`
|
||
var v = null;
|
||
var v2 = null;
|
||
var cv = null;
|
||
var t = 0;
|
||
var gl = renderer.gl
|
||
var index = 0;
|
||
var data = buffer.data;
|
||
`];for(let a=0;a<s.length;a++){const o=s[a],h=i.uniforms[o.data.name],l=o.data.name;let c=!1;for(let u=0;u<Ra.length;u++){const d=Ra[u];if(d.codeUbo&&d.test(o.data,h)){n.push(`offset = ${o.offset/4};`,Ra[u].codeUbo(o.data.name,h)),c=!0;break}}if(!c)if(o.data.size>1){const u=P_(o.data.type),d=Math.max(z_[o.data.type]/16,1),f=u/d,m=(4-f%4)%4;n.push(`
|
||
cv = ud.${l}.value;
|
||
v = uv.${l};
|
||
offset = ${o.offset/4};
|
||
|
||
t = 0;
|
||
|
||
for(var i=0; i < ${o.data.size*d}; i++)
|
||
{
|
||
for(var j = 0; j < ${f}; j++)
|
||
{
|
||
data[offset++] = v[t++];
|
||
}
|
||
offset += ${m};
|
||
}
|
||
|
||
`)}else{const u=HP[o.data.type];n.push(`
|
||
cv = ud.${l}.value;
|
||
v = uv.${l};
|
||
offset = ${o.offset/4};
|
||
${u};
|
||
`)}}return n.push(`
|
||
renderer.buffer.update(buffer);
|
||
`),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join(`
|
||
`))}}let qP=0;const rh={textureCount:0,uboCount:0};class j_{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=qP++}systemCheck(){if(!_P())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const s=t.program,r=s.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==s&&(this.program=s,this.gl.useProgram(r.program)),e||(rh.textureCount=0,rh.uboCount=0,this.syncUniformGroup(t.uniformGroup,rh)),r}setUniforms(t){const e=this.shader.program,s=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(s.uniformData,t,this.renderer)}syncUniformGroup(t,e){const s=this.getGlProgram();(!t.static||t.dirtyId!==s.uniformDirtyGroups[t.id])&&(s.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,s,e))}syncUniforms(t,e,s){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,s)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=gP(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const s=this.getGlProgram();if(!t.static||t.dirtyId!==0||!s.uniformGroups[t.id]){t.dirtyId=0;const r=s.uniformGroups[t.id]||this.createSyncBufferGroup(t,s,e);t.buffer.update(),r(s.uniformData,t.uniforms,this.renderer,rh,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,s.uniformBufferBindings[e])}createSyncBufferGroup(t,e,s){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const n=this.gl.getUniformBlockIndex(e.program,s);e.uniformBufferBindings[s]=this.shader.uniformBindCount,r.uniformBlockBinding(e.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;const a=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[a];if(o||(o=this._uboCache[a]=jP(t,this.shader.program.uniformData)),t.autoManage){const h=new Float32Array(o.size/4);t.buffer.update(h)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,s){const r=t.uniforms,n=[`${s}-`];for(const a in r)n.push(a),e[a]&&n.push(e[a].type);return n.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,s=t.program,r=GP(e,s);return s.glPrograms[this.renderer.CONTEXT_UID]=r,r}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}j_.extension={type:gt.RendererSystem,name:"shader"};St.add(j_);class Kh{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.3 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}Kh.defaultOptions={hello:!1},Kh.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"startup"};St.add(Kh);function KP(i,t=[]){return t[It.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.ADD]=[i.ONE,i.ONE],t[It.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SCREEN]=[i.ONE,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.NONE]=[0,0],t[It.NORMAL_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.ADD_NPM]=[i.SRC_ALPHA,i.ONE,i.ONE,i.ONE],t[It.SCREEN_NPM]=[i.SRC_ALPHA,i.ONE_MINUS_SRC_COLOR,i.ONE,i.ONE_MINUS_SRC_ALPHA],t[It.SRC_IN]=[i.DST_ALPHA,i.ZERO],t[It.SRC_OUT]=[i.ONE_MINUS_DST_ALPHA,i.ZERO],t[It.SRC_ATOP]=[i.DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],t[It.DST_OVER]=[i.ONE_MINUS_DST_ALPHA,i.ONE],t[It.DST_IN]=[i.ZERO,i.SRC_ALPHA],t[It.DST_OUT]=[i.ZERO,i.ONE_MINUS_SRC_ALPHA],t[It.DST_ATOP]=[i.ONE_MINUS_DST_ALPHA,i.SRC_ALPHA],t[It.XOR]=[i.ONE_MINUS_DST_ALPHA,i.ONE_MINUS_SRC_ALPHA],t[It.SUBTRACT]=[i.ONE,i.ONE,i.ONE,i.ONE,i.FUNC_REVERSE_SUBTRACT,i.FUNC_ADD],t}const ZP=0,JP=1,QP=2,tM=3,eM=4,sM=5,q_=class Im{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=It.NONE,this._blendEq=!1,this.map=[],this.map[ZP]=this.setBlend,this.map[JP]=this.setOffset,this.map[QP]=this.setCullFace,this.map[tM]=this.setDepthTest,this.map[eM]=this.setFrontFace,this.map[sM]=this.setDepthMask,this.checks=[],this.defaultState=new jr,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=KP(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e=e>>1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this.updateCheck(Im.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(Im.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};q_.extension={type:gt.RendererSystem,name:"state"};let rM=q_;St.add(rM);class iM extends Al{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter(r=>t.systems[r]),s=[...e,...Object.keys(t.systems).filter(r=>!e.includes(r))];for(const r of s)this.addSystem(t.systems[r],r)}addRunners(...t){t.forEach(e=>{this.runners[e]=new gr(e)})}addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const r in this.runners)this.runners[r].add(s);return this}emitWithCustomOptions(t,e){const s=Object.keys(this._systemsHash);t.items.forEach(r=>{const n=s.find(a=>this._systemsHash[a]===r);r[t.name](e[n])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const To=class Th{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Th.defaultMaxIdle,this.checkCountMax=Th.defaultCheckCountMax,this.mode=Th.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==kp.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let s=!1;for(let r=0;r<e.length;r++){const n=e[r];n.resource&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,s=!0)}if(s){let r=0;for(let n=0;n<e.length;n++)e[n]!==null&&(e[r++]=e[n]);e.length=r}}unload(t){const e=this.renderer.texture,s=t._texture;s&&!s.framebuffer&&e.destroyTexture(s);for(let r=t.children.length-1;r>=0;r--)this.unload(t.children[r])}destroy(){this.renderer=null}};To.defaultMode=kp.AUTO,To.defaultMaxIdle=3600,To.defaultCheckCountMax=600,To.extension={type:gt.RendererSystem,name:"textureGC"};let Cn=To;St.add(Cn);class Tf{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=wt.UNSIGNED_BYTE,this.internalFormat=ft.RGBA,this.samplerType=0}}function nM(i){let t;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?t={[i.RGB]:Tt.FLOAT,[i.RGBA]:Tt.FLOAT,[i.ALPHA]:Tt.FLOAT,[i.LUMINANCE]:Tt.FLOAT,[i.LUMINANCE_ALPHA]:Tt.FLOAT,[i.R8]:Tt.FLOAT,[i.R8_SNORM]:Tt.FLOAT,[i.RG8]:Tt.FLOAT,[i.RG8_SNORM]:Tt.FLOAT,[i.RGB8]:Tt.FLOAT,[i.RGB8_SNORM]:Tt.FLOAT,[i.RGB565]:Tt.FLOAT,[i.RGBA4]:Tt.FLOAT,[i.RGB5_A1]:Tt.FLOAT,[i.RGBA8]:Tt.FLOAT,[i.RGBA8_SNORM]:Tt.FLOAT,[i.RGB10_A2]:Tt.FLOAT,[i.RGB10_A2UI]:Tt.FLOAT,[i.SRGB8]:Tt.FLOAT,[i.SRGB8_ALPHA8]:Tt.FLOAT,[i.R16F]:Tt.FLOAT,[i.RG16F]:Tt.FLOAT,[i.RGB16F]:Tt.FLOAT,[i.RGBA16F]:Tt.FLOAT,[i.R32F]:Tt.FLOAT,[i.RG32F]:Tt.FLOAT,[i.RGB32F]:Tt.FLOAT,[i.RGBA32F]:Tt.FLOAT,[i.R11F_G11F_B10F]:Tt.FLOAT,[i.RGB9_E5]:Tt.FLOAT,[i.R8I]:Tt.INT,[i.R8UI]:Tt.UINT,[i.R16I]:Tt.INT,[i.R16UI]:Tt.UINT,[i.R32I]:Tt.INT,[i.R32UI]:Tt.UINT,[i.RG8I]:Tt.INT,[i.RG8UI]:Tt.UINT,[i.RG16I]:Tt.INT,[i.RG16UI]:Tt.UINT,[i.RG32I]:Tt.INT,[i.RG32UI]:Tt.UINT,[i.RGB8I]:Tt.INT,[i.RGB8UI]:Tt.UINT,[i.RGB16I]:Tt.INT,[i.RGB16UI]:Tt.UINT,[i.RGB32I]:Tt.INT,[i.RGB32UI]:Tt.UINT,[i.RGBA8I]:Tt.INT,[i.RGBA8UI]:Tt.UINT,[i.RGBA16I]:Tt.INT,[i.RGBA16UI]:Tt.UINT,[i.RGBA32I]:Tt.INT,[i.RGBA32UI]:Tt.UINT,[i.DEPTH_COMPONENT16]:Tt.FLOAT,[i.DEPTH_COMPONENT24]:Tt.FLOAT,[i.DEPTH_COMPONENT32F]:Tt.FLOAT,[i.DEPTH_STENCIL]:Tt.FLOAT,[i.DEPTH24_STENCIL8]:Tt.FLOAT,[i.DEPTH32F_STENCIL8]:Tt.FLOAT}:t={[i.RGB]:Tt.FLOAT,[i.RGBA]:Tt.FLOAT,[i.ALPHA]:Tt.FLOAT,[i.LUMINANCE]:Tt.FLOAT,[i.LUMINANCE_ALPHA]:Tt.FLOAT,[i.DEPTH_STENCIL]:Tt.FLOAT},t}function aM(i){let t;return"WebGL2RenderingContext"in globalThis&&i instanceof globalThis.WebGL2RenderingContext?t={[wt.UNSIGNED_BYTE]:{[ft.RGBA]:i.RGBA8,[ft.RGB]:i.RGB8,[ft.RG]:i.RG8,[ft.RED]:i.R8,[ft.RGBA_INTEGER]:i.RGBA8UI,[ft.RGB_INTEGER]:i.RGB8UI,[ft.RG_INTEGER]:i.RG8UI,[ft.RED_INTEGER]:i.R8UI,[ft.ALPHA]:i.ALPHA,[ft.LUMINANCE]:i.LUMINANCE,[ft.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[wt.BYTE]:{[ft.RGBA]:i.RGBA8_SNORM,[ft.RGB]:i.RGB8_SNORM,[ft.RG]:i.RG8_SNORM,[ft.RED]:i.R8_SNORM,[ft.RGBA_INTEGER]:i.RGBA8I,[ft.RGB_INTEGER]:i.RGB8I,[ft.RG_INTEGER]:i.RG8I,[ft.RED_INTEGER]:i.R8I},[wt.UNSIGNED_SHORT]:{[ft.RGBA_INTEGER]:i.RGBA16UI,[ft.RGB_INTEGER]:i.RGB16UI,[ft.RG_INTEGER]:i.RG16UI,[ft.RED_INTEGER]:i.R16UI,[ft.DEPTH_COMPONENT]:i.DEPTH_COMPONENT16},[wt.SHORT]:{[ft.RGBA_INTEGER]:i.RGBA16I,[ft.RGB_INTEGER]:i.RGB16I,[ft.RG_INTEGER]:i.RG16I,[ft.RED_INTEGER]:i.R16I},[wt.UNSIGNED_INT]:{[ft.RGBA_INTEGER]:i.RGBA32UI,[ft.RGB_INTEGER]:i.RGB32UI,[ft.RG_INTEGER]:i.RG32UI,[ft.RED_INTEGER]:i.R32UI,[ft.DEPTH_COMPONENT]:i.DEPTH_COMPONENT24},[wt.INT]:{[ft.RGBA_INTEGER]:i.RGBA32I,[ft.RGB_INTEGER]:i.RGB32I,[ft.RG_INTEGER]:i.RG32I,[ft.RED_INTEGER]:i.R32I},[wt.FLOAT]:{[ft.RGBA]:i.RGBA32F,[ft.RGB]:i.RGB32F,[ft.RG]:i.RG32F,[ft.RED]:i.R32F,[ft.DEPTH_COMPONENT]:i.DEPTH_COMPONENT32F},[wt.HALF_FLOAT]:{[ft.RGBA]:i.RGBA16F,[ft.RGB]:i.RGB16F,[ft.RG]:i.RG16F,[ft.RED]:i.R16F},[wt.UNSIGNED_SHORT_5_6_5]:{[ft.RGB]:i.RGB565},[wt.UNSIGNED_SHORT_4_4_4_4]:{[ft.RGBA]:i.RGBA4},[wt.UNSIGNED_SHORT_5_5_5_1]:{[ft.RGBA]:i.RGB5_A1},[wt.UNSIGNED_INT_2_10_10_10_REV]:{[ft.RGBA]:i.RGB10_A2,[ft.RGBA_INTEGER]:i.RGB10_A2UI},[wt.UNSIGNED_INT_10F_11F_11F_REV]:{[ft.RGB]:i.R11F_G11F_B10F},[wt.UNSIGNED_INT_5_9_9_9_REV]:{[ft.RGB]:i.RGB9_E5},[wt.UNSIGNED_INT_24_8]:{[ft.DEPTH_STENCIL]:i.DEPTH24_STENCIL8},[wt.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[ft.DEPTH_STENCIL]:i.DEPTH32F_STENCIL8}}:t={[wt.UNSIGNED_BYTE]:{[ft.RGBA]:i.RGBA,[ft.RGB]:i.RGB,[ft.ALPHA]:i.ALPHA,[ft.LUMINANCE]:i.LUMINANCE,[ft.LUMINANCE_ALPHA]:i.LUMINANCE_ALPHA},[wt.UNSIGNED_SHORT_5_6_5]:{[ft.RGB]:i.RGB},[wt.UNSIGNED_SHORT_4_4_4_4]:{[ft.RGBA]:i.RGBA},[wt.UNSIGNED_SHORT_5_5_5_1]:{[ft.RGBA]:i.RGBA}},t}class K_{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Lt,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=aM(t),this.samplerTypes=nM(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};const s=new Tf(t.createTexture());t.bindTexture(t.TEXTURE_2D,s.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=s,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Tf(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let r=0;r<this.boundTextures.length;r++)this.bind(null,r)}bind(t,e=0){const{gl:s}=this;if(t=t==null?void 0:t.castToBaseTexture(),(t==null?void 0:t.valid)&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const r=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,s.activeTexture(s.TEXTURE0+e)),s.bindTexture(t.target,r.texture)),r.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,s.activeTexture(s.TEXTURE0+e)),this.updateTexture(t)):r.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,s.activeTexture(s.TEXTURE0+e)),s.bindTexture(s.TEXTURE_2D,this.emptyTextures[s.TEXTURE_2D].texture),this.boundTextures[e]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:e,boundTextures:s}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let r=0;r<s.length;r++)s[r]===this.unknownTexture&&this.bind(null,r)}for(let r=0;r<s.length;r++)s[r]===t&&(this.currentLocation!==r&&(e.activeTexture(e.TEXTURE0+r),this.currentLocation=r),e.bindTexture(t.target,this.emptyTextures[t.target].texture),s[r]=null)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:s,CONTEXT_UID:r}=this;if(s)for(let n=t-1;n>=0;--n){const a=e[n];a&&a._glTextures[r].samplerType!==Tt.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const e=new Tf(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){var s;e.internalFormat=((s=this.internalFormats[t.type])==null?void 0:s[t.format])??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??Tt.FLOAT,this.webGLVersion===2&&t.type===wt.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){var r;const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const s=this.renderer;if(this.initTextureType(t,e),(r=t.resource)==null?void 0:r.upload(s,t,e))e.samplerType!==Tt.FLOAT&&(this.hasIntegerTextures=!0);else{const n=t.realWidth,a=t.realHeight,o=s.gl;(e.width!==n||e.height!==a||e.dirtyId<0)&&(e.width=n,e.height=a,o.texImage2D(t.target,0,e.internalFormat,n,a,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:s}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),s.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const r=this.managedTextures.indexOf(t);r!==-1&&Ma(this.managedTextures,r,1)}}updateTextureStyle(t){var s;const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===Ms.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ps.CLAMP:e.wrapMode=t.wrapMode,(s=t.resource)!=null&&s.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const s=this.gl;if(e.mipmap&&t.mipmap!==Ms.ON_MANUAL&&s.generateMipmap(t.target),s.texParameteri(t.target,s.TEXTURE_WRAP_S,e.wrapMode),s.texParameteri(t.target,s.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===Ns.LINEAR?s.LINEAR_MIPMAP_LINEAR:s.NEAREST_MIPMAP_NEAREST);const r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===Ns.LINEAR){const n=Math.min(t.anisotropicLevel,s.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));s.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else s.texParameteri(t.target,s.TEXTURE_MIN_FILTER,t.scaleMode===Ns.LINEAR?s.LINEAR:s.NEAREST);s.texParameteri(t.target,s.TEXTURE_MAG_FILTER,t.scaleMode===Ns.LINEAR?s.LINEAR:s.NEAREST)}destroy(){this.renderer=null}}K_.extension={type:gt.RendererSystem,name:"texture"};St.add(K_);class Z_{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:s}=this,r=t._glTransformFeedbacks[s]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,r)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:s,renderer:r}=this;e&&r.shader.bind(e),s.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:s,CONTEXT_UID:r}=this,n=e.createTransformFeedback();t._glTransformFeedbacks[r]=n,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,n);for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];o&&(s.buffer.update(o),o._glBuffers[r].refCount++,e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,a,o._glBuffers[r].buffer||null))}return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),n}disposeTransformFeedback(t,e){const s=t._glTransformFeedbacks[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this);const n=this.renderer.buffer;if(n)for(let a=0;a<t.buffers.length;a++){const o=t.buffers[a];if(!o)continue;const h=o._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!e&&n.dispose(o,e))}s&&(e||r.deleteTransformFeedback(s),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Z_.extension={type:gt.RendererSystem,name:"transformFeedback"};St.add(Z_);class Zh{constructor(t){this.renderer=t}init(t){this.screen=new Ut(0,0,t.width,t.height),this.element=t.view||_t.ADAPTER.createCanvas(),this.resolution=t.resolution||_t.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,e){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(e*this.resolution);const s=this.element.width/this.resolution,r=this.element.height/this.resolution;this.screen.width=s,this.screen.height=r,this.autoDensity&&(this.element.style.width=`${s}px`,this.element.style.height=`${r}px`),this.renderer.emit("resize",s,r),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){var e;t&&((e=this.element.parentNode)==null||e.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}Zh.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},Zh.extension={type:[gt.RendererSystem,gt.CanvasRendererSystem],name:"_view"};St.add(Zh);_t.PREFER_ENV=Kn.WEBGL2;_t.STRICT_TEXTURE_CACHE=!1;_t.RENDER_OPTIONS={...qh.defaultOptions,...jh.defaultOptions,...Zh.defaultOptions,...Kh.defaultOptions};Object.defineProperties(_t,{WRAP_MODE:{get(){return Lt.defaultOptions.wrapMode},set(i){Ht("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),Lt.defaultOptions.wrapMode=i}},SCALE_MODE:{get(){return Lt.defaultOptions.scaleMode},set(i){Ht("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),Lt.defaultOptions.scaleMode=i}},MIPMAP_TEXTURES:{get(){return Lt.defaultOptions.mipmap},set(i){Ht("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),Lt.defaultOptions.mipmap=i}},ANISOTROPIC_LEVEL:{get(){return Lt.defaultOptions.anisotropicLevel},set(i){Ht("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),Lt.defaultOptions.anisotropicLevel=i}},FILTER_RESOLUTION:{get(){return Ht("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),_s.defaultResolution},set(i){_s.defaultResolution=i}},FILTER_MULTISAMPLE:{get(){return Ht("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),_s.defaultMultisample},set(i){_s.defaultMultisample=i}},SPRITE_MAX_TEXTURES:{get(){return li.defaultMaxTextures},set(i){Ht("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),li.defaultMaxTextures=i}},SPRITE_BATCH_SIZE:{get(){return li.defaultBatchSize},set(i){Ht("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),li.defaultBatchSize=i}},CAN_UPLOAD_SAME_BUFFER:{get(){return li.canUploadSameBuffer},set(i){Ht("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),li.canUploadSameBuffer=i}},GC_MODE:{get(){return Cn.defaultMode},set(i){Ht("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),Cn.defaultMode=i}},GC_MAX_IDLE:{get(){return Cn.defaultMaxIdle},set(i){Ht("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),Cn.defaultMaxIdle=i}},GC_MAX_CHECK_COUNT:{get(){return Cn.defaultCheckCountMax},set(i){Ht("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),Cn.defaultCheckCountMax=i}},PRECISION_VERTEX:{get(){return ur.defaultVertexPrecision},set(i){Ht("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),ur.defaultVertexPrecision=i}},PRECISION_FRAGMENT:{get(){return ur.defaultFragmentPrecision},set(i){Ht("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),ur.defaultFragmentPrecision=i}}});var Wn=(i=>(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(Wn||{});class Sf{constructor(t,e=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=s,this.once=r}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const J_=class ks{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Sf(null,null,1/0),this.deltaMS=1/ks.targetFPMS,this.elapsedMS=1/ks.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=Wn.NORMAL){return this._addListener(new Sf(t,e,s))}addOnce(t,e,s=Wn.NORMAL){return this._addListener(new Sf(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*ks.targetFPMS;const s=this._head;let r=s.next;for(;r;)r=r.emit(this.deltaTime);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),s=Math.min(Math.max(0,e)/1e3,ks.targetFPMS);this._maxElapsedMS=1/s}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!ks._shared){const t=ks._shared=new ks;t.autoStart=!0,t._protected=!0}return ks._shared}static get system(){if(!ks._system){const t=ks._system=new ks;t.autoStart=!0,t._protected=!0}return ks._system}};J_.targetFPMS=.06;let ss=J_;Object.defineProperties(_t,{TARGET_FPMS:{get(){return ss.targetFPMS},set(i){Ht("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),ss.targetFPMS=i}}});class Q_{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Wn.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ss.shared:new ss,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Q_.extension=gt.Application;St.add(Q_);const t1=[];St.handleByList(gt.Renderer,t1);function oM(i){for(const t of t1)if(t.test(i))return new t(i);throw new Error("Unable to auto-detect a suitable renderer.")}var lM=`attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
vTextureCoord = aTextureCoord;
|
||
}`,hM=`attribute vec2 aVertexPosition;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
uniform vec4 inputSize;
|
||
uniform vec4 outputFrame;
|
||
|
||
vec4 filterVertexPosition( void )
|
||
{
|
||
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
|
||
|
||
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
||
}
|
||
|
||
vec2 filterTextureCoord( void )
|
||
{
|
||
return aVertexPosition * (outputFrame.zw * inputSize.zw);
|
||
}
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = filterVertexPosition();
|
||
vTextureCoord = filterTextureCoord();
|
||
}
|
||
`;const cM=lM,e1=hM;class s1{constructor(t){this.renderer=t}contextChange(t){let e;if(this.renderer.context.webGLVersion===1){const s=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,s)}else{const s=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,s)}e>=De.HIGH?this.multisample=De.HIGH:e>=De.MEDIUM?this.multisample=De.MEDIUM:e>=De.LOW?this.multisample=De.LOW:this.multisample=De.NONE}destroy(){}}s1.extension={type:gt.RendererSystem,name:"_multisample"};St.add(s1);class uM{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class r1{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);e.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:s,CONTEXT_UID:r}=this;if(this.boundBufferBases[e]!==t){const n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[e]=t,s.bindBufferBase(s.UNIFORM_BUFFER,e,n.buffer)}}bindBufferRange(t,e,s){const{gl:r,CONTEXT_UID:n}=this;s=s||0;const a=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,e||0,a.buffer,s*256,256)}update(t){const{gl:e,CONTEXT_UID:s}=this,r=t._glBuffers[s]||this.createGLBuffer(t);if(t._updateID!==r.updateID)if(r.updateID=t._updateID,e.bindBuffer(t.type,r.buffer),r.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;r.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const s=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),s&&(e||r.deleteBuffer(s.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let s=0;s<e.length;s++)this.dispose(this.managedBuffers[e[s]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:s}=this;return t._glBuffers[e]=new uM(s.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}r1.extension={type:gt.RendererSystem,name:"buffer"};St.add(r1);class i1{constructor(t){this.renderer=t}render(t,e){const s=this.renderer;let r,n,a,o;if(e&&(r=e.renderTexture,n=e.clear,a=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!r,s.runners.prerender.emit(),s.emit("prerender"),s.projection.transform=a,!s.context.isLost){if(r||(this.lastObjectRendered=t),!o){const h=t.enableTempParent();t.updateTransform(),t.disableTempParent(h)}s.renderTexture.bind(r),s.batch.currentRenderer.start(),(n??s.background.clearBeforeRender)&&s.renderTexture.clear(),t.render(s),s.batch.currentRenderer.flush(),r&&(e.blit&&s.framebuffer.blit(),r.baseTexture.update()),s.runners.postrender.emit(),s.projection.transform=null,s.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}i1.extension={type:gt.RendererSystem,name:"objectRenderer"};St.add(i1);const Sh=class Pm extends iM{constructor(t){super(),this.type=n_.WEBGL,t=Object.assign({},_t.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new yr({projectionMatrix:new fe},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Pm.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(e),"useContextAlpha"in t&&(Ht("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),t.premultipliedAlpha=t.useContextAlpha&&t.useContextAlpha!=="notMultiplied",t.backgroundAlpha=t.useContextAlpha===!1?1:t.backgroundAlpha),this._plugin.rendererPlugins=Pm.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:BI()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Ht("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return Ht("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return Ht("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return Ht("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){Ht("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return Ht("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){Ht("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return Ht("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};Sh.extension={type:gt.Renderer,priority:1},Sh.__plugins={},Sh.__systems={};let Xp=Sh;St.handleByMap(gt.RendererPlugin,Xp.__plugins);St.handleByMap(gt.RendererSystem,Xp.__systems);St.add(Xp);class n1 extends el{constructor(t,e){const{width:s,height:r}=e||{};super(s,r),this.items=[],this.itemDirtyIds=[];for(let n=0;n<t;n++){const a=new Lt;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let s=0;s<this.length;s++)t[s]&&(t[s].castToBaseTexture?this.addBaseTextureAt(t[s].castToBaseTexture(),s):t[s]instanceof el?this.addResourceAt(t[s],s):this.addResourceAt(S_(t[s],e),s))}dispose(){for(let t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,e){if(!this.items[e])throw new Error(`Index ${e} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this}bind(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=t,this.items[e].on("update",t.update,t)}unbind(t){super.unbind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=null,this.items[e].off("update",t.update,t)}load(){if(this._load)return this._load;const t=this.items.map(e=>e.resource).filter(e=>e).map(e=>e.load());return this._load=Promise.all(t).then(()=>{const{realWidth:e,realHeight:s}=this.items[0];return this.resize(e,s),this.update(),Promise.resolve(this)}),this._load}}class dM extends n1{constructor(t,e){const{width:s,height:r}=e||{};let n,a;Array.isArray(t)?(n=t,a=t.length):a=t,super(a,{width:s,height:r}),n&&this.initFromArray(n,e)}addBaseTextureAt(t,e){if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Pa.TEXTURE_2D_ARRAY}upload(t,e,s){const{length:r,itemDirtyIds:n,items:a}=this,{gl:o}=t;s.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,s.internalFormat,this._width,this._height,r,0,e.format,s.type,null);for(let h=0;h<r;h++){const l=a[h];n[h]<l.dirtyId&&(n[h]=l.dirtyId,l.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,h,l.resource.width,l.resource.height,1,e.format,s.type,l.resource.source))}return!0}}class fM extends Ii{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return e&&t instanceof e?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const a1=class So extends n1{constructor(t,e){const{width:s,height:r,autoLoad:n,linkBaseTexture:a}=e||{};if(t&&t.length!==So.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:s,height:r});for(let o=0;o<So.SIDES;o++)this.items[o].target=Pa.TEXTURE_CUBE_MAP_POSITIVE_X+o;this.linkBaseTexture=a!==!1,t&&this.initFromArray(t,e),n!==!1&&this.load()}bind(t){super.bind(t),t.target=Pa.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,s){if(s===void 0&&(s=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=Pa.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,s){const r=this.itemDirtyIds;for(let n=0;n<So.SIDES;n++){const a=this.items[n];(r[n]<a.dirtyId||s.dirtyId<e.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(t,a,s),r[n]=a.dirtyId):r[n]<-1&&(t.gl.texImage2D(a.target,0,s.internalFormat,e.realWidth,e.realHeight,0,e.format,s.type,null),r[n]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===So.SIDES}};a1.SIDES=6;let mM=a1;class xa extends Ii{constructor(t,e){e=e||{};let s,r,n;typeof t=="string"?(s=xa.EMPTY,r=t,n=!0):(s=t,r=null,n=!1),super(s),this.url=r,this.crossOrigin=e.crossOrigin??!0,this.alphaMode=typeof e.alphaMode=="number"?e.alphaMode:null,this.ownsImageBitmap=e.ownsImageBitmap??n,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(t,e)=>{if(this.url===null){t(this);return}try{const s=await _t.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await s.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ke.UNPACK?"premultiply":"none"});if(this.destroyed){n.close();return}this.source=n,this.update(),t(this)}catch(s){if(this.destroyed)return;e(s),this.onError.emit(s)}}),this._load)}upload(t,e,s){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,s)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return xa._EMPTY=xa._EMPTY??_t.ADAPTER.createCanvas(0,0),xa._EMPTY}}const Mm=class Eh extends Ii{constructor(t,e){e=e||{},super(_t.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.update(),t(this)},Eh.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;Ii.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,s=t.height;if(!e||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let r=e*this.scale,n=s*this.scale;(this._overrideWidth||this._overrideHeight)&&(r=this._overrideWidth||this._overrideHeight/s*e,n=this._overrideHeight||this._overrideWidth/e*s),r=Math.round(r),n=Math.round(n);const a=this.source;a.width=r,a.height=n,a._pixiId=`canvas_${Hn()}`,a.getContext("2d").drawImage(t,0,0,e,s,0,0,r,n),this._resolve(),this._resolve=null}}static getSize(t){const e=Eh.SVG_SIZE.exec(t),s={};return e&&(s[e[1]]=Math.round(parseFloat(e[3])),s[e[5]]=Math.round(parseFloat(e[7]))),s}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Eh.SVG_XML.test(t)}};Mm.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Mm.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Rm=Mm;class pM extends Ii{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}}const Fm=class km extends Ii{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const s=document.createElement("video");e.autoLoad!==!1&&s.setAttribute("preload","auto"),e.playsinline!==!1&&(s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline","")),e.muted===!0&&(s.setAttribute("muted",""),s.muted=!0),e.loop===!0&&s.setAttribute("loop",""),e.autoPlay!==!1&&s.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const r=t[0].src||t[0];Ii.crossOrigin(s,r,e.crossorigin);for(let n=0;n<t.length;++n){const a=document.createElement("source");let{src:o,mime:h}=t[n];if(o=o||t[n],o.startsWith("data:"))h=o.slice(5,o.indexOf(";"));else if(!o.startsWith("blob:")){const l=o.split("?").shift().toLowerCase(),c=l.slice(l.lastIndexOf(".")+1);h=h||km.MIME_TYPES[c]||`video/${c}`}a.src=o,h&&(a.type=h),s.appendChild(a)}t=s}super(t),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}update(t=0){if(!this.destroyed){if(this._updateFPS){const e=ss.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise((e,s)=>{this.valid?e(this):(this._resolve=e,this._reject=s,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(ss.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ss.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ss.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||km.TYPES.includes(e)}};Fm.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Fm.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let o1=Fm;bm.push(xa,k_,fM,o1,pM,Rm,Gc,mM,dM);class Ya{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?Ut.EMPTY:(t=t||new Ut(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:s,b:r,c:n,d:a,tx:o,ty:h}=t,l=s*e.x+n*e.y+o,c=r*e.x+a*e.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let e=this.minX,s=this.minY,r=this.maxX,n=this.maxY,a=t[0],o=t[1];e=a<e?a:e,s=o<s?o:s,r=a>r?a:r,n=o>n?o:n,a=t[2],o=t[3],e=a<e?a:e,s=o<s?o:s,r=a>r?a:r,n=o>n?o:n,a=t[4],o=t[5],e=a<e?a:e,s=o<s?o:s,r=a>r?a:r,n=o>n?o:n,a=t[6],o=t[7],e=a<e?a:e,s=o<s?o:s,r=a>r?a:r,n=o>n?o:n,this.minX=e,this.minY=s,this.maxX=r,this.maxY=n}addFrame(t,e,s,r,n){this.addFrameMatrix(t.worldTransform,e,s,r,n)}addFrameMatrix(t,e,s,r,n){const a=t.a,o=t.b,h=t.c,l=t.d,c=t.tx,u=t.ty;let d=this.minX,f=this.minY,m=this.maxX,p=this.maxY,g=a*e+h*s+c,y=o*e+l*s+u;d=g<d?g:d,f=y<f?y:f,m=g>m?g:m,p=y>p?y:p,g=a*r+h*s+c,y=o*r+l*s+u,d=g<d?g:d,f=y<f?y:f,m=g>m?g:m,p=y>p?y:p,g=a*e+h*n+c,y=o*e+l*n+u,d=g<d?g:d,f=y<f?y:f,m=g>m?g:m,p=y>p?y:p,g=a*r+h*n+c,y=o*r+l*n+u,d=g<d?g:d,f=y<f?y:f,m=g>m?g:m,p=y>p?y:p,this.minX=d,this.minY=f,this.maxX=m,this.maxY=p}addVertexData(t,e,s){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;for(let h=e;h<s;h+=2){const l=t[h],c=t[h+1];r=l<r?l:r,n=c<n?c:n,a=l>a?l:a,o=c>o?c:o}this.minX=r,this.minY=n,this.maxX=a,this.maxY=o}addVertices(t,e,s,r){this.addVerticesMatrix(t.worldTransform,e,s,r)}addVerticesMatrix(t,e,s,r,n=0,a=n){const o=t.a,h=t.b,l=t.c,c=t.d,u=t.tx,d=t.ty;let f=this.minX,m=this.minY,p=this.maxX,g=this.maxY;for(let y=s;y<r;y+=2){const _=e[y],v=e[y+1],b=o*_+l*v+u,T=c*v+h*_+d;f=Math.min(f,b-n),p=Math.max(p,b+n),m=Math.min(m,T-a),g=Math.max(g,T+a)}this.minX=f,this.minY=m,this.maxX=p,this.maxY=g}addBounds(t){const e=this.minX,s=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<s?t.minY:s,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n}addBoundsMask(t,e){const s=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,a=t.maxY<e.maxY?t.maxY:e.maxY;if(s<=n&&r<=a){const o=this.minX,h=this.minY,l=this.maxX,c=this.maxY;this.minX=s<o?s:o,this.minY=r<h?r:h,this.maxX=n>l?n:l,this.maxY=a>c?a:c}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const s=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,a=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(s<=n&&r<=a){const o=this.minX,h=this.minY,l=this.maxX,c=this.maxY;this.minX=s<o?s:o,this.minY=r<h?r:h,this.maxX=n>l?n:l,this.maxY=a>c?a:c}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,s,r,n,a){t-=n,e-=a,s+=n,r+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>s?this.maxX:s,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r}}class Ie extends Al{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Dp,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ya,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let s=0;s<e.length;++s){const r=e[s];Object.defineProperty(Ie.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new Ut),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new Ut),t=this._localBoundsRect),this._localBounds||(this._localBounds=new Ya);const e=this.transform,s=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(s==null?void 0:s.worldAlpha)??1,this.transform=this._tempDisplayObjectParent.transform;const r=this._bounds,n=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=s,this.transform=e,this._bounds=r,this._bounds.updateID+=this._boundsID-n,a}toGlobal(t,e,s=!1){return s||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(t,e,s,r){return e&&(t=e.toGlobal(t,s,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,s)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)}setTransform(t=0,e=0,s=1,r=1,n=0,a=0,o=0,h=0,l=0){return this.position.x=t,this.position.y=e,this.scale.x=s||1,this.scale.y=r||1,this.rotation=n,this.skew.x=a,this.skew.y=o,this.pivot.x=h,this.pivot.y=l,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new gM),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*hP}set angle(t){this.transform.rotation=t*cP}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const e=this._mask.isMaskData?this._mask.maskObject:this._mask;e&&(e._maskRefCount--,e._maskRefCount===0&&(e.renderable=!0,e.isMask=!1))}if(this._mask=t,this._mask){const e=this._mask.isMaskData?this._mask.maskObject:this._mask;e&&(e._maskRefCount===0&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++)}}}}class gM extends Ie{constructor(){super(...arguments),this.sortDirty=null}}Ie.prototype.displayObjectUpdateTransform=Ie.prototype.updateTransform;const yM=new fe;function xM(i,t){return i.zIndex===t.zIndex?i._lastSortedIndex-t._lastSortedIndex:i.zIndex-t.zIndex}const l1=class Lm extends Ie{constructor(){super(),this.children=[],this.sortableChildren=Lm.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const s=this.getChildIndex(t),r=this.getChildIndex(e);this.children[s]=e,this.children[r]=t,this.onChildrenChange(s<r?s:r)}getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const s=this.getChildIndex(t);Ma(this.children,s,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],s=this.children.indexOf(e);if(s===-1)return null;e.parent=null,e.transform._parentID=-1,Ma(this.children,s,1),this._boundsID++,this.onChildrenChange(s),e.emit("removed",this),this.emit("childRemoved",e,this,s)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,Ma(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const s=t,r=e,n=r-s;let a;if(n>0&&n<=r){a=this.children.splice(s,n);for(let o=0;o<a.length;++o)a[o].parent=null,a[o].transform&&(a[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let o=0;o<a.length;++o)a[o].emit("removed",this),this.emit("childRemoved",a[o],this,o);return a}else if(n===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,s=this.children.length;e<s;++e){const r=this.children[e];r._lastSortedIndex=e,!t&&r.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(xM),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const s=this.children[t];s.visible&&s.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(!(!e.visible||!e.renderable))if(e.calculateBounds(),e._mask){const s=e._mask.isMaskData?e._mask.maskObject:e._mask;s?(s.calculateBounds(),this._bounds.addBoundsMask(e._bounds,s._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const s=super.getLocalBounds(t);if(!e)for(let r=0,n=this.children.length;r<n;++r){const a=this.children[r];a.visible&&a.updateTransform()}return s}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let s,r;this.cullArea?(s=this.cullArea,r=this.worldTransform):this._render!==Lm.prototype._render&&(s=this.getBounds(!0));const n=t.projection.transform;if(n&&(r?(r=yM.copyFrom(r),r.prepend(n)):r=n),s&&e.intersects(s,r))this._render(t);else if(this.cullArea)return;for(let a=0,o=this.children.length;a<o;++a){const h=this.children[a],l=h.cullable;h.cullable=l||!this.cullArea,h.render(t),h.cullable=l}}render(t){var e;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(e=this.filters)!=null&&e.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let s=0,r=this.children.length;s<r;++s)this.children[s].render(t)}}renderAdvanced(t){var n,a,o;const e=this.filters,s=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let h=0;h<e.length;h++)e[h].enabled&&this._enabledFilters.push(e[h])}const r=e&&((n=this._enabledFilters)==null?void 0:n.length)||s&&(!s.isMaskData||s.enabled&&(s.autoDetect||s.type!==Ye.NONE));if(r&&t.batch.flush(),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.push(this,this._enabledFilters),s&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let h=0,l=this.children.length;h<l;++h)this.children[h].render(t)}r&&t.batch.flush(),s&&t.mask.pop(this),e&&((o=this._enabledFilters)!=null&&o.length)&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e=typeof t=="boolean"?t:t==null?void 0:t.children,s=this.removeChildren(0,this.children.length);if(e)for(let r=0;r<s.length;++r)s[r].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;e!==0?this.scale.x=t/e:this.scale.x=1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;e!==0?this.scale.y=t/e:this.scale.y=1,this._height=t}};l1.defaultSortableChildren=!1;let fs=l1;fs.prototype.containerUpdateTransform=fs.prototype.updateTransform;Object.defineProperties(_t,{SORTABLE_CHILDREN:{get(){return fs.defaultSortableChildren},set(i){Ht("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),fs.defaultSortableChildren=i}}});const go=new Kt,bM=new Uint16Array([0,1,2,0,2,3]);class to extends fs{constructor(t){super(),this._anchor=new gi(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Wt(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=It.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||Nt.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=bM,this.pluginName="batch",this.isSprite=!0,this._roundPixels=_t.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Zi(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Zi(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,s=e.a,r=e.b,n=e.c,a=e.d,o=e.tx,h=e.ty,l=this.vertexData,c=t.trim,u=t.orig,d=this._anchor;let f=0,m=0,p=0,g=0;if(c?(m=c.x-d._x*u.width,f=m+c.width,g=c.y-d._y*u.height,p=g+c.height):(m=-d._x*u.width,f=m+u.width,g=-d._y*u.height,p=g+u.height),l[0]=s*m+n*g+o,l[1]=a*g+r*m+h,l[2]=s*f+n*g+o,l[3]=a*g+r*f+h,l[4]=s*f+n*p+o,l[5]=a*p+r*f+h,l[6]=s*m+n*p+o,l[7]=a*p+r*m+h,this._roundPixels){const y=_t.RESOLUTION;for(let _=0;_<l.length;++_)l[_]=Math.round(l[_]*y)/y}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const t=this._texture,e=this.vertexTrimmedData,s=t.orig,r=this._anchor,n=this.transform.worldTransform,a=n.a,o=n.b,h=n.c,l=n.d,c=n.tx,u=n.ty,d=-r._x*s.width,f=d+s.width,m=-r._y*s.height,p=m+s.height;if(e[0]=a*d+h*m+c,e[1]=l*m+o*d+u,e[2]=a*f+h*m+c,e[3]=l*m+o*f+u,e[4]=a*f+h*p+c,e[5]=l*p+o*f+u,e[6]=a*d+h*p+c,e[7]=l*p+o*d+u,this._roundPixels){const g=_t.RESOLUTION;for(let y=0;y<e.length;++y)e[y]=Math.round(e[y]*g)/g}}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(t){return this.children.length===0?(this._localBounds||(this._localBounds=new Ya),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Ut),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,go);const e=this._texture.orig.width,s=this._texture.orig.height,r=-e*this.anchor.x;let n=0;return go.x>=r&&go.x<r+e&&(n=-s*this.anchor.y,go.y>=n&&go.y<n+s)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof t=="boolean"?t:t==null?void 0:t.texture){const e=typeof t=="boolean"?t:t==null?void 0:t.baseTexture;this._texture.destroy(!!e)}this._texture=null}static from(t,e){const s=t instanceof Nt?t:Nt.from(t,e);return new to(s)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const e=Zi(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const e=Zi(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||Nt.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const h1=new fe;Ie.prototype._cacheAsBitmap=!1;Ie.prototype._cacheData=null;Ie.prototype._cacheAsBitmapResolution=null;Ie.prototype._cacheAsBitmapMultisample=null;class vM{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(Ie.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(i){i!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=i,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(i){i!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=i,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(i){if(this._cacheAsBitmap===i)return;this._cacheAsBitmap=i;let t;i?(this._cacheData||(this._cacheData=new vM),t=this._cacheData,t.originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(t=this._cacheData,t.sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea)}}});Ie.prototype._renderCached=function(i){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(i),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(i))};Ie.prototype._initCachedDisplayObject=function(i){var d,f;if((d=this._cacheData)!=null&&d.sprite)return;const t=this.alpha;this.alpha=1,i.batch.flush();const e=this.getLocalBounds(new Ut,!0);if((f=this.filters)!=null&&f.length){const m=this.filters[0].padding;e.pad(m)}const s=this.cacheAsBitmapResolution||i.resolution;e.ceil(s),e.width=Math.max(e.width,1/s),e.height=Math.max(e.height,1/s);const r=i.renderTexture.current,n=i.renderTexture.sourceFrame.clone(),a=i.renderTexture.destinationFrame.clone(),o=i.projection.transform,h=Zn.create({width:e.width,height:e.height,resolution:s,multisample:this.cacheAsBitmapMultisample??i.multisample}),l=`cacheAsBitmap_${Hn()}`;this._cacheData.textureCacheId=l,Lt.addToCache(h.baseTexture,l),Nt.addToCache(h,l);const c=this.transform.localTransform.copyTo(h1).invert().translate(-e.x,-e.y);this.render=this._cacheData.originalRender,i.render(this,{renderTexture:h,clear:!0,transform:c,skipUpdateTransform:!1}),i.framebuffer.blit(),i.projection.transform=o,i.renderTexture.bind(r,n,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=t;const u=new to(h);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-(e.x/e.width),u.anchor.y=-(e.y/e.height),u.alpha=t,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=u.containsPoint.bind(u)};Ie.prototype._renderCachedCanvas=function(i){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(i),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(i))};Ie.prototype._initCachedDisplayObjectCanvas=function(i){var c;if((c=this._cacheData)!=null&&c.sprite)return;const t=this.getLocalBounds(new Ut,!0),e=this.alpha;this.alpha=1;const s=i.canvasContext.activeContext,r=i._projTransform,n=this.cacheAsBitmapResolution||i.resolution;t.ceil(n),t.width=Math.max(t.width,1/n),t.height=Math.max(t.height,1/n);const a=Zn.create({width:t.width,height:t.height,resolution:n}),o=`cacheAsBitmap_${Hn()}`;this._cacheData.textureCacheId=o,Lt.addToCache(a.baseTexture,o),Nt.addToCache(a,o);const h=h1;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,i.render(this,{renderTexture:a,clear:!0,transform:h,skipUpdateTransform:!1}),i.canvasContext.activeContext=s,i._projTransform=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const l=new to(a);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-(t.x/t.width),l.anchor.y=-(t.y/t.height),l.alpha=e,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=i._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)};Ie.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID};Ie.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)};Ie.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Lt.removeFromCache(this._cacheData.textureCacheId),Nt.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null};Ie.prototype._cacheAsBitmapDestroy=function(i){this.cacheAsBitmap=!1,this.destroy(i)};Ie.prototype.name=null;fs.prototype.getChildByName=function(i,t){for(let e=0,s=this.children.length;e<s;e++)if(this.children[e].name===i)return this.children[e];if(t)for(let e=0,s=this.children.length;e<s;e++){const r=this.children[e];if(!r.getChildByName)continue;const n=r.getChildByName(i,!0);if(n)return n}return null};Ie.prototype.getGlobalPosition=function(i=new Kt,t=!1){return this.parent?this.parent.toGlobal(this.position,i,t):(i.x=this.position.x,i.y=this.position.y),i};var _M=`varying vec2 vTextureCoord;
|
||
|
||
uniform sampler2D uSampler;
|
||
uniform float uAlpha;
|
||
|
||
void main(void)
|
||
{
|
||
gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
|
||
}
|
||
`;class wM extends _s{constructor(t=1){super(cM,_M,{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}const TM={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},SM=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
|
||
`);function EM(i){const t=TM[i],e=t.length;let s=SM,r="";const n="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;";let a;for(let o=0;o<i;o++){let h=n.replace("%index%",o.toString());a=o,o>=e&&(a=i-o-1),h=h.replace("%value%",t[a].toString()),r+=h,r+=`
|
||
`}return s=s.replace("%blur%",r),s=s.replace("%size%",i.toString()),s}const AM=`
|
||
attribute vec2 aVertexPosition;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
|
||
uniform float strength;
|
||
|
||
varying vec2 vBlurTexCoords[%size%];
|
||
|
||
uniform vec4 inputSize;
|
||
uniform vec4 outputFrame;
|
||
|
||
vec4 filterVertexPosition( void )
|
||
{
|
||
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
|
||
|
||
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
||
}
|
||
|
||
vec2 filterTextureCoord( void )
|
||
{
|
||
return aVertexPosition * (outputFrame.zw * inputSize.zw);
|
||
}
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = filterVertexPosition();
|
||
|
||
vec2 textureCoord = filterTextureCoord();
|
||
%blur%
|
||
}`;function CM(i,t){const e=Math.ceil(i/2);let s=AM,r="",n;t?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let a=0;a<i;a++){let o=n.replace("%index%",a.toString());o=o.replace("%sampleIndex%",`${a-(e-1)}.0`),r+=o,r+=`
|
||
`}return s=s.replace("%blur%",r),s=s.replace("%size%",i.toString()),s}class Bm extends _s{constructor(t,e=8,s=4,r=_s.defaultResolution,n=5){const a=CM(n,t),o=EM(n);super(a,o),this.horizontal=t,this.resolution=r,this._quality=0,this.quality=s,this.blur=e}apply(t,e,s,r){if(s?this.horizontal?this.uniforms.strength=1/s.width*(s.width/e.width):this.uniforms.strength=1/s.height*(s.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)t.applyFilter(this,e,s,r);else{const n=t.getFilterTexture(),a=t.renderer;let o=e,h=n;this.state.blend=!1,t.applyFilter(this,o,h,Nr.CLEAR);for(let l=1;l<this.passes-1;l++){t.bindAndClear(o,Nr.BLIT),this.uniforms.uSampler=h;const c=h;h=o,o=c,a.shader.bind(this),a.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,h,s,r),t.returnFilterTexture(n)}}get blur(){return this.strength}set blur(t){this.padding=1+Math.abs(t)*2,this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}}class IM extends _s{constructor(t=8,e=4,s=_s.defaultResolution,r=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new Bm(!0,t,e,s,r),this.blurYFilter=new Bm(!1,t,e,s,r),this.resolution=s,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,s,r){const n=Math.abs(this.blurXFilter.strength),a=Math.abs(this.blurYFilter.strength);if(n&&a){const o=t.getFilterTexture();this.blurXFilter.apply(t,e,o,Nr.CLEAR),this.blurYFilter.apply(t,o,s,r),t.returnFilterTexture(o)}else a?this.blurYFilter.apply(t,e,s,r):this.blurXFilter.apply(t,e,s,r)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2}get blur(){return this.blurXFilter.blur}set blur(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get blurX(){return this.blurXFilter.blur}set blurX(t){this.blurXFilter.blur=t,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(t){this.blurYFilter.blur=t,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(t){this.blurYFilter.blendMode=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}}var PM=`varying vec2 vTextureCoord;
|
||
uniform sampler2D uSampler;
|
||
uniform float m[20];
|
||
uniform float uAlpha;
|
||
|
||
void main(void)
|
||
{
|
||
vec4 c = texture2D(uSampler, vTextureCoord);
|
||
|
||
if (uAlpha == 0.0) {
|
||
gl_FragColor = c;
|
||
return;
|
||
}
|
||
|
||
// Un-premultiply alpha before applying the color matrix. See issue #3539.
|
||
if (c.a > 0.0) {
|
||
c.rgb /= c.a;
|
||
}
|
||
|
||
vec4 result;
|
||
|
||
result.r = (m[0] * c.r);
|
||
result.r += (m[1] * c.g);
|
||
result.r += (m[2] * c.b);
|
||
result.r += (m[3] * c.a);
|
||
result.r += m[4];
|
||
|
||
result.g = (m[5] * c.r);
|
||
result.g += (m[6] * c.g);
|
||
result.g += (m[7] * c.b);
|
||
result.g += (m[8] * c.a);
|
||
result.g += m[9];
|
||
|
||
result.b = (m[10] * c.r);
|
||
result.b += (m[11] * c.g);
|
||
result.b += (m[12] * c.b);
|
||
result.b += (m[13] * c.a);
|
||
result.b += m[14];
|
||
|
||
result.a = (m[15] * c.r);
|
||
result.a += (m[16] * c.g);
|
||
result.a += (m[17] * c.b);
|
||
result.a += (m[18] * c.a);
|
||
result.a += m[19];
|
||
|
||
vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
|
||
|
||
// Premultiply alpha again.
|
||
rgb *= result.a;
|
||
|
||
gl_FragColor = vec4(rgb, result.a);
|
||
}
|
||
`;class Om extends _s{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(e1,PM,t),this.alpha=1}_loadMatrix(t,e=!1){let s=t;e&&(this._multiply(s,this.uniforms.m,t),s=this._colorMatrix(s)),this.uniforms.m=s}_multiply(t,e,s){return t[0]=e[0]*s[0]+e[1]*s[5]+e[2]*s[10]+e[3]*s[15],t[1]=e[0]*s[1]+e[1]*s[6]+e[2]*s[11]+e[3]*s[16],t[2]=e[0]*s[2]+e[1]*s[7]+e[2]*s[12]+e[3]*s[17],t[3]=e[0]*s[3]+e[1]*s[8]+e[2]*s[13]+e[3]*s[18],t[4]=e[0]*s[4]+e[1]*s[9]+e[2]*s[14]+e[3]*s[19]+e[4],t[5]=e[5]*s[0]+e[6]*s[5]+e[7]*s[10]+e[8]*s[15],t[6]=e[5]*s[1]+e[6]*s[6]+e[7]*s[11]+e[8]*s[16],t[7]=e[5]*s[2]+e[6]*s[7]+e[7]*s[12]+e[8]*s[17],t[8]=e[5]*s[3]+e[6]*s[8]+e[7]*s[13]+e[8]*s[18],t[9]=e[5]*s[4]+e[6]*s[9]+e[7]*s[14]+e[8]*s[19]+e[9],t[10]=e[10]*s[0]+e[11]*s[5]+e[12]*s[10]+e[13]*s[15],t[11]=e[10]*s[1]+e[11]*s[6]+e[12]*s[11]+e[13]*s[16],t[12]=e[10]*s[2]+e[11]*s[7]+e[12]*s[12]+e[13]*s[17],t[13]=e[10]*s[3]+e[11]*s[8]+e[12]*s[13]+e[13]*s[18],t[14]=e[10]*s[4]+e[11]*s[9]+e[12]*s[14]+e[13]*s[19]+e[14],t[15]=e[15]*s[0]+e[16]*s[5]+e[17]*s[10]+e[18]*s[15],t[16]=e[15]*s[1]+e[16]*s[6]+e[17]*s[11]+e[18]*s[16],t[17]=e[15]*s[2]+e[16]*s[7]+e[17]*s[12]+e[18]*s[17],t[18]=e[15]*s[3]+e[16]*s[8]+e[17]*s[13]+e[18]*s[18],t[19]=e[15]*s[4]+e[16]*s[9]+e[17]*s[14]+e[18]*s[19]+e[19],t}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}tint(t,e){const[s,r,n]=Wt.shared.setValue(t).toArray(),a=[s,0,0,0,0,0,r,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(a,e)}greyscale(t,e){const s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(s,e)}blackAndWhite(t){const e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)}hue(t,e){t=(t||0)/180*Math.PI;const s=Math.cos(t),r=Math.sin(t),n=Math.sqrt,a=1/3,o=n(a),h=s+(1-s)*a,l=a*(1-s)-o*r,c=a*(1-s)+o*r,u=a*(1-s)+o*r,d=s+a*(1-s),f=a*(1-s)-o*r,m=a*(1-s)-o*r,p=a*(1-s)+o*r,g=s+a*(1-s),y=[h,l,c,0,0,u,d,f,0,0,m,p,g,0,0,0,0,0,1,0];this._loadMatrix(y,e)}contrast(t,e){const s=(t||0)+1,r=-.5*(s-1),n=[s,0,0,0,r,0,s,0,0,r,0,0,s,0,r,0,0,0,1,0];this._loadMatrix(n,e)}saturate(t=0,e){const s=t*2/3+1,r=(s-1)*-.5,n=[s,r,r,0,0,r,s,r,0,0,r,r,s,0,0,0,0,0,1,0];this._loadMatrix(n,e)}desaturate(){this.saturate(-1)}negative(t){const e=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(e,t)}sepia(t){const e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)}technicolor(t){const e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)}polaroid(t){const e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)}toBGR(t){const e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)}kodachrome(t){const e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)}browni(t){const e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)}vintage(t){const e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)}colorTone(t,e,s,r,n){t=t||.2,e=e||.15,s=s||16770432,r=r||3375104;const a=Wt.shared,[o,h,l]=a.setValue(s).toArray(),[c,u,d]=a.setValue(r).toArray(),f=[.3,.59,.11,0,0,o,h,l,t,0,c,u,d,e,0,o-c,h-u,l-d,0,0];this._loadMatrix(f,n)}night(t,e){t=t||.1;const s=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(s,e)}predator(t,e){const s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(s,e)}lsd(t){const e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}Om.prototype.grayscale=Om.prototype.greyscale;var MM=`varying vec2 vFilterCoord;
|
||
varying vec2 vTextureCoord;
|
||
|
||
uniform vec2 scale;
|
||
uniform mat2 rotation;
|
||
uniform sampler2D uSampler;
|
||
uniform sampler2D mapSampler;
|
||
|
||
uniform highp vec4 inputSize;
|
||
uniform vec4 inputClamp;
|
||
|
||
void main(void)
|
||
{
|
||
vec4 map = texture2D(mapSampler, vFilterCoord);
|
||
|
||
map -= 0.5;
|
||
map.xy = scale * inputSize.zw * (rotation * map.xy);
|
||
|
||
gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
|
||
}
|
||
`,RM=`attribute vec2 aVertexPosition;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 filterMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
varying vec2 vFilterCoord;
|
||
|
||
uniform vec4 inputSize;
|
||
uniform vec4 outputFrame;
|
||
|
||
vec4 filterVertexPosition( void )
|
||
{
|
||
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
|
||
|
||
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
||
}
|
||
|
||
vec2 filterTextureCoord( void )
|
||
{
|
||
return aVertexPosition * (outputFrame.zw * inputSize.zw);
|
||
}
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = filterVertexPosition();
|
||
vTextureCoord = filterTextureCoord();
|
||
vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
|
||
}
|
||
`;class FM extends _s{constructor(t,e){const s=new fe;t.renderable=!1,super(RM,MM,{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=s,e==null&&(e=20),this.scale=new Kt(e,e)}apply(t,e,s,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const n=this.maskSprite.worldTransform,a=Math.sqrt(n.a*n.a+n.b*n.b),o=Math.sqrt(n.c*n.c+n.d*n.d);a!==0&&o!==0&&(this.uniforms.rotation[0]=n.a/a,this.uniforms.rotation[1]=n.b/a,this.uniforms.rotation[2]=n.c/o,this.uniforms.rotation[3]=n.d/o),t.applyFilter(this,e,s,r)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}var kM=`varying vec2 v_rgbNW;
|
||
varying vec2 v_rgbNE;
|
||
varying vec2 v_rgbSW;
|
||
varying vec2 v_rgbSE;
|
||
varying vec2 v_rgbM;
|
||
|
||
varying vec2 vFragCoord;
|
||
uniform sampler2D uSampler;
|
||
uniform highp vec4 inputSize;
|
||
|
||
|
||
/**
|
||
Basic FXAA implementation based on the code on geeks3d.com with the
|
||
modification that the texture2DLod stuff was removed since it's
|
||
unsupported by WebGL.
|
||
|
||
--
|
||
|
||
From:
|
||
https://github.com/mitsuhiko/webgl-meincraft
|
||
|
||
Copyright (c) 2011 by Armin Ronacher.
|
||
|
||
Some rights reserved.
|
||
|
||
Redistribution and use in source and binary forms, with or without
|
||
modification, are permitted provided that the following conditions are
|
||
met:
|
||
|
||
* Redistributions of source code must retain the above copyright
|
||
notice, this list of conditions and the following disclaimer.
|
||
|
||
* Redistributions in binary form must reproduce the above
|
||
copyright notice, this list of conditions and the following
|
||
disclaimer in the documentation and/or other materials provided
|
||
with the distribution.
|
||
|
||
* The names of the contributors may not be used to endorse or
|
||
promote products derived from this software without specific
|
||
prior written permission.
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
|
||
#ifndef FXAA_REDUCE_MIN
|
||
#define FXAA_REDUCE_MIN (1.0/ 128.0)
|
||
#endif
|
||
#ifndef FXAA_REDUCE_MUL
|
||
#define FXAA_REDUCE_MUL (1.0 / 8.0)
|
||
#endif
|
||
#ifndef FXAA_SPAN_MAX
|
||
#define FXAA_SPAN_MAX 8.0
|
||
#endif
|
||
|
||
//optimized version for mobile, where dependent
|
||
//texture reads can be a bottleneck
|
||
vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
|
||
vec2 v_rgbNW, vec2 v_rgbNE,
|
||
vec2 v_rgbSW, vec2 v_rgbSE,
|
||
vec2 v_rgbM) {
|
||
vec4 color;
|
||
vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
|
||
vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
|
||
vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
|
||
vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
|
||
vec4 texColor = texture2D(tex, v_rgbM);
|
||
vec3 rgbM = texColor.xyz;
|
||
vec3 luma = vec3(0.299, 0.587, 0.114);
|
||
float lumaNW = dot(rgbNW, luma);
|
||
float lumaNE = dot(rgbNE, luma);
|
||
float lumaSW = dot(rgbSW, luma);
|
||
float lumaSE = dot(rgbSE, luma);
|
||
float lumaM = dot(rgbM, luma);
|
||
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
|
||
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
|
||
|
||
mediump vec2 dir;
|
||
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
|
||
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
|
||
|
||
float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
|
||
(0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
|
||
|
||
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
|
||
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
|
||
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
|
||
dir * rcpDirMin)) * inverseVP;
|
||
|
||
vec3 rgbA = 0.5 * (
|
||
texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
|
||
texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
|
||
vec3 rgbB = rgbA * 0.5 + 0.25 * (
|
||
texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
|
||
texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
|
||
|
||
float lumaB = dot(rgbB, luma);
|
||
if ((lumaB < lumaMin) || (lumaB > lumaMax))
|
||
color = vec4(rgbA, texColor.a);
|
||
else
|
||
color = vec4(rgbB, texColor.a);
|
||
return color;
|
||
}
|
||
|
||
void main() {
|
||
|
||
vec4 color;
|
||
|
||
color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
|
||
|
||
gl_FragColor = color;
|
||
}
|
||
`,LM=`
|
||
attribute vec2 aVertexPosition;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
|
||
varying vec2 v_rgbNW;
|
||
varying vec2 v_rgbNE;
|
||
varying vec2 v_rgbSW;
|
||
varying vec2 v_rgbSE;
|
||
varying vec2 v_rgbM;
|
||
|
||
varying vec2 vFragCoord;
|
||
|
||
uniform vec4 inputSize;
|
||
uniform vec4 outputFrame;
|
||
|
||
vec4 filterVertexPosition( void )
|
||
{
|
||
vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
|
||
|
||
return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
||
}
|
||
|
||
void texcoords(vec2 fragCoord, vec2 inverseVP,
|
||
out vec2 v_rgbNW, out vec2 v_rgbNE,
|
||
out vec2 v_rgbSW, out vec2 v_rgbSE,
|
||
out vec2 v_rgbM) {
|
||
v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
|
||
v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
|
||
v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
|
||
v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
|
||
v_rgbM = vec2(fragCoord * inverseVP);
|
||
}
|
||
|
||
void main(void) {
|
||
|
||
gl_Position = filterVertexPosition();
|
||
|
||
vFragCoord = aVertexPosition * outputFrame.zw;
|
||
|
||
texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
|
||
}
|
||
`;class BM extends _s{constructor(){super(LM,kM)}}var OM=`precision highp float;
|
||
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
|
||
uniform float uNoise;
|
||
uniform float uSeed;
|
||
uniform sampler2D uSampler;
|
||
|
||
float rand(vec2 co)
|
||
{
|
||
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
||
}
|
||
|
||
void main()
|
||
{
|
||
vec4 color = texture2D(uSampler, vTextureCoord);
|
||
float randomValue = rand(gl_FragCoord.xy * uSeed);
|
||
float diff = (randomValue - 0.5) * uNoise;
|
||
|
||
// Un-premultiply alpha before applying the color matrix. See issue #3539.
|
||
if (color.a > 0.0) {
|
||
color.rgb /= color.a;
|
||
}
|
||
|
||
color.r += diff;
|
||
color.g += diff;
|
||
color.b += diff;
|
||
|
||
// Premultiply alpha again.
|
||
color.rgb *= color.a;
|
||
|
||
gl_FragColor = color;
|
||
}
|
||
`;class DM extends _s{constructor(t=.5,e=Math.random()){super(e1,OM,{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const Ex={AlphaFilter:wM,BlurFilter:IM,BlurFilterPass:Bm,ColorMatrixFilter:Om,DisplacementFilter:FM,FXAAFilter:BM,NoiseFilter:DM};Object.entries(Ex).forEach(([i,t])=>{Object.defineProperty(Ex,i,{get(){return Ht("7.1.0",`filters.${i} has moved to ${i}`),t}})});class NM{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(ss.system.add(this.tickerUpdate,this,Wn.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(ss.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}}const ji=new NM;class Cl{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Cl.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Kt,this.page=new Kt,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,s){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,s,r,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class Jh extends Cl{constructor(){super(...arguments),this.client=new Kt,this.movement=new Kt,this.offset=new Kt,this.global=new Kt,this.screen=new Kt}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,s){return t.worldTransform.applyInverse(s||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,s,r,n,a,o,h,l,c,u,d,f,m,p){throw new Error("Method not implemented.")}}class or extends Jh{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Fa extends Jh{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}Fa.DOM_DELTA_PIXEL=0,Fa.DOM_DELTA_LINE=1,Fa.DOM_DELTA_PAGE=2;const UM=2048,XM=new Kt,Ef=new Kt;class VM{constructor(t){this.dispatch=new Al,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((s,r)=>s.priority-r.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let s=0,r=e.length;s<r;s++)e[s].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){ji.pauseUpdate=!0;const s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",r=this[s](this.rootTarget,this.rootTarget.eventMode,XM.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const s=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let r=0,n=s.length-1;r<n;r++)if(t.currentTarget=s[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!(t.propagationStopped||t.propagationImmediatelyStopped)){t.eventPhase=t.BUBBLING_PHASE;for(let r=s.length-2;r>=0;r--)if(t.currentTarget=s[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,s=this._allInteractiveElements){if(s.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(e)?e:[e];for(let n=s.length-1;n>=0;n--)r.forEach(a=>{t.currentTarget=s[n],this.notifyTarget(t,a)})}propagationPath(t){const e=[t];for(let s=0;s<UM&&t!==this.rootTarget;s++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,s,r,n,a=!1){let o=!1;if(this._interactivePrune(t))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ji.pauseUpdate=!1),t.interactiveChildren&&t.children){const c=t.children;for(let u=c.length-1;u>=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(e)?e:d.eventMode,s,r,n,a||n(t,s));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const m=t.isInteractive();(f.length>0||m)&&(m&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),o=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return h&&l&&this._allInteractiveElements.push(t),a||this._hitElements.length>0?null:o?this._hitElements:h&&!n(t,s)&&r(t,s)?l?[t]:[]:null}hitTestRecursive(t,e,s,r,n){if(this._interactivePrune(t)||n(t,s))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(ji.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(e)?e:c.eventMode,s,r,n);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();return(u.length>0||d)&&u.push(t),u}}}const a=this._isInteractive(e),o=t.isInteractive();return a&&r(t,s)?o?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,e){var s;if(t.hitArea&&(t.worldTransform.applyInverse(e,Ef),!t.hitArea.contains(Ef.x,Ef.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!((s=r.containsPoint)!=null&&s.call(r,e)))return!0}return!1}hitTestFn(t,e){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(e):!1}notifyTarget(t,e){var n,a;e=e??t.type;const s=`on${e}`;(a=(n=t.currentTarget)[s])==null||a.call(n,t);const r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),e.pointerType==="touch")this.dispatchEvent(e,"touchstart");else if(e.pointerType==="mouse"||e.pointerType==="pen"){const r=e.button===2;this.dispatchEvent(e,r?"rightdown":"mousedown")}const s=this.trackingData(t.pointerId);s.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var h,l;if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s=e.pointerType==="mouse"||e.pointerType==="pen",r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.overTargets);if(((h=r.overTargets)==null?void 0:h.length)>0&&n!==e.target){const c=t.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(t,c,n);if(this.dispatchEvent(u,"pointerout"),s&&this.dispatchEvent(u,"mouseout"),!e.composedPath().includes(n)){const d=this.createPointerEvent(t,"pointerleave",n);for(d.eventPhase=d.AT_TARGET;d.target&&!e.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),s&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(n!==e.target){const c=t.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(e,c);this.dispatchEvent(u,"pointerover"),s&&this.dispatchEvent(u,"mouseover");let d=n==null?void 0:n.parent;for(;d&&d!==this.rootTarget.parent&&d!==e.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(e,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==n&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),s&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push("pointermove"):this.dispatchEvent(e,"pointermove"),o&&a.push("globalpointermove"),e.pointerType==="touch"&&(this.moveOnAll?a.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),o&&a.push("globaltouchmove")),s&&(this.moveOnAll?a.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),o&&a.push("globalmousemove"),this.cursor=(l=e.target)==null?void 0:l.cursor),a.length>0&&this.all(e,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){var a;if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),s=this.createPointerEvent(t),r=s.pointerType==="mouse"||s.pointerType==="pen";this.dispatchEvent(s,"pointerover"),r&&this.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(this.cursor=(a=s.target)==null?void 0:a.cursor);const n=this.clonePointerEvent(s,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;e.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId);if(e.overTargets){const s=t.pointerType==="mouse"||t.pointerType==="pen",r=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout");const a=this.createPointerEvent(t,"pointerleave",r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),s&&this.notifyTarget(a,"mouseleave"),a.target=a.target.parent;e.overTargets=null,this.freeEvent(n),this.freeEvent(a)}this.cursor=null}mapPointerUp(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=performance.now(),s=this.createPointerEvent(t);if(this.dispatchEvent(s,"pointerup"),s.pointerType==="touch")this.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const o=s.button===2;this.dispatchEvent(s,o?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]);let a=n;if(n&&!s.composedPath().includes(n)){let o=n;for(;o&&!s.composedPath().includes(o);){if(s.currentTarget=o,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")this.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){const h=s.button===2;this.notifyTarget(s,h?"rightupoutside":"mouseupoutside")}o=o.parent}delete r.pressTargetsByButton[t.button],a=o}if(a){const o=this.clonePointerEvent(s,"click");o.target=a,o.path=null,r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:o.target,timeStamp:e});const h=r.clicksByButton[t.button];if(h.target===o.target&&e-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=o.target,h.timeStamp=e,o.detail=h.clickCount,o.pointerType==="mouse"){const l=o.button===2;this.dispatchEvent(o,l?"rightclick":"click")}else o.pointerType==="touch"&&this.dispatchEvent(o,"tap");this.dispatchEvent(o,"pointertap"),this.freeEvent(o)}this.freeEvent(s)}mapPointerUpOutside(t){if(!(t instanceof or)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),s=this.findMountedTarget(e.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(s){let n=s;for(;n;)r.currentTarget=n,this.notifyTarget(r,"pointerupoutside"),r.pointerType==="touch"?this.notifyTarget(r,"touchendoutside"):(r.pointerType==="mouse"||r.pointerType==="pen")&&this.notifyTarget(r,r.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(r)}mapWheel(t){if(!(t instanceof Fa)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let s=1;s<t.length&&t[s].parent===e;s++)e=t[s];return e}createPointerEvent(t,e,s){const r=this.allocateEvent(or);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=s??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof e=="string"&&(r.type=e),r}createWheelEvent(t){const e=this.allocateEvent(Fa);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const s=this.allocateEvent(or);return s.nativeEvent=t.nativeEvent,s.originalEvent=t.originalEvent,this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.target=t.target,s.path=t.composedPath().slice(),s.type=e??s.type,s}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof or&&e instanceof or&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Jh&&e instanceof Jh&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyListeners(t,e){const s=t.currentTarget._events[e];if(s&&t.currentTarget.isInteractive())if("fn"in s)s.once&&t.currentTarget.removeListener(e,s.fn,void 0,!0),s.fn.call(s.context,t);else for(let r=0,n=s.length;r<n&&!t.propagationImmediatelyStopped;r++)s[r].once&&t.currentTarget.removeListener(e,s[r].fn,void 0,!0),s[r].fn.call(s[r].context,t)}}const YM=1,GM={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Dm=class Nm{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new VM(null),ji.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new or(null),this.rootWheelEvent=new Fa(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Nm.defaultEventFeatures},{set:(e,s,r)=>(s==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=r),e[s]=r,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){const{view:e,resolution:s}=this.renderer;this.setTargetElement(e),this.resolution=s,Nm._defaultEventMode=t.eventMode??"auto",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const s=this.cursorStyles[t];if(s)switch(typeof s){case"string":e&&(this.domElement.style.cursor=s);break;case"function":s(t);break;case"object":e&&Object.assign(this.domElement.style,s);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let s=0,r=e.length;s<r;s++){const n=e[s],a=this.bootstrapEvent(this.rootPointerEvent,n);this.rootBoundary.mapEvent(a)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,ji.pointerMoved();const e=this.normalizeToPointerData(t);for(let s=0,r=e.length;s<r;s++){const n=this.bootstrapEvent(this.rootPointerEvent,e[s]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const s=e!==this.domElement?"outside":"",r=this.normalizeToPointerData(t);for(let n=0,a=r.length;n<a;n++){const o=this.bootstrapEvent(this.rootPointerEvent,r[n]);o.type+=s,this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);for(let s=0,r=e.length;s<r;s++){const n=this.bootstrapEvent(this.rootPointerEvent,e[s]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this.removeEvents(),this.domElement=t,ji.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;ji.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;ji.removeTickerListener();const t=this.domElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(t,e,s){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;t.x=(e-r.left)*(this.domElement.width/r.width)*n,t.y=(s-r.top)*(this.domElement.height/r.height)*n}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let s=0,r=t.changedTouches.length;s<r;s++){const n=t.changedTouches[s];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){const s=t;typeof s.isPrimary>"u"&&(s.isPrimary=!0),typeof s.width>"u"&&(s.width=1),typeof s.height>"u"&&(s.height=1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="mouse"),typeof s.pointerId>"u"&&(s.pointerId=YM),typeof s.pressure>"u"&&(s.pressure=.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),s.isNormalized=!0,e.push(s)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=GM[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};Dm.extension={name:"events",type:[gt.RendererSystem,gt.CanvasRendererSystem]},Dm.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Um=Dm;St.add(Um);function Ax(i){return i==="dynamic"||i==="static"}const $M={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??Ax(Um.defaultEventMode)},set interactive(i){Ht("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=i,this.eventMode=i?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Um.defaultEventMode},set eventMode(i){this._internalInteractive=Ax(i),this._internalEventMode=i},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(i,t,e){const s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,r=typeof e=="object"?e.signal:void 0,n=typeof e=="object"?e.once===!0:!1,a=typeof t=="function"?void 0:t;i=s?`${i}capture`:i;const o=typeof t=="function"?t:t.handleEvent,h=this;r&&r.addEventListener("abort",()=>{h.off(i,o,a)}),n?h.once(i,o,a):h.on(i,o,a)},removeEventListener(i,t,e){const s=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,r=typeof t=="function"?void 0:t;i=s?`${i}capture`:i,t=typeof t=="function"?t:t.handleEvent,this.off(i,t,r)},dispatchEvent(i){if(!(i instanceof Cl))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return i.defaultPrevented=!1,i.path=null,i.target=this,i.manager.dispatchEvent(i),!i.defaultPrevented}};Ie.mixin($M);const HM={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Ie.mixin(HM);const WM=9,ih=100,zM=0,jM=0,Cx=2,Ix=1,qM=-1e3,KM=-1e3,ZM=2;class c1{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(pi.tablet||pi.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width=`${ih}px`,e.style.height=`${ih}px`,e.style.position="absolute",e.style.top=`${zM}px`,e.style.left=`${jM}px`,e.style.zIndex=Cx.toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width=`${Ix}px`,t.style.height=`${Ix}px`,t.style.position="absolute",t.style.top=`${qM}px`,t.style.left=`${KM}px`,t.style.zIndex=ZM.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)==null||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)==null||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let s=0;s<e.length;s++)this.updateAccessibleObjects(e[s])}update(){const t=performance.now();if(pi.android.device&&t<this.androidUpdateCount||(this.androidUpdateCount=t+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:e,y:s,width:r,height:n}=this.renderer.view.getBoundingClientRect(),{width:a,height:o,resolution:h}=this.renderer,l=r/a*h,c=n/o*h;let u=this.div;u.style.left=`${e}px`,u.style.top=`${s}px`,u.style.width=`${a}px`,u.style.height=`${o}px`;for(let d=0;d<this.children.length;d++){const f=this.children[d];if(f.renderId!==this.renderId)f._accessibleActive=!1,Ma(this.children,d,1),this.div.removeChild(f._accessibleDiv),this.pool.push(f._accessibleDiv),f._accessibleDiv=null,d--;else{u=f._accessibleDiv;let m=f.hitArea;const p=f.worldTransform;f.hitArea?(u.style.left=`${(p.tx+m.x*p.a)*l}px`,u.style.top=`${(p.ty+m.y*p.d)*c}px`,u.style.width=`${m.width*p.a*l}px`,u.style.height=`${m.height*p.d*c}px`):(m=f.getBounds(),this.capHitArea(m),u.style.left=`${m.x*l}px`,u.style.top=`${m.y*c}px`,u.style.width=`${m.width*l}px`,u.style.height=`${m.height*c}px`,u.title!==f.accessibleTitle&&f.accessibleTitle!==null&&(u.title=f.accessibleTitle),u.getAttribute("aria-label")!==f.accessibleHint&&f.accessibleHint!==null&&u.setAttribute("aria-label",f.accessibleHint)),(f.accessibleTitle!==u.title||f.tabIndex!==u.tabIndex)&&(u.title=f.accessibleTitle,u.tabIndex=f.tabIndex,this.debug&&this.updateDebugHTML(u))}}this.renderId++}updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:s}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>s&&(t.height=s-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=`${ih}px`,e.style.height=`${ih}px`,e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=Cx.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?e.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:s}=t.target,r=this.renderer.events.rootBoundary,n=Object.assign(new Cl(r),{target:s});r.rootTarget=this.renderer.lastObjectRendered,e.forEach(a=>r.dispatchEvent(n,a))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode===WM&&this.activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}c1.extension={name:"accessibility",type:[gt.RendererPlugin,gt.CanvasRendererPlugin]};St.add(c1);const u1=class Xm{constructor(t){this.stage=new fs,t=Object.assign({forceCanvas:!1},t),this.renderer=oM(t),Xm._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render(this.stage)}get view(){var t;return(t=this.renderer)==null?void 0:t.view}get screen(){var t;return(t=this.renderer)==null?void 0:t.screen}destroy(t,e){const s=Xm._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};u1._plugins=[];let JM=u1;St.handleByList(gt.Application,JM._plugins);class d1{static init(t){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;e=r,s=n}this.renderer.resize(e,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}d1.extension=gt.Application;St.add(d1);const Px={loader:gt.LoadParser,resolver:gt.ResolveParser,cache:gt.CacheParser,detection:gt.DetectionParser};St.handle(gt.Asset,i=>{const t=i.ref;Object.entries(Px).filter(([e])=>!!t[e]).forEach(([e,s])=>St.add(Object.assign(t[e],{extension:t[e].extension??s})))},i=>{const t=i.ref;Object.keys(Px).filter(e=>!!t[e]).forEach(e=>St.remove(t[e]))});class QM{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let s=0;s<e;s++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function eo(i,t){if(Array.isArray(t)){for(const e of t)if(i.startsWith(`data:${e}`))return!0;return!1}return i.startsWith(`data:${t}`)}function Ue(i,t){const e=i.split("?")[0],s=ye.extname(e).toLowerCase();return Array.isArray(t)?t.includes(s):s===t}const hr=(i,t,e=!1)=>(Array.isArray(i)||(i=[i]),t?i.map(s=>typeof s=="string"||e?t(s):s):i),sl=(i,t)=>{const e=t.split("?")[1];return e&&(i+=`?${e}`),i};function f1(i,t,e,s,r){const n=t[e];for(let a=0;a<n.length;a++){const o=n[a];e<t.length-1?f1(i.replace(s[e],o),t,e+1,s,r):r.push(i.replace(s[e],o))}}function tR(i){const t=/\{(.*?)\}/g,e=i.match(t),s=[];if(e){const r=[];e.forEach(n=>{const a=n.substring(1,n.length-1).split(",");r.push(a)}),f1(i,r,0,e,s)}else s.push(i);return s}const Qh=i=>!Array.isArray(i);class eR{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=hr(t);let r;for(let o=0;o<this.parsers.length;o++){const h=this.parsers[o];if(h.test(e)){r=h.getCacheableAssets(s,e);break}}r||(r={},s.forEach(o=>{r[o]=e}));const n=Object.keys(r),a={cacheKeys:n,keys:s};if(s.forEach(o=>{this._cacheMap.set(o,a)}),n.forEach(o=>{const h=r?r[o]:e;this._cache.has(o)&&this._cache.get(o)!==h&&console.warn("[Cache] already has key:",o),this._cache.set(o,r[o])}),e instanceof Nt){const o=e;s.forEach(h=>{o.baseTexture!==Nt.EMPTY.baseTexture&&Lt.addToCache(o.baseTexture,h),Nt.addToCache(o,h)})}}remove(t){if(!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(s=>{this._cache.delete(s)}),e.keys.forEach(s=>{this._cacheMap.delete(s)})}get parsers(){return this._parsers}}const Rn=new eR;class sR{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,s)=>(this._parsersValidated=!1,t[e]=s,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const s={promise:null,parser:null};return s.promise=(async()=>{var a,o;let r=null,n=null;if(e.loadParser&&(n=this._parserHash[e.loadParser],n||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!n){for(let h=0;h<this.parsers.length;h++){const l=this.parsers[h];if(l.load&&((a=l.test)!=null&&a.call(l,t,e,this))){n=l;break}}if(!n)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}r=await n.load(t,e,this),s.parser=n;for(let h=0;h<this.parsers.length;h++){const l=this.parsers[h];l.parse&&l.parse&&await((o=l.testParse)==null?void 0:o.call(l,r,e,this))&&(r=await l.parse(r,e,this)||r,s.parser=l)}return r})(),s}async load(t,e){this._parsersValidated||this._validateParsers();let s=0;const r={},n=Qh(t),a=hr(t,l=>({alias:[l],src:l})),o=a.length,h=a.map(async l=>{const c=ye.toAbsolute(l.src);if(!r[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),r[l.src]=await this.promiseCache[c].promise,e&&e(++s/o)}catch(u){throw delete this.promiseCache[c],delete r[l.src],new Error(`[Loader.load] Failed to load ${c}.
|
||
${u}`)}});return await Promise.all(h),n?r[a[0].src]:r}async unload(t){const e=hr(t,s=>({alias:[s],src:s})).map(async s=>{var a,o;const r=ye.toAbsolute(s.src),n=this.promiseCache[r];if(n){const h=await n.promise;delete this.promiseCache[r],(o=(a=n.parser)==null?void 0:a.unload)==null||o.call(a,h,s,this)}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e}),{})}}var Ts=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(Ts||{});const rR=".json",iR="application/json",nR={extension:{type:gt.LoadParser,priority:Ts.Low},name:"loadJson",test(i){return eo(i,iR)||Ue(i,rR)},async load(i){return await(await _t.ADAPTER.fetch(i)).json()}};St.add(nR);const aR=".txt",oR="text/plain",lR={name:"loadTxt",extension:{type:gt.LoadParser,priority:Ts.Low},test(i){return eo(i,oR)||Ue(i,aR)},async load(i){return await(await _t.ADAPTER.fetch(i)).text()}};St.add(lR);const hR=["normal","bold","100","200","300","400","500","600","700","800","900"],cR=[".ttf",".otf",".woff",".woff2"],uR=["font/ttf","font/otf","font/woff","font/woff2"],dR=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function fR(i){const t=ye.extname(i),e=ye.basename(i,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1));let s=e.length>0;for(const n of e)if(!n.match(dR)){s=!1;break}let r=e.join(" ");return s||(r=`"${r.replace(/[\\"]/g,"\\$&")}"`),r}const mR=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function pR(i){return mR.test(i)?i:encodeURI(i)}const gR={extension:{type:gt.LoadParser,priority:Ts.Low},name:"loadWebFont",test(i){return eo(i,uR)||Ue(i,cR)},async load(i,t){var s,r,n;const e=_t.ADAPTER.getFontFaceSet();if(e){const a=[],o=((s=t.data)==null?void 0:s.family)??fR(i),h=((n=(r=t.data)==null?void 0:r.weights)==null?void 0:n.filter(c=>hR.includes(c)))??["normal"],l=t.data??{};for(let c=0;c<h.length;c++){const u=h[c],d=new FontFace(o,`url(${pR(i)})`,{...l,weight:u});await d.load(),e.add(d),a.push(d)}return a.length===1?a[0]:a}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(i){(Array.isArray(i)?i:[i]).forEach(t=>_t.ADAPTER.getFontFaceSet().delete(t))}};St.add(gR);const yR=`(function() {
|
||
"use strict";
|
||
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
||
async function checkImageBitmap() {
|
||
try {
|
||
if (typeof createImageBitmap != "function")
|
||
return !1;
|
||
const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);
|
||
return imageBitmap.width === 1 && imageBitmap.height === 1;
|
||
} catch {
|
||
return !1;
|
||
}
|
||
}
|
||
checkImageBitmap().then((result) => {
|
||
self.postMessage(result);
|
||
});
|
||
})();
|
||
`;let ka=null,Vm=class{constructor(){ka||(ka=URL.createObjectURL(new Blob([yR],{type:"application/javascript"}))),this.worker=new Worker(ka)}};Vm.revokeObjectURL=function(){ka&&(URL.revokeObjectURL(ka),ka=null)};const xR=`(function() {
|
||
"use strict";
|
||
async function loadImageBitmap(url) {
|
||
const response = await fetch(url);
|
||
if (!response.ok)
|
||
throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
|
||
const imageBlob = await response.blob();
|
||
return await createImageBitmap(imageBlob);
|
||
}
|
||
self.onmessage = async (event) => {
|
||
try {
|
||
const imageBitmap = await loadImageBitmap(event.data.data[0]);
|
||
self.postMessage({
|
||
data: imageBitmap,
|
||
uuid: event.data.uuid,
|
||
id: event.data.id
|
||
}, [imageBitmap]);
|
||
} catch (e) {
|
||
self.postMessage({
|
||
error: e,
|
||
uuid: event.data.uuid,
|
||
id: event.data.id
|
||
});
|
||
}
|
||
};
|
||
})();
|
||
`;let La=null;class m1{constructor(){La||(La=URL.createObjectURL(new Blob([xR],{type:"application/javascript"}))),this.worker=new Worker(La)}}m1.revokeObjectURL=function(){La&&(URL.revokeObjectURL(La),La=null)};let Mx=0,Af;class bR{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{const{worker:e}=new Vm;e.addEventListener("message",s=>{e.terminate(),Vm.revokeObjectURL(),t(s.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Af===void 0&&(Af=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<Af&&(this._createdWorkers++,t=new m1().worker,t.addEventListener("message",e=>{this.complete(e.data),this.returnWorker(e.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const s=new Promise((r,n)=>{this.queue.push({id:t,arguments:e,resolve:r,reject:n})});return this.next(),s}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),s=e.id;this.resolveHash[Mx]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Mx++,id:s})}}const Rx=new bR;function Il(i,t,e){i.resource.internal=!0;const s=new Nt(i),r=()=>{delete t.promiseCache[e],Rn.has(e)&&Rn.remove(e)};return s.baseTexture.once("destroyed",()=>{e in t.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),r())}),s.once("destroyed",()=>{i.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),r())}),s}const vR=[".jpeg",".jpg",".png",".webp",".avif"],_R=["image/jpeg","image/png","image/webp","image/avif"];async function wR(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${i}: ${t.status} ${t.statusText}`);const e=await t.blob();return await createImageBitmap(e)}const qc={name:"loadTextures",extension:{type:gt.LoadParser,priority:Ts.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(i){return eo(i,_R)||Ue(i,vR)},async load(i,t,e){var o;const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let r;s?this.config.preferWorkers&&await Rx.isImageBitmapSupported()?r=await Rx.loadImageBitmap(i):r=await wR(i):r=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=i,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const n={...t.data};n.resolution??(n.resolution=Ci(i)),s&&((o=n.resourceOptions)==null?void 0:o.ownsImageBitmap)===void 0&&(n.resourceOptions={...n.resourceOptions},n.resourceOptions.ownsImageBitmap=!0);const a=new Lt(r,n);return a.resource.src=i,Il(a,e,i)},unload(i){i.destroy(!0)}};St.add(qc);const TR=".svg",SR="image/svg+xml",ER={extension:{type:gt.LoadParser,priority:Ts.High},name:"loadSVG",test(i){return eo(i,SR)||Ue(i,TR)},async testParse(i){return Rm.test(i)},async parse(i,t,e){var n;const s=new Rm(i,(n=t==null?void 0:t.data)==null?void 0:n.resourceOptions);await s.load();const r=new Lt(s,{resolution:Ci(i),...t==null?void 0:t.data});return r.resource.src=t.src,Il(r,e,t.src)},async load(i,t){return(await _t.ADAPTER.fetch(i)).text()},unload:qc.unload};St.add(ER);const AR=[".mp4",".m4v",".webm",".ogv"],CR=["video/mp4","video/webm","video/ogg"],IR={name:"loadVideo",extension:{type:gt.LoadParser,priority:Ts.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(i){return eo(i,CR)||Ue(i,AR)},async load(i,t,e){var a;let s;const r=await(await _t.ADAPTER.fetch(i)).blob(),n=URL.createObjectURL(r);try{const o={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(a=t==null?void 0:t.data)==null?void 0:a.resourceOptions,autoLoad:!0},h=new o1(n,o);await h.load();const l=new Lt(h,{alphaMode:await LI(),resolution:Ci(i),...t==null?void 0:t.data});l.resource.src=i,s=Il(l,e,i),s.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(n)})}catch(o){throw URL.revokeObjectURL(n),o}return s},unload(i){i.destroy(!0)}};St.add(IR);class PR{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){const{alias:e,name:s,src:r,srcs:n}=t;return hr(e||s||r||n,a=>typeof a=="string"?a:Array.isArray(a)?a.map(o=>(o==null?void 0:o.src)??(o==null?void 0:o.srcs)??o):a!=null&&a.src||a!=null&&a.srcs?a.src??a.srcs:a,!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const s=[];Array.isArray(e)?e.forEach(r=>{const n=r.src??r.srcs,a=r.alias??r.name;let o;if(typeof a=="string"){const h=this._createBundleAssetId(t,a);s.push(h),o=[a,h]}else{const h=a.map(l=>this._createBundleAssetId(t,l));s.push(...h),o=[...a,...h]}this.add({...r,alias:o,src:n})}):Object.keys(e).forEach(r=>{const n=[r,this._createBundleAssetId(t,r)];if(typeof e[r]=="string")this.add({alias:n,src:e[r]});else if(Array.isArray(e[r]))this.add({alias:n,src:e[r]});else{const a=e[r],o=a.src??a.srcs;this.add({...a,alias:n,src:Array.isArray(o)?o:[o]})}s.push(...n)}),this._bundles[t]=s}add(t,e,s,r,n){const a=[];typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"?(Ht("7.2.0",`Assets.add now uses an object instead of individual parameters.
|
||
Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:t,src:e,data:s,format:r,loadParser:n})):Array.isArray(t)?a.push(...t):a.push(t);let o;o=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},hr(a).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const m=hr(l||c).map(y=>typeof y=="string"?tR(y):Array.isArray(y)?y:[y]),p=this.getAlias(h);Array.isArray(p)?p.forEach(o):o(p);const g=[];m.forEach(y=>{y.forEach(_=>{let v={};if(typeof _!="object"){v.src=_;for(let b=0;b<this._parsers.length;b++){const T=this._parsers[b];if(T.test(_)){v=T.parse(_);break}}}else u=_.data??u,d=_.format??d,f=_.loadParser??f,v={...v,..._};if(!p)throw new Error(`[Resolver] alias is undefined for this asset: ${v.src}`);v=this.buildResolvedAsset(v,{aliases:p,data:u,format:d,loadParser:f}),g.push(v)})}),p.forEach(y=>{this._assetMap[y]=g})})}resolveBundle(t){const e=Qh(t);t=hr(t);const s={};return t.forEach(r=>{const n=this._bundles[r];if(n){const a=this.resolve(n),o={};for(const h in a){const l=a[h];o[this._extractAssetIdFromBundle(r,h)]=l}s[r]=o}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const r in e)s[r]=e[r].src;return s}return e.src}resolve(t){const e=Qh(t);t=hr(t);const s={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const a=n[0],o=this._getPreferredOrder(n);o==null||o.priority.forEach(h=>{o.params[h].forEach(l=>{const c=n.filter(u=>u[h]?u[h]===l:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]??a}else this._resolverHash[r]=this.buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const s=t[0],r=this._preferredOrder.find(n=>n.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:s,data:r,loadParser:n,format:a}=e;return(this._basePath||this._rootPath)&&(t.src=ye.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=a??t.format??ye.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}class MR{constructor(){this._detections=[],this._initialized=!1,this.resolver=new PR,this.loader=new sR,this.cache=Rn,this._backgroundLoader=new QM(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var n,a;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let o=t.manifest;typeof o=="string"&&(o=await this.load(o)),this.resolver.addManifest(o)}const e=((n=t.texturePreference)==null?void 0:n.resolution)??1,s=typeof e=="number"?[e]:e,r=await this._detectFormats({preferredFormats:(a=t.texturePreference)==null?void 0:a.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:r,resolution:s}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,s,r,n){this.resolver.add(t,e,s,r,n)}async load(t,e){this._initialized||await this.init();const s=Qh(t),r=hr(t).map(o=>{if(typeof o!="string"){const h=this.resolver.getAlias(o);return h.some(l=>!this.resolver.hasKey(l))&&this.add(o),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(o)||this.add({alias:o,src:o}),o}),n=this.resolver.resolve(r),a=await this._mapLoadToResolve(n,e);return s?a[r[0]]:a}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let s=!1;typeof t=="string"&&(s=!0,t=[t]);const r=this.resolver.resolveBundle(t),n={},a=Object.keys(r);let o=0,h=0;const l=()=>{e==null||e(++o/h)},c=a.map(u=>{const d=r[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{n[u]=f})});return await Promise.all(c),s?n[t[0]]:n}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(s=>{this._backgroundLoader.add(Object.values(s))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return Rn.get(t);const e={};for(let s=0;s<t.length;s++)e[s]=Rn.get(t[s]);return e}async _mapLoadToResolve(t,e){const s=Object.values(t),r=Object.keys(t);this._backgroundLoader.active=!1;const n=await this.loader.load(s,e);this._backgroundLoader.active=!0;const a={};return s.forEach((o,h)=>{const l=n[o.src],c=[o.src];o.alias&&c.push(...o.alias),a[r[h]]=l,Rn.set(c,l)}),a}async unload(t){this._initialized||await this.init();const e=hr(t).map(r=>typeof r!="string"?r.src:r),s=this.resolver.resolve(e);await this._unloadFromResolved(s)}async unloadBundle(t){this._initialized||await this.init(),t=hr(t);const e=this.resolver.resolveBundle(t),s=Object.keys(e).map(r=>this._unloadFromResolved(e[r]));await Promise.all(s)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(s=>{Rn.remove(s.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const s of t.detections)t.skipDetections||await s.test()?e=await s.add(e):t.skipDetections||(e=await s.remove(e));return e=e.filter((s,r)=>e.indexOf(s)===r),e}get detections(){return this._detections}get preferWorkers(){return qc.config.preferWorkers}set preferWorkers(t){Ht("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(s=>s in t).forEach(s=>{e.config[s]=t[s]})})}}const Cs=new MR;St.handleByList(gt.LoadParser,Cs.loader.parsers).handleByList(gt.ResolveParser,Cs.resolver.parsers).handleByList(gt.CacheParser,Cs.cache.parsers).handleByList(gt.DetectionParser,Cs.detections);const RR={extension:gt.CacheParser,test:i=>Array.isArray(i)&&i.every(t=>t instanceof Nt),getCacheableAssets:(i,t)=>{const e={};return i.forEach(s=>{t.forEach((r,n)=>{e[s+(n===0?"":n+1)]=r})}),e}};St.add(RR);async function p1(i){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=i});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(i)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const FR={extension:{type:gt.DetectionParser,priority:1},test:async()=>p1("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async i=>[...i,"avif"],remove:async i=>i.filter(t=>t!=="avif")};St.add(FR);const kR={extension:{type:gt.DetectionParser,priority:0},test:async()=>p1("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async i=>[...i,"webp"],remove:async i=>i.filter(t=>t!=="webp")};St.add(kR);const Fx=["png","jpg","jpeg"],LR={extension:{type:gt.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async i=>[...i,...Fx],remove:async i=>i.filter(t=>!Fx.includes(t))};St.add(LR);const BR="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Vp(i){return BR?!1:document.createElement("video").canPlayType(i)!==""}const OR={extension:{type:gt.DetectionParser,priority:0},test:async()=>Vp("video/webm"),add:async i=>[...i,"webm"],remove:async i=>i.filter(t=>t!=="webm")};St.add(OR);const DR={extension:{type:gt.DetectionParser,priority:0},test:async()=>Vp("video/mp4"),add:async i=>[...i,"mp4","m4v"],remove:async i=>i.filter(t=>t!=="mp4"&&t!=="m4v")};St.add(DR);const NR={extension:{type:gt.DetectionParser,priority:0},test:async()=>Vp("video/ogg"),add:async i=>[...i,"ogv"],remove:async i=>i.filter(t=>t!=="ogv")};St.add(NR);const UR={extension:gt.ResolveParser,test:qc.test,parse:i=>{var t;return{resolution:parseFloat(((t=_t.RETINA_PREFIX.exec(i))==null?void 0:t[1])??"1"),format:ye.extname(i).slice(1),src:i}}};St.add(UR);var Ze=(i=>(i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i))(Ze||{});const tc={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let Ir,ma;function kx(){ma={bptc:Ir.getExtension("EXT_texture_compression_bptc"),astc:Ir.getExtension("WEBGL_compressed_texture_astc"),etc:Ir.getExtension("WEBGL_compressed_texture_etc"),s3tc:Ir.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:Ir.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:Ir.getExtension("WEBGL_compressed_texture_pvrtc")||Ir.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:Ir.getExtension("WEBGL_compressed_texture_etc1"),atc:Ir.getExtension("WEBGL_compressed_texture_atc")}}const XR={extension:{type:gt.DetectionParser,priority:2},test:async()=>{const i=_t.ADAPTER.createCanvas().getContext("webgl");return i?(Ir=i,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async i=>{ma||kx();const t=[];for(const e in ma)ma[e]&&t.push(e);return[...t,...i]},remove:async i=>(ma||kx(),i.filter(t=>!(t in ma)))};St.add(XR);class VR extends Gc{constructor(t,e={width:1,height:1,autoLoad:!0}){let s,r;typeof t=="string"?(s=t,r=new Uint8Array):(s=null,r=t),super(r,e),this.origin=s,this.buffer=r?new xm(r):null,this._load=null,this.loaded=!1,this.origin!==null&&e.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new xm(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class Xn extends VR{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=Xn._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||Xn._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,s){const r=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;r.pixelStorei(r.UNPACK_ALIGNMENT,4);for(let n=0,a=this.levels;n<a;n++){const{levelID:o,levelWidth:h,levelHeight:l,levelBuffer:c}=this._levelBuffers[n];r.compressedTexImage2D(r.TEXTURE_2D,o,this.format,h,l,0,c)}return!0}onBlobLoaded(){this._levelBuffers=Xn._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=35916&&t<=35919)return"s3tc_sRGB";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t===36196)return"etc1";if(t===35986||t===35987||t===34798)return"atc";if(t>=36492&&t<=36495)return"bptc";if(t===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${t}`)}static _createLevelBuffers(t,e,s,r,n,a,o){const h=new Array(s);let l=t.byteOffset,c=a,u=o,d=c+r-1&~(r-1),f=u+n-1&~(n-1),m=d*f*tc[e];for(let p=0;p<s;p++)h[p]={levelID:p,levelWidth:s>1?c:d,levelHeight:s>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,m)},l+=m,c=c>>1||1,u=u>>1||1,d=c+r-1&~(r-1),f=u+n-1&~(n-1),m=d*f*tc[e];return h}}const Cf=4,nh=124,YR=32,Lx=20,GR=542327876,ah={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},$R={FOURCC:2},oh={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},HR=1,WR=2,zR=4,jR=64,qR=512,KR=131072,ZR=827611204,JR=861165636,QR=894720068,t2=808540228,e2=4,s2={[ZR]:Ze.COMPRESSED_RGBA_S3TC_DXT1_EXT,[JR]:Ze.COMPRESSED_RGBA_S3TC_DXT3_EXT,[QR]:Ze.COMPRESSED_RGBA_S3TC_DXT5_EXT},r2={70:Ze.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Ze.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Ze.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Ze.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Ze.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Ze.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Ze.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Ze.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Ze.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Ze.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Ze.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Ze.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Ze.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function i2(i){const t=new Uint32Array(i);if(t[0]!==GR)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(i,0,nh/Uint32Array.BYTES_PER_ELEMENT),s=e[ah.HEIGHT],r=e[ah.WIDTH],n=e[ah.MIPMAP_COUNT],a=new Uint32Array(i,ah.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,YR/Uint32Array.BYTES_PER_ELEMENT),o=a[HR];if(o&zR){const h=a[$R.FOURCC];if(h!==t2){const _=s2[h],v=Cf+nh,b=new Uint8Array(i,v);return[new Xn(b,{format:_,width:r,height:s,levels:n})]}const l=Cf+nh,c=new Uint32Array(t.buffer,l,Lx/Uint32Array.BYTES_PER_ELEMENT),u=c[oh.DXGI_FORMAT],d=c[oh.RESOURCE_DIMENSION],f=c[oh.MISC_FLAG],m=c[oh.ARRAY_SIZE],p=r2[u];if(p===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===e2)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,y=Cf+nh+Lx;if(m===1)g.push(new Uint8Array(i,y));else{const _=tc[p];let v=0,b=r,T=s;for(let w=0;w<n;w++){const E=Math.max(1,b+3&-4),A=Math.max(1,T+3&-4),P=E*A*_;v+=P,b=b>>>1,T=T>>>1}let S=y;for(let w=0;w<m;w++)g.push(new Uint8Array(i,S,v)),S+=v}return g.map(_=>new Xn(_,{format:p,width:r,height:s,levels:n}))}throw o&jR?new Error("DDSParser does not support uncompressed texture data."):o&qR?new Error("DDSParser does not supported YUV uncompressed texture data."):o&KR?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&WR?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Bx=[171,75,84,88,32,49,49,187,13,10,26,10],n2=67305985,ir={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Ym=64,Ox={[wt.UNSIGNED_BYTE]:1,[wt.UNSIGNED_SHORT]:2,[wt.INT]:4,[wt.UNSIGNED_INT]:4,[wt.FLOAT]:4,[wt.HALF_FLOAT]:8},a2={[ft.RGBA]:4,[ft.RGB]:3,[ft.RG]:2,[ft.RED]:1,[ft.LUMINANCE]:1,[ft.LUMINANCE_ALPHA]:2,[ft.ALPHA]:1},o2={[wt.UNSIGNED_SHORT_4_4_4_4]:2,[wt.UNSIGNED_SHORT_5_5_5_1]:2,[wt.UNSIGNED_SHORT_5_6_5]:2};function l2(i,t,e=!1){const s=new DataView(t);if(!h2(i,s))return null;const r=s.getUint32(ir.ENDIANNESS,!0)===n2,n=s.getUint32(ir.GL_TYPE,r),a=s.getUint32(ir.GL_FORMAT,r),o=s.getUint32(ir.GL_INTERNAL_FORMAT,r),h=s.getUint32(ir.PIXEL_WIDTH,r),l=s.getUint32(ir.PIXEL_HEIGHT,r)||1,c=s.getUint32(ir.PIXEL_DEPTH,r)||1,u=s.getUint32(ir.NUMBER_OF_ARRAY_ELEMENTS,r)||1,d=s.getUint32(ir.NUMBER_OF_FACES,r),f=s.getUint32(ir.NUMBER_OF_MIPMAP_LEVELS,r),m=s.getUint32(ir.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const p=4,g=4,y=h+3&-4,_=l+3&-4,v=new Array(u);let b=h*l;n===0&&(b=y*_);let T;if(n!==0?Ox[n]?T=Ox[n]*a2[a]:T=o2[n]:T=tc[o],T===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const S=e?u2(s,m,r):null;let w=b*T,E=h,A=l,P=y,I=_,C=Ym+m;for(let R=0;R<f;R++){const F=s.getUint32(C,r);let D=C+4;for(let M=0;M<u;M++){let O=v[M];O||(O=v[M]=new Array(f)),O[R]={levelID:R,levelWidth:f>1||n!==0?E:P,levelHeight:f>1||n!==0?A:I,levelBuffer:new Uint8Array(t,D,w)},D+=w}C+=F+4,C=C%4!==0?C+4-C%4:C,E=E>>1||1,A=A>>1||1,P=E+p-1&-4,I=A+g-1&-4,w=P*I*T}return n!==0?{uncompressed:v.map(R=>{let F=R[0].levelBuffer,D=!1;return n===wt.FLOAT?F=new Float32Array(R[0].levelBuffer.buffer,R[0].levelBuffer.byteOffset,R[0].levelBuffer.byteLength/4):n===wt.UNSIGNED_INT?(D=!0,F=new Uint32Array(R[0].levelBuffer.buffer,R[0].levelBuffer.byteOffset,R[0].levelBuffer.byteLength/4)):n===wt.INT&&(D=!0,F=new Int32Array(R[0].levelBuffer.buffer,R[0].levelBuffer.byteOffset,R[0].levelBuffer.byteLength/4)),{resource:new Gc(F,{width:R[0].levelWidth,height:R[0].levelHeight}),type:n,format:D?c2(a):a}}),kvData:S}:{compressed:v.map(R=>new Xn(null,{format:o,width:h,height:l,levels:f,levelBuffers:R})),kvData:S}}function h2(i,t){for(let e=0;e<Bx.length;e++)if(t.getUint8(e)!==Bx[e])return console.error(`${i} is not a valid *.ktx file!`),!1;return!0}function c2(i){switch(i){case ft.RGBA:return ft.RGBA_INTEGER;case ft.RGB:return ft.RGB_INTEGER;case ft.RG:return ft.RG_INTEGER;case ft.RED:return ft.RED_INTEGER;default:return i}}function u2(i,t,e){const s=new Map;let r=0;for(;r<t;){const n=i.getUint32(Ym+r,e),a=Ym+r+4,o=3-(n+3)%4;if(n===0||n>t-r){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&i.getUint8(a+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=new TextDecoder().decode(new Uint8Array(i.buffer,a,h)),c=new DataView(i.buffer,a+h+1,n-h-1);s.set(l,c),r+=4+n+o}return s}const d2={extension:{type:gt.LoadParser,priority:Ts.High},name:"loadDDS",test(i){return Ue(i,".dds")},async load(i,t,e){const s=await(await _t.ADAPTER.fetch(i)).arrayBuffer(),r=i2(s).map(n=>{const a=new Lt(n,{mipmap:Ms.OFF,alphaMode:Ke.NO_PREMULTIPLIED_ALPHA,resolution:Ci(i),...t.data});return Il(a,e,i)});return r.length===1?r[0]:r},unload(i){Array.isArray(i)?i.forEach(t=>t.destroy(!0)):i.destroy(!0)}};St.add(d2);const f2={extension:{type:gt.LoadParser,priority:Ts.High},name:"loadKTX",test(i){return Ue(i,".ktx")},async load(i,t,e){const s=await(await _t.ADAPTER.fetch(i)).arrayBuffer(),{compressed:r,uncompressed:n,kvData:a}=l2(i,s),o=r??n,h={mipmap:Ms.OFF,alphaMode:Ke.NO_PREMULTIPLIED_ALPHA,resolution:Ci(i),...t.data},l=o.map(c=>{o===n&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new Lt(u,h);return d.ktxKeyValueData=a,Il(d,e,i)});return l.length===1?l[0]:l},unload(i){Array.isArray(i)?i.forEach(t=>t.destroy(!0)):i.destroy(!0)}};St.add(f2);const m2=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],p2={extension:gt.ResolveParser,test:i=>{const t=ye.extname(i).slice(1);return["basis","ktx","dds"].includes(t)},parse:i=>{var s,r;const t=i.split("."),e=t.pop();if(["ktx","dds"].includes(e)){const n=t.pop();if(m2.includes(n))return{resolution:parseFloat(((s=_t.RETINA_PREFIX.exec(i))==null?void 0:s[1])??"1"),format:n,src:i}}return{resolution:parseFloat(((r=_t.RETINA_PREFIX.exec(i))==null?void 0:r[1])??"1"),format:e,src:i}}};St.add(p2);const lh=new Ut,g2=4,g1=class Eo{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,s,r){const n=new Image;return n.src=await this.base64(t,e,s,r),n}async base64(t,e,s,r){const n=this.canvas(t,r);if(n.toBlob!==void 0)return new Promise((a,o)=>{n.toBlob(h=>{if(!h){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>a(l.result),l.onerror=o,l.readAsDataURL(h)},e,s)});if(n.toDataURL!==void 0)return n.toDataURL(e,s);if(n.convertToBlob!==void 0){const a=await n.convertToBlob({type:e,quality:s});return new Promise((o,h)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=h,l.readAsDataURL(a)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:s,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);a&&Eo._flipY(s,r,n),o&&Eo._unpremultiplyAlpha(s);const h=new KI(r,n,1),l=new ImageData(new Uint8ClampedArray(s.buffer),r,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:s,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);return a&&Eo._flipY(s,r,n),o&&Eo._unpremultiplyAlpha(s),s}_rawPixels(t,e){const s=this.renderer;if(!s)throw new Error("The Extract has already been destroyed");let r,n=!1,a=!1,o,h=!1;t&&(t instanceof Zn?o=t:(o=s.generateTexture(t,{region:e,resolution:s.resolution,multisample:s.multisample}),h=!0,e&&(lh.width=e.width,lh.height=e.height,e=lh)));const l=s.gl;if(o){if(r=o.baseTexture.resolution,e=e??o.frame,n=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===ft.RGBA,!h){s.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[s.CONTEXT_UID];f.blitFramebuffer&&s.framebuffer.bind(f.blitFramebuffer)}}else r=s.resolution,e||(e=lh,e.width=s.width/r,e.height=s.height/r),n=!0,a=this._rendererPremultipliedAlpha,s.renderTexture.bind();const c=Math.max(Math.round(e.width*r),1),u=Math.max(Math.round(e.height*r),1),d=new Uint8Array(g2*c*u);return l.readPixels(Math.round(e.x*r),Math.round(e.y*r),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(o==null||o.destroy(!0)),{pixels:d,width:c,height:u,flipY:n,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,s){const r=e<<2,n=s>>1,a=new Uint8Array(r);for(let o=0;o<n;o++){const h=o*r,l=(s-o-1)*r;a.set(t.subarray(h,h+r)),t.copyWithin(h,l,l+r),t.set(a,l)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let s=0;s<e;s+=4){const r=t[s+3];if(r!==0){const n=255.001/r;t[s]=t[s]*n+.5,t[s+1]=t[s+1]*n+.5,t[s+2]=t[s+2]*n+.5}}}};g1.extension={name:"extract",type:gt.RendererSystem};let y2=g1;St.add(y2);const ec={build(i){const t=i.points;let e,s,r,n,a,o;if(i.type===ts.CIRC){const m=i.shape;e=m.x,s=m.y,a=o=m.radius,r=n=0}else if(i.type===ts.ELIP){const m=i.shape;e=m.x,s=m.y,a=m.width,o=m.height,r=n=0}else{const m=i.shape,p=m.width/2,g=m.height/2;e=m.x+p,s=m.y+g,a=o=Math.max(0,Math.min(m.radius,Math.min(p,g))),r=p-a,n=g-o}if(!(a>=0&&o>=0&&r>=0&&n>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(a+o)),l=h*8+(r?4:0)+(n?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+r,t[1]=t[3]=s+n,t[2]=t[4]=e-r,t[5]=t[7]=s-n;return}let c=0,u=h*4+(r?2:0)+2,d=u,f=l;{const m=r+a,p=n,g=e+m,y=e-m,_=s+p;if(t[c++]=g,t[c++]=_,t[--u]=_,t[--u]=y,n){const v=s-p;t[d++]=y,t[d++]=v,t[--f]=v,t[--f]=g}}for(let m=1;m<h;m++){const p=Math.PI/2*(m/h),g=r+Math.cos(p)*a,y=n+Math.sin(p)*o,_=e+g,v=e-g,b=s+y,T=s-y;t[c++]=_,t[c++]=b,t[--u]=b,t[--u]=v,t[d++]=v,t[d++]=T,t[--f]=T,t[--f]=_}{const m=r,p=n+o,g=e+m,y=e-m,_=s+p,v=s-p;t[c++]=g,t[c++]=_,t[--f]=v,t[--f]=g,r&&(t[c++]=y,t[c++]=_,t[--f]=v,t[--f]=y)}},triangulate(i,t){const e=i.points,s=t.points,r=t.indices;if(e.length===0)return;let n=s.length/2;const a=n;let o,h;if(i.type!==ts.RREC){const c=i.shape;o=c.x,h=c.y}else{const c=i.shape;o=c.x+c.width/2,h=c.y+c.height/2}const l=i.matrix;s.push(i.matrix?l.a*o+l.c*h+l.tx:o,i.matrix?l.b*o+l.d*h+l.ty:h),n++,s.push(e[0],e[1]);for(let c=2;c<e.length;c+=2)s.push(e[c],e[c+1]),r.push(n++,a,n);r.push(a+1,a,n)}};function Dx(i,t=!1){const e=i.length;if(e<6)return;let s=0;for(let r=0,n=i[e-2],a=i[e-1];r<e;r+=2){const o=i[r],h=i[r+1];s+=(o-n)*(h+a),n=o,a=h}if(!t&&s>0||t&&s<=0){const r=e/2;for(let n=r+r%2;n<e;n+=2){const a=e-n-2,o=e-n-1,h=n,l=n+1;[i[a],i[h]]=[i[h],i[a]],[i[o],i[l]]=[i[l],i[o]]}}}const y1={build(i){i.points=i.shape.points.slice()},triangulate(i,t){let e=i.points;const s=i.holes,r=t.points,n=t.indices;if(e.length>=6){Dx(e,!1);const a=[];for(let l=0;l<s.length;l++){const c=s[l];Dx(c.points,!0),a.push(e.length/2),e=e.concat(c.points)}const o=KC(e,a,2);if(!o)return;const h=r.length/2;for(let l=0;l<o.length;l+=3)n.push(o[l]+h),n.push(o[l+1]+h),n.push(o[l+2]+h);for(let l=0;l<e.length;l++)r.push(e[l])}}},x2={build(i){const t=i.shape,e=t.x,s=t.y,r=t.width,n=t.height,a=i.points;a.length=0,r>=0&&n>=0&&a.push(e,s,e+r,s,e+r,s+n,e,s+n)},triangulate(i,t){const e=i.points,s=t.points;if(e.length===0)return;const r=s.length/2;s.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(r,r+1,r+2,r+1,r+2,r+3)}},b2={build(i){ec.build(i)},triangulate(i,t){ec.triangulate(i,t)}};var Hs=(i=>(i.MITER="miter",i.BEVEL="bevel",i.ROUND="round",i))(Hs||{}),Ji=(i=>(i.BUTT="butt",i.ROUND="round",i.SQUARE="square",i))(Ji||{});const Ga={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(i,t=20){if(!this.adaptive||!i||isNaN(i))return t;let e=Math.ceil(i/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class Nx{static curveTo(t,e,s,r,n,a){const o=a[a.length-2],h=a[a.length-1]-e,l=o-t,c=r-e,u=s-t,d=Math.abs(h*u-l*c);if(d<1e-8||n===0)return(a[a.length-2]!==t||a[a.length-1]!==e)&&a.push(t,e),null;const f=h*h+l*l,m=c*c+u*u,p=h*c+l*u,g=n*Math.sqrt(f)/d,y=n*Math.sqrt(m)/d,_=g*p/f,v=y*p/m,b=g*u+y*l,T=g*c+y*h,S=l*(y+_),w=h*(y+_),E=u*(g+v),A=c*(g+v),P=Math.atan2(w-T,S-b),I=Math.atan2(A-T,E-b);return{cx:b+t,cy:T+e,radius:n,startAngle:P,endAngle:I,anticlockwise:l*c>u*h}}static arc(t,e,s,r,n,a,o,h,l){const c=o-a,u=Ga._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/zh)*40),d=c/(u*2),f=d*2,m=Math.cos(d),p=Math.sin(d),g=u-1,y=g%1/g;for(let _=0;_<=g;++_){const v=_+y*_,b=d+a+f*v,T=Math.cos(b),S=-Math.sin(b);l.push((m*T+p*S)*n+s,(m*-S+p*T)*n+r)}}}class v2{constructor(){this.reset()}begin(t,e,s){this.reset(),this.style=t,this.start=e,this.attribStart=s}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Yp{static curveLength(t,e,s,r,n,a,o,h){let l=0,c=0,u=0,d=0,f=0,m=0,p=0,g=0,y=0,_=0,v=0,b=t,T=e;for(let S=1;S<=10;++S)c=S/10,u=c*c,d=u*c,f=1-c,m=f*f,p=m*f,g=p*t+3*m*c*s+3*f*u*n+d*o,y=p*e+3*m*c*r+3*f*u*a+d*h,_=b-g,v=T-y,b=g,T=y,l+=Math.sqrt(_*_+v*v);return l}static curveTo(t,e,s,r,n,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const c=Ga._segmentsCount(Yp.curveLength(h,l,t,e,s,r,n,a));let u=0,d=0,f=0,m=0,p=0;o.push(h,l);for(let g=1,y=0;g<=c;++g)y=g/c,u=1-y,d=u*u,f=d*u,m=y*y,p=m*y,o.push(f*h+3*d*y*t+3*u*m*s+p*n,f*l+3*d*y*e+3*u*m*r+p*a)}}function Ux(i,t,e,s,r,n,a,o){const h=i-e*r,l=t-s*r,c=i+e*n,u=t+s*n;let d,f;a?(d=s,f=-e):(d=-s,f=e);const m=h+d,p=l+f,g=c+d,y=u+f;return o.push(m,p,g,y),2}function _n(i,t,e,s,r,n,a,o){const h=e-i,l=s-t;let c=Math.atan2(h,l),u=Math.atan2(r-i,n-t);o&&c<u?c+=Math.PI*2:!o&&c>u&&(u+=Math.PI*2);let d=c;const f=u-c,m=Math.abs(f),p=Math.sqrt(h*h+l*l),g=(15*m*Math.sqrt(p)/Math.PI>>0)+1,y=f/g;if(d+=y,o){a.push(i,t,e,s);for(let _=1,v=d;_<g;_++,v+=y)a.push(i,t,i+Math.sin(v)*p,t+Math.cos(v)*p);a.push(i,t,r,n)}else{a.push(e,s,i,t);for(let _=1,v=d;_<g;_++,v+=y)a.push(i+Math.sin(v)*p,t+Math.cos(v)*p,i,t);a.push(r,n,i,t)}return g*2}function _2(i,t){const e=i.shape;let s=i.points||e.points.slice();const r=t.closePointEps;if(s.length===0)return;const n=i.lineStyle,a=new Kt(s[0],s[1]),o=new Kt(s[s.length-2],s[s.length-1]),h=e.type!==ts.POLY||e.closeStroke,l=Math.abs(a.x-o.x)<r&&Math.abs(a.y-o.y)<r;if(h){s=s.slice(),l&&(s.pop(),s.pop(),o.set(s[s.length-2],s[s.length-1]));const O=(a.x+o.x)*.5,k=(o.y+a.y)*.5;s.unshift(O,k),s.push(O,k)}const c=t.points,u=s.length/2;let d=s.length;const f=c.length/2,m=n.width/2,p=m*m,g=n.miterLimit*n.miterLimit;let y=s[0],_=s[1],v=s[2],b=s[3],T=0,S=0,w=-(_-b),E=y-v,A=0,P=0,I=Math.sqrt(w*w+E*E);w/=I,E/=I,w*=m,E*=m;const C=n.alignment,R=(1-C)*2,F=C*2;h||(n.cap===Ji.ROUND?d+=_n(y-w*(R-F)*.5,_-E*(R-F)*.5,y-w*R,_-E*R,y+w*F,_+E*F,c,!0)+2:n.cap===Ji.SQUARE&&(d+=Ux(y,_,w,E,R,F,!0,c))),c.push(y-w*R,_-E*R,y+w*F,_+E*F);for(let O=1;O<u-1;++O){y=s[(O-1)*2],_=s[(O-1)*2+1],v=s[O*2],b=s[O*2+1],T=s[(O+1)*2],S=s[(O+1)*2+1],w=-(_-b),E=y-v,I=Math.sqrt(w*w+E*E),w/=I,E/=I,w*=m,E*=m,A=-(b-S),P=v-T,I=Math.sqrt(A*A+P*P),A/=I,P/=I,A*=m,P*=m;const k=v-y,N=_-b,B=v-T,L=S-b,G=k*B+N*L,V=N*B-L*k,q=V<0;if(Math.abs(V)<.001*Math.abs(G)){c.push(v-w*R,b-E*R,v+w*F,b+E*F),G>=0&&(n.join===Hs.ROUND?d+=_n(v,b,v-w*R,b-E*R,v-A*R,b-P*R,c,!1)+4:d+=2,c.push(v-A*F,b-P*F,v+A*R,b+P*R));continue}const H=(-w+y)*(-E+b)-(-w+v)*(-E+_),at=(-A+T)*(-P+b)-(-A+v)*(-P+S),et=(k*at-B*H)/V,ot=(L*H-N*at)/V,ct=(et-v)*(et-v)+(ot-b)*(ot-b),rt=v+(et-v)*R,dt=b+(ot-b)*R,X=v-(et-v)*F,$=b-(ot-b)*F,K=Math.min(k*k+N*N,B*B+L*L),J=q?R:F,Q=K+J*J*p,it=ct<=Q;let U=n.join;if(U===Hs.MITER&&ct/p>g&&(U=Hs.BEVEL),it)switch(U){case Hs.MITER:{c.push(rt,dt,X,$);break}case Hs.BEVEL:{q?c.push(rt,dt,v+w*F,b+E*F,rt,dt,v+A*F,b+P*F):c.push(v-w*R,b-E*R,X,$,v-A*R,b-P*R,X,$),d+=2;break}case Hs.ROUND:{q?(c.push(rt,dt,v+w*F,b+E*F),d+=_n(v,b,v+w*F,b+E*F,v+A*F,b+P*F,c,!0)+4,c.push(rt,dt,v+A*F,b+P*F)):(c.push(v-w*R,b-E*R,X,$),d+=_n(v,b,v-w*R,b-E*R,v-A*R,b-P*R,c,!1)+4,c.push(v-A*R,b-P*R,X,$));break}}else{switch(c.push(v-w*R,b-E*R,v+w*F,b+E*F),U){case Hs.MITER:{q?c.push(X,$,X,$):c.push(rt,dt,rt,dt),d+=2;break}case Hs.ROUND:{q?d+=_n(v,b,v+w*F,b+E*F,v+A*F,b+P*F,c,!0)+2:d+=_n(v,b,v-w*R,b-E*R,v-A*R,b-P*R,c,!1)+2;break}}c.push(v-A*R,b-P*R,v+A*F,b+P*F),d+=2}}y=s[(u-2)*2],_=s[(u-2)*2+1],v=s[(u-1)*2],b=s[(u-1)*2+1],w=-(_-b),E=y-v,I=Math.sqrt(w*w+E*E),w/=I,E/=I,w*=m,E*=m,c.push(v-w*R,b-E*R,v+w*F,b+E*F),h||(n.cap===Ji.ROUND?d+=_n(v-w*(R-F)*.5,b-E*(R-F)*.5,v-w*R,b-E*R,v+w*F,b+E*F,c,!1)+2:n.cap===Ji.SQUARE&&(d+=Ux(v,b,w,E,R,F,!1,c)));const D=t.indices,M=Ga.epsilon*Ga.epsilon;for(let O=f;O<d+f-2;++O)y=c[O*2],_=c[O*2+1],v=c[(O+1)*2],b=c[(O+1)*2+1],T=c[(O+2)*2],S=c[(O+2)*2+1],!(Math.abs(y*(b-S)+v*(S-_)+T*(_-b))<M)&&D.push(O,O+1,O+2)}function w2(i,t){let e=0;const s=i.shape,r=i.points||s.points,n=s.type!==ts.POLY||s.closeStroke;if(r.length===0)return;const a=t.points,o=t.indices,h=r.length/2,l=a.length/2;let c=l;for(a.push(r[0],r[1]),e=1;e<h;e++)a.push(r[e*2],r[e*2+1]),o.push(c,c+1),c++;n&&o.push(c,l)}function Xx(i,t){i.lineStyle.native?w2(i,t):_2(i,t)}class Gp{static curveLength(t,e,s,r,n,a){const o=t-2*s+n,h=e-2*r+a,l=2*s-2*t,c=2*r-2*e,u=4*(o*o+h*h),d=4*(o*l+h*c),f=l*l+c*c,m=2*Math.sqrt(u+d+f),p=Math.sqrt(u),g=2*u*p,y=2*Math.sqrt(f),_=d/p;return(g*m+p*d*(m-y)+(4*f*u-d*d)*Math.log((2*p+_+m)/(_+y)))/(4*g)}static curveTo(t,e,s,r,n){const a=n[n.length-2],o=n[n.length-1],h=Ga._segmentsCount(Gp.curveLength(a,o,t,e,s,r));let l=0,c=0;for(let u=1;u<=h;++u){const d=u/h;l=a+(t-a)*d,c=o+(e-o)*d,n.push(l+(t+(s-t)*d-l)*d,c+(e+(r-e)*d-c)*d)}}}const If={[ts.POLY]:y1,[ts.CIRC]:ec,[ts.ELIP]:ec,[ts.RECT]:x2,[ts.RREC]:b2},Vx=[],hh=[];class sc{constructor(t,e=null,s=null,r=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=s,this.fillStyle=e,this.matrix=r,this.type=t.type}clone(){return new sc(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const la=new Kt,x1=class b1 extends E_{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new Ya,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),hh.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),Vx.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,s=null,r=null){const n=new sc(t,e,s,r);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const s=new sc(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=r.lineStyle,r.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let s=0;s<e.length;++s){const r=e[s];if(r.fillStyle.visible&&r.shape&&(r.matrix?r.matrix.applyInverse(t,la):la.copyFrom(t),r.shape.contains(la.x,la.y))){let n=!1;if(r.holes){for(let a=0;a<r.holes.length;a++)if(r.holes[a].shape.contains(la.x,la.y)){n=!0;break}}if(!n)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let s=null,r=null;this.batches.length>0&&(s=this.batches[this.batches.length-1],r=s.style);for(let h=this.shapeIndex;h<e.length;h++){this.shapeIndex++;const l=e[h],c=l.fillStyle,u=l.lineStyle;If[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(c.visible||u.visible)&&this.processHoles(l.holes);for(let d=0;d<2;d++){const f=d===0?c:u;if(!f.visible)continue;const m=f.texture.baseTexture,p=this.indices.length,g=this.points.length/2;m.wrapMode=Ps.REPEAT,d===0?this.processFill(l):this.processLine(l);const y=this.points.length/2-g;y!==0&&(s&&!this._compareStyles(r,f)&&(s.end(p,g),s=null),s||(s=Vx.pop()||new v2,s.begin(f,p,g),this.batches.push(s),r=f),this.addUvs(this.points,t,f.texture,g,y,f.matrix))}}const n=this.indices.length,a=this.points.length/2;if(s&&s.end(n,a),this.batches.length===0){this.batchable=!0;return}const o=a>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const s=this.graphicsData[t],r=s.fillStyle,n=s.lineStyle;if(r&&!r.texture.baseTexture.valid||n&&!n.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,s=t.length;e<s;e++){const r=t[e];for(let n=0;n<r.size;n++){const a=r.start+n;this.indicesUint16[a]=this.indicesUint16[a]-r.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<b1.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++Lt._globalBatch;for(let u=0;u<this.drawCalls.length;u++)this.drawCalls[u].texArray.clear(),hh.push(this.drawCalls[u]);this.drawCalls.length=0;const e=this.colors,s=this.textureIds;let r=hh.pop();r||(r=new _m,r.texArray=new Em),r.texArray.count=0,r.start=0,r.size=0,r.type=Yr.TRIANGLES;let n=0,a=null,o=0,h=!1,l=Yr.TRIANGLES,c=0;this.drawCalls.push(r);for(let u=0;u<this.batches.length;u++){const d=this.batches[u],f=8,m=d.style,p=m.texture.baseTexture;h!==!!m.native&&(h=!!m.native,l=h?Yr.LINES:Yr.TRIANGLES,a=null,n=f,t++),a!==p&&(a=p,p._batchEnabled!==t&&(n===f&&(t++,n=0,r.size>0&&(r=hh.pop(),r||(r=new _m,r.texArray=new Em),this.drawCalls.push(r)),r.start=c,r.size=0,r.texArray.count=0,r.type=l),p.touched=1,p._batchEnabled=t,p._batchLocation=n,p.wrapMode=Ps.REPEAT,r.texArray.elements[r.texArray.count++]=p,n++)),r.size+=d.size,c+=d.size,o=p._batchLocation,this.addColors(e,m.color,m.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,o,d.attribSize,d.attribStart)}Lt._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,s=this.colors,r=this.textureIds,n=new ArrayBuffer(t.length*3*4),a=new Float32Array(n),o=new Uint32Array(n);let h=0;for(let l=0;l<t.length/2;l++)a[h++]=t[l*2],a[h++]=t[l*2+1],a[h++]=e[l*2],a[h++]=e[l*2+1],o[h++]=s[l],a[h++]=r[l];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?y1.triangulate(t,this):If[t.type].triangulate(t,this)}processLine(t){Xx(t,this);for(let e=0;e<t.holes.length;e++)Xx(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const s=t[e];If[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let s=0;s<t.length/2;s++){const r=t[s*2],n=t[s*2+1];t[s*2]=e.a*r+e.c*n+e.tx,t[s*2+1]=e.b*r+e.d*n+e.ty}}addColors(t,e,s,r,n=0){const a=Wt.shared.setValue(e).toLittleEndianNumber(),o=Wt.shared.setValue(a).toPremultiplied(s);t.length=Math.max(t.length,n+r);for(let h=0;h<r;h++)t[n+h]=o}addTextureIds(t,e,s,r=0){t.length=Math.max(t.length,r+s);for(let n=0;n<s;n++)t[r+n]=e}addUvs(t,e,s,r,n,a=null){let o=0;const h=e.length,l=s.frame;for(;o<n;){let u=t[(r+o)*2],d=t[(r+o)*2+1];if(a){const f=a.a*u+a.c*d+a.tx;d=a.b*u+a.d*d+a.ty,u=f}o++,e.push(u/l.width,d/l.height)}const c=s.baseTexture;(l.width<c.width||l.height<c.height)&&this.adjustUvs(e,s,h,n)}adjustUvs(t,e,s,r){const n=e.baseTexture,a=1e-6,o=s+r*2,h=e.frame,l=h.width/n.width,c=h.height/n.height;let u=h.x/h.width,d=h.y/h.height,f=Math.floor(t[s]+a),m=Math.floor(t[s+1]+a);for(let p=s+2;p<o;p+=2)f=Math.min(f,Math.floor(t[p]+a)),m=Math.min(m,Math.floor(t[p+1]+a));u-=f,d-=m;for(let p=s;p<o;p+=2)t[p]=(t[p]+u)*l,t[p+1]=(t[p+1]+d)*c}};x1.BATCHABLE_SIZE=100;let T2=x1;class Kc{constructor(){this.color=16777215,this.alpha=1,this.texture=Nt.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new Kc;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=Nt.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class $p extends Kc{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Ji.BUTT,this.join=Hs.MITER,this.miterLimit=10}clone(){const t=new $p;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=Ji.BUTT,this.join=Hs.MITER,this.miterLimit=10}}const Pf={},Gm=class Ah extends fs{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new Kc,this._lineStyle=new $p,this._matrix=null,this._holeMode=!1,this.state=jr.for2d(),this._geometry=t||new T2,this._geometry.refCount++,this._transformID=-1,this._tintColor=new Wt(16777215),this.blendMode=It.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new Ah(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,s,r=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:s,alignment:r,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:Nt.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Ji.BUTT,join:Hs.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const s=t.width>0&&t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:s},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new Un,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Un,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const s=this.currentPath.points,r=s[s.length-2],n=s[s.length-1];return(r!==t||n!==e)&&s.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,s,r){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),Gp.curveTo(t,e,s,r,n),this}bezierCurveTo(t,e,s,r,n,a){return this._initCurve(),Yp.curveTo(t,e,s,r,n,a,this.currentPath.points),this}arcTo(t,e,s,r,n){this._initCurve(t,e);const a=this.currentPath.points,o=Nx.curveTo(t,e,s,r,n,a);if(o){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=o;this.arc(h,l,c,u,d,f)}return this}arc(t,e,s,r,n,a=!1){if(r===n)return this;if(!a&&n<=r?n+=zh:a&&r<=n&&(r+=zh),n-r===0)return this;const o=t+Math.cos(r)*s,h=e+Math.sin(r)*s,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-o),d=Math.abs(c[c.length-1]-h);u<l&&d<l||c.push(o,h)}else this.moveTo(o,h),c=this.currentPath.points;return Nx.arc(o,h,t,e,s,r,n,a,c),this}beginFill(t=0,e){return this.beginTextureFill({texture:Nt.WHITE,color:t,alpha:e})}normalizeColor(t){const e=Wt.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:Nt.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const s=t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:s},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,s,r){return this.drawShape(new Ut(t,e,s,r))}drawRoundedRect(t,e,s,r,n){return this.drawShape(new Wc(t,e,s,r,n))}drawCircle(t,e,s){return this.drawShape(new $c(t,e,s))}drawEllipse(t,e,s,r){return this.drawShape(new Hc(t,e,s,r))}drawPolygon(...t){let e,s=!0;const r=t[0];r.points?(s=r.closeStroke,e=r.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new Un(e);return n.closeStroke=s,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===ts.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,s=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(t.points);for(let r=0;r<s;r++){const n=t.batches[r],a=n.style.color,o=new Float32Array(this.vertexData.buffer,n.attribStart*4*2,n.attribSize*2),h=new Float32Array(t.uvsFloat32.buffer,n.attribStart*4*2,n.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,n.start*2,n.size),c={vertexData:o,blendMode:e,indices:l,uvs:h,_batchRGB:Wt.shared.setValue(a).toRgbArray(),_tintRGB:a,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[r]=c}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,s=this.batches.length;e<s;e++){const r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}}_renderDirect(t){const e=this._resolveDirectShader(t),s=this._geometry,r=this.worldAlpha,n=e.uniforms,a=s.drawCalls;n.translationMatrix=this.transform.worldTransform,Wt.shared.setValue(this._tintColor).premultiply(r).toArray(n.tint),t.shader.bind(e),t.geometry.bind(s,e),t.state.set(this.state);for(let o=0,h=a.length;o<h;o++)this._renderDrawCallDirect(t,s.drawCalls[o])}_renderDrawCallDirect(t,e){const{texArray:s,type:r,size:n,start:a}=e,o=s.count;for(let h=0;h<o;h++)t.texture.bind(s.elements[h],h);t.geometry.draw(r,n,a)}_resolveDirectShader(t){let e=this.shader;const s=this.pluginName;if(!e){if(!Pf[s]){const{maxTextures:r}=t.plugins[s],n=new Int32Array(r);for(let h=0;h<r;h++)n[h]=h;const a={tint:new Float32Array([1,1,1,1]),translationMatrix:new fe,default:yr.from({uSamplers:n},!0)},o=t.plugins[s]._shader.program;Pf[s]=new Js(o,a)}e=Pf[s]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:s,maxX:r,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,s,r,n)}containsPoint(t){return this.worldTransform.applyInverse(t,Ah._TEMP_POINT),this._geometry.containsPoint(Ah._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=Wt.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,s=e.a,r=e.b,n=e.c,a=e.d,o=e.tx,h=e.ty,l=this._geometry.points,c=this.vertexData;let u=0;for(let d=0;d<l.length;d+=2){const f=l[d],m=l[d+1];c[u++]=s*f+n*m+o,c[u++]=a*m+r*f+h}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};Gm.curves=Ga,Gm._TEMP_POINT=new Kt;let gs=Gm;class S2{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}}const Mf=new Kt,Yx=new Un,v1=class _1 extends fs{constructor(t,e,s,r=Yr.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=s||jr.for2d(),this.drawMode=r,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=_t.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(t){const e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===Yr.TRIANGLES&&e.length<_1.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)}_renderDefault(t){const e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(t){const e=this.geometry,s=this.shader;s.uvMatrix&&(s.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=s._tintRGB,this._texture=s.texture;const r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,s=t._updateID;if(s===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const r=this.transform.worldTransform,n=r.a,a=r.b,o=r.c,h=r.d,l=r.tx,c=r.ty,u=this.vertexData;for(let d=0;d<u.length/2;d++){const f=e[d*2],m=e[d*2+1];u[d*2]=n*f+o*m+l,u[d*2+1]=a*f+h*m+c}if(this._roundPixels){const d=_t.RESOLUTION;for(let f=0;f<u.length;++f)u[f]=Math.round(u[f]*d)/d}this.vertexDirty=s}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new S2(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,Mf);const e=this.geometry.getBuffer("aVertexPosition").data,s=Yx.points,r=this.geometry.getIndex().data,n=r.length,a=this.drawMode===4?3:1;for(let o=0;o+2<n;o+=a){const h=r[o]*2,l=r[o+1]*2,c=r[o+2]*2;if(s[0]=e[h],s[1]=e[h+1],s[2]=e[l],s[3]=e[l+1],s[4]=e[c],s[5]=e[c+1],Yx.contains(Mf.x,Mf.y))return!0}return!1}destroy(t){super.destroy(t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};v1.BATCHABLE_SIZE=100;let zn=v1;class Zc extends er{constructor(t,e,s){super();const r=new ne(t),n=new ne(e,!0),a=new ne(s,!0,!0);this.addAttribute("aVertexPosition",r,2,!1,wt.FLOAT).addAttribute("aTextureCoord",n,2,!1,wt.FLOAT).addIndex(a),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var E2=`varying vec2 vTextureCoord;
|
||
uniform vec4 uColor;
|
||
|
||
uniform sampler2D uSampler;
|
||
|
||
void main(void)
|
||
{
|
||
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
|
||
}
|
||
`,A2=`attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform mat3 uTextureMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
|
||
}
|
||
`;class rl extends Js{constructor(t,e){const s={uSampler:t,alpha:1,uTextureMatrix:fe.IDENTITY,uColor:new Float32Array([1,1,1,1])};e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e),e.uniforms&&Object.assign(s,e.uniforms),super(e.program||ur.from(A2,E2),s),this._colorDirty=!1,this.uvMatrix=new jc(t),this.batchable=e.program===void 0,this.pluginName=e.pluginName,this._tintColor=new Wt(e.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=e.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const t=this.texture.baseTexture.alphaMode;Wt.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class NL extends zn{constructor(t=Nt.EMPTY,e,s,r,n){const a=new Zc(e,s,r);a.getBuffer("aVertexPosition").static=!1;const o=new rl(t);super(a,o,null,n),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class Gx{constructor(t,e,s){this.geometry=new er,this.indexBuffer=null,this.size=s,this.dynamicProperties=[],this.staticProperties=[];for(let r=0;r<t.length;++r){let n=t[r];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||wt.FLOAT,offset:n.offset},e[r]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const t=this.geometry;let e=0;this.indexBuffer=new ne(jI(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let a=0;a<this.dynamicProperties.length;++a){const o=this.dynamicProperties[a];o.offset=e,e+=o.size,this.dynamicStride+=o.size}const s=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(s),this.dynamicDataUint32=new Uint32Array(s),this.dynamicBuffer=new ne(this.dynamicData,!1,!1);let r=0;this.staticStride=0;for(let a=0;a<this.staticProperties.length;++a){const o=this.staticProperties[a];o.offset=r,r+=o.size,this.staticStride+=o.size}const n=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(n),this.staticDataUint32=new Uint32Array(n),this.staticBuffer=new ne(this.staticData,!0,!1);for(let a=0;a<this.dynamicProperties.length;++a){const o=this.dynamicProperties[a];t.addAttribute(o.attributeName,this.dynamicBuffer,0,o.type===wt.UNSIGNED_BYTE,o.type,this.dynamicStride*4,o.offset*4)}for(let a=0;a<this.staticProperties.length;++a){const o=this.staticProperties[a];t.addAttribute(o.attributeName,this.staticBuffer,0,o.type===wt.UNSIGNED_BYTE,o.type,this.staticStride*4,o.offset*4)}}uploadDynamic(t,e,s){for(let r=0;r<this.dynamicProperties.length;r++){const n=this.dynamicProperties[r];n.uploadFunction(t,e,s,n.type===wt.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,s){for(let r=0;r<this.staticProperties.length;r++){const n=this.staticProperties[r];n.uploadFunction(t,e,s,n.type===wt.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}var C2=`varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
|
||
uniform sampler2D uSampler;
|
||
|
||
void main(void){
|
||
vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
|
||
gl_FragColor = color;
|
||
}`,I2=`attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
attribute vec4 aColor;
|
||
|
||
attribute vec2 aPositionCoord;
|
||
attribute float aRotation;
|
||
|
||
uniform mat3 translationMatrix;
|
||
uniform vec4 uColor;
|
||
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
|
||
void main(void){
|
||
float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
|
||
float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
|
||
|
||
vec2 v = vec2(x, y);
|
||
v = v + aPositionCoord;
|
||
|
||
gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = aTextureCoord;
|
||
vColor = aColor * uColor;
|
||
}
|
||
`;class w1 extends zc{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new fe,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:wt.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=Js.from(I2,C2,{}),this.state=jr.for2d()}render(t){const e=t.children,s=t._maxSize,r=t._batchSize,n=this.renderer;let a=e.length;if(a===0)return;a>s&&!t.autoResize&&(a=s);let o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=w_(t.blendMode,l),n.state.set(this.state);const c=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Wt.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,m=0;f<a;f+=r,m+=1){let p=a-f;p>r&&(p=r),m>=o.length&&o.push(this._generateOneMoreBuffer(t));const g=o[m];g.uploadDynamic(e,f,p);const y=t._bufferUpdateIDs[m]||0;d=d||g._updateID<y,d&&(g._updateID=t._updateID,g.uploadStatic(e,f,p)),n.geometry.bind(g.geometry),c.drawElements(c.TRIANGLES,p*6,c.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],s=t._maxSize,r=t._batchSize,n=t._properties;for(let a=0;a<s;a+=r)e.push(new Gx(this.properties,n,r));return e}_generateOneMoreBuffer(t){const e=t._batchSize,s=t._properties;return new Gx(this.properties,s,e)}uploadVertices(t,e,s,r,n,a){let o=0,h=0,l=0,c=0;for(let u=0;u<s;++u){const d=t[e+u],f=d._texture,m=d.scale.x,p=d.scale.y,g=f.trim,y=f.orig;g?(h=g.x-d.anchor.x*y.width,o=h+g.width,c=g.y-d.anchor.y*y.height,l=c+g.height):(o=y.width*(1-d.anchor.x),h=y.width*-d.anchor.x,l=y.height*(1-d.anchor.y),c=y.height*-d.anchor.y),r[a]=h*m,r[a+1]=c*p,r[a+n]=o*m,r[a+n+1]=c*p,r[a+n*2]=o*m,r[a+n*2+1]=l*p,r[a+n*3]=h*m,r[a+n*3+1]=l*p,a+=n*4}}uploadPosition(t,e,s,r,n,a){for(let o=0;o<s;o++){const h=t[e+o].position;r[a]=h.x,r[a+1]=h.y,r[a+n]=h.x,r[a+n+1]=h.y,r[a+n*2]=h.x,r[a+n*2+1]=h.y,r[a+n*3]=h.x,r[a+n*3+1]=h.y,a+=n*4}}uploadRotation(t,e,s,r,n,a){for(let o=0;o<s;o++){const h=t[e+o].rotation;r[a]=h,r[a+n]=h,r[a+n*2]=h,r[a+n*3]=h,a+=n*4}}uploadUvs(t,e,s,r,n,a){for(let o=0;o<s;++o){const h=t[e+o]._texture._uvs;h?(r[a]=h.x0,r[a+1]=h.y0,r[a+n]=h.x1,r[a+n+1]=h.y1,r[a+n*2]=h.x2,r[a+n*2+1]=h.y2,r[a+n*3]=h.x3,r[a+n*3+1]=h.y3,a+=n*4):(r[a]=0,r[a+1]=0,r[a+n]=0,r[a+n+1]=0,r[a+n*2]=0,r[a+n*2+1]=0,r[a+n*3]=0,r[a+n*3+1]=0,a+=n*4)}}uploadTint(t,e,s,r,n,a){for(let o=0;o<s;++o){const h=t[e+o],l=Wt.shared.setValue(h._tintRGB).toPremultiplied(h.alpha,h.texture.baseTexture.alphaMode>0);r[a]=l,r[a+n]=l,r[a+n*2]=l,r[a+n*3]=l,a+=n*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}w1.extension={name:"particle",type:gt.RendererPlugin};St.add(w1);var Jc=(i=>(i[i.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",i[i.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",i))(Jc||{});const ch={willReadFrequently:!0},Pr=class Ct{static get experimentalLetterSpacingSupported(){let t=Ct._experimentalLetterSpacingSupported;if(t!==void 0){const e=_t.ADAPTER.getCanvasRenderingContext2D().prototype;t=Ct._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,s,r,n,a,o,h,l){this.text=t,this.style=e,this.width=s,this.height=r,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=l}static measureText(t,e,s,r=Ct._canvas){s=s??e.wordWrap;const n=e.toFontString(),a=Ct.measureFont(n);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);const o=r.getContext("2d",ch);o.font=n;const h=(s?Ct.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let m=0;m<h.length;m++){const p=Ct._measureText(h[m],e.letterSpacing,o);l[m]=p,c=Math.max(c,p)}let u=c+e.strokeThickness;e.dropShadow&&(u+=e.dropShadowDistance);const d=e.lineHeight||a.fontSize+e.strokeThickness;let f=Math.max(d,a.fontSize+e.strokeThickness*2)+e.leading+(h.length-1)*(d+e.leading);return e.dropShadow&&(f+=e.dropShadowDistance),new Ct(t,e,u,f,h,l,d+e.leading,c,a)}static _measureText(t,e,s){let r=!1;Ct.experimentalLetterSpacingSupported&&(Ct.experimentalLetterSpacing?(s.letterSpacing=`${e}px`,s.textLetterSpacing=`${e}px`,r=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));let n=s.measureText(t).width;return n>0&&(r?n-=e:n+=(Ct.graphemeSegmenter(t).length-1)*e),n}static wordWrap(t,e,s=Ct._canvas){const r=s.getContext("2d",ch);let n=0,a="",o="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,u=Ct.collapseSpaces(c),d=Ct.collapseNewlines(c);let f=!u;const m=e.wordWrapWidth+l,p=Ct.tokenize(t);for(let g=0;g<p.length;g++){let y=p[g];if(Ct.isNewline(y)){if(!d){o+=Ct.addLine(a),f=!u,a="",n=0;continue}y=" "}if(u){const v=Ct.isBreakingSpace(y),b=Ct.isBreakingSpace(a[a.length-1]);if(v&&b)continue}const _=Ct.getFromCache(y,l,h,r);if(_>m)if(a!==""&&(o+=Ct.addLine(a),a="",n=0),Ct.canBreakWords(y,e.breakWords)){const v=Ct.wordWrapSplit(y);for(let b=0;b<v.length;b++){let T=v[b],S=T,w=1;for(;v[b+w];){const A=v[b+w];if(!Ct.canBreakChars(S,A,y,b,e.breakWords))T+=A;else break;S=A,w++}b+=w-1;const E=Ct.getFromCache(T,l,h,r);E+n>m&&(o+=Ct.addLine(a),f=!1,a="",n=0),a+=T,n+=E}}else{a.length>0&&(o+=Ct.addLine(a),a="",n=0);const v=g===p.length-1;o+=Ct.addLine(y,!v),f=!1,a="",n=0}else _+n>m&&(f=!1,o+=Ct.addLine(a),a="",n=0),(a.length>0||!Ct.isBreakingSpace(y)||f)&&(a+=y,n+=_)}return o+=Ct.addLine(a,!1),o}static addLine(t,e=!0){return t=Ct.trimRight(t),t=e?`${t}
|
||
`:t,t}static getFromCache(t,e,s,r){let n=s[t];return typeof n!="number"&&(n=Ct._measureText(t,e,r)+e,s[t]=n),n}static collapseSpaces(t){return t==="normal"||t==="pre-line"}static collapseNewlines(t){return t==="normal"}static trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const s=t[e];if(!Ct.isBreakingSpace(s))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:Ct._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:Ct._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let s="";if(typeof t!="string")return e;for(let r=0;r<t.length;r++){const n=t[r],a=t[r+1];if(Ct.isBreakingSpace(n,a)||Ct.isNewline(n)){s!==""&&(e.push(s),s=""),e.push(n);continue}s+=n}return s!==""&&e.push(s),e}static canBreakWords(t,e){return e}static canBreakChars(t,e,s,r,n){return!0}static wordWrapSplit(t){return Ct.graphemeSegmenter(t)}static measureFont(t){if(Ct._fonts[t])return Ct._fonts[t];const e={ascent:0,descent:0,fontSize:0},s=Ct._canvas,r=Ct._context;r.font=t;const n=Ct.METRICS_STRING+Ct.BASELINE_SYMBOL,a=Math.ceil(r.measureText(n).width);let o=Math.ceil(r.measureText(Ct.BASELINE_SYMBOL).width);const h=Math.ceil(Ct.HEIGHT_MULTIPLIER*o);if(o=o*Ct.BASELINE_MULTIPLIER|0,a===0||h===0)return Ct._fonts[t]=e,e;s.width=a,s.height=h,r.fillStyle="#f00",r.fillRect(0,0,a,h),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(n,0,o);const l=r.getImageData(0,0,a,h).data,c=l.length,u=a*4;let d=0,f=0,m=!1;for(d=0;d<o;++d){for(let p=0;p<u;p+=4)if(l[f+p]!==255){m=!0;break}if(!m)f+=u;else break}for(e.ascent=o-d,f=c-u,m=!1,d=h;d>o;--d){for(let p=0;p<u;p+=4)if(l[f+p]!==255){m=!0;break}if(!m)f-=u;else break}return e.descent=d-o,e.fontSize=e.ascent+e.descent,Ct._fonts[t]=e,e}static clearMetrics(t=""){t?delete Ct._fonts[t]:Ct._fonts={}}static get _canvas(){var t;if(!Ct.__canvas){let e;try{const s=new OffscreenCanvas(0,0);if((t=s.getContext("2d",ch))!=null&&t.measureText)return Ct.__canvas=s,s;e=_t.ADAPTER.createCanvas()}catch{e=_t.ADAPTER.createCanvas()}e.width=e.height=10,Ct.__canvas=e}return Ct.__canvas}static get _context(){return Ct.__context||(Ct.__context=Ct._canvas.getContext("2d",ch)),Ct.__context}};Pr.METRICS_STRING="|ÉqÅ",Pr.BASELINE_SYMBOL="M",Pr.BASELINE_MULTIPLIER=1.4,Pr.HEIGHT_MULTIPLIER=2,Pr.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const i=new Intl.Segmenter;return t=>[...i.segment(t)].map(e=>e.segment)}return i=>[...i]})(),Pr.experimentalLetterSpacing=!1,Pr._fonts={},Pr._newlines=[10,13],Pr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Hi=Pr;const P2=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],T1=class Ao{constructor(t){this.styleID=0,this.reset(),Ff(this,t,t)}clone(){const t={};return Ff(t,this,Ao.defaultStyle),new Ao(t)}reset(){Ff(this,Ao.defaultStyle,Ao.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Rf(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Rf(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){M2(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Rf(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let s=e.length-1;s>=0;s--){let r=e[s].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!P2.includes(r)&&(r=`"${r}"`),e[s]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};T1.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Jc.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let rn=T1;function Rf(i){const t=Wt.shared,e=s=>{const r=t.setValue(s);return r.alpha===1?r.toHex():r.toRgbaString()};return Array.isArray(i)?i.map(e):e(i)}function M2(i,t){if(!Array.isArray(i)||!Array.isArray(t)||i.length!==t.length)return!1;for(let e=0;e<i.length;++e)if(i[e]!==t[e])return!1;return!0}function Ff(i,t,e){for(const s in e)Array.isArray(t[s])?i[s]=t[s].slice():i[s]=t[s]}const R2={texture:!0,children:!1,baseTexture:!0},S1=class $m extends to{constructor(t,e,s){let r=!1;s||(s=_t.ADAPTER.createCanvas(),r=!0),s.width=3,s.height=3;const n=Nt.from(s);n.orig=new Ut,n.trim=new Ut,super(n),this._ownCanvas=r,this.canvas=s,this.context=s.getContext("2d",{willReadFrequently:!0}),this._resolution=$m.defaultResolution??_t.RESOLUTION,this._autoResolution=$m.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=t,this.style=e,this.localStyleID=-1}static get experimentalLetterSpacing(){return Hi.experimentalLetterSpacing}static set experimentalLetterSpacing(t){Ht("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),Hi.experimentalLetterSpacing=t}updateText(t){const e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;this._font=this._style.toFontString();const s=this.context,r=Hi.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),n=r.width,a=r.height,o=r.lines,h=r.lineHeight,l=r.lineWidths,c=r.maxLineWidth,u=r.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,n)+e.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+e.padding*2)*this._resolution),s.scale(this._resolution,this._resolution),s.clearRect(0,0,this.canvas.width,this.canvas.height),s.font=this._font,s.lineWidth=e.strokeThickness,s.textBaseline=e.textBaseline,s.lineJoin=e.lineJoin,s.miterLimit=e.miterLimit;let d,f;const m=e.dropShadow?2:1;for(let p=0;p<m;++p){const g=e.dropShadow&&p===0,y=g?Math.ceil(Math.max(1,a)+e.padding*2):0,_=y*this._resolution;if(g){s.fillStyle="black",s.strokeStyle="black";const b=e.dropShadowColor,T=e.dropShadowBlur*this._resolution,S=e.dropShadowDistance*this._resolution;s.shadowColor=Wt.shared.setValue(b).setAlpha(e.dropShadowAlpha).toRgbaString(),s.shadowBlur=T,s.shadowOffsetX=Math.cos(e.dropShadowAngle)*S,s.shadowOffsetY=Math.sin(e.dropShadowAngle)*S+_}else s.fillStyle=this._generateFillStyle(e,o,r),s.strokeStyle=e.stroke,s.shadowColor="black",s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0;let v=(h-u.fontSize)/2;h-u.fontSize<0&&(v=0);for(let b=0;b<o.length;b++)d=e.strokeThickness/2,f=e.strokeThickness/2+b*h+u.ascent+v,e.align==="right"?d+=c-l[b]:e.align==="center"&&(d+=(c-l[b])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(o[b],d+e.padding,f+e.padding-y,!0),e.fill&&this.drawLetterSpacing(o[b],d+e.padding,f+e.padding-y)}this.updateTexture()}drawLetterSpacing(t,e,s,r=!1){const n=this._style.letterSpacing;let a=!1;if(Hi.experimentalLetterSpacingSupported&&(Hi.experimentalLetterSpacing?(this.context.letterSpacing=`${n}px`,this.context.textLetterSpacing=`${n}px`,a=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),n===0||a){r?this.context.strokeText(t,e,s):this.context.fillText(t,e,s);return}let o=e;const h=Hi.graphemeSegmenter(t);let l=this.context.measureText(t).width,c=0;for(let u=0;u<h.length;++u){const d=h[u];r?this.context.strokeText(d,o,s):this.context.fillText(d,o,s);let f="";for(let m=u+1;m<h.length;++m)f+=h[m];c=this.context.measureText(f).width,o+=l-c+n,l=c}}updateTexture(){const t=this.canvas;if(this._style.trim){const a=JI(t);a.data&&(t.width=a.width,t.height=a.height,this.context.putImageData(a.data,0,0))}const e=this._texture,s=this._style,r=s.trim?0:s.padding,n=e.baseTexture;e.trim.width=e._frame.width=t.width/this._resolution,e.trim.height=e._frame.height=t.height/this._resolution,e.trim.x=-r,e.trim.y=-r,e.orig.width=e._frame.width-r*2,e.orig.height=e._frame.height-r*2,this._onTextureUpdate(),n.setRealSize(t.width,t.height,this._resolution),e.updateUvs(),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(t,e){return this.updateText(!0),this._textureID===-1&&(t=!1),super.getBounds(t,e)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds.call(this,t)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(t,e,s){const r=t.fill;if(Array.isArray(r)){if(r.length===1)return r[0]}else return r;let n;const a=t.dropShadow?t.dropShadowDistance:0,o=t.padding||0,h=this.canvas.width/this._resolution-a-o*2,l=this.canvas.height/this._resolution-a-o*2,c=r.slice(),u=t.fillGradientStops.slice();if(!u.length){const d=c.length+1;for(let f=1;f<d;++f)u.push(f/d)}if(c.unshift(r[0]),u.unshift(0),c.push(r[r.length-1]),u.push(1),t.fillGradientType===Jc.LINEAR_VERTICAL){n=this.context.createLinearGradient(h/2,o,h/2,l+o);const d=s.fontProperties.fontSize+t.strokeThickness;for(let f=0;f<e.length;f++){const m=s.lineHeight*(f-1)+d,p=s.lineHeight*f;let g=p;f>0&&m>p&&(g=(p+m)/2);const y=p+d,_=s.lineHeight*(f+1);let v=y;f+1<e.length&&_<y&&(v=(y+_)/2);const b=(v-g)/l;for(let T=0;T<c.length;T++){let S=0;typeof u[T]=="number"?S=u[T]:S=T/c.length;let w=Math.min(1,Math.max(0,g/l+S*b));w=Number(w.toFixed(5)),n.addColorStop(w,c[T])}}}else{n=this.context.createLinearGradient(o,l/2,h+o,l/2);const d=c.length+1;let f=1;for(let m=0;m<c.length;m++){let p;typeof u[m]=="number"?p=u[m]:p=f/d,n.addColorStop(p,c[m]),f++}}return n}destroy(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},R2,t),super.destroy(t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this.updateText(!0);const e=Zi(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this.updateText(!0);const e=Zi(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get style(){return this._style}set style(t){t=t||{},t instanceof rn?this._style=t:this._style=new rn(t),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}};S1.defaultAutoResolution=!0;let Hp=S1;class F2{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function k2(i,t){var s;let e=!1;if((s=i==null?void 0:i._textures)!=null&&s.length){for(let r=0;r<i._textures.length;r++)if(i._textures[r]instanceof Nt){const n=i._textures[r].baseTexture;t.includes(n)||(t.push(n),e=!0)}}return e}function L2(i,t){if(i.baseTexture instanceof Lt){const e=i.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function B2(i,t){if(i._texture&&i._texture instanceof Nt){const e=i._texture.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function O2(i,t){return t instanceof Hp?(t.updateText(!0),!0):!1}function D2(i,t){if(t instanceof rn){const e=t.toFontString();return Hi.measureFont(e),!0}return!1}function N2(i,t){if(i instanceof Hp){t.includes(i.style)||t.push(i.style),t.includes(i)||t.push(i);const e=i._texture.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function U2(i,t){return i instanceof rn?(t.includes(i)||t.push(i),!0):!1}const E1=class A1{constructor(t){this.limiter=new F2(A1.uploadsPerFrame),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(N2),this.registerFindHook(U2),this.registerFindHook(k2),this.registerFindHook(L2),this.registerFindHook(B2),this.registerUploadHook(O2),this.registerUploadHook(D2)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,ss.system.addOnce(this.tick,this,Wn.UTILITY))):e()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed){for(let s=0,r=this.uploadHooks.length;s<r;s++)if(this.uploadHooks[s](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}}e||this.queue.shift()}if(this.queue.length)ss.system.addOnce(this.tick,this,Wn.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,s=t.length;e<s;e++)t[e]()}}registerFindHook(t){return t&&this.addHooks.push(t),this}registerUploadHook(t){return t&&this.uploadHooks.push(t),this}add(t){for(let e=0,s=this.addHooks.length;e<s&&!this.addHooks[e](t,this.queue);e++);if(t instanceof fs)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&ss.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};E1.uploadsPerFrame=4;let Hm=E1;Object.defineProperties(_t,{UPLOADS_PER_FRAME:{get(){return Hm.uploadsPerFrame},set(i){Ht("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Hm.uploadsPerFrame=i}}});function C1(i,t){return t instanceof Lt?(t._glTextures[i.CONTEXT_UID]||i.texture.bind(t),!0):!1}function X2(i,t){if(!(t instanceof gs))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:s}=e;for(let r=0;r<s.length;r++){const{texture:n}=s[r].style;n&&C1(i,n.baseTexture)}return e.batchable||i.geometry.bind(e,t._resolveDirectShader(i)),!0}function V2(i,t){return i instanceof gs?(t.push(i),!0):!1}class I1 extends Hm{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(V2),this.registerUploadHook(C1),this.registerUploadHook(X2)}}I1.extension={name:"prepare",type:gt.RendererSystem};St.add(I1);var Y2=`#version 300 es
|
||
#define SHADER_NAME Tiling-Sprite-100
|
||
|
||
precision lowp float;
|
||
|
||
in vec2 vTextureCoord;
|
||
|
||
out vec4 fragmentColor;
|
||
|
||
uniform sampler2D uSampler;
|
||
uniform vec4 uColor;
|
||
uniform mat3 uMapCoord;
|
||
uniform vec4 uClampFrame;
|
||
uniform vec2 uClampOffset;
|
||
|
||
void main(void)
|
||
{
|
||
vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
|
||
coord = (uMapCoord * vec3(coord, 1.0)).xy;
|
||
vec2 unclamped = coord;
|
||
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
|
||
|
||
vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
|
||
|
||
fragmentColor = texSample * uColor;
|
||
}
|
||
`,G2=`#version 300 es
|
||
#define SHADER_NAME Tiling-Sprite-300
|
||
|
||
precision lowp float;
|
||
|
||
in vec2 aVertexPosition;
|
||
in vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform mat3 uTransform;
|
||
|
||
out vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
|
||
}
|
||
`,$2=`#version 100
|
||
#ifdef GL_EXT_shader_texture_lod
|
||
#extension GL_EXT_shader_texture_lod : enable
|
||
#endif
|
||
#define SHADER_NAME Tiling-Sprite-100
|
||
|
||
precision lowp float;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
uniform sampler2D uSampler;
|
||
uniform vec4 uColor;
|
||
uniform mat3 uMapCoord;
|
||
uniform vec4 uClampFrame;
|
||
uniform vec2 uClampOffset;
|
||
|
||
void main(void)
|
||
{
|
||
vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
|
||
coord = (uMapCoord * vec3(coord, 1.0)).xy;
|
||
vec2 unclamped = coord;
|
||
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
|
||
|
||
#ifdef GL_EXT_shader_texture_lod
|
||
vec4 texSample = unclamped == coord
|
||
? texture2D(uSampler, coord)
|
||
: texture2DLodEXT(uSampler, coord, 0);
|
||
#else
|
||
vec4 texSample = texture2D(uSampler, coord);
|
||
#endif
|
||
|
||
gl_FragColor = texSample * uColor;
|
||
}
|
||
`,$x=`#version 100
|
||
#define SHADER_NAME Tiling-Sprite-100
|
||
|
||
precision lowp float;
|
||
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform mat3 uTransform;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
|
||
}
|
||
`,H2=`#version 100
|
||
#define SHADER_NAME Tiling-Sprite-Simple-100
|
||
|
||
precision lowp float;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
uniform sampler2D uSampler;
|
||
uniform vec4 uColor;
|
||
|
||
void main(void)
|
||
{
|
||
vec4 texSample = texture2D(uSampler, vTextureCoord);
|
||
gl_FragColor = texSample * uColor;
|
||
}
|
||
`;const uh=new fe;class P1 extends zc{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new B_,this.state=jr.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=Js.from($x,H2,e),this.shader=t.context.webGLVersion>1?Js.from(G2,Y2,e):Js.from($x,$2,e)}render(t){const e=this.renderer,s=this.quad;let r=s.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;r=s.uvs,r[0]=r[6]=-n,r[1]=r[3]=-a,r[2]=r[4]=1-n,r[5]=r[7]=1-a,s.invalidate();const o=t._texture,h=o.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,u=t.uvMatrix;let d=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==Ps.CLAMP:h.wrapMode===Ps.CLAMP&&(h.wrapMode=Ps.REPEAT));const f=d?this.simpleShader:this.shader,m=o.width,p=o.height,g=t._width,y=t._height;uh.set(c.a*m/g,c.b*m/y,c.c*p/g,c.d*p/y,c.tx/g,c.ty/y),uh.invert(),d?uh.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=uh.toArray(!0),f.uniforms.uColor=Wt.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=o,e.shader.bind(f),e.geometry.bind(s),this.state.blendMode=w_(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}P1.extension={name:"tilingSprite",type:gt.RendererPlugin};St.add(P1);const M1=class Co{constructor(t,e,s){this.linkedSheets=[],(t instanceof Lt||t instanceof Nt)&&(t={texture:t,data:e,resolutionFilename:s});const{texture:r,data:n,resolutionFilename:a=null,cachePrefix:o=""}=t;this.cachePrefix=o,this._texture=r instanceof Nt?r:null,this.baseTexture=r instanceof Lt?r:this._texture.baseTexture,this.textures={},this.animations={},this.data=n;const h=this.baseTexture.resource;this.resolution=this._updateResolution(a||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let s=Ci(t,null);return s===null&&(s=typeof e=="number"?e:parseFloat(e??"1")),s!==1&&this.baseTexture.setResolution(s),s}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Co.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const s=Co.BATCH_SIZE;for(;e-t<s&&e<this._frameKeys.length;){const r=this._frameKeys[e],n=this._frames[r],a=n.frame;if(a){let o=null,h=null;const l=n.trimmed!==!1&&n.sourceSize?n.sourceSize:n.frame,c=new Ut(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?o=new Ut(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):o=new Ut(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),n.trimmed!==!1&&n.spriteSourceSize&&(h=new Ut(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[r]=new Nt(this.baseTexture,o,c,h,n.rotated?2:0,n.anchor,n.borders),Nt.addToCache(this.textures[r],this.cachePrefix+r.toString())}e++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){const r=t[e][s];this.animations[e].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Co.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Co.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var e;for(const s in this.textures)this.textures[s].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((e=this._texture)==null||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};M1.BATCH_SIZE=1e3;let Hx=M1;const W2=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function R1(i,t,e){const s={};if(i.forEach(r=>{s[r]=t}),Object.keys(t.textures).forEach(r=>{s[`${t.cachePrefix}${r}`]=t.textures[r]}),!e){const r=ye.dirname(i[0]);t.linkedSheets.forEach((n,a)=>{Object.assign(s,R1([`${r}/${t.data.meta.related_multi_packs[a]}`],n,!0))})}return s}const z2={extension:gt.Asset,cache:{test:i=>i instanceof Hx,getCacheableAssets:(i,t)=>R1(i,t,!1)},resolver:{test:i=>{const t=i.split("?")[0].split("."),e=t.pop(),s=t.pop();return e==="json"&&W2.includes(s)},parse:i=>{var e;const t=i.split(".");return{resolution:parseFloat(((e=_t.RETINA_PREFIX.exec(i))==null?void 0:e[1])??"1"),format:t[t.length-2],src:i}}},loader:{name:"spritesheetLoader",extension:{type:gt.LoadParser,priority:Ts.Normal},async testParse(i,t){return ye.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){var c,u;const{texture:s,imageFilename:r,cachePrefix:n}=(t==null?void 0:t.data)??{};let a=ye.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let o;if(s&&s.baseTexture)o=s;else{const d=sl(a+(r??i.meta.image),t.src);o=(await e.load([d]))[d]}const h=new Hx({texture:o.baseTexture,data:i,resolutionFilename:t.src,cachePrefix:n});await h.parse();const l=(c=i==null?void 0:i.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(l)){const d=[];for(const m of l){if(typeof m!="string")continue;let p=a+m;(u=t.data)!=null&&u.ignoreMultiPack||(p=sl(p,t.src),d.push(e.load({src:p,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(d);h.linkedSheets=f,f.forEach(m=>{m.linkedSheets=[h].concat(h.linkedSheets.filter(p=>p!==m))})}return h},unload(i){i.destroy(!0)}}};St.add(z2);class rc{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Ch{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),s={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const n in e){const a=e[n].match(/^[a-z]+/gm)[0],o=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in o){const c=o[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f;h[u]=m}s[a].push(h)}const r=new rc;return s.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),s.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),s.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),s.char.forEach(n=>r.char.push({id:parseInt(n.id,10),page:parseInt(n.page,10),x:parseInt(n.x,10),y:parseInt(n.y,10),width:parseInt(n.width,10),height:parseInt(n.height,10),xoffset:parseInt(n.xoffset,10),yoffset:parseInt(n.yoffset,10),xadvance:parseInt(n.xadvance,10)})),s.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),s.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class Wm{static test(t){const e=t;return typeof t!="string"&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const e=new rc,s=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),a=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l<s.length;l++)e.info.push({face:s[l].getAttribute("face"),size:parseInt(s[l].getAttribute("size"),10)});for(let l=0;l<r.length;l++)e.common.push({lineHeight:parseInt(r[l].getAttribute("lineHeight"),10)});for(let l=0;l<n.length;l++)e.page.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});for(let l=0;l<a.length;l++){const c=a[l];e.char.push({id:parseInt(c.getAttribute("id"),10),page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xoffset:parseInt(c.getAttribute("xoffset"),10),yoffset:parseInt(c.getAttribute("yoffset"),10),xadvance:parseInt(c.getAttribute("xadvance"),10)})}for(let l=0;l<o.length;l++)e.kerning.push({first:parseInt(o[l].getAttribute("first"),10),second:parseInt(o[l].getAttribute("second"),10),amount:parseInt(o[l].getAttribute("amount"),10)});for(let l=0;l<h.length;l++)e.distanceField.push({fieldType:h[l].getAttribute("fieldType"),distanceRange:parseInt(h[l].getAttribute("distanceRange"),10)});return e}}class zm{static test(t){return typeof t=="string"&&t.includes("<font>")?Wm.test(_t.ADAPTER.parseXML(t)):!1}static parse(t){return Wm.parse(_t.ADAPTER.parseXML(t))}}const kf=[Ch,Wm,zm];function j2(i){for(let t=0;t<kf.length;t++)if(kf[t].test(i))return kf[t];return null}function q2(i,t,e,s,r,n){const a=e.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;let o;const h=e.dropShadow?e.dropShadowDistance:0,l=e.padding||0,c=i.width/s-h-l*2,u=i.height/s-h-l*2,d=a.slice(),f=e.fillGradientStops.slice();if(!f.length){const m=d.length+1;for(let p=1;p<m;++p)f.push(p/m)}if(d.unshift(a[0]),f.unshift(0),d.push(a[a.length-1]),f.push(1),e.fillGradientType===Jc.LINEAR_VERTICAL){o=t.createLinearGradient(c/2,l,c/2,u+l);let m=0;const p=(n.fontProperties.fontSize+e.strokeThickness)/u;for(let g=0;g<r.length;g++){const y=n.lineHeight*g;for(let _=0;_<d.length;_++){let v=0;typeof f[_]=="number"?v=f[_]:v=_/d.length;const b=y/u+v*p;let T=Math.max(m,b);T=Math.min(T,1),o.addColorStop(T,d[_]),m=T}}}else{o=t.createLinearGradient(l,u/2,c+l,u/2);const m=d.length+1;let p=1;for(let g=0;g<d.length;g++){let y;typeof f[g]=="number"?y=f[g]:y=p/m,o.addColorStop(y,d[g]),p++}}return o}function K2(i,t,e,s,r,n,a){const o=e.text,h=e.fontProperties;t.translate(s,r),t.scale(n,n);const l=a.strokeThickness/2,c=-(a.strokeThickness/2);if(t.font=a.toFontString(),t.lineWidth=a.strokeThickness,t.textBaseline=a.textBaseline,t.lineJoin=a.lineJoin,t.miterLimit=a.miterLimit,t.fillStyle=q2(i,t,a,n,[o],e),t.strokeStyle=a.stroke,a.dropShadow){const u=a.dropShadowColor,d=a.dropShadowBlur*n,f=a.dropShadowDistance*n;t.shadowColor=Wt.shared.setValue(u).setAlpha(a.dropShadowAlpha).toRgbaString(),t.shadowBlur=d,t.shadowOffsetX=Math.cos(a.dropShadowAngle)*f,t.shadowOffsetY=Math.sin(a.dropShadowAngle)*f}else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0;a.stroke&&a.strokeThickness&&t.strokeText(o,l,c+e.lineHeight-h.descent),a.fill&&t.fillText(o,l,c+e.lineHeight-h.descent),t.setTransform(1,0,0,1,0,0),t.fillStyle="rgba(0, 0, 0, 0)"}function Ih(i){return i.codePointAt?i.codePointAt(0):i.charCodeAt(0)}function F1(i){return Array.from?Array.from(i):i.split("")}function Z2(i){typeof i=="string"&&(i=[i]);const t=[];for(let e=0,s=i.length;e<s;e++){const r=i[e];if(Array.isArray(r)){if(r.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${r.length}.`);const n=r[0].charCodeAt(0),a=r[1].charCodeAt(0);if(a<n)throw new Error("[BitmapFont]: Invalid character range.");for(let o=n,h=a;o<=h;o++)t.push(String.fromCharCode(o))}else t.push(...F1(r))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}const Vi=class Mr{constructor(t,e,s){var c;const[r]=t.info,[n]=t.common,[a]=t.page,[o]=t.distanceField,h=Ci(a.file),l={};this._ownsTextures=s,this.font=r.face,this.size=r.size,this.lineHeight=n.lineHeight/h,this.chars={},this.pageTextures=l;for(let u=0;u<t.page.length;u++){const{id:d,file:f}=t.page[u];l[d]=e instanceof Array?e[u]:e[f],o!=null&&o.fieldType&&o.fieldType!=="none"&&(l[d].baseTexture.alphaMode=Ke.NO_PREMULTIPLIED_ALPHA,l[d].baseTexture.mipmap=Ms.OFF)}for(let u=0;u<t.char.length;u++){const{id:d,page:f}=t.char[u];let{x:m,y:p,width:g,height:y,xoffset:_,yoffset:v,xadvance:b}=t.char[u];m/=h,p/=h,g/=h,y/=h,_/=h,v/=h,b/=h;const T=new Ut(m+l[f].frame.x/h,p+l[f].frame.y/h,g,y);this.chars[d]={xOffset:_,yOffset:v,xAdvance:b,kerning:{},texture:new Nt(l[f].baseTexture,T),page:f}}for(let u=0;u<t.kerning.length;u++){let{first:d,second:f,amount:m}=t.kerning[u];d/=h,f/=h,m/=h,this.chars[f]&&(this.chars[f].kerning[d]=m)}this.distanceFieldRange=o==null?void 0:o.distanceRange,this.distanceFieldType=((c=o==null?void 0:o.fieldType)==null?void 0:c.toLowerCase())??"none"}destroy(){for(const t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(const t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null}static install(t,e,s){let r;if(t instanceof rc)r=t;else{const a=j2(t);if(!a)throw new Error("Unrecognized data format for font.");r=a.parse(t)}e instanceof Nt&&(e=[e]);const n=new Mr(r,e,s);return Mr.available[n.font]=n,n}static uninstall(t){const e=Mr.available[t];if(!e)throw new Error(`No font found named '${t}'`);e.destroy(),delete Mr.available[t]}static from(t,e,s){if(!t)throw new Error("[BitmapFont] Property `name` is required.");const{chars:r,padding:n,resolution:a,textureWidth:o,textureHeight:h,...l}=Object.assign({},Mr.defaultOptions,s),c=Z2(r),u=e instanceof rn?e:new rn(e),d=o,f=new rc;f.info[0]={face:u.fontFamily,size:u.fontSize},f.common[0]={lineHeight:u.fontSize};let m=0,p=0,g,y,_,v=0;const b=[];for(let S=0;S<c.length;S++){g||(g=_t.ADAPTER.createCanvas(),g.width=o,g.height=h,y=g.getContext("2d"),_=new Lt(g,{resolution:a,...l}),b.push(new Nt(_)),f.page.push({id:b.length-1,file:""}));const w=c[S],E=Hi.measureText(w,u,!1,g),A=E.width,P=Math.ceil(E.height),I=Math.ceil((u.fontStyle==="italic"?2:1)*A);if(p>=h-P*a){if(p===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${w}')`);--S,g=null,y=null,_=null,p=0,m=0,v=0;continue}if(v=Math.max(P+E.fontProperties.descent,v),I*a+m>=d){if(m===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${w}')`);--S,p+=v*a,p=Math.ceil(p),m=0,v=0;continue}K2(g,y,E,m,p,a,u);const C=Ih(E.text);f.char.push({id:C,page:b.length-1,x:m/a,y:p/a,width:I,height:P,xoffset:0,yoffset:0,xadvance:A-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),m+=(I+2*n)*a,m=Math.ceil(m)}if(!(s!=null&&s.skipKerning))for(let S=0,w=c.length;S<w;S++){const E=c[S];for(let A=0;A<w;A++){const P=c[A],I=y.measureText(E).width,C=y.measureText(P).width,R=y.measureText(E+P).width-(I+C);R&&f.kerning.push({first:Ih(E),second:Ih(P),amount:R})}}const T=new Mr(f,b,!0);return Mr.available[t]!==void 0&&Mr.uninstall(t),Mr.available[t]=T,T}};Vi.ALPHA=[["a","z"],["A","Z"]," "],Vi.NUMERIC=[["0","9"]],Vi.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Vi.ASCII=[[" ","~"]],Vi.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Vi.ALPHANUMERIC},Vi.available={};let Yi=Vi;var J2=`// Pixi texture info\r
|
||
varying vec2 vTextureCoord;\r
|
||
uniform sampler2D uSampler;\r
|
||
\r
|
||
// Tint\r
|
||
uniform vec4 uColor;\r
|
||
\r
|
||
// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
|
||
uniform float uFWidth;\r
|
||
\r
|
||
void main(void) {\r
|
||
\r
|
||
// To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
|
||
vec4 texColor = texture2D(uSampler, vTextureCoord);\r
|
||
\r
|
||
// MSDF\r
|
||
float median = texColor.r + texColor.g + texColor.b -\r
|
||
min(texColor.r, min(texColor.g, texColor.b)) -\r
|
||
max(texColor.r, max(texColor.g, texColor.b));\r
|
||
// SDF\r
|
||
median = min(median, texColor.a);\r
|
||
\r
|
||
float screenPxDistance = uFWidth * (median - 0.5);\r
|
||
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
|
||
if (median < 0.01) {\r
|
||
alpha = 0.0;\r
|
||
} else if (median > 0.99) {\r
|
||
alpha = 1.0;\r
|
||
}\r
|
||
\r
|
||
// Gamma correction for coverage-like alpha\r
|
||
float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r
|
||
float gamma = mix(1.0, 1.0 / 2.2, luma);\r
|
||
float coverage = pow(uColor.a * alpha, gamma); \r
|
||
\r
|
||
// NPM Textures, NPM outputs\r
|
||
gl_FragColor = vec4(uColor.rgb, coverage);\r
|
||
}\r
|
||
`,Q2=`// Mesh material default fragment\r
|
||
attribute vec2 aVertexPosition;\r
|
||
attribute vec2 aTextureCoord;\r
|
||
\r
|
||
uniform mat3 projectionMatrix;\r
|
||
uniform mat3 translationMatrix;\r
|
||
uniform mat3 uTextureMatrix;\r
|
||
\r
|
||
varying vec2 vTextureCoord;\r
|
||
\r
|
||
void main(void)\r
|
||
{\r
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
|
||
\r
|
||
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
|
||
}\r
|
||
`;const Wx=[],zx=[],jx=[],tF=class k1 extends fs{constructor(t,e={}){super();const{align:s,tint:r,maxWidth:n,letterSpacing:a,fontName:o,fontSize:h}=Object.assign({},k1.styleDefaults,e);if(!Yi.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new Wt(r),this._font=void 0,this._fontName=o,this._fontSize=h,this.text=t,this._maxWidth=n,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new gi(()=>{this.dirty=!0},this,0,0),this._roundPixels=_t.ROUND_PIXELS,this.dirty=!0,this._resolution=_t.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var I;const t=Yi.available[this._fontName],e=this.fontSize,s=e/t.size,r=new Kt,n=[],a=[],o=[],h=this._text.replace(/(?:\r\n|\r)/g,`
|
||
`)||" ",l=F1(h),c=this._maxWidth*t.size/e,u=t.distanceFieldType==="none"?Wx:zx;let d=null,f=0,m=0,p=0,g=-1,y=0,_=0,v=0,b=0;for(let C=0;C<l.length;C++){const R=l[C],F=Ih(R);if(/(?:\s)/.test(R)&&(g=C,y=f,b++),R==="\r"||R===`
|
||
`){a.push(f),o.push(-1),m=Math.max(m,f),++p,++_,r.x=0,r.y+=t.lineHeight,d=null,b=0;continue}const D=t.chars[F];if(!D)continue;d&&D.kerning[d]&&(r.x+=D.kerning[d]);const M=jx.pop()||{texture:Nt.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Kt};M.texture=D.texture,M.line=p,M.charCode=F,M.position.x=Math.round(r.x+D.xOffset+this._letterSpacing/2),M.position.y=Math.round(r.y+D.yOffset),M.prevSpaces=b,n.push(M),f=M.position.x+Math.max(D.xAdvance-D.xOffset,D.texture.orig.width),r.x+=D.xAdvance+this._letterSpacing,v=Math.max(v,D.yOffset+D.texture.height),d=F,g!==-1&&c>0&&r.x>c&&(++_,Ma(n,1+g-_,1+C-g),C=g,g=-1,a.push(y),o.push(n.length>0?n[n.length-1].prevSpaces:0),m=Math.max(m,y),p++,r.x=0,r.y+=t.lineHeight,d=null,b=0)}const T=l[l.length-1];T!=="\r"&&T!==`
|
||
`&&(/(?:\s)/.test(T)&&(f=y),a.push(f),m=Math.max(m,f),o.push(-1));const S=[];for(let C=0;C<=p;C++){let R=0;this._align==="right"?R=m-a[C]:this._align==="center"?R=(m-a[C])/2:this._align==="justify"&&(R=o[C]<0?0:(m-a[C])/o[C]),S.push(R)}const w=n.length,E={},A=[],P=this._activePagesMeshData;u.push(...P);for(let C=0;C<w;C++){const R=n[C].texture,F=R.baseTexture.uid;if(!E[F]){let D=u.pop();if(!D){const O=new Zc;let k,N;t.distanceFieldType==="none"?(k=new rl(Nt.EMPTY),N=It.NORMAL):(k=new rl(Nt.EMPTY,{program:ur.from(Q2,J2),uniforms:{uFWidth:0}}),N=It.NORMAL_NPM);const B=new zn(O,k);B.blendMode=N,D={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:B,vertices:null,uvs:null,indices:null}}D.index=0,D.indexCount=0,D.vertexCount=0,D.uvsCount=0,D.total=0;const{_textureCache:M}=this;M[F]=M[F]||new Nt(R.baseTexture),D.mesh.texture=M[F],D.mesh.tint=this._tintColor.value,A.push(D),E[F]=D}E[F].total++}for(let C=0;C<P.length;C++)A.includes(P[C])||this.removeChild(P[C].mesh);for(let C=0;C<A.length;C++)A[C].mesh.parent!==this&&this.addChild(A[C].mesh);this._activePagesMeshData=A;for(const C in E){const R=E[C],F=R.total;if(!(((I=R.indices)==null?void 0:I.length)>6*F)||R.vertices.length<zn.BATCHABLE_SIZE*2)R.vertices=new Float32Array(8*F),R.uvs=new Float32Array(8*F),R.indices=new Uint16Array(6*F);else{const D=R.total,M=R.vertices;for(let O=D*4*2;O<M.length;O++)M[O]=0}R.mesh.size=6*F}for(let C=0;C<w;C++){const R=n[C];let F=R.position.x+S[R.line]*(this._align==="justify"?R.prevSpaces:1);this._roundPixels&&(F=Math.round(F));const D=F*s,M=R.position.y*s,O=R.texture,k=E[O.baseTexture.uid],N=O.frame,B=O._uvs,L=k.index++;k.indices[L*6+0]=0+L*4,k.indices[L*6+1]=1+L*4,k.indices[L*6+2]=2+L*4,k.indices[L*6+3]=0+L*4,k.indices[L*6+4]=2+L*4,k.indices[L*6+5]=3+L*4,k.vertices[L*8+0]=D,k.vertices[L*8+1]=M,k.vertices[L*8+2]=D+N.width*s,k.vertices[L*8+3]=M,k.vertices[L*8+4]=D+N.width*s,k.vertices[L*8+5]=M+N.height*s,k.vertices[L*8+6]=D,k.vertices[L*8+7]=M+N.height*s,k.uvs[L*8+0]=B.x0,k.uvs[L*8+1]=B.y0,k.uvs[L*8+2]=B.x1,k.uvs[L*8+3]=B.y1,k.uvs[L*8+4]=B.x2,k.uvs[L*8+5]=B.y2,k.uvs[L*8+6]=B.x3,k.uvs[L*8+7]=B.y3}this._textWidth=m*s,this._textHeight=(r.y+t.lineHeight)*s;for(const C in E){const R=E[C];if(this.anchor.x!==0||this.anchor.y!==0){let O=0;const k=this._textWidth*this.anchor.x,N=this._textHeight*this.anchor.y;for(let B=0;B<R.total;B++)R.vertices[O++]-=k,R.vertices[O++]-=N,R.vertices[O++]-=k,R.vertices[O++]-=N,R.vertices[O++]-=k,R.vertices[O++]-=N,R.vertices[O++]-=k,R.vertices[O++]-=N}this._maxLineHeight=v*s;const F=R.mesh.geometry.getBuffer("aVertexPosition"),D=R.mesh.geometry.getBuffer("aTextureCoord"),M=R.mesh.geometry.getIndex();F.data=R.vertices,D.data=R.uvs,M.data=R.indices,F.update(),D.update(),M.update()}for(let C=0;C<n.length;C++)jx.push(n[C]);this._font=t,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);const{distanceFieldRange:e,distanceFieldType:s,size:r}=Yi.available[this._fontName];if(s!=="none"){const{a:n,b:a,c:o,d:h}=this.worldTransform,l=Math.sqrt(n*n+a*a),c=Math.sqrt(o*o+h*h),u=(Math.abs(l)+Math.abs(c))/2,d=this.fontSize/r,f=t._view.resolution;for(const m of this._activePagesMeshData)m.mesh.shader.uniforms.uFWidth=u*e*d*f}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=Yi.available[this._fontName];if(!t)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(t){if(this.tint!==t){this._tintColor.setValue(t);for(let e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.dirty=!0)}get fontName(){return this._fontName}set fontName(t){if(!Yi.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){return this._fontSize??Yi.available[this._fontName].size}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}destroy(t){const{_textureCache:e}=this,s=Yi.available[this._fontName].distanceFieldType==="none"?Wx:zx;s.push(...this._activePagesMeshData);for(const r of this._activePagesMeshData)this.removeChild(r.mesh);this._activePagesMeshData=[],s.filter(r=>e[r.mesh.texture.baseTexture.uid]).forEach(r=>{r.mesh.texture=Nt.EMPTY});for(const r in e)e[r].destroy(),delete e[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};tF.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const eF=[".xml",".fnt"],sF={extension:{type:gt.LoadParser,priority:Ts.Normal},name:"loadBitmapFont",test(i){return eF.includes(ye.extname(i).toLowerCase())},async testParse(i){return Ch.test(i)||zm.test(i)},async parse(i,t,e){const s=Ch.test(i)?Ch.parse(i):zm.parse(i),{src:r}=t,{page:n}=s,a=[];for(let l=0;l<n.length;++l){const c=n[l].file;let u=ye.join(ye.dirname(r),c);u=sl(u,r),a.push(u)}const o=await e.load(a),h=a.map(l=>o[l]);return Yi.install(s,h,!0)},async load(i,t){return(await _t.ADAPTER.fetch(i)).text()},unload(i){i.destroy()}};St.add(sF);const jm=class pa extends rn{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new pa(Object.keys(pa.defaultOptions).reduce((e,s)=>({...e,[s]:t[s]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(t=>{URL.revokeObjectURL(t.src),t.refs--,t.refs===0&&(t.fontFace&&document.fonts.delete(t.fontFace),delete pa.availableFonts[t.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:s}=pa;if(s[t]){const r=s[t];return this._fonts.push(r),r.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return _t.ADAPTER.fetch(t).then(r=>r.blob()).then(async r=>new Promise((n,a)=>{const o=URL.createObjectURL(r),h=new FileReader;h.onload=()=>n([o,h.result]),h.onerror=a,h.readAsDataURL(r)})).then(async([r,n])=>{const a=Object.assign({family:ye.basename(t,ye.extname(t)),weight:"normal",style:"normal",display:"auto",src:r,dataSrc:n,refs:1,originalUrl:t,fontFace:null},e);s[t]=a,this._fonts.push(a),this.styleID++;const o=new FontFace(a.family,`url(${a.src})`,{weight:a.weight,style:a.style,display:a.display});a.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...t){const e=t.filter(s=>!this._overrides.includes(s));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(s=>this._overrides.includes(s));e.length>0&&(this._overrides=this._overrides.filter(s=>!e.includes(s)),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((t,e)=>`${t}
|
||
@font-face {
|
||
font-family: "${e.family}";
|
||
src: url('${e.dataSrc}');
|
||
font-weight: ${e.weight};
|
||
font-style: ${e.style};
|
||
font-display: ${e.display};
|
||
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=WI(t)),typeof t=="number"?HI(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,s=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),r=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${s}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,pa.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=_t.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};jm.availableFonts={},jm.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Lf=jm;const dh=class ga extends to{constructor(t="",e={}){super(Nt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,r=Nt.from(s,{scaleMode:_t.SCALE_MODE,resourceOptions:{autoLoad:!1}});r.orig=new Ut,r.trim=new Ut,this.texture=r;const n="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",o=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",o.appendChild(h),this.maxWidth=ga.defaultMaxWidth,this.maxHeight=ga.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=o,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=s,this._loadImage=new Image,this._autoResolution=ga.defaultAutoResolution,this._resolution=ga.defaultResolution??_t.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:s,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:s.toCSS(r)}),this._styleElement.textContent=s.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:a,height:o}=n;(a>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(a)),l=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),s!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(r)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+s.padding*2,height:l+s.padding*2}}async updateText(t=!0){const{style:e,_image:s,_loadImage:r}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:a}=this.measureText();s.width=r.width=Math.ceil(Math.max(1,n)),s.height=r.height=Math.ceil(Math.max(1,a)),this._updateID++;const o=this._updateID;await new Promise(h=>{r.onload=async()=>{if(o<this._updateID){h();return}await e.onBeforeDraw(),s.src=r.src,r.onload=null,r.src="",this.updateTexture(),h()};const l=new XMLSerializer().serializeToString(this._svgRoot);r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(l)}`})}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:s,resolution:r}=this,{padding:n}=t,{baseTexture:a}=e;e.trim.width=e._frame.width=s.width/r,e.trim.height=e._frame.height=s.height/r,e.trim.x=-n,e.trim.y=-n,e.orig.width=e._frame.width-n*2,e.orig.height=e._frame.height-n*2,this._onTextureUpdate(),a.setRealSize(s.width,s.height,r),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){var s,r,n,a,o;typeof t=="boolean"&&(t={children:t}),t=Object.assign({},ga.defaultDestroyOptions,t),super.destroy(t);const e=null;this.ownsStyle&&((s=this._style)==null||s.cleanFonts()),this._style=e,(r=this._svgRoot)==null||r.remove(),this._svgRoot=e,(n=this._domElement)==null||n.remove(),this._domElement=e,(a=this._foreignObject)==null||a.remove(),this._foreignObject=e,(o=this._styleElement)==null||o.remove(),this._styleElement=e,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=e,this._image.src="",this._image=e}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=Zi(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=Zi(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&(t=t||{},t instanceof Lf?(this.ownsStyle=!1,this._style=t):t instanceof rn?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Lf.from(t)):(this.ownsStyle=!0,this._style=new Lf(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(t===""||t===null||t===void 0?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};dh.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},dh.defaultMaxWidth=2024,dh.defaultMaxHeight=2024,dh.defaultAutoResolution=!0;let L1=class{constructor(){x(this,"entries",{});x(this,"size",0)}add(t){let e=this.entries[t];return this.entries[t]=!0,e?!1:(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,r=t.length;s<r;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}};var as;let Dt=(as=class{constructor(t=0,e=0,s=0,r=0){x(this,"r");x(this,"g");x(this,"b");x(this,"a");this.r=t,this.g=e,this.b=s,this.a=r}set(t,e,s,r){return this.r=t,this.g=e,this.b=s,this.a=r,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)=="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!=8?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,r){return this.r+=t,this.g+=e,this.b+=s,this.a+=r,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}toRgb888(){const t=e=>("0"+(e*255).toString(16)).slice(-2);return+("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t,e=new as){return e.setFromString(t)}},x(as,"WHITE",new as(1,1,1,1)),x(as,"RED",new as(1,0,0,1)),x(as,"GREEN",new as(0,1,0,1)),x(as,"BLUE",new as(0,0,1,1)),x(as,"MAGENTA",new as(1,0,1,1)),as);var Re;let yt=(Re=class{static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*Re.degRad)}static sinDeg(t){return Math.sin(t*Re.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*Re.degRad}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){let e=Math.pow(Math.abs(t),.3333333333333333);return t<0?-e:e}static randomTriangular(t,e){return Re.randomTriangularWith(t,e,(t+e)*.5)}static randomTriangularWith(t,e,s){let r=Math.random(),n=e-t;return r<=(s-t)/n?t+Math.sqrt(r*n*(s-t)):e-Math.sqrt((1-r)*n*(e-s))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},x(Re,"PI",3.1415927),x(Re,"PI2",Re.PI*2),x(Re,"invPI2",1/Re.PI2),x(Re,"radiansToDegrees",180/Re.PI),x(Re,"radDeg",Re.radiansToDegrees),x(Re,"degreesToRadians",Re.PI/180),x(Re,"degRad",Re.degreesToRadians),Re);var cr;let xt=(cr=class{static arrayCopy(t,e,s,r,n){for(let a=e,o=r;a<e+n;a++,o++)s[o]=t[a]}static arrayFill(t,e,s,r){for(let n=e;n<s;n++)t[n]=r}static setArraySize(t,e,s=0){let r=t.length;if(r==e)return t;if(t.length=e,r<e)for(let n=r;n<e;n++)t[n]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:cr.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let r=0;r<t;r++)s[r]=e;return s}static newFloatArray(t){if(cr.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let s=0;s<e.length;s++)e[s]=0;return e}}static newShortArray(t){if(cr.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let s=0;s<e.length;s++)e[s]=0;return e}}static toFloatArray(t){return cr.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return cr.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}},x(cr,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u"),cr),ic=class{constructor(t){x(this,"items",new Array);x(this,"instantiator");this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}},nc=class{constructor(t=0,e=0){x(this,"x");x(this,"y");this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return t!=0&&(this.x/=t,this.y/=t),this}},B1=class{constructor(t){x(this,"name");if(!t)throw new Error("name cannot be null.");this.name=t}};var kn;let Pi=(kn=class extends B1{constructor(e){super(e);x(this,"id",kn.nextID++);x(this,"bones",null);x(this,"vertices",[]);x(this,"worldVerticesLength",0);x(this,"timelineAttachment",this)}computeWorldVertices(e,s,r,n,a,o){r=a+(r>>1)*o;let h=e.bone.skeleton,l=e.deform,c=this.vertices,u=this.bones;if(!u){l.length>0&&(c=l);let p=e.bone,g=p.worldX,y=p.worldY,_=p.a,v=p.b,b=p.c,T=p.d;for(let S=s,w=a;w<r;S+=2,w+=o){let E=c[S],A=c[S+1];n[w]=E*_+A*v+g,n[w+1]=E*b+A*T+y}return}let d=0,f=0;for(let p=0;p<s;p+=2){let g=u[d];d+=g+1,f+=g}let m=h.bones;if(l.length==0)for(let p=a,g=f*3;p<r;p+=o){let y=0,_=0,v=u[d++];for(v+=d;d<v;d++,g+=3){let b=m[u[d]],T=c[g],S=c[g+1],w=c[g+2];y+=(T*b.a+S*b.b+b.worldX)*w,_+=(T*b.c+S*b.d+b.worldY)*w}n[p]=y,n[p+1]=_}else{let p=l;for(let g=a,y=f*3,_=f<<1;g<r;g+=o){let v=0,b=0,T=u[d++];for(T+=d;d<T;d++,y+=3,_+=2){let S=m[u[d]],w=c[y]+p[_],E=c[y+1]+p[_+1],A=c[y+2];v+=(w*S.a+E*S.b+S.worldX)*A,b+=(w*S.c+E*S.d+S.worldY)*A}n[g]=v,n[g+1]=b}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),xt.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=xt.newFloatArray(this.vertices.length),xt.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment}},x(kn,"nextID",0),kn);var xi;let O1=(xi=class{constructor(t){x(this,"id",xi.nextID());x(this,"regions");x(this,"start",0);x(this,"digits",0);x(this,"setupIndex",0);this.regions=new Array(t)}copy(){let t=new xi(this.regions.length);return xt.arrayCopy(this.regions,0,t.regions,0,this.regions.length),t.start=this.start,t.digits=this.digits,t.setupIndex=this.setupIndex,t}apply(t,e){let s=t.sequenceIndex;s==-1&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let r=this.regions[s];e.region!=r&&(e.region=r,e.updateRegion())}getPath(t,e){let s=t,r=(this.start+e).toString();for(let n=this.digits-r.length;n>0;n--)s+="0";return s+=r,s}static nextID(){return xi._nextID++}},x(xi,"_nextID",0),xi);var Qe;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(Qe||(Qe={}));const D1=[Qe.hold,Qe.once,Qe.loop,Qe.pingpong,Qe.onceReverse,Qe.loopReverse,Qe.pingpongReverse];let Wp=class{constructor(t,e,s){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds",new L1);x(this,"duration");if(!t)throw new Error("name cannot be null.");this.name=t,this.setTimelines(e),this.duration=s}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,r,n,a,o,h){if(!t)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(s%=this.duration,e>0&&(e%=this.duration));let l=this.timelines;for(let c=0,u=l.length;c<u;c++)l[c].apply(t,e,s,n,a,o,h)}};var ht;(function(i){i[i.setup=0]="setup",i[i.first=1]="first",i[i.replace=2]="replace",i[i.add=3]="add"})(ht||(ht={}));var hs;(function(i){i[i.mixIn=0]="mixIn",i[i.mixOut=1]="mixOut"})(hs||(hs={}));const Vt={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28};let we=class{constructor(t,e){x(this,"propertyIds");x(this,"frames");this.propertyIds=e,this.frames=xt.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(t,e){let s=t.length;for(let r=1;r<s;r++)if(t[r]>e)return r-1;return s-1}static search(t,e,s){let r=t.length;for(let n=s;n<r;n+=s)if(t[n]>e)return n-s;return r-s}},qr=class extends we{constructor(e,s,r){super(e,r);x(this,"curves");this.curves=xt.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let s=this.getFrameCount()+e*18;if(this.curves.length>s){let r=xt.newFloatArray(s);xt.arrayCopy(this.curves,0,r,0,s),this.curves=r}}setBezier(e,s,r,n,a,o,h,l,c,u,d){let f=this.curves,m=this.getFrameCount()+e*18;r==0&&(f[s]=2+m);let p=(n-o*2+l)*.03,g=(a-h*2+c)*.03,y=((o-l)*3-n+u)*.006,_=((h-c)*3-a+d)*.006,v=p*2+y,b=g*2+_,T=(o-n)*.3+p+y*.16666667,S=(h-a)*.3+g+_*.16666667,w=n+T,E=a+S;for(let A=m+18;m<A;m+=2)f[m]=w,f[m+1]=E,T+=v,S+=b,v+=y,b+=_,w+=T,E+=S}getBezierValue(e,s,r,n){let a=this.curves;if(a[n]>e){let c=this.frames[s],u=this.frames[s+r];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}let o=n+18;for(n+=2;n<o;n+=2)if(a[n]>=e){let c=a[n-2],u=a[n-1];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}s+=this.getFrameEntries();let h=a[o-2],l=a[o-1];return l+(e-h)/(this.frames[s]-h)*(this.frames[s+r]-l)}},wr=class extends qr{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let n=2;n<=s;n+=2)if(e[n]>t){s=n-2;break}let r=this.curves[s>>1];switch(r){case 0:let n=e[s],a=e[s+1];return a+(t-n)/(e[s+2]-n)*(e[s+2+1]-a);case 1:return e[s+1]}return this.getBezierValue(t,s,1,r-2)}getRelativeValue(t,e,s,r,n){if(t<this.frames[0]){switch(s){case ht.setup:return n;case ht.first:return r+(n-r)*e}return r}let a=this.getCurveValue(t);switch(s){case ht.setup:return n+a*e;case ht.first:case ht.replace:a+=n-r}return r+a*e}getAbsoluteValue(t,e,s,r,n){if(t<this.frames[0]){switch(s){case ht.setup:return n;case ht.first:return r+(n-r)*e}return r}let a=this.getCurveValue(t);return s==ht.setup?n+(a-n)*e:r+(a-r)*e}getAbsoluteValue2(t,e,s,r,n,a){if(t<this.frames[0]){switch(s){case ht.setup:return n;case ht.first:return r+(n-r)*e}return r}return s==ht.setup?n+(a-n)*e:r+(a-r)*e}getScaleValue(t,e,s,r,n,a){const o=this.frames;if(t<o[0]){switch(s){case ht.setup:return a;case ht.first:return n+(a-n)*e}return n}let h=this.getCurveValue(t)*a;if(e==1)return s==ht.add?n+h-a:h;if(r==hs.mixOut)switch(s){case ht.setup:return a+(Math.abs(h)*yt.signum(a)-a)*e;case ht.first:case ht.replace:return n+(Math.abs(h)*yt.signum(n)-n)*e}else{let l=0;switch(s){case ht.setup:return l=Math.abs(a)*yt.signum(h),l+(h-l)*e;case ht.first:case ht.replace:return l=Math.abs(n)*yt.signum(h),l+(h-l)*e}}return n+(h-a)*e}};class zp extends qr{constructor(t,e,s,r){super(t,e,[s,r])}getFrameEntries(){return 3}setFrame(t,e,s,r){t*=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r}}let ac=class extends wr{constructor(e,s,r){super(e,s,Vt.rotate+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.rotation=this.getRelativeValue(r,a,o,l.rotation,l.data.rotation))}},N1=class extends zp{constructor(e,s,r){super(e,s,Vt.x+"|"+r,Vt.y+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];if(!l.active)return;let c=this.frames;if(r<c[0]){switch(o){case ht.setup:l.x=l.data.x,l.y=l.data.y;return;case ht.first:l.x+=(l.data.x-l.x)*a,l.y+=(l.data.y-l.y)*a}return}let u=0,d=0,f=we.search(c,r,3),m=this.curves[f/3];switch(m){case 0:let p=c[f];u=c[f+1],d=c[f+2];let g=(r-p)/(c[f+3]-p);u+=(c[f+3+1]-u)*g,d+=(c[f+3+2]-d)*g;break;case 1:u=c[f+1],d=c[f+2];break;default:u=this.getBezierValue(r,f,1,m-2),d=this.getBezierValue(r,f,2,m+18-2)}switch(o){case ht.setup:l.x=l.data.x+u*a,l.y=l.data.y+d*a;break;case ht.first:case ht.replace:l.x+=(l.data.x+u-l.x)*a,l.y+=(l.data.y+d-l.y)*a;break;case ht.add:l.x+=u*a,l.y+=d*a}}},U1=class extends wr{constructor(e,s,r){super(e,s,Vt.x+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.x=this.getRelativeValue(r,a,o,l.x,l.data.x))}},X1=class extends wr{constructor(e,s,r){super(e,s,Vt.y+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.y=this.getRelativeValue(r,a,o,l.y,l.data.y))}},V1=class extends zp{constructor(e,s,r){super(e,s,Vt.scaleX+"|"+r,Vt.scaleY+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];if(!l.active)return;let c=this.frames;if(r<c[0]){switch(o){case ht.setup:l.scaleX=l.data.scaleX,l.scaleY=l.data.scaleY;return;case ht.first:l.scaleX+=(l.data.scaleX-l.scaleX)*a,l.scaleY+=(l.data.scaleY-l.scaleY)*a}return}let u,d,f=we.search(c,r,3),m=this.curves[f/3];switch(m){case 0:let p=c[f];u=c[f+1],d=c[f+2];let g=(r-p)/(c[f+3]-p);u+=(c[f+3+1]-u)*g,d+=(c[f+3+2]-d)*g;break;case 1:u=c[f+1],d=c[f+2];break;default:u=this.getBezierValue(r,f,1,m-2),d=this.getBezierValue(r,f,2,m+18-2)}if(u*=l.data.scaleX,d*=l.data.scaleY,a==1)o==ht.add?(l.scaleX+=u-l.data.scaleX,l.scaleY+=d-l.data.scaleY):(l.scaleX=u,l.scaleY=d);else{let p=0,g=0;if(h==hs.mixOut)switch(o){case ht.setup:p=l.data.scaleX,g=l.data.scaleY,l.scaleX=p+(Math.abs(u)*yt.signum(p)-p)*a,l.scaleY=g+(Math.abs(d)*yt.signum(g)-g)*a;break;case ht.first:case ht.replace:p=l.scaleX,g=l.scaleY,l.scaleX=p+(Math.abs(u)*yt.signum(p)-p)*a,l.scaleY=g+(Math.abs(d)*yt.signum(g)-g)*a;break;case ht.add:l.scaleX+=(u-l.data.scaleX)*a,l.scaleY+=(d-l.data.scaleY)*a}else switch(o){case ht.setup:p=Math.abs(l.data.scaleX)*yt.signum(u),g=Math.abs(l.data.scaleY)*yt.signum(d),l.scaleX=p+(u-p)*a,l.scaleY=g+(d-g)*a;break;case ht.first:case ht.replace:p=Math.abs(l.scaleX)*yt.signum(u),g=Math.abs(l.scaleY)*yt.signum(d),l.scaleX=p+(u-p)*a,l.scaleY=g+(d-g)*a;break;case ht.add:l.scaleX+=(u-l.data.scaleX)*a,l.scaleY+=(d-l.data.scaleY)*a}}}},Y1=class extends wr{constructor(e,s,r){super(e,s,Vt.scaleX+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.scaleX=this.getScaleValue(r,a,o,h,l.scaleX,l.data.scaleX))}},G1=class extends wr{constructor(e,s,r){super(e,s,Vt.scaleY+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.scaleY=this.getScaleValue(r,a,o,h,l.scaleY,l.data.scaleY))}},$1=class extends zp{constructor(e,s,r){super(e,s,Vt.shearX+"|"+r,Vt.shearY+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];if(!l.active)return;let c=this.frames;if(r<c[0]){switch(o){case ht.setup:l.shearX=l.data.shearX,l.shearY=l.data.shearY;return;case ht.first:l.shearX+=(l.data.shearX-l.shearX)*a,l.shearY+=(l.data.shearY-l.shearY)*a}return}let u=0,d=0,f=we.search(c,r,3),m=this.curves[f/3];switch(m){case 0:let p=c[f];u=c[f+1],d=c[f+2];let g=(r-p)/(c[f+3]-p);u+=(c[f+3+1]-u)*g,d+=(c[f+3+2]-d)*g;break;case 1:u=c[f+1],d=c[f+2];break;default:u=this.getBezierValue(r,f,1,m-2),d=this.getBezierValue(r,f,2,m+18-2)}switch(o){case ht.setup:l.shearX=l.data.shearX+u*a,l.shearY=l.data.shearY+d*a;break;case ht.first:case ht.replace:l.shearX+=(l.data.shearX+u-l.shearX)*a,l.shearY+=(l.data.shearY+d-l.shearY)*a;break;case ht.add:l.shearX+=u*a,l.shearY+=d*a}}},H1=class extends wr{constructor(e,s,r){super(e,s,Vt.shearX+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.shearX=this.getRelativeValue(r,a,o,l.shearX,l.data.shearX))}},W1=class extends wr{constructor(e,s,r){super(e,s,Vt.shearY+"|"+r);x(this,"boneIndex",0);this.boneIndex=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];l.active&&(l.shearY=this.getRelativeValue(r,a,o,l.shearY,l.data.shearY))}},z1=class extends we{constructor(e,s){super(e,[Vt.inherit+"|"+s]);x(this,"boneIndex",0);this.boneIndex=s}getFrameEntries(){return 2}setFrame(e,s,r){e*=2,this.frames[e]=s,this.frames[e+1]=r}apply(e,s,r,n,a,o,h){let l=e.bones[this.boneIndex];if(!l.active)return;if(h==hs.mixOut){o==ht.setup&&(l.inherit=l.data.inherit);return}let c=this.frames;if(r<c[0]){(o==ht.setup||o==ht.first)&&(l.inherit=l.data.inherit);return}l.inherit=this.frames[we.search(c,r,2)+1]}},j1=class extends qr{constructor(e,s,r){super(e,s,[Vt.rgb+"|"+r,Vt.alpha+"|"+r]);x(this,"slotIndex",0);this.slotIndex=r}getFrameEntries(){return 5}setFrame(e,s,r,n,a,o){e*=5,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a,this.frames[e+4]=o}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color;if(r<c[0]){let _=l.data.color;switch(o){case ht.setup:u.setFromColor(_);return;case ht.first:u.add((_.r-u.r)*a,(_.g-u.g)*a,(_.b-u.b)*a,(_.a-u.a)*a)}return}let d=0,f=0,m=0,p=0,g=we.search(c,r,5),y=this.curves[g/5];switch(y){case 0:let _=c[g];d=c[g+1],f=c[g+2],m=c[g+3],p=c[g+4];let v=(r-_)/(c[g+5]-_);d+=(c[g+5+1]-d)*v,f+=(c[g+5+2]-f)*v,m+=(c[g+5+3]-m)*v,p+=(c[g+5+4]-p)*v;break;case 1:d=c[g+1],f=c[g+2],m=c[g+3],p=c[g+4];break;default:d=this.getBezierValue(r,g,1,y-2),f=this.getBezierValue(r,g,2,y+18-2),m=this.getBezierValue(r,g,3,y+36-2),p=this.getBezierValue(r,g,4,y+54-2)}a==1?u.set(d,f,m,p):(o==ht.setup&&u.setFromColor(l.data.color),u.add((d-u.r)*a,(f-u.g)*a,(m-u.b)*a,(p-u.a)*a))}},q1=class extends qr{constructor(e,s,r){super(e,s,[Vt.rgb+"|"+r]);x(this,"slotIndex",0);this.slotIndex=r}getFrameEntries(){return 4}setFrame(e,s,r,n,a){e<<=2,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color;if(r<c[0]){let y=l.data.color;switch(o){case ht.setup:u.r=y.r,u.g=y.g,u.b=y.b;return;case ht.first:u.r+=(y.r-u.r)*a,u.g+=(y.g-u.g)*a,u.b+=(y.b-u.b)*a}return}let d=0,f=0,m=0,p=we.search(c,r,4),g=this.curves[p>>2];switch(g){case 0:let y=c[p];d=c[p+1],f=c[p+2],m=c[p+3];let _=(r-y)/(c[p+4]-y);d+=(c[p+4+1]-d)*_,f+=(c[p+4+2]-f)*_,m+=(c[p+4+3]-m)*_;break;case 1:d=c[p+1],f=c[p+2],m=c[p+3];break;default:d=this.getBezierValue(r,p,1,g-2),f=this.getBezierValue(r,p,2,g+18-2),m=this.getBezierValue(r,p,3,g+36-2)}if(a==1)u.r=d,u.g=f,u.b=m;else{if(o==ht.setup){let y=l.data.color;u.r=y.r,u.g=y.g,u.b=y.b}u.r+=(d-u.r)*a,u.g+=(f-u.g)*a,u.b+=(m-u.b)*a}}},K1=class extends wr{constructor(e,s,r){super(e,s,Vt.alpha+"|"+r);x(this,"slotIndex",0);this.slotIndex=r}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=l.color;if(r<this.frames[0]){let d=l.data.color;switch(o){case ht.setup:c.a=d.a;return;case ht.first:c.a+=(d.a-c.a)*a}return}let u=this.getCurveValue(r);a==1?c.a=u:(o==ht.setup&&(c.a=l.data.color.a),c.a+=(u-c.a)*a)}},Z1=class extends qr{constructor(e,s,r){super(e,s,[Vt.rgb+"|"+r,Vt.alpha+"|"+r,Vt.rgb2+"|"+r]);x(this,"slotIndex",0);this.slotIndex=r}getFrameEntries(){return 8}setFrame(e,s,r,n,a,o,h,l,c){e<<=3,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a,this.frames[e+4]=o,this.frames[e+5]=h,this.frames[e+6]=l,this.frames[e+7]=c}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color,d=l.darkColor;if(r<c[0]){let S=l.data.color,w=l.data.darkColor;switch(o){case ht.setup:u.setFromColor(S),d.r=w.r,d.g=w.g,d.b=w.b;return;case ht.first:u.add((S.r-u.r)*a,(S.g-u.g)*a,(S.b-u.b)*a,(S.a-u.a)*a),d.r+=(w.r-d.r)*a,d.g+=(w.g-d.g)*a,d.b+=(w.b-d.b)*a}return}let f=0,m=0,p=0,g=0,y=0,_=0,v=0,b=we.search(c,r,8),T=this.curves[b>>3];switch(T){case 0:let S=c[b];f=c[b+1],m=c[b+2],p=c[b+3],g=c[b+4],y=c[b+5],_=c[b+6],v=c[b+7];let w=(r-S)/(c[b+8]-S);f+=(c[b+8+1]-f)*w,m+=(c[b+8+2]-m)*w,p+=(c[b+8+3]-p)*w,g+=(c[b+8+4]-g)*w,y+=(c[b+8+5]-y)*w,_+=(c[b+8+6]-_)*w,v+=(c[b+8+7]-v)*w;break;case 1:f=c[b+1],m=c[b+2],p=c[b+3],g=c[b+4],y=c[b+5],_=c[b+6],v=c[b+7];break;default:f=this.getBezierValue(r,b,1,T-2),m=this.getBezierValue(r,b,2,T+18-2),p=this.getBezierValue(r,b,3,T+36-2),g=this.getBezierValue(r,b,4,T+54-2),y=this.getBezierValue(r,b,5,T+72-2),_=this.getBezierValue(r,b,6,T+90-2),v=this.getBezierValue(r,b,7,T+108-2)}if(a==1)u.set(f,m,p,g),d.r=y,d.g=_,d.b=v;else{if(o==ht.setup){u.setFromColor(l.data.color);let S=l.data.darkColor;d.r=S.r,d.g=S.g,d.b=S.b}u.add((f-u.r)*a,(m-u.g)*a,(p-u.b)*a,(g-u.a)*a),d.r+=(y-d.r)*a,d.g+=(_-d.g)*a,d.b+=(v-d.b)*a}}},J1=class extends qr{constructor(e,s,r){super(e,s,[Vt.rgb+"|"+r,Vt.rgb2+"|"+r]);x(this,"slotIndex",0);this.slotIndex=r}getFrameEntries(){return 7}setFrame(e,s,r,n,a,o,h,l){e*=7,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a,this.frames[e+4]=o,this.frames[e+5]=h,this.frames[e+6]=l}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=this.frames,u=l.color,d=l.darkColor;if(r<c[0]){let T=l.data.color,S=l.data.darkColor;switch(o){case ht.setup:u.r=T.r,u.g=T.g,u.b=T.b,d.r=S.r,d.g=S.g,d.b=S.b;return;case ht.first:u.r+=(T.r-u.r)*a,u.g+=(T.g-u.g)*a,u.b+=(T.b-u.b)*a,d.r+=(S.r-d.r)*a,d.g+=(S.g-d.g)*a,d.b+=(S.b-d.b)*a}return}let f=0,m=0,p=0,g=0,y=0,_=0,v=we.search(c,r,7),b=this.curves[v/7];switch(b){case 0:let T=c[v];f=c[v+1],m=c[v+2],p=c[v+3],g=c[v+4],y=c[v+5],_=c[v+6];let S=(r-T)/(c[v+7]-T);f+=(c[v+7+1]-f)*S,m+=(c[v+7+2]-m)*S,p+=(c[v+7+3]-p)*S,g+=(c[v+7+4]-g)*S,y+=(c[v+7+5]-y)*S,_+=(c[v+7+6]-_)*S;break;case 1:f=c[v+1],m=c[v+2],p=c[v+3],g=c[v+4],y=c[v+5],_=c[v+6];break;default:f=this.getBezierValue(r,v,1,b-2),m=this.getBezierValue(r,v,2,b+18-2),p=this.getBezierValue(r,v,3,b+36-2),g=this.getBezierValue(r,v,4,b+54-2),y=this.getBezierValue(r,v,5,b+72-2),_=this.getBezierValue(r,v,6,b+90-2)}if(a==1)u.r=f,u.g=m,u.b=p,d.r=g,d.g=y,d.b=_;else{if(o==ht.setup){let T=l.data.color,S=l.data.darkColor;u.r=T.r,u.g=T.g,u.b=T.b,d.r=S.r,d.g=S.g,d.b=S.b}u.r+=(f-u.r)*a,u.g+=(m-u.g)*a,u.b+=(p-u.b)*a,d.r+=(g-d.r)*a,d.g+=(y-d.g)*a,d.b+=(_-d.b)*a}}},ba=class extends we{constructor(e,s){super(e,[Vt.attachment+"|"+s]);x(this,"slotIndex",0);x(this,"attachmentNames");this.slotIndex=s,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.attachmentNames[e]=r}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(l.bone.active){if(h==hs.mixOut){o==ht.setup&&this.setAttachment(e,l,l.data.attachmentName);return}if(r<this.frames[0]){(o==ht.setup||o==ht.first)&&this.setAttachment(e,l,l.data.attachmentName);return}this.setAttachment(e,l,this.attachmentNames[we.search1(this.frames,r)])}}setAttachment(e,s,r){s.setAttachment(r?e.getAttachment(this.slotIndex,r):null)}},Q1=class extends qr{constructor(e,s,r,n){super(e,s,[Vt.deform+"|"+r+"|"+n.id]);x(this,"slotIndex",0);x(this,"attachment");x(this,"vertices");this.slotIndex=r,this.attachment=n,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.vertices[e]=r}setBezier(e,s,r,n,a,o,h,l,c,u,d){let f=this.curves,m=this.getFrameCount()+e*18;r==0&&(f[s]=2+m);let p=(n-o*2+l)*.03,g=c*.03-h*.06,y=((o-l)*3-n+u)*.006,_=(h-c+.33333333)*.018,v=p*2+y,b=g*2+_,T=(o-n)*.3+p+y*.16666667,S=h*.3+g+_*.16666667,w=n+T,E=S;for(let A=m+18;m<A;m+=2)f[m]=w,f[m+1]=E,T+=v,S+=b,v+=y,b+=_,w+=T,E+=S}getCurvePercent(e,s){let r=this.curves,n=r[s];switch(n){case 0:let l=this.frames[s];return(e-l)/(this.frames[s+this.getFrameEntries()]-l);case 1:return 0}if(n-=2,r[n]>e){let l=this.frames[s];return r[n+1]*(e-l)/(r[n]-l)}let a=n+18;for(n+=2;n<a;n+=2)if(r[n]>=e){let l=r[n-2],c=r[n-1];return c+(e-l)/(r[n]-l)*(r[n+1]-c)}let o=r[a-2],h=r[a-1];return h+(1-h)*(e-o)/(this.frames[s+this.getFrameEntries()]-o)}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=l.getAttachment();if(!c||!(c instanceof Pi)||c.timelineAttachment!=this.attachment)return;let u=l.deform;u.length==0&&(o=ht.setup);let d=this.vertices,f=d[0].length,m=this.frames;if(r<m[0]){switch(o){case ht.setup:u.length=0;return;case ht.first:if(a==1){u.length=0;return}u.length=f;let b=c;if(b.bones){a=1-a;for(var p=0;p<f;p++)u[p]*=a}else{let T=b.vertices;for(var p=0;p<f;p++)u[p]+=(T[p]-u[p])*a}}return}if(u.length=f,r>=m[m.length-1]){let b=d[m.length-1];if(a==1)if(o==ht.add){let T=c;if(T.bones)for(let S=0;S<f;S++)u[S]+=b[S];else{let S=T.vertices;for(let w=0;w<f;w++)u[w]+=b[w]-S[w]}}else xt.arrayCopy(b,0,u,0,f);else switch(o){case ht.setup:{let S=c;if(S.bones)for(let w=0;w<f;w++)u[w]=b[w]*a;else{let w=S.vertices;for(let E=0;E<f;E++){let A=w[E];u[E]=A+(b[E]-A)*a}}break}case ht.first:case ht.replace:for(let S=0;S<f;S++)u[S]+=(b[S]-u[S])*a;break;case ht.add:let T=c;if(T.bones)for(let S=0;S<f;S++)u[S]+=b[S]*a;else{let S=T.vertices;for(let w=0;w<f;w++)u[w]+=(b[w]-S[w])*a}}return}let g=we.search1(m,r),y=this.getCurvePercent(r,g),_=d[g],v=d[g+1];if(a==1)if(o==ht.add){let b=c;if(b.bones)for(let T=0;T<f;T++){let S=_[T];u[T]+=S+(v[T]-S)*y}else{let T=b.vertices;for(let S=0;S<f;S++){let w=_[S];u[S]+=w+(v[S]-w)*y-T[S]}}}else for(let b=0;b<f;b++){let T=_[b];u[b]=T+(v[b]-T)*y}else switch(o){case ht.setup:{let T=c;if(T.bones)for(let S=0;S<f;S++){let w=_[S];u[S]=(w+(v[S]-w)*y)*a}else{let S=T.vertices;for(let w=0;w<f;w++){let E=_[w],A=S[w];u[w]=A+(E+(v[w]-E)*y-A)*a}}break}case ht.first:case ht.replace:for(let T=0;T<f;T++){let S=_[T];u[T]+=(S+(v[T]-S)*y-u[T])*a}break;case ht.add:let b=c;if(b.bones)for(let T=0;T<f;T++){let S=_[T];u[T]+=(S+(v[T]-S)*y)*a}else{let T=b.vertices;for(let S=0;S<f;S++){let w=_[S];u[S]+=(w+(v[S]-w)*y-T[S])*a}}}}};var Ln;let jp=(Ln=class extends we{constructor(e){super(e,Ln.propertyIds);x(this,"events");this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s.time,this.events[e]=s}apply(e,s,r,n,a,o,h){if(!n)return;let l=this.frames,c=this.frames.length;if(s>r)this.apply(e,s,Number.MAX_VALUE,n,a,o,h),s=-1;else if(s>=l[c-1])return;if(r<l[0])return;let u=0;if(s<l[0])u=0;else{u=we.search1(l,s)+1;let d=l[u];for(;u>0&&l[u-1]==d;)u--}for(;u<c&&r>=l[u];u++)n.push(this.events[u])}},x(Ln,"propertyIds",[""+Vt.event]),Ln);var Bn;let Lo=(Bn=class extends we{constructor(e){super(e,Bn.propertyIds);x(this,"drawOrders");this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.drawOrders[e]=r}apply(e,s,r,n,a,o,h){if(h==hs.mixOut){o==ht.setup&&xt.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(r<this.frames[0]){(o==ht.setup||o==ht.first)&&xt.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let l=we.search1(this.frames,r),c=this.drawOrders[l];if(!c)xt.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let u=e.drawOrder,d=e.slots;for(let f=0,m=c.length;f<m;f++)u[f]=d[c[f]]}}},x(Bn,"propertyIds",[""+Vt.drawOrder]),Bn),tw=class extends qr{constructor(e,s,r){super(e,s,[Vt.ikConstraint+"|"+r]);x(this,"constraintIndex",0);this.constraintIndex=r}getFrameEntries(){return 6}setFrame(e,s,r,n,a,o,h){e*=6,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a,this.frames[e+4]=o?1:0,this.frames[e+5]=h?1:0}apply(e,s,r,n,a,o,h){let l=e.ikConstraints[this.constraintIndex];if(!l.active)return;let c=this.frames;if(r<c[0]){switch(o){case ht.setup:l.mix=l.data.mix,l.softness=l.data.softness,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch;return;case ht.first:l.mix+=(l.data.mix-l.mix)*a,l.softness+=(l.data.softness-l.softness)*a,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch}return}let u=0,d=0,f=we.search(c,r,6),m=this.curves[f/6];switch(m){case 0:let p=c[f];u=c[f+1],d=c[f+2];let g=(r-p)/(c[f+6]-p);u+=(c[f+6+1]-u)*g,d+=(c[f+6+2]-d)*g;break;case 1:u=c[f+1],d=c[f+2];break;default:u=this.getBezierValue(r,f,1,m-2),d=this.getBezierValue(r,f,2,m+18-2)}o==ht.setup?(l.mix=l.data.mix+(u-l.data.mix)*a,l.softness=l.data.softness+(d-l.data.softness)*a,h==hs.mixOut?(l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch):(l.bendDirection=c[f+3],l.compress=c[f+4]!=0,l.stretch=c[f+5]!=0)):(l.mix+=(u-l.mix)*a,l.softness+=(d-l.softness)*a,h==hs.mixIn&&(l.bendDirection=c[f+3],l.compress=c[f+4]!=0,l.stretch=c[f+5]!=0))}},ew=class extends qr{constructor(e,s,r){super(e,s,[Vt.transformConstraint+"|"+r]);x(this,"constraintIndex",0);this.constraintIndex=r}getFrameEntries(){return 7}setFrame(e,s,r,n,a,o,h,l){let c=this.frames;e*=7,c[e]=s,c[e+1]=r,c[e+2]=n,c[e+3]=a,c[e+4]=o,c[e+5]=h,c[e+6]=l}apply(e,s,r,n,a,o,h){let l=e.transformConstraints[this.constraintIndex];if(!l.active)return;let c=this.frames;if(r<c[0]){let v=l.data;switch(o){case ht.setup:l.mixRotate=v.mixRotate,l.mixX=v.mixX,l.mixY=v.mixY,l.mixScaleX=v.mixScaleX,l.mixScaleY=v.mixScaleY,l.mixShearY=v.mixShearY;return;case ht.first:l.mixRotate+=(v.mixRotate-l.mixRotate)*a,l.mixX+=(v.mixX-l.mixX)*a,l.mixY+=(v.mixY-l.mixY)*a,l.mixScaleX+=(v.mixScaleX-l.mixScaleX)*a,l.mixScaleY+=(v.mixScaleY-l.mixScaleY)*a,l.mixShearY+=(v.mixShearY-l.mixShearY)*a}return}let u,d,f,m,p,g,y=we.search(c,r,7),_=this.curves[y/7];switch(_){case 0:let v=c[y];u=c[y+1],d=c[y+2],f=c[y+3],m=c[y+4],p=c[y+5],g=c[y+6];let b=(r-v)/(c[y+7]-v);u+=(c[y+7+1]-u)*b,d+=(c[y+7+2]-d)*b,f+=(c[y+7+3]-f)*b,m+=(c[y+7+4]-m)*b,p+=(c[y+7+5]-p)*b,g+=(c[y+7+6]-g)*b;break;case 1:u=c[y+1],d=c[y+2],f=c[y+3],m=c[y+4],p=c[y+5],g=c[y+6];break;default:u=this.getBezierValue(r,y,1,_-2),d=this.getBezierValue(r,y,2,_+18-2),f=this.getBezierValue(r,y,3,_+36-2),m=this.getBezierValue(r,y,4,_+54-2),p=this.getBezierValue(r,y,5,_+72-2),g=this.getBezierValue(r,y,6,_+90-2)}if(o==ht.setup){let v=l.data;l.mixRotate=v.mixRotate+(u-v.mixRotate)*a,l.mixX=v.mixX+(d-v.mixX)*a,l.mixY=v.mixY+(f-v.mixY)*a,l.mixScaleX=v.mixScaleX+(m-v.mixScaleX)*a,l.mixScaleY=v.mixScaleY+(p-v.mixScaleY)*a,l.mixShearY=v.mixShearY+(g-v.mixShearY)*a}else l.mixRotate+=(u-l.mixRotate)*a,l.mixX+=(d-l.mixX)*a,l.mixY+=(f-l.mixY)*a,l.mixScaleX+=(m-l.mixScaleX)*a,l.mixScaleY+=(p-l.mixScaleY)*a,l.mixShearY+=(g-l.mixShearY)*a}},sw=class extends wr{constructor(e,s,r){super(e,s,Vt.pathConstraintPosition+"|"+r);x(this,"constraintIndex",0);this.constraintIndex=r}apply(e,s,r,n,a,o,h){let l=e.pathConstraints[this.constraintIndex];l.active&&(l.position=this.getAbsoluteValue(r,a,o,l.position,l.data.position))}},rw=class extends wr{constructor(e,s,r){super(e,s,Vt.pathConstraintSpacing+"|"+r);x(this,"constraintIndex",0);this.constraintIndex=r}apply(e,s,r,n,a,o,h){let l=e.pathConstraints[this.constraintIndex];l.active&&(l.spacing=this.getAbsoluteValue(r,a,o,l.spacing,l.data.spacing))}},iw=class extends qr{constructor(e,s,r){super(e,s,[Vt.pathConstraintMix+"|"+r]);x(this,"constraintIndex",0);this.constraintIndex=r}getFrameEntries(){return 4}setFrame(e,s,r,n,a){let o=this.frames;e<<=2,o[e]=s,o[e+1]=r,o[e+2]=n,o[e+3]=a}apply(e,s,r,n,a,o,h){let l=e.pathConstraints[this.constraintIndex];if(!l.active)return;let c=this.frames;if(r<c[0]){switch(o){case ht.setup:l.mixRotate=l.data.mixRotate,l.mixX=l.data.mixX,l.mixY=l.data.mixY;return;case ht.first:l.mixRotate+=(l.data.mixRotate-l.mixRotate)*a,l.mixX+=(l.data.mixX-l.mixX)*a,l.mixY+=(l.data.mixY-l.mixY)*a}return}let u,d,f,m=we.search(c,r,4),p=this.curves[m>>2];switch(p){case 0:let g=c[m];u=c[m+1],d=c[m+2],f=c[m+3];let y=(r-g)/(c[m+4]-g);u+=(c[m+4+1]-u)*y,d+=(c[m+4+2]-d)*y,f+=(c[m+4+3]-f)*y;break;case 1:u=c[m+1],d=c[m+2],f=c[m+3];break;default:u=this.getBezierValue(r,m,1,p-2),d=this.getBezierValue(r,m,2,p+18-2),f=this.getBezierValue(r,m,3,p+36-2)}if(o==ht.setup){let g=l.data;l.mixRotate=g.mixRotate+(u-g.mixRotate)*a,l.mixX=g.mixX+(d-g.mixX)*a,l.mixY=g.mixY+(f-g.mixY)*a}else l.mixRotate+=(u-l.mixRotate)*a,l.mixX+=(d-l.mixX)*a,l.mixY+=(f-l.mixY)*a}},Jn=class extends wr{constructor(e,s,r,n){super(e,s,n+"|"+r);x(this,"constraintIndex",0);this.constraintIndex=r}apply(e,s,r,n,a,o,h){let l;if(this.constraintIndex==-1){const c=r>=this.frames[0]?this.getCurveValue(r):0;for(const u of e.physicsConstraints)u.active&&this.global(u.data)&&this.set(u,this.getAbsoluteValue2(r,a,o,this.get(u),this.setup(u),c))}else l=e.physicsConstraints[this.constraintIndex],l.active&&this.set(l,this.getAbsoluteValue(r,a,o,this.get(l),this.setup(l)))}},nw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintInertia)}setup(t){return t.data.inertia}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}},aw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintStrength)}setup(t){return t.data.strength}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}},ow=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintDamping)}setup(t){return t.data.damping}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}},lw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintMass)}setup(t){return 1/t.data.massInverse}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}},hw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintWind)}setup(t){return t.data.wind}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}},cw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintGravity)}setup(t){return t.data.gravity}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}},uw=class extends Jn{constructor(t,e,s){super(t,e,s,Vt.physicsConstraintMix)}setup(t){return t.data.mix}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}};var On;let dw=(On=class extends we{constructor(e,s){super(e,On.propertyIds);x(this,"constraintIndex");this.constraintIndex=s}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s}apply(e,s,r,n,a,o,h){let l;if(this.constraintIndex!=-1&&(l=e.physicsConstraints[this.constraintIndex],!l.active))return;const c=this.frames;if(s>r)this.apply(e,s,Number.MAX_VALUE,[],a,o,h),s=-1;else if(s>=c[c.length-1])return;if(!(r<c[0])&&(s<c[0]||r>=c[we.search1(c,s)+1]))if(l!=null)l.reset();else for(const u of e.physicsConstraints)u.active&&u.reset()}},x(On,"propertyIds",[Vt.physicsConstraintReset.toString()]),On);var ys;let fw=(ys=class extends we{constructor(e,s,r){super(e,[Vt.sequence+"|"+s+"|"+r.sequence.id]);x(this,"slotIndex");x(this,"attachment");this.slotIndex=s,this.attachment=r}getFrameEntries(){return ys.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,s,r,n,a){let o=this.frames;e*=ys.ENTRIES,o[e]=s,o[e+ys.MODE]=r|n<<4,o[e+ys.DELAY]=a}apply(e,s,r,n,a,o,h){let l=e.slots[this.slotIndex];if(!l.bone.active)return;let c=l.attachment,u=this.attachment;if(c!=u&&(!(c instanceof Pi)||c.timelineAttachment!=u))return;if(h==hs.mixOut){o==ht.setup&&(l.sequenceIndex=-1);return}let d=this.frames;if(r<d[0]){(o==ht.setup||o==ht.first)&&(l.sequenceIndex=-1);return}let f=we.search(d,r,ys.ENTRIES),m=d[f],p=d[f+ys.MODE],g=d[f+ys.DELAY];if(!this.attachment.sequence)return;let y=p>>4,_=this.attachment.sequence.regions.length,v=D1[p&15];if(v!=Qe.hold)switch(y+=(r-m)/g+1e-5|0,v){case Qe.once:y=Math.min(_-1,y);break;case Qe.loop:y%=_;break;case Qe.pingpong:{let b=(_<<1)-2;y=b==0?0:y%b,y>=_&&(y=b-y);break}case Qe.onceReverse:y=Math.max(_-1-y,0);break;case Qe.loopReverse:y=_-1-y%_;break;case Qe.pingpongReverse:{let b=(_<<1)-2;y=b==0?0:(y+_-1)%b,y>=_&&(y=b-y)}}l.sequenceIndex=y}},x(ys,"ENTRIES",3),x(ys,"MODE",1),x(ys,"DELAY",2),ys);var bi;let rF=(bi=class{constructor(t){x(this,"data");x(this,"tracks",new Array);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",new Array);x(this,"listeners",new Array);x(this,"queue",new nF(this));x(this,"propertyIDs",new L1);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new ic(()=>new iF));this.data=t}static emptyAnimation(){return bi._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(!n)continue;n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;let a=t*n.timeScale;if(n.delay>0){if(n.delay-=a,n.delay>0)continue;a=-n.delay,n.delay=0}let o=n.next;if(o){let h=n.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=n.timeScale==0?0:(h/n.timeScale+t)*o.timeScale,n.trackTime+=a,this.setCurrent(s,o,!0);o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){e[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,t)){let h=n.mixingFrom;for(n.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}n.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let r=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.nextTrackLast!=-1&&t.mixTime>=t.mixDuration?((s.totalAlpha==0||t.mixDuration==0)&&(t.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),r):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let e=this.events,s=this.tracks,r=!1;for(let d=0,f=s.length;d<f;d++){let m=s[d];if(!m||m.delay>0)continue;r=!0;let p=d==0?ht.first:m.mixBlend,g=m.alpha;m.mixingFrom?g*=this.applyMixingFrom(m,t,p):m.trackTime>=m.trackEnd&&!m.next&&(g=0);let y=g>=m.alphaAttachmentThreshold,_=m.animationLast,v=m.getAnimationTime(),b=v,T=e;m.reverse&&(b=m.animation.duration-b,T=null);let S=m.animation.timelines,w=S.length;if(d==0&&g==1||p==ht.add){d==0&&(y=!0);for(let E=0;E<w;E++){var n=S[E];n instanceof ba?this.applyAttachmentTimeline(n,t,b,p,y):n.apply(t,_,b,T,g,p,hs.mixIn)}}else{let E=m.timelineMode,A=m.shortestRotation,P=!A&&m.timelinesRotation.length!=w<<1;P&&(m.timelinesRotation.length=w<<1);for(let I=0;I<w;I++){let C=S[I],R=E[I]==Bf?p:ht.setup;!A&&C instanceof ac?this.applyRotateTimeline(C,t,b,g,R,m.timelinesRotation,I<<1,P):C instanceof ba?this.applyAttachmentTimeline(C,t,b,p,y):C.apply(t,_,b,T,g,R,hs.mixIn)}}this.queueEvents(m,v),e.length=0,m.nextAnimationLast=v,m.nextTrackLast=m.trackTime}for(var a=this.unkeyedState+Zx,o=t.slots,h=0,l=t.slots.length;h<l;h++){var c=o[h];if(c.attachmentState==a){var u=c.data.attachmentName;c.setAttachment(u?t.getAttachment(c.data.index,u):null)}}return this.unkeyedState+=2,this.queue.drain(),r}applyMixingFrom(t,e,s){let r=t.mixingFrom;r.mixingFrom&&this.applyMixingFrom(r,e,s);let n=0;t.mixDuration==0?(n=1,s==ht.first&&(s=ht.setup)):(n=t.mixTime/t.mixDuration,n>1&&(n=1),s!=ht.first&&(s=r.mixBlend));let a=n<r.mixAttachmentThreshold,o=n<r.mixDrawOrderThreshold,h=r.animation.timelines,l=h.length,c=r.alpha*t.interruptAlpha,u=c*(1-n),d=r.animationLast,f=r.getAnimationTime(),m=f,p=null;if(r.reverse?m=r.animation.duration-m:n<r.eventThreshold&&(p=this.events),s==ht.add)for(let g=0;g<l;g++)h[g].apply(e,d,m,p,u,s,hs.mixOut);else{let g=r.timelineMode,y=r.timelineHoldMix,_=r.shortestRotation,v=!_&&r.timelinesRotation.length!=l<<1;v&&(r.timelinesRotation.length=l<<1),r.totalAlpha=0;for(let b=0;b<l;b++){let T=h[b],S=hs.mixOut,w,E=0;switch(g[b]){case Bf:if(!o&&T instanceof Lo)continue;w=s,E=u;break;case qx:w=ht.setup,E=u;break;case Kx:w=s,E=c;break;case Of:w=ht.setup,E=c;break;default:w=ht.setup;let A=y[b];E=c*Math.max(0,1-A.mixTime/A.mixDuration);break}r.totalAlpha+=E,!_&&T instanceof ac?this.applyRotateTimeline(T,e,m,E,w,r.timelinesRotation,b<<1,v):T instanceof ba?this.applyAttachmentTimeline(T,e,m,w,a&&E>=r.alphaAttachmentThreshold):(o&&T instanceof Lo&&w==ht.setup&&(S=hs.mixIn),T.apply(e,d,m,p,E,w,S))}}return t.mixDuration>0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,n}applyAttachmentTimeline(t,e,s,r,n){var a=e.slots[t.slotIndex];a.bone.active&&(s<t.frames[0]?(r==ht.setup||r==ht.first)&&this.setAttachment(e,a,a.data.attachmentName,n):this.setAttachment(e,a,t.attachmentNames[we.search1(t.frames,s)],n),a.attachmentState<=this.unkeyedState&&(a.attachmentState=this.unkeyedState+Zx))}setAttachment(t,e,s,r){e.setAttachment(s?t.getAttachment(e.data.index,s):null),r&&(e.attachmentState=this.unkeyedState+oF)}applyRotateTimeline(t,e,s,r,n,a,o,h){if(h&&(a[o]=0),r==1){t.apply(e,0,s,null,1,n,hs.mixIn);return}let l=e.bones[t.boneIndex];if(!l.active)return;let c=t.frames,u=0,d=0;if(s<c[0])switch(n){case ht.setup:l.rotation=l.data.rotation;default:return;case ht.first:u=l.rotation,d=l.data.rotation}else u=n==ht.setup?l.data.rotation:l.rotation,d=l.data.rotation+t.getCurveValue(s);let f=0,m=d-u;if(m-=Math.ceil(m/360-.5)*360,m==0)f=a[o];else{let p=0,g=0;h?(p=0,g=m):(p=a[o],g=a[o+1]);let y=p-p%360;f=m+y;let _=m>=0,v=p>=0;Math.abs(g)<=90&&yt.signum(g)!=yt.signum(m)&&(Math.abs(p-y)>180?(f+=360*yt.signum(p),v=_):y!=0?f-=360*yt.signum(p):v=_),v!=_&&(f+=360*yt.signum(p)),a[o]=f}a[o+1]=m,l.rotation=u+f*r}queueEvents(t,e){let s=t.animationStart,r=t.animationEnd,n=r-s,a=t.trackLast%n,o=this.events,h=0,l=o.length;for(;h<l;h++){let u=o[h];if(u.time<a)break;u.time>r||this.queue.event(t,u)}let c=!1;if(t.loop)if(n==0)c=!0;else{const u=Math.floor(t.trackTime/n);c=u>0&&u>Math.floor(t.trackLast/n)}else c=e>=r&&t.animationLast<r;for(c&&this.queue.complete(t);h<l;h++){let u=o[h];u.time<s||this.queue.event(t,u)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){let r=s.mixingFrom;if(!r)break;this.queue.end(r),s.mixingFrom=null,s.mixingTo=null,s=r}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(s&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let r=!0,n=this.expandToIndex(t);n&&(n.nextTrackLast==-1?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,r=!1):this.clearNext(n));let a=this.trackEntry(t,e,s,n);return this.setCurrent(t,a,r),this.queue.drain(),a}addAnimation(t,e,s=!1,r=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,s,r)}addAnimationWith(t,e,s=!1,r=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let a=this.trackEntry(t,e,s,n);return n?(n.next=a,a.previous=n,r<=0&&(r=Math.max(r+n.getTrackComplete()-a.mixDuration,0))):(this.setCurrent(t,a,!0),this.queue.drain(),r<0&&(r=0)),a.delay=r,a}setEmptyAnimation(t,e=0){let s=this.setAnimationWith(t,bi.emptyAnimation(),!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){let r=this.addAnimationWith(t,bi.emptyAnimation(),!1,s);return s<=0&&(r.delay=Math.max(r.delay+r.mixDuration-e,0)),r.mixDuration=e,r.trackEnd=e,r}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++){let n=this.tracks[s];n&&this.setEmptyAnimation(n.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(xt.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,s,r){let n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=s,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=r?this.data.getMix(r.animation,e):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=ht.replace,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let t=this.tracks;for(let e=0,s=t.length;e<s;e++){let r=t[e];if(r){for(;r.mixingFrom;)r=r.mixingFrom;do(!r.mixingTo||r.mixBlend!=ht.add)&&this.computeHold(r),r=r.mixingTo;while(r)}}}computeHold(t){let e=t.mixingTo,s=t.animation.timelines,r=t.animation.timelines.length,n=t.timelineMode;n.length=r;let a=t.timelineHoldMix;a.length=0;let o=this.propertyIDs;if(e&&e.holdPrevious){for(let h=0;h<r;h++)n[h]=o.addAll(s[h].getPropertyIds())?Of:Kx;return}t:for(let h=0;h<r;h++){let l=s[h],c=l.getPropertyIds();if(!o.addAll(c))n[h]=Bf;else if(!e||l instanceof ba||l instanceof Lo||l instanceof jp||!e.animation.hasTimeline(c))n[h]=qx;else{for(let u=e.mixingTo;u;u=u.mixingTo)if(!u.animation.hasTimeline(c)){if(t.mixDuration>0){n[h]=aF,a[h]=u;continue t}break}n[h]=Of}}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},x(bi,"_emptyAnimation",new Wp("<empty>",[],0)),bi),iF=class{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"holdPrevious",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"_mixDuration",0);x(this,"interruptAlpha",0);x(this,"totalAlpha",0);x(this,"mixBlend",ht.replace);x(this,"timelineMode",new Array);x(this,"timelineHoldMix",new Array);x(this,"timelinesRotation",new Array)}get mixDuration(){return this._mixDuration}set mixDuration(t){this._mixDuration=t}setMixDurationWithDelay(t,e){this._mixDuration=t,e<=0&&(this.previous!=null?e=Math.max(e+this.previous.getTrackComplete()-t,0):e=0),this.delay=e}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let t=this.animationEnd-this.animationStart;return t==0?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(t!=0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}},nF=class{constructor(t){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=t}start(t){this.objects.push(As.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(As.interrupt),this.objects.push(t)}end(t){this.objects.push(As.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(As.dispose),this.objects.push(t)}complete(t){this.objects.push(As.complete),this.objects.push(t)}event(t,e){this.objects.push(As.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects;for(let e=0;e<t.length;e+=2){let s=t[e],r=t[e+1],n=this.animState.listeners.slice();switch(s){case As.start:r.listener&&r.listener.start&&r.listener.start(r);for(let o=0;o<n.length;o++){let h=n[o];h.start&&h.start(r)}break;case As.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let o=0;o<n.length;o++){let h=n[o];h.interrupt&&h.interrupt(r)}break;case As.end:r.listener&&r.listener.end&&r.listener.end(r);for(let o=0;o<n.length;o++){let h=n[o];h.end&&h.end(r)}case As.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let o=0;o<n.length;o++){let h=n[o];h.dispose&&h.dispose(r)}this.animState.trackEntryPool.free(r);break;case As.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let o=0;o<n.length;o++){let h=n[o];h.complete&&h.complete(r)}break;case As.event:let a=t[e+++2];r.listener&&r.listener.event&&r.listener.event(r,a);for(let o=0;o<n.length;o++){let h=n[o];h.event&&h.event(r,a)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};var As;(function(i){i[i.start=0]="start",i[i.interrupt=1]="interrupt",i[i.end=2]="end",i[i.dispose=3]="dispose",i[i.complete=4]="complete",i[i.event=5]="event"})(As||(As={}));const Bf=0,qx=1,Kx=2,Of=3,aF=4,Zx=1,oF=2;let lF=class{constructor(t){x(this,"skeletonData");x(this,"animationToMixTime",{});x(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let r=this.skeletonData.findAnimation(t);if(!r)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(r,n,s)}setMixWith(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let r=t.name+"."+e.name;this.animationToMixTime[r]=s}getMix(t,e){let s=t.name+"."+e.name,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}},hF=class mw extends Pi{constructor(e){super(e);x(this,"color",new Dt(1,1,1,1))}copy(){let e=new mw(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},Bo=class pw extends Pi{constructor(e){super(e);x(this,"endSlot",null);x(this,"color",new Dt(.2275,.2275,.8078,1))}copy(){let e=new pw(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},cF=class{constructor(t){x(this,"_image");this._image=t}getImage(){return this._image}};var ze;(function(i){i[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.MipMap=9987]="MipMap",i[i.MipMapNearestNearest=9984]="MipMapNearestNearest",i[i.MipMapLinearNearest=9985]="MipMapLinearNearest",i[i.MipMapNearestLinear=9986]="MipMapNearestLinear",i[i.MipMapLinearLinear=9987]="MipMapLinearLinear"})(ze||(ze={}));var wi;(function(i){i[i.MirroredRepeat=33648]="MirroredRepeat",i[i.ClampToEdge=33071]="ClampToEdge",i[i.Repeat=10497]="Repeat"})(wi||(wi={}));let uF=class{constructor(){x(this,"texture");x(this,"u",0);x(this,"v",0);x(this,"u2",0);x(this,"v2",0);x(this,"width",0);x(this,"height",0);x(this,"degrees",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0)}},dF=class{constructor(t){x(this,"pages",new Array);x(this,"regions",new Array);let e=new fF(t),s=new Array(4),r={};r.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},r.format=()=>{},r.filter=c=>{c.minFilter=xt.enumValue(ze,s[1]),c.magFilter=xt.enumValue(ze,s[2])},r.repeat=c=>{s[1].indexOf("x")!=-1&&(c.uWrap=wi.Repeat),s[1].indexOf("y")!=-1&&(c.vWrap=wi.Repeat)},r.pma=c=>{c.pma=s[1]=="true"};var n={};n.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},n.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},n.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},n.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},n.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},n.rotate=c=>{let u=s[1];u=="true"?c.degrees=90:u!="false"&&(c.degrees=parseInt(u))},n.index=c=>{c.index=parseInt(s[1])};let a=e.readLine();for(;a&&a.trim().length==0;)a=e.readLine();for(;!(!a||a.trim().length==0||e.readEntry(s,a)==0);)a=e.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length==0)o=null,a=e.readLine();else if(o){let c=new gw(o,a);for(;;){let u=e.readEntry(s,a=e.readLine());if(u==0)break;let d=n[s[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(s[0]);let f=[];for(let m=0;m<u;m++)f.push(parseInt(s[m+1]));l.push(f)}}c.originalWidth==0&&c.originalHeight==0&&(c.originalWidth=c.width,c.originalHeight=c.height),h&&h.length>0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees==90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new mF(a.trim());e.readEntry(s,a=e.readLine())!=0;){let c=r[s[0]];c&&c(o)}this.pages.push(o)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){var t;for(let e=0;e<this.pages.length;e++)(t=this.pages[e].texture)==null||t.dispose()}},fF=class{constructor(t){x(this,"lines");x(this,"index",0);this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||(e=e.trim(),e.length==0))return 0;let s=e.indexOf(":");if(s==-1)return 0;t[0]=e.substr(0,s).trim();for(let r=1,n=s+1;;r++){let a=e.indexOf(",",n);if(a==-1)return t[r]=e.substr(n).trim(),r;if(t[r]=e.substr(n,a-n).trim(),n=a+1,r==4)return 4}}},mF=class{constructor(t){x(this,"name");x(this,"minFilter",ze.Nearest);x(this,"magFilter",ze.Nearest);x(this,"uWrap",wi.ClampToEdge);x(this,"vWrap",wi.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(this,"regions",new Array);this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}},gw=class extends uF{constructor(e,s){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=e,this.name=s,e.regions.push(this)}},Qc=class qm extends Pi{constructor(e,s){super(e);x(this,"region",null);x(this,"path");x(this,"regionUVs",[]);x(this,"uvs",[]);x(this,"triangles",[]);x(this,"color",new Dt(1,1,1,1));x(this,"width",0);x(this,"height",0);x(this,"hullLength",0);x(this,"edges",[]);x(this,"parentMesh",null);x(this,"sequence",null);x(this,"tempColor",new Dt(0,0,0,0));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=xt.newFloatArray(e.length));let s=this.uvs,r=this.uvs.length,n=this.region.u,a=this.region.v,o=0,h=0;if(this.region instanceof gw){let l=this.region,c=l.page,u=c.width,d=c.height;switch(l.degrees){case 90:n-=(l.originalHeight-l.offsetY-l.height)/u,a-=(l.originalWidth-l.offsetX-l.width)/d,o=l.originalHeight/u,h=l.originalWidth/d;for(let f=0;f<r;f+=2)s[f]=n+e[f+1]*o,s[f+1]=a+(1-e[f])*h;return;case 180:n-=(l.originalWidth-l.offsetX-l.width)/u,a-=l.offsetY/d,o=l.originalWidth/u,h=l.originalHeight/d;for(let f=0;f<r;f+=2)s[f]=n+(1-e[f])*o,s[f+1]=a+(1-e[f+1])*h;return;case 270:n-=l.offsetY/u,a-=l.offsetX/d,o=l.originalHeight/u,h=l.originalWidth/d;for(let f=0;f<r;f+=2)s[f]=n+(1-e[f+1])*o,s[f+1]=a+e[f]*h;return}n-=l.offsetX/u,a-=(l.originalHeight-l.offsetY-l.height)/d,o=l.originalWidth/u,h=l.originalHeight/d}else this.region?(o=this.region.u2-n,h=this.region.v2-a):(n=a=0,o=h=1);for(let l=0;l<r;l+=2)s[l]=n+e[l]*o,s[l+1]=a+e[l+1]*h}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new qm(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),xt.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=this.uvs instanceof Float32Array?xt.newFloatArray(this.uvs.length):new Array(this.uvs.length),xt.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),xt.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),xt.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,s,r,n,a,o){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,s,r,n,a,o)}newLinkedMesh(){let e=new qm(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),e.timelineAttachment=this.timelineAttachment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},oc=class yw extends Pi{constructor(e){super(e);x(this,"lengths",[]);x(this,"closed",!1);x(this,"constantSpeed",!1);x(this,"color",new Dt(1,1,1,1))}copy(){let e=new yw(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),xt.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},pF=class xw extends Pi{constructor(e){super(e);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"color",new Dt(.38,.94,0,1))}computeWorldPosition(e,s){return s.x=this.x*e.a+this.y*e.b+e.worldX,s.y=this.x*e.c+this.y*e.d+e.worldY,s}computeWorldRotation(e){const s=this.rotation*yt.degRad,r=Math.cos(s),n=Math.sin(s),a=r*e.a+n*e.b,o=r*e.c+n*e.d;return yt.atan2Deg(o,a)}copy(){let e=new xw(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}};var Gt;let qp=(Gt=class extends B1{constructor(e,s){super(e);x(this,"x",0);x(this,"y",0);x(this,"scaleX",1);x(this,"scaleY",1);x(this,"rotation",0);x(this,"width",0);x(this,"height",0);x(this,"color",new Dt(1,1,1,1));x(this,"path");x(this,"region",null);x(this,"sequence",null);x(this,"offset",xt.newFloatArray(8));x(this,"uvs",xt.newFloatArray(8));x(this,"tempColor",new Dt(1,1,1,1));this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.region,s=this.uvs;if(e==null){s[0]=0,s[1]=0,s[2]=0,s[3]=1,s[4]=1,s[5]=1,s[6]=1,s[7]=0;return}let r=this.width/this.region.originalWidth*this.scaleX,n=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*r,o=-this.height/2*this.scaleY+this.region.offsetY*n,h=a+this.region.width*r,l=o+this.region.height*n,c=this.rotation*yt.degRad,u=Math.cos(c),d=Math.sin(c),f=this.x,m=this.y,p=a*u+f,g=a*d,y=o*u+m,_=o*d,v=h*u+f,b=h*d,T=l*u+m,S=l*d,w=this.offset;w[0]=p-_,w[1]=y+g,w[2]=p-S,w[3]=T+g,w[4]=v-S,w[5]=T+b,w[6]=v-_,w[7]=y+b,e.degrees==90?(s[0]=e.u2,s[1]=e.v2,s[2]=e.u,s[3]=e.v2,s[4]=e.u,s[5]=e.v,s[6]=e.u2,s[7]=e.v):(s[0]=e.u,s[1]=e.v2,s[2]=e.u,s[3]=e.v,s[4]=e.u2,s[5]=e.v,s[6]=e.u2,s[7]=e.v2)}computeWorldVertices(e,s,r,n){this.sequence!=null&&this.sequence.apply(e,this);let a=e.bone,o=this.offset,h=a.worldX,l=a.worldY,c=a.a,u=a.b,d=a.c,f=a.d,m=0,p=0;m=o[0],p=o[1],s[r]=m*c+p*u+h,s[r+1]=m*d+p*f+l,r+=n,m=o[2],p=o[3],s[r]=m*c+p*u+h,s[r+1]=m*d+p*f+l,r+=n,m=o[4],p=o[5],s[r]=m*c+p*u+h,s[r+1]=m*d+p*f+l,r+=n,m=o[6],p=o[7],s[r]=m*c+p*u+h,s[r+1]=m*d+p*f+l}copy(){let e=new Gt(this.name,this.path);return e.region=this.region,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,xt.arrayCopy(this.uvs,0,e.uvs,0,8),xt.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},x(Gt,"X1",0),x(Gt,"Y1",1),x(Gt,"C1R",2),x(Gt,"C1G",3),x(Gt,"C1B",4),x(Gt,"C1A",5),x(Gt,"U1",6),x(Gt,"V1",7),x(Gt,"X2",8),x(Gt,"Y2",9),x(Gt,"C2R",10),x(Gt,"C2G",11),x(Gt,"C2B",12),x(Gt,"C2A",13),x(Gt,"U2",14),x(Gt,"V2",15),x(Gt,"X3",16),x(Gt,"Y3",17),x(Gt,"C3R",18),x(Gt,"C3G",19),x(Gt,"C3B",20),x(Gt,"C3A",21),x(Gt,"U3",22),x(Gt,"V3",23),x(Gt,"X4",24),x(Gt,"Y4",25),x(Gt,"C4R",26),x(Gt,"C4G",27),x(Gt,"C4B",28),x(Gt,"C4A",29),x(Gt,"U4",30),x(Gt,"V4",31),Gt),Jx=class{constructor(t){x(this,"atlas");this.atlas=t}loadSequence(t,e,s){let r=s.regions;for(let n=0,a=r.length;n<a;n++){let o=s.getPath(e,n),h=this.atlas.findRegion(o);if(h==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+t+")");r[n]=h}}newRegionAttachment(t,e,s,r){let n=new qp(e,s);if(r!=null)this.loadSequence(e,s,r);else{let a=this.atlas.findRegion(s);if(!a)throw new Error("Region not found in atlas: "+s+" (region attachment: "+e+")");n.region=a}return n}newMeshAttachment(t,e,s,r){let n=new Qc(e,s);if(r!=null)this.loadSequence(e,s,r);else{let a=this.atlas.findRegion(s);if(!a)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+e+")");n.region=a}return n}newBoundingBoxAttachment(t,e){return new hF(e)}newPathAttachment(t,e){return new oc(e)}newPointAttachment(t,e){return new pF(e)}newClippingAttachment(t,e){return new Bo(e)}},bw=class{constructor(t,e,s){x(this,"index",0);x(this,"name");x(this,"parent",null);x(this,"length",0);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",1);x(this,"scaleY",1);x(this,"shearX",0);x(this,"shearY",0);x(this,"inherit",Ae.Normal);x(this,"skinRequired",!1);x(this,"color",new Dt);x(this,"icon");x(this,"visible",!1);if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=s}};var Ae;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(Ae||(Ae={}));let Qx=class{constructor(t,e,s){x(this,"data");x(this,"skeleton");x(this,"parent",null);x(this,"children",new Array);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"ax",0);x(this,"ay",0);x(this,"arotation",0);x(this,"ascaleX",0);x(this,"ascaleY",0);x(this,"ashearX",0);x(this,"ashearY",0);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"inherit",Ae.Normal);x(this,"sorted",!1);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(t){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,s,r,n,a,o){this.ax=t,this.ay=e,this.arotation=s,this.ascaleX=r,this.ascaleY=n,this.ashearX=a,this.ashearY=o;let h=this.parent;if(!h){let f=this.skeleton;const m=f.scaleX,p=f.scaleY,g=(s+a)*yt.degRad,y=(s+90+o)*yt.degRad;this.a=Math.cos(g)*r*m,this.b=Math.cos(y)*n*m,this.c=Math.sin(g)*r*p,this.d=Math.sin(y)*n*p,this.worldX=t*m+f.x,this.worldY=e*p+f.y;return}let l=h.a,c=h.b,u=h.c,d=h.d;switch(this.worldX=l*t+c*e+h.worldX,this.worldY=u*t+d*e+h.worldY,this.inherit){case Ae.Normal:{const f=(s+a)*yt.degRad,m=(s+90+o)*yt.degRad,p=Math.cos(f)*r,g=Math.cos(m)*n,y=Math.sin(f)*r,_=Math.sin(m)*n;this.a=l*p+c*y,this.b=l*g+c*_,this.c=u*p+d*y,this.d=u*g+d*_;return}case Ae.OnlyTranslation:{const f=(s+a)*yt.degRad,m=(s+90+o)*yt.degRad;this.a=Math.cos(f)*r,this.b=Math.cos(m)*n,this.c=Math.sin(f)*r,this.d=Math.sin(m)*n;break}case Ae.NoRotationOrReflection:{let f=1/this.skeleton.scaleX,m=1/this.skeleton.scaleY;l*=f,u*=m;let p=l*l+u*u,g=0;p>1e-4?(p=Math.abs(l*d*m-c*f*u)/p,c=u*p,d=l*p,g=Math.atan2(u,l)*yt.radDeg):(l=0,u=0,g=90-Math.atan2(d,c)*yt.radDeg);const y=(s+a-g)*yt.degRad,_=(s+o-g+90)*yt.degRad,v=Math.cos(y)*r,b=Math.cos(_)*n,T=Math.sin(y)*r,S=Math.sin(_)*n;this.a=l*v-c*T,this.b=l*b-c*S,this.c=u*v+d*T,this.d=u*b+d*S;break}case Ae.NoScale:case Ae.NoScaleOrReflection:{s*=yt.degRad;const f=Math.cos(s),m=Math.sin(s);let p=(l*f+c*m)/this.skeleton.scaleX,g=(u*f+d*m)/this.skeleton.scaleY,y=Math.sqrt(p*p+g*g);y>1e-5&&(y=1/y),p*=y,g*=y,y=Math.sqrt(p*p+g*g),this.inherit==Ae.NoScale&&l*d-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(y=-y),s=Math.PI/2+Math.atan2(g,p);const _=Math.cos(s)*y,v=Math.sin(s)*y;a*=yt.degRad,o=(90+o)*yt.degRad;const b=Math.cos(a)*r,T=Math.cos(o)*n,S=Math.sin(a)*r,w=Math.sin(o)*n;this.a=p*b+_*S,this.b=p*T+_*w,this.c=g*b+v*S,this.d=g*T+v*w;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let t=this.parent;if(!t){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*yt.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*yt.radDeg;return}let e=t.a,s=t.b,r=t.c,n=t.d,a=1/(e*n-s*r),o=n*a,h=s*a,l=r*a,c=e*a,u=this.worldX-t.worldX,d=this.worldY-t.worldY;this.ax=u*o-d*h,this.ay=d*c-u*l;let f,m,p,g;if(this.inherit==Ae.OnlyTranslation)f=this.a,m=this.b,p=this.c,g=this.d;else{switch(this.inherit){case Ae.NoRotationOrReflection:{let T=Math.abs(e*n-s*r)/(e*e+r*r);s=-r*this.skeleton.scaleX*T/this.skeleton.scaleY,n=e*this.skeleton.scaleY*T/this.skeleton.scaleX,a=1/(e*n-s*r),o=n*a,h=s*a;break}case Ae.NoScale:case Ae.NoScaleOrReflection:let y=yt.cosDeg(this.rotation),_=yt.sinDeg(this.rotation);e=(e*y+s*_)/this.skeleton.scaleX,r=(r*y+n*_)/this.skeleton.scaleY;let v=Math.sqrt(e*e+r*r);v>1e-5&&(v=1/v),e*=v,r*=v,v=Math.sqrt(e*e+r*r),this.inherit==Ae.NoScale&&a<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(v=-v);let b=yt.PI/2+Math.atan2(r,e);s=Math.cos(b)*v,n=Math.sin(b)*v,a=1/(e*n-s*r),o=n*a,h=s*a,l=r*a,c=e*a}f=o*this.a-h*this.c,m=o*this.b-h*this.d,p=c*this.c-l*this.a,g=c*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+p*p),this.ascaleX>1e-4){let y=f*g-m*p;this.ascaleY=y/this.ascaleX,this.ashearY=-Math.atan2(f*m+p*g,y)*yt.radDeg,this.arotation=Math.atan2(p,f)*yt.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,m)*yt.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*yt.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*yt.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,r=t.y-this.worldY;return t.x=s*this.d*e-r*this.b*e,t.y=r*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(t==null)throw new Error("world cannot be null.");return this.parent==null?t:this.parent.worldToLocal(t)}parentToWorld(t){if(t==null)throw new Error("world cannot be null.");return this.parent==null?t:this.parent.localToWorld(t)}worldToLocalRotation(t){let e=yt.sinDeg(t),s=yt.cosDeg(t);return Math.atan2(this.a*e-this.c*s,this.d*s-this.b*e)*yt.radDeg+this.rotation-this.shearX}localToWorldRotation(t){t-=this.rotation-this.shearX;let e=yt.sinDeg(t),s=yt.cosDeg(t);return Math.atan2(s*this.c+e*this.d,s*this.a+e*this.b)*yt.radDeg}rotateWorld(t){t*=yt.degRad;const e=Math.sin(t),s=Math.cos(t),r=this.a,n=this.b;this.a=s*r-e*this.c,this.b=s*n-e*this.d,this.c=e*r+s*this.c,this.d=e*n+s*this.d}},tu=class{constructor(t,e,s){x(this,"name");x(this,"order");x(this,"skinRequired");this.name=t,this.order=e,this.skinRequired=s}},vw=class{constructor(t,e){x(this,"data");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"time",0);x(this,"volume",0);x(this,"balance",0);if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}},_w=class{constructor(t){x(this,"name");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"audioPath",null);x(this,"volume",0);x(this,"balance",0);this.name=t}},gF=class{constructor(t,e){x(this,"data");x(this,"bones");x(this,"target");x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"mix",1);x(this,"softness",0);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0;r<t.bones.length;r++){let n=e.findBone(t.bones[r].name);if(!n)throw new Error(`Couldn't find bone ${t.bones[r].name}`);this.bones.push(n)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=s,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(this.mix==0)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(t,e,s,r,n,a,o){let h=t.parent;if(!h)throw new Error("IK bone must have parent.");let l=h.a,c=h.b,u=h.c,d=h.d,f=-t.ashearX-t.arotation,m=0,p=0;switch(t.inherit){case Ae.OnlyTranslation:m=(e-t.worldX)*yt.signum(t.skeleton.scaleX),p=(s-t.worldY)*yt.signum(t.skeleton.scaleY);break;case Ae.NoRotationOrReflection:let _=Math.abs(l*d-c*u)/Math.max(1e-4,l*l+u*u),v=l/t.skeleton.scaleX,b=u/t.skeleton.scaleY;c=-b*_*t.skeleton.scaleX,d=v*_*t.skeleton.scaleY,f+=Math.atan2(b,v)*yt.radDeg;default:let T=e-h.worldX,S=s-h.worldY,w=l*d-c*u;Math.abs(w)<=1e-4?(m=0,p=0):(m=(T*d-S*c)/w-t.ax,p=(S*l-T*u)/w-t.ay)}f+=Math.atan2(p,m)*yt.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let g=t.ascaleX,y=t.ascaleY;if(r||n){switch(t.inherit){case Ae.NoScale:case Ae.NoScaleOrReflection:m=e-t.worldX,p=s-t.worldY}const _=t.data.length*g;if(_>1e-4){const v=m*m+p*p;if(r&&v<_*_||n&&v>_*_){const b=(Math.sqrt(v)/_-1)*o+1;g*=b,a&&(y*=b)}}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,g,y,t.ashearX,t.ashearY)}apply2(t,e,s,r,n,a,o,h,l){if(t.inherit!=Ae.Normal||e.inherit!=Ae.Normal)return;let c=t.ax,u=t.ay,d=t.ascaleX,f=t.ascaleY,m=d,p=f,g=e.ascaleX,y=0,_=0,v=0;d<0?(d=-d,y=180,v=-1):(y=0,v=1),f<0&&(f=-f,v=-v),g<0?(g=-g,_=180):_=0;let b=e.ax,T=0,S=0,w=0,E=t.a,A=t.b,P=t.c,I=t.d,C=Math.abs(d-f)<=1e-4;!C||a?(T=0,S=E*b+t.worldX,w=P*b+t.worldY):(T=e.ay,S=E*b+A*T+t.worldX,w=P*b+I*T+t.worldY);let R=t.parent;if(!R)throw new Error("IK parent must itself have a parent.");E=R.a,A=R.b,P=R.c,I=R.d;let F=E*I-A*P,D=S-R.worldX,M=w-R.worldY;F=Math.abs(F)<=1e-4?0:1/F;let O=(D*I-M*A)*F-c,k=(M*E-D*P)*F-u,N=Math.sqrt(O*O+k*k),B=e.data.length*g,L,G;if(N<1e-4){this.apply1(t,s,r,!1,a,!1,l),e.updateWorldTransformWith(b,T,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}D=s-R.worldX,M=r-R.worldY;let V=(D*I-M*A)*F-c,q=(M*E-D*P)*F-u,H=V*V+q*q;if(h!=0){h*=d*(g+1)*.5;let ot=Math.sqrt(H),ct=ot-N-B*d+h;if(ct>0){let rt=Math.min(1,ct/(h*2))-1;rt=(ct-h*(1-rt*rt))/ot,V-=rt*V,q-=rt*q,H=V*V+q*q}}t:if(C){B*=d;let ot=(H-N*N-B*B)/(2*N*B);ot<-1?(ot=-1,G=Math.PI*n):ot>1?(ot=1,G=0,a&&(E=(Math.sqrt(H)/(N+B)-1)*l+1,m*=E,o&&(p*=E))):G=Math.acos(ot)*n,E=N+B*ot,A=B*Math.sin(G),L=Math.atan2(q*E-V*A,V*E+q*A)}else{E=d*B,A=f*B;let ot=E*E,ct=A*A,rt=Math.atan2(q,V);P=ct*N*N+ot*H-ot*ct;let dt=-2*ct*N,X=ct-ot;if(I=dt*dt-4*X*P,I>=0){let j=Math.sqrt(I);dt<0&&(j=-j),j=-(dt+j)*.5;let mt=j/X,ut=P/j,vt=Math.abs(mt)<Math.abs(ut)?mt:ut;if(mt=H-vt*vt,mt>=0){M=Math.sqrt(mt)*n,L=rt-Math.atan2(M,vt),G=Math.atan2(M/f,(vt-N)/d);break t}}let $=yt.PI,K=N-E,J=K*K,Q=0,it=0,U=N+E,Y=U*U,W=0;P=-E*N/(ot-ct),P>=-1&&P<=1&&(P=Math.acos(P),D=E*Math.cos(P)+N,M=A*Math.sin(P),I=D*D+M*M,I<J&&($=P,J=I,K=D,Q=M),I>Y&&(it=P,Y=I,U=D,W=M)),H<=(J+Y)*.5?(L=rt-Math.atan2(Q*n,K),G=$*n):(L=rt-Math.atan2(W*n,U),G=it*n)}let at=Math.atan2(T,b)*v,et=t.arotation;L=(L-at)*yt.radDeg+y-et,L>180?L-=360:L<-180&&(L+=360),t.updateWorldTransformWith(c,u,et+L*l,m,p,0,0),et=e.arotation,G=((G+at)*yt.radDeg-e.ashearX)*v+_-et,G>180?G-=360:G<-180&&(G+=360),e.updateWorldTransformWith(b,T,et+G*l,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}},ww=class extends tu{constructor(e){super(e,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"uniform",!1);x(this,"mix",0);x(this,"softness",0)}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Tw=class extends tu{constructor(e){super(e,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"positionMode",Hr.Fixed);x(this,"spacingMode",$e.Fixed);x(this,"rotateMode",Vn.Chain);x(this,"offsetRotation",0);x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0)}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}};var Hr;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Hr||(Hr={}));var $e;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})($e||($e={}));var Vn;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(Vn||(Vn={}));var os;let yF=(os=class{constructor(t,e){x(this,"data");x(this,"bones");x(this,"target");x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"spaces",new Array);x(this,"positions",new Array);x(this,"world",new Array);x(this,"curves",new Array);x(this,"lengths",new Array);x(this,"segments",new Array);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0,n=t.bones.length;r<n;r++){let a=e.findBone(t.bones[r].name);if(!a)throw new Error(`Couldn't find bone ${t.bones[r].name}.`);this.bones.push(a)}let s=e.findSlot(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=s,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(t){let e=this.target.getAttachment();if(!(e instanceof oc))return;let s=this.mixRotate,r=this.mixX,n=this.mixY;if(s==0&&r==0&&n==0)return;let a=this.data,o=a.rotateMode==Vn.Tangent,h=a.rotateMode==Vn.ChainScale,l=this.bones,c=l.length,u=o?c:c+1,d=xt.setArraySize(this.spaces,u),f=h?this.lengths=xt.setArraySize(this.lengths,c):[],m=this.spacing;switch(a.spacingMode){case $e.Percent:if(h)for(let S=0,w=u-1;S<w;S++){let E=l[S],A=E.data.length,P=A*E.a,I=A*E.c;f[S]=Math.sqrt(P*P+I*I)}xt.arrayFill(d,1,u,m);break;case $e.Proportional:let b=0;for(let S=0,w=u-1;S<w;){let E=l[S],A=E.data.length;if(A<os.epsilon)h&&(f[S]=0),d[++S]=m;else{let P=A*E.a,I=A*E.c,C=Math.sqrt(P*P+I*I);h&&(f[S]=C),d[++S]=C,b+=C}}if(b>0){b=u/b*m;for(let S=1;S<u;S++)d[S]*=b}break;default:let T=a.spacingMode==$e.Length;for(let S=0,w=u-1;S<w;){let E=l[S],A=E.data.length;if(A<os.epsilon)h&&(f[S]=0),d[++S]=m;else{let P=A*E.a,I=A*E.c,C=Math.sqrt(P*P+I*I);h&&(f[S]=C),d[++S]=(T?A+m:m)*C/A}}}let p=this.computeWorldPositions(e,u,o),g=p[0],y=p[1],_=a.offsetRotation,v=!1;if(_==0)v=a.rotateMode==Vn.Chain;else{v=!1;let b=this.target.bone;_*=b.a*b.d-b.b*b.c>0?yt.degRad:-.01745329277777778}for(let b=0,T=3;b<c;b++,T+=3){let S=l[b];S.worldX+=(g-S.worldX)*r,S.worldY+=(y-S.worldY)*n;let w=p[T],E=p[T+1],A=w-g,P=E-y;if(h){let I=f[b];if(I!=0){let C=(Math.sqrt(A*A+P*P)/I-1)*s+1;S.a*=C,S.c*=C}}if(g=w,y=E,s>0){let I=S.a,C=S.b,R=S.c,F=S.d,D=0,M=0,O=0;if(o?D=p[T-1]:d[b+1]==0?D=p[T+2]:D=Math.atan2(P,A),D-=Math.atan2(R,I),v){M=Math.cos(D),O=Math.sin(D);let k=S.data.length;g+=(k*(M*I-O*R)-A)*s,y+=(k*(O*I+M*R)-P)*s}else D+=_;D>yt.PI?D-=yt.PI2:D<-3.1415927&&(D+=yt.PI2),D*=s,M=Math.cos(D),O=Math.sin(D),S.a=M*I-O*R,S.b=M*C-O*F,S.c=O*I+M*R,S.d=O*C+M*F}S.updateAppliedTransform()}}computeWorldPositions(t,e,s){let r=this.target,n=this.position,a=this.spaces,o=xt.setArraySize(this.positions,e*3+2),h=this.world,l=t.closed,c=t.worldVerticesLength,u=c/6,d=os.NONE;if(!t.constantSpeed){let k=t.lengths;u-=l?1:2;let N=k[u];this.data.positionMode==Hr.Percent&&(n*=N);let B;switch(this.data.spacingMode){case $e.Percent:B=N;break;case $e.Proportional:B=N/e;break;default:B=1}h=xt.setArraySize(this.world,8);for(let L=0,G=0,V=0;L<e;L++,G+=3){let q=a[L]*B;n+=q;let H=n;if(l)H%=N,H<0&&(H+=N),V=0;else if(H<0){d!=os.BEFORE&&(d=os.BEFORE,t.computeWorldVertices(r,2,4,h,0,2)),this.addBeforePosition(H,h,0,o,G);continue}else if(H>N){d!=os.AFTER&&(d=os.AFTER,t.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(H-N,h,0,o,G);continue}for(;;V++){let at=k[V];if(!(H>at)){if(V==0)H/=at;else{let et=k[V-1];H=(H-et)/(at-et)}break}}V!=d&&(d=V,l&&V==u?(t.computeWorldVertices(r,c-4,4,h,0,2),t.computeWorldVertices(r,0,4,h,4,2)):t.computeWorldVertices(r,V*6+2,8,h,0,2)),this.addCurvePosition(H,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,G,s||L>0&&q==0)}return o}l?(c+=2,h=xt.setArraySize(this.world,c),t.computeWorldVertices(r,2,c-4,h,0,2),t.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=xt.setArraySize(this.world,c),t.computeWorldVertices(r,2,c,h,0,2));let f=xt.setArraySize(this.curves,u),m=0,p=h[0],g=h[1],y=0,_=0,v=0,b=0,T=0,S=0,w=0,E=0,A=0,P=0,I=0,C=0,R=0,F=0;for(let k=0,N=2;k<u;k++,N+=6)y=h[N],_=h[N+1],v=h[N+2],b=h[N+3],T=h[N+4],S=h[N+5],w=(p-y*2+v)*.1875,E=(g-_*2+b)*.1875,A=((y-v)*3-p+T)*.09375,P=((_-b)*3-g+S)*.09375,I=w*2+A,C=E*2+P,R=(y-p)*.75+w+A*.16666667,F=(_-g)*.75+E+P*.16666667,m+=Math.sqrt(R*R+F*F),R+=I,F+=C,I+=A,C+=P,m+=Math.sqrt(R*R+F*F),R+=I,F+=C,m+=Math.sqrt(R*R+F*F),R+=I+A,F+=C+P,m+=Math.sqrt(R*R+F*F),f[k]=m,p=T,g=S;this.data.positionMode==Hr.Percent&&(n*=m);let D;switch(this.data.spacingMode){case $e.Percent:D=m;break;case $e.Proportional:D=m/e;break;default:D=1}let M=this.segments,O=0;for(let k=0,N=0,B=0,L=0;k<e;k++,N+=3){let G=a[k]*D;n+=G;let V=n;if(l)V%=m,V<0&&(V+=m),B=0;else if(V<0){this.addBeforePosition(V,h,0,o,N);continue}else if(V>m){this.addAfterPosition(V-m,h,c-4,o,N);continue}for(;;B++){let q=f[B];if(!(V>q)){if(B==0)V/=q;else{let H=f[B-1];V=(V-H)/(q-H)}break}}if(B!=d){d=B;let q=B*6;for(p=h[q],g=h[q+1],y=h[q+2],_=h[q+3],v=h[q+4],b=h[q+5],T=h[q+6],S=h[q+7],w=(p-y*2+v)*.03,E=(g-_*2+b)*.03,A=((y-v)*3-p+T)*.006,P=((_-b)*3-g+S)*.006,I=w*2+A,C=E*2+P,R=(y-p)*.3+w+A*.16666667,F=(_-g)*.3+E+P*.16666667,O=Math.sqrt(R*R+F*F),M[0]=O,q=1;q<8;q++)R+=I,F+=C,I+=A,C+=P,O+=Math.sqrt(R*R+F*F),M[q]=O;R+=I,F+=C,O+=Math.sqrt(R*R+F*F),M[8]=O,R+=I+A,F+=C+P,O+=Math.sqrt(R*R+F*F),M[9]=O,L=0}for(V*=O;;L++){let q=M[L];if(!(V>q)){if(L==0)V/=q;else{let H=M[L-1];V=L+(V-H)/(q-H)}break}}this.addCurvePosition(V*.1,p,g,y,_,v,b,T,S,o,N,s||k>0&&G==0)}return o}addBeforePosition(t,e,s,r,n){let a=e[s],o=e[s+1],h=e[s+2]-a,l=e[s+3]-o,c=Math.atan2(l,h);r[n]=a+t*Math.cos(c),r[n+1]=o+t*Math.sin(c),r[n+2]=c}addAfterPosition(t,e,s,r,n){let a=e[s+2],o=e[s+3],h=a-e[s],l=o-e[s+1],c=Math.atan2(l,h);r[n]=a+t*Math.cos(c),r[n+1]=o+t*Math.sin(c),r[n+2]=c}addCurvePosition(t,e,s,r,n,a,o,h,l,c,u,d){if(t==0||isNaN(t)){c[u]=e,c[u+1]=s,c[u+2]=Math.atan2(n-s,r-e);return}let f=t*t,m=f*t,p=1-t,g=p*p,y=g*p,_=p*t,v=_*3,b=p*v,T=v*t,S=e*y+r*b+a*T+h*m,w=s*y+n*b+o*T+l*m;c[u]=S,c[u+1]=w,d&&(t<.001?c[u+2]=Math.atan2(n-s,r-e):c[u+2]=Math.atan2(w-(s*g+n*_*2+o*f),S-(e*g+r*_*2+a*f)))}},x(os,"NONE",-1),x(os,"BEFORE",-2),x(os,"AFTER",-3),x(os,"epsilon",1e-5),os),xF=class{constructor(t,e){x(this,"data");x(this,"_bone",null);x(this,"inertia",0);x(this,"strength",0);x(this,"damping",0);x(this,"massInverse",0);x(this,"wind",0);x(this,"gravity",0);x(this,"mix",0);x(this,"_reset",!0);x(this,"ux",0);x(this,"uy",0);x(this,"cx",0);x(this,"cy",0);x(this,"tx",0);x(this,"ty",0);x(this,"xOffset",0);x(this,"xVelocity",0);x(this,"yOffset",0);x(this,"yVelocity",0);x(this,"rotateOffset",0);x(this,"rotateVelocity",0);x(this,"scaleOffset",0);x(this,"scaleVelocity",0);x(this,"active",!1);x(this,"skeleton");x(this,"remaining",0);x(this,"lastTime",0);this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(t){const e=this.mix;if(e==0)return;const s=this.data.x>0,r=this.data.y>0,n=this.data.rotate>0||this.data.shearX>0,a=this.data.scaleX>0,o=this.bone,h=o.data.length;switch(t){case qi.none:return;case qi.reset:this.reset();case qi.update:const l=this.skeleton,c=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=c,this.lastTime=l.time;const u=o.worldX,d=o.worldY;if(this._reset)this._reset=!1,this.ux=u,this.uy=d;else{let f=this.remaining,m=this.inertia,p=this.data.step,g=this.skeleton.data.referenceScale,y=-1,_=this.data.limit*c,v=_*Math.abs(l.scaleY);if(_*=Math.abs(l.scaleX),s||r){if(s){const b=(this.ux-u)*m;this.xOffset+=b>_?_:b<-_?-_:b,this.ux=u}if(r){const b=(this.uy-d)*m;this.yOffset+=b>v?v:b<-v?-v:b,this.uy=d}if(f>=p){y=Math.pow(this.damping,60*p);const b=this.massInverse*p,T=this.strength,S=this.wind*g*l.scaleX,w=this.gravity*g*l.scaleY;do s&&(this.xVelocity+=(S-this.xOffset*T)*b,this.xOffset+=this.xVelocity*p,this.xVelocity*=y),r&&(this.yVelocity-=(w+this.yOffset*T)*b,this.yOffset+=this.yVelocity*p,this.yVelocity*=y),f-=p;while(f>=p)}s&&(o.worldX+=this.xOffset*e*this.data.x),r&&(o.worldY+=this.yOffset*e*this.data.y)}if(n||a){let b=Math.atan2(o.c,o.a),T=0,S=0,w=0,E=this.cx-o.worldX,A=this.cy-o.worldY;if(E>_?E=_:E<-_&&(E=-_),A>v?A=v:A<-v&&(A=-v),n){w=(this.data.rotate+this.data.shearX)*e;let P=Math.atan2(A+this.ty,E+this.tx)-b-this.rotateOffset*w;this.rotateOffset+=(P-Math.ceil(P*yt.invPI2-.5)*yt.PI2)*m,P=this.rotateOffset*w+b,T=Math.cos(P),S=Math.sin(P),a&&(P=h*o.getWorldScaleX(),P>0&&(this.scaleOffset+=(E*T+A*S)*m/P))}else{T=Math.cos(b),S=Math.sin(b);const P=h*o.getWorldScaleX();P>0&&(this.scaleOffset+=(E*T+A*S)*m/P)}if(f=this.remaining,f>=p){y==-1&&(y=Math.pow(this.damping,60*p));const P=this.massInverse*p,I=this.strength,C=this.wind,R=Kp.yDown?-this.gravity:this.gravity,F=h/g;for(;;)if(f-=p,a&&(this.scaleVelocity+=(C*T-R*S-this.scaleOffset*I)*P,this.scaleOffset+=this.scaleVelocity*p,this.scaleVelocity*=y),n){if(this.rotateVelocity-=((C*S+R*T)*F+this.rotateOffset*I)*P,this.rotateOffset+=this.rotateVelocity*p,this.rotateVelocity*=y,f<p)break;const D=this.rotateOffset*w+b;T=Math.cos(D),S=Math.sin(D)}else if(f<p)break}}this.remaining=f}this.cx=o.worldX,this.cy=o.worldY;break;case qi.pose:s&&(o.worldX+=this.xOffset*e*this.data.x),r&&(o.worldY+=this.yOffset*e*this.data.y)}if(n){let l=this.rotateOffset*e,c=0,u=0,d=0;if(this.data.shearX>0){let f=0;this.data.rotate>0&&(f=l*this.data.rotate,c=Math.sin(f),u=Math.cos(f),d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d),f+=l*this.data.shearX,c=Math.sin(f),u=Math.cos(f),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c}else l*=this.data.rotate,c=Math.sin(l),u=Math.cos(l),d=o.a,o.a=u*d-c*o.c,o.c=c*d+u*o.c,d=o.b,o.b=u*d-c*o.d,o.d=c*d+u*o.d}if(a){const l=1+this.scaleOffset*e*this.data.scaleX;o.a*=l,o.c*=l}t!=qi.pose&&(this.tx=h*o.a,this.ty=h*o.c),o.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(t,e,s){const r=s*yt.degRad,n=Math.cos(r),a=Math.sin(r),o=this.cx-t,h=this.cy-e;this.translate(o*n-h*a-o,o*a+h*n-h)}},bF=class{constructor(t,e){x(this,"data");x(this,"bone");x(this,"color");x(this,"darkColor",null);x(this,"attachment",null);x(this,"attachmentState",0);x(this,"sequenceIndex",-1);x(this,"deform",new Array);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new Dt,this.darkColor=t.darkColor?new Dt:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&((!(t instanceof Pi)||!(this.attachment instanceof Pi)||t.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},vF=class{constructor(t,e){x(this,"data");x(this,"bones");x(this,"target");x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"temp",new nc);x(this,"active",!1);if(!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let r=0;r<t.bones.length;r++){let n=e.findBone(t.bones[r].name);if(!n)throw new Error(`Couldn't find bone ${t.bones[r].name}.`);this.bones.push(n)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}.`);this.target=s,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}update(t){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=e!=0||s!=0,h=this.target,l=h.a,c=h.b,u=h.c,d=h.d,f=l*d-c*u>0?yt.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let y=0,_=g.length;y<_;y++){let v=g[y];if(t!=0){let b=v.a,T=v.b,S=v.c,w=v.d,E=Math.atan2(u,l)-Math.atan2(S,b)+m;E>yt.PI?E-=yt.PI2:E<-3.1415927&&(E+=yt.PI2),E*=t;let A=Math.cos(E),P=Math.sin(E);v.a=A*b-P*S,v.b=A*T-P*w,v.c=P*b+A*S,v.d=P*T+A*w}if(o){let b=this.temp;h.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(b.x-v.worldX)*e,v.worldY+=(b.y-v.worldY)*s}if(r!=0){let b=Math.sqrt(v.a*v.a+v.c*v.c);b!=0&&(b=(b+(Math.sqrt(l*l+u*u)-b+this.data.offsetScaleX)*r)/b),v.a*=b,v.c*=b}if(n!=0){let b=Math.sqrt(v.b*v.b+v.d*v.d);b!=0&&(b=(b+(Math.sqrt(c*c+d*d)-b+this.data.offsetScaleY)*n)/b),v.b*=b,v.d*=b}if(a>0){let b=v.b,T=v.d,S=Math.atan2(T,b),w=Math.atan2(d,c)-Math.atan2(u,l)-(S-Math.atan2(v.c,v.a));w>yt.PI?w-=yt.PI2:w<-3.1415927&&(w+=yt.PI2),w=S+(w+p)*a;let E=Math.sqrt(b*b+T*T);v.b=Math.cos(w)*E,v.d=Math.sin(w)*E}v.updateAppliedTransform()}}applyRelativeWorld(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=e!=0||s!=0,h=this.target,l=h.a,c=h.b,u=h.c,d=h.d,f=l*d-c*u>0?yt.degRad:-.01745329277777778,m=this.data.offsetRotation*f,p=this.data.offsetShearY*f,g=this.bones;for(let y=0,_=g.length;y<_;y++){let v=g[y];if(t!=0){let b=v.a,T=v.b,S=v.c,w=v.d,E=Math.atan2(u,l)+m;E>yt.PI?E-=yt.PI2:E<-3.1415927&&(E+=yt.PI2),E*=t;let A=Math.cos(E),P=Math.sin(E);v.a=A*b-P*S,v.b=A*T-P*w,v.c=P*b+A*S,v.d=P*T+A*w}if(o){let b=this.temp;h.localToWorld(b.set(this.data.offsetX,this.data.offsetY)),v.worldX+=b.x*e,v.worldY+=b.y*s}if(r!=0){let b=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleX)*r+1;v.a*=b,v.c*=b}if(n!=0){let b=(Math.sqrt(c*c+d*d)-1+this.data.offsetScaleY)*n+1;v.b*=b,v.d*=b}if(a>0){let b=Math.atan2(d,c)-Math.atan2(u,l);b>yt.PI?b-=yt.PI2:b<-3.1415927&&(b+=yt.PI2);let T=v.b,S=v.d;b=Math.atan2(S,T)+(b-yt.PI/2+p)*a;let w=Math.sqrt(T*T+S*S);v.b=Math.cos(b)*w,v.d=Math.sin(b)*w}v.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=this.target,h=this.bones;for(let l=0,c=h.length;l<c;l++){let u=h[l],d=u.arotation;t!=0&&(d+=(o.arotation-d+this.data.offsetRotation)*t);let f=u.ax,m=u.ay;f+=(o.ax-f+this.data.offsetX)*e,m+=(o.ay-m+this.data.offsetY)*s;let p=u.ascaleX,g=u.ascaleY;r!=0&&p!=0&&(p=(p+(o.ascaleX-p+this.data.offsetScaleX)*r)/p),n!=0&&g!=0&&(g=(g+(o.ascaleY-g+this.data.offsetScaleY)*n)/g);let y=u.ashearY;a!=0&&(y+=(o.ashearY-y+this.data.offsetShearY)*a),u.updateWorldTransformWith(f,m,d,p,g,u.ashearX,y)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,r=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,o=this.target,h=this.bones;for(let l=0,c=h.length;l<c;l++){let u=h[l],d=u.arotation+(o.arotation+this.data.offsetRotation)*t,f=u.ax+(o.ax+this.data.offsetX)*e,m=u.ay+(o.ay+this.data.offsetY)*s,p=u.ascaleX*((o.ascaleX-1+this.data.offsetScaleX)*r+1),g=u.ascaleY*((o.ascaleY-1+this.data.offsetScaleY)*n+1),y=u.ashearY+(o.ashearY+this.data.offsetShearY)*a;u.updateWorldTransformWith(f,m,d,p,g,u.ashearX,y)}}};var ui;let Kp=(ui=class{constructor(t){x(this,"data");x(this,"bones");x(this,"slots");x(this,"drawOrder");x(this,"ikConstraints");x(this,"transformConstraints");x(this,"pathConstraints");x(this,"physicsConstraints");x(this,"_updateCache",new Array);x(this,"skin",null);x(this,"color");x(this,"scaleX",1);x(this,"_scaleY",1);x(this,"x",0);x(this,"y",0);x(this,"time",0);if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e<t.bones.length;e++){let s=t.bones[e],r;if(!s.parent)r=new Qx(s,this,null);else{let n=this.bones[s.parent.index];r=new Qx(s,this,n),n.children.push(r)}this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(let e=0;e<t.slots.length;e++){let s=t.slots[e],r=this.bones[s.boneData.index],n=new bF(s,r);this.slots.push(n),this.drawOrder.push(n)}this.ikConstraints=new Array;for(let e=0;e<t.ikConstraints.length;e++){let s=t.ikConstraints[e];this.ikConstraints.push(new gF(s,this))}this.transformConstraints=new Array;for(let e=0;e<t.transformConstraints.length;e++){let s=t.transformConstraints[e];this.transformConstraints.push(new vF(s,this))}this.pathConstraints=new Array;for(let e=0;e<t.pathConstraints.length;e++){let s=t.pathConstraints[e];this.pathConstraints.push(new yF(s,this))}this.physicsConstraints=new Array;for(let e=0;e<t.physicsConstraints.length;e++){let s=t.physicsConstraints[e];this.physicsConstraints.push(new xF(s,this))}this.color=new Dt(1,1,1,1),this.updateCache()}get scaleY(){return ui.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}updateCache(){let t=this._updateCache;t.length=0;let e=this.bones;for(let d=0,f=e.length;d<f;d++){let m=e[d];m.sorted=m.data.skinRequired,m.active=!m.sorted}if(this.skin){let d=this.skin.bones;for(let f=0,m=this.skin.bones.length;f<m;f++){let p=this.bones[d[f].index];do p.sorted=!1,p.active=!0,p=p.parent;while(p)}}let s=this.ikConstraints,r=this.transformConstraints,n=this.pathConstraints,a=this.physicsConstraints,o=s.length,h=r.length,l=n.length,c=this.physicsConstraints.length,u=o+h+l+c;t:for(let d=0;d<u;d++){for(let f=0;f<o;f++){let m=s[f];if(m.data.order==d){this.sortIkConstraint(m);continue t}}for(let f=0;f<h;f++){let m=r[f];if(m.data.order==d){this.sortTransformConstraint(m);continue t}}for(let f=0;f<l;f++){let m=n[f];if(m.data.order==d){this.sortPathConstraint(m);continue t}}for(let f=0;f<c;f++){const m=a[f];if(m.data.order==d){this.sortPhysicsConstraint(m);continue t}}}for(let d=0,f=e.length;d<f;d++)this.sortBone(e[d])}sortIkConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&xt.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target;this.sortBone(e);let s=t.bones,r=s[0];if(this.sortBone(r),s.length==1)this._updateCache.push(t),this.sortReset(r.children);else{let n=s[s.length-1];this.sortBone(n),this._updateCache.push(t),this.sortReset(r.children),n.sorted=!0}}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&xt.contains(this.skin.constraints,t.data,!0)),!t.active)return;let e=t.target,s=e.data.index,r=e.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,r),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,r);for(let h=0,l=this.data.skins.length;h<l;h++)this.sortPathConstraintAttachment(this.data.skins[h],s,r);let n=e.getAttachment();n instanceof oc&&this.sortPathConstraintAttachmentWith(n,r);let a=t.bones,o=a.length;for(let h=0;h<o;h++)this.sortBone(a[h]);this._updateCache.push(t);for(let h=0;h<o;h++)this.sortReset(a[h].children);for(let h=0;h<o;h++)a[h].sorted=!0}sortTransformConstraint(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&xt.contains(this.skin.constraints,t.data,!0)),!t.active)return;this.sortBone(t.target);let e=t.bones,s=e.length;if(t.data.local)for(let r=0;r<s;r++){let n=e[r];this.sortBone(n.parent),this.sortBone(n)}else for(let r=0;r<s;r++)this.sortBone(e[r]);this._updateCache.push(t);for(let r=0;r<s;r++)this.sortReset(e[r].children);for(let r=0;r<s;r++)e[r].sorted=!0}sortPathConstraintAttachment(t,e,s){let r=t.attachments[e];if(r)for(let n in r)this.sortPathConstraintAttachmentWith(r[n],s)}sortPathConstraintAttachmentWith(t,e){if(!(t instanceof oc))return;let s=t.bones;if(!s)this.sortBone(e);else{let r=this.bones;for(let n=0,a=s.length;n<a;){let o=s[n++];for(o+=n;n<o;)this.sortBone(r[s[n++]])}}}sortPhysicsConstraint(t){const e=t.bone;t.active=e.active&&(!t.data.skinRequired||this.skin!=null&&xt.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(e),this._updateCache.push(t),this.sortReset(e.children),e.sorted=!0)}sortBone(t){if(!t||t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,s=t.length;e<s;e++){let r=t[e];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}}updateWorldTransform(t){if(t==null)throw new Error("physics is undefined");let e=this.bones;for(let r=0,n=e.length;r<n;r++){let a=e[r];a.ax=a.x,a.ay=a.y,a.arotation=a.rotation,a.ascaleX=a.scaleX,a.ascaleY=a.scaleY,a.ashearX=a.shearX,a.ashearY=a.shearY}let s=this._updateCache;for(let r=0,n=s.length;r<n;r++)s[r].update(t)}updateWorldTransformWith(t,e){if(!e)throw new Error("parent cannot be null.");let s=this.bones;for(let g=1,y=s.length;g<y;g++){let _=s[g];_.ax=_.x,_.ay=_.y,_.arotation=_.rotation,_.ascaleX=_.scaleX,_.ascaleY=_.scaleY,_.ashearX=_.shearX,_.ashearY=_.shearY}let r=this.getRootBone();if(!r)throw new Error("Root bone must not be null.");let n=e.a,a=e.b,o=e.c,h=e.d;r.worldX=n*this.x+a*this.y+e.worldX,r.worldY=o*this.x+h*this.y+e.worldY;const l=(r.rotation+r.shearX)*yt.degRad,c=(r.rotation+90+r.shearY)*yt.degRad,u=Math.cos(l)*r.scaleX,d=Math.cos(c)*r.scaleY,f=Math.sin(l)*r.scaleX,m=Math.sin(c)*r.scaleY;r.a=(n*u+a*f)*this.scaleX,r.b=(n*d+a*m)*this.scaleX,r.c=(o*u+h*f)*this.scaleY,r.d=(o*d+h*m)*this.scaleY;let p=this._updateCache;for(let g=0,y=p.length;g<y;g++){let _=p[g];_!=r&&_.update(t)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let t=this.slots;xt.arrayCopy(t,0,this.drawOrder,0,t.length);for(let e=0,s=t.length;e<s;e++)t[e].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.data.name==t)return n}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.data.name==t)return n}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let s=0,r=e.length;s<r;s++){let n=e[s],a=n.data.attachmentName;if(a){let o=t.getAttachment(s,a);o&&n.setAttachment(o)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let s=this.data.findSlot(t);if(!s)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(s.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let r=0,n=s.length;r<n;r++){let a=s[r];if(a.data.name==t){let o=null;if(e&&(o=this.getAttachment(r,e),!o))throw new Error("Attachment not found: "+e+", for slot: "+t);a.setAttachment(o);return}}throw new Error("Slot not found: "+t)}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(e=>e.data.name==t)??null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(e=>e.data.name==t)??null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(e=>e.data.name==t)??null}findPhysicsConstraint(t){if(t==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(e=>e.data.name==t)??null}getBoundsRect(t){let e=new nc,s=new nc;return this.getBounds(e,s,void 0,t),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(t,e,s=new Array(2),r=null){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");let n=this.drawOrder,a=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let c=0,u=n.length;c<u;c++){let d=n[c];if(!d.bone.active)continue;let f=0,m=null,p=null,g=d.getAttachment();if(g instanceof qp)f=8,m=xt.setArraySize(s,f,0),g.computeWorldVertices(d,m,0,2),p=ui.quadTriangles;else if(g instanceof Qc){let y=g;f=y.worldVerticesLength,m=xt.setArraySize(s,f,0),y.computeWorldVertices(d,0,f,m,0,2),p=y.triangles}else if(g instanceof Bo&&r!=null){r.clipStart(d,g);continue}if(m&&p){r!=null&&r.isClipping()&&(r.clipTriangles(m,p,p.length),m=r.clippedVertices,f=r.clippedVertices.length);for(let y=0,_=m.length;y<_;y+=2){let v=m[y],b=m[y+1];a=Math.min(a,v),o=Math.min(o,b),h=Math.max(h,v),l=Math.max(l,b)}}r!=null&&r.clipEndWithSlot(d)}r!=null&&r.clipEnd(),t.set(a,o),e.set(h-a,l-o)}update(t){this.time+=t}physicsTranslate(t,e){const s=this.physicsConstraints;for(let r=0,n=s.length;r<n;r++)s[r].translate(t,e)}physicsRotate(t,e,s){const r=this.physicsConstraints;for(let n=0,a=r.length;n<a;n++)r[n].rotate(t,e,s)}},x(ui,"quadTriangles",[0,1,2,2,3,0]),x(ui,"yDown",!1),ui);var qi;(function(i){i[i.none=0]="none",i[i.reset=1]="reset",i[i.update=2]="update",i[i.pose=3]="pose"})(qi||(qi={}));let Sw=class extends tu{constructor(e){super(e,0,!1);x(this,"_bone",null);x(this,"x",0);x(this,"y",0);x(this,"rotate",0);x(this,"scaleX",0);x(this,"shearX",0);x(this,"limit",0);x(this,"step",0);x(this,"inertia",0);x(this,"strength",0);x(this,"damping",0);x(this,"massInverse",0);x(this,"wind",0);x(this,"gravity",0);x(this,"mix",0);x(this,"inertiaGlobal",!1);x(this,"strengthGlobal",!1);x(this,"dampingGlobal",!1);x(this,"massGlobal",!1);x(this,"windGlobal",!1);x(this,"gravityGlobal",!1);x(this,"mixGlobal",!1)}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}},lc=class{constructor(){x(this,"name",null);x(this,"bones",new Array);x(this,"slots",new Array);x(this,"skins",new Array);x(this,"defaultSkin",null);x(this,"events",new Array);x(this,"animations",new Array);x(this,"ikConstraints",new Array);x(this,"transformConstraints",new Array);x(this,"pathConstraints",new Array);x(this,"physicsConstraints",new Array);x(this,"x",0);x(this,"y",0);x(this,"width",0);x(this,"height",0);x(this,"referenceScale",100);x(this,"version",null);x(this,"hash",null);x(this,"fps",0);x(this,"imagesPath",null);x(this,"audioPath",null)}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.name==t)return n}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.name==t)return n}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.name==t)return n}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.name==t)return n}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.name==t)return n}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let s=0,r=e.length;s<r;s++){const n=e[s];if(n.name==t)return n}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let s=0,r=e.length;s<r;s++){const n=e[s];if(n.name==t)return n}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let s=0,r=e.length;s<r;s++){const n=e[s];if(n.name==t)return n}return null}findPhysicsConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.physicsConstraints;for(let s=0,r=e.length;s<r;s++){const n=e[s];if(n.name==t)return n}return null}},tb=class{constructor(t=0,e,s){x(this,"slotIndex");x(this,"name");x(this,"attachment");this.slotIndex=t,this.name=e,this.attachment=s}},Km=class{constructor(t){x(this,"name");x(this,"attachments",new Array);x(this,"bones",Array());x(this,"constraints",new Array);x(this,"color",new Dt(.99607843,.61960787,.30980393,1));if(!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,s){if(!s)throw new Error("attachment cannot be null.");let r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=s}addSkin(t){for(let r=0;r<t.bones.length;r++){let n=t.bones[r],a=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==n){a=!0;break}a||this.bones.push(n)}for(let r=0;r<t.constraints.length;r++){let n=t.constraints[r],a=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==n){a=!0;break}a||this.constraints.push(n)}let e=t.getAttachments();for(let r=0;r<e.length;r++){var s=e[r];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(t){for(let r=0;r<t.bones.length;r++){let n=t.bones[r],a=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==n){a=!0;break}a||this.bones.push(n)}for(let r=0;r<t.constraints.length;r++){let n=t.constraints[r],a=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==n){a=!0;break}a||this.constraints.push(n)}let e=t.getAttachments();for(let r=0;r<e.length;r++){var s=e[r];s.attachment&&(s.attachment instanceof Qc?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){let s=this.attachments[t];s&&delete s[e]}getAttachments(){let t=new Array;for(var e=0;e<this.attachments.length;e++){let s=this.attachments[e];if(s)for(let r in s){let n=s[r];n&&t.push(new tb(e,r,n))}}return t}getAttachmentsForSlot(t,e){let s=this.attachments[t];if(s)for(let r in s){let n=s[r];n&&e.push(new tb(t,r,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let r=0;r<t.slots.length;r++){let n=t.slots[r],a=n.getAttachment();if(a&&s<e.attachments.length){let o=e.attachments[s];for(let h in o){let l=o[h];if(a==l){let c=this.getAttachment(s,h);c&&n.setAttachment(c);break}}}s++}}},Ew=class{constructor(t,e,s){x(this,"index",0);x(this,"name");x(this,"boneData");x(this,"color",new Dt(1,1,1,1));x(this,"darkColor",null);x(this,"attachmentName",null);x(this,"blendMode",Qi.Normal);x(this,"visible",!0);if(t<0)throw new Error("index must be >= 0.");if(!e)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=s}};var Qi;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(Qi||(Qi={}));let Aw=class extends tu{constructor(e){super(e,0,!1);x(this,"bones",new Array);x(this,"_target",null);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0);x(this,"offsetRotation",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"offsetScaleX",0);x(this,"offsetScaleY",0);x(this,"offsetShearY",0);x(this,"relative",!1);x(this,"local",!1)}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},eb=class{constructor(t){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",new Array);this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new lc;s.name="";let r=new _F(t),n=r.readInt32(),a=r.readInt32();s.hash=a==0&&n==0?null:a.toString(16)+n.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*e;let o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let h=0;h=r.readInt(!0);for(let c=0;c<h;c++){let u=r.readString();if(!u)throw new Error("String in string table must not be null.");r.strings.push(u)}h=r.readInt(!0);for(let c=0;c<h;c++){let u=r.readString();if(!u)throw new Error("Bone name must not be null.");let d=c==0?null:s.bones[r.readInt(!0)],f=new bw(c,u,d);f.rotation=r.readFloat(),f.x=r.readFloat()*e,f.y=r.readFloat()*e,f.scaleX=r.readFloat(),f.scaleY=r.readFloat(),f.shearX=r.readFloat(),f.shearY=r.readFloat(),f.length=r.readFloat()*e,f.inherit=r.readByte(),f.skinRequired=r.readBoolean(),o&&(Dt.rgba8888ToColor(f.color,r.readInt32()),f.icon=r.readString()??void 0,f.visible=r.readBoolean()),s.bones.push(f)}h=r.readInt(!0);for(let c=0;c<h;c++){let u=r.readString();if(!u)throw new Error("Slot name must not be null.");let d=s.bones[r.readInt(!0)],f=new Ew(c,u,d);Dt.rgba8888ToColor(f.color,r.readInt32());let m=r.readInt32();m!=-1&&Dt.rgb888ToColor(f.darkColor=new Dt,m),f.attachmentName=r.readStringRef(),f.blendMode=r.readInt(!0),o&&(f.visible=r.readBoolean()),s.slots.push(f)}h=r.readInt(!0);for(let c=0,u;c<h;c++){let d=r.readString();if(!d)throw new Error("IK constraint data name must not be null.");let f=new ww(d);f.order=r.readInt(!0),u=r.readInt(!0);for(let p=0;p<u;p++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let m=r.readByte();f.skinRequired=(m&1)!=0,f.bendDirection=(m&2)!=0?1:-1,f.compress=(m&4)!=0,f.stretch=(m&8)!=0,f.uniform=(m&16)!=0,(m&32)!=0&&(f.mix=(m&64)!=0?r.readFloat():1),(m&128)!=0&&(f.softness=r.readFloat()*e),s.ikConstraints.push(f)}h=r.readInt(!0);for(let c=0,u;c<h;c++){let d=r.readString();if(!d)throw new Error("Transform constraint data name must not be null.");let f=new Aw(d);f.order=r.readInt(!0),u=r.readInt(!0);for(let p=0;p<u;p++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.bones[r.readInt(!0)];let m=r.readByte();f.skinRequired=(m&1)!=0,f.local=(m&2)!=0,f.relative=(m&4)!=0,(m&8)!=0&&(f.offsetRotation=r.readFloat()),(m&16)!=0&&(f.offsetX=r.readFloat()*e),(m&32)!=0&&(f.offsetY=r.readFloat()*e),(m&64)!=0&&(f.offsetScaleX=r.readFloat()),(m&128)!=0&&(f.offsetScaleY=r.readFloat()),m=r.readByte(),(m&1)!=0&&(f.offsetShearY=r.readFloat()),(m&2)!=0&&(f.mixRotate=r.readFloat()),(m&4)!=0&&(f.mixX=r.readFloat()),(m&8)!=0&&(f.mixY=r.readFloat()),(m&16)!=0&&(f.mixScaleX=r.readFloat()),(m&32)!=0&&(f.mixScaleY=r.readFloat()),(m&64)!=0&&(f.mixShearY=r.readFloat()),s.transformConstraints.push(f)}h=r.readInt(!0);for(let c=0,u;c<h;c++){let d=r.readString();if(!d)throw new Error("Path constraint data name must not be null.");let f=new Tw(d);f.order=r.readInt(!0),f.skinRequired=r.readBoolean(),u=r.readInt(!0);for(let p=0;p<u;p++)f.bones.push(s.bones[r.readInt(!0)]);f.target=s.slots[r.readInt(!0)];const m=r.readByte();f.positionMode=m&1,f.spacingMode=m>>1&3,f.rotateMode=m>>3&3,(m&128)!=0&&(f.offsetRotation=r.readFloat()),f.position=r.readFloat(),f.positionMode==Hr.Fixed&&(f.position*=e),f.spacing=r.readFloat(),(f.spacingMode==$e.Length||f.spacingMode==$e.Fixed)&&(f.spacing*=e),f.mixRotate=r.readFloat(),f.mixX=r.readFloat(),f.mixY=r.readFloat(),s.pathConstraints.push(f)}h=r.readInt(!0);for(let c=0,u;c<h;c++){const d=r.readString();if(!d)throw new Error("Physics constraint data name must not be null.");const f=new Sw(d);f.order=r.readInt(!0),f.bone=s.bones[r.readInt(!0)];let m=r.readByte();f.skinRequired=(m&1)!=0,(m&2)!=0&&(f.x=r.readFloat()),(m&4)!=0&&(f.y=r.readFloat()),(m&8)!=0&&(f.rotate=r.readFloat()),(m&16)!=0&&(f.scaleX=r.readFloat()),(m&32)!=0&&(f.shearX=r.readFloat()),f.limit=((m&64)!=0?r.readFloat():5e3)*e,f.step=1/r.readUnsignedByte(),f.inertia=r.readFloat(),f.strength=r.readFloat(),f.damping=r.readFloat(),f.massInverse=(m&128)!=0?r.readFloat():1,f.wind=r.readFloat(),f.gravity=r.readFloat(),m=r.readByte(),(m&1)!=0&&(f.inertiaGlobal=!0),(m&2)!=0&&(f.strengthGlobal=!0),(m&4)!=0&&(f.dampingGlobal=!0),(m&8)!=0&&(f.massGlobal=!0),(m&16)!=0&&(f.windGlobal=!0),(m&32)!=0&&(f.gravityGlobal=!0),(m&64)!=0&&(f.mixGlobal=!0),f.mix=(m&128)!=0?r.readFloat():1,s.physicsConstraints.push(f)}let l=this.readSkin(r,s,!0,o);l&&(s.defaultSkin=l,s.skins.push(l));{let c=s.skins.length;for(xt.setArraySize(s.skins,h=c+r.readInt(!0));c<h;c++){let u=this.readSkin(r,s,!1,o);if(!u)throw new Error("readSkin() should not have returned null.");s.skins[c]=u}}h=this.linkedMeshes.length;for(let c=0;c<h;c++){let u=this.linkedMeshes[c];const d=s.skins[u.skinIndex];if(!u.parent)throw new Error("Linked mesh parent must not be null");let f=d.getAttachment(u.slotIndex,u.parent);if(!f)throw new Error(`Parent mesh not found: ${u.parent}`);u.mesh.timelineAttachment=u.inheritTimeline?f:u.mesh,u.mesh.setParentMesh(f),u.mesh.region!=null&&u.mesh.updateRegion()}this.linkedMeshes.length=0,h=r.readInt(!0);for(let c=0;c<h;c++){let u=r.readString();if(!u)throw new Error("Event data name must not be null");let d=new _w(u);d.intValue=r.readInt(!1),d.floatValue=r.readFloat(),d.stringValue=r.readString(),d.audioPath=r.readString(),d.audioPath&&(d.volume=r.readFloat(),d.balance=r.readFloat()),s.events.push(d)}h=r.readInt(!0);for(let c=0;c<h;c++){let u=r.readString();if(!u)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(r,u,s))}return s}readSkin(t,e,s,r){let n=null,a=0;if(s){if(a=t.readInt(!0),a==0)return null;n=new Km("default")}else{let o=t.readString();if(!o)throw new Error("Skin name must not be null.");n=new Km(o),r&&Dt.rgba8888ToColor(n.color,t.readInt32()),n.bones.length=t.readInt(!0);for(let h=0,l=n.bones.length;h<l;h++)n.bones[h]=e.bones[t.readInt(!0)];for(let h=0,l=t.readInt(!0);h<l;h++)n.constraints.push(e.ikConstraints[t.readInt(!0)]);for(let h=0,l=t.readInt(!0);h<l;h++)n.constraints.push(e.transformConstraints[t.readInt(!0)]);for(let h=0,l=t.readInt(!0);h<l;h++)n.constraints.push(e.pathConstraints[t.readInt(!0)]);for(let h=0,l=t.readInt(!0);h<l;h++)n.constraints.push(e.physicsConstraints[t.readInt(!0)]);a=t.readInt(!0)}for(let o=0;o<a;o++){let h=t.readInt(!0);for(let l=0,c=t.readInt(!0);l<c;l++){let u=t.readStringRef();if(!u)throw new Error("Attachment name must not be null");let d=this.readAttachment(t,e,n,h,u,r);d&&n.setAttachment(h,u,d)}}return n}readAttachment(t,e,s,r,n,a){let o=this.scale,h=t.readByte();const l=(h&8)!=0?t.readStringRef():n;if(!l)throw new Error("Attachment name must not be null");switch(h&7){case ri.Region:{let c=(h&16)!=0?t.readStringRef():null;const u=(h&32)!=0?t.readInt32():4294967295,d=(h&64)!=0?this.readSequence(t):null;let f=(h&128)!=0?t.readFloat():0,m=t.readFloat(),p=t.readFloat(),g=t.readFloat(),y=t.readFloat(),_=t.readFloat(),v=t.readFloat();c||(c=l);let b=this.attachmentLoader.newRegionAttachment(s,l,c,d);return b?(b.path=c,b.x=m*o,b.y=p*o,b.scaleX=g,b.scaleY=y,b.rotation=f,b.width=_*o,b.height=v*o,Dt.rgba8888ToColor(b.color,u),b.sequence=d,d==null&&b.updateRegion(),b):null}case ri.BoundingBox:{let c=this.readVertices(t,(h&16)!=0),u=a?t.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(s,l);return d?(d.worldVerticesLength=c.length,d.vertices=c.vertices,d.bones=c.bones,a&&Dt.rgba8888ToColor(d.color,u),d):null}case ri.Mesh:{let c=(h&16)!=0?t.readStringRef():l;const u=(h&32)!=0?t.readInt32():4294967295,d=(h&64)!=0?this.readSequence(t):null,f=t.readInt(!0),m=this.readVertices(t,(h&128)!=0),p=this.readFloatArray(t,m.length,1),g=this.readShortArray(t,(m.length-f-2)*3);let y=[],_=0,v=0;a&&(y=this.readShortArray(t,t.readInt(!0)),_=t.readFloat(),v=t.readFloat()),c||(c=l);let b=this.attachmentLoader.newMeshAttachment(s,l,c,d);return b?(b.path=c,Dt.rgba8888ToColor(b.color,u),b.bones=m.bones,b.vertices=m.vertices,b.worldVerticesLength=m.length,b.triangles=g,b.regionUVs=p,d==null&&b.updateRegion(),b.hullLength=f<<1,b.sequence=d,a&&(b.edges=y,b.width=_*o,b.height=v*o),b):null}case ri.LinkedMesh:{const c=(h&16)!=0?t.readStringRef():l;if(c==null)throw new Error("Path of linked mesh must not be null");const u=(h&32)!=0?t.readInt32():4294967295,d=(h&64)!=0?this.readSequence(t):null,f=(h&128)!=0,m=t.readInt(!0),p=t.readStringRef();let g=0,y=0;a&&(g=t.readFloat(),y=t.readFloat());let _=this.attachmentLoader.newMeshAttachment(s,l,c,d);return _?(_.path=c,Dt.rgba8888ToColor(_.color,u),_.sequence=d,a&&(_.width=g*o,_.height=y*o),this.linkedMeshes.push(new wF(_,m,r,p,f)),_):null}case ri.Path:{const c=(h&16)!=0,u=(h&32)!=0,d=this.readVertices(t,(h&64)!=0),f=xt.newArray(d.length/6,0);for(let g=0,y=f.length;g<y;g++)f[g]=t.readFloat()*o;const m=a?t.readInt32():0,p=this.attachmentLoader.newPathAttachment(s,l);return p?(p.closed=c,p.constantSpeed=u,p.worldVerticesLength=d.length,p.vertices=d.vertices,p.bones=d.bones,p.lengths=f,a&&Dt.rgba8888ToColor(p.color,m),p):null}case ri.Point:{const c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),f=a?t.readInt32():0,m=this.attachmentLoader.newPointAttachment(s,l);return m?(m.x=u*o,m.y=d*o,m.rotation=c,a&&Dt.rgba8888ToColor(m.color,f),m):null}case ri.Clipping:{const c=t.readInt(!0),u=this.readVertices(t,(h&16)!=0);let d=a?t.readInt32():0,f=this.attachmentLoader.newClippingAttachment(s,l);return f?(f.endSlot=e.slots[c],f.worldVerticesLength=u.length,f.vertices=u.vertices,f.bones=u.bones,a&&Dt.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(t){let e=new O1(t.readInt(!0));return e.start=t.readInt(!0),e.digits=t.readInt(!0),e.setupIndex=t.readInt(!0),e}readVertices(t,e){const s=this.scale,r=t.readInt(!0),n=new TF;if(n.length=r<<1,!e)return n.vertices=this.readFloatArray(t,n.length,s),n;let a=new Array,o=new Array;for(let h=0;h<r;h++){let l=t.readInt(!0);o.push(l);for(let c=0;c<l;c++)o.push(t.readInt(!0)),a.push(t.readFloat()*s),a.push(t.readFloat()*s),a.push(t.readFloat())}return n.vertices=xt.toFloatArray(a),n.bones=o,n}readFloatArray(t,e,s){let r=new Array(e);if(s==1)for(let n=0;n<e;n++)r[n]=t.readFloat();else for(let n=0;n<e;n++)r[n]=t.readFloat()*s;return r}readShortArray(t,e){let s=new Array(e);for(let r=0;r<e;r++)s[r]=t.readInt(!0);return s}readAnimation(t,e,s){t.readInt(!0);let r=new Array,n=this.scale;for(let l=0,c=t.readInt(!0);l<c;l++){let u=t.readInt(!0);for(let d=0,f=t.readInt(!0);d<f;d++){let m=t.readByte(),p=t.readInt(!0),g=p-1;switch(m){case BF:{let y=new ba(p,u);for(let _=0;_<p;_++)y.setFrame(_,t.readFloat(),t.readStringRef());r.push(y);break}case OF:{let y=t.readInt(!0),_=new j1(p,y,u),v=t.readFloat(),b=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255;for(let E=0,A=0;_.setFrame(E,v,b,T,S,w),E!=g;E++){let P=t.readFloat(),I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,R=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255;switch(t.readByte()){case Fr:_.setStepped(E);break;case kr:zt(t,_,A++,E,0,v,P,b,I,1),zt(t,_,A++,E,1,v,P,T,C,1),zt(t,_,A++,E,2,v,P,S,R,1),zt(t,_,A++,E,3,v,P,w,F,1)}v=P,b=I,T=C,S=R,w=F}r.push(_);break}case DF:{let y=t.readInt(!0),_=new q1(p,y,u),v=t.readFloat(),b=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255;for(let w=0,E=0;_.setFrame(w,v,b,T,S),w!=g;w++){let A=t.readFloat(),P=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255;switch(t.readByte()){case Fr:_.setStepped(w);break;case kr:zt(t,_,E++,w,0,v,A,b,P,1),zt(t,_,E++,w,1,v,A,T,I,1),zt(t,_,E++,w,2,v,A,S,C,1)}v=A,b=P,T=I,S=C}r.push(_);break}case NF:{let y=t.readInt(!0),_=new Z1(p,y,u),v=t.readFloat(),b=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255;for(let I=0,C=0;_.setFrame(I,v,b,T,S,w,E,A,P),I!=g;I++){let R=t.readFloat(),F=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,O=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255;switch(t.readByte()){case Fr:_.setStepped(I);break;case kr:zt(t,_,C++,I,0,v,R,b,F,1),zt(t,_,C++,I,1,v,R,T,D,1),zt(t,_,C++,I,2,v,R,S,M,1),zt(t,_,C++,I,3,v,R,w,O,1),zt(t,_,C++,I,4,v,R,E,k,1),zt(t,_,C++,I,5,v,R,A,N,1),zt(t,_,C++,I,6,v,R,P,B,1)}v=R,b=F,T=D,S=M,w=O,E=k,A=N,P=B}r.push(_);break}case UF:{let y=t.readInt(!0),_=new J1(p,y,u),v=t.readFloat(),b=t.readUnsignedByte()/255,T=t.readUnsignedByte()/255,S=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255,E=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255;for(let P=0,I=0;_.setFrame(P,v,b,T,S,w,E,A),P!=g;P++){let C=t.readFloat(),R=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,O=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255;switch(t.readByte()){case Fr:_.setStepped(P);break;case kr:zt(t,_,I++,P,0,v,C,b,R,1),zt(t,_,I++,P,1,v,C,T,F,1),zt(t,_,I++,P,2,v,C,S,D,1),zt(t,_,I++,P,3,v,C,w,M,1),zt(t,_,I++,P,4,v,C,E,O,1),zt(t,_,I++,P,5,v,C,A,k,1)}v=C,b=R,T=F,S=D,w=M,E=O,A=k}r.push(_);break}case XF:{let y=new K1(p,t.readInt(!0),u),_=t.readFloat(),v=t.readUnsignedByte()/255;for(let b=0,T=0;y.setFrame(b,_,v),b!=g;b++){let S=t.readFloat(),w=t.readUnsignedByte()/255;switch(t.readByte()){case Fr:y.setStepped(b);break;case kr:zt(t,y,T++,b,0,_,S,v,w,1)}_=S,v=w}r.push(y)}}}}for(let l=0,c=t.readInt(!0);l<c;l++){let u=t.readInt(!0);for(let d=0,f=t.readInt(!0);d<f;d++){let m=t.readByte(),p=t.readInt(!0);if(m==LF){let y=new z1(p,u);for(let _=0;_<p;_++)y.setFrame(_,t.readFloat(),t.readByte());r.push(y);continue}let g=t.readInt(!0);switch(m){case SF:r.push(rs(t,new ac(p,g,u),1));break;case EF:r.push(Df(t,new N1(p,g,u),n));break;case AF:r.push(rs(t,new U1(p,g,u),n));break;case CF:r.push(rs(t,new X1(p,g,u),n));break;case IF:r.push(Df(t,new V1(p,g,u),1));break;case PF:r.push(rs(t,new Y1(p,g,u),1));break;case MF:r.push(rs(t,new G1(p,g,u),1));break;case RF:r.push(Df(t,new $1(p,g,u),1));break;case FF:r.push(rs(t,new H1(p,g,u),1));break;case kF:r.push(rs(t,new W1(p,g,u),1))}}}for(let l=0,c=t.readInt(!0);l<c;l++){let u=t.readInt(!0),d=t.readInt(!0),f=d-1,m=new tw(d,t.readInt(!0),u),p=t.readByte(),g=t.readFloat(),y=(p&1)!=0?(p&2)!=0?t.readFloat():1:0,_=(p&4)!=0?t.readFloat()*n:0;for(let v=0,b=0;m.setFrame(v,g,y,_,(p&8)!=0?1:-1,(p&16)!=0,(p&32)!=0),v!=f;v++){p=t.readByte();const T=t.readFloat(),S=(p&1)!=0?(p&2)!=0?t.readFloat():1:0,w=(p&4)!=0?t.readFloat()*n:0;(p&64)!=0?m.setStepped(v):(p&128)!=0&&(zt(t,m,b++,v,0,g,T,y,S,1),zt(t,m,b++,v,1,g,T,_,w,n)),g=T,y=S,_=w}r.push(m)}for(let l=0,c=t.readInt(!0);l<c;l++){let u=t.readInt(!0),d=t.readInt(!0),f=d-1,m=new ew(d,t.readInt(!0),u),p=t.readFloat(),g=t.readFloat(),y=t.readFloat(),_=t.readFloat(),v=t.readFloat(),b=t.readFloat(),T=t.readFloat();for(let S=0,w=0;m.setFrame(S,p,g,y,_,v,b,T),S!=f;S++){let E=t.readFloat(),A=t.readFloat(),P=t.readFloat(),I=t.readFloat(),C=t.readFloat(),R=t.readFloat(),F=t.readFloat();switch(t.readByte()){case Fr:m.setStepped(S);break;case kr:zt(t,m,w++,S,0,p,E,g,A,1),zt(t,m,w++,S,1,p,E,y,P,1),zt(t,m,w++,S,2,p,E,_,I,1),zt(t,m,w++,S,3,p,E,v,C,1),zt(t,m,w++,S,4,p,E,b,R,1),zt(t,m,w++,S,5,p,E,T,F,1)}p=E,g=A,y=P,_=I,v=C,b=R,T=F}r.push(m)}for(let l=0,c=t.readInt(!0);l<c;l++){let u=t.readInt(!0),d=s.pathConstraints[u];for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readByte(),g=t.readInt(!0),y=t.readInt(!0);switch(p){case GF:r.push(rs(t,new sw(g,y,u),d.positionMode==Hr.Fixed?n:1));break;case $F:r.push(rs(t,new rw(g,y,u),d.spacingMode==$e.Length||d.spacingMode==$e.Fixed?n:1));break;case HF:let _=new iw(g,y,u),v=t.readFloat(),b=t.readFloat(),T=t.readFloat(),S=t.readFloat();for(let w=0,E=0,A=_.getFrameCount()-1;_.setFrame(w,v,b,T,S),w!=A;w++){let P=t.readFloat(),I=t.readFloat(),C=t.readFloat(),R=t.readFloat();switch(t.readByte()){case Fr:_.setStepped(w);break;case kr:zt(t,_,E++,w,0,v,P,b,I,1),zt(t,_,E++,w,1,v,P,T,C,1),zt(t,_,E++,w,2,v,P,S,R,1)}v=P,b=I,T=C,S=R}r.push(_)}}}for(let l=0,c=t.readInt(!0);l<c;l++){const u=t.readInt(!0)-1;for(let d=0,f=t.readInt(!0);d<f;d++){const m=t.readByte(),p=t.readInt(!0);if(m==QF){const y=new dw(p,u);for(let _=0;_<p;_++)y.setFrame(_,t.readFloat());r.push(y);continue}const g=t.readInt(!0);switch(m){case WF:r.push(rs(t,new nw(p,g,u),1));break;case zF:r.push(rs(t,new aw(p,g,u),1));break;case jF:r.push(rs(t,new ow(p,g,u),1));break;case qF:r.push(rs(t,new lw(p,g,u),1));break;case KF:r.push(rs(t,new hw(p,g,u),1));break;case ZF:r.push(rs(t,new cw(p,g,u),1));break;case JF:r.push(rs(t,new uw(p,g,u),1))}}}for(let l=0,c=t.readInt(!0);l<c;l++){let u=s.skins[t.readInt(!0)];for(let d=0,f=t.readInt(!0);d<f;d++){let m=t.readInt(!0);for(let p=0,g=t.readInt(!0);p<g;p++){let y=t.readStringRef();if(!y)throw new Error("attachmentName must not be null.");let _=u.getAttachment(m,y),v=t.readByte(),b=t.readInt(!0),T=b-1;switch(v){case VF:{let S=_,w=S.bones,E=S.vertices,A=w?E.length/3*2:E.length,P=t.readInt(!0),I=new Q1(b,P,m,S),C=t.readFloat();for(let R=0,F=0;;R++){let D,M=t.readInt(!0);if(M==0)D=w?xt.newFloatArray(A):E;else{D=xt.newFloatArray(A);let k=t.readInt(!0);if(M+=k,n==1)for(let N=k;N<M;N++)D[N]=t.readFloat();else for(let N=k;N<M;N++)D[N]=t.readFloat()*n;if(!w)for(let N=0,B=D.length;N<B;N++)D[N]+=E[N]}if(I.setFrame(R,C,D),R==T)break;let O=t.readFloat();switch(t.readByte()){case Fr:I.setStepped(R);break;case kr:zt(t,I,F++,R,0,C,O,0,1,1)}C=O}r.push(I);break}case YF:{let S=new fw(b,m,_);for(let w=0;w<b;w++){let E=t.readFloat(),A=t.readInt32();S.setFrame(w,E,D1[A&15],A>>4,t.readFloat())}r.push(S);break}}}}}let a=t.readInt(!0);if(a>0){let l=new Lo(a),c=s.slots.length;for(let u=0;u<a;u++){let d=t.readFloat(),f=t.readInt(!0),m=xt.newArray(c,0);for(let _=c-1;_>=0;_--)m[_]=-1;let p=xt.newArray(c-f,0),g=0,y=0;for(let _=0;_<f;_++){let v=t.readInt(!0);for(;g!=v;)p[y++]=g++;m[g+t.readInt(!0)]=g++}for(;g<c;)p[y++]=g++;for(let _=c-1;_>=0;_--)m[_]==-1&&(m[_]=p[--y]);l.setFrame(u,d,m)}r.push(l)}let o=t.readInt(!0);if(o>0){let l=new jp(o);for(let c=0;c<o;c++){let u=t.readFloat(),d=s.events[t.readInt(!0)],f=new vw(u,d);f.intValue=t.readInt(!1),f.floatValue=t.readFloat(),f.stringValue=t.readString(),f.stringValue==null&&(f.stringValue=d.stringValue),f.data.audioPath&&(f.volume=t.readFloat(),f.balance=t.readFloat()),l.setFrame(c,f)}r.push(l)}let h=0;for(let l=0,c=r.length;l<c;l++)h=Math.max(h,r[l].getDuration());return new Wp(e,r,h)}},_F=class{constructor(t,e=new Array,s=0,r=new DataView(t instanceof ArrayBuffer?t:t.buffer)){x(this,"strings");x(this,"index");x(this,"buffer");this.strings=e,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),s=e&127;return(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<7,(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<14,(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<21,(e&128)!=0&&(e=this.readByte(),s|=(e&127)<<28)))),t?s:s>>>1^-(s&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s<t;){let r=this.readUnsignedByte();switch(r>>4){case 12:case 13:e+=String.fromCharCode((r&31)<<6|this.readByte()&63),s+=2;break;case 14:e+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:e+=String.fromCharCode(r),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}},wF=class{constructor(t,e,s,r,n){x(this,"parent");x(this,"skinIndex");x(this,"slotIndex");x(this,"mesh");x(this,"inheritTimeline");this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}},TF=class{constructor(t=null,e=null,s=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=t,this.vertices=e,this.length=s}};var ri;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(ri||(ri={}));function rs(i,t,e){let s=i.readFloat(),r=i.readFloat()*e;for(let n=0,a=0,o=t.getFrameCount()-1;t.setFrame(n,s,r),n!=o;n++){let h=i.readFloat(),l=i.readFloat()*e;switch(i.readByte()){case Fr:t.setStepped(n);break;case kr:zt(i,t,a++,n,0,s,h,r,l,e)}s=h,r=l}return t}function Df(i,t,e){let s=i.readFloat(),r=i.readFloat()*e,n=i.readFloat()*e;for(let a=0,o=0,h=t.getFrameCount()-1;t.setFrame(a,s,r,n),a!=h;a++){let l=i.readFloat(),c=i.readFloat()*e,u=i.readFloat()*e;switch(i.readByte()){case Fr:t.setStepped(a);break;case kr:zt(i,t,o++,a,0,s,l,r,c,e),zt(i,t,o++,a,1,s,l,n,u,e)}s=l,r=c,n=u}return t}function zt(i,t,e,s,r,n,a,o,h,l){t.setBezier(e,s,r,n,o,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,a,h)}const SF=0,EF=1,AF=2,CF=3,IF=4,PF=5,MF=6,RF=7,FF=8,kF=9,LF=10,BF=0,OF=1,DF=2,NF=3,UF=4,XF=5,VF=0,YF=1,GF=0,$F=1,HF=2,WF=0,zF=1,jF=2,qF=4,KF=5,ZF=6,JF=7,QF=8,Fr=1,kr=2;let tk=class Ls{constructor(){x(this,"convexPolygons",new Array);x(this,"convexPolygonsIndices",new Array);x(this,"indicesArray",new Array);x(this,"isConcaveArray",new Array);x(this,"triangles",new Array);x(this,"polygonPool",new ic(()=>new Array));x(this,"polygonIndicesPool",new ic(()=>new Array))}triangulate(t){let e=t,s=t.length>>1,r=this.indicesArray;r.length=0;for(let o=0;o<s;o++)r[o]=o;let n=this.isConcaveArray;n.length=0;for(let o=0,h=s;o<h;++o)n[o]=Ls.isConcave(o,s,e,r);let a=this.triangles;for(a.length=0;s>3;){let o=s-1,h=0,l=1;for(;;){t:if(!n[h]){let d=r[o]<<1,f=r[h]<<1,m=r[l]<<1,p=e[d],g=e[d+1],y=e[f],_=e[f+1],v=e[m],b=e[m+1];for(let T=(l+1)%s;T!=o;T=(T+1)%s){if(!n[T])continue;let S=r[T]<<1,w=e[S],E=e[S+1];if(Ls.positiveArea(v,b,p,g,w,E)&&Ls.positiveArea(p,g,y,_,w,E)&&Ls.positiveArea(y,_,v,b,w,E))break t}break}if(l==0){do{if(!n[h])break;h--}while(h>0);break}o=h,h=l,l=(l+1)%s}a.push(r[(s+h-1)%s]),a.push(r[h]),a.push(r[(h+1)%s]),r.splice(h,1),n.splice(h,1),s--;let c=(s+h-1)%s,u=h==s?0:h;n[c]=Ls.isConcave(c,s,e,r),n[u]=Ls.isConcave(u,s,e,r)}return s==3&&(a.push(r[2]),a.push(r[0]),a.push(r[1])),a}decompose(t,e){let s=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;let n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let h=-1,l=0;for(let c=0,u=e.length;c<u;c+=3){let d=e[c]<<1,f=e[c+1]<<1,m=e[c+2]<<1,p=s[d],g=s[d+1],y=s[f],_=s[f+1],v=s[m],b=s[m+1],T=!1;if(h==d){let S=o.length-4,w=Ls.winding(o[S],o[S+1],o[S+2],o[S+3],v,b),E=Ls.winding(v,b,o[0],o[1],o[2],o[3]);w==l&&E==l&&(o.push(v),o.push(b),a.push(m),T=!0)}T||(o.length>0?(r.push(o),n.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),o=this.polygonPool.obtain(),o.length=0,o.push(p),o.push(g),o.push(y),o.push(_),o.push(v),o.push(b),a=this.polygonIndicesPool.obtain(),a.length=0,a.push(d),a.push(f),a.push(m),l=Ls.winding(p,g,y,_,v,b),h=d)}o.length>0&&(r.push(o),n.push(a));for(let c=0,u=r.length;c<u;c++){if(a=n[c],a.length==0)continue;let d=a[0],f=a[a.length-1];o=r[c];let m=o.length-4,p=o[m],g=o[m+1],y=o[m+2],_=o[m+3],v=o[0],b=o[1],T=o[2],S=o[3],w=Ls.winding(p,g,y,_,v,b);for(let E=0;E<u;E++){if(E==c)continue;let A=n[E];if(A.length!=3)continue;let P=A[0],I=A[1],C=A[2],R=r[E],F=R[R.length-2],D=R[R.length-1];if(P!=d||I!=f)continue;let M=Ls.winding(p,g,y,_,F,D),O=Ls.winding(F,D,v,b,T,S);M==w&&O==w&&(R.length=0,A.length=0,o.push(F),o.push(D),a.push(C),p=y,g=_,y=F,_=D,E=0)}}for(let c=r.length-1;c>=0;c--)o=r[c],o.length==0&&(r.splice(c,1),this.polygonPool.free(o),a=n[c],n.splice(c,1),this.polygonIndicesPool.free(a));return r}static isConcave(t,e,s,r){let n=r[(e+t-1)%e]<<1,a=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(s[n],s[n+1],s[a],s[a+1],s[o],s[o+1])}static positiveArea(t,e,s,r,n,a){return t*(a-r)+s*(e-a)+n*(r-e)>=0}static winding(t,e,s,r,n,a){let o=s-t,h=r-e;return n*h-a*o+o*e-t*h>=0?1:-1}},ek=class Zm{constructor(){x(this,"triangulator",new tk);x(this,"clippingPolygon",new Array);x(this,"clipOutput",new Array);x(this,"clippedVertices",new Array);x(this,"clippedUVs",new Array);x(this,"clippedTriangles",new Array);x(this,"scratch",new Array);x(this,"clipAttachment",null);x(this,"clippingPolygons",null)}clipStart(t,e){if(this.clipAttachment)return 0;this.clipAttachment=e;let s=e.worldVerticesLength,r=xt.setArraySize(this.clippingPolygon,s);e.computeWorldVertices(t,0,s,r,0,2);let n=this.clippingPolygon;Zm.makeClockwise(n);let a=this.clippingPolygons=this.triangulator.decompose(n,this.triangulator.triangulate(n));for(let o=0,h=a.length;o<h;o++){let l=a[o];Zm.makeClockwise(l),l.push(l[0]),l.push(l[1])}return a.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,s,r,n,a,o,h){let l,c,u,d,f,m;typeof e=="number"?(l=s,c=r,u=n,d=a,f=o,m=h):(l=e,c=s,u=r,d=n,f=a,m=o),u&&d&&f&&typeof m=="boolean"?this.clipTrianglesRender(t,l,c,u,d,f,m):this.clipTrianglesNoRender(t,l,c)}clipTrianglesNoRender(t,e,s){let r=this.clipOutput,n=this.clippedVertices,a=this.clippedTriangles,o=this.clippingPolygons,h=o.length,l=0;n.length=0,a.length=0;for(let c=0;c<s;c+=3){let u=e[c]<<1,d=t[u],f=t[u+1];u=e[c+1]<<1;let m=t[u],p=t[u+1];u=e[c+2]<<1;let g=t[u],y=t[u+1];for(let _=0;_<h;_++){let v=n.length;if(this.clip(d,f,m,p,g,y,o[_],r)){let b=r.length;if(b==0)continue;let T=b>>1,S=this.clipOutput,w=xt.setArraySize(n,v+T*2);for(let A=0;A<b;A+=2,v+=2){let P=S[A],I=S[A+1];w[v]=P,w[v+1]=I}v=a.length;let E=xt.setArraySize(a,v+3*(T-2));T--;for(let A=1;A<T;A++,v+=3)E[v]=l,E[v+1]=l+A,E[v+2]=l+A+1;l+=T+1}else{let b=xt.setArraySize(n,v+6);b[v]=d,b[v+1]=f,b[v+2]=m,b[v+3]=p,b[v+4]=g,b[v+5]=y,v=a.length;let T=xt.setArraySize(a,v+3);T[v]=l,T[v+1]=l+1,T[v+2]=l+2,l+=3;break}}}}clipTrianglesRender(t,e,s,r,n,a,o){let h=this.clipOutput,l=this.clippedVertices,c=this.clippedTriangles,u=this.clippingPolygons,d=u.length,f=o?12:8,m=0;l.length=0,c.length=0;for(let p=0;p<s;p+=3){let g=e[p]<<1,y=t[g],_=t[g+1],v=r[g],b=r[g+1];g=e[p+1]<<1;let T=t[g],S=t[g+1],w=r[g],E=r[g+1];g=e[p+2]<<1;let A=t[g],P=t[g+1],I=r[g],C=r[g+1];for(let R=0;R<d;R++){let F=l.length;if(this.clip(y,_,T,S,A,P,u[R],h)){let D=h.length;if(D==0)continue;let M=S-P,O=A-T,k=y-A,N=P-_,B=1/(M*k+O*(_-P)),L=D>>1,G=this.clipOutput,V=xt.setArraySize(l,F+L*f);for(let H=0;H<D;H+=2,F+=f){let at=G[H],et=G[H+1];V[F]=at,V[F+1]=et,V[F+2]=n.r,V[F+3]=n.g,V[F+4]=n.b,V[F+5]=n.a;let ot=at-A,ct=et-P,rt=(M*ot+O*ct)*B,dt=(N*ot+k*ct)*B,X=1-rt-dt;V[F+6]=v*rt+w*dt+I*X,V[F+7]=b*rt+E*dt+C*X,o&&(V[F+8]=a.r,V[F+9]=a.g,V[F+10]=a.b,V[F+11]=a.a)}F=c.length;let q=xt.setArraySize(c,F+3*(L-2));L--;for(let H=1;H<L;H++,F+=3)q[F]=m,q[F+1]=m+H,q[F+2]=m+H+1;m+=L+1}else{let D=xt.setArraySize(l,F+3*f);D[F]=y,D[F+1]=_,D[F+2]=n.r,D[F+3]=n.g,D[F+4]=n.b,D[F+5]=n.a,o?(D[F+6]=v,D[F+7]=b,D[F+8]=a.r,D[F+9]=a.g,D[F+10]=a.b,D[F+11]=a.a,D[F+12]=T,D[F+13]=S,D[F+14]=n.r,D[F+15]=n.g,D[F+16]=n.b,D[F+17]=n.a,D[F+18]=w,D[F+19]=E,D[F+20]=a.r,D[F+21]=a.g,D[F+22]=a.b,D[F+23]=a.a,D[F+24]=A,D[F+25]=P,D[F+26]=n.r,D[F+27]=n.g,D[F+28]=n.b,D[F+29]=n.a,D[F+30]=I,D[F+31]=C,D[F+32]=a.r,D[F+33]=a.g,D[F+34]=a.b,D[F+35]=a.a):(D[F+6]=v,D[F+7]=b,D[F+8]=T,D[F+9]=S,D[F+10]=n.r,D[F+11]=n.g,D[F+12]=n.b,D[F+13]=n.a,D[F+14]=w,D[F+15]=E,D[F+16]=A,D[F+17]=P,D[F+18]=n.r,D[F+19]=n.g,D[F+20]=n.b,D[F+21]=n.a,D[F+22]=I,D[F+23]=C),F=c.length;let M=xt.setArraySize(c,F+3);M[F]=m,M[F+1]=m+1,M[F+2]=m+2,m+=3;break}}}}clipTrianglesUnpacked(t,e,s,r){let n=this.clipOutput,a=this.clippedVertices,o=this.clippedUVs,h=this.clippedTriangles,l=this.clippingPolygons,c=l.length,u=0;a.length=0,o.length=0,h.length=0;for(let d=0;d<s;d+=3){let f=e[d]<<1,m=t[f],p=t[f+1],g=r[f],y=r[f+1];f=e[d+1]<<1;let _=t[f],v=t[f+1],b=r[f],T=r[f+1];f=e[d+2]<<1;let S=t[f],w=t[f+1],E=r[f],A=r[f+1];for(let P=0;P<c;P++){let I=a.length;if(this.clip(m,p,_,v,S,w,l[P],n)){let C=n.length;if(C==0)continue;let R=v-w,F=S-_,D=m-S,M=w-p,O=1/(R*D+F*(p-w)),k=C>>1,N=this.clipOutput,B=xt.setArraySize(a,I+k*2),L=xt.setArraySize(o,I+k*2);for(let V=0;V<C;V+=2,I+=2){let q=N[V],H=N[V+1];B[I]=q,B[I+1]=H;let at=q-S,et=H-w,ot=(R*at+F*et)*O,ct=(M*at+D*et)*O,rt=1-ot-ct;L[I]=g*ot+b*ct+E*rt,L[I+1]=y*ot+T*ct+A*rt}I=h.length;let G=xt.setArraySize(h,I+3*(k-2));k--;for(let V=1;V<k;V++,I+=3)G[I]=u,G[I+1]=u+V,G[I+2]=u+V+1;u+=k+1}else{let C=xt.setArraySize(a,I+6);C[I]=m,C[I+1]=p,C[I+2]=_,C[I+3]=v,C[I+4]=S,C[I+5]=w;let R=xt.setArraySize(o,I+6);R[I]=g,R[I+1]=y,R[I+2]=b,R[I+3]=T,R[I+4]=E,R[I+5]=A,I=h.length;let F=xt.setArraySize(h,I+3);F[I]=u,F[I+1]=u+1,F[I+2]=u+2,u+=3;break}}}}clip(t,e,s,r,n,a,o,h){let l=h,c=!1,u;o.length%4>=2?(u=h,h=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(s),u.push(r),u.push(n),u.push(a),u.push(t),u.push(e),h.length=0;let d=o.length-4,f=o;for(let m=0;;m+=2){let p=f[m],g=f[m+1],y=p-f[m+2],_=g-f[m+3],v=h.length,b=u;for(let S=0,w=u.length-2;S<w;){let E=b[S],A=b[S+1];S+=2;let P=b[S],I=b[S+1],C=_*(p-P)>y*(g-I),R=_*(p-E)-y*(g-A);if(R>0){if(C){h.push(P),h.push(I);continue}let F=P-E,D=I-A,M=R/(F*_-D*y);if(M>=0&&M<=1)h.push(E+F*M),h.push(A+D*M);else{h.push(P),h.push(I);continue}}else if(C){let F=P-E,D=I-A,M=R/(F*_-D*y);if(M>=0&&M<=1)h.push(E+F*M),h.push(A+D*M),h.push(P),h.push(I);else{h.push(P),h.push(I);continue}}c=!0}if(v==h.length)return l.length=0,!0;if(h.push(h[0]),h.push(h[1]),m==d)break;let T=h;h=u,h.length=0,u=T}if(l!=h){l.length=0;for(let m=0,p=h.length-2;m<p;m++)l[m]=h[m]}else l.length=l.length-2;return c}static makeClockwise(t){let e=t,s=t.length,r=e[s-2]*e[1]-e[0]*e[s-1],n=0,a=0,o=0,h=0;for(let l=0,c=s-3;l<c;l+=2)n=e[l],a=e[l+1],o=e[l+2],h=e[l+3],r+=n*h-o*a;if(!(r<0))for(let l=0,c=s-2,u=s>>1;l<u;l+=2){let d=e[l],f=e[l+1],m=c-l;e[l]=e[m],e[l+1]=e[m+1],e[m]=d,e[m+1]=f}}},sb=class{constructor(t){x(this,"attachmentLoader");x(this,"scale",1);x(this,"linkedMeshes",new Array);this.attachmentLoader=t}readSkeletonData(t){let e=this.scale,s=new lc,r=typeof t=="string"?JSON.parse(t):t,n=r.skeleton;if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=Z(n,"referenceScale",100)*e,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),r.bones)for(let a=0;a<r.bones.length;a++){let o=r.bones[a],h=null,l=Z(o,"parent",null);l&&(h=s.findBone(l));let c=new bw(s.bones.length,o.name,h);c.length=Z(o,"length",0)*e,c.x=Z(o,"x",0)*e,c.y=Z(o,"y",0)*e,c.rotation=Z(o,"rotation",0),c.scaleX=Z(o,"scaleX",1),c.scaleY=Z(o,"scaleY",1),c.shearX=Z(o,"shearX",0),c.shearY=Z(o,"shearY",0),c.inherit=xt.enumValue(Ae,Z(o,"inherit","Normal")),c.skinRequired=Z(o,"skin",!1);let u=Z(o,"color",null);u&&c.color.setFromString(u),s.bones.push(c)}if(r.slots)for(let a=0;a<r.slots.length;a++){let o=r.slots[a],h=o.name,l=s.findBone(o.bone);if(!l)throw new Error(`Couldn't find bone ${o.bone} for slot ${h}`);let c=new Ew(s.slots.length,h,l),u=Z(o,"color",null);u&&c.color.setFromString(u);let d=Z(o,"dark",null);d&&(c.darkColor=Dt.fromString(d)),c.attachmentName=Z(o,"attachment",null),c.blendMode=xt.enumValue(Qi,Z(o,"blend","normal")),c.visible=Z(o,"visible",!0),s.slots.push(c)}if(r.ik)for(let a=0;a<r.ik.length;a++){let o=r.ik[a],h=new ww(o.name);h.order=Z(o,"order",0),h.skinRequired=Z(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let u=s.findBone(o.bones[c]);if(!u)throw new Error(`Couldn't find bone ${o.bones[c]} for IK constraint ${o.name}.`);h.bones.push(u)}let l=s.findBone(o.target);if(!l)throw new Error(`Couldn't find target bone ${o.target} for IK constraint ${o.name}.`);h.target=l,h.mix=Z(o,"mix",1),h.softness=Z(o,"softness",0)*e,h.bendDirection=Z(o,"bendPositive",!0)?1:-1,h.compress=Z(o,"compress",!1),h.stretch=Z(o,"stretch",!1),h.uniform=Z(o,"uniform",!1),s.ikConstraints.push(h)}if(r.transform)for(let a=0;a<r.transform.length;a++){let o=r.transform[a],h=new Aw(o.name);h.order=Z(o,"order",0),h.skinRequired=Z(o,"skin",!1);for(let u=0;u<o.bones.length;u++){let d=o.bones[u],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for transform constraint ${o.name}.`);h.bones.push(f)}let l=o.target,c=s.findBone(l);if(!c)throw new Error(`Couldn't find target bone ${l} for transform constraint ${o.name}.`);h.target=c,h.local=Z(o,"local",!1),h.relative=Z(o,"relative",!1),h.offsetRotation=Z(o,"rotation",0),h.offsetX=Z(o,"x",0)*e,h.offsetY=Z(o,"y",0)*e,h.offsetScaleX=Z(o,"scaleX",0),h.offsetScaleY=Z(o,"scaleY",0),h.offsetShearY=Z(o,"shearY",0),h.mixRotate=Z(o,"mixRotate",1),h.mixX=Z(o,"mixX",1),h.mixY=Z(o,"mixY",h.mixX),h.mixScaleX=Z(o,"mixScaleX",1),h.mixScaleY=Z(o,"mixScaleY",h.mixScaleX),h.mixShearY=Z(o,"mixShearY",1),s.transformConstraints.push(h)}if(r.path)for(let a=0;a<r.path.length;a++){let o=r.path[a],h=new Tw(o.name);h.order=Z(o,"order",0),h.skinRequired=Z(o,"skin",!1);for(let u=0;u<o.bones.length;u++){let d=o.bones[u],f=s.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for path constraint ${o.name}.`);h.bones.push(f)}let l=o.target,c=s.findSlot(l);if(!c)throw new Error(`Couldn't find target slot ${l} for path constraint ${o.name}.`);h.target=c,h.positionMode=xt.enumValue(Hr,Z(o,"positionMode","Percent")),h.spacingMode=xt.enumValue($e,Z(o,"spacingMode","Length")),h.rotateMode=xt.enumValue(Vn,Z(o,"rotateMode","Tangent")),h.offsetRotation=Z(o,"rotation",0),h.position=Z(o,"position",0),h.positionMode==Hr.Fixed&&(h.position*=e),h.spacing=Z(o,"spacing",0),(h.spacingMode==$e.Length||h.spacingMode==$e.Fixed)&&(h.spacing*=e),h.mixRotate=Z(o,"mixRotate",1),h.mixX=Z(o,"mixX",1),h.mixY=Z(o,"mixY",h.mixX),s.pathConstraints.push(h)}if(r.physics)for(let a=0;a<r.physics.length;a++){const o=r.physics[a],h=new Sw(o.name);h.order=Z(o,"order",0),h.skinRequired=Z(o,"skin",!1);const l=o.bone,c=s.findBone(l);if(c==null)throw new Error("Physics bone not found: "+l);h.bone=c,h.x=Z(o,"x",0),h.y=Z(o,"y",0),h.rotate=Z(o,"rotate",0),h.scaleX=Z(o,"scaleX",0),h.shearX=Z(o,"shearX",0),h.limit=Z(o,"limit",5e3)*e,h.step=1/Z(o,"fps",60),h.inertia=Z(o,"inertia",1),h.strength=Z(o,"strength",100),h.damping=Z(o,"damping",1),h.massInverse=1/Z(o,"mass",1),h.wind=Z(o,"wind",0),h.gravity=Z(o,"gravity",0),h.mix=Z(o,"mix",1),h.inertiaGlobal=Z(o,"inertiaGlobal",!1),h.strengthGlobal=Z(o,"strengthGlobal",!1),h.dampingGlobal=Z(o,"dampingGlobal",!1),h.massGlobal=Z(o,"massGlobal",!1),h.windGlobal=Z(o,"windGlobal",!1),h.gravityGlobal=Z(o,"gravityGlobal",!1),h.mixGlobal=Z(o,"mixGlobal",!1),s.physicsConstraints.push(h)}if(r.skins)for(let a=0;a<r.skins.length;a++){let o=r.skins[a],h=new Km(o.name);if(o.bones)for(let l=0;l<o.bones.length;l++){let c=o.bones[l],u=s.findBone(c);if(!u)throw new Error(`Couldn't find bone ${c} for skin ${o.name}.`);h.bones.push(u)}if(o.ik)for(let l=0;l<o.ik.length;l++){let c=o.ik[l],u=s.findIkConstraint(c);if(!u)throw new Error(`Couldn't find IK constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.transform)for(let l=0;l<o.transform.length;l++){let c=o.transform[l],u=s.findTransformConstraint(c);if(!u)throw new Error(`Couldn't find transform constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.path)for(let l=0;l<o.path.length;l++){let c=o.path[l],u=s.findPathConstraint(c);if(!u)throw new Error(`Couldn't find path constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.physics)for(let l=0;l<o.physics.length;l++){let c=o.physics[l],u=s.findPhysicsConstraint(c);if(!u)throw new Error(`Couldn't find physics constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}for(let l in o.attachments){let c=s.findSlot(l);if(!c)throw new Error(`Couldn't find slot ${l} for skin ${o.name}.`);let u=o.attachments[l];for(let d in u){let f=this.readAttachment(u[d],h,c.index,d,s);f&&h.setAttachment(c.index,d,f)}}s.skins.push(h),h.name=="default"&&(s.defaultSkin=h)}for(let a=0,o=this.linkedMeshes.length;a<o;a++){let h=this.linkedMeshes[a],l=h.skin?s.findSkin(h.skin):s.defaultSkin;if(!l)throw new Error(`Skin not found: ${h.skin}`);let c=l.getAttachment(h.slotIndex,h.parent);if(!c)throw new Error(`Parent mesh not found: ${h.parent}`);h.mesh.timelineAttachment=h.inheritTimeline?c:h.mesh,h.mesh.setParentMesh(c),h.mesh.region!=null&&h.mesh.updateRegion()}if(this.linkedMeshes.length=0,r.events)for(let a in r.events){let o=r.events[a],h=new _w(a);h.intValue=Z(o,"int",0),h.floatValue=Z(o,"float",0),h.stringValue=Z(o,"string",""),h.audioPath=Z(o,"audio",null),h.audioPath&&(h.volume=Z(o,"volume",1),h.balance=Z(o,"balance",0)),s.events.push(h)}if(r.animations)for(let a in r.animations){let o=r.animations[a];this.readAnimation(o,a,s)}return s}readAttachment(t,e,s,r,n){let a=this.scale;switch(r=Z(t,"name",r),Z(t,"type","region")){case"region":{let o=Z(t,"path",r),h=this.readSequence(Z(t,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(e,r,o,h);if(!l)return null;l.path=o,l.x=Z(t,"x",0)*a,l.y=Z(t,"y",0)*a,l.scaleX=Z(t,"scaleX",1),l.scaleY=Z(t,"scaleY",1),l.rotation=Z(t,"rotation",0),l.width=t.width*a,l.height=t.height*a,l.sequence=h;let c=Z(t,"color",null);return c&&l.color.setFromString(c),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let o=this.attachmentLoader.newBoundingBoxAttachment(e,r);if(!o)return null;this.readVertices(t,o,t.vertexCount<<1);let h=Z(t,"color",null);return h&&o.color.setFromString(h),o}case"mesh":case"linkedmesh":{let o=Z(t,"path",r),h=this.readSequence(Z(t,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(e,r,o,h);if(!l)return null;l.path=o;let c=Z(t,"color",null);c&&l.color.setFromString(c),l.width=Z(t,"width",0)*a,l.height=Z(t,"height",0)*a,l.sequence=h;let u=Z(t,"parent",null);if(u)return this.linkedMeshes.push(new sk(l,Z(t,"skin",null),s,u,Z(t,"timelines",!0))),l;let d=t.uvs;return this.readVertices(t,l,d.length),l.triangles=t.triangles,l.regionUVs=d,l.region!=null&&l.updateRegion(),l.edges=Z(t,"edges",null),l.hullLength=Z(t,"hull",0)*2,l}case"path":{let o=this.attachmentLoader.newPathAttachment(e,r);if(!o)return null;o.closed=Z(t,"closed",!1),o.constantSpeed=Z(t,"constantSpeed",!0);let h=t.vertexCount;this.readVertices(t,o,h<<1);let l=xt.newArray(h/3,0);for(let u=0;u<t.lengths.length;u++)l[u]=t.lengths[u]*a;o.lengths=l;let c=Z(t,"color",null);return c&&o.color.setFromString(c),o}case"point":{let o=this.attachmentLoader.newPointAttachment(e,r);if(!o)return null;o.x=Z(t,"x",0)*a,o.y=Z(t,"y",0)*a,o.rotation=Z(t,"rotation",0);let h=Z(t,"color",null);return h&&o.color.setFromString(h),o}case"clipping":{let o=this.attachmentLoader.newClippingAttachment(e,r);if(!o)return null;let h=Z(t,"end",null);h&&(o.endSlot=n.findSlot(h));let l=t.vertexCount;this.readVertices(t,o,l<<1);let c=Z(t,"color",null);return c&&o.color.setFromString(c),o}}return null}readSequence(t){if(t==null)return null;let e=new O1(Z(t,"count",0));return e.start=Z(t,"start",1),e.digits=Z(t,"digits",0),e.setupIndex=Z(t,"setup",0),e}readVertices(t,e,s){let r=this.scale;e.worldVerticesLength=s;let n=t.vertices;if(s==n.length){let h=xt.toFloatArray(n);if(r!=1)for(let l=0,c=n.length;l<c;l++)h[l]*=r;e.vertices=h;return}let a=new Array,o=new Array;for(let h=0,l=n.length;h<l;){let c=n[h++];o.push(c);for(let u=h+c*4;h<u;h+=4)o.push(n[h]),a.push(n[h+1]*r),a.push(n[h+2]*r),a.push(n[h+3])}e.bones=o,e.vertices=xt.toFloatArray(a)}readAnimation(t,e,s){let r=this.scale,n=new Array;if(t.slots)for(let o in t.slots){let h=t.slots[o],l=s.findSlot(o);if(!l)throw new Error("Slot not found: "+o);let c=l.index;for(let u in h){let d=h[u];if(!d)continue;let f=d.length;if(u=="attachment"){let m=new ba(f,c);for(let p=0;p<f;p++){let g=d[p];m.setFrame(p,Z(g,"time",0),Z(g,"name",null))}n.push(m)}else if(u=="rgba"){let m=new j1(f,f<<2,c),p=d[0],g=Z(p,"time",0),y=Dt.fromString(p.color);for(let _=0,v=0;;_++){m.setFrame(_,g,y.r,y.g,y.b,y.a);let b=d[_+1];if(!b){m.shrink(v);break}let T=Z(b,"time",0),S=Dt.fromString(b.color),w=p.curve;w&&(v=Jt(w,m,v,_,0,g,T,y.r,S.r,1),v=Jt(w,m,v,_,1,g,T,y.g,S.g,1),v=Jt(w,m,v,_,2,g,T,y.b,S.b,1),v=Jt(w,m,v,_,3,g,T,y.a,S.a,1)),g=T,y=S,p=b}n.push(m)}else if(u=="rgb"){let m=new q1(f,f*3,c),p=d[0],g=Z(p,"time",0),y=Dt.fromString(p.color);for(let _=0,v=0;;_++){m.setFrame(_,g,y.r,y.g,y.b);let b=d[_+1];if(!b){m.shrink(v);break}let T=Z(b,"time",0),S=Dt.fromString(b.color),w=p.curve;w&&(v=Jt(w,m,v,_,0,g,T,y.r,S.r,1),v=Jt(w,m,v,_,1,g,T,y.g,S.g,1),v=Jt(w,m,v,_,2,g,T,y.b,S.b,1)),g=T,y=S,p=b}n.push(m)}else if(u=="alpha")n.push(nr(d,new K1(f,f,c),0,1));else if(u=="rgba2"){let m=new Z1(f,f*7,c),p=d[0],g=Z(p,"time",0),y=Dt.fromString(p.light),_=Dt.fromString(p.dark);for(let v=0,b=0;;v++){m.setFrame(v,g,y.r,y.g,y.b,y.a,_.r,_.g,_.b);let T=d[v+1];if(!T){m.shrink(b);break}let S=Z(T,"time",0),w=Dt.fromString(T.light),E=Dt.fromString(T.dark),A=p.curve;A&&(b=Jt(A,m,b,v,0,g,S,y.r,w.r,1),b=Jt(A,m,b,v,1,g,S,y.g,w.g,1),b=Jt(A,m,b,v,2,g,S,y.b,w.b,1),b=Jt(A,m,b,v,3,g,S,y.a,w.a,1),b=Jt(A,m,b,v,4,g,S,_.r,E.r,1),b=Jt(A,m,b,v,5,g,S,_.g,E.g,1),b=Jt(A,m,b,v,6,g,S,_.b,E.b,1)),g=S,y=w,_=E,p=T}n.push(m)}else if(u=="rgb2"){let m=new J1(f,f*6,c),p=d[0],g=Z(p,"time",0),y=Dt.fromString(p.light),_=Dt.fromString(p.dark);for(let v=0,b=0;;v++){m.setFrame(v,g,y.r,y.g,y.b,_.r,_.g,_.b);let T=d[v+1];if(!T){m.shrink(b);break}let S=Z(T,"time",0),w=Dt.fromString(T.light),E=Dt.fromString(T.dark),A=p.curve;A&&(b=Jt(A,m,b,v,0,g,S,y.r,w.r,1),b=Jt(A,m,b,v,1,g,S,y.g,w.g,1),b=Jt(A,m,b,v,2,g,S,y.b,w.b,1),b=Jt(A,m,b,v,3,g,S,_.r,E.r,1),b=Jt(A,m,b,v,4,g,S,_.g,E.g,1),b=Jt(A,m,b,v,5,g,S,_.b,E.b,1)),g=S,y=w,_=E,p=T}n.push(m)}}}if(t.bones)for(let o in t.bones){let h=t.bones[o],l=s.findBone(o);if(!l)throw new Error("Bone not found: "+o);let c=l.index;for(let u in h){let d=h[u],f=d.length;if(f!=0){if(u==="rotate")n.push(nr(d,new ac(f,f,c),0,1));else if(u==="translate"){let m=new N1(f,f<<1,c);n.push(Nf(d,m,"x","y",0,r))}else if(u==="translatex"){let m=new U1(f,f,c);n.push(nr(d,m,0,r))}else if(u==="translatey"){let m=new X1(f,f,c);n.push(nr(d,m,0,r))}else if(u==="scale"){let m=new V1(f,f<<1,c);n.push(Nf(d,m,"x","y",1,1))}else if(u==="scalex"){let m=new Y1(f,f,c);n.push(nr(d,m,1,1))}else if(u==="scaley"){let m=new G1(f,f,c);n.push(nr(d,m,1,1))}else if(u==="shear"){let m=new $1(f,f<<1,c);n.push(Nf(d,m,"x","y",0,1))}else if(u==="shearx"){let m=new H1(f,f,c);n.push(nr(d,m,0,1))}else if(u==="sheary"){let m=new W1(f,f,c);n.push(nr(d,m,0,1))}else if(u==="inherit"){let m=new z1(f,l.index);for(let p=0;p<d.length;p++){let g=d[p];m.setFrame(p,Z(g,"time",0),xt.enumValue(Ae,Z(g,"inherit","Normal")))}n.push(m)}}}}if(t.ik)for(let o in t.ik){let h=t.ik[o],l=h[0];if(!l)continue;let c=s.findIkConstraint(o);if(!c)throw new Error("IK Constraint not found: "+o);let u=s.ikConstraints.indexOf(c),d=new tw(h.length,h.length<<1,u),f=Z(l,"time",0),m=Z(l,"mix",1),p=Z(l,"softness",0)*r;for(let g=0,y=0;;g++){d.setFrame(g,f,m,p,Z(l,"bendPositive",!0)?1:-1,Z(l,"compress",!1),Z(l,"stretch",!1));let _=h[g+1];if(!_){d.shrink(y);break}let v=Z(_,"time",0),b=Z(_,"mix",1),T=Z(_,"softness",0)*r,S=l.curve;S&&(y=Jt(S,d,y,g,0,f,v,m,b,1),y=Jt(S,d,y,g,1,f,v,p,T,r)),f=v,m=b,p=T,l=_}n.push(d)}if(t.transform)for(let o in t.transform){let h=t.transform[o],l=h[0];if(!l)continue;let c=s.findTransformConstraint(o);if(!c)throw new Error("Transform constraint not found: "+o);let u=s.transformConstraints.indexOf(c),d=new ew(h.length,h.length*6,u),f=Z(l,"time",0),m=Z(l,"mixRotate",1),p=Z(l,"mixX",1),g=Z(l,"mixY",p),y=Z(l,"mixScaleX",1),_=Z(l,"mixScaleY",y),v=Z(l,"mixShearY",1);for(let b=0,T=0;;b++){d.setFrame(b,f,m,p,g,y,_,v);let S=h[b+1];if(!S){d.shrink(T);break}let w=Z(S,"time",0),E=Z(S,"mixRotate",1),A=Z(S,"mixX",1),P=Z(S,"mixY",A),I=Z(S,"mixScaleX",1),C=Z(S,"mixScaleY",I),R=Z(S,"mixShearY",1),F=l.curve;F&&(T=Jt(F,d,T,b,0,f,w,m,E,1),T=Jt(F,d,T,b,1,f,w,p,A,1),T=Jt(F,d,T,b,2,f,w,g,P,1),T=Jt(F,d,T,b,3,f,w,y,I,1),T=Jt(F,d,T,b,4,f,w,_,C,1),T=Jt(F,d,T,b,5,f,w,v,R,1)),f=w,m=E,p=A,g=P,y=I,_=C,y=I,l=S}n.push(d)}if(t.path)for(let o in t.path){let h=t.path[o],l=s.findPathConstraint(o);if(!l)throw new Error("Path constraint not found: "+o);let c=s.pathConstraints.indexOf(l);for(let u in h){let d=h[u],f=d[0];if(!f)continue;let m=d.length;if(u==="position"){let p=new sw(m,m,c);n.push(nr(d,p,0,l.positionMode==Hr.Fixed?r:1))}else if(u==="spacing"){let p=new rw(m,m,c);n.push(nr(d,p,0,l.spacingMode==$e.Length||l.spacingMode==$e.Fixed?r:1))}else if(u==="mix"){let p=new iw(m,m*3,c),g=Z(f,"time",0),y=Z(f,"mixRotate",1),_=Z(f,"mixX",1),v=Z(f,"mixY",_);for(let b=0,T=0;;b++){p.setFrame(b,g,y,_,v);let S=d[b+1];if(!S){p.shrink(T);break}let w=Z(S,"time",0),E=Z(S,"mixRotate",1),A=Z(S,"mixX",1),P=Z(S,"mixY",A),I=f.curve;I&&(T=Jt(I,p,T,b,0,g,w,y,E,1),T=Jt(I,p,T,b,1,g,w,_,A,1),T=Jt(I,p,T,b,2,g,w,v,P,1)),g=w,y=E,_=A,v=P,f=S}n.push(p)}}}if(t.physics)for(let o in t.physics){let h=t.physics[o],l=-1;if(o.length>0){let c=s.findPhysicsConstraint(o);if(!c)throw new Error("Physics constraint not found: "+o);l=s.physicsConstraints.indexOf(c)}for(let c in h){let u=h[c],d=u[0];if(!d)continue;let f=u.length;if(c=="reset"){const p=new dw(f,l);for(let g=0;d!=null;d=u[g+1],g++)p.setFrame(g,Z(d,"time",0));n.push(p);continue}let m;if(c=="inertia")m=new nw(f,f,l);else if(c=="strength")m=new aw(f,f,l);else if(c=="damping")m=new ow(f,f,l);else if(c=="mass")m=new lw(f,f,l);else if(c=="wind")m=new hw(f,f,l);else if(c=="gravity")m=new cw(f,f,l);else if(c=="mix")m=new uw(f,f,l);else continue;n.push(nr(u,m,0,1))}}if(t.attachments)for(let o in t.attachments){let h=t.attachments[o],l=s.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let c in h){let u=h[c],d=s.findSlot(c);if(!d)throw new Error("Slot not found: "+c);let f=d.index;for(let m in u){let p=u[m],g=l.getAttachment(f,m);for(let y in p){let _=p[y],v=_[0];if(v){if(y=="deform"){let b=g.bones,T=g.vertices,S=b?T.length/3*2:T.length,w=new Q1(_.length,_.length,f,g),E=Z(v,"time",0);for(let A=0,P=0;;A++){let I,C=Z(v,"vertices",null);if(!C)I=b?xt.newFloatArray(S):T;else{I=xt.newFloatArray(S);let M=Z(v,"offset",0);if(xt.arrayCopy(C,0,I,M,C.length),r!=1)for(let O=M,k=O+C.length;O<k;O++)I[O]*=r;if(!b)for(let O=0;O<S;O++)I[O]+=T[O]}w.setFrame(A,E,I);let R=_[A+1];if(!R){w.shrink(P);break}let F=Z(R,"time",0),D=v.curve;D&&(P=Jt(D,w,P,A,0,E,F,0,1,1)),E=F,v=R}n.push(w)}else if(y=="sequence"){let b=new fw(_.length,f,g),T=0;for(let S=0;S<_.length;S++){let w=Z(v,"delay",T),E=Z(v,"time",0),A=Qe[Z(v,"mode","hold")],P=Z(v,"index",0);b.setFrame(S,E,A,P,w),T=w,v=_[S+1]}n.push(b)}}}}}}if(t.drawOrder){let o=new Lo(t.drawOrder.length),h=s.slots.length,l=0;for(let c=0;c<t.drawOrder.length;c++,l++){let u=t.drawOrder[c],d=null,f=Z(u,"offsets",null);if(f){d=xt.newArray(h,-1);let m=xt.newArray(h-f.length,0),p=0,g=0;for(let y=0;y<f.length;y++){let _=f[y],v=s.findSlot(_.slot);if(!v)throw new Error("Slot not found: "+v);let b=v.index;for(;p!=b;)m[g++]=p++;d[p+_.offset]=p++}for(;p<h;)m[g++]=p++;for(let y=h-1;y>=0;y--)d[y]==-1&&(d[y]=m[--g])}o.setFrame(l,Z(u,"time",0),d)}n.push(o)}if(t.events){let o=new jp(t.events.length),h=0;for(let l=0;l<t.events.length;l++,h++){let c=t.events[l],u=s.findEvent(c.name);if(!u)throw new Error("Event not found: "+c.name);let d=new vw(xt.toSinglePrecision(Z(c,"time",0)),u);d.intValue=Z(c,"int",u.intValue),d.floatValue=Z(c,"float",u.floatValue),d.stringValue=Z(c,"string",u.stringValue),d.data.audioPath&&(d.volume=Z(c,"volume",1),d.balance=Z(c,"balance",0)),o.setFrame(h,d)}n.push(o)}let a=0;for(let o=0,h=n.length;o<h;o++)a=Math.max(a,n[o].getDuration());s.animations.push(new Wp(e,n,a))}},sk=class{constructor(t,e,s,r,n){x(this,"parent");x(this,"skin");x(this,"slotIndex");x(this,"mesh");x(this,"inheritTimeline");this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=r,this.inheritTimeline=n}};function nr(i,t,e,s){let r=i[0],n=Z(r,"time",0),a=Z(r,"value",e)*s,o=0;for(let h=0;;h++){t.setFrame(h,n,a);let l=i[h+1];if(!l)return t.shrink(o),t;let c=Z(l,"time",0),u=Z(l,"value",e)*s;r.curve&&(o=Jt(r.curve,t,o,h,0,n,c,a,u,s)),n=c,a=u,r=l}}function Nf(i,t,e,s,r,n){let a=i[0],o=Z(a,"time",0),h=Z(a,e,r)*n,l=Z(a,s,r)*n,c=0;for(let u=0;;u++){t.setFrame(u,o,h,l);let d=i[u+1];if(!d)return t.shrink(c),t;let f=Z(d,"time",0),m=Z(d,e,r)*n,p=Z(d,s,r)*n,g=a.curve;g&&(c=Jt(g,t,c,u,0,o,f,h,m,n),c=Jt(g,t,c,u,1,o,f,l,p,n)),o=f,h=m,l=p,a=d}}function Jt(i,t,e,s,r,n,a,o,h,l){if(i=="stepped")return t.setStepped(s),e;let c=r<<2,u=i[c],d=i[c+1]*l,f=i[c+2],m=i[c+3]*l;return t.setBezier(e,s,r,n,o,u,d,f,m,a,h),e+1}function Z(i,t,e){return i[t]!==void 0?i[t]:e}typeof Math.fround>"u"&&(Math.fround=(function(i){return function(t){return i[0]=t,i[0]}})(new Float32Array(1)));if(typeof window<"u"&&window.PIXI){let i=window.require;window.require=t=>{if(i)return i(t);if(t.startsWith("@pixi/"))return window.PIXI}}var zs;let hc=(zs=class extends cF{constructor(e){super(e.resource.source);x(this,"texture");this.texture=Nt.from(e)}static from(e){return zs.textureMap.has(e)?zs.textureMap.get(e):new zs(e)}setFilters(e,s){this.texture.baseTexture.scaleMode=zs.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=zs.toPixiMipMap(e)}setWraps(e,s){this.texture.baseTexture.wrapMode=zs.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case ze.Nearest:case ze.MipMapNearestLinear:case ze.MipMapNearestNearest:return Ns.NEAREST;case ze.Linear:case ze.MipMapLinearLinear:case ze.MipMapLinearNearest:return Ns.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case ze.Nearest:case ze.Linear:return Ms.OFF;case ze.MipMapNearestLinear:case ze.MipMapNearestNearest:case ze.MipMapLinearLinear:case ze.MipMapLinearNearest:return Ms.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case wi.ClampToEdge:return Ps.CLAMP;case wi.MirroredRepeat:return Ps.MIRRORED_REPEAT;case wi.Repeat:return Ps.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case Qi.Normal:return It.NORMAL;case Qi.Additive:return It.ADD;case Qi.Multiply:return It.MULTIPLY;case Qi.Screen:return It.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}},x(zs,"textureMap",new Map),zs);var js;let rk=(js=class extends zn{constructor(){const e=new Zc;e.getBuffer("aVertexPosition").static=!1,e.getBuffer("aTextureCoord").static=!1;const s=new rl(Nt.EMPTY);super(e,s);x(this,"name","");x(this,"warnedTwoTint",!1)}updateFromSpineData(e,s,r,n,a,o,h,l){var y,_;this.texture=e.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((y=u.data)==null?void 0:y.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((_=d.data)==null?void 0:_.length)!==c&&(d.data=new Float32Array(c));let f=0,m=u.data,p=d.data;for(let v=0;v<a;v+=l?12:8){let b=v;p[f]=n[b++],p[f+1]=n[b++],b+=4,m[f]=n[b++],m[f+1]=n[b++],f+=2}l&&!this.warnedTwoTint&&(console.warn("DarkTint is not enabled by default. To enable use a DarkSlotMesh factory while creating the Spine object."),this.warnedTwoTint=!0),js.auxColor[0]=n[2],js.auxColor[1]=n[3],js.auxColor[2]=n[4],js.auxColor[3]=n[5],this.tint=js.auxColor,this.alpha=js.auxColor[3],this.blendMode=hc.toPixiBlending(s);const g=this.geometry.indexBuffer;if(g.data.length!==o.length)g.data=new Uint32Array(o);else{const v=g.data;for(let b=0;b<h;b++)v[b]=o[b]}this.name=r,u.update(),d.update(),g.update()}},x(js,"auxColor",[0,0,0,0]),js),ik=class extends er{constructor(t=!1){super();const e=new ne(void 0),s=new ne(void 0,!0),r=new ne(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,wt.FLOAT),this.addAttribute("aTextureCoord",s,2,!1,wt.FLOAT),this.addIndex(r)}};const nk=`
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform mat3 uTextureMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
|
||
}
|
||
`,ak=`
|
||
varying vec2 vTextureCoord;
|
||
uniform vec4 uColor;
|
||
uniform vec4 uDarkColor;
|
||
|
||
uniform sampler2D uSampler;
|
||
|
||
void main(void)
|
||
{
|
||
vec4 texColor = texture2D(uSampler, vTextureCoord);
|
||
gl_FragColor.a = texColor.a * uColor.a;
|
||
gl_FragColor.rgb = ((texColor.a - 1.0) * uDarkColor.a + 1.0 - texColor.rgb) * uDarkColor.rgb + texColor.rgb * uColor.rgb;
|
||
}
|
||
`;let ok=class extends Js{constructor(e){const s={uSampler:e??Nt.EMPTY,alpha:1,uTextureMatrix:fe.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},r={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(ur.from(nk,ak),s);x(this,"uvMatrix");x(this,"batchable");x(this,"pluginName");x(this,"_tintRGB");x(this,"_darkTintRGB");x(this,"_colorDirty");x(this,"_alpha");x(this,"_tintColor");x(this,"_darkTintColor");this._colorDirty=!1,this.uvMatrix=new jc(s.uSampler),this.batchable=!0,this.pluginName=r.pluginName,this._tintColor=new Wt(r.tint),this._darkTintColor=new Wt(r.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=r.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(e){e!==this.darkTint&&(this._darkTintColor.setValue(e),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._colorDirty=!0)}get darkTint(){return this._darkTintColor.value}get tintValue(){return this._tintColor.toNumber()}get darkTintValue(){return this._darkTintColor.toNumber()}update(){this._colorDirty&&(this._colorDirty=!1,Wt.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),Wt.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}},lk=class extends zn{constructor(e){super(new ik,new ok(e),void 0,void 0);x(this,"_darkTintRGB",0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(e){this.shader.darkTint=e}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(e){const s=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=s.indexBuffer.data,this._tintRGB=r._tintRGB,this._darkTintRGB=r._darkTintRGB,this._texture=r.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}};var Me;let Uf=(Me=class extends lk{constructor(){super();x(this,"name","")}updateFromSpineData(e,s,r,n,a,o,h,l){var y,_;this.texture=e.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((y=u.data)==null?void 0:y.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((_=d.data)==null?void 0:_.length)!==c&&(d.data=new Float32Array(c));let f=0,m=u.data,p=d.data;for(let v=0;v<a;v+=l?12:8){let b=v;p[f]=n[b++],p[f+1]=n[b++],b+=4,m[f]=n[b++],m[f+1]=n[b++],f+=2}l?(Me.auxColor[0]=n[8],Me.auxColor[1]=n[9],Me.auxColor[2]=n[10],Me.auxColor[3]=n[11],this.darkTint=Me.auxColor,Me.auxColor[0]=n[2],Me.auxColor[1]=n[3],Me.auxColor[2]=n[4],Me.auxColor[3]=n[5],this.tint=Me.auxColor):(Me.auxColor[0]=n[2],Me.auxColor[1]=n[3],Me.auxColor[2]=n[4],Me.auxColor[3]=n[5],this.tint=Me.auxColor),this.blendMode=hc.toPixiBlending(s),this.alpha=Me.auxColor[3];const g=this.geometry.indexBuffer;if(g.data.length!==o.length)g.data=new Uint32Array(o);else{const v=g.data;for(let b=0;b<h;b++)v[b]=o[b]}this.name=r,u.update(),d.update(),g.update()}},x(Me,"auxColor",[0,0,0,0]),Me);var qt;let aO=(qt=class extends fs{constructor(e,s){if(e instanceof lc)e={...s,skeletonData:e};else if(s)throw new Error("You cannot use options and oldOptions together.");super();x(this,"skeleton");x(this,"state");x(this,"darkTint",!1);x(this,"hasNeverUpdated",!0);x(this,"_debug");x(this,"slotMeshFactory",()=>new rk);x(this,"beforeUpdateWorldTransforms",()=>{});x(this,"afterUpdateWorldTransforms",()=>{});x(this,"_autoUpdate",!1);x(this,"_ticker",ss.shared);x(this,"meshesCache",new Map);x(this,"lightColor",new Dt);x(this,"darkColor",new Dt);x(this,"_boundsProvider");x(this,"_boundsPoint",new Kt);x(this,"_boundsSpineID",-1);x(this,"_boundsSpineDirty",!0);x(this,"slotsObject",new Map);x(this,"verticesCache",xt.newFloatArray(1024));x(this,"clippingSlotToPixiMasks",{});x(this,"currentClippingSlot");const r=e instanceof lc?e:e.skeletonData;this.skeleton=new Kp(r);const n=new lF(r);this.state=new rF(n),(e==null?void 0:e.darkTint)!==void 0||(s==null?void 0:s.slotMeshFactory)===void 0?(this.darkTint=(e==null?void 0:e.darkTint)===void 0?this.skeleton.slots.some(a=>!!a.data.darkColor):e==null?void 0:e.darkTint,this.darkTint&&(this.slotMeshFactory=()=>new Uf)):this.initializeMeshFactory(s==null?void 0:s.slotMeshFactory),e!=null&&e.ticker&&(this._ticker=e.ticker),this.autoUpdate=(e==null?void 0:e.autoUpdate)??!0,this.boundsProvider=e.boundsProvider}get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!e&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=e}get ticker(){return this._ticker}set ticker(e){e=e??ss.shared,this._ticker!==e&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),e.add(this.internalUpdate,this)),this._ticker=e)}get boundsProvider(){return this._boundsProvider}set boundsProvider(e){this._boundsProvider=e,e?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}initializeMeshFactory(e){if(e){this.slotMeshFactory=e;const s=this.slotMeshFactory();s instanceof Uf&&(this.darkTint=!0),s.destroy()}else for(let s=0;s<this.skeleton.slots.length;s++)if(this.skeleton.slots[s].data.darkColor){this.slotMeshFactory=()=>new Uf,this.darkTint=!0;break}}update(e){this.internalUpdate(0,e)}internalUpdate(e,s){this.hasNeverUpdated=!1;const r=s??this._ticker.deltaMS/1e3;this.state.update(r),this.state.apply(this.skeleton),this.beforeUpdateWorldTransforms(this),this.skeleton.update(r),this.skeleton.updateWorldTransform(qi.update),this.afterUpdateWorldTransforms(this)}updateTransform(){var e;this.renderMeshes(),this.sortChildren(),(e=this.debug)==null||e.renderDebug(this),super.updateTransform()}destroy(e){var s;this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,r]of this.meshesCache)r==null||r.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(let r in this.clippingSlotToPixiMasks)(s=this.clippingSlotToPixiMasks[r].mask)==null||s.destroy(),delete this.clippingSlotToPixiMasks[r];super.destroy(e)}resetMeshes(){for(const[,e]of this.meshesCache)e.zIndex=-1,e.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(e){return this.meshesCache.has(e)}getMeshForSlot(e){if(this.hasMeshForSlot(e)){let s=this.meshesCache.get(e);return s.visible=!0,s}else{let s=this.slotMeshFactory();return this.addChild(s),this.meshesCache.set(e,s),s}}getSlotFromRef(e){let s;if(typeof e=="number"?s=this.skeleton.slots[e]:typeof e=="string"?s=this.skeleton.findSlot(e):s=e,!s)throw new Error(`No slot found with the given slot reference: ${e}`);return s}addSlotObject(e,s,r){var o;let n=this.getSlotFromRef(e);const a=(o=this.slotsObject.get(n))==null?void 0:o.container;if(!(a&&a===s)){for(const[h,{container:l}]of this.slotsObject)if(h!==n&&l===s){this.removeSlotObject(h,s);break}a&&this.removeChild(a),this.slotsObject.set(n,{container:s,followAttachmentTimeline:(r==null?void 0:r.followAttachmentTimeline)||!1,followSlotColor:(r==null?void 0:r.followSlotColor)||!1}),this.addChild(s)}}getSlotObject(e){const s=this.slotsObject.get(this.getSlotFromRef(e));return s?s.container:void 0}removeSlotObject(e,s){var a;let r=this.getSlotFromRef(e),n=(a=this.slotsObject.get(r))==null?void 0:a.container;n&&(s&&s!==n||(this.removeChild(n),this.slotsObject.delete(r)))}removeSlotObjects(){for(const[,e]of this.slotsObject)e.container.removeFromParent();this.slotsObject.clear()}updateSlotObject(e,s,r){const{container:n,followAttachmentTimeline:a}=e,o=a?!!s.attachment:!0;if(n.visible=this.skeleton.drawOrder.includes(s)&&o,n.visible){let h=s.bone;const l=n.localTransform;l.a=h.a,l.b=h.c,l.c=-h.b,l.d=-h.d,l.tx=h.worldX,l.ty=h.worldY,n.transform.setFromMatrix(l),n.zIndex=r,n.alpha=this.skeleton.color.a*s.color.a,e.followSlotColor&&this.setSlotObjectTint(n,255*this.skeleton.color.r*s.color.r<<16|255*this.skeleton.color.g*s.color.g<<8|255*this.skeleton.color.b*s.color.b)}}setSlotObjectTint(e,s){const r=e;"tint"in r&&(r.tint=s);for(const n of r.children??[])this.setSlotObjectTint(n,s)}updateAndSetPixiMask(e,s){var o,h;const r=e.attachment;if(r&&r instanceof Bo){const l=(o=this.clippingSlotToPixiMasks)[h=e.data.name]||(o[h]={slot:e,vertices:new Array});l.maskComputed=!1,this.currentClippingSlot=l;return}let n=this.currentClippingSlot;const a=this.slotsObject.get(e);if(n&&a){let l=n.mask;if(l||(l=rb.obtain(),n.mask=l,this.addChild(l)),!n.maskComputed){let c=n.slot,u=c.attachment;n.maskComputed=!0;const d=u.worldVerticesLength,f=n.vertices;u.computeWorldVertices(c,0,d,f,0,2),l.clear().lineStyle(0).beginFill(0).drawPolygon(f).endFill()}a.container.mask=l}else a!=null&&a.container.mask&&(a.container.mask=null);if(n&&n.slot.attachment.endSlot==e.data&&(this.currentClippingSlot=void 0),s){for(const l in this.clippingSlotToPixiMasks){const c=this.clippingSlotToPixiMasks[l];(!(c.slot.attachment instanceof Bo)||!c.maskComputed)&&c.mask&&(this.removeChild(c.mask),rb.free(c.mask),c.mask=void 0)}this.currentClippingSlot=void 0}}renderMeshes(){var n,a;this.resetMeshes();let e=null,s=null;const r=this.skeleton.drawOrder;for(let o=0,h=r.length,l=0;o<h;o++){const c=r[o];let u=this.slotsObject.get(c),d=o+l;u&&(this.updateSlotObject(u,c,d+1),l++),this.updateAndSetPixiMask(c,o===r.length-1);const f=c.darkColor!=null,m=qt.clipper.isClipping()?2:f?qt.DARK_VERTEX_SIZE:qt.VERTEX_SIZE;if(!c.bone.active){qt.clipper.clipEndWithSlot(c);continue}const p=c.getAttachment();let g,y,_=0;if(p instanceof qp){const v=p;g=v.color,_=m*4,v.computeWorldVertices(c,this.verticesCache,0,m),e=qt.QUAD_TRIANGLES,s=v.uvs,y=(n=v.region)==null?void 0:n.texture}else if(p instanceof Qc){const v=p;g=v.color,_=(v.worldVerticesLength>>1)*m,_>this.verticesCache.length&&(this.verticesCache=xt.newFloatArray(_)),v.computeWorldVertices(c,0,v.worldVerticesLength,this.verticesCache,0,m),e=v.triangles,s=v.uvs,y=(a=v.region)==null?void 0:a.texture}else if(p instanceof Bo){qt.clipper.clipStart(c,p);continue}else{this.hasMeshForSlot(c)&&(this.getMeshForSlot(c).visible=!1),qt.clipper.clipEndWithSlot(c);continue}if(y!=null){const b=c.bone.skeleton.color,T=c.color,S=b.a*T.a*g.a;this.lightColor.set(b.r*T.r*g.r,b.g*T.g*g.g,b.b*T.b*g.b,S),c.darkColor!=null?this.darkColor.set(c.darkColor.r,c.darkColor.g,c.darkColor.b,1):this.darkColor.set(0,0,0,1);let w,E,A,P;if(qt.clipper.isClipping())qt.clipper.clipTriangles(this.verticesCache,e,e.length,s,this.lightColor,this.darkColor,f),w=qt.clipper.clippedVertices,E=w.length,A=qt.clipper.clippedTriangles,P=A.length;else{const C=this.verticesCache;for(let R=2,F=0,D=_;R<D;R+=m,F+=2){let M=R;C[M++]=this.lightColor.r,C[M++]=this.lightColor.g,C[M++]=this.lightColor.b,C[M++]=this.lightColor.a,C[M++]=s[F],C[M++]=s[F+1],f&&(C[M++]=this.darkColor.r,C[M++]=this.darkColor.g,C[M++]=this.darkColor.b,C[M++]=this.darkColor.a)}w=this.verticesCache,E=_,A=e,P=e.length}if(E==0||P==0){qt.clipper.clipEndWithSlot(c);continue}const I=this.getMeshForSlot(c);I.renderable=!0,I.zIndex=d,I.updateFromSpineData(y,c.data.blendMode,c.data.name,w,E,A,P,f)}qt.clipper.clipEndWithSlot(c)}qt.clipper.clipEnd()}calculateBounds(){if(!this._boundsProvider){super.calculateBounds();return}const e=this.transform;if(this._boundsSpineID===e._worldID)return;this.updateBounds();const s=this._localBounds,r=this._boundsPoint;r.set(s.minX,s.minY),e.worldTransform.apply(r,r),this._bounds.minX=r.x,this._bounds.minY=r.y,r.set(s.maxX,s.maxY),e.worldTransform.apply(r,r),this._bounds.maxX=r.x,this._bounds.maxY=r.y}updateBounds(){if(!this._boundsProvider||!this._boundsSpineDirty)return;this._boundsSpineDirty=!1,this._localBounds||(this._localBounds=new Ya);const e=this._boundsProvider.calculateBounds(this),s=this._localBounds;s.clear(),s.minX=e.x,s.minY=e.y,s.maxX=e.x+e.width,s.maxY=e.y+e.height,this.hitArea=this._localBounds.getRectangle()}setBonePosition(e,s){const r=e;if(typeof e=="string"&&(e=this.skeleton.findBone(e)),!e)throw Error(`Cannot set bone position, bone ${String(r)} not found`);if(qt.vectorAux.set(s.x,s.y),e.parent){const n=e.parent.worldToLocal(qt.vectorAux);e.x=n.x,e.y=n.y}else e.x=qt.vectorAux.x,e.y=qt.vectorAux.y}getBonePosition(e,s){const r=e;return typeof e=="string"&&(e=this.skeleton.findBone(e)),e?(s||(s={x:0,y:0}),s.x=e.worldX,s.y=e.worldY,s):(console.error(`Cannot get bone position! Bone ${String(r)} not found`),s)}skeletonToPixiWorldCoordinates(e){this.worldTransform.apply(e,e)}pixiWorldCoordinatesToSkeleton(e){this.worldTransform.applyInverse(e,e)}pixiWorldCoordinatesToBone(e,s){this.pixiWorldCoordinatesToSkeleton(e),s.parent?s.parent.worldToLocal(e):s.worldToLocal(e)}static from(e,s,r){if(typeof e=="string")return qt.oldFrom(e,s,r);const{skeleton:n,atlas:a,scale:o=1,darkTint:h,autoUpdate:l,boundsProvider:c,ticker:u}=e,d=`${n}-${a}-${o}`;let f=qt.skeletonCache[d];if(!f){const m=Cs.get(n),p=Cs.get(a),g=new Jx(p);let y=m instanceof Uint8Array?new eb(g):new sb(g);y.scale=o,f=y.readSkeletonData(m),qt.skeletonCache[d]=f}return new qt({skeletonData:f,darkTint:h,autoUpdate:l,boundsProvider:c,ticker:u})}static oldFrom(e,s,r){const n=`${e}-${s}-${(r==null?void 0:r.scale)??1}`;let a=qt.skeletonCache[n];if(a)return new qt(a,r);const o=Cs.get(e),h=Cs.get(s),l=new Jx(h);let c=o instanceof Uint8Array?new eb(l):new sb(l);return c.scale=(r==null?void 0:r.scale)??1,a=c.readSkeletonData(o),qt.skeletonCache[n]=a,new this(a,r)}get tint(){return this.skeleton.color.toRgb888()}set tint(e){Dt.rgb888ToColor(this.skeleton.color,e)}},x(qt,"vectorAux",new nc),x(qt,"clipper",new ek),x(qt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),x(qt,"VERTEX_SIZE",8),x(qt,"DARK_VERTEX_SIZE",12),x(qt,"skeletonCache",Object.create(null)),qt);const rb=new ic(()=>new gs);Kp.yDown=!0;const fh="spineTextureAtlasLoader",hk={extension:gt.Asset,resolver:{test:i=>Ue(i,".atlas"),parse:i=>{var e,s;const t=i.split(".");return{resolution:parseFloat(((s=(e=_t.RETINA_PREFIX)==null?void 0:e.exec(i))==null?void 0:s[1])??"1"),format:t[t.length-2],src:i}}},loader:{name:fh,extension:{type:gt.LoadParser,priority:Ts.Normal,name:fh},test(i){return Ue(i,".atlas")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${fh}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return await t.text()},testParse(i,t){const e=Ue(t.src,".atlas"),s=typeof i=="string",r=t.loadParser===fh;return Promise.resolve((e||r)&&s)},unload(i){i.dispose()},async parse(i,t,e){var h;const s=t.data||{};let r=ye.dirname(t.src);r&&r.lastIndexOf("/")!==r.length-1&&(r+="/");const n=new dF(i);if(s.images instanceof Lt||typeof s.images=="string"){const l=s.images;s.images={},s.images[n.pages[0].name]=l}const a=[];let o=!0;for(const l of e.parsers)if(l.name=="loadTextures"){o=(h=l.config)==null?void 0:h.preferCreateImageBitmap;break}Cs.setPreferences({preferCreateImageBitmap:!1});for(const l of n.pages){const c=l.name,u=s!=null&&s.images?s.images[c]:void 0;if(u instanceof Lt)l.setTexture(hc.from(u));else{const d=u??ye.normalize([...r.split(ye.sep),c].join(ye.sep)),f={src:sl(d,t.src),data:{...s.imageMetadata,alphaMode:l.pma?Ke.PMA:Ke.UNPACK}},m=e.load(f).then(p=>{l.setTexture(hc.from(p.baseTexture))});a.push(m)}}return await Promise.all(a),Cs.setPreferences({preferCreateImageBitmap:o}),n}}};St.add(hk);const mh="spineSkeletonLoader";function ck(i){return i.hasOwnProperty("bones")}function uk(i){return i instanceof Uint8Array}const dk={extension:gt.Asset,loader:{name:mh,extension:{type:gt.LoadParser,priority:Ts.Normal,name:mh},test(i){return Ue(i,".skel")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${mh}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())},testParse(i,t){const e=Ue(t.src,".json")&&ck(i),s=Ue(t.src,".skel")&&uk(i),r=t.loadParser===mh;return Promise.resolve(e||s||r)}}};St.add(dk);let fk=class extends er{constructor(e=!1){super();x(this,"_buffer");x(this,"_indexBuffer");this._buffer=new ne(void 0,e,!1),this._indexBuffer=new ne(void 0,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,wt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,wt.FLOAT).addAttribute("aColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,wt.FLOAT).addIndex(this._indexBuffer)}};const mk=`
|
||
precision highp float;
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
attribute vec4 aColor;
|
||
attribute vec4 aDarkColor;
|
||
attribute float aTextureId;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform vec4 tint;
|
||
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
varying vec4 vDarkColor;
|
||
varying float vTextureId;
|
||
|
||
void main(void){
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = aTextureCoord;
|
||
vTextureId = aTextureId;
|
||
vColor = aColor * tint;
|
||
vDarkColor = aDarkColor * tint;
|
||
|
||
}
|
||
`,pk=`
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
varying vec4 vDarkColor;
|
||
varying float vTextureId;
|
||
uniform sampler2D uSamplers[%count%];
|
||
|
||
void main(void){
|
||
vec4 color;
|
||
%forloop%
|
||
|
||
|
||
gl_FragColor.a = color.a * vColor.a;
|
||
gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb;
|
||
}
|
||
`;var Vf;let gk=(Vf=class extends li{constructor(t){super(t),this.shaderGenerator=new Np(mk,pk),this.geometryClass=fk,this.vertexSize=7}packInterleavedGeometry(t,e,s,r,n){const{uint32View:a,float32View:o}=e,h=r/this.vertexSize,l=t.uvs,c=t.indices,u=t.vertexData,d=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),m=Wt.shared.setValue(t._tintRGB).toPremultiplied(f,!0),p=Wt.shared.setValue(t._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g<u.length;g+=2)o[r++]=u[g],o[r++]=u[g+1],o[r++]=l[g],o[r++]=l[g+1],a[r++]=m,a[r++]=p,o[r++]=d;for(let g=0;g<c.length;g++)s[n++]=h+c[g]}},x(Vf,"extension",{name:"darkTintBatch",type:gt.RendererPlugin}),Vf);St.add(gk);class Cw{constructor(){x(this,"array",[])}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!==void 0}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}class Zp{constructor(){x(this,"entries",{});x(this,"size",0)}add(t){const e=this.entries[t];return this.entries[t]=!0,e?!1:(this.size++,!0)}addAll(t){const e=this.size;for(let s=0,r=t.length;s<r;s++)this.add(t[s]);return e!==this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}}const Bs=class Bs{constructor(t=0,e=0,s=0,r=0){x(this,"r");x(this,"g");x(this,"b");x(this,"a");this.r=t,this.g=e,this.b=s,this.a=r}set(t,e,s,r){return this.r=t,this.g=e,this.b=s,this.a=r,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)==="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!==8?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,r){return this.r+=t,this.g+=e,this.b+=s,this.a+=r,this.clamp()}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(t,e){t.r=((e&4278190080)>>>24)/255,t.g=((e&16711680)>>>16)/255,t.b=((e&65280)>>>8)/255,t.a=(e&255)/255}static rgb888ToColor(t,e){t.r=((e&16711680)>>>16)/255,t.g=((e&65280)>>>8)/255,t.b=(e&255)/255}toRgb888(){const t=e=>`0${(e*255).toString(16)}`.slice(-2);return+`0x${t(this.r)}${t(this.g)}${t(this.b)}`}static fromString(t,e=new Bs){return e.setFromString(t)}};x(Bs,"WHITE",new Bs(1,1,1,1)),x(Bs,"RED",new Bs(1,0,0,1)),x(Bs,"GREEN",new Bs(0,1,0,1)),x(Bs,"BLUE",new Bs(0,0,1,1)),x(Bs,"MAGENTA",new Bs(1,0,1,1));let Ft=Bs;const Se=class Se{static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*Se.degRad)}static sinDeg(t){return Math.sin(t*Se.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*Se.radDeg}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){const e=Math.pow(Math.abs(t),.3333333333333333);return t<0?-e:e}static randomTriangular(t,e){return Se.randomTriangularWith(t,e,(t+e)*.5)}static randomTriangularWith(t,e,s){const r=Math.random(),n=e-t;return r<=(s-t)/n?t+Math.sqrt(r*n*(s-t)):e-Math.sqrt((1-r)*n*(e-s))}static isPowerOfTwo(t){return t&&(t&t-1)===0}};x(Se,"epsilon",1e-5),x(Se,"epsilon2",Se.epsilon*Se.epsilon),x(Se,"PI",3.1415927),x(Se,"PI2",Se.PI*2),x(Se,"invPI2",1/Se.PI2),x(Se,"radiansToDegrees",180/Se.PI),x(Se,"radDeg",Se.radiansToDegrees),x(Se,"degreesToRadians",Se.PI/180),x(Se,"degRad",Se.degreesToRadians);let pt=Se;const Gs=class Gs{apply(t,e,s){return e===void 0||s===void 0?this.applyInternal(t):t+(e-t)*this.applyInternal(s)}};x(Gs,"linear",new class extends Gs{applyInternal(t){return t}}),x(Gs,"smooth",new class extends Gs{applyInternal(t){return t*t*(3-2*t)}}),x(Gs,"slowFast",new class extends Gs{applyInternal(t){return t*t}}),x(Gs,"fastSlow",new class extends Gs{applyInternal(t){return(t-1)*(t-1)*-1+1}}),x(Gs,"circle",new class extends Gs{applyInternal(t){return t<=.5?(t*=2,(1-Math.sqrt(1-t*t))/2):(t--,t*=2,(Math.sqrt(1-t*t)+1)/2)}});let en=Gs;class Jp extends en{constructor(e){super();x(this,"power",2);this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2===0?-2:2)+1}}class Iw extends Jp{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2===0?-1:1)+1}}const Wi=class Wi{static arrayCopy(t,e,s,r,n){for(let a=e,o=r;a<e+n;a++,o++)s[o]=t[a]}static arrayFill(t,e,s,r){for(let n=e;n<s;n++)t[n]=r}static setArraySize(t,e,s=0){const r=t.length;if(r===e)return t;if(t.length=e,r<e)for(let n=r;n<e;n++)t[n]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:Wi.setArraySize(t,e,s)}static newArray(t,e){const s=[];for(let r=0;r<t;r++)s[r]=e;return s}static newFloatArray(t){if(Wi.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{const e=[];for(let s=0;s<e.length;s++)e[s]=0;return e}}static newShortArray(t){if(Wi.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{const e=[];for(let s=0;s<e.length;s++)e[s]=0;return e}}static toFloatArray(t){return Wi.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return Wi.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t){}static contains(t,e,s=!0){for(let r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}};x(Wi,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u");let bt=Wi;class Pw{static logBones(t){for(let e=0;e<t.bones.length;e++){const s=t.bones[e].appliedPose;console.log(`${s.bone.data.name}, ${s.a}, ${s.b}, ${s.c}, ${s.d}, ${s.worldX}, ${s.worldY}`)}}}class $a{constructor(t){x(this,"items",[]);x(this,"instantiator");this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){var e;(e=t.reset)==null||e.call(t),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}}class il{constructor(t=0,e=0){x(this,"x");x(this,"y");this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){const t=this.length();return t!==0&&(this.x/=t,this.y/=t),this}}class Mw{constructor(){x(this,"maxDelta",.064);x(this,"framesPerSecond",0);x(this,"delta",0);x(this,"totalTime",0);x(this,"lastTime",Date.now()/1e3);x(this,"frameCount",0);x(this,"frameTime",0)}update(){const t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}class Rw{constructor(t=32){x(this,"values");x(this,"addedValues",0);x(this,"lastValue",0);x(this,"mean",0);x(this,"dirty",!0);this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}}class eu{constructor(t){x(this,"_image");this._image=t}getImage(){return this._image}}var Oe;(function(i){i[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.MipMap=9987]="MipMap",i[i.MipMapNearestNearest=9984]="MipMapNearestNearest",i[i.MipMapLinearNearest=9985]="MipMapLinearNearest",i[i.MipMapNearestLinear=9986]="MipMapNearestLinear",i[i.MipMapLinearLinear=9987]="MipMapLinearLinear"})(Oe||(Oe={}));var xr;(function(i){i[i.MirroredRepeat=33648]="MirroredRepeat",i[i.ClampToEdge=33071]="ClampToEdge",i[i.Repeat=10497]="Repeat"})(xr||(xr={}));class Qp{constructor(){x(this,"texture");x(this,"u",0);x(this,"v",0);x(this,"u2",0);x(this,"v2",0);x(this,"width",0);x(this,"height",0);x(this,"degrees",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0)}}class Fw extends eu{setFilters(t,e){}setWraps(t,e){}dispose(){}}class nl{constructor(t){x(this,"pages",[]);x(this,"regions",[]);const e=new yk(t),s=new Array(4),r={};r.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},r.format=()=>{},r.filter=c=>{c.minFilter=bt.enumValue(Oe,s[1]),c.magFilter=bt.enumValue(Oe,s[2])},r.repeat=c=>{s[1].indexOf("x")!==-1&&(c.uWrap=xr.Repeat),s[1].indexOf("y")!==-1&&(c.vWrap=xr.Repeat)},r.pma=c=>{c.pma=s[1]==="true"};var n={};n.xy=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2])},n.size=c=>{c.width=parseInt(s[1]),c.height=parseInt(s[2])},n.bounds=c=>{c.x=parseInt(s[1]),c.y=parseInt(s[2]),c.width=parseInt(s[3]),c.height=parseInt(s[4])},n.offset=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2])},n.orig=c=>{c.originalWidth=parseInt(s[1]),c.originalHeight=parseInt(s[2])},n.offsets=c=>{c.offsetX=parseInt(s[1]),c.offsetY=parseInt(s[2]),c.originalWidth=parseInt(s[3]),c.originalHeight=parseInt(s[4])},n.rotate=c=>{const u=s[1];u==="true"?c.degrees=90:u!=="false"&&(c.degrees=parseInt(u))},n.index=c=>{c.index=parseInt(s[1])};let a=e.readLine();for(;a&&a.trim().length===0;)a=e.readLine();for(;!(!a||a.trim().length===0||e.readEntry(s,a)===0);)a=e.readLine();let o=null,h=null,l=null;for(;a!==null;)if(a.trim().length===0)o=null,a=e.readLine();else if(o){const c=new su(o,a);for(;;){const u=e.readEntry(s,a=e.readLine());if(u===0)break;const d=n[s[0]];if(d)d(c);else{h||(h=[]),l||(l=[]),h.push(s[0]);const f=[];for(let m=0;m<u;m++)f.push(parseInt(s[m+1]));l.push(f)}}c.originalWidth===0&&c.originalHeight===0&&(c.originalWidth=c.width,c.originalHeight=c.height),h&&h.length>0&&l&&l.length>0&&(c.names=h,c.values=l,h=null,l=null),c.u=c.x/o.width,c.v=c.y/o.height,c.degrees===90?(c.u2=(c.x+c.height)/o.width,c.v2=(c.y+c.width)/o.height):(c.u2=(c.x+c.width)/o.width,c.v2=(c.y+c.height)/o.height),this.regions.push(c)}else{for(o=new tg(a.trim());e.readEntry(s,a=e.readLine())!==0;){const c=r[s[0]];c&&c(o)}this.pages.push(o)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name===t)return this.regions[e];return null}setTextures(t,e=""){for(const s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){var t;for(let e=0;e<this.pages.length;e++)(t=this.pages[e].texture)==null||t.dispose()}}class yk{constructor(t){x(this,"lines");x(this,"index",0);this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e||(e=e.trim(),e.length===0))return 0;const s=e.indexOf(":");if(s===-1)return 0;t[0]=e.substr(0,s).trim();for(let r=1,n=s+1;;r++){const a=e.indexOf(",",n);if(a===-1)return t[r]=e.substr(n).trim(),r;if(t[r]=e.substr(n,a-n).trim(),n=a+1,r===4)return 4}}}class tg{constructor(t){x(this,"name");x(this,"minFilter",Oe.Nearest);x(this,"magFilter",Oe.Nearest);x(this,"uWrap",xr.ClampToEdge);x(this,"vWrap",xr.ClampToEdge);x(this,"texture",null);x(this,"width",0);x(this,"height",0);x(this,"pma",!1);x(this,"regions",[]);this.name=t}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(const e of this.regions)e.texture=t}}class su extends Qp{constructor(e,s){super();x(this,"page");x(this,"name");x(this,"x",0);x(this,"y",0);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"originalWidth",0);x(this,"originalHeight",0);x(this,"index",0);x(this,"degrees",0);x(this,"names",null);x(this,"values",null);this.page=e,this.name=s,e.regions.push(this)}}const xc=class xc{constructor(t){x(this,"name");x(this,"timelineAttachment");x(this,"timelineSlots",xc.empty);if(!t)throw new Error("name cannot be null.");this.name=t,this.timelineAttachment=this}isTimelineActive(t,e,s){let r=t[e];if(r.bone.isActive()){const n=(s?r.getAppliedPose():r.getPose()).getAttachment();if(n!=null&&n.timelineAttachment===this)return!0}for(let n=0,a=this.timelineSlots.length;n<a;n++){if(r=t[this.timelineSlots[n]],!r.bone.isActive())continue;const o=(s?r.getAppliedPose():r.getPose()).getAttachment();if(o!=null&&o.timelineAttachment===this)return!0}return!1}};x(xc,"empty",[]);let Ha=xc;const bc=class bc extends Ha{constructor(e){super(e);x(this,"id",bc.nextID++);x(this,"bones",null);x(this,"vertices",[]);x(this,"worldVerticesLength",0)}computeWorldVertices(e,s,r,n,a,o,h){n=o+(n>>1)*h;const l=s.appliedPose.deform;let c=this.vertices;const u=this.bones;if(!u){l.length>0&&(c=l);const p=s.bone.appliedPose,g=p.worldX,y=p.worldY,_=p.a,v=p.b,b=p.c,T=p.d;for(let S=r,w=o;w<n;S+=2,w+=h){const E=c[S],A=c[S+1];a[w]=E*_+A*v+g,a[w+1]=E*b+A*T+y}return}let d=0,f=0;for(let p=0;p<r;p+=2){const g=u[d];d+=g+1,f+=g}const m=e.bones;if(l.length===0)for(let p=o,g=f*3;p<n;p+=h){let y=0,_=0,v=u[d++];for(v+=d;d<v;d++,g+=3){const b=m[u[d]].appliedPose,T=c[g],S=c[g+1],w=c[g+2];y+=(T*b.a+S*b.b+b.worldX)*w,_+=(T*b.c+S*b.d+b.worldY)*w}a[p]=y,a[p+1]=_}else{const p=l;for(let g=o,y=f*3,_=f<<1;g<n;g+=h){let v=0,b=0,T=u[d++];for(T+=d;d<T;d++,y+=3,_+=2){const S=m[u[d]].appliedPose,w=c[y]+p[_],E=c[y+1]+p[_+1],A=c[y+2];v+=(w*S.a+E*S.b+S.worldX)*A,b+=(w*S.c+E*S.d+S.worldY)*A}a[g]=v,a[g+1]=b}}}copyTo(e){this.bones?(e.bones=[],bt.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=bt.newFloatArray(this.vertices.length),bt.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment,e.timelineSlots=this.timelineSlots}};x(bc,"nextID",0);let vr=bc;class Vs extends vr{constructor(e,s){super(e);x(this,"sequence");x(this,"regionUVs",[]);x(this,"triangles",[]);x(this,"hullLength",0);x(this,"path");x(this,"color",new Ft(1,1,1,1));x(this,"sourceMesh",null);x(this,"edges",[]);x(this,"width",0);x(this,"height",0);x(this,"tempColor",new Ft(0,0,0,0));this.sequence=s}copy(){if(this.sourceMesh)return this.newLinkedMesh();const e=new Vs(this.name,this.sequence.copy());return e.path=this.path,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=[],bt.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.triangles=[],bt.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,this.edges&&(e.edges=[],bt.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}updateSequence(){this.sequence.update(this)}getSourceMesh(){return this.sourceMesh}setSourceMesh(e){this.sourceMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength,this.edges=e.edges,this.width=e.width,this.height=e.height)}newLinkedMesh(){const e=new Vs(this.name,this.sequence.copy());return e.timelineAttachment=this.timelineAttachment,e.path=this.path,e.color.setFromColor(this.color),e.setSourceMesh(this.sourceMesh?this.sourceMesh:this),e.updateSequence(),e}static computeUVs(e,s,r){if(!e)throw new Error("Region not set.");const n=r.length;let a=e.u,o=e.v,h=0,l=0;if(e instanceof su){const c=e.page,u=c.width,d=c.height;switch(e.degrees){case 90:a-=(e.originalHeight-e.offsetY-e.height)/u,o-=(e.originalWidth-e.offsetX-e.width)/d,h=e.originalHeight/u,l=e.originalWidth/d;for(let f=0;f<n;f+=2)r[f]=a+s[f+1]*h,r[f+1]=o+(1-s[f])*l;return;case 180:a-=(e.originalWidth-e.offsetX-e.width)/u,o-=e.offsetY/d,h=e.originalWidth/u,l=e.originalHeight/d;for(let f=0;f<n;f+=2)r[f]=a+(1-s[f])*h,r[f+1]=o+(1-s[f+1])*l;return;case 270:a-=e.offsetY/u,o-=e.offsetX/d,h=e.originalHeight/u,l=e.originalWidth/d;for(let f=0;f<n;f+=2)r[f]=a+(1-s[f+1])*h,r[f+1]=o+s[f]*l;return;default:a-=e.offsetX/u,o-=(e.originalHeight-e.offsetY-e.height)/d,h=e.originalWidth/u,l=e.originalHeight/d}}else e?(h=e.u2-a,l=e.v2-o):(a=o=0,h=l=1);for(let c=0;c<n;c+=2)r[c]=a+s[c]*h,r[c+1]=o+s[c+1]*l}}const Zt=class Zt extends Ha{constructor(e,s){super(e);x(this,"sequence");x(this,"x",0);x(this,"y",0);x(this,"scaleX",1);x(this,"scaleY",1);x(this,"rotation",0);x(this,"width",0);x(this,"height",0);x(this,"path");x(this,"color",new Ft(1,1,1,1));x(this,"tempColor",new Ft(1,1,1,1));this.sequence=s}copy(){const e=new Zt(this.name,this.sequence.copy());return e.path=this.path,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,e.color.setFromColor(this.color),e}computeWorldVertices(e,s,r,n,a){const o=e.bone.appliedPose,h=o.worldX,l=o.worldY,c=o.a,u=o.b,d=o.c,f=o.d;let m=s[0],p=s[1];r[n]=m*c+p*u+h,r[n+1]=m*d+p*f+l,n+=a,m=s[2],p=s[3],r[n]=m*c+p*u+h,r[n+1]=m*d+p*f+l,n+=a,m=s[4],p=s[5],r[n]=m*c+p*u+h,r[n+1]=m*d+p*f+l,n+=a,m=s[6],p=s[7],r[n]=m*c+p*u+h,r[n+1]=m*d+p*f+l}getOffsets(e){return this.sequence.offsets[this.sequence.resolveIndex(e)]}updateSequence(){this.sequence.update(this)}static computeUVs(e,s,r,n,a,o,h,l,c,u){if(!e)throw new Error("Region not set.");const d=h/e.originalWidth*n,f=l/e.originalHeight*a,m=-h/2*n+e.offsetX*d,p=-l/2*a+e.offsetY*f,g=m+e.width*d,y=p+e.height*f,_=o*pt.degRad,v=Math.cos(_),b=Math.sin(_),T=m*v+s,S=m*b,w=p*v+r,E=p*b,A=g*v+s,P=g*b,I=y*v+r,C=y*b;c[0]=T-E,c[1]=w+S,c[2]=T-C,c[3]=I+S,c[4]=A-C,c[5]=I+P,c[6]=A-E,c[7]=w+P,e==null?(u[0]=0,u[1]=0,u[2]=0,u[3]=1,u[4]=1,u[5]=1,u[6]=1,u[7]=0):(u[1]=e.v2,u[2]=e.u,u[5]=e.v,u[6]=e.u2,e.degrees===90?(u[0]=e.u2,u[3]=e.v2,u[4]=e.u,u[7]=e.v):(u[0]=e.u,u[3]=e.v,u[4]=e.u2,u[7]=e.v2))}};x(Zt,"X1",0),x(Zt,"Y1",1),x(Zt,"C1R",2),x(Zt,"C1G",3),x(Zt,"C1B",4),x(Zt,"C1A",5),x(Zt,"U1",6),x(Zt,"V1",7),x(Zt,"X2",8),x(Zt,"Y2",9),x(Zt,"C2R",10),x(Zt,"C2G",11),x(Zt,"C2B",12),x(Zt,"C2A",13),x(Zt,"U2",14),x(Zt,"V2",15),x(Zt,"X3",16),x(Zt,"Y3",17),x(Zt,"C3R",18),x(Zt,"C3G",19),x(Zt,"C3B",20),x(Zt,"C3A",21),x(Zt,"U3",22),x(Zt,"V3",23),x(Zt,"X4",24),x(Zt,"Y4",25),x(Zt,"C4R",26),x(Zt,"C4G",27),x(Zt,"C4B",28),x(Zt,"C4A",29),x(Zt,"U4",30),x(Zt,"V4",31);let _r=Zt;const _a=class _a{constructor(t,e){x(this,"id",_a.nextID());x(this,"regions");x(this,"pathSuffix");x(this,"uvs");x(this,"offsets");x(this,"start",0);x(this,"digits",0);x(this,"setupIndex",0);this.regions=new Array(t),this.pathSuffix=e}copy(){const t=this.regions.length,e=new _a(t,this.pathSuffix);if(bt.arrayCopy(this.regions,0,e.regions,0,t),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,this.uvs!=null){const s=this.uvs[0].length;e.uvs=[];for(let r=0;r<t;r++)e.uvs[r]=bt.newFloatArray(s),bt.arrayCopy(this.uvs[r],0,e.uvs[r],0,s)}if(this.offsets!=null){e.offsets=[];for(let s=0;s<t;s++)e.offsets[s]=[],bt.arrayCopy(this.offsets[s],0,e.offsets[s],0,8)}return e}update(t){const e=this.regions.length;if(t instanceof _r){this.uvs=[],this.offsets=[];for(let s=0;s<e;s++)this.uvs[s]=bt.newFloatArray(8),this.offsets[s]=[],_r.computeUVs(this.regions[s],t.x,t.y,t.scaleX,t.scaleY,t.rotation,t.width,t.height,this.offsets[s],this.uvs[s])}else if(t instanceof Vs){const s=t.regionUVs;this.uvs=[],this.offsets=void 0;for(let r=0;r<e;r++)this.uvs[r]=bt.newFloatArray(s.length),Vs.computeUVs(this.regions[r],s,this.uvs[r])}}resolveIndex(t){let e=t.sequenceIndex;return e===-1&&(e=this.setupIndex),e>=this.regions.length&&(e=this.regions.length-1),e}getUVs(t){return this.uvs[t]}hasPathSuffix(){return this.pathSuffix}getPath(t,e){if(!this.pathSuffix)return t;let s=t;const r=(this.start+e).toString();for(let n=this.digits-r.length;n>0;n--)s+="0";return s+=r,s}static nextID(){return _a._nextID++}};x(_a,"_nextID",0);let nn=_a;var He;(function(i){i[i.hold=0]="hold",i[i.once=1]="once",i[i.loop=2]="loop",i[i.pingpong=3]="pingpong",i[i.onceReverse=4]="onceReverse",i[i.loopReverse=5]="loopReverse",i[i.pingpongReverse=6]="pingpongReverse"})(He||(He={}));const ru=[He.hold,He.once,He.loop,He.pingpong,He.onceReverse,He.loopReverse,He.pingpongReverse];class Pl{constructor(t,e,s){x(this,"name");x(this,"timelines",[]);x(this,"timelineIds");x(this,"bones");x(this,"color",new Ft(1,1,1,1));x(this,"duration");if(!t)throw new Error("name cannot be null.");this.name=t,this.duration=s,this.timelineIds=new Zp,this.bones=[],this.setTimelines(e)}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t;const e=t.length;this.timelineIds.clear(),this.bones.length=0;const s=new Set,r=t;for(let n=0;n<e;n++){const a=r[n];this.timelineIds.addAll(a.propertyIds),sg(a)&&s.add(a.boneIndex)&&this.bones.push(a.boneIndex)}}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,r,n,a,o,h,l,c){if(!t)throw new Error("skeleton cannot be null.");r&&this.duration!==0&&(s%=this.duration,e>0&&(e%=this.duration));const u=this.timelines;for(let d=0,f=u.length;d<f;d++)u[d].apply(t,e,s,n,a,o,h,l,c)}}var At;(function(i){i[i.current=0]="current",i[i.setup=1]="setup",i[i.first=2]="first"})(At||(At={}));var Bt;(function(i){i[i.rotate=0]="rotate",i[i.x=1]="x",i[i.y=2]="y",i[i.scaleX=3]="scaleX",i[i.scaleY=4]="scaleY",i[i.shearX=5]="shearX",i[i.shearY=6]="shearY",i[i.inherit=7]="inherit",i[i.rgb=8]="rgb",i[i.alpha=9]="alpha",i[i.rgb2=10]="rgb2",i[i.attachment=11]="attachment",i[i.deform=12]="deform",i[i.event=13]="event",i[i.drawOrder=14]="drawOrder",i[i.drawOrderFolder=15]="drawOrderFolder",i[i.ikConstraint=16]="ikConstraint",i[i.transformConstraint=17]="transformConstraint",i[i.pathConstraintPosition=18]="pathConstraintPosition",i[i.pathConstraintSpacing=19]="pathConstraintSpacing",i[i.pathConstraintMix=20]="pathConstraintMix",i[i.physicsConstraintInertia=21]="physicsConstraintInertia",i[i.physicsConstraintStrength=22]="physicsConstraintStrength",i[i.physicsConstraintDamping=23]="physicsConstraintDamping",i[i.physicsConstraintMass=24]="physicsConstraintMass",i[i.physicsConstraintWind=25]="physicsConstraintWind",i[i.physicsConstraintGravity=26]="physicsConstraintGravity",i[i.physicsConstraintMix=27]="physicsConstraintMix",i[i.physicsConstraintReset=28]="physicsConstraintReset",i[i.sequence=29]="sequence",i[i.sliderTime=30]="sliderTime",i[i.sliderMix=31]="sliderMix"})(Bt||(Bt={}));class ce{constructor(t,...e){x(this,"propertyIds");x(this,"frames");x(this,"additive",!1);x(this,"instant",!1);this.propertyIds=e,this.frames=bt.newFloatArray(t*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search(t,e,s=1){const r=t.length;for(let n=s;n<r;n+=s)if(t[n]>e)return n-s;return r-s}}function eg(i){return typeof i=="object"&&i!==null&&typeof i.slotIndex=="number"}class Fi extends ce{constructor(e,s,...r){super(e,...r);x(this,"curves");this.curves=bt.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){const s=this.getFrameCount()+e*18;if(this.curves.length>s){const r=bt.newFloatArray(s);bt.arrayCopy(this.curves,0,r,0,s),this.curves=r}}setBezier(e,s,r,n,a,o,h,l,c,u,d){const f=this.curves;let m=this.getFrameCount()+e*18;r===0&&(f[s]=2+m);const p=(n-o*2+l)*.03,g=(a-h*2+c)*.03,y=((o-l)*3-n+u)*.006,_=((h-c)*3-a+d)*.006;let v=p*2+y,b=g*2+_,T=(o-n)*.3+p+y*.16666667,S=(h-a)*.3+g+_*.16666667,w=n+T,E=a+S;for(let A=m+18;m<A;m+=2)f[m]=w,f[m+1]=E,T+=v,S+=b,v+=y,b+=_,w+=T,E+=S}getBezierValue(e,s,r,n){const a=this.curves;if(a[n]>e){const c=this.frames[s],u=this.frames[s+r];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}const o=n+18;for(n+=2;n<o;n+=2)if(a[n]>=e){const c=a[n-2],u=a[n-1];return u+(e-c)/(a[n]-c)*(a[n+1]-u)}s+=this.getFrameEntries();const h=a[o-2],l=a[o-1];return l+(e-h)/(this.frames[s]-h)*(this.frames[s+r]-l)}}class dr extends Fi{constructor(t,e,s){super(t,e,s)}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){const e=this.frames;let s=e.length-2;for(let n=2;n<=s;n+=2)if(e[n]>t){s=n-2;break}const r=this.curves[s>>1];switch(r){case 0:{const n=e[s],a=e[s+1];return a+(t-n)/(e[s+2]-n)*(e[s+2+1]-a)}case 1:return e[s+1]}return this.getBezierValue(t,s,1,r-2)}getRelativeValue(t,e,s,r,n,a){if(t<this.frames[0])return dr.beforeFirstKey(s,e,n,a);const o=this.getCurveValue(t);return s===At.setup?a+o*e:n+(r?o:o+a-n)*e}getAbsoluteValue(t,e,s,r,n,a,o){return o===void 0?this.getAbsoluteValue1(t,e,s,r,n,a):this.getAbsoluteValue2(t,e,s,r,n,a,o)}getAbsoluteValue1(t,e,s,r,n,a){if(t<this.frames[0])return dr.beforeFirstKey(s,e,n,a);const o=this.getCurveValue(t);return s===At.setup?a+(r?o:o-a)*e:n+(r?o:o-n)*e}getAbsoluteValue2(t,e,s,r,n,a,o){return t<this.frames[0]?dr.beforeFirstKey(s,e,n,a):s===At.setup?a+(r?o:o-a)*e:n+(r?o:o-n)*e}getScaleValue(t,e,s,r,n,a,o){if(t<this.frames[0])return dr.beforeFirstKey(s,e,a,o);const h=this.getCurveValue(t)*o;if(e===1&&!r)return h;let l=s===At.setup?o:a;return r?l+(h-o)*e:n?l+(Math.abs(h)*Math.sign(l)-l)*e:(l=Math.abs(l)*Math.sign(h),l+(h-l)*e)}static beforeFirstKey(t,e,s,r){switch(t){case At.setup:return r;case At.first:return s+(r-s)*e;case At.current:return s}}}function sg(i){return typeof i=="object"&&i!==null&&typeof i.boneIndex=="number"}class ki extends dr{constructor(e,s,r,n){super(e,s,`${n}|${r}`);x(this,"boneIndex");this.boneIndex=r,this.additive=!0}apply(e,s,r,n,a,o,h,l,c){const u=e.bones[this.boneIndex];u.active&&this.apply1(c?u.appliedPose:u.pose,u.data.setupPose,r,a,o,h,l)}}class Ml extends Fi{constructor(e,s,r,n,a){super(e,s,`${n}|${r}`,`${a}|${r}`);x(this,"boneIndex");this.boneIndex=r,this.additive=!0}getFrameEntries(){return 3}setFrame(e,s,r,n){e*=3,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n}apply(e,s,r,n,a,o,h,l,c){const u=e.bones[this.boneIndex];u.active&&this.apply1(c?u.appliedPose:u.pose,u.data.setupPose,r,a,o,h,l)}}class Wa extends ki{constructor(t,e,s){super(t,e,s,Bt.rotate)}apply1(t,e,s,r,n,a,o){t.rotation=this.getRelativeValue(s,r,n,a,t.rotation,e.rotation)}}class iu extends Ml{constructor(t,e,s){super(t,e,s,Bt.x,Bt.y)}apply1(t,e,s,r,n,a,o){const h=this.frames;if(s<h[0]){switch(n){case At.setup:t.x=e.x,t.y=e.y;break;case At.first:t.x+=(e.x-t.x)*r,t.y+=(e.y-t.y)*r;break}return}let l=0,c=0;const u=ce.search(h,s,3),d=this.curves[u/3];switch(d){case 0:{const f=h[u];l=h[u+1],c=h[u+2];const m=(s-f)/(h[u+3]-f);l+=(h[u+3+1]-l)*m,c+=(h[u+3+2]-c)*m;break}case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}n===At.setup?(t.x=e.x+l*r,t.y=e.y+c*r):a?(t.x+=l*r,t.y+=c*r):(t.x+=(e.x+l-t.x)*r,t.y+=(e.y+c-t.y)*r)}}class nu extends ki{constructor(t,e,s){super(t,e,s,Bt.x)}apply1(t,e,s,r,n,a,o){t.x=this.getRelativeValue(s,r,n,a,t.x,e.x)}}class au extends ki{constructor(t,e,s){super(t,e,s,Bt.y)}apply1(t,e,s,r,n,a,o){t.y=this.getRelativeValue(s,r,n,a,t.y,e.y)}}class ou extends Ml{constructor(t,e,s){super(t,e,s,Bt.scaleX,Bt.scaleY)}apply1(t,e,s,r,n,a,o){const h=this.frames;if(s<h[0]){switch(n){case At.setup:t.scaleX=e.scaleX,t.scaleY=e.scaleY;break;case At.first:t.scaleX+=(e.scaleX-t.scaleX)*r,t.scaleY+=(e.scaleY-t.scaleY)*r;break}return}let l,c;const u=ce.search(h,s,3),d=this.curves[u/3];switch(d){case 0:{const f=h[u];l=h[u+1],c=h[u+2];const m=(s-f)/(h[u+3]-f);l+=(h[u+3+1]-l)*m,c+=(h[u+3+2]-c)*m;break}case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}if(l*=e.scaleX,c*=e.scaleY,r===1&&!a)t.scaleX=l,t.scaleY=c;else{let f=0,m=0;n===At.setup?(f=e.scaleX,m=e.scaleY):(f=t.scaleX,m=t.scaleY),a?(t.scaleX=f+(l-e.scaleX)*r,t.scaleY=m+(c-e.scaleY)*r):o?(t.scaleX=f+(Math.abs(l)*Math.sign(f)-f)*r,t.scaleY=m+(Math.abs(c)*Math.sign(m)-m)*r):(f=Math.abs(f)*Math.sign(l),m=Math.abs(m)*Math.sign(c),t.scaleX=f+(l-f)*r,t.scaleY=m+(c-m)*r)}}}class lu extends ki{constructor(t,e,s){super(t,e,s,Bt.scaleX)}apply1(t,e,s,r,n,a,o){t.scaleX=this.getScaleValue(s,r,n,a,o,t.scaleX,e.scaleX)}}class hu extends ki{constructor(t,e,s){super(t,e,s,Bt.scaleY)}apply1(t,e,s,r,n,a,o){t.scaleY=this.getScaleValue(s,r,n,a,o,t.scaleY,e.scaleY)}}class cu extends Ml{constructor(t,e,s){super(t,e,s,Bt.shearX,Bt.shearY)}apply1(t,e,s,r,n,a,o){const h=this.frames;if(s<h[0]){switch(n){case At.setup:t.shearX=e.shearX,t.shearY=e.shearY;break;case At.first:t.shearX+=(e.shearX-t.shearX)*r,t.shearY+=(e.shearY-t.shearY)*r;break}return}let l=0,c=0;const u=ce.search(h,s,3),d=this.curves[u/3];switch(d){case 0:{const f=h[u];l=h[u+1],c=h[u+2];const m=(s-f)/(h[u+3]-f);l+=(h[u+3+1]-l)*m,c+=(h[u+3+2]-c)*m;break}case 1:l=h[u+1],c=h[u+2];break;default:l=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)}n===At.setup?(t.shearX=e.shearX+l*r,t.shearY=e.shearY+c*r):a?(t.shearX+=l*r,t.shearY+=c*r):(t.shearX+=(e.shearX+l-t.shearX)*r,t.shearY+=(e.shearY+c-t.shearY)*r)}}class uu extends ki{constructor(t,e,s){super(t,e,s,Bt.shearX)}apply1(t,e,s,r,n,a,o){t.shearX=this.getRelativeValue(s,r,n,a,t.shearX,e.shearX)}}class du extends ki{constructor(t,e,s){super(t,e,s,Bt.shearY)}apply1(t,e,s,r,n,a,o){t.shearY=this.getRelativeValue(s,r,n,a,t.shearY,e.shearY)}}class fu extends ce{constructor(e,s){super(e,`${Bt.inherit}|${s}`);x(this,"boneIndex");this.boneIndex=s,this.instant=!0}getFrameEntries(){return 2}setFrame(e,s,r){e*=2,this.frames[e]=s,this.frames[e+1]=r}apply(e,s,r,n,a,o,h,l,c){const u=e.bones[this.boneIndex];if(!u.active)return;const d=c?u.appliedPose:u.pose;if(l)o!==At.current&&(d.inherit=u.data.setupPose.inherit);else{const f=this.frames;r<f[0]?o!==At.current&&(d.inherit=u.data.setupPose.inherit):d.inherit=this.frames[ce.search(f,r,2)+1]}}}class so extends Fi{constructor(e,s,r,...n){super(e,s,...n);x(this,"slotIndex");this.slotIndex=r}apply(e,s,r,n,a,o,h,l,c){const u=e.slots[this.slotIndex];u.bone.active&&this.apply1(u,c?u.appliedPose:u.pose,r,a,o,h)}}class mu extends so{constructor(t,e,s){super(t,e,s,`${Bt.rgb}|${s}`,`${Bt.alpha}|${s}`)}getFrameEntries(){return 5}setFrame(t,e,s,r,n,a){t*=5,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=n,this.frames[t+4]=a}apply1(t,e,s,r,n,a){const o=e.color,h=this.frames;if(s<h[0]){const p=t.data.setupPose.color;switch(n){case At.setup:o.setFromColor(p);break;case At.first:o.add((p.r-o.r)*r,(p.g-o.g)*r,(p.b-o.b)*r,(p.a-o.a)*r);break}return}let l=0,c=0,u=0,d=0;const f=ce.search(h,s,5),m=this.curves[f/5];switch(m){case 0:{const p=h[f];l=h[f+1],c=h[f+2],u=h[f+3],d=h[f+4];const g=(s-p)/(h[f+5]-p);l+=(h[f+5+1]-l)*g,c+=(h[f+5+2]-c)*g,u+=(h[f+5+3]-u)*g,d+=(h[f+5+4]-d)*g;break}case 1:l=h[f+1],c=h[f+2],u=h[f+3],d=h[f+4];break;default:l=this.getBezierValue(s,f,1,m-2),c=this.getBezierValue(s,f,2,m+18-2),u=this.getBezierValue(s,f,3,m+36-2),d=this.getBezierValue(s,f,4,m+54-2)}if(r===1)o.set(l,c,u,d);else if(n===At.setup){const p=t.data.setupPose.color;o.set(p.r+(l-p.r)*r,p.g+(c-p.g)*r,p.b+(u-p.b)*r,p.a+(d-p.a)*r)}else o.add((l-o.r)*r,(c-o.g)*r,(u-o.b)*r,(d-o.a)*r)}}class pu extends so{constructor(t,e,s){super(t,e,s,`${Bt.rgb}|${s}`)}getFrameEntries(){return 4}setFrame(t,e,s,r,n){t<<=2,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=n}apply1(t,e,s,r,n,a){const o=e.color;let h=0,l=0,c=0;const u=this.frames;if(s<u[0]){const m=t.data.setupPose.color;switch(n){case At.setup:{o.r=m.r,o.g=m.g,o.b=m.b;break}case At.first:{o.r+=(m.r-o.r)*r,o.g+=(m.g-o.g)*r,o.b+=(m.b-o.b)*r;break}}return}const d=ce.search(u,s,4),f=this.curves[d>>2];switch(f){case 0:{const m=u[d];h=u[d+1],l=u[d+2],c=u[d+3];const p=(s-m)/(u[d+4]-m);h+=(u[d+4+1]-h)*p,l+=(u[d+4+2]-l)*p,c+=(u[d+4+3]-c)*p;break}case 1:h=u[d+1],l=u[d+2],c=u[d+3];break;default:h=this.getBezierValue(s,d,1,f-2),l=this.getBezierValue(s,d,2,f+18-2),c=this.getBezierValue(s,d,3,f+36-2)}if(r!==1)if(n===At.setup){const m=t.data.setupPose.color;h=m.r+(h-m.r)*r,l=m.g+(l-m.g)*r,c=m.b+(c-m.b)*r}else h=o.r+(h-o.r)*r,l=o.g+(l-o.g)*r,c=o.b+(c-o.b)*r;o.r=h<0?0:h>1?1:h,o.g=l<0?0:l>1?1:l,o.b=c<0?0:c>1?1:c}}class gu extends dr{constructor(e,s,r){super(e,s,`${Bt.alpha}|${r}`);x(this,"slotIndex",0);this.slotIndex=r}apply(e,s,r,n,a,o,h,l,c){const u=e.slots[this.slotIndex];if(!u.bone.active)return;const d=(c?u.appliedPose:u.pose).color;let f=0;const m=this.frames;if(r<m[0]){const p=u.data.setupPose.color.a;switch(o){case At.setup:d.a=p;break;case At.first:d.a+=(p-d.a)*a;break}return}if(f=this.getCurveValue(r),a!==1)if(o===At.setup){const p=u.data.setupPose.color;f=p.a+(f-p.a)*a}else f=d.a+(f-d.a)*a;d.a=f<0?0:f>1?1:f}}class yu extends so{constructor(t,e,s){super(t,e,s,`${Bt.rgb}|${s}`,`${Bt.alpha}|${s}`,`${Bt.rgb2}|${s}`)}getFrameEntries(){return 8}setFrame(t,e,s,r,n,a,o,h,l){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=n,this.frames[t+4]=a,this.frames[t+5]=o,this.frames[t+6]=h,this.frames[t+7]=l}apply1(t,e,s,r,n,a){const o=e.color,h=e.darkColor;let l=0,c=0,u=0;const d=this.frames;if(s<d[0]){const v=t.data.setupPose,b=v.color,T=v.darkColor;switch(n){case At.setup:{o.setFromColor(b),h.r=T.r,h.g=T.g,h.b=T.b;break}case At.first:{o.add((b.r-o.r)*r,(b.g-o.g)*r,(b.b-o.b)*r,(b.a-o.a)*r),h.r+=(T.r-h.r)*r,h.g+=(T.g-h.g)*r,h.b+=(T.b-h.b)*r;break}}return}let f=0,m=0,p=0,g=0;const y=ce.search(d,s,8),_=this.curves[y>>3];switch(_){case 0:{const v=d[y];f=d[y+1],m=d[y+2],p=d[y+3],g=d[y+4],l=d[y+5],c=d[y+6],u=d[y+7];const b=(s-v)/(d[y+8]-v);f+=(d[y+8+1]-f)*b,m+=(d[y+8+2]-m)*b,p+=(d[y+8+3]-p)*b,g+=(d[y+8+4]-g)*b,l+=(d[y+8+5]-l)*b,c+=(d[y+8+6]-c)*b,u+=(d[y+8+7]-u)*b;break}case 1:f=d[y+1],m=d[y+2],p=d[y+3],g=d[y+4],l=d[y+5],c=d[y+6],u=d[y+7];break;default:f=this.getBezierValue(s,y,1,_-2),m=this.getBezierValue(s,y,2,_+18-2),p=this.getBezierValue(s,y,3,_+36-2),g=this.getBezierValue(s,y,4,_+54-2),l=this.getBezierValue(s,y,5,_+72-2),c=this.getBezierValue(s,y,6,_+90-2),u=this.getBezierValue(s,y,7,_+108-2)}if(r===1)o.set(f,m,p,g);else if(n===At.setup){const v=t.data.setupPose;let b=v.color;o.set(b.r+(f-b.r)*r,b.g+(m-b.g)*r,b.b+(p-b.b)*r,b.a+(g-b.a)*r),b=v.darkColor,l=b.r+(l-b.r)*r,c=b.g+(c-b.g)*r,u=b.b+(u-b.b)*r}else o.add((f-o.r)*r,(m-o.g)*r,(p-o.b)*r,(g-o.a)*r),l=h.r+(l-h.r)*r,c=h.g+(c-h.g)*r,u=h.b+(u-h.b)*r;h.r=l<0?0:l>1?1:l,h.g=c<0?0:c>1?1:c,h.b=u<0?0:u>1?1:u}}class xu extends so{constructor(t,e,s){super(t,e,s,`${Bt.rgb}|${s}`,`${Bt.rgb2}|${s}`)}getFrameEntries(){return 7}setFrame(t,e,s,r,n,a,o,h){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=r,this.frames[t+3]=n,this.frames[t+4]=a,this.frames[t+5]=o,this.frames[t+6]=h}apply1(t,e,s,r,n,a){const o=e.color,h=e.darkColor;let l=0,c=0,u=0,d=0,f=0,m=0;const p=this.frames;if(s<p[0]){const _=t.data.setupPose,v=_.color,b=_.darkColor;switch(n){case At.setup:o.r=v.r,o.g=v.g,o.b=v.b,h.r=b.r,h.g=b.g,h.b=b.b;break;case At.first:o.r+=(v.r-o.r)*r,o.g+=(v.g-o.g)*r,o.b+=(v.b-o.b)*r,h.r+=(b.r-h.r)*r,h.g+=(b.g-h.g)*r,h.b+=(b.b-h.b)*r;break}return}const g=ce.search(p,s,7),y=this.curves[g/7];switch(y){case 0:{const _=p[g];l=p[g+1],c=p[g+2],u=p[g+3],d=p[g+4],f=p[g+5],m=p[g+6];const v=(s-_)/(p[g+7]-_);l+=(p[g+7+1]-l)*v,c+=(p[g+7+2]-c)*v,u+=(p[g+7+3]-u)*v,d+=(p[g+7+4]-d)*v,f+=(p[g+7+5]-f)*v,m+=(p[g+7+6]-m)*v;break}case 1:l=p[g+1],c=p[g+2],u=p[g+3],d=p[g+4],f=p[g+5],m=p[g+6];break;default:l=this.getBezierValue(s,g,1,y-2),c=this.getBezierValue(s,g,2,y+18-2),u=this.getBezierValue(s,g,3,y+36-2),d=this.getBezierValue(s,g,4,y+54-2),f=this.getBezierValue(s,g,5,y+72-2),m=this.getBezierValue(s,g,6,y+90-2)}if(r!==1)if(n===At.setup){const _=t.data.setupPose;let v=_.color;l=v.r+(l-v.r)*r,c=v.g+(c-v.g)*r,u=v.b+(u-v.b)*r,v=_.darkColor,d=v.r+(d-v.r)*r,f=v.g+(f-v.g)*r,m=v.b+(m-v.b)*r}else l=o.r+(l-o.r)*r,c=o.g+(c-o.g)*r,u=o.b+(u-o.b)*r,d=h.r+(d-h.r)*r,f=h.g+(f-h.g)*r,m=h.b+(m-h.b)*r;o.r=l<0?0:l>1?1:l,o.g=c<0?0:c>1?1:c,o.b=u<0?0:u>1?1:u,h.r=d<0?0:d>1?1:d,h.g=f<0?0:f>1?1:f,h.b=m<0?0:m>1?1:m}}class Yn extends ce{constructor(e,s){super(e,`${Bt.attachment}|${s}`);x(this,"slotIndex",0);x(this,"attachmentNames");this.slotIndex=s,this.attachmentNames=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.attachmentNames[e]=r}apply(e,s,r,n,a,o,h,l,c){const u=e.slots[this.slotIndex];if(!u.bone.active)return;const d=c?u.appliedPose:u.pose;l||r<this.frames[0]?o!==At.current&&this.setAttachment(e,d,u.data.attachmentName):this.setAttachment(e,d,this.attachmentNames[ce.search(this.frames,r)])}setAttachment(e,s,r){s.setAttachment(r?e.getAttachment(this.slotIndex,r):null)}}class bu extends Fi{constructor(e,s,r,n){super(e,s,`${Bt.deform}|${r}|${n.id}`);x(this,"slotIndex");x(this,"attachment");x(this,"vertices");this.slotIndex=r,this.attachment=n,this.vertices=new Array(e),this.additive=!0}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.vertices[e]=r}setBezier(e,s,r,n,a,o,h,l,c,u,d){const f=this.curves;let m=this.getFrameCount()+e*18;r===0&&(f[s]=2+m);const p=(n-o*2+l)*.03,g=c*.03-h*.06,y=((o-l)*3-n+u)*.006,_=(h-c+.33333333)*.018;let v=p*2+y,b=g*2+_,T=(o-n)*.3+p+y*.16666667,S=h*.3+g+_*.16666667,w=n+T,E=S;for(let A=m+18;m<A;m+=2)f[m]=w,f[m+1]=E,T+=v,S+=b,v+=y,b+=_,w+=T,E+=S}getCurvePercent(e,s){const r=this.curves;let n=r[s];switch(n){case 0:{const l=this.frames[s];return(e-l)/(this.frames[s+this.getFrameEntries()]-l)}case 1:return 0}if(n-=2,r[n]>e){const l=this.frames[s];return r[n+1]*(e-l)/(r[n]-l)}const a=n+18;for(n+=2;n<a;n+=2)if(r[n]>=e){const l=r[n-2],c=r[n-1];return c+(e-l)/(r[n]-l)*(r[n+1]-c)}const o=r[a-2],h=r[a-1];return h+(1-h)*(e-o)/(this.frames[s+this.getFrameEntries()]-o)}apply(e,s,r,n,a,o,h,l,c){const u=e.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,c))return;const d=this.attachment.timelineSlots,f=this.frames;if(r<f[0]){this.applyBeforeFirst(u[this.slotIndex],c,a,o);for(const _ of d)this.applyBeforeFirst(u[_],c,a,o);return}let m,p,g;if(r>=f[f.length-1])g=0,m=this.vertices[f.length-1],p=null;else{const _=ce.search(f,r);g=this.getCurvePercent(r,_),m=this.vertices[_],p=this.vertices[_+1]}const y=this.vertices[0].length;this.applyToSlot(u[this.slotIndex],c,m,p,g,y,a,o,h);for(const _ of d)this.applyToSlot(u[_],c,m,p,g,y,a,o,h)}applyBeforeFirst(e,s,r,n){if(!e.bone.active)return;const a=s?e.appliedPose:e.pose;if(a.attachment==null||a.attachment.timelineAttachment!==this.attachment)return;const o=a.deform;switch(o.length===0&&(n=At.setup),n){case At.setup:o.length=0;break;case At.first:{if(r===1){o.length=0;return}const h=this.vertices[0].length;o.length=h;const l=o,c=a.attachment;if(c.bones===null){const u=c.vertices;for(let d=0;d<h;d++)l[d]+=(u[d]-l[d])*r}else{r=1-r;for(let u=0;u<h;u++)l[u]*=r}}}}applyToSlot(e,s,r,n,a,o,h,l,c){if(!e.bone.active)return;const u=s?e.appliedPose:e.pose;if(u.attachment===null||u.attachment.timelineAttachment!==this.attachment)return;const d=u.attachment,f=u.deform;f.length===0&&(l=At.setup);const m=l===At.setup;if(f.length=o,n===null)if(h===1)if(c&&!m)if(d.bones)for(let p=0;p<o;p++)f[p]+=r[p];else{const p=d.vertices;for(let g=0;g<o;g++)f[g]+=r[g]-p[g]}else bt.arrayCopy(r,0,f,0,o);else if(m)if(d.bones)for(let p=0;p<o;p++)f[p]=r[p]*h;else{const p=d.vertices;for(let g=0;g<o;g++){const y=p[g];f[g]=y+(r[g]-y)*h}}else if(c)if(d.bones)for(let p=0;p<o;p++)f[p]+=r[p]*h;else{const p=d.vertices;for(let g=0;g<o;g++)f[g]+=(r[g]-p[g])*h}else for(let p=0;p<o;p++)f[p]+=(r[p]-f[p])*h;else if(h===1)if(c&&!m)if(d.bones)for(let p=0;p<o;p++){const g=r[p];f[p]+=g+(n[p]-g)*a}else{const p=d.vertices;for(let g=0;g<o;g++){const y=r[g];f[g]+=y+(n[g]-y)*a-p[g]}}else if(a===0)bt.arrayCopy(r,0,f,0,o);else for(let p=0;p<o;p++){const g=r[p];f[p]=g+(n[p]-g)*a}else if(m)if(d.bones)for(let p=0;p<o;p++){const g=r[p];f[p]=(g+(n[p]-g)*a)*h}else{const p=d.vertices;for(let g=0;g<o;g++){const y=r[g],_=p[g];f[g]=_+(y+(n[g]-y)*a-_)*h}}else if(c)if(d.bones)for(let p=0;p<o;p++){const g=r[p];f[p]+=(g+(n[p]-g)*a)*h}else{const p=d.vertices;for(let g=0;g<o;g++){const y=r[g];f[g]+=(y+(n[g]-y)*a-p[g])*h}}else for(let p=0;p<o;p++){const g=r[p];f[p]+=(g+(n[p]-g)*a-f[p])*h}}}const $s=class $s extends ce{constructor(e,s,r){super(e,`${Bt.sequence}|${s}|${r.sequence.id}`);x(this,"slotIndex");x(this,"attachment");this.slotIndex=s,this.attachment=r,this.instant=!0}getFrameEntries(){return $s.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,s,r,n,a){const o=this.frames;e*=$s.ENTRIES,o[e]=s,o[e+$s.MODE]=r|n<<4,o[e+$s.DELAY]=a}apply(e,s,r,n,a,o,h,l,c){const u=e.slots;if(!this.attachment.isTimelineActive(u,this.slotIndex,c))return;const d=this.attachment.timelineSlots,f=this.frames;if(l||r<f[0]){if(o!==At.current){this.setupPose(u[this.slotIndex],c);for(const _ of d)this.setupPose(u[_],c)}return}const m=ce.search(f,r,$s.ENTRIES),p=f[m],g=f[m+$s.MODE],y=f[m+$s.DELAY];this.applyToSlot(u[this.slotIndex],c,r,p,g,y);for(const _ of d)this.applyToSlot(u[_],c,r,p,g,y)}setupPose(e,s){if(!e.bone.active)return;const r=s?e.appliedPose:e.pose;r.attachment===null||r.attachment.timelineAttachment!==this.attachment||(r.sequenceIndex=-1)}applyToSlot(e,s,r,n,a,o){if(!e.bone.active)return;const h=s?e.appliedPose:e.pose;if(h.attachment===null||h.attachment.timelineAttachment!==this.attachment)return;let l=a>>4,c=h.attachment.sequence.regions.length;const u=ru[a&15];if(u!==He.hold)switch(l+=(r-n)/o+1e-5|0,u){case He.once:l=Math.min(c-1,l);break;case He.loop:l%=c;break;case He.pingpong:{const d=(c<<1)-2;l=d===0?0:l%d,l>=c&&(l=d-l);break}case He.onceReverse:l=Math.max(c-1-l,0);break;case He.loopReverse:l=c-1-l%c;break;case He.pingpongReverse:{const d=(c<<1)-2;l=d===0?0:(l+c-1)%d,l>=c&&(l=d-l)}}h.sequenceIndex=l}};x($s,"ENTRIES",3),x($s,"MODE",1),x($s,"DELAY",2);let za=$s;const vc=class vc extends ce{constructor(e){super(e,...vc.propertyIds);x(this,"events");this.events=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s.time,this.events[e]=s}apply(e,s,r,n,a,o,h,l,c){if(!n)return;const u=this.frames,d=this.frames.length;if(s>r)this.apply(null,s,Number.MAX_VALUE,n,0,o,!1,!1,!1),s=-1;else if(s>=u[d-1])return;if(r<u[0])return;let f=0;if(s<u[0])f=0;else{f=ce.search(u,s)+1;const m=u[f];for(;f>0&&u[f-1]===m;)f--}for(;f<d&&r>=u[f];f++)n.push(this.events[f])}};x(vc,"propertyIds",[`${Bt.event}`]);let jn=vc;const wa=class wa extends ce{constructor(e){super(e,...wa.propertyIds);x(this,"drawOrders");this.drawOrders=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s,r){this.frames[e]=s,this.drawOrders[e]=r}apply(e,s,r,n,a,o,h,l,c){const u=c?e.drawOrder.appliedPose:e.drawOrder.pose,d=e.slots;if(l||r<this.frames[0]){o!==At.current&&bt.arrayCopy(d,0,u,0,e.slots.length);return}const f=this.drawOrders[ce.search(this.frames,r)];if(!f)bt.arrayCopy(d,0,u,0,e.slots.length);else for(let m=0,p=f.length;m<p;m++)u[m]=d[f[m]]}};x(wa,"propertyID",`${Bt.drawOrder}`),x(wa,"propertyIds",[wa.propertyID]);let Wr=wa;const Oo=class Oo extends ce{constructor(e,s,r){super(e,...Oo.propertyIds(s));x(this,"slots");x(this,"inFolder");x(this,"drawOrders");this.slots=s,this.drawOrders=new Array(e),this.inFolder=new Array(r);for(const n of s)this.inFolder[n]=!0;this.instant=!0}static propertyIds(e){const s=e.length,r=new Array(s);for(let n=0;n<s;n++)r[n]=`${Oo.propertyID}|${e[n]}`;return r}getFrameCount(){return this.frames.length}getSlots(){return this.slots}getDrawOrders(){return this.drawOrders}setFrame(e,s,r){this.frames[e]=s,this.drawOrders[e]=r}apply(e,s,r,n,a,o,h,l,c){const u=c?e.drawOrder.appliedPose:e.drawOrder.pose,d=e.slots;if(l||r<this.frames[0])o!==At.current&&this.setup(u,d);else{const f=this.drawOrders[ce.search(this.frames,r)];if(!f)this.setup(u,d);else{const m=this.inFolder,p=this.slots;for(let g=0,y=0,_=p.length;!(m[u[g].data.index]&&(u[g]=d[p[f[y]]],++y===_));g++);}}}setup(e,s){const{inFolder:r,slots:n}=this;for(let a=0,o=0,h=n.length;!(r[e[a].data.index]&&(e[a]=s[n[o]],++o===h));a++);}};x(Oo,"propertyID",`${Bt.drawOrderFolder}`);let an=Oo;function rg(i){return typeof i=="object"&&i!==null&&typeof i.constraintIndex=="number"}class vu extends Fi{constructor(e,s,r){super(e,s,`${Bt.ikConstraint}|${r}`);x(this,"constraintIndex",0);this.constraintIndex=r}getFrameEntries(){return 6}setFrame(e,s,r,n,a,o,h){e*=6,this.frames[e]=s,this.frames[e+1]=r,this.frames[e+2]=n,this.frames[e+3]=a,this.frames[e+4]=o?1:0,this.frames[e+5]=h?1:0}apply(e,s,r,n,a,o,h,l,c){const u=e.constraints[this.constraintIndex];if(!u.active)return;const d=c?u.appliedPose:u.pose,f=this.frames;if(r<f[0]){const v=u.data.setupPose;switch(o){case At.setup:{d.mix=v.mix,d.softness=v.softness,d.bendDirection=v.bendDirection,d.compress=v.compress,d.stretch=v.stretch;break}case At.first:{d.mix+=(v.mix-d.mix)*a,d.softness+=(v.softness-d.softness)*a,d.bendDirection=v.bendDirection,d.compress=v.compress,d.stretch=v.stretch;break}}return}let m=0,p=0;const g=ce.search(f,r,6),y=this.curves[g/6];switch(y){case 0:{const v=f[g];m=f[g+1],p=f[g+2];const b=(r-v)/(f[g+6]-v);m+=(f[g+6+1]-m)*b,p+=(f[g+6+2]-p)*b;break}case 1:m=f[g+1],p=f[g+2];break;default:m=this.getBezierValue(r,g,1,y-2),p=this.getBezierValue(r,g,2,y+18-2)}const _=o===At.setup?u.data.setupPose:d;d.mix=_.mix+(m-_.mix)*a,d.softness=_.softness+(p-_.softness)*a,l?o===At.setup&&(d.bendDirection=_.bendDirection,d.compress=_.compress,d.stretch=_.stretch):(d.bendDirection=f[g+3],d.compress=f[g+4]!==0,d.stretch=f[g+5]!==0)}}class _u extends Fi{constructor(e,s,r){super(e,s,`${Bt.transformConstraint}|${r}`);x(this,"constraintIndex",0);this.constraintIndex=r,this.additive=!0}getFrameEntries(){return 7}setFrame(e,s,r,n,a,o,h,l){const c=this.frames;e*=7,c[e]=s,c[e+1]=r,c[e+2]=n,c[e+3]=a,c[e+4]=o,c[e+5]=h,c[e+6]=l}apply(e,s,r,n,a,o,h,l,c){const u=e.constraints[this.constraintIndex];if(!u.active)return;const d=c?u.appliedPose:u.pose,f=this.frames;if(r<f[0]){const w=u.data.setupPose;switch(o){case At.setup:{d.mixRotate=w.mixRotate,d.mixX=w.mixX,d.mixY=w.mixY,d.mixScaleX=w.mixScaleX,d.mixScaleY=w.mixScaleY,d.mixShearY=w.mixShearY;break}case At.first:{d.mixRotate+=(w.mixRotate-d.mixRotate)*a,d.mixX+=(w.mixX-d.mixX)*a,d.mixY+=(w.mixY-d.mixY)*a,d.mixScaleX+=(w.mixScaleX-d.mixScaleX)*a,d.mixScaleY+=(w.mixScaleY-d.mixScaleY)*a,d.mixShearY+=(w.mixShearY-d.mixShearY)*a;break}}return}let m,p,g,y,_,v;const b=ce.search(f,r,7),T=this.curves[b/7];switch(T){case 0:{const w=f[b];m=f[b+1],p=f[b+2],g=f[b+3],y=f[b+4],_=f[b+5],v=f[b+6];const E=(r-w)/(f[b+7]-w);m+=(f[b+7+1]-m)*E,p+=(f[b+7+2]-p)*E,g+=(f[b+7+3]-g)*E,y+=(f[b+7+4]-y)*E,_+=(f[b+7+5]-_)*E,v+=(f[b+7+6]-v)*E;break}case 1:m=f[b+1],p=f[b+2],g=f[b+3],y=f[b+4],_=f[b+5],v=f[b+6];break;default:m=this.getBezierValue(r,b,1,T-2),p=this.getBezierValue(r,b,2,T+18-2),g=this.getBezierValue(r,b,3,T+36-2),y=this.getBezierValue(r,b,4,T+54-2),_=this.getBezierValue(r,b,5,T+72-2),v=this.getBezierValue(r,b,6,T+90-2)}const S=o===At.setup?u.data.setupPose:d;h?(d.mixRotate=S.mixRotate+m*a,d.mixX=S.mixX+p*a,d.mixY=S.mixY+g*a,d.mixScaleX=S.mixScaleX+y*a,d.mixScaleY=S.mixScaleY+_*a,d.mixShearY=S.mixShearY+v*a):(d.mixRotate=S.mixRotate+(m-S.mixRotate)*a,d.mixX=S.mixX+(p-S.mixX)*a,d.mixY=S.mixY+(g-S.mixY)*a,d.mixScaleX=S.mixScaleX+(y-S.mixScaleX)*a,d.mixScaleY=S.mixScaleY+(_-S.mixScaleY)*a,d.mixShearY=S.mixShearY+(v-S.mixShearY)*a)}}class Qn extends dr{constructor(e,s,r,n){super(e,s,`${n}|${r}`);x(this,"constraintIndex");this.constraintIndex=r}}class wu extends Qn{constructor(t,e,s){super(t,e,s,Bt.pathConstraintPosition),this.additive=!0}apply(t,e,s,r,n,a,o,h,l){const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.position=this.getAbsoluteValue(s,n,a,o,u.position,c.data.setupPose.position)}}}class Tu extends Qn{constructor(t,e,s){super(t,e,s,Bt.pathConstraintSpacing)}apply(t,e,s,r,n,a,o,h,l){const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.spacing=this.getAbsoluteValue(s,n,a,!1,u.spacing,c.data.setupPose.spacing)}}}class Su extends Fi{constructor(e,s,r){super(e,s,`${Bt.pathConstraintMix}|${r}`);x(this,"constraintIndex");this.constraintIndex=r}getFrameEntries(){return 4}setFrame(e,s,r,n,a){const o=this.frames;e<<=2,o[e]=s,o[e+1]=r,o[e+2]=n,o[e+3]=a}apply(e,s,r,n,a,o,h,l,c){const u=e.constraints[this.constraintIndex];if(!u.active)return;const d=c?u.appliedPose:u.pose,f=this.frames;if(r<f[0]){const b=u.data.setupPose;switch(o){case At.setup:{d.mixRotate=b.mixRotate,d.mixX=b.mixX,d.mixY=b.mixY;break}case At.first:{d.mixRotate+=(b.mixRotate-d.mixRotate)*a,d.mixX+=(b.mixX-d.mixX)*a,d.mixY+=(b.mixY-d.mixY)*a;break}}return}let m,p,g;const y=ce.search(f,r,4),_=this.curves[y>>2];switch(_){case 0:{const b=f[y];m=f[y+1],p=f[y+2],g=f[y+3];const T=(r-b)/(f[y+4]-b);m+=(f[y+4+1]-m)*T,p+=(f[y+4+2]-p)*T,g+=(f[y+4+3]-g)*T;break}case 1:m=f[y+1],p=f[y+2],g=f[y+3];break;default:m=this.getBezierValue(r,y,1,_-2),p=this.getBezierValue(r,y,2,_+18-2),g=this.getBezierValue(r,y,3,_+36-2)}const v=o===At.setup?u.data.setupPose:d;h?(d.mixRotate=v.mixRotate+m*a,d.mixX=v.mixX+p*a,d.mixY=v.mixY+g*a):(d.mixRotate=v.mixRotate+(m-v.mixRotate)*a,d.mixX=v.mixX+(p-v.mixX)*a,d.mixY=v.mixY+(g-v.mixY)*a)}}class Kr extends Qn{constructor(t,e,s,r){super(t,e,s,r)}apply(t,e,s,r,n,a,o,h,l){if(o&&!this.additive&&(o=!1),this.constraintIndex===-1){const c=s>=this.frames[0]?this.getCurveValue(s):0,u=t.physics;for(const d of u)if(d.active&&this.global(d.data)){const f=l?d.appliedPose:d.pose;this.set(f,this.getAbsoluteValue(s,n,a,o,this.get(f),this.get(d.data.setupPose),c))}}else{const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;this.set(u,this.getAbsoluteValue(s,n,a,o,this.get(u),this.get(c.data.setupPose)))}}}}class Eu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintInertia)}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}}class Au extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintStrength)}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}}class Cu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintDamping)}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}}class Iu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintMass)}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}}class Pu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintWind),this.additive=!0}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}}class Mu extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintGravity),this.additive=!0}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}}class Ru extends Kr{constructor(t,e,s){super(t,e,s,Bt.physicsConstraintMix)}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}}const _c=class _c extends ce{constructor(e,s){super(e,..._c.propertyIds);x(this,"constraintIndex");this.constraintIndex=s,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s}apply(e,s,r,n,a,o,h,l,c){let u;if(this.constraintIndex!==-1&&(u=e.constraints[this.constraintIndex],!u.active))return;const d=this.frames;if(s>r)this.apply(e,s,Number.MAX_VALUE,[],a,o,!1,!1,!1),s=-1;else if(s>=d[d.length-1])return;if(!(r<d[0])&&(s<d[0]||r>=d[ce.search(d,s)+1]))if(u!=null)u.reset(e);else for(const f of e.physics)f.active&&f.reset(e)}};x(_c,"propertyIds",[Bt.physicsConstraintReset.toString()]);let ja=_c;class Fu extends Qn{constructor(t,e,s){super(t,e,s,Bt.sliderTime)}apply(t,e,s,r,n,a,o,h,l){const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.time=this.getAbsoluteValue(s,n,a,o,u.time,c.data.setupPose.time)}}}class ku extends Qn{constructor(t,e,s){super(t,e,s,Bt.sliderMix),this.additive=!0}apply(t,e,s,r,n,a,o,h,l){const c=t.constraints[this.constraintIndex];if(c.active){const u=l?c.appliedPose:c.pose;u.mix=this.getAbsoluteValue(s,n,a,o,u.mix,c.data.setupPose.mix)}}}const Do=class Do{constructor(t){x(this,"data");x(this,"tracks",[]);x(this,"timeScale",1);x(this,"unkeyedState",0);x(this,"events",[]);x(this,"listeners",[]);x(this,"queue",new ng(this));x(this,"propertyIds",new Map);x(this,"animationsChanged",!1);x(this,"trackEntryPool",new $a(()=>new ig));this.data=t}update(t){t*=this.timeScale;const e=this.tracks;for(let s=0,r=e.length;s<r;s++){const n=e[s];if(!n)continue;n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast;let a=t*n.timeScale;if(n.delay>0){if(n.delay-=a,n.delay>0)continue;a=-n.delay,n.delay=0}let o=n.next;if(o){const h=n.trackLast-o.delay;if(h>=0){for(o.delay=0,o.trackTime+=n.timeScale===0?0:(h/n.timeScale+t)*o.timeScale,n.trackTime+=a,this.setTrack(s,o,!0);o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(n.trackLast>=n.trackEnd&&!n.mixingFrom){e[s]=null,this.queue.end(n),this.clearNext(n);continue}if(n.mixingFrom&&this.updateMixingFrom(n,t)){let h=n.mixingFrom;for(n.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}n.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){const s=t.mixingFrom;if(!s)return!0;const r=this.updateMixingFrom(s,e);if(s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.nextTrackLast!==-1&&t.mixTime>=t.mixDuration){if(s.totalAlpha===0||t.mixDuration===0){if(t.mixingFrom=s.mixingFrom,s.mixingFrom!=null&&(s.mixingFrom.mixingTo=t),s.totalAlpha===0)for(let n=t;n.mixingTo!=null;n=n.mixingTo)n.keepHold=!0;this.queue.end(s)}return r}return s.trackTime+=e*s.timeScale,t.mixTime+=e,!1}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const e=this.events,s=this.tracks;let r=!1;for(let o=0,h=s.length;o<h;o++){const l=s[o];if(!l||l.delay>0)continue;r=!0;let c=l.alpha;l.mixingFrom?c*=this.applyMixingFrom(l,t):l.trackTime>=l.trackEnd&&!l.next&&(c=0);let u=l.animationLast,d=l.getAnimationTime(),f=d,m=e;l.reverse&&(f=l.animation.duration-f,m=null);const p=l.animation.timelines,g=p.length;if(o===0&&c===1)for(let y=0;y<g;y++){bt.webkit602BugfixHelper(c);const _=p[y];_ instanceof Yn?this.applyAttachmentTimeline(_,t,f,At.setup,!0):_.apply(t,u,f,m,c,At.setup,!1,!1,!1)}else{const y=l.timelineMode,_=c>=l.alphaAttachmentThreshold,v=l.additive,b=v||l.shortestRotation,T=!b&&l.timelinesRotation.length!==g<<1;T&&(l.timelinesRotation.length=g<<1);for(let S=0;S<g;S++){const w=p[S],E=y[S]&dc;!b&&w instanceof Wa?this.applyRotateTimeline(w,t,f,c,E,l.timelinesRotation,S<<1,T):w instanceof Yn?this.applyAttachmentTimeline(w,t,f,E,_):(bt.webkit602BugfixHelper(c),w.apply(t,u,f,m,c,E,v,!1,!1))}}l.reverse&&this.eventsReverse(l,u,d),this.queueEvents(l,d),e.length=0,l.nextAnimationLast=d,l.nextTrackLast=l.trackTime}const n=this.unkeyedState+fc,a=t.slots;for(let o=0,h=t.slots.length;o<h;o++){const l=a[o];if(l.attachmentState===n){const c=l.data.attachmentName;l.pose.setAttachment(c?t.getAttachment(l.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),r}applyMixingFrom(t,e){const s=t.mixingFrom,r=s.mixingFrom!==null?this.applyMixingFrom(s,e):1,n=t.mix(),a=s.alpha*r,o=1-n*t.alpha,h=a*(1-n),l=o>0?h/o:a,c=s.animation.timelines,u=c.length,d=s.timelineMode,f=s.timelineHoldMix,m=n<s.mixAttachmentThreshold,p=n<s.mixDrawOrderThreshold,g=s.additive,y=g||s.shortestRotation,_=!y&&s.timelinesRotation.length!==u<<1;_&&(s.timelinesRotation.length=u<<1);const v=s.timelinesRotation;let b=s.animationLast,T=s.getAnimationTime(),S=T,w=null;s.reverse?S=s.animation.duration-S:n<s.eventThreshold&&(w=this.events),s.totalAlpha=0;for(let E=0;E<u;E++){const A=c[E],P=d[E],I=P&dc;let C=0;if((P&va)!==0){const R=f[E];C=R==null?l:l*(1-R.mix())}else{if(!p&&A instanceof Wr&&I===At.current)continue;C=h}if(s.totalAlpha+=C,!y&&A instanceof Wa)this.applyRotateTimeline(A,e,S,C,I,v,E<<1,_);else if(A instanceof Yn)this.applyAttachmentTimeline(A,e,S,I,m&&C>=s.alphaAttachmentThreshold);else{const R=!p||!(A instanceof Wr)||I===At.current;A.apply(e,b,S,w,C,I,g,R,!1)}}return s.reverse&&n<s.eventThreshold&&this.eventsReverse(s,b,T),t.mixDuration>0&&this.queueEvents(s,T),this.events.length=0,s.nextAnimationLast=T,s.nextTrackLast=s.trackTime,n}applyAttachmentTimeline(t,e,s,r,n){const a=e.slots[t.slotIndex];if(!a.bone.active||!n&&a.attachmentState===this.unkeyedState+mc)return;let o=s<t.frames[0],h=null;if(o||(h=t.attachmentNames[ce.search(t.frames,s)],o=!n&&h==null),o){if(r===At.current)return;h=a.data.attachmentName}a.pose.setAttachment(h==null?null:e.getAttachment(a.data.index,h)),n?a.attachmentState=this.unkeyedState+mc:o||(a.attachmentState=this.unkeyedState+fc)}applyRotateTimeline(t,e,s,r,n,a,o,h){if(h&&(a[o]=0),r===1){t.apply(e,0,s,null,1,n,!1,!1,!1);return}const l=e.bones[t.boneIndex];if(!l.active)return;const c=l.pose,u=l.data.setupPose,d=t.frames;let f,m;if(s<d[0]){switch(n){case At.setup:{c.rotation=u.rotation;return}case At.current:return}f=c.rotation,m=u.rotation}else f=n===At.setup?u.rotation:c.rotation,m=u.rotation+t.getCurveValue(s);let p=0,g=m-f;if(g-=Math.ceil(g/360-.5)*360,g===0)p=a[o];else{let y=0,_=0;h?(y=0,_=g):(y=a[o],_=a[o+1]);const v=y-y%360;p=g+v;let b=g>=0,T=y>=0;Math.abs(_)<=90&&pt.signum(_)!==pt.signum(g)&&(Math.abs(y-v)>180?(p+=360*pt.signum(y),T=b):v!==0?p-=360*pt.signum(y):T=b),T!==b&&(p+=360*pt.signum(y)),a[o]=p}a[o+1]=g,c.rotation=f+p*r}queueEvents(t,e){const s=t.animationStart,r=t.animationEnd,n=r-s,a=t.reverse;let o=t.trackLast%n;a&&(o=n-o);const h=this.events;let l=0,c=h.length;for(;l<c;l++){const d=h[l];if(d.time<o!==a)break;d.time>=s&&d.time<=r&&this.queue.event(t,d)}let u=!1;if(t.loop)if(n===0)u=!0;else{const d=Math.floor(t.trackTime/n);u=d>0&&d>Math.floor(t.trackLast/n)}else u=e>=r&&t.animationLast<r;for(u&&this.queue.complete(t);l<c;l++){const d=h[l];d.time>=s&&d.time<=r&&this.queue.event(t,d)}}eventsReverse(t,e,s){const r=t.animation.duration,n=r-e,a=r-s,o=t.animation.timelines;for(let h=0,l=t.animation.timelines.length;h<l;h++){const c=o[h];if(!(c instanceof jn))continue;const u=c.events,d=c.frames,f=d.length;if(n>=a){for(let m=0;m<f;m++)if(!(d[m]<a)){if(d[m]>=n)break;this.events.push(u[m])}}else{for(let p=0;p<f&&!(d[p]>=n);p++)this.events.push(u[p]);let m=0;for(;m<f&&!(d[m]>=a);m++);for(;m<f;m++)this.events.push(u[m])}}}clearTracks(){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t<0)throw new Error("trackIndex must be >= 0.");if(t>=this.tracks.length)return;const e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){const r=s.mixingFrom;if(!r)break;this.queue.end(r),s.mixingFrom=null,s.mixingTo=null,s=r}this.tracks[e.trackIndex]=null,this.queue.drain()}setTrack(t,e,s){const r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(r.next=null,s&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){return typeof e=="string"?this.setAnimation1(t,e,s):this.setAnimation2(t,e,s)}setAnimation1(t,e,s=!1){const r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error(`Animation not found: ${e}`);return this.setAnimation2(t,r,s)}setAnimation2(t,e,s=!1){if(t<0)throw new Error("trackIndex must be >= 0.");if(!e)throw new Error("animation cannot be null.");let r=!0,n=this.expandToIndex(t);n&&(n.nextTrackLast===-1&&n.animation===e?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,r=!1):this.clearNext(n));const a=this.trackEntry(t,e,s,n);return this.setTrack(t,a,r),this.queue.drain(),a}addAnimation(t,e,s=!1,r=0){return typeof e=="string"?this.addAnimation1(t,e,s,r):this.addAnimation2(t,e,s,r)}addAnimation1(t,e,s=!1,r=0){const n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error(`Animation not found: ${e}`);return this.addAnimation2(t,n,s,r)}addAnimation2(t,e,s=!1,r=0){if(t<0)throw new Error("trackIndex must be >= 0.");if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;const a=this.trackEntry(t,e,s,n);return n?(n.next=a,a.previous=n,r<=0&&(r=Math.max(r+n.getTrackComplete()-a.mixDuration,0))):(this.setTrack(t,a,!0),this.queue.drain(),r<0&&(r=0)),a.delay=r,a}setEmptyAnimation(t,e=0){const s=this.setAnimation(t,Do.emptyAnimation,!1);return s.mixDuration=e,s.trackEnd=e,s}addEmptyAnimation(t,e=0,s=0){const r=this.addAnimation(t,Do.emptyAnimation,!1,s);return s<=0&&(r.delay=Math.max(r.delay+r.mixDuration-e,0)),r.mixDuration=e,r.trackEnd=e,r}setEmptyAnimations(t=0){const e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,r=this.tracks.length;s<r;s++){const n=this.tracks[s];n&&this.setEmptyAnimation(n.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(t){return t<this.tracks.length?this.tracks[t]:(bt.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)}trackEntry(t,e,s,r){const n=this.trackEntryPool.obtain();return n.reset(),n.trackIndex=t,n.animation=e,n.loop=s,n.additive=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=e.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=r?this.data.getMix(r.animation,e):0,n.totalAlpha=0,n.keepHold=!1,n}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1;const t=this.tracks;for(let e=0,s=t.length;e<s;e++){const r=t[e];if(!r)continue;let n=r;for(;n.mixingFrom;)n=n.mixingFrom;do this.computeHold(n,r),n=n.mixingTo;while(n)}this.propertyIds.clear()}computeHold(t,e){var c,u;const s=t.animation.timelines,r=t.animation.timelines.length,n=t.timelineMode;n.length=r;const a=t.timelineHoldMix;a.length=0;const o=t.additive,h=t.keepHold,l=t.mixingTo;for(let d=0;d<r;d++){const f=s[d],m=f.propertyIds,p=this.from(e,f,m);if(o&&f.additive){n[d]=p;continue}let g;if(l===null||f.instant||l.additive&&f.additive||!((c=l.animation)!=null&&c.hasTimeline(m)))g=p;else{g=p|va;for(let y=l.mixingTo;y!=null;y=y.mixingTo)if(y.additive&&f.additive||!((u=y.animation)!=null&&u.hasTimeline(m))){y.mixDuration>0&&(a[d]=y);break}}h&&(g=g&~va|n[d]&va),n[d]=g}}from(t,e,s){const r=this.propertyIds;let n=ag;for(let a=0,o=s.length;a<o;a++){const h=r.get(s[a]);if(h===void 0)r.set(s[a],t);else{if(h!==t){for(;++a<o;)r.has(s[a])||r.set(s[a],t);return cc}n=uc}}if(e instanceof an){const a=r.get(Wr.propertyID);if(a!=null)return a!==t?cc:uc}return n}getTrack(t){if(t<0)throw new Error("trackIndex must be >= 0.");return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}};x(Do,"emptyAnimation",new Pl("<empty>",[],0));let qa=Do;class ig{constructor(){x(this,"animation",null);x(this,"previous",null);x(this,"next",null);x(this,"mixingFrom",null);x(this,"mixingTo",null);x(this,"listener",null);x(this,"trackIndex",0);x(this,"loop",!1);x(this,"additive",!1);x(this,"reverse",!1);x(this,"shortestRotation",!1);x(this,"keepHold",!1);x(this,"eventThreshold",0);x(this,"mixAttachmentThreshold",0);x(this,"alphaAttachmentThreshold",0);x(this,"mixDrawOrderThreshold",0);x(this,"animationStart",0);x(this,"animationEnd",0);x(this,"animationLast",0);x(this,"nextAnimationLast",0);x(this,"delay",0);x(this,"trackTime",0);x(this,"trackLast",0);x(this,"nextTrackLast",0);x(this,"trackEnd",0);x(this,"timeScale",0);x(this,"alpha",0);x(this,"mixTime",0);x(this,"mixDuration",0);x(this,"totalAlpha",0);x(this,"mixInterpolation",en.linear);x(this,"timelineMode",[]);x(this,"timelineHoldMix",[]);x(this,"timelinesRotation",[])}setMixDuration(t,e){this.mixDuration=t,e!==void 0&&(e<=0&&(e=this.previous==null?0:Math.max(e+this.previous.getTrackComplete()-t,0)),this.delay=e)}setMixInterpolation(t){if(!t)throw new Error("mixInterpolation cannot be null.");this.mixInterpolation=t}mix(){if(this.mixDuration===0)return 1;let t=this.mixTime/this.mixDuration;return t>=1?1:this.mixInterpolation===en.linear?t:(t=this.mixInterpolation.apply(t),t<0?0:t>1?1:t)}reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.mixInterpolation=en.linear,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(!this.loop)return Math.min(this.trackTime+this.animationStart,this.animationEnd);const t=this.animationEnd-this.animationStart;return t===0?this.animationStart:this.trackTime%t+this.animationStart}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){const t=this.animationEnd-this.animationStart;if(t!==0){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}wasApplied(){return this.nextTrackLast!==-1}isNextReady(){return this.next!=null&&this.nextTrackLast-this.next.delay>=0}}class ng{constructor(t){x(this,"objects",[]);x(this,"drainDisabled",!1);x(this,"animState");this.animState=t}start(t){this.objects.push(ns.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(ns.interrupt),this.objects.push(t)}end(t){this.objects.push(ns.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(ns.dispose),this.objects.push(t)}complete(t){this.objects.push(ns.complete),this.objects.push(t)}event(t,e){this.objects.push(ns.event),this.objects.push(t),this.objects.push(e)}drain(){var t,e,s,r,n,a;if(!this.drainDisabled){this.drainDisabled=!0;for(let o=0;o<this.objects.length;o+=2){const h=this.objects,l=h[o],c=h[o+1],u=this.animState.listeners.slice();switch(l){case ns.start:(t=c.listener)!=null&&t.start&&c.listener.start(c);for(let d=0;d<u.length;d++){const f=u[d];f.start&&f.start(c)}break;case ns.interrupt:(e=c.listener)!=null&&e.interrupt&&c.listener.interrupt(c);for(let d=0;d<u.length;d++){const f=u[d];f.interrupt&&f.interrupt(c)}break;case ns.end:(s=c.listener)!=null&&s.end&&c.listener.end(c);for(let d=0;d<u.length;d++){const f=u[d];f.end&&f.end(c)}case ns.dispose:(r=c.listener)!=null&&r.dispose&&c.listener.dispose(c);for(let d=0;d<u.length;d++){const f=u[d];f.dispose&&f.dispose(c)}this.animState.trackEntryPool.free(c);break;case ns.complete:(n=c.listener)!=null&&n.complete&&c.listener.complete(c);for(let d=0;d<u.length;d++){const f=u[d];f.complete&&f.complete(c)}break;case ns.event:{const d=h[o+++2];(a=c.listener)!=null&&a.event&&c.listener.event(c,d);for(let f=0;f<u.length;f++){const m=u[f];m.event&&m.event(c,d)}break}}}this.clear(),this.drainDisabled=!1}}clear(){this.objects.length=0}}var ns;(function(i){i[i.start=0]="start",i[i.interrupt=1]="interrupt",i[i.end=2]="end",i[i.dispose=3]="dispose",i[i.complete=4]="complete",i[i.event=5]="event"})(ns||(ns={}));class kw{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}}const cc=0,ag=1,uc=2,dc=3,va=4,fc=1,mc=2;class og{constructor(t){x(this,"skeletonData");x(this,"animationToMixTime",{});x(this,"defaultMix",0);if(!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){return typeof t=="string"?this.setMix1(t,e,s):this.setMix2(t,e,s)}setMix1(t,e,s){const r=this.skeletonData.findAnimation(t);if(!r)throw new Error(`Animation not found: ${t}`);const n=this.skeletonData.findAnimation(e);if(!n)throw new Error(`Animation not found: ${e}`);this.setMix2(r,n,s)}setMix2(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");const r=`${t.name}.${e.name}`;this.animationToMixTime[r]=s}getMix(t,e){const s=`${t.name}.${e.name}`,r=this.animationToMixTime[s];return r===void 0?this.defaultMix:r}}class Lw{constructor(t,e="",s=new lg,r=new al){x(this,"textureLoader");x(this,"pathPrefix");x(this,"downloader");x(this,"cache");x(this,"errors",{});x(this,"toLoad",0);x(this,"loaded",0);x(this,"texturePmaInfo",{});this.textureLoader=t,this.pathPrefix=e,this.downloader=s,this.cache=r}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,s){this.toLoad--,this.loaded++,this.cache.assets[e]=s,this.cache.assetsRefCount[e]=(this.cache.assetsRefCount[e]||0)+1,t&&t(e,s)}error(t,e,s){this.toLoad--,this.loaded++,this.errors[e]=s,t&&t(e,s)}loadAll(){return new Promise((e,s)=>{const r=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):e(this);return}requestAnimationFrame(r)};requestAnimationFrame(r)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},s=()=>{}){t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((r,n)=>{this.downloader.downloadBinary(t,a=>{this.success(e,t,a),r(a)},(a,o)=>{const h=`Couldn't load binary ${t}: status ${a}, ${o}`;this.error(s,t,h),n(h)})}))}loadText(t,e=()=>{},s=()=>{}){t=this.start(t),this.downloader.downloadText(t,r=>{this.success(e,t,r)},(r,n)=>{this.error(s,t,`Couldn't load text ${t}: status ${r}, ${n}`)})}loadJson(t,e=()=>{},s=()=>{}){t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((r,n)=>{this.downloader.downloadJson(t,a=>{this.success(e,t,a),r(a)},(a,o)=>{const h=`Couldn't load JSON ${t}: status ${a}, ${o}`;this.error(s,t,h),n(h)})}))}reuseAssets(t,e=()=>{},s=()=>{}){const r=this.cache.getAsset(t),n=r!==void 0;return n&&(this.cache.assetsLoaded[t]=r.then(a=>(a=a instanceof Image||a instanceof ImageBitmap?this.textureLoader(a):a,this.success(e,t,a),a)).catch(a=>{this.error(s,t,a)})),n}loadTexture(t,e=()=>{},s=()=>{}){if(t=this.start(t),this.reuseAssets(t,e,s))return;const r=this.texturePmaInfo[t];this.cache.assetsLoaded[t]=new Promise((n,a)=>{if(!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(t,{mode:"cors"}).then(l=>{if(l.ok)return l.blob();const c=`Couldn't load image: ${t}`;this.error(s,t,`Couldn't load image: ${t}`),a(c)}).then(l=>l?createImageBitmap(l,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(l=>{if(l){const c=this.createTexture(t,r,l);this.success(e,t,c),n(c)}});else{const l=new Image;l.crossOrigin="anonymous",l.onload=()=>{const c=this.createTexture(t,r,l);this.success(e,t,c),n(c)},l.onerror=()=>{const c=`Couldn't load image: ${t}`;this.error(s,t,c),a(c)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),l.src=t}})}loadTextureAtlas(t,e=()=>{},s=()=>{},r){const n=t.lastIndexOf("/"),a=n>=0?t.substring(0,n+1):"";t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((o,h)=>{this.downloader.downloadText(t,l=>{try{const c=this.createTextureAtlas(l,a,t,r);let u=c.pages.length,d=!1;if(u===0){this.success(e,t,c),o(c);return}for(const f of c.pages)this.loadTexture(this.texturePath(a,f.name,r),(m,p)=>{d||(f.setTexture(p),--u===0&&(this.success(e,t,c),o(c)))},(m,p)=>{if(!d){const g=`Couldn't load texture ${t} page image: ${m}`;this.error(s,t,g),h(g)}d=!0})}catch(c){const u=`Couldn't parse texture atlas ${t}: ${c.message}`;this.error(s,t,u),h(u)}},(l,c)=>{const u=`Couldn't load texture atlas ${t}: status ${l}, ${c}`;this.error(s,t,u),h(u)})}))}loadTextureAtlasButNoTextures(t,e=()=>{},s=()=>{}){const r=t.lastIndexOf("/"),n=r>=0?t.substring(0,r+1):"";t=this.start(t),!this.reuseAssets(t,e,s)&&(this.cache.assetsLoaded[t]=new Promise((a,o)=>{this.downloader.downloadText(t,h=>{try{const l=this.createTextureAtlas(h,n,t);this.success(e,t,l),a(l)}catch(l){const c=`Couldn't parse texture atlas ${t}: ${l.message}`;this.error(s,t,c),o(c)}},(h,l)=>{const c=`Couldn't load texture atlas ${t}: status ${h}, ${l}`;this.error(s,t,c),o(c)})}))}async loadBinaryAsync(t){return new Promise((e,s)=>{this.loadBinary(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadJsonAsync(t){return new Promise((e,s)=>{this.loadJson(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadTextureAsync(t){return new Promise((e,s)=>{this.loadTexture(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadTextureAtlasAsync(t){return new Promise((e,s)=>{this.loadTextureAtlas(t,(r,n)=>e(n),(r,n)=>s(n))})}async loadTextureAtlasButNoTexturesAsync(t){return new Promise((e,s)=>{this.loadTextureAtlasButNoTextures(t,(r,n)=>e(n),(r,n)=>s(n))})}setCache(t){this.cache=t}get(t){return this.cache.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;const e=this.cache.assets[t];if(e)return e;const s=this.errors[t];throw Error(`Asset not found: ${t}${s?`
|
||
${s}`:""}`)}remove(t){t=this.pathPrefix+t;const e=this.cache.assets[t];return e.dispose&&e.dispose(),delete this.cache.assets[t],delete this.cache.assetsRefCount[t],delete this.cache.assetsLoaded[t],e}removeAll(){for(const t in this.cache.assets){const e=this.cache.assets[t];e.dispose&&e.dispose()}this.cache.assets={},this.cache.assetsLoaded={},this.cache.assetsRefCount={}}isLoadingComplete(){return this.toLoad===0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}disposeAsset(t){const e=this.cache.assets[t];if(e instanceof nl){e.dispose();return}this.disposeAssetInternal(t)}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}disposeAssetInternal(t){if(this.cache.assetsRefCount[t]>0&&--this.cache.assetsRefCount[t]===0)return this.remove(t)}createTextureAtlas(t,e,s,r){const n=new nl(t);n.dispose=()=>{var a;if(!(this.cache.assetsRefCount[s]<=0)){this.disposeAssetInternal(s);for(const o of n.pages)(a=o.texture)==null||a.dispose()}};for(const a of n.pages){const o=this.texturePath(e,a.name,r);this.texturePmaInfo[this.pathPrefix+o]=a.pma}return n}createTexture(t,e,s){const r=this.textureLoader(s,e),n=r.dispose.bind(r);return r.dispose=()=>{this.disposeAssetInternal(t)&&n()},r}texturePath(t,e,s){return s?s[e]:t+e}}const Ta=class Ta{constructor(){x(this,"assets",{});x(this,"assetsRefCount",{});x(this,"assetsLoaded",{})}static getCache(t){const e=Ta.AVAILABLE_CACHES.get(t);if(e)return e;const s=new Ta;return Ta.AVAILABLE_CACHES.set(t,s),s}async addAsset(t,e){return this.assetsLoaded[t]=Promise.resolve(e),this.assets[t]=e,e}getAsset(t){return this.assetsLoaded[t]}};x(Ta,"AVAILABLE_CACHES",new Map);let al=Ta;class lg{constructor(){x(this,"callbacks",{});x(this,"rawDataUris",{})}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return e!==-1?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){var e=window.atob(t),s=e.length,r=new Uint8Array(s);for(let n=0;n<s;n++)r[n]=e.charCodeAt(n);return r}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(e===-1)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,s){if(this.start(t,e,s))return;const r=this.rawDataUris[t];if(r&&!r.includes(".")){try{this.finish(t,200,this.dataUriToString(r))}catch(o){this.finish(t,400,JSON.stringify(o))}return}const n=new XMLHttpRequest;n.overrideMimeType("text/html"),n.open("GET",r||t,!0);const a=()=>{this.finish(t,n.status,n.responseText)};n.onload=a,n.onerror=a,n.send()}downloadJson(t,e,s){this.downloadText(t,r=>{e(JSON.parse(r))},s)}downloadBinary(t,e,s){if(this.start(t,e,s))return;const r=this.rawDataUris[t];if(r&&!r.includes(".")){try{this.finish(t,200,this.dataUriToUint8Array(r))}catch(o){this.finish(t,400,JSON.stringify(o))}return}const n=new XMLHttpRequest;n.open("GET",r||t,!0),n.responseType="arraybuffer";const a=()=>{this.finish(t,n.status,n.response)};n.onload=()=>{n.status===200||n.status===0?this.finish(t,200,new Uint8Array(n.response)):a()},n.onerror=a,n.send()}start(t,e,s){let r=this.callbacks[t];try{if(r)return!0;this.callbacks[t]=r=[]}finally{r.push(e,s)}}finish(t,e,s){const r=this.callbacks[t];if(delete this.callbacks[t],e===200||e===0)for(let n=0,a=r.length;n<a;n+=2)r[n](s);else for(let n=1,a=r.length;n<a;n+=2)r[n](e,s)}}class ro extends vr{constructor(e){super(e);x(this,"color",new Ft(1,1,1,1))}copy(){const e=new ro(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}}class zr extends vr{constructor(e){super(e);x(this,"endSlot",null);x(this,"convex",!1);x(this,"inverse",!1);x(this,"color",new Ft(.2275,.2275,.8078,1))}copy(){const e=new zr(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.convex=this.convex,e.inverse=this.inverse,e.color.setFromColor(this.color),e}}class on extends vr{constructor(e){super(e);x(this,"lengths",[]);x(this,"closed",!1);x(this,"constantSpeed",!1);x(this,"color",new Ft(1,1,1,1))}copy(){const e=new on(this.name);return this.copyTo(e),e.lengths=[],bt.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=this.closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}}class Rl extends vr{constructor(e){super(e);x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"color",new Ft(.38,.94,0,1))}computeWorldPosition(e,s){return s.x=this.x*e.a+this.y*e.b+e.worldX,s.y=this.x*e.c+this.y*e.d+e.worldY,s}computeWorldRotation(e){const s=this.rotation*pt.degRad,r=Math.cos(s),n=Math.sin(s),a=r*e.a+n*e.b,o=r*e.c+n*e.d;return pt.atan2Deg(o,a)}copy(){const e=new Rl(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}}class hg{constructor(t,e=!1){x(this,"atlas");x(this,"allowMissingRegions");this.atlas=t,this.allowMissingRegions=e}findRegions(t,e,s){const r=s.regions;for(let n=0,a=r.length;n<a;n++)r[n]=this.findRegion(t,s.getPath(e,n))}findRegion(t,e){const s=this.atlas.findRegion(e);if(!s&&!this.allowMissingRegions)throw new Error(`Region not found in atlas: ${e} (attachment: ${t})`);return s}newRegionAttachment(t,e,s,r,n){return this.findRegions(s,r,n),new _r(s,n)}newMeshAttachment(t,e,s,r,n){return this.findRegions(s,r,n),new Vs(s,n)}newBoundingBoxAttachment(t,e,s){return new ro(s)}newPathAttachment(t,e,s){return new on(s)}newPointAttachment(t,e,s){return new Rl(s)}newClippingAttachment(t,e,s){return new zr(s)}}class Fl{constructor(t,e){x(this,"name");x(this,"setupPose");x(this,"skinRequired",!1);if(t==null)throw new Error("name cannot be null.");this.name=t,this.setupPose=e}}class io extends Fl{constructor(e,s,r){super(s,new ol);x(this,"index",0);x(this,"parent",null);x(this,"length",0);x(this,"color",new Ft);x(this,"icon");x(this,"iconSize",1);x(this,"iconRotation",0);x(this,"visible",!1);if(e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");this.index=e,this.parent=r}copy(e){const s=new io(this.index,this.name,e);return s.length=this.length,s.setupPose.set(this.setupPose),s}}var be;(function(i){i[i.Normal=0]="Normal",i[i.OnlyTranslation=1]="OnlyTranslation",i[i.NoRotationOrReflection=2]="NoRotationOrReflection",i[i.NoScale=3]="NoScale",i[i.NoScaleOrReflection=4]="NoScaleOrReflection"})(be||(be={}));class ol{constructor(){x(this,"bone");x(this,"x",0);x(this,"y",0);x(this,"rotation",0);x(this,"scaleX",0);x(this,"scaleY",0);x(this,"shearX",0);x(this,"shearY",0);x(this,"inherit",be.Normal);x(this,"a",0);x(this,"b",0);x(this,"c",0);x(this,"d",0);x(this,"worldY",0);x(this,"worldX",0);x(this,"world",0);x(this,"local",0)}set(t){if(t==null)throw new Error("pose cannot be null.");this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}setPosition(t,e){this.x=t,this.y=e}setScale(t,e){this.scaleX=t,this.scaleY=e===void 0?t:e}getInherit(){return this.inherit}setInherit(t){if(t==null)throw new Error("inherit cannot be null.");this.inherit=t}update(t,e){this.world!==t._update&&this.updateWorldTransform(t)}updateWorldTransform(t){this.local===t._update?this.updateLocalTransform(t):this.world=t._update;const e=this.rotation,s=this.scaleX,r=this.scaleY,n=this.shearX,a=this.shearY;if(!this.bone.parent){const d=t.scaleX,f=t.scaleY,m=(e+n)*pt.degRad,p=(e+90+a)*pt.degRad;this.a=Math.cos(m)*s*d,this.b=Math.cos(p)*r*d,this.c=Math.sin(m)*s*f,this.d=Math.sin(p)*r*f,this.worldX=this.x*d+t.x,this.worldY=this.y*f+t.y;return}const o=this.bone.parent.appliedPose;let h=o.a,l=o.b,c=o.c,u=o.d;switch(this.worldX=h*this.x+l*this.y+o.worldX,this.worldY=c*this.x+u*this.y+o.worldY,this.inherit){case be.Normal:{const d=(e+n)*pt.degRad,f=(e+90+a)*pt.degRad,m=Math.cos(d)*s,p=Math.cos(f)*r,g=Math.sin(d)*s,y=Math.sin(f)*r;this.a=h*m+l*g,this.b=h*p+l*y,this.c=c*m+u*g,this.d=c*p+u*y;return}case be.OnlyTranslation:{const d=t.scaleX,f=t.scaleY,m=(e+n)*pt.degRad,p=(e+90+a)*pt.degRad;this.a=Math.cos(m)*s*d,this.b=Math.cos(p)*r*d,this.c=Math.sin(m)*s*f,this.d=Math.sin(p)*r*f;break}case be.NoRotationOrReflection:{const d=t.scaleX,f=t.scaleY,m=1/d,p=1/f;h*=m,c*=p;let g=h*h+c*c,y=0;g>pt.epsilon2?(g=Math.abs(h*u*p-l*m*c)/g,l=c*g,u=h*g,y=e-pt.atan2Deg(c,h)):(h=0,c=0,y=e-90+pt.atan2Deg(u,l));const _=(y+n)*pt.degRad,v=(y+a+90)*pt.degRad,b=Math.cos(_)*s,T=Math.cos(v)*r,S=Math.sin(_)*s,w=Math.sin(v)*r;this.a=(h*b-l*S)*d,this.b=(h*T-l*w)*d,this.c=(c*b+u*S)*f,this.d=(c*T+u*w)*f;break}case be.NoScale:case be.NoScaleOrReflection:{const d=t.scaleX,f=t.scaleY,m=1/d,p=1/f,g=e*pt.degRad,y=Math.cos(g),_=Math.sin(g);let v=(h*y+l*_)*m,b=(c*y+u*_)*p;const T=1/Math.sqrt(v*v+b*b);v*=T,b*=T;let S=-b,w=v;this.inherit===be.NoScale&&h*u-l*c<0!=(d<0!=f<0)&&(S=-S,w=-w);const E=n*pt.degRad,A=(90+a)*pt.degRad,P=Math.cos(E)*s,I=Math.cos(A)*r,C=Math.sin(E)*s,R=Math.sin(A)*r;this.a=(v*P+S*C)*d,this.b=(v*I+S*R)*d,this.c=(b*P+w*C)*f,this.d=(b*I+w*R)*f;break}}}updateLocalTransform(t){this.local=0,this.world=t._update;const e=t.scaleX,s=t.scaleY;if(!this.bone.parent){const y=1/e,_=1/s;this.x=(this.worldX-t.x)*y,this.y=(this.worldY-t.y)*_,this.set5(this.a*y,this.b*y,this.c*_,this.d*_,0);return}const r=this.bone.parent.appliedPose;let n=r.a,a=r.b,o=r.c,h=r.d;const l=n*h-a*o,c=1/(n*h-a*o),u=h*c,d=a*c,f=o*c,m=n*c,p=this.worldX-r.worldX,g=this.worldY-r.worldY;switch(this.x=p*u-g*d,this.y=g*m-p*f,this.inherit){case be.Normal:this.set5(u*this.a-d*this.c,u*this.b-d*this.d,m*this.c-f*this.a,m*this.d-f*this.b,0);break;case be.OnlyTranslation:{const y=1/e,_=1/s;this.set5(this.a*y,this.b*y,this.c*_,this.d*_,0);break}case be.NoRotationOrReflection:{const y=1/e,_=1/s;n*=y,o*=_;const v=this.a*y,b=this.b*y,T=this.c*_,S=this.d*_,w=1/(n*n+o*o),E=1/Math.abs(l*y*_);this.set5((n*v+o*T)*w,(n*b+o*S)*w,(n*T-o*v)*E,(n*S-o*b)*E,pt.atan2Deg(o,n));break}case be.NoScale:case be.NoScaleOrReflection:{const y=1/e,_=1/s,v=this.a*y,b=this.b*y,T=this.c*_,S=this.d*_;let w=h*this.a-a*this.c,E=n*this.c-o*this.a;l<0&&(w=-w,E=-E);let A=pt.atan2Deg(E,w);this.rotation=A,A*=pt.degRad;const P=Math.cos(A),I=Math.sin(A);let C=(n*P+a*I)*y,R=(o*P+h*I)*_;const F=1/Math.sqrt(C*C+R*R);C*=F,R*=F;const D=this.inherit===be.NoScale&&l<0!=(e<0!=s<0)?-1:1;this.set4(C*v+R*T,C*b+R*S,(C*T-R*v)*D,(C*S-R*b)*D)}}}set4(t,e,s,r){const n=t*t+s*s,a=e*e+r*r;n>pt.epsilon2?(this.shearX=pt.atan2Deg(s,t),this.scaleX=Math.sqrt(n)):(this.shearX=0,this.scaleX=0),this.scaleY=Math.sqrt(a),a>pt.epsilon2?(this.shearY=pt.atan2Deg(r,e),t*r-e*s<0?(this.scaleY=-this.scaleY,this.shearY+=90):this.shearY-=90,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}set5(t,e,s,r,n){this.shearX=0;const a=t*t+s*s,o=e*e+r*r;if(a>pt.epsilon2){const h=pt.atan2Deg(s,t);this.rotation=h+n,this.scaleX=Math.sqrt(a),this.scaleY=Math.sqrt(o),o>pt.epsilon2?(this.shearY=pt.atan2Deg(r,e),t*r-e*s<0?(this.scaleY=-this.scaleY,this.shearY+=90-h):this.shearY-=90+h,this.shearY>180?this.shearY-=360:this.shearY<=-180&&(this.shearY+=360)):this.shearY=0}else this.scaleX=0,this.scaleY=Math.sqrt(o),this.shearY=0,this.rotation=o>pt.epsilon2?pt.atan2Deg(r,e)-90+n:n}validateLocalTransform(t){this.local===t._update&&this.updateLocalTransform(t)}modifyLocal(t){this.local===t._update&&this.updateLocalTransform(t),this.world=0,this.resetWorld(t,t._update)}modifyWorld(t){const e=t._update;this.local=e,this.world=e,this.resetWorld(t,e)}resetWorld(t,e){const s=this.bone.children;for(let r=0,n=s.length;r<n;r++){const a=s[r].appliedPose;a.world===e&&(a.local===e&&a.updateLocalTransform(t),a.world=0,a.resetWorld(t,e))}}getWorldRotationX(){return pt.atan2Deg(this.c,this.a)}getWorldRotationY(){return pt.atan2Deg(this.d,this.b)}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(t){if(t==null)throw new Error("world cannot be null.");const e=this.a*this.d-this.b*this.c,s=t.x-this.worldX,r=t.y-this.worldY;return t.x=(s*this.d-r*this.b)/e,t.y=(r*this.a-s*this.c)/e,t}localToWorld(t){if(t==null)throw new Error("local cannot be null.");const e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(t==null)throw new Error("world cannot be null.");return this.bone.parent==null?t:this.bone.parent.appliedPose.worldToLocal(t)}parentToWorld(t){if(t==null)throw new Error("world cannot be null.");return this.bone.parent==null?t:this.bone.parent.appliedPose.localToWorld(t)}worldToLocalRotation(t){t*=pt.degRad;const e=Math.sin(t),s=Math.cos(t);return pt.atan2Deg(this.a*e-this.c*s,this.d*s-this.b*e)+this.rotation-this.shearX}localToWorldRotation(t){t=(t-this.rotation-this.shearX)*pt.degRad;const e=Math.sin(t),s=Math.cos(t);return pt.atan2Deg(s*this.c+e*this.d,s*this.a+e*this.b)}rotateWorld(t){t*=pt.degRad;const e=Math.sin(t),s=Math.cos(t),r=this.a,n=this.b;this.a=s*r-e*this.c,this.b=s*n-e*this.d,this.c=e*r+s*this.c,this.d=e*n+s*this.d}}class Lu{constructor(t,e,s){x(this,"data");x(this,"pose");x(this,"constrainedPose");x(this,"appliedPose");if(t==null)throw new Error("data cannot be null.");this.data=t,this.pose=e,this.constrainedPose=s,this.appliedPose=e}setupPose(){this.pose.set(this.data.setupPose)}getData(){return this.data}getPose(){return this.pose}getAppliedPose(){return this.appliedPose}unconstrained(){this.appliedPose=this.pose}constrained(){this.appliedPose=this.constrainedPose}resetConstrained(){this.constrainedPose.set(this.pose)}}class Bu extends Lu{constructor(e,s,r){super(e,s,r);x(this,"active",!1);this.setupPose()}isActive(){return this.active}}class Gn extends Bu{constructor(e,s){super(e,new ol,new ol);x(this,"parent",null);x(this,"children",[]);x(this,"sorted",!1);this.parent=s,this.appliedPose.bone=this,this.constrainedPose.bone=this}copy(e){const s=new Gn(this.data,e);return s.pose.set(this.pose),s}}class ta extends Bu{constructor(t,e,s){super(t,e,s)}isSourceActive(){return!0}}class cg{constructor(t){x(this,"_setupPose");x(this,"pose");x(this,"constrainedPose");x(this,"appliedPose");this._setupPose=t,this.pose=[...t],this.constrainedPose=[],this.appliedPose=this.pose}setupPose(){this.pose.length=this._setupPose.length,bt.arrayCopy(this._setupPose,0,this.pose,0,this._setupPose.length)}unconstrained(){this.appliedPose=this.pose}constrained(){this.appliedPose=this.constrainedPose}resetConstrained(){this.constrainedPose.length=this.pose.length,bt.arrayCopy(this.pose,0,this.constrainedPose,0,this.pose.length)}}class ea extends Fl{constructor(t,e){super(t,e)}}var es;(function(i){i[i.None=0]="None",i[i.Uniform=1]="Uniform",i[i.Volume=2]="Volume"})(es||(es={}));let kl=class{constructor(t,e){x(this,"time",0);x(this,"data");x(this,"intValue",0);x(this,"floatValue",0);x(this,"stringValue",null);x(this,"volume",0);x(this,"balance",0);if(!e)throw new Error("data cannot be null.");this.time=t,this.data=e}};class Ou{constructor(t){x(this,"name");x(this,"_audioPath",null);x(this,"setupPose",new kl(-1,this));this.name=t}get audioPath(){return this._audioPath}set audioPath(t){if(t==null)throw new Error("audioPath cannot be null.");this._audioPath=t}}class ll{constructor(){x(this,"bendDirection",0);x(this,"compress",!1);x(this,"stretch",!1);x(this,"mix",0);x(this,"softness",0)}set(t){this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}}class Ur extends ta{constructor(e,s){super(e,new ll,new ll);x(this,"bones");x(this,"target");if(!s)throw new Error("skeleton cannot be null.");this.bones=[];for(const r of e.bones)this.bones.push(s.bones[r.index].constrainedPose);this.target=s.bones[e.target.index]}copy(e){var s=new Ur(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.appliedPose;if(r.mix===0)return;const n=this.target.appliedPose,a=this.bones;switch(a.length){case 1:Ur.apply(e,a[0],n.worldX,n.worldY,r.compress,r.stretch,this.data.scaleYMode,r.mix);break;case 2:Ur.apply(e,a[0],a[1],n.worldX,n.worldY,r.bendDirection,r.stretch,this.data.scaleYMode,r.softness,r.mix);break}}sort(e){e.sortBone(this.target);const s=this.bones[0].bone;e.sortBone(s),e._updateCache.push(this),s.sorted=!1,e.sortReset(s.children),e.constrained(s),this.bones.length>1&&e.constrained(this.bones[1].bone)}isSourceActive(){return this.target.active}static apply(e,s,r,n,a,o,h,l,c,u){typeof r=="number"?Ur.apply1(e,s,r,n,a,o,h,l):Ur.apply2(e,s,r,n,a,o,h,l,c,u)}static apply1(e,s,r,n,a,o,h,l){s.modifyLocal(e);const c=s.bone.parent.appliedPose;let u=c.a,d=c.b,f=c.c,m=c.d,p=-s.shearX-s.rotation,g=0,y=0;switch(s.inherit){case be.OnlyTranslation:g=(r-s.worldX)*pt.signum(e.scaleX),y=(n-s.worldY)*pt.signum(e.scaleY);break;case be.NoRotationOrReflection:{const _=Math.abs(u*m-d*f)/Math.max(pt.epsilon,u*u+f*f),v=u/e.scaleX,b=f/e.scaleY;d=-b*_*e.scaleX,m=v*_*e.scaleY,p+=pt.atan2Deg(b,v)}default:{const _=r-c.worldX,v=n-c.worldY,b=u*m-d*f;Math.abs(b)<=pt.epsilon?(g=0,y=0):(g=(_*m-v*d)/b-s.x,y=(v*u-_*f)/b-s.y)}}if(p+=pt.atan2Deg(y,g),s.scaleX<0&&(p+=180),p>180?p-=360:p<=-180&&(p+=360),s.rotation+=p*l,a||o){switch(s.inherit){case be.NoScale:case be.NoScaleOrReflection:g=r-s.worldX,y=n-s.worldY}const _=s.bone.data.length*s.scaleX;if(_>pt.epsilon){const v=g*g+y*y;if(a&&v<_*_||o&&v>_*_){const b=(Math.sqrt(v)/_-1)*l+1;switch(s.scaleX*=b,h){case es.Uniform:s.scaleY*=b;break;case es.Volume:s.scaleY/=b<.7?.25+.642857*b:b}}}}}static apply2(e,s,r,n,a,o,h,l,c,u){if(s.inherit!==be.Normal||r.inherit!==be.Normal)return;s.modifyLocal(e),r.modifyLocal(e);let d=s.x,f=s.y,m=s.scaleX,p=s.scaleY,g=r.scaleX,y=0,_=0,v=0;m<0?(m=-m,y=180,v=-1):(y=0,v=1),p<0&&(p=-p,v=-v),g<0?(g=-g,_=180):_=0;let b=0,T=0,S=s.a,w=s.b,E=s.c,A=s.d;const P=Math.abs(m-p)<=pt.epsilon;!P||h?(r.y=0,b=S*r.x+s.worldX,T=E*r.x+s.worldY):(b=S*r.x+w*r.y+s.worldX,T=E*r.x+A*r.y+s.worldY);const I=s.bone.parent.appliedPose;S=I.a,w=I.b,E=I.c,A=I.d;let C=S*A-w*E,R=b-I.worldX,F=T-I.worldY;C=Math.abs(C)<=pt.epsilon?0:1/C;const D=(R*A-F*w)*C-d,M=(F*S-R*E)*C-f;let O=Math.sqrt(D*D+M*M),k=r.bone.data.length*g,N,B;if(O<pt.epsilon){Ur.apply(e,s,n,a,!1,h,es.None,u),r.rotation=0;return}R=n-I.worldX,F=a-I.worldY;let L=(R*A-F*w)*C-d,G=(F*S-R*E)*C-f,V=L*L+G*G;if(c!==0){c*=m*(g+1)*.5;const H=Math.sqrt(V),at=H-O-k*m+c;if(at>0){let et=Math.min(1,at/(c*2))-1;et=(at-c*(1-et*et))/H,L-=et*L,G-=et*G,V=L*L+G*G}}t:if(P){k*=m;let H=(V-O*O-k*k)/(2*O*k);if(H<-1)H=-1,B=Math.PI*o;else if(H>1){if(H=1,B=0,h)switch(S=(Math.sqrt(V)/(O+k)-1)*u+1,s.scaleX*=S,l){case es.Uniform:s.scaleY*=S;break;case es.Volume:s.scaleY/=S<.7?.25+.642857*S:S}}else B=Math.acos(H)*o;S=O+k*H,w=k*Math.sin(B),N=Math.atan2(G*S-L*w,L*S+G*w)}else{S=m*k,w=p*k;const H=S*S,at=w*w,et=Math.atan2(G,L);E=at*O*O+H*V-H*at;const ot=-2*at*O,ct=at-H;if(A=ot*ot-4*ct*E,A>=0){let U=Math.sqrt(A);ot<0&&(U=-U),U=-(ot+U)*.5;let Y=U/ct,W=E/U;const j=Math.abs(Y)<Math.abs(W)?Y:W;if(Y=V-j*j,Y>=0){F=Math.sqrt(Y)*o,N=et-Math.atan2(F,j),B=Math.atan2(F/p,(j-O)/m);break t}}let rt=pt.PI,dt=O-S,X=dt*dt,$=0,K=0,J=O+S,Q=J*J,it=0;E=-S*O/(H-at),E>=-1&&E<=1&&(E=Math.acos(E),R=S*Math.cos(E)+O,F=w*Math.sin(E),A=R*R+F*F,A<X&&(rt=E,X=A,dt=R,$=F),A>Q&&(K=E,Q=A,J=R,it=F)),V<=(X+Q)*.5?(N=et-Math.atan2($*o,dt),B=rt*o):(N=et-Math.atan2(it*o,J),B=K*o)}const q=Math.atan2(r.y,r.x)*v;N=(N-q)*pt.radDeg+y-s.rotation,N>180?N-=360:N<=-180&&(N+=360),s.rotation+=N*u,B=((B+q)*pt.radDeg-r.shearX)*v+_-r.rotation,B>180?B-=360:B<=-180&&(B+=360),r.rotation+=B*u}}class Ba extends ea{constructor(e){super(e,new ll);x(this,"bones",[]);x(this,"_target",null);x(this,"_scaleYMode",es.None)}set target(e){this._target=e}get target(){if(!this._target)throw new Error("target cannot be null.");return this._target}set scaleYMode(e){this._scaleYMode=e}get scaleYMode(){if(this._scaleYMode==null)throw new Error("scaleYMode cannot be null.");return this._scaleYMode}create(e){return new Ur(this,e)}}class hl{constructor(){x(this,"position",0);x(this,"spacing",0);x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0)}set(t){this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}}class Oa extends ea{constructor(e){super(e,new hl);x(this,"bones",[]);x(this,"_slot",null);x(this,"positionMode",Qs.Fixed);x(this,"spacingMode",ke.Fixed);x(this,"rotateMode",Ti.Chain);x(this,"offsetRotation",0)}set slot(e){this._slot=e}get slot(){if(this._slot)return this._slot;throw new Error("SlotData not set.")}create(e){return new cl(this,e)}}var Qs;(function(i){i[i.Fixed=0]="Fixed",i[i.Percent=1]="Percent"})(Qs||(Qs={}));var ke;(function(i){i[i.Length=0]="Length",i[i.Fixed=1]="Fixed",i[i.Percent=2]="Percent",i[i.Proportional=3]="Proportional"})(ke||(ke={}));var Ti;(function(i){i[i.Tangent=0]="Tangent",i[i.Chain=1]="Chain",i[i.ChainScale=2]="ChainScale"})(Ti||(Ti={}));const lr=class lr extends ta{constructor(e,s){super(e,new hl,new hl);x(this,"data");x(this,"bones");x(this,"slot");x(this,"spaces",[]);x(this,"positions",[]);x(this,"world",[]);x(this,"curves",[]);x(this,"lengths",[]);x(this,"segments",[]);if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.bones=[];for(const r of this.data.bones)this.bones.push(s.bones[r.index].constrainedPose);this.slot=s.slots[e.slot.index]}copy(e){var s=new lr(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.slot.appliedPose.attachment;if(!(r instanceof on))return;const n=this.appliedPose,a=n.mixRotate,o=n.mixX,h=n.mixY;if(a===0&&o===0&&h===0)return;const l=this.data,c=l.rotateMode===Ti.Tangent,u=l.rotateMode===Ti.ChainScale,d=this.bones,f=d.length,m=c?f:f+1,p=bt.setArraySize(this.spaces,m),g=u?this.lengths=bt.setArraySize(this.lengths,f):[],y=n.spacing;switch(l.spacingMode){case ke.Percent:if(u)for(let w=0,E=m-1;w<E;w++){const A=d[w],P=A.bone.data.length,I=P*A.a,C=P*A.c;g[w]=Math.sqrt(I*I+C*C)}bt.arrayFill(p,1,m,y);break;case ke.Proportional:{let w=0;for(let E=0,A=m-1;E<A;){const P=d[E],I=P.bone.data.length;if(I<pt.epsilon)u&&(g[E]=0),p[++E]=y;else{const C=I*P.a,R=I*P.c,F=Math.sqrt(C*C+R*R);u&&(g[E]=F),p[++E]=F,w+=F}}if(w>0){w=m/w*y;for(let E=1;E<m;E++)p[E]*=w}break}default:{const w=l.spacingMode===ke.Length;for(let E=0,A=m-1;E<A;){const P=d[E],I=P.bone.data.length;if(I<pt.epsilon)u&&(g[E]=0),p[++E]=y;else{const C=I*P.a,R=I*P.c,F=Math.sqrt(C*C+R*R);u&&(g[E]=F),p[++E]=(w?Math.max(0,I+y):y)*F/I}}}}const _=this.computeWorldPositions(e,r,m,c);let v=_[0],b=_[1],T=l.offsetRotation,S=!1;if(T===0)S=l.rotateMode===Ti.Chain;else{S=!1;const w=this.slot.bone.appliedPose;T*=w.a*w.d-w.b*w.c>0?pt.degRad:-pt.degRad}for(let w=0,E=3;w<f;w++,E+=3){const A=d[w];A.modifyWorld(e),A.worldX+=(v-A.worldX)*o,A.worldY+=(b-A.worldY)*h;const P=_[E],I=_[E+1],C=P-v,R=I-b;if(u){const F=g[w];if(F!==0){const D=(Math.sqrt(C*C+R*R)/F-1)*a+1;A.a*=D,A.c*=D}}if(v=P,b=I,a>0){let F=A.a,D=A.b,M=A.c,O=A.d,k=0,N=0,B=0;if(c?k=_[E-1]:p[w+1]===0?k=_[E+2]:k=Math.atan2(R,C),k-=Math.atan2(M,F),S){N=Math.cos(k),B=Math.sin(k);const L=A.bone.data.length;v+=(L*(N*F-B*M)-C)*a,b+=(L*(B*F+N*M)-R)*a}else k+=T;k>pt.PI?k-=pt.PI2:k<-pt.PI&&(k+=pt.PI2),k*=a,N=Math.cos(k),B=Math.sin(k),A.a=N*F-B*M,A.b=N*D-B*O,A.c=B*F+N*M,A.d=B*D+N*O}}}computeWorldPositions(e,s,r,n){const a=this.slot;let o=this.appliedPose.position,h=this.spaces,l=bt.setArraySize(this.positions,r*3+2),c=this.world;const u=s.closed;let d=s.worldVerticesLength,f=d/6,m=lr.NONE;if(!s.constantSpeed){const B=s.lengths;f-=u?1:2;const L=B[f];this.data.positionMode===Qs.Percent&&(o*=L);let G;switch(this.data.spacingMode){case ke.Percent:G=L;break;case ke.Proportional:G=L/r;break;default:G=1}c=bt.setArraySize(this.world,8);for(let V=0,q=0,H=0;V<r;V++,q+=3){const at=h[V]*G;o+=at;let et=o;if(u)et%=L,et<0&&(et+=L),H=0;else if(et<0){m!==lr.BEFORE&&(m=lr.BEFORE,s.computeWorldVertices(e,a,2,4,c,0,2)),this.addBeforePosition(et,c,0,l,q);continue}else if(et>L){m!==lr.AFTER&&(m=lr.AFTER,s.computeWorldVertices(e,a,d-6,4,c,0,2)),this.addAfterPosition(et-L,c,0,l,q);continue}for(;;H++){const ot=B[H];if(!(et>ot)){if(H===0)et/=ot;else{const ct=B[H-1];et=(et-ct)/(ot-ct)}break}}H!==m&&(m=H,u&&H===f?(s.computeWorldVertices(e,a,d-4,4,c,0,2),s.computeWorldVertices(e,a,0,4,c,4,2)):s.computeWorldVertices(e,a,H*6+2,8,c,0,2)),this.addCurvePosition(et,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],l,q,n||V>0&&at===0)}return l}u?(d+=2,c=bt.setArraySize(this.world,d),s.computeWorldVertices(e,a,2,d-4,c,0,2),s.computeWorldVertices(e,a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(f--,d-=4,c=bt.setArraySize(this.world,d),s.computeWorldVertices(e,a,2,d,c,0,2));const p=bt.setArraySize(this.curves,f);let g=0,y=c[0],_=c[1],v=0,b=0,T=0,S=0,w=0,E=0,A=0,P=0,I=0,C=0,R=0,F=0,D=0,M=0;for(let B=0,L=2;B<f;B++,L+=6)v=c[L],b=c[L+1],T=c[L+2],S=c[L+3],w=c[L+4],E=c[L+5],A=(y-v*2+T)*.1875,P=(_-b*2+S)*.1875,I=((v-T)*3-y+w)*.09375,C=((b-S)*3-_+E)*.09375,R=A*2+I,F=P*2+C,D=(v-y)*.75+A+I*.16666667,M=(b-_)*.75+P+C*.16666667,g+=Math.sqrt(D*D+M*M),D+=R,M+=F,R+=I,F+=C,g+=Math.sqrt(D*D+M*M),D+=R,M+=F,g+=Math.sqrt(D*D+M*M),D+=R+I,M+=F+C,g+=Math.sqrt(D*D+M*M),p[B]=g,y=w,_=E;this.data.positionMode===Qs.Percent&&(o*=g);let O;switch(this.data.spacingMode){case ke.Percent:O=g;break;case ke.Proportional:O=g/r;break;default:O=1}const k=this.segments;let N=0;for(let B=0,L=0,G=0,V=0;B<r;B++,L+=3){const q=h[B]*O;o+=q;let H=o;if(u)H%=g,H<0&&(H+=g),G=0,V=0;else if(H<0){this.addBeforePosition(H,c,0,l,L);continue}else if(H>g){this.addAfterPosition(H-g,c,d-4,l,L);continue}for(;;G++){const at=p[G];if(!(H>at)){if(G===0)H/=at;else{const et=p[G-1];H=(H-et)/(at-et)}break}}if(G!==m){m=G;let at=G*6;for(y=c[at],_=c[at+1],v=c[at+2],b=c[at+3],T=c[at+4],S=c[at+5],w=c[at+6],E=c[at+7],A=(y-v*2+T)*.03,P=(_-b*2+S)*.03,I=((v-T)*3-y+w)*.006,C=((b-S)*3-_+E)*.006,R=A*2+I,F=P*2+C,D=(v-y)*.3+A+I*.16666667,M=(b-_)*.3+P+C*.16666667,N=Math.sqrt(D*D+M*M),k[0]=N,at=1;at<8;at++)D+=R,M+=F,R+=I,F+=C,N+=Math.sqrt(D*D+M*M),k[at]=N;D+=R,M+=F,N+=Math.sqrt(D*D+M*M),k[8]=N,D+=R+I,M+=F+C,N+=Math.sqrt(D*D+M*M),k[9]=N,V=0}for(H*=N;;V++){const at=k[V];if(!(H>at)){if(V===0)H/=at;else{const et=k[V-1];H=V+(H-et)/(at-et)}break}}this.addCurvePosition(H*.1,y,_,v,b,T,S,w,E,l,L,n||B>0&&q===0)}return l}addBeforePosition(e,s,r,n,a){const o=s[r],h=s[r+1],l=s[r+2]-o,c=s[r+3]-h,u=Math.atan2(c,l);n[a]=o+e*Math.cos(u),n[a+1]=h+e*Math.sin(u),n[a+2]=u}addAfterPosition(e,s,r,n,a){const o=s[r+2],h=s[r+3],l=o-s[r],c=h-s[r+1],u=Math.atan2(c,l);n[a]=o+e*Math.cos(u),n[a+1]=h+e*Math.sin(u),n[a+2]=u}addCurvePosition(e,s,r,n,a,o,h,l,c,u,d,f){if(e===0||Number.isNaN(e)){u[d]=s,u[d+1]=r,u[d+2]=Math.atan2(a-r,n-s);return}const m=e*e,p=m*e,g=1-e,y=g*g,_=y*g,v=g*e,b=v*3,T=g*b,S=b*e,w=s*_+n*T+o*S+l*p,E=r*_+a*T+h*S+c*p;u[d]=w,u[d+1]=E,f&&(e<.001?u[d+2]=Math.atan2(a-r,n-s):u[d+2]=Math.atan2(E-(r*y+a*v*2+h*m),w-(s*y+n*v*2+o*m)))}sort(e){const s=this.slot.data.index,r=this.slot.bone;e.skin!=null&&this.sortPathSlot(e,e.skin,s,r),e.data.defaultSkin!=null&&e.data.defaultSkin!==e.skin&&this.sortPathSlot(e,e.data.defaultSkin,s,r),this.sortPath(e,this.slot.pose.attachment,r);const n=this.bones,a=this.bones.length;for(let o=0;o<a;o++){const h=n[o].bone;e.sortBone(h),e.constrained(h)}e._updateCache.push(this);for(let o=0;o<a;o++)e.sortReset(n[o].bone.children);for(let o=0;o<a;o++)n[o].bone.sorted=!0}sortPathSlot(e,s,r,n){const a=s.getAttachments();for(let o=0,h=a.length;o<h;o++){const l=a[o];l.slotIndex===r&&this.sortPath(e,l.attachment,n)}}sortPath(e,s,r){if(!(s instanceof on))return;const n=s.bones;if(n==null)e.sortBone(r);else{const a=e.bones;for(let o=0,h=n.length;o<h;){let l=n[o++];for(l+=o;o<l;)e.sortBone(a[n[o++]])}}}isSourceActive(){return this.slot.bone.active}};x(lr,"NONE",-1),x(lr,"BEFORE",-2),x(lr,"AFTER",-3);let cl=lr;var Os;(function(i){i[i.none=0]="none",i[i.reset=1]="reset",i[i.update=2]="update",i[i.pose=3]="pose"})(Os||(Os={}));class ul{constructor(){x(this,"inertia",0);x(this,"strength",0);x(this,"damping",0);x(this,"massInverse",0);x(this,"wind",0);x(this,"gravity",0);x(this,"mix",0)}set(t){this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}}class dl{constructor(){x(this,"color",new Ft(1,1,1,1));x(this,"darkColor",null);x(this,"attachment",null);x(this,"sequenceIndex",0);x(this,"deform",[])}SlotPose(){}set(t){if(t==null)throw new Error("pose cannot be null.");this.color.setFromColor(t.color),this.darkColor!=null&&t.darkColor!=null&&this.darkColor.setFromColor(t.darkColor),this.attachment=t.attachment,this.sequenceIndex=t.sequenceIndex,this.deform.length=0,this.deform.push(...t.deform)}getAttachment(){return this.attachment}setAttachment(t){this.attachment!==t&&((!(t instanceof vr)||!(this.attachment instanceof vr)||t.timelineAttachment!==this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}}class Ll extends Lu{constructor(e,s){super(e,new dl,new dl);x(this,"skeleton");x(this,"bone");x(this,"attachmentState",0);if(!s)throw new Error("skeleton cannot be null.");this.skeleton=s,this.bone=s.bones[e.boneData.index],e.setupPose.darkColor!=null&&(this.pose.darkColor=new Ft,this.constrainedPose.darkColor=new Ft),this.setupPose()}copy(e,s,r){const n=new Ll(e.data,this.skeleton);return this.data.setupPose.darkColor!=null&&(n.pose.darkColor=new Ft,n.constrainedPose.darkColor=new Ft),n.pose.set(e.pose),n}setupPose(){this.pose.color.setFromColor(this.data.setupPose.color),this.pose.darkColor&&this.pose.darkColor.setFromColor(this.data.setupPose.darkColor),this.pose.sequenceIndex=this.data.setupPose.sequenceIndex,this.data.attachmentName?(this.pose.attachment=null,this.pose.setAttachment(this.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.pose.setAttachment(null)}}const Fn=class Fn{constructor(t){x(this,"data");x(this,"bones");x(this,"slots");x(this,"drawOrder");x(this,"constraints");x(this,"physics");x(this,"_updateCache",[]);x(this,"resetCache",[]);x(this,"skin",null);x(this,"color");x(this,"scaleX",1);x(this,"_scaleY",1);x(this,"x",0);x(this,"y",0);x(this,"time",0);x(this,"windX",1);x(this,"windY",0);x(this,"gravityX",0);x(this,"gravityY",1);x(this,"_update",0);if(!t)throw new Error("data cannot be null.");this.data=t,this.bones=[];for(let e=0;e<t.bones.length;e++){const s=t.bones[e];let r;if(!s.parent)r=new Gn(s,null);else{const n=this.bones[s.parent.index];r=new Gn(s,n),n.children.push(r)}this.bones.push(r)}this.slots=[];for(const e of this.data.slots)this.slots.push(new Ll(e,this));this.drawOrder=new cg(this.slots),this.physics=[],this.constraints=[];for(const e of this.data.constraints){const s=e.create(this);s instanceof no&&this.physics.push(s),this.constraints.push(s)}this.color=new Ft(1,1,1,1),this.updateCache()}static get yDir(){return Fn.yDown?-1:1}get scaleY(){return this._scaleY*Fn.yDir}set scaleY(t){this._scaleY=t}updateCache(){this._updateCache.length=0,this.resetCache.length=0,this.drawOrder.unconstrained();const t=this.slots;for(let a=0,o=t.length;a<o;a++)t[a].unconstrained();const e=this.bones,s=e.length;for(let a=0,o=s;a<o;a++){const h=e[a];h.sorted=h.data.skinRequired,h.active=!h.sorted,h.unconstrained()}if(this.skin){const a=this.skin.bones;for(let o=0,h=this.skin.bones.length;o<h;o++){let l=this.bones[a[o].index];do l.sorted=!1,l.active=!0,l=l.parent;while(l)}}const r=this.constraints;let n=this.constraints.length;for(let a=0;a<n;a++)r[a].unconstrained();for(let a=0;a<n;a++){const o=r[a];o.active=o.isSourceActive()&&(!o.data.skinRequired||this.skin!=null&&this.skin.constraints.includes(o.data)),o.active&&o.sort(this)}for(let a=0;a<s;a++)this.sortBone(e[a]);n=this._updateCache.length;for(let a=0;a<n;a++){const o=this._updateCache[a];o instanceof Gn&&(this._updateCache[a]=o.appliedPose)}}constrained(t){t.pose===t.appliedPose&&(t.constrained(),this.resetCache.push(t))}sortBone(t){if(t.sorted||!t.active)return;const e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,s=t.length;e<s;e++){const r=t[e];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}}updateWorldTransform(t){this._update++,this.drawOrder.appliedPose===this.drawOrder.constrainedPose&&this.drawOrder.resetConstrained();const e=this.resetCache;for(let r=0,n=this.resetCache.length;r<n;r++)e[r].resetConstrained();const s=this._updateCache;for(let r=0,n=this._updateCache.length;r<n;r++)s[r].update(this,t)}setupPose(){this.setupPoseBones(),this.setupPoseSlots()}setupPoseBones(){const t=this.bones;for(let s=0,r=t.length;s<r;s++)t[s].setupPose();const e=this.constraints;for(let s=0,r=e.length;s<r;s++)e[s].setupPose()}setupPoseSlots(){this.drawOrder.setupPose();const t=this.slots;for(let e=0,s=t.length;e<s;e++)t[e].setupPose()}getRootBone(){return this.bones.length===0?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");const e=this.bones;for(let s=0,r=e.length;s<r;s++)if(e[s].data.name===t)return e[s];return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");const e=this.slots;for(let s=0,r=e.length;s<r;s++)if(e[s].data.name===t)return e[s];return null}setSkin(t){typeof t=="string"?this.setSkinByName(t):this.setSkinBySkin(t)}setSkinByName(t){const e=this.data.findSkin(t);if(!e)throw new Error(`Skin not found: ${t}`);this.setSkin(e)}setSkinBySkin(t){if(t!==this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{const e=this.slots;for(let s=0,r=e.length;s<r;s++){const n=e[s],a=n.data.attachmentName;if(a){const o=t.getAttachment(s,a);o&&n.pose.setAttachment(o)}}}this.skin=t,this.updateCache()}}getAttachment(t,e){return typeof t=="string"?this.getAttachmentByName(t,e):this.getAttachmentByIndex(t,e)}getAttachmentByName(t,e){const s=this.data.findSlot(t);if(!s)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(s.index,e)}getAttachmentByIndex(t,e){if(!e)throw new Error("placeholder cannot be null.");if(this.skin){const s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");const s=this.findSlot(t);if(!s)throw new Error(`Slot not found: ${t}`);let r=null;if(e&&(r=this.getAttachment(s.data.index,e),!r))throw new Error(`Attachment not found: ${e}, for slot: ${t}`);s.pose.setAttachment(r)}findConstraint(t,e){if(t==null)throw new Error("constraintName cannot be null.");if(e==null)throw new Error("type cannot be null.");const s=this.constraints;for(let r=0,n=s.length;r<n;r++){const a=s[r];if(a instanceof e&&a.data.name===t)return a}return null}getBoundsRect(t){const e=new il,s=new il;return this.getBounds(e,s,void 0,t),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(t,e,s=new Array(2),r=null){if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");const n=this.drawOrder.appliedPose,a=n;let o=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let u=0,d=n.length;u<d;u++){const f=a[u];if(!f.bone.active)continue;let m=0,p=null,g=null;const y=f.appliedPose.attachment;if(y){if(y instanceof _r)m=8,p=bt.setArraySize(s,m,0),y.computeWorldVertices(f,y.getOffsets(f.appliedPose),p,0,2),g=Fn.quadTriangles;else if(y instanceof Vs)m=y.worldVerticesLength,p=bt.setArraySize(s,m,0),y.computeWorldVertices(this,f,0,m,p,0,2),g=y.triangles;else if(y instanceof zr&&r){r.clipEnd(f),r.clipStart(this,f,y);continue}if(p&&g){r!=null&&r.isClipping()&&r.clipTriangles(p,g,g.length)&&(p=r.clippedVertices,m=r.clippedVertices.length);for(let _=0,v=p.length;_<v;_+=2){const b=p[_],T=p[_+1];o=Math.min(o,b),h=Math.min(h,T),l=Math.max(l,b),c=Math.max(c,T)}}}r&&r.clipEnd(f)}r&&r.clipEnd(),t.set(o,h),e.set(l-o,c-h)}setScale(t,e){this.scaleX=t,this.scaleY=e}setPosition(t,e){this.x=t,this.y=e}update(t){this.time+=t}physicsTranslate(t,e){const s=this.physics;for(let r=0,n=s.length;r<n;r++)s[r].translate(t,e)}physicsRotate(t,e,s){const r=this.physics;for(let n=0,a=r.length;n<a;n++)r[n].rotate(t,e,s)}};x(Fn,"quadTriangles",[0,1,2,2,3,0]),x(Fn,"yDown",!1);let Mi=Fn;class no extends ta{constructor(e,s){super(e,new ul,new ul);x(this,"bone");x(this,"_reset",!0);x(this,"ux",0);x(this,"uy",0);x(this,"cx",0);x(this,"cy",0);x(this,"tx",0);x(this,"ty",0);x(this,"xOffset",0);x(this,"xLag",0);x(this,"xVelocity",0);x(this,"yOffset",0);x(this,"yLag",0);x(this,"yVelocity",0);x(this,"rotateOffset",0);x(this,"rotateLag",0);x(this,"rotateVelocity",0);x(this,"scaleOffset",0);x(this,"scaleLag",0);x(this,"scaleVelocity",0);x(this,"remaining",0);x(this,"lastTime",0);if(s==null)throw new Error("skeleton cannot be null.");this.bone=s.bones[e.bone.index].constrainedPose}copy(e){var s=new no(this.data,e);return s.pose.set(this.pose),s}reset(e){this.remaining=0,this.lastTime=e.time,this._reset=!0,this.xOffset=0,this.xLag=0,this.xVelocity=0,this.yOffset=0,this.yLag=0,this.yVelocity=0,this.rotateOffset=0,this.rotateLag=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleLag=0,this.scaleVelocity=0}translate(e,s){this.ux-=e,this.uy-=s,this.cx-=e,this.cy-=s}rotate(e,s,r){const n=r*pt.degRad,a=Math.cos(n),o=Math.sin(n),h=this.cx-e,l=this.cy-s;this.translate(h*a-l*o-h,h*o+l*a-l)}update(e,s){const r=this.appliedPose,n=r.mix;if(n===0)return;const a=this.data.x>0,o=this.data.y>0,h=this.data.rotate>0||this.data.shearX>0,l=this.data.scaleX>0,c=this.bone;let u=c.bone.data.length,d=this.data.step,f=0;if(s!==Os.none){switch(c.modifyWorld(e),s){case Os.reset:this.reset(e);case Os.update:{const m=Math.max(e.time-this.lastTime,0),p=this.remaining;this.remaining+=m,this.lastTime=e.time;const g=c.worldX,y=c.worldY;if(this._reset)this._reset=!1,this.ux=g,this.uy=y;else{let _=this.remaining,v=r.inertia,b=e.data.referenceScale,T=-1,S=0,w=0,E=this.data.limit*m,A=E*Math.abs(e.scaleY);if(E*=Math.abs(e.scaleX),a||o){if(a){const P=(this.ux-g)*v;this.xOffset+=P>E?E:P<-E?-E:P,this.ux=g}if(o){const P=(this.uy-y)*v;this.yOffset+=P>A?A:P<-A?-A:P,this.uy=y}if(_>=d){const P=this.xOffset,I=this.yOffset;T=r.damping**(60*d),S=d*r.massInverse,w=r.strength;const C=b*r.wind,R=b*r.gravity,F=(C*e.windX+R*e.gravityX)*e.scaleX,D=(C*e.windY+R*e.gravityY)*e.scaleY;do a&&(this.xVelocity+=(F-this.xOffset*w)*S,this.xOffset+=this.xVelocity*d,this.xVelocity*=T),o&&(this.yVelocity-=(D+this.yOffset*w)*S,this.yOffset+=this.yVelocity*d,this.yVelocity*=T),_-=d;while(_>=d);this.xLag=this.xOffset-P,this.yLag=this.yOffset-I}f=Math.max(0,1-_/d),a&&(c.worldX+=(this.xOffset-this.xLag*f)*n*this.data.x),o&&(c.worldY+=(this.yOffset-this.yLag*f)*n*this.data.y)}if(h||l){let P=Math.atan2(c.c,c.a),I=0,C=0,R=0,F=this.cx-c.worldX,D=this.cy-c.worldY;if(F>E?F=E:F<-E&&(F=-E),D>A?D=A:D<-A&&(D=-A),_=this.remaining,h){R=(this.data.rotate+this.data.shearX)*n,f=this.rotateLag*Math.max(0,1-p/d);let M=Math.atan2(D+this.ty,F+this.tx)-P-(this.rotateOffset-f)*R;this.rotateOffset+=(M-Math.ceil(M*pt.invPI2-.5)*pt.PI2)*v,M=(this.rotateOffset-f)*R+P,I=Math.cos(M),C=Math.sin(M),l&&(M=u*c.getWorldScaleX(),M>0&&(this.scaleOffset+=(F*I+D*C)*v/M))}else{I=Math.cos(P),C=Math.sin(P);const M=u*c.getWorldScaleX()-this.scaleLag*Math.max(0,1-p/d);M>0&&(this.scaleOffset+=(F*I+D*C)*v/M)}if(_>=d){T===-1&&(T=r.damping**(60*d),S=d*r.massInverse,w=r.strength);const M=r.wind*e.windX+r.gravity*e.gravityX,O=(r.wind*e.windY+r.gravity*e.gravityY)*Mi.yDir,k=this.rotateOffset,N=this.scaleOffset,B=u/b;for(;;)if(_-=d,l&&(this.scaleVelocity+=(M*I-O*C-this.scaleOffset*w)*S,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=T),h){if(this.rotateVelocity-=((M*C+O*I)*B+this.rotateOffset*w)*S,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=T,_<d)break;const L=this.rotateOffset*R+P;I=Math.cos(L),C=Math.sin(L)}else if(_<d)break;this.rotateLag=this.rotateOffset-k,this.scaleLag=this.scaleOffset-N}f=Math.max(0,1-_/d)}this.remaining=_}this.cx=c.worldX,this.cy=c.worldY;break}case Os.pose:f=Math.max(0,1-this.remaining/d),a&&(c.worldX+=(this.xOffset-this.xLag*f)*n*this.data.x),o&&(c.worldY+=(this.yOffset-this.yLag*f)*n*this.data.y)}if(h){let m=(this.rotateOffset-this.rotateLag*f)*n,p=0,g=0,y=0;if(this.data.shearX>0){let _=0;this.data.rotate>0&&(_=m*this.data.rotate,p=Math.sin(_),g=Math.cos(_),y=c.b,c.b=g*y-p*c.d,c.d=p*y+g*c.d),_+=m*this.data.shearX,p=Math.sin(_),g=Math.cos(_),y=c.a,c.a=g*y-p*c.c,c.c=p*y+g*c.c}else m*=this.data.rotate,p=Math.sin(m),g=Math.cos(m),y=c.a,c.a=g*y-p*c.c,c.c=p*y+g*c.c,y=c.b,c.b=g*y-p*c.d,c.d=p*y+g*c.d}if(l){let m=1+(this.scaleOffset-this.scaleLag*f)*n*this.data.scaleX;switch(c.a*=m,c.c*=m,this.data.scaleYMode){case es.Uniform:c.b*=m,c.d*=m;break;case es.Volume:m=Math.abs(m),m=m>=.7?1/m:4-3.67347*m,c.b*=m,c.d*=m}}s!==Os.pose&&(this.tx=u*c.a,this.ty=u*c.c)}}sort(e){const s=this.bone.bone;e.sortBone(s),e._updateCache.push(this),e.sortReset(s.children),e.constrained(s)}isSourceActive(){return this.bone.bone.active}}class Da extends ea{constructor(e){super(e,new ul);x(this,"_bone",null);x(this,"x",0);x(this,"y",0);x(this,"rotate",0);x(this,"scaleX",0);x(this,"shearX",0);x(this,"limit",0);x(this,"step",0);x(this,"inertiaGlobal",!1);x(this,"strengthGlobal",!1);x(this,"dampingGlobal",!1);x(this,"massGlobal",!1);x(this,"windGlobal",!1);x(this,"gravityGlobal",!1);x(this,"mixGlobal",!1);x(this,"_scaleYMode",es.None)}set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}get scaleYMode(){return this._scaleYMode}set scaleYMode(e){if(e==null)throw new Error("scaleYMode cannot be null.");this._scaleYMode=e}create(e){return new no(this,e)}}typeof Math.fround>"u"&&(Math.fround=(i=>t=>(i[0]=t,i[0]))(new Float32Array(1)));class fl{constructor(){x(this,"time",0);x(this,"mix",0)}set(t){this.time=t.time,this.mix=t.mix}}const No=class No extends ta{constructor(e,s){super(e,new fl,new fl);x(this,"bone",null);if(!s)throw new Error("skeleton cannot be null.");e.bone!=null&&(this.bone=s.bones[e.bone.index])}copy(e){var s=new No(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.appliedPose;if(r.mix===0)return;const n=this.data,a=n.animation,o=this.bone;if(o!==null){if(!o.active)return;n.local&&o.appliedPose.validateLocalTransform(e),r.time=n.offset+(n.property.value(e,o.appliedPose,n.local,No.offsets)-n.property.offset)*n.scale,n.loop?r.time=a.duration+r.time%a.duration:r.time=Math.max(0,r.time)}const h=e.bones,l=a.bones;for(let c=0,u=a.bones.length;c<u;c++)h[l[c]].appliedPose.modifyLocal(e);a.apply(e,r.time,r.time,n.loop,null,r.mix,At.current,n.additive,!1,!0)}sort(e){const s=this.bone,r=this.data;s&&!r.local&&e.sortBone(s),e._updateCache.push(this);const n=e.bones,a=r.animation.bones;for(let d=0,f=r.animation.bones.length;d<f;d++){const m=n[a[d]];m.sorted=!1,e.sortReset(m.children),e.constrained(m)}const o=r.animation.timelines,h=e.slots,l=e.constraints,c=e.physics,u=e.physics.length;for(let d=0,f=r.animation.timelines.length;d<f;d++){const m=o[d];if(eg(m))e.constrained(h[m.slotIndex]);else if(m instanceof Wr||m instanceof an)e.drawOrder.constrained();else if(m instanceof Kr)if(m.constraintIndex===-1)for(let p=0;p<u;p++)e.constrained(c[p]);else e.constrained(l[m.constraintIndex]);else if(rg(m)){const p=m.constraintIndex;p!==-1&&e.constrained(l[p])}}}};x(No,"offsets",[0,0,0,0,0,0]);let ml=No;class yi extends ea{constructor(e){super(e,new fl);x(this,"animation");x(this,"additive",!1);x(this,"loop",!1);x(this,"bone",null);x(this,"property");x(this,"scale",0);x(this,"offset",0);x(this,"local",!1);x(this,"max",0)}create(e){return new ml(this,e)}}class Bl{constructor(){x(this,"name",null);x(this,"bones",[]);x(this,"slots",[]);x(this,"skins",[]);x(this,"defaultSkin",null);x(this,"events",[]);x(this,"animations",[]);x(this,"constraints",[]);x(this,"x",0);x(this,"y",0);x(this,"width",0);x(this,"height",0);x(this,"referenceScale",100);x(this,"version",null);x(this,"hash",null);x(this,"fps",30);x(this,"imagesPath",null);x(this,"audioPath",null)}findBone(t){if(!t)throw new Error("boneName cannot be null.");const e=this.bones;for(let s=0,r=e.length;s<r;s++)if(e[s].name===t)return e[s];return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");const e=this.slots;for(let s=0,r=e.length;s<r;s++)if(e[s].name===t)return e[s];return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");const e=this.skins;for(let s=0,r=e.length;s<r;s++)if(e[s].name===t)return e[s];return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");const e=this.events;for(let s=0,r=e.length;s<r;s++)if(e[s].name===t)return e[s];return null}findSliderAnimations(t){const e=this.constraints;for(let s=0,r=this.constraints.length;s<r;s++){const n=e[s];n instanceof yi&&n.animation!=null&&t.push(n.animation)}return t}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");const e=this.animations;for(let s=0,r=e.length;s<r;s++)if(e[s].name===t)return e[s];return null}findConstraint(t,e){if(!t)throw new Error("constraintName cannot be null.");if(e==null)throw new Error("type cannot be null.");const s=this.constraints;for(let r=0,n=this.constraints.length;r<n;r++){const a=s[r];if(a instanceof e&&a.name===t)return a}return null}}class pc{constructor(t=0,e,s){x(this,"slotIndex",0);x(this,"placeholder");x(this,"attachment");this.slotIndex=t,this.placeholder=e,this.attachment=s}}class Ka{constructor(t){x(this,"name");x(this,"attachments",[]);x(this,"bones",[]);x(this,"constraints",[]);x(this,"color",new Ft(.99607843,.61960787,.30980393,1));if(!t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,s){if(!s)throw new Error("attachment cannot be null.");const r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=s}addSkin(t){for(let s=0;s<t.bones.length;s++){const r=t.bones[s];let n=!1;for(let a=0;a<this.bones.length;a++)if(this.bones[a]===r){n=!0;break}n||this.bones.push(r)}for(let s=0;s<t.constraints.length;s++){const r=t.constraints[s];let n=!1;for(let a=0;a<this.constraints.length;a++)if(this.constraints[a]===r){n=!0;break}n||this.constraints.push(r)}const e=t.getAttachments();for(let s=0;s<e.length;s++){const r=e[s];this.setAttachment(r.slotIndex,r.placeholder,r.attachment)}}copySkin(t){for(let s=0;s<t.bones.length;s++){const r=t.bones[s];let n=!1;for(let a=0;a<this.bones.length;a++)if(this.bones[a]===r){n=!0;break}n||this.bones.push(r)}for(let s=0;s<t.constraints.length;s++){const r=t.constraints[s];let n=!1;for(let a=0;a<this.constraints.length;a++)if(this.constraints[a]===r){n=!0;break}n||this.constraints.push(r)}const e=t.getAttachments();for(let s=0;s<e.length;s++){const r=e[s];r.attachment&&(r.attachment instanceof Vs?(r.attachment=r.attachment.newLinkedMesh(),this.setAttachment(r.slotIndex,r.placeholder,r.attachment)):(r.attachment=r.attachment.copy(),this.setAttachment(r.slotIndex,r.placeholder,r.attachment)))}}getAttachment(t,e){const s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){const s=this.attachments[t];s&&delete s[e]}getAttachments(){const t=[];for(let e=0;e<this.attachments.length;e++){const s=this.attachments[e];if(s)for(const r in s){const n=s[r];n&&t.push(new pc(e,r,n))}}return t}getAttachmentsForSlot(t,e){const s=this.attachments[t];if(s)for(const r in s){const n=s[r];n&&e.push(new pc(t,r,n))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let r=0;r<t.slots.length;r++){const n=t.slots[r],a=n.pose.getAttachment();if(a&&s<e.attachments.length){const o=e.attachments[s];for(const h in o){const l=o[h];if(a===l){const c=this.getAttachment(s,h);c&&n.pose.setAttachment(c);break}}}s++}}}class Du extends Fl{constructor(e,s,r){super(s,new dl);x(this,"index",0);x(this,"boneData");x(this,"attachmentName",null);x(this,"blendMode",fr.Normal);x(this,"visible",!0);if(e<0)throw new Error("index must be >= 0.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.boneData=r}}var fr;(function(i){i[i.Normal=0]="Normal",i[i.Additive=1]="Additive",i[i.Multiply=2]="Multiply",i[i.Screen=3]="Screen"})(fr||(fr={}));class pl{constructor(){x(this,"mixRotate",0);x(this,"mixX",0);x(this,"mixY",0);x(this,"mixScaleX",0);x(this,"mixScaleY",0);x(this,"mixShearY",0)}set(t){this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}}class Ol extends ta{constructor(e,s){super(e,new pl,new pl);x(this,"bones");x(this,"source");if(!s)throw new Error("skeleton cannot be null.");this.bones=[];for(const n of e.bones)this.bones.push(s.bones[n.index].constrainedPose);const r=s.bones[e.source.index];if(r==null)throw new Error("source cannot be null.");this.source=r}copy(e){var s=new Ol(this.data,e);return s.pose.set(this.pose),s}update(e,s){const r=this.appliedPose;if(r.mixRotate===0&&r.mixX===0&&r.mixY===0&&r.mixScaleX===0&&r.mixScaleY===0&&r.mixShearY===0)return;const n=this.data,a=n.localSource,o=n.localTarget,h=n.additive,l=n.clamp,c=n.offsets,u=this.source.appliedPose;a&&u.validateLocalTransform(e);const d=n.properties,f=n.properties.length,m=this.bones;for(let p=0,g=this.bones.length;p<g;p++){const y=m[p];o?y.modifyLocal(e):y.modifyWorld(e);for(let _=0;_<f;_++){const v=d[_],b=v.value(e,u,a,c)-v.offset,T=v.to;for(let S=0,w=v.to.length;S<w;S++){const E=T[S];if(E.mix(r)!==0){let A=E.offset+b*E.scale;l&&(E.offset<E.max?A=pt.clamp(A,E.offset,E.max):A=pt.clamp(A,E.max,E.offset)),E.apply(e,r,y,A,o,h)}}}}}sort(e){this.data.localSource||e.sortBone(this.source);const s=this.bones,r=this.bones.length,n=!this.data.localTarget;if(n)for(let a=0;a<r;a++)e.sortBone(s[a].bone);e._updateCache.push(this);for(let a=0;a<r;a++){const o=s[a].bone;e.sortReset(o.children),e.constrained(o)}for(let a=0;a<r;a++)s[a].bone.sorted=n}isSourceActive(){return this.source.active}}const Be=class Be extends ea{constructor(e){super(e,new pl);x(this,"bones",[]);x(this,"_source",null);x(this,"offsets",[0,0,0,0,0,0]);x(this,"offsetX",0);x(this,"offsetY",0);x(this,"localSource",!1);x(this,"localTarget",!1);x(this,"additive",!1);x(this,"clamp",!1);x(this,"properties",[])}set source(e){this._source=e}get source(){if(this._source)return this._source;throw new Error("BoneData not set.")}create(e){return new Ol(this,e)}getOffsetRotation(){return this.offsets[Be.ROTATION]}setOffsetRotation(e){this.offsets[Be.ROTATION]=e}getOffsetX(){return this.offsets[Be.X]}setOffsetX(e){this.offsets[Be.X]=e}getOffsetY(){return this.offsets[Be.Y]}setOffsetY(e){this.offsets[Be.Y]=e}getOffsetScaleX(){return this.offsets[Be.SCALEX]}setOffsetScaleX(e){this.offsets[Be.SCALEX]=e}getOffsetScaleY(){return this.offsets[Be.SCALEY]}setOffsetScaleY(e){this.offsets[Be.SCALEY]=e}getOffsetShearY(){return this.offsets[Be.SHEARY]}setOffsetShearY(e){this.offsets[Be.SHEARY]=e}};x(Be,"ROTATION",0),x(Be,"X",1),x(Be,"Y",2),x(Be,"SCALEX",3),x(Be,"SCALEY",4),x(Be,"SHEARY",5);let te=Be;class dn{constructor(){x(this,"offset",0);x(this,"to",[])}}class fn{constructor(){x(this,"offset",0);x(this,"max",0);x(this,"scale",0)}}class gl extends dn{value(t,e,s,r){if(s)return e.rotation+r[te.ROTATION];const n=t.scaleX,a=t.scaleY;let o=Math.atan2(e.c/a,e.a/n)*pt.radDeg+((e.a*e.d-e.b*e.c)*n*a>0?r[te.ROTATION]:-r[te.ROTATION]);return o<0&&(o+=360),o}}class Nu extends fn{mix(t){return t.mixRotate}apply(t,e,s,r,n,a){if(n)s.rotation+=(a?r:r-s.rotation)*e.mixRotate;else{const o=t.scaleX,h=t.scaleY,l=1/o,c=1/h,u=s.a*l,d=s.b*l,f=s.c*c,m=s.d*c;r*=pt.degRad,a||(r-=Math.atan2(f,u)),r>pt.PI?r-=pt.PI2:r<-pt.PI&&(r+=pt.PI2),r*=e.mixRotate;const p=Math.cos(r),g=Math.sin(r);s.a=(p*u-g*f)*o,s.b=(p*d-g*m)*o,s.c=(g*u+p*f)*h,s.d=(g*d+p*m)*h}}}class yl extends dn{value(t,e,s,r){return s?e.x+r[te.X]:(r[te.X]*e.a+r[te.Y]*e.b+e.worldX)/t.scaleX}}class Uu extends fn{mix(t){return t.mixX}apply(t,e,s,r,n,a){n?s.x+=(a?r:r-s.x)*e.mixX:(a||(r-=s.worldX/t.scaleX),s.worldX+=r*e.mixX*t.scaleX)}}class xl extends dn{value(t,e,s,r){return s?e.y+r[te.Y]:(r[te.X]*e.c+r[te.Y]*e.d+e.worldY)/t.scaleY}}class Xu extends fn{mix(t){return t.mixY}apply(t,e,s,r,n,a){n?s.y+=(a?r:r-s.y)*e.mixY:(a||(r-=s.worldY/t.scaleY),s.worldY+=r*e.mixY*t.scaleY)}}class bl extends dn{value(t,e,s,r){if(s)return e.scaleX+r[te.SCALEX];const n=e.a/t.scaleX,a=e.c/t.scaleY;return Math.sqrt(n*n+a*a)+r[te.SCALEX]}}class Vu extends fn{mix(t){return t.mixScaleX}apply(t,e,s,r,n,a){if(n)a?s.scaleX*=1+(r-1)*e.mixScaleX:s.scaleX!==0&&(s.scaleX+=(r-s.scaleX)*e.mixScaleX);else if(a){const o=1+(r-1)*e.mixScaleX;s.a*=o,s.c*=o}else{let o=s.a/t.scaleX,h=s.c/t.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(r-l)*e.mixScaleX/l,s.a*=l,s.c*=l)}}}class vl extends dn{value(t,e,s,r){if(s)return e.scaleY+r[te.SCALEY];const n=e.b/t.scaleX,a=e.d/t.scaleY;return Math.sqrt(n*n+a*a)+r[te.SCALEY]}}class Yu extends fn{mix(t){return t.mixScaleY}apply(t,e,s,r,n,a){if(n)a?s.scaleY*=1+(r-1)*e.mixScaleY:s.scaleY!==0&&(s.scaleY+=(r-s.scaleY)*e.mixScaleY);else if(a){const o=1+(r-1)*e.mixScaleY;s.b*=o,s.d*=o}else{let o=s.b/t.scaleX,h=s.d/t.scaleY,l=Math.sqrt(o*o+h*h);l!==0&&(l=1+(r-l)*e.mixScaleY/l,s.b*=l,s.d*=l)}}}class _l extends dn{value(t,e,s,r){if(s)return e.shearY+r[te.SHEARY];const n=1/t.scaleX,a=1/t.scaleY;return(Math.atan2(e.d*a,e.b*n)-Math.atan2(e.c*a,e.a*n))*pt.radDeg-90+r[te.SHEARY]}}class Gu extends fn{mix(t){return t.mixShearY}apply(t,e,s,r,n,a){if(n)a||(r-=s.shearY),s.shearY+=r*e.mixShearY;else{const o=t.scaleX,h=t.scaleY,l=s.b/o,c=s.d/h,u=Math.atan2(c,l);r=(r+90)*pt.degRad,a?r-=pt.PI/2:(r-=u-Math.atan2(s.c/h,s.a/o),r>pt.PI?r-=pt.PI2:r<-pt.PI&&(r+=pt.PI2)),r=u+r*e.mixShearY;const d=Math.sqrt(l*l+c*c);s.b=Math.cos(r)*d*o,s.d=Math.sin(r)*d*h}}}class ug{constructor(t){x(this,"scale",1);x(this,"attachmentLoader");x(this,"linkedMeshes",[]);this.attachmentLoader=t}readSkeletonData(t){const e=this.scale,s=new Bl;s.name="";const r=new dg(t),n=r.readInt32(),a=r.readInt32();s.hash=a===0&&n===0?null:a.toString(16)+n.toString(16),s.version=r.readString(),s.x=r.readFloat(),s.y=r.readFloat(),s.width=r.readFloat(),s.height=r.readFloat(),s.referenceScale=r.readFloat()*e;const o=r.readBoolean();o&&(s.fps=r.readFloat(),s.imagesPath=r.readString(),s.audioPath=r.readString());let h=0;h=r.readInt(!0);for(let m=0;m<h;m++){const p=r.readString();if(!p)throw new Error("String in string table must not be null.");r.strings.push(p)}const l=s.bones;h=r.readInt(!0);for(let m=0;m<h;m++){const p=r.readString();if(!p)throw new Error("Bone name must not be null.");const g=m===0?null:l[r.readInt(!0)],y=new io(m,p,g),_=y.setupPose;_.rotation=r.readFloat(),_.x=r.readFloat()*e,_.y=r.readFloat()*e,_.scaleX=r.readFloat(),_.scaleY=r.readFloat(),_.shearX=r.readFloat(),_.shearY=r.readFloat(),_.inherit=r.readByte(),y.length=r.readFloat()*e,y.skinRequired=r.readBoolean(),o&&(Ft.rgba8888ToColor(y.color,r.readInt32()),y.icon=r.readString()??void 0,y.iconSize=r.readFloat(),y.iconRotation=r.readFloat(),y.visible=r.readBoolean()),l.push(y)}h=r.readInt(!0);for(let m=0;m<h;m++){const p=r.readString();if(!p)throw new Error("Slot name must not be null.");const g=l[r.readInt(!0)],y=new Du(m,p,g);Ft.rgba8888ToColor(y.setupPose.color,r.readInt32());const _=r.readInt32();_!==-1&&Ft.rgb888ToColor(y.setupPose.darkColor=new Ft,_),y.attachmentName=r.readStringRef(),y.blendMode=r.readInt(!0),o&&(y.visible=r.readBoolean()),s.slots.push(y)}const c=s.constraints,u=r.readInt(!0);for(let m=0;m<u;m++){const p=r.readString();if(!p)throw new Error("Constraint data name must not be null.");let g;switch(r.readByte()){case Nk:{const y=new Ba(p);g=r.readInt(!0);for(let b=0;b<g;b++)y.bones.push(l[r.readInt(!0)]);y.target=l[r.readInt(!0)];const _=r.readByte();y.skinRequired=(_&1)!==0,(_&2)!==0&&(y.scaleYMode=r.readUnsignedByte());const v=y.setupPose;v.bendDirection=(_&4)!==0?-1:1,v.compress=(_&8)!==0,v.stretch=(_&16)!==0,(_&32)!==0&&(v.mix=(_&64)!==0?r.readFloat():1),(_&128)!==0&&(v.softness=r.readFloat()*e),c.push(y);break}case Xk:{const y=new te(p);g=r.readInt(!0);for(let b=0;b<g;b++)y.bones.push(l[r.readInt(!0)]);y.source=l[r.readInt(!0)];let _=r.readUnsignedByte();y.skinRequired=(_&1)!==0,y.localSource=(_&2)!==0,y.localTarget=(_&4)!==0,y.additive=(_&8)!==0,y.clamp=(_&16)!==0,g=_>>5;for(let b=0,T;b<g;b++){let S=1,w;switch(r.readByte()){case 0:w=new gl;break;case 1:{S=e,w=new yl;break}case 2:{S=e,w=new xl;break}case 3:w=new bl;break;case 4:w=new vl;break;case 5:w=new _l;break;default:w=null}if(w){w.offset=r.readFloat()*S,T=r.readByte();for(let E=0;E<T;E++){let A=1,P;switch(r.readByte()){case 0:P=new Nu;break;case 1:{A=e,P=new Uu;break}case 2:{A=e,P=new Xu;break}case 3:P=new Vu;break;case 4:P=new Yu;break;case 5:P=new Gu;break;default:P=null}P&&(P.offset=r.readFloat()*A,P.max=r.readFloat()*A,P.scale=r.readFloat()*A/S,w.to[E]=P)}y.properties[b]=w}}_=r.readByte(),(_&1)!==0&&(y.offsets[te.ROTATION]=r.readFloat()),(_&2)!==0&&(y.offsets[te.X]=r.readFloat()*e),(_&4)!==0&&(y.offsets[te.Y]=r.readFloat()*e),(_&8)!==0&&(y.offsets[te.SCALEX]=r.readFloat()),(_&16)!==0&&(y.offsets[te.SCALEY]=r.readFloat()),(_&32)!==0&&(y.offsets[te.SHEARY]=r.readFloat()),_=r.readByte();const v=y.setupPose;(_&1)!==0&&(v.mixRotate=r.readFloat()),(_&2)!==0&&(v.mixX=r.readFloat()),(_&4)!==0&&(v.mixY=r.readFloat()),(_&8)!==0&&(v.mixScaleX=r.readFloat()),(_&16)!==0&&(v.mixScaleY=r.readFloat()),(_&32)!==0&&(v.mixShearY=r.readFloat()),c.push(y);break}case Uk:{const y=new Oa(p);g=r.readInt(!0);for(let b=0;b<g;b++)y.bones.push(l[r.readInt(!0)]);y.slot=s.slots[r.readInt(!0)];const _=r.readByte();y.skinRequired=(_&1)!==0,y.positionMode=_>>1&1,y.spacingMode=_>>2&3,y.rotateMode=_>>4&3,(_&128)!==0&&(y.offsetRotation=r.readFloat());const v=y.setupPose;v.position=r.readFloat(),y.positionMode===Qs.Fixed&&(v.position*=e),v.spacing=r.readFloat(),(y.spacingMode===ke.Length||y.spacingMode===ke.Fixed)&&(v.spacing*=e),v.mixRotate=r.readFloat(),v.mixX=r.readFloat(),v.mixY=r.readFloat(),c.push(y);break}case Vk:{const y=new Da(p);y.bone=l[r.readInt(!0)];let _=r.readByte();if(y.skinRequired=(_&1)!==0,(_&2)!==0&&(y.x=r.readFloat()),(_&4)!==0&&(y.y=r.readFloat()),(_&8)!==0&&(y.rotate=r.readFloat()),(_&16)!==0){let b=r.readFloat();b<-2?(y.scaleYMode=es.Volume,b=-2-b):b<0&&(y.scaleYMode=es.Uniform,b=-1-b),y.scaleX=b}(_&32)!==0&&(y.shearX=r.readFloat()),y.limit=((_&64)!==0?r.readFloat():5e3)*e,y.step=1/r.readUnsignedByte();const v=y.setupPose;v.inertia=r.readFloat(),v.strength=r.readFloat(),v.damping=r.readFloat(),v.massInverse=(_&128)!==0?r.readFloat():1,v.wind=r.readFloat(),v.gravity=r.readFloat(),_=r.readByte(),(_&1)!==0&&(y.inertiaGlobal=!0),(_&2)!==0&&(y.strengthGlobal=!0),(_&4)!==0&&(y.dampingGlobal=!0),(_&8)!==0&&(y.massGlobal=!0),(_&16)!==0&&(y.windGlobal=!0),(_&32)!==0&&(y.gravityGlobal=!0),(_&64)!==0&&(y.mixGlobal=!0),v.mix=(_&128)!==0?r.readFloat():1,c.push(y);break}case Yk:{const y=new yi(p),_=r.readByte();if(y.skinRequired=(_&1)!==0,y.loop=(_&2)!==0,y.additive=(_&4)!==0,(_&8)!==0){const v=r.readFloat();o&&(_&64)!==0?y.max=v:y.setupPose.time=v}if((_&16)!==0&&(y.setupPose.mix=(_&32)!==0?r.readFloat():1),(_&64)!==0){y.local=(_&128)!==0,y.bone=l[r.readInt(!0)];const v=r.readFloat();let b=1;switch(r.readByte()){case 0:y.property=new gl;break;case 1:{b=e,y.property=new yl;break}case 2:{b=e,y.property=new xl;break}case 3:y.property=new bl;break;case 4:y.property=new vl;break;case 5:y.property=new _l;break;default:continue}y.property.offset=v*b,y.offset=r.readFloat(),y.scale=r.readFloat()/b}c.push(y);break}}}const d=this.readSkin(r,s,!0,o);d&&(s.defaultSkin=d,s.skins.push(d));{let m=s.skins.length;for(bt.setArraySize(s.skins,h=m+r.readInt(!0));m<h;m++){const p=this.readSkin(r,s,!1,o);if(!p)throw new Error("readSkin() should not have returned null.");s.skins[m]=p}}h=this.linkedMeshes.length;for(let m=0;m<h;m++){const p=this.linkedMeshes[m],g=s.skins[p.skinIndex];if(!p.source)throw new Error("Linked mesh parent must not be null");const y=g.getAttachment(p.sourceIndex,p.source);if(!y)throw new Error(`Source mesh not found: ${p.source}`);p.mesh.timelineAttachment=p.inheritTimelines?y:p.mesh,p.mesh.setSourceMesh(y),p.mesh.updateSequence()}this.linkedMeshes.length=0,h=r.readInt(!0);for(let m=0;m<h;m++){const p=r.readString();if(!p)throw new Error("Event data name must not be null");const g=new Ou(p),y=g.setupPose;y.intValue=r.readInt(!1),y.floatValue=r.readFloat(),y.stringValue=r.readString(),g._audioPath=r.readString(),g.audioPath&&(y.volume=r.readFloat(),y.balance=r.readFloat()),s.events.push(g)}const f=s.animations;h=r.readInt(!0);for(let m=0;m<h;m++){const p=r.readString();if(!p)throw new Error("Animation name must not be null.");f.push(this.readAnimation(r,p,s,o))}for(let m=0;m<u;m++){const p=c[m];p instanceof yi&&(p.animation=f[r.readInt(!0)])}return s}readSkin(t,e,s,r){let n=null,a=0;if(s){if(a=t.readInt(!0),a===0)return null;n=new Ka("default")}else{const o=t.readString();if(!o)throw new Error("Skin name must not be null.");n=new Ka(o),r&&Ft.rgba8888ToColor(n.color,t.readInt32());let h=t.readInt(!0),l=e.bones,c=n.bones;for(let u=0;u<h;u++)c[u]=l[t.readInt(!0)];h=t.readInt(!0),l=e.constraints,c=n.constraints;for(let u=0;u<h;u++)c[u]=l[t.readInt(!0)];a=t.readInt(!0)}for(let o=0;o<a;o++){const h=t.readInt(!0);for(let l=0,c=t.readInt(!0);l<c;l++){const u=t.readStringRef();if(!u)throw new Error("Attachment name must not be null");const d=this.readAttachment(t,e,n,h,u,r);d&&n.setAttachment(h,u,d)}}return n}readAttachment(t,e,s,r,n,a){const o=this.scale,h=t.readByte(),l=(h&8)!==0?t.readStringRef():n;if(!l)throw new Error("Attachment name must not be null");switch(h&7){case ii.Region:{let c=(h&16)!==0?t.readStringRef():null;const u=(h&32)!==0?t.readInt32():4294967295,d=this.readSequence(t,(h&64)!==0),f=(h&128)!==0?t.readFloat():0,m=t.readFloat(),p=t.readFloat(),g=t.readFloat(),y=t.readFloat(),_=t.readFloat(),v=t.readFloat();c||(c=l);const b=this.attachmentLoader.newRegionAttachment(s,n,l,c,d);return b?(b.path=c,b.x=m*o,b.y=p*o,b.scaleX=g,b.scaleY=y,b.rotation=f,b.width=_*o,b.height=v*o,Ft.rgba8888ToColor(b.color,u),b.updateSequence(),b):null}case ii.BoundingBox:{const c=this.readVertices(t,(h&16)!==0),u=a?t.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(s,n,l);return d?(d.worldVerticesLength=c.length,d.vertices=c.vertices,d.bones=c.bones,a&&Ft.rgba8888ToColor(d.color,u),d):null}case ii.Mesh:{let c=(h&16)!==0?t.readStringRef():l;const u=(h&32)!==0?t.readInt32():4294967295,d=this.readSequence(t,(h&64)!==0),f=t.readInt(!0),m=this.readVertices(t,(h&128)!==0),p=this.readFloatArray(t,m.length,1),g=this.readShortArray(t,(m.length-f-2)*3),y=t.readInt(!0);let _=null;if(y>0){_=[];for(let w=0;w<y;w++)_[w]=t.readInt(!0)}let v=[],b=0,T=0;a&&(v=this.readShortArray(t,t.readInt(!0)),b=t.readFloat(),T=t.readFloat()),c||(c=l);const S=this.attachmentLoader.newMeshAttachment(s,n,l,c,d);return S?(S.path=c,Ft.rgba8888ToColor(S.color,u),S.hullLength=f<<1,S.bones=m.bones,S.vertices=m.vertices,S.worldVerticesLength=m.length,S.regionUVs=p,S.triangles=g,_&&(S.timelineSlots=_),a&&(S.edges=v,S.width=b*o,S.height=T*o),S.updateSequence(),S):null}case ii.LinkedMesh:{const c=(h&16)!==0?t.readStringRef():l;if(c==null)throw new Error("Path of linked mesh must not be null");const u=(h&32)!==0?t.readInt32():4294967295,d=this.readSequence(t,(h&64)!==0),f=(h&128)!==0,m=t.readInt(!0),p=t.readInt(!0),g=t.readStringRef();let y=0,_=0;a&&(y=t.readFloat(),_=t.readFloat());const v=this.attachmentLoader.newMeshAttachment(s,n,l,c,d);return v?(v.path=c,Ft.rgba8888ToColor(v.color,u),a&&(v.width=y*o,v.height=_*o),this.linkedMeshes.push(new xk(v,p,r,m,g,f)),v):null}case ii.Path:{const c=(h&16)!==0,u=(h&32)!==0,d=this.readVertices(t,(h&64)!==0),f=this.readFloatArray(t,d.length/6,o),m=a?t.readInt32():0,p=this.attachmentLoader.newPathAttachment(s,n,l);return p?(p.closed=c,p.constantSpeed=u,p.worldVerticesLength=d.length,p.vertices=d.vertices,p.bones=d.bones,p.lengths=f,a&&Ft.rgba8888ToColor(p.color,m),p):null}case ii.Point:{const c=t.readFloat(),u=t.readFloat(),d=t.readFloat(),f=a?t.readInt32():0,m=this.attachmentLoader.newPointAttachment(s,n,l);return m?(m.x=u*o,m.y=d*o,m.rotation=c,a&&Ft.rgba8888ToColor(m.color,f),m):null}case ii.Clipping:{const c=t.readInt(!0),u=this.readVertices(t,(h&16)!==0),d=a?t.readInt32():0,f=this.attachmentLoader.newClippingAttachment(s,n,l);return f?(f.endSlot=e.slots[c],f.convex=(h&32)!==0,f.inverse=(h&64)!==0,f.worldVerticesLength=u.length,f.vertices=u.vertices,f.bones=u.bones,a&&Ft.rgba8888ToColor(f.color,d),f):null}}}readSequence(t,e){if(!e)return new nn(1,!1);const s=new nn(t.readInt(!0),!0);return s.start=t.readInt(!0),s.digits=t.readInt(!0),s.setupIndex=t.readInt(!0),s}readVertices(t,e){const s=this.scale,n=t.readInt(!0)<<1;if(!e)return new ib(null,this.readFloatArray(t,n,s),n);const a=t.readInt(!0),o=[],h=[];for(let l=0,c=0;l<a;){const u=t.readInt(!0);o[l++]=u;for(let d=0;d<u;d++,c+=3)o[l++]=t.readInt(!0),h[c]=t.readFloat()*s,h[c+1]=t.readFloat()*s,h[c+2]=t.readFloat()}return new ib(o,bt.toFloatArray(h),n)}readFloatArray(t,e,s){const r=[];if(s===1)for(let n=0;n<e;n++)r[n]=t.readFloat();else for(let n=0;n<e;n++)r[n]=t.readFloat()*s;return r}readShortArray(t,e){const s=[];for(let r=0;r<e;r++)s[r]=t.readInt(!0);return s}readAnimation(t,e,s,r){t.readInt(!0);const n=[],a=this.scale;for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0);for(let g=0,y=t.readInt(!0);g<y;g++){const _=t.readByte(),v=t.readInt(!0),b=v-1;switch(_){case Fk:{const T=new Yn(v,p);for(let S=0;S<v;S++)T.setFrame(S,t.readFloat(),t.readStringRef());n.push(T);break}case kk:{const T=t.readInt(!0),S=new mu(v,T,p);let w=t.readFloat(),E=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255;for(let C=0,R=0;S.setFrame(C,w,E,A,P,I),C!==b;C++){const F=t.readFloat(),D=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255,O=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255;switch(t.readByte()){case Lr:S.setStepped(C);break;case Br:jt(t,S,R++,C,0,w,F,E,D,1),jt(t,S,R++,C,1,w,F,A,M,1),jt(t,S,R++,C,2,w,F,P,O,1),jt(t,S,R++,C,3,w,F,I,k,1)}w=F,E=D,A=M,P=O,I=k}n.push(S);break}case Lk:{const T=t.readInt(!0),S=new pu(v,T,p);let w=t.readFloat(),E=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255;for(let I=0,C=0;S.setFrame(I,w,E,A,P),I!==b;I++){const R=t.readFloat(),F=t.readUnsignedByte()/255,D=t.readUnsignedByte()/255,M=t.readUnsignedByte()/255;switch(t.readByte()){case Lr:S.setStepped(I);break;case Br:jt(t,S,C++,I,0,w,R,E,F,1),jt(t,S,C++,I,1,w,R,A,D,1),jt(t,S,C++,I,2,w,R,P,M,1)}w=R,E=F,A=D,P=M}n.push(S);break}case Bk:{const T=t.readInt(!0),S=new yu(v,T,p);let w=t.readFloat(),E=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,R=t.readUnsignedByte()/255,F=t.readUnsignedByte()/255;for(let D=0,M=0;S.setFrame(D,w,E,A,P,I,C,R,F),D!==b;D++){const O=t.readFloat(),k=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255,L=t.readUnsignedByte()/255,G=t.readUnsignedByte()/255,V=t.readUnsignedByte()/255,q=t.readUnsignedByte()/255;switch(t.readByte()){case Lr:S.setStepped(D);break;case Br:jt(t,S,M++,D,0,w,O,E,k,1),jt(t,S,M++,D,1,w,O,A,N,1),jt(t,S,M++,D,2,w,O,P,B,1),jt(t,S,M++,D,3,w,O,I,L,1),jt(t,S,M++,D,4,w,O,C,G,1),jt(t,S,M++,D,5,w,O,R,V,1),jt(t,S,M++,D,6,w,O,F,q,1)}w=O,E=k,A=N,P=B,I=L,C=G,R=V,F=q}n.push(S);break}case Ok:{const T=t.readInt(!0),S=new xu(v,T,p);let w=t.readFloat(),E=t.readUnsignedByte()/255,A=t.readUnsignedByte()/255,P=t.readUnsignedByte()/255,I=t.readUnsignedByte()/255,C=t.readUnsignedByte()/255,R=t.readUnsignedByte()/255;for(let F=0,D=0;S.setFrame(F,w,E,A,P,I,C,R),F!==b;F++){const M=t.readFloat(),O=t.readUnsignedByte()/255,k=t.readUnsignedByte()/255,N=t.readUnsignedByte()/255,B=t.readUnsignedByte()/255,L=t.readUnsignedByte()/255,G=t.readUnsignedByte()/255;switch(t.readByte()){case Lr:S.setStepped(F);break;case Br:jt(t,S,D++,F,0,w,M,E,O,1),jt(t,S,D++,F,1,w,M,A,k,1),jt(t,S,D++,F,2,w,M,P,N,1),jt(t,S,D++,F,3,w,M,I,B,1),jt(t,S,D++,F,4,w,M,C,L,1),jt(t,S,D++,F,5,w,M,R,G,1)}w=M,E=O,A=k,P=N,I=B,C=L,R=G}n.push(S);break}case Dk:{const T=new gu(v,t.readInt(!0),p);let S=t.readFloat(),w=t.readUnsignedByte()/255;for(let E=0,A=0;T.setFrame(E,S,w),E!==b;E++){const P=t.readFloat(),I=t.readUnsignedByte()/255;switch(t.readByte()){case Lr:T.setStepped(E);break;case Br:jt(t,T,A++,E,0,S,P,w,I,1)}S=P,w=I}n.push(T)}}}}for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0);for(let g=0,y=t.readInt(!0);g<y;g++){const _=t.readByte(),v=t.readInt(!0);if(_===Rk){const T=new fu(v,p);for(let S=0;S<v;S++)T.setFrame(S,t.readFloat(),t.readByte());n.push(T);continue}const b=t.readInt(!0);switch(_){case _k:Fe(t,n,new Wa(v,b,p),1);break;case wk:Fe(t,n,new iu(v,b,p),a);break;case Tk:Fe(t,n,new nu(v,b,p),a);break;case Sk:Fe(t,n,new au(v,b,p),a);break;case Ek:Fe(t,n,new ou(v,b,p),1);break;case Ak:Fe(t,n,new lu(v,b,p),1);break;case Ck:Fe(t,n,new hu(v,b,p),1);break;case Ik:Fe(t,n,new cu(v,b,p),1);break;case Pk:Fe(t,n,new uu(v,b,p),1);break;case Mk:Fe(t,n,new du(v,b,p),1);break}}}for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0),g=t.readInt(!0),y=g-1,_=new vu(g,t.readInt(!0),p);let v=t.readByte(),b=t.readFloat(),T=(v&1)!==0?(v&2)!==0?t.readFloat():1:0,S=(v&4)!==0?t.readFloat()*a:0;for(let w=0,E=0;_.setFrame(w,b,T,S,(v&8)!==0?1:-1,(v&16)!==0,(v&32)!==0),w!==y;w++){v=t.readByte();const A=t.readFloat(),P=(v&1)!==0?(v&2)!==0?t.readFloat():1:0,I=(v&4)!==0?t.readFloat()*a:0;(v&64)!==0?_.setStepped(w):(v&128)!==0&&(jt(t,_,E++,w,0,b,A,T,P,1),jt(t,_,E++,w,1,b,A,S,I,a)),b=A,T=P,S=I}n.push(_)}for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0),g=t.readInt(!0),y=g-1,_=new _u(g,t.readInt(!0),p);let v=t.readFloat(),b=t.readFloat(),T=t.readFloat(),S=t.readFloat(),w=t.readFloat(),E=t.readFloat(),A=t.readFloat();for(let P=0,I=0;_.setFrame(P,v,b,T,S,w,E,A),P!==y;P++){const C=t.readFloat(),R=t.readFloat(),F=t.readFloat(),D=t.readFloat(),M=t.readFloat(),O=t.readFloat(),k=t.readFloat();switch(t.readByte()){case Lr:_.setStepped(P);break;case Br:jt(t,_,I++,P,0,v,C,b,R,1),jt(t,_,I++,P,1,v,C,T,F,1),jt(t,_,I++,P,2,v,C,S,D,1),jt(t,_,I++,P,3,v,C,w,M,1),jt(t,_,I++,P,4,v,C,E,O,1),jt(t,_,I++,P,5,v,C,A,k,1)}v=C,b=R,T=F,S=D,w=M,E=O,A=k}n.push(_)}for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0),g=s.constraints[p];for(let y=0,_=t.readInt(!0);y<_;y++){const v=t.readByte(),b=t.readInt(!0),T=t.readInt(!0);switch(v){case Hk:Fe(t,n,new wu(b,T,p),g.positionMode===Qs.Fixed?a:1);break;case Wk:Fe(t,n,new Tu(b,T,p),g.spacingMode===ke.Length||g.spacingMode===ke.Fixed?a:1);break;case zk:{const S=new Su(b,T,p);let w=t.readFloat(),E=t.readFloat(),A=t.readFloat(),P=t.readFloat();for(let I=0,C=0,R=S.getFrameCount()-1;S.setFrame(I,w,E,A,P),I!==R;I++){const F=t.readFloat(),D=t.readFloat(),M=t.readFloat(),O=t.readFloat();switch(t.readByte()){case Lr:S.setStepped(I);break;case Br:jt(t,S,C++,I,0,w,F,E,D,1),jt(t,S,C++,I,1,w,F,A,M,1),jt(t,S,C++,I,2,w,F,P,O,1)}w=F,E=D,A=M,P=O}n.push(S)}}}}for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0)-1;for(let g=0,y=t.readInt(!0);g<y;g++){const _=t.readByte(),v=t.readInt(!0);if(_===eL){const T=new ja(v,p);for(let S=0;S<v;S++)T.setFrame(S,t.readFloat());n.push(T);continue}const b=t.readInt(!0);switch(_){case jk:Fe(t,n,new Eu(v,b,p),1);break;case qk:Fe(t,n,new Au(v,b,p),1);break;case Kk:Fe(t,n,new Cu(v,b,p),1);break;case Zk:Fe(t,n,new Iu(v,b,p),1);break;case Jk:Fe(t,n,new Pu(v,b,p),1);break;case Qk:Fe(t,n,new Mu(v,b,p),1);break;case tL:Fe(t,n,new Ru(v,b,p),1);break;default:throw new Error("Unknown physics timeline type.")}}}for(let f=0,m=t.readInt(!0);f<m;f++){const p=t.readInt(!0);for(let g=0,y=t.readInt(!0);g<y;g++){const _=t.readByte(),v=t.readInt(!0),b=t.readInt(!0);switch(_){case sL:Fe(t,n,new Fu(v,b,p),1);break;case rL:Fe(t,n,new ku(v,b,p),1);break;default:throw new Error(`Uknown slider type: ${_}`)}}}for(let f=0,m=t.readInt(!0);f<m;f++){const p=s.skins[t.readInt(!0)];for(let g=0,y=t.readInt(!0);g<y;g++){const _=t.readInt(!0);for(let v=0,b=t.readInt(!0);v<b;v++){const T=t.readStringRef();if(!T)throw new Error("attachmentName must not be null.");const S=p.getAttachment(_,T),w=t.readByte(),E=t.readInt(!0),A=E-1;switch(w){case Gk:{const P=S,I=P.bones,C=P.vertices,R=I?C.length/3*2:C.length,F=t.readInt(!0),D=new bu(E,F,_,P);let M=t.readFloat();for(let O=0,k=0;;O++){let N,B=t.readInt(!0);if(B===0)N=I?bt.newFloatArray(R):C;else{N=bt.newFloatArray(R);const G=t.readInt(!0);if(B+=G,a===1)for(let V=G;V<B;V++)N[V]=t.readFloat();else for(let V=G;V<B;V++)N[V]=t.readFloat()*a;if(!I)for(let V=0,q=N.length;V<q;V++)N[V]+=C[V]}if(D.setFrame(O,M,N),O===A)break;const L=t.readFloat();switch(t.readByte()){case Lr:D.setStepped(O);break;case Br:jt(t,D,k++,O,0,M,L,0,1,1)}M=L}n.push(D);break}case $k:{const P=new za(E,_,S);for(let I=0;I<E;I++){const C=t.readFloat(),R=t.readInt32();P.setFrame(I,C,ru[R&15],R>>4,t.readFloat())}n.push(P);break}}}}}const o=s.slots.length,h=t.readInt(!0);if(h>0){const f=new Wr(h);for(let m=0;m<h;m++)f.setFrame(m,t.readFloat(),nb(t,o));n.push(f)}const l=t.readInt(!0);for(let f=0;f<l;f++){const m=t.readInt(!0),p=new Array(m);for(let _=0;_<m;_++)p[_]=t.readInt(!0);const g=t.readInt(!0),y=new an(g,p,o);for(let _=0;_<g;_++)y.setFrame(_,t.readFloat(),nb(t,m));n.push(y)}const c=t.readInt(!0);if(c>0){const f=new jn(c);for(let m=0;m<c;m++){const p=t.readFloat(),g=s.events[t.readInt(!0)],y=new kl(p,g);y.intValue=t.readInt(!1),y.floatValue=t.readFloat(),y.stringValue=t.readString(),y.stringValue==null&&(y.stringValue=g.setupPose.stringValue),y.data.audioPath&&(y.volume=t.readFloat(),y.balance=t.readFloat()),f.setFrame(m,y)}n.push(f)}let u=0;for(let f=0,m=n.length;f<m;f++)u=Math.max(u,n[f].getDuration());const d=new Pl(e,n,u);return r&&Ft.rgba8888ToColor(d.color,t.readInt32()),d}}class dg{constructor(t,e=[],s=0,r=new DataView(t instanceof ArrayBuffer?t:t.buffer)){x(this,"strings");x(this,"index");x(this,"buffer");this.strings=e,this.index=s,this.buffer=r}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){const t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){const t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),s=e&127;return(e&128)!==0&&(e=this.readByte(),s|=(e&127)<<7,(e&128)!==0&&(e=this.readByte(),s|=(e&127)<<14,(e&128)!==0&&(e=this.readByte(),s|=(e&127)<<21,(e&128)!==0&&(e=this.readByte(),s|=(e&127)<<28)))),t?s:s>>>1^-(s&1)}readStringRef(){const t=this.readInt(!0);return t===0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s<t;){const r=this.readUnsignedByte();switch(r>>4){case 12:case 13:e+=String.fromCharCode((r&31)<<6|this.readByte()&63),s+=2;break;case 14:e+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),s+=3;break;default:e+=String.fromCharCode(r),s++}}return e}readFloat(){const t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!==0}}let xk=class{constructor(t,e,s,r,n,a){x(this,"source");x(this,"skinIndex");x(this,"slotIndex");x(this,"sourceIndex");x(this,"mesh");x(this,"inheritTimelines");this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.sourceIndex=r,this.source=n,this.inheritTimelines=a}};class ib{constructor(t=null,e,s=0){x(this,"bones");x(this,"vertices");x(this,"length");this.bones=t,this.vertices=e,this.length=s}}var ii;(function(i){i[i.Region=0]="Region",i[i.BoundingBox=1]="BoundingBox",i[i.Mesh=2]="Mesh",i[i.LinkedMesh=3]="LinkedMesh",i[i.Path=4]="Path",i[i.Point=5]="Point",i[i.Clipping=6]="Clipping"})(ii||(ii={}));function Fe(i,t,e,s){e instanceof dr?bk(i,t,e,s):vk(i,t,e,s)}function bk(i,t,e,s){let r=i.readFloat(),n=i.readFloat()*s;for(let a=0,o=0,h=e.getFrameCount()-1;e.setFrame(a,r,n),a!==h;a++){const l=i.readFloat(),c=i.readFloat()*s;switch(i.readByte()){case Lr:e.setStepped(a);break;case Br:jt(i,e,o++,a,0,r,l,n,c,s)}r=l,n=c}t.push(e)}function vk(i,t,e,s){let r=i.readFloat(),n=i.readFloat()*s,a=i.readFloat()*s;for(let o=0,h=0,l=e.getFrameCount()-1;e.setFrame(o,r,n,a),o!==l;o++){const c=i.readFloat(),u=i.readFloat()*s,d=i.readFloat()*s;switch(i.readByte()){case Lr:e.setStepped(o);break;case Br:jt(i,e,h++,o,0,r,c,n,u,s),jt(i,e,h++,o,1,r,c,a,d,s)}r=c,n=u,a=d}t.push(e)}function nb(i,t){const e=i.readInt(!0);if(e===0)return null;const s=new Array(t).fill(-1),r=new Array(t-e);let n=0,a=0;for(let o=0;o<e;o++){const h=i.readInt(!0);for(;n!==h;)r[a++]=n++;s[n+i.readInt(!0)]=n++}for(;n<t;)r[a++]=n++;for(let o=t-1;o>=0;o--)s[o]===-1&&(s[o]=r[--a]);return s}function jt(i,t,e,s,r,n,a,o,h,l){t.setBezier(e,s,r,n,o,i.readFloat(),i.readFloat()*l,i.readFloat(),i.readFloat()*l,a,h)}const _k=0,wk=1,Tk=2,Sk=3,Ek=4,Ak=5,Ck=6,Ik=7,Pk=8,Mk=9,Rk=10,Fk=0,kk=1,Lk=2,Bk=3,Ok=4,Dk=5,Nk=0,Uk=1,Xk=2,Vk=3,Yk=4,Gk=0,$k=1,Hk=0,Wk=1,zk=2,jk=0,qk=1,Kk=2,Zk=4,Jk=5,Qk=6,tL=7,eL=8,sL=0,rL=1,Lr=1,Br=2;class fg{constructor(){x(this,"minX",0);x(this,"minY",0);x(this,"maxX",0);x(this,"maxY",0);x(this,"boundingBoxes",[]);x(this,"polygons",[]);x(this,"polygonPool",new $a(()=>bt.newFloatArray(16)))}update(t,e){if(!t)throw new Error("skeleton cannot be null.");const s=this.boundingBoxes,r=this.polygons,n=this.polygonPool,a=t.slots,o=a.length;s.length=0,n.freeAll(r),r.length=0;for(let h=0;h<o;h++){const l=a[h];if(!l.bone.active)continue;const c=l.appliedPose.attachment;if(c instanceof ro){s.push(c);let u=n.obtain();u.length!==c.worldVerticesLength&&(u=bt.newFloatArray(c.worldVerticesLength)),r.push(u),c.computeWorldVertices(t,l,0,c.worldVerticesLength,u,0,2)}}e?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const n=this.polygons;for(let a=0,o=n.length;a<o;a++){const h=n[a],l=h;for(let c=0,u=h.length;c<u;c+=2){const d=l[c],f=l[c+1];t=Math.min(t,d),e=Math.min(e,f),s=Math.max(s,d),r=Math.max(r,f)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=r}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,r){const n=this.minX,a=this.minY,o=this.maxX,h=this.maxY;if(t<=n&&s<=n||e<=a&&r<=a||t>=o&&s>=o||e>=h&&r>=h)return!1;const l=(r-e)/(s-t);let c=l*(n-t)+e;if(c>a&&c<h||(c=l*(o-t)+e,c>a&&c<h))return!0;let u=(a-e)/l+t;return u>n&&u<o||(u=(h-e)/l+t,u>n&&u<o)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){const s=this.polygons;for(let r=0,n=s.length;r<n;r++)if(this.containsPointPolygon(s[r],t,e))return this.boundingBoxes[r];return null}containsPointPolygon(t,e,s){const r=t,n=t.length;let a=n-2,o=!1;for(let h=0;h<n;h+=2){const l=r[h+1],c=r[a+1];if(l<s&&c>=s||c<s&&l>=s){const u=r[h];u+(s-l)/(c-l)*(r[a]-u)<e&&(o=!o)}a=h}return o}intersectsSegment(t,e,s,r){const n=this.polygons;for(let a=0,o=n.length;a<o;a++)if(this.intersectsSegmentPolygon(n[a],t,e,s,r))return this.boundingBoxes[a];return null}intersectsSegmentPolygon(t,e,s,r,n){const a=t,o=t.length,h=e-r,l=s-n,c=e*n-s*r;let u=a[o-2],d=a[o-1];for(let f=0;f<o;f+=2){const m=a[f],p=a[f+1],g=u*p-d*m,y=u-m,_=d-p,v=h*_-l*y,b=(c*y-h*g)/v;if((b>=u&&b<=m||b>=m&&b<=u)&&(b>=e&&b<=r||b>=r&&b<=e)){const T=(c*_-l*g)/v;if((T>=d&&T<=p||T>=p&&T<=d)&&(T>=s&&T<=n||T>=n&&T<=s))return!0}u=m,d=p}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");const e=this.boundingBoxes.indexOf(t);return e===-1?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}class Je{constructor(){x(this,"convexPolygons",[]);x(this,"convexPolygonsIndices",[]);x(this,"indicesArray",[]);x(this,"isConcaveArray",[]);x(this,"triangles",[]);x(this,"polygonPool",new $a(()=>[]));x(this,"polygonIndicesPool",new $a(()=>[]))}triangulate(t){const e=t;let s=t.length>>1;const r=this.indicesArray;r.length=0;for(let o=0;o<s;o++)r[o]=o;const n=this.isConcaveArray;n.length=0;for(let o=0;o<s;o++)n[o]=Je.isConcave(o,s,e,r);const a=this.triangles;for(a.length=0;s>3;){let o=s-1,h=0,l=1;for(;;){t:if(!n[h]){const d=r[o]<<1,f=r[h]<<1,m=r[l]<<1,p=e[d],g=e[d+1],y=e[f],_=e[f+1],v=e[m],b=e[m+1];for(let T=l+1<s?l+1:0;T!==o;){if(n[T]){const S=r[T]<<1,w=e[S],E=e[S+1];if(Je.positiveArea(v,b,p,g,w,E)&&Je.positiveArea(p,g,y,_,w,E)&&Je.positiveArea(y,_,v,b,w,E))break t}++T===s&&(T=0)}break}if(l===0){do{if(!n[h])break;h--}while(h>0);o=h>0?h-1:s-1,l=h+1<s?h+1:0;break}o=h,h=l,++l===s&&(l=0)}a.push(r[o],r[h],r[l]),r.splice(h,1),n.splice(h,1),s--;const c=h>0?h-1:s-1,u=h<s?h:0;n[c]=Je.isConcave(c,s,e,r),n[u]=Je.isConcave(u,s,e,r)}return s===3&&a.push(r[2],r[0],r[1]),a}decompose(t,e){const s=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;const n=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(n),n.length=0;let a=this.polygonIndicesPool.obtain();a.length=0;let o=this.polygonPool.obtain();o.length=0;let h=-1,l=0;for(let c=0,u=e.length;c<u;c+=3){const d=e[c]<<1,f=e[c+1]<<1,m=e[c+2]<<1,p=s[d],g=s[d+1],y=s[f],_=s[f+1],v=s[m],b=s[m+1];if(h===d){const T=o.length-4;if(Je.winding(o[T],o[T+1],o[T+2],o[T+3],v,b)===l&&Je.winding(v,b,o[0],o[1],o[2],o[3])===l){o.push(v,b),a.push(m);continue}}o.length>0&&(r.push(o),n.push(a),o=this.polygonPool.obtain(),a=this.polygonIndicesPool.obtain()),o.length=0,o.push(p,g,y,_),o.push(v,b),a.length=0,a.push(d,f,m),l=Je.winding(p,g,y,_,v,b),h=d}o.length>0&&(r.push(o),n.push(a));for(let c=0,u=r.length;c<u;c++){if(a=n[c],a.length===0)continue;const d=a[0];let f=a[a.length-1];o=r[c];const m=o.length-4;let p=o[m],g=o[m+1],y=o[m+2],_=o[m+3];const v=o[0],b=o[1],T=o[2],S=o[3],w=Je.winding(p,g,y,_,v,b);for(let E=0;E<u;E++){if(E===c)continue;const A=n[E];if(A.length!==3)continue;const P=A[0],I=A[1],C=A[2],R=r[E],F=R[R.length-2],D=R[R.length-1];P!==d||I!==f||Je.winding(p,g,y,_,F,D)===w&&Je.winding(F,D,v,b,T,S)===w&&(R.length=0,A.length=0,o.push(F,D),a.push(C),f=C,p=y,g=_,y=F,_=D,E=-1)}}for(let c=r.length-1;c>=0;c--)o=r[c],o.length===0?(r.splice(c,1),this.polygonPool.free(o),a=n[c],n.splice(c,1),this.polygonIndicesPool.free(a)):o.push(o[0],o[1]);return r}static isConcave(t,e,s,r){const n=r[t>0?t-1:e-1]<<1,a=r[t]<<1,o=r[t+1<e?t+1:0]<<1;return!Je.positiveArea(s[n],s[n+1],s[a],s[a+1],s[o],s[o+1])}static positiveArea(t,e,s,r,n,a){return t*(a-r)+s*(e-a)+n*(r-e)>=0}static winding(t,e,s,r,n,a){return t*(a-r)+s*(e-a)+n*(r-e)>=0?1:-1}}class ao{constructor(){x(this,"triangulator",null);x(this,"clippingPolygon",[]);x(this,"clippingPolygons",[]);x(this,"clipOutput",[]);x(this,"clippedVertices",[]);x(this,"clippedUVs",[]);x(this,"clippedTriangles",[]);x(this,"inverseVertices",[]);x(this,"_clippedVerticesTyped",new Float32Array(1024));x(this,"_clippedUVsTyped",new Float32Array(1024));x(this,"_clippedTrianglesTyped",new Uint16Array(1024));x(this,"clippedVerticesTyped",new Float32Array(0));x(this,"clippedUVsTyped",new Float32Array(0));x(this,"clippedTrianglesTyped",new Uint16Array(0));x(this,"clippedVerticesLength",0);x(this,"clippedUVsLength",0);x(this,"clippedTrianglesLength",0);x(this,"scratch",[]);x(this,"inverse",!1);x(this,"clipAttachment",null)}clipStart(t,e,s){if(this.clipAttachment)return;const r=s.worldVerticesLength;this.clipAttachment=s,this.inverse=s.inverse;const n=bt.setArraySize(this.clippingPolygon,r);s.computeWorldVertices(t,e,0,r,n,0,2);const a=this.clippingPolygon,o=this.makeClockwise(a);o||this.inverse||s.convex?(o||this.makeConvex(a),this.clippingPolygon.push(a[0],a[1]),this.clippingPolygons.push(a)):(this.triangulator===null&&(this.triangulator=new Je),this.clippingPolygons.push(...this.triangulator.decompose(a,this.triangulator.triangulate(a))))}clipEnd(t){this.clipAttachment&&(t&&this.clipAttachment.endSlot!==t.data||(this.clipAttachment=null,this.clippingPolygons.length=0))}isClipping(){return this.clipAttachment!=null}clipTriangles(t,e,s,r,n,a,o,h){return r&&n&&a&&typeof o=="boolean"&&typeof h=="number"?this.clipTrianglesRender(t,e,s,r,n,a,o,h):this.clipTrianglesNoRender(t,e,s)}clipTrianglesNoRender(t,e,s){const r=this.clippedVertices;r.length=0;const n=this.clippedTriangles;n.length=0;let a=0;if(this.inverse){const u=this.clippingPolygons[0];for(let d=0;d<s;d+=3){let f=e[d]<<1;const m=t[f],p=t[f+1];f=e[d+1]<<1;const g=t[f],y=t[f+1];f=e[d+2]<<1;const _=t[f],v=t[f+1];this.clipInverse(m,p,g,y,_,v,u);const b=this.inverseVertices;for(let T=0,S=this.inverseVertices.length;T<S;){const w=b[T++];let E=w>>1,A=r.length;const P=bt.setArraySize(r,A+w);bt.arrayCopy(b,T,P,A,w),A=n.length;const I=bt.setArraySize(n,A+3*(E-2));for(let C=1;C<E-1;C++,A+=3)I[A]=a,I[A+1]=a+C,I[A+2]=a+C+1;a+=E,T+=w}}return!0}const o=this.clipOutput,h=this.clippingPolygons,l=h.length;let c=null;for(let u=0;u<s;u+=3){let d=e[u]<<1;const f=t[d],m=t[d+1];d=e[u+1]<<1;const p=t[d],g=t[d+1];d=e[u+2]<<1;const y=t[d],_=t[d+1];for(let v=0;v<l;v++){let b=r.length;if(this.clip(f,m,p,g,y,_,h[v])){c=this.clipOutput;const T=o.length;if(T===0)continue;let S=T>>1;const w=bt.setArraySize(r,b+T);bt.arrayCopy(c,0,w,b,T),b=n.length;const E=bt.setArraySize(n,b+3*(S-2));S--;for(let A=1;A<S;A++,b+=3)E[b]=a,E[b+1]=a+A,E[b+2]=a+A+1;a+=S}else{const T=bt.setArraySize(r,b+6);T[b]=f,T[b+1]=m,T[b+2]=p,T[b+3]=g,T[b+4]=y,T[b+5]=_,b=n.length;const S=bt.setArraySize(n,b+3);S[b]=a,S[b+1]=a+1,S[b+2]=a+2,a+=3;break}}}return c!=null}clipTrianglesRender(t,e,s,r,n,a,o,h){const l=this.clippedVertices;l.length=0;const c=this.clippedTriangles;c.length=0;let u=0;if(this.inverse){const g=this.clippingPolygons[0];for(let y=0;y<s;y+=3){let _=e[y],v=e[y+1],b=e[y+2];const T=t[_*h],S=t[_*h+1],w=t[v*h],E=t[v*h+1],A=t[b*h],P=t[b*h+1];this.clipInverse(T,S,w,E,A,P,g);const I=this.inverseVertices.length;if(I===0)continue;const C=r[_<<=1],R=r[_+1],F=r[v<<=1],D=r[v+1],M=r[b<<=1],O=r[b+1],k=E-P,N=A-w,B=T-A,L=P-S,G=1/(k*B+N*(S-P)),V=this.inverseVertices;for(let q=0;q<I;){const H=V[q++],at=H>>1;let et=l.length;const ot=bt.setArraySize(l,et+at*h);for(let rt=0;rt<H;rt+=2,et+=h){const dt=V[q+rt],X=V[q+rt+1];ot[et]=dt,ot[et+1]=X,ot[et+2]=n.r,ot[et+3]=n.g,ot[et+4]=n.b,ot[et+5]=n.a;const $=dt-A,K=X-P,J=(k*$+N*K)*G,Q=(L*$+B*K)*G,it=1-J-Q;ot[et+6]=C*J+F*Q+M*it,ot[et+7]=R*J+D*Q+O*it,o&&(ot[et+8]=a.r,ot[et+9]=a.g,ot[et+10]=a.b,ot[et+11]=a.a)}et=c.length;const ct=bt.setArraySize(c,et+3*(at-2));for(let rt=1;rt<at-1;rt++,et+=3)ct[et]=u,ct[et+1]=u+rt,ct[et+2]=u+rt+1;u+=at,q+=H}}return!0}const d=this.clipOutput,f=this.clippingPolygons,m=this.clippingPolygons.length;let p=null;for(let g=0;g<s;g+=3){let y=e[g];const _=t[y*h],v=t[y*h+1],b=r[y<<1],T=r[(y<<1)+1];y=e[g+1];const S=t[y*h],w=t[y*h+1],E=r[y<<1],A=r[(y<<1)+1];y=e[g+2];const P=t[y*h],I=t[y*h+1],C=r[y<<1],R=r[(y<<1)+1];let F=0,D=0,M=0,O=0,k=0;for(let N=0;N<m;N++){let B=l.length;if(this.clip(_,v,S,w,P,I,f[N])){p=this.clipOutput;const L=d.length;if(L===0)continue;let G=L>>1;k===0&&(F=w-I,D=P-S,M=_-P,O=I-v,k=1/(F*M-D*O));const V=bt.setArraySize(l,B+G*h);for(let H=0;H<L;H+=2,B+=h){const at=p[H],et=p[H+1];V[B]=at,V[B+1]=et,V[B+2]=n.r,V[B+3]=n.g,V[B+4]=n.b,V[B+5]=n.a;const ot=at-P,ct=et-I,rt=(F*ot+D*ct)*k,dt=(O*ot+M*ct)*k,X=1-rt-dt;V[B+6]=b*rt+E*dt+C*X,V[B+7]=T*rt+A*dt+R*X,o&&(V[B+8]=a.r,V[B+9]=a.g,V[B+10]=a.b,V[B+11]=a.a)}B=c.length;const q=bt.setArraySize(c,B+3*(G-2));G--;for(let H=1;H<G;H++,B+=3)q[B]=u,q[B+1]=u+H,q[B+2]=u+H+1;u+=G+1}else{const L=bt.setArraySize(l,B+3*h);L[B]=_,L[B+1]=v,L[B+2]=n.r,L[B+3]=n.g,L[B+4]=n.b,L[B+5]=n.a,o?(L[B+6]=b,L[B+7]=T,L[B+8]=a.r,L[B+9]=a.g,L[B+10]=a.b,L[B+11]=a.a,L[B+12]=S,L[B+13]=w,L[B+14]=n.r,L[B+15]=n.g,L[B+16]=n.b,L[B+17]=n.a,L[B+18]=E,L[B+19]=A,L[B+20]=a.r,L[B+21]=a.g,L[B+22]=a.b,L[B+23]=a.a,L[B+24]=P,L[B+25]=I,L[B+26]=n.r,L[B+27]=n.g,L[B+28]=n.b,L[B+29]=n.a,L[B+30]=C,L[B+31]=R,L[B+32]=a.r,L[B+33]=a.g,L[B+34]=a.b,L[B+35]=a.a):(L[B+6]=b,L[B+7]=T,L[B+8]=S,L[B+9]=w,L[B+10]=n.r,L[B+11]=n.g,L[B+12]=n.b,L[B+13]=n.a,L[B+14]=E,L[B+15]=A,L[B+16]=P,L[B+17]=I,L[B+18]=n.r,L[B+19]=n.g,L[B+20]=n.b,L[B+21]=n.a,L[B+22]=C,L[B+23]=R),B=c.length;const G=bt.setArraySize(c,B+3);G[B]=u,G[B+1]=u+1,G[B+2]=u+2,u+=3;break}}}return p!=null}clipTrianglesUnpacked(t,e,s,r,n,a=2){let o=this._clippedVerticesTyped,h=this._clippedUVsTyped,l=this._clippedTrianglesTyped,c=0;if(this.clippedVerticesLength=0,this.clippedUVsLength=0,this.clippedTrianglesLength=0,this.inverse){const p=this.clippingPolygons[0];for(let g=0;g<r;g+=3){let y=s[g]*a;const _=t[e+y],v=t[e+y+1];let b=s[g]<<1;const T=n[b],S=n[b+1];y=s[g+1]*a;const w=t[e+y],E=t[e+y+1];b=s[g+1]<<1;const A=n[b],P=n[b+1];y=s[g+2]*a;const I=t[e+y],C=t[e+y+1];b=s[g+2]<<1;const R=n[b],F=n[b+1];this.clipInverse(_,v,w,E,I,C,p);const D=this.inverseVertices.length;if(D===0)continue;const M=E-C,O=I-w,k=_-I,N=C-v,B=1/(M*k+O*(v-C)),L=this.inverseVertices;for(let G=0;G<D;){const V=L[G++],q=V>>1;let H=this.clippedVerticesLength;const at=H+q*a,et=this.clippedUVsLength+q*2;o.length<at&&(this._clippedVerticesTyped=new Float32Array(at*2),this._clippedVerticesTyped.set(o.subarray(0,H)),o=this._clippedVerticesTyped),h.length<et&&(this._clippedUVsTyped=new Float32Array(et*2),this._clippedUVsTyped.set(h.subarray(0,this.clippedUVsLength)),h=this._clippedUVsTyped),this.clippedVerticesLength=at,this.clippedUVsLength=et;const ot=this._clippedVerticesTyped,ct=this._clippedUVsTyped;let rt=et-q*2;for(let $=0;$<V;$+=2,H+=a,rt+=2){const K=L[G+$],J=L[G+$+1];ot[H]=K,ot[H+1]=J;const Q=K-I,it=J-C,U=(M*Q+O*it)*B,Y=(N*Q+k*it)*B,W=1-U-Y;ct[rt]=T*U+A*Y+R*W,ct[rt+1]=S*U+P*Y+F*W}H=this.clippedTrianglesLength;const dt=H+3*(q-2);l.length<dt&&(this._clippedTrianglesTyped=new Uint16Array(dt*2),this._clippedTrianglesTyped.set(l.subarray(0,H)),l=this._clippedTrianglesTyped),this.clippedTrianglesLength=dt;const X=l;for(let $=1;$<q-1;$++,H+=3)X[H]=c,X[H+1]=c+$,X[H+2]=c+$+1;c+=q,G+=V}}return this.clippedVerticesTyped=this._clippedVerticesTyped.subarray(0,this.clippedVerticesLength),this.clippedUVsTyped=this._clippedUVsTyped.subarray(0,this.clippedUVsLength),this.clippedTrianglesTyped=this._clippedTrianglesTyped.subarray(0,this.clippedTrianglesLength),!0}const u=this.clipOutput,d=this.clippingPolygons,f=this.clippingPolygons.length;let m=null;for(let p=0;p<r;p+=3){let g=s[p],y=g*a;const _=t[e+y],v=t[e+y+1];let b=g<<1;const T=n[b],S=n[b+1];g=s[p+1],y=g*a;const w=t[e+y],E=t[e+y+1];b=g<<1;const A=n[b],P=n[b+1];g=s[p+2],y=g*a;const I=t[e+y],C=t[e+y+1];b=g<<1;const R=n[b],F=n[b+1];let D=0,M=0,O=0,k=0,N=0;for(let B=0;B<f;B++){let L=this.clippedVerticesLength;if(this.clip(_,v,w,E,I,C,d[B])){m=u;const G=u.length;if(G===0)continue;let V=G>>1;N===0&&(D=E-C,M=I-w,O=_-I,k=C-v,N=1/(D*O-M*k));const q=L+V*a;o.length<q&&(this._clippedVerticesTyped=new Float32Array(q*2),this._clippedVerticesTyped.set(o.subarray(0,L)),this._clippedUVsTyped=new Float32Array((this.clippedUVsLength+V*2)*2),this._clippedUVsTyped.set(h.subarray(0,this.clippedUVsLength)),o=this._clippedVerticesTyped,h=this._clippedUVsTyped);const H=o,at=h;this.clippedVerticesLength=q;let et=this.clippedUVsLength;this.clippedUVsLength=et+V*2;for(let rt=0;rt<G;rt+=2,L+=a,et+=2){const dt=m[rt],X=m[rt+1];H[L]=dt,H[L+1]=X;const $=dt-I,K=X-C,J=(D*$+M*K)*N,Q=(k*$+O*K)*N,it=1-J-Q;at[et]=T*J+A*Q+R*it,at[et+1]=S*J+P*Q+F*it}L=this.clippedTrianglesLength;const ot=L+3*(V-2);l.length<ot&&(this._clippedTrianglesTyped=new Uint16Array(ot*2),this._clippedTrianglesTyped.set(l.subarray(0,L)),l=this._clippedTrianglesTyped),this.clippedTrianglesLength=ot;const ct=l;V--;for(let rt=1;rt<V;rt++,L+=3)ct[L]=c,ct[L+1]=c+rt,ct[L+2]=c+rt+1;c+=V+1}else{let G=L+3*a;o.length<G&&(this._clippedVerticesTyped=new Float32Array(G*2),this._clippedVerticesTyped.set(o.subarray(0,L)),o=this._clippedVerticesTyped),o[L]=_,o[L+1]=v,o[L+a]=w,o[L+a+1]=E,o[L+a*2]=I,o[L+a*2+1]=C;const V=this.clippedUVsLength+6;h.length<V&&(this._clippedUVsTyped=new Float32Array(V*2),this._clippedUVsTyped.set(h.subarray(0,this.clippedUVsLength)),h=this._clippedUVsTyped);const q=this.clippedUVsLength;h[q]=T,h[q+1]=S,h[q+2]=A,h[q+3]=P,h[q+4]=R,h[q+5]=F,this.clippedVerticesLength=G,this.clippedUVsLength=V,L=this.clippedTrianglesLength,G=L+3,l.length<G&&(this._clippedTrianglesTyped=new Uint16Array(G*2),this._clippedTrianglesTyped.set(l.subarray(0,L)),l=this._clippedTrianglesTyped);const H=l;H[L]=c,H[L+1]=c+1,H[L+2]=c+2,c+=3,this.clippedTrianglesLength=G;break}}}return this.clippedVerticesTyped=this._clippedVerticesTyped.subarray(0,this.clippedVerticesLength),this.clippedUVsTyped=this._clippedUVsTyped.subarray(0,this.clippedUVsLength),this.clippedTrianglesTyped=this._clippedTrianglesTyped.subarray(0,this.clippedTrianglesLength),m!==null}clip(t,e,s,r,n,a,o){const h=this.clipOutput;let l=!1,c,u;o.length%4>=2?(c=this.clipOutput,u=this.scratch):(c=this.scratch,u=this.clipOutput);const d=o;c.length=8;const f=c;f[0]=t,f[1]=e,f[2]=s,f[3]=r,f[4]=n,f[5]=a,f[6]=t,f[7]=e,u.length=0;const m=o.length-4;for(let p=0;;p+=2){const g=d[p],y=d[p+1],_=g-d[p+2],v=y-d[p+3],b=u.length,T=c;t=T[0],e=T[1];let S=v*(g-t)-_*(y-e);for(let E=2,A=c.length-2;E<=A;E+=2){s=T[E],r=T[E+1];const P=v*(g-s)-_*(y-r);if(S>0)if(P>0)u.push(s,r);else{const I=s-t,C=r-e,R=S/(I*v-C*_);R>=0&&R<=1?(u.push(t+I*R,e+C*R),l=!0):u.push(s,r)}else if(P>0){const I=s-t,C=r-e,R=S/(I*v-C*_);R>=0&&R<=1?(u.push(t+I*R,e+C*R,s,r),l=!0):u.push(s,r)}else l=!0;t=s,e=r,S=P}if(b===u.length)return h.length=0,!0;if(u.push(u[0],u[1]),p===m)break;const w=u;u=c,u.length=0,c=w}if(h!==u){h.length=0;for(let p=0,g=u.length-2;p<g;p++)h[p]=u[p]}else h.length=h.length-2;return l}clipInverse(t,e,s,r,n,a,o){this.inverseVertices.length=0;const h=o.length-4;let l,c;o.length%4>=2?(l=this.clipOutput,c=this.scratch):(l=this.scratch,c=this.clipOutput),l.length=8;let u=o,d=l;d[0]=t,d[1]=e,d[2]=s,d[3]=r,d[4]=n,d[5]=a,d[6]=t,d[7]=e,c.length=0;for(let f=0;;f+=2){const m=u[f],p=u[f+1],g=m-u[f+2],y=p-u[f+3],_=c.length,v=this.inverseVertices.length;this.inverseVertices.push(0),d=l,t=d[0],e=d[1];let b=y*(m-t)-g*(p-e);for(let w=2,E=l.length-2;w<=E;w+=2){s=d[w],r=d[w+1];const A=y*(m-s)-g*(p-r);if(b>0)if(A>0)c.push(s,r);else{const P=s-t,I=r-e,C=b/(P*y-I*g);if(C>=0&&C<=1){const R=t+P*C,F=e+I*C;c.push(R,F),this.inverseVertices.push(R,F,s,r)}else c.push(s,r)}else if(A>0){const P=s-t,I=r-e,C=b/(P*y-I*g);if(C>=0&&C<=1){const R=t+P*C,F=e+I*C;this.inverseVertices.push(R,F),c.push(R,F,s,r)}else c.push(s,r)}else this.inverseVertices.push(s,r);t=s,e=r,b=A}const T=this.inverseVertices.length-v-1;if(T>=6?this.inverseVertices[v]=T:this.inverseVertices.length=v,_===c.length||(c.push(c[0],c[1]),f===h))break;const S=c;c=l,c.length=0,l=S}}makeClockwise(t){const e=t,s=t.length;let r=!0,n=!0,a=0,o=e[s-2],h=e[s-1],l=e[0],c=e[1];for(let d=2;d<s;d+=2){const f=e[d],m=e[d+1];a+=l*m-f*c;const p=(l-o)*(m-c)-(c-h)*(f-l);n=n&&p<=0,r=r&&p>=0,o=l,h=c,l=f,c=m}a+=l*e[1]-e[0]*c;const u=(l-o)*(e[1]-c)-(c-h)*(e[0]-l);if(n=n&&u<=0,r=r&&u>=0,a>=0){for(let d=0,f=s-2,m=s>>1;d<m;d+=2){const p=e[d],g=e[d+1],y=f-d;e[d]=e[y],e[d+1]=e[y+1],e[y]=p,e[y+1]=g}return r}return n}makeConvex(t){const e=t.length,s=t;this.clipOutput.length=e;const r=this.clipOutput;r[0]=s[0],r[1]=s[1];for(let o=2;o<e;o+=2){const h=s[o],l=s[o+1];let c=o-2;for(;c>=0&&(r[c]>h||r[c]===h&&r[c+1]>l);c-=2)r[c+2]=r[c],r[c+3]=r[c+1];r[c+2]=h,r[c+3]=l}s[0]=r[0],s[1]=r[1],s[2]=r[2],s[3]=r[3];let n=4;for(let o=4;o<e;o+=2,n+=2){const h=r[o],l=r[o+1];for(;(s[n-2]-s[n-4])*(l-s[n-3])-(s[n-1]-s[n-3])*(h-s[n-4])>=0&&(n-=2,n!==2););s[n]=h,s[n+1]=l}s[n]=r[e-4],s[n+1]=r[e-3];const a=n;n+=2;for(let o=e-6;o>=0;o-=2,n+=2){const h=r[o],l=r[o+1];for(;(s[n-2]-s[n-4])*(l-s[n-3])-(s[n-1]-s[n-3])*(h-s[n-4])>=0&&(n-=2,n!==a););s[n]=h,s[n+1]=l}t.length=n-2}}class mg{constructor(t){x(this,"attachmentLoader");x(this,"scale",1);x(this,"linkedMeshes",[]);this.attachmentLoader=t}readSkeletonData(t){const e=this.scale,s=new Bl,r=typeof t=="string"?JSON.parse(t):t,n=r.skeleton;if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=z(n,"referenceScale",100)*e,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),r.bones)for(let a=0;a<r.bones.length;a++){const o=r.bones[a];let h=null;const l=z(o,"parent",null);l&&(h=s.findBone(l));const c=new io(s.bones.length,o.name,h);c.length=z(o,"length",0)*e;const u=c.setupPose;u.x=z(o,"x",0)*e,u.y=z(o,"y",0)*e,u.rotation=z(o,"rotation",0),u.scaleX=z(o,"scaleX",1),u.scaleY=z(o,"scaleY",1),u.shearX=z(o,"shearX",0),u.shearY=z(o,"shearY",0),u.inherit=bt.enumValue(be,z(o,"inherit","Normal")),c.skinRequired=z(o,"skin",!1);const d=z(o,"color",null);d&&c.color.setFromString(d),c.icon=z(o,"icon",void 0),c.iconSize=z(o,"iconSize",1),c.iconRotation=z(o,"iconRotation",0),s.bones.push(c)}if(r.slots)for(let a=0;a<r.slots.length;a++){const o=r.slots[a],h=o.name,l=s.findBone(o.bone);if(!l)throw new Error(`Couldn't find bone ${o.bone} for slot ${h}`);const c=new Du(s.slots.length,h,l),u=z(o,"color",null);u&&c.setupPose.color.setFromString(u);const d=z(o,"dark",null);d&&(c.setupPose.darkColor=Ft.fromString(d)),c.attachmentName=z(o,"attachment",null),c.blendMode=bt.enumValue(fr,z(o,"blend","normal")),c.visible=z(o,"visible",!0),s.slots.push(c)}if(r.constraints)for(const a of r.constraints){const o=a.name,h=z(a,"skin",!1);switch(z(a,"type",!1)){case"ik":{const l=new Ba(o);l.skinRequired=h;for(let m=0;m<a.bones.length;m++){const p=s.findBone(a.bones[m]);if(!p)throw new Error(`Couldn't find bone ${a.bones[m]} for IK constraint ${o}.`);l.bones.push(p)}const c=a.target,u=s.findBone(c);if(!u)throw new Error(`Couldn't find target bone ${c} for IK constraint ${o}.`);l.target=u;const d=z(a,"scaleY",null);d!=null&&(l.scaleYMode=bt.enumValue(es,d));const f=l.setupPose;f.mix=z(a,"mix",1),f.softness=z(a,"softness",0)*e,f.bendDirection=z(a,"bendPositive",!0)?1:-1,f.compress=z(a,"compress",!1),f.stretch=z(a,"stretch",!1),s.constraints.push(l);break}case"transform":{const l=new te(o);l.skinRequired=h;for(let b=0;b<a.bones.length;b++){const T=a.bones[b],S=s.findBone(T);if(!S)throw new Error(`Couldn't find bone ${T} for transform constraint ${a.name}.`);l.bones.push(S)}const c=a.source,u=s.findBone(c);if(!u)throw new Error(`Couldn't find source bone ${c} for transform constraint ${a.name}.`);l.source=u,l.localSource=z(a,"localSource",!1),l.localTarget=z(a,"localTarget",!1),l.additive=z(a,"additive",!1),l.clamp=z(a,"clamp",!1);let d=!1,f=!1,m=!1,p=!1,g=!1,y=!1;const _=Object.entries(z(a,"properties",{}));for(const[b,T]of _){const S=this.fromProperty(b),w=this.propertyScale(b,e);S.offset=z(T,"offset",0)*w;const E=Object.entries(z(T,"to",{}));for(const[A,P]of E){let I=1,C;switch(A){case"rotate":{d=!0,C=new Nu;break}case"x":{f=!0,C=new Uu,I=e;break}case"y":{m=!0,C=new Xu,I=e;break}case"scaleX":{p=!0,C=new Vu;break}case"scaleY":{g=!0,C=new Yu;break}case"shearY":{y=!0,C=new Gu;break}default:throw new Error(`Invalid transform constraint to property: ${A}`)}C.offset=z(P,"offset",0)*I,C.max=z(P,"max",1)*I,C.scale=z(P,"scale",1)*I/w,S.to.push(C)}S.to.length>0&&l.properties.push(S)}l.offsets[te.ROTATION]=z(a,"rotation",0),l.offsets[te.X]=z(a,"x",0)*e,l.offsets[te.Y]=z(a,"y",0)*e,l.offsets[te.SCALEX]=z(a,"scaleX",0),l.offsets[te.SCALEY]=z(a,"scaleY",0),l.offsets[te.SHEARY]=z(a,"shearY",0);const v=l.setupPose;d&&(v.mixRotate=z(a,"mixRotate",1)),f&&(v.mixX=z(a,"mixX",1)),m&&(v.mixY=z(a,"mixY",v.mixX)),p&&(v.mixScaleX=z(a,"mixScaleX",1)),g&&(v.mixScaleY=z(a,"mixScaleY",v.mixScaleX)),y&&(v.mixShearY=z(a,"mixShearY",1)),s.constraints.push(l);break}case"path":{const l=new Oa(o);l.skinRequired=h;for(let f=0;f<a.bones.length;f++){const m=a.bones[f],p=s.findBone(m);if(!p)throw new Error(`Couldn't find bone ${m} for path constraint ${a.name}.`);l.bones.push(p)}const c=a.slot,u=s.findSlot(c);if(!u)throw new Error(`Couldn't find slot ${c} for path constraint ${a.name}.`);l.slot=u,l.positionMode=bt.enumValue(Qs,z(a,"positionMode","Percent")),l.spacingMode=bt.enumValue(ke,z(a,"spacingMode","Length")),l.rotateMode=bt.enumValue(Ti,z(a,"rotateMode","Tangent")),l.offsetRotation=z(a,"rotation",0);const d=l.setupPose;d.position=z(a,"position",0),l.positionMode===Qs.Fixed&&(d.position*=e),d.spacing=z(a,"spacing",0),(l.spacingMode===ke.Length||l.spacingMode===ke.Fixed)&&(d.spacing*=e),d.mixRotate=z(a,"mixRotate",1),d.mixX=z(a,"mixX",1),d.mixY=z(a,"mixY",d.mixX),s.constraints.push(l);break}case"physics":{const l=new Da(o);l.skinRequired=h;const c=a.bone,u=s.findBone(c);if(u==null)throw new Error(`Physics bone not found: ${c}`);l.bone=u,l.x=z(a,"x",0),l.y=z(a,"y",0),l.rotate=z(a,"rotate",0),l.scaleX=z(a,"scaleX",0);const d=z(a,"scaleY",null);d!=null&&(l.scaleYMode=bt.enumValue(es,d)),l.shearX=z(a,"shearX",0),l.limit=z(a,"limit",5e3)*e,l.step=1/z(a,"fps",60);const f=l.setupPose;f.inertia=z(a,"inertia",.5),f.strength=z(a,"strength",100),f.damping=z(a,"damping",.85),f.massInverse=1/z(a,"mass",1),f.wind=z(a,"wind",0),f.gravity=z(a,"gravity",0),f.mix=z(a,"mix",1),l.inertiaGlobal=z(a,"inertiaGlobal",!1),l.strengthGlobal=z(a,"strengthGlobal",!1),l.dampingGlobal=z(a,"dampingGlobal",!1),l.massGlobal=z(a,"massGlobal",!1),l.windGlobal=z(a,"windGlobal",!1),l.gravityGlobal=z(a,"gravityGlobal",!1),l.mixGlobal=z(a,"mixGlobal",!1),s.constraints.push(l);break}case"slider":{const l=new yi(o);l.skinRequired=h,l.additive=z(a,"additive",!1),l.loop=z(a,"loop",!1),l.setupPose.mix=z(a,"mix",1);const c=a.bone;if(c){if(l.bone=s.findBone(c),!l.bone)throw new Error(`Slider bone not found: ${c}`);const u=a.property;l.property=this.fromProperty(u);const d=this.propertyScale(u,e);l.property.offset=z(a,"from",0)*d,l.offset=z(a,"to",0),l.scale=z(a,"scale",1)/d,l.max=z(a,"max",0),l.local=z(a,"local",!1)}else l.setupPose.time=z(a,"time",0);s.constraints.push(l);break}}}if(r.skins)for(let a=0;a<r.skins.length;a++){const o=r.skins[a],h=new Ka(o.name);if(o.bones)for(let l=0;l<o.bones.length;l++){const c=o.bones[l],u=s.findBone(c);if(!u)throw new Error(`Couldn't find bone ${c} for skin ${o.name}.`);h.bones.push(u)}if(o.ik)for(let l=0;l<o.ik.length;l++){const c=o.ik[l],u=s.findConstraint(c,Ba);if(!u)throw new Error(`Couldn't find IK constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.transform)for(let l=0;l<o.transform.length;l++){const c=o.transform[l],u=s.findConstraint(c,te);if(!u)throw new Error(`Couldn't find transform constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.path)for(let l=0;l<o.path.length;l++){const c=o.path[l],u=s.findConstraint(c,Oa);if(!u)throw new Error(`Couldn't find path constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.physics)for(let l=0;l<o.physics.length;l++){const c=o.physics[l],u=s.findConstraint(c,Da);if(!u)throw new Error(`Couldn't find physics constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}if(o.slider)for(let l=0;l<o.slider.length;l++){const c=o.slider[l],u=s.findConstraint(c,yi);if(!u)throw new Error(`Couldn't find slider constraint ${c} for skin ${o.name}.`);h.constraints.push(u)}for(const l in o.attachments){const c=s.findSlot(l);if(!c)throw new Error(`Couldn't find skin slot ${l} for skin ${o.name}.`);const u=o.attachments[l];for(const d in u){const f=this.readAttachment(u[d],h,c.index,d,s);f&&h.setAttachment(c.index,d,f)}}s.skins.push(h),h.name==="default"&&(s.defaultSkin=h)}for(let a=0,o=this.linkedMeshes.length;a<o;a++){const h=this.linkedMeshes[a],l=h.skin?s.findSkin(h.skin):s.defaultSkin;if(!l)throw new Error(`Skin not found: ${h.skin}`);const c=l.getAttachment(h.sourceIndex,h.source);if(!c)throw new Error(`Source mesh not found: ${h.source}`);h.mesh.timelineAttachment=h.inheritTimelines?c:h.mesh,h.mesh.setSourceMesh(c),h.mesh.updateSequence();t:if(h.inheritTimelines&&h.slotIndex!==h.sourceIndex){const u=c.timelineSlots;for(const f of u)if(f===h.slotIndex)break t;const d=[...u];d[u.length]=h.slotIndex,c.timelineSlots=d}}if(this.linkedMeshes.length=0,r.events)for(const a in r.events){const o=r.events[a],h=new Ou(a),l=h.setupPose;l.intValue=z(o,"int",0),l.floatValue=z(o,"float",0),l.stringValue=z(o,"string",""),h._audioPath=z(o,"audio",null),h.audioPath&&(l.volume=z(o,"volume",l.volume),l.balance=z(o,"balance",l.balance)),s.events.push(h)}if(r.animations)for(const a in r.animations){const o=r.animations[a];this.readAnimation(o,a,s)}if(r.constraints)for(const a in r.constraints){const o=r.constraints[a];if(o.type==="slider"){const h=s.findConstraint(o.name,yi),l=o.animation,c=s.findAnimation(l);if(!c)throw new Error(`Slider animation not found: ${l}`);h.animation=c}}return s}fromProperty(t){let e;switch(t){case"rotate":e=new gl;break;case"x":e=new yl;break;case"y":e=new xl;break;case"scaleX":e=new bl;break;case"scaleY":e=new vl;break;case"shearY":e=new _l;break;default:throw new Error(`Invalid transform constraint from property: ${t}`)}return e}propertyScale(t,e){switch(t){case"x":case"y":return e;default:return 1}}readAttachment(t,e,s,r,n){const a=this.scale,o=z(t,"name",r);switch(z(t,"type","region")){case"region":{const h=z(t,"path",o),l=this.readSequence(z(t,"sequence",null)),c=this.attachmentLoader.newRegionAttachment(e,r,o,h,l);if(!c)return null;c.path=h,c.x=z(t,"x",0)*a,c.y=z(t,"y",0)*a,c.scaleX=z(t,"scaleX",1),c.scaleY=z(t,"scaleY",1),c.rotation=z(t,"rotation",0),c.width=t.width*a,c.height=t.height*a;const u=z(t,"color",null);return u&&c.color.setFromString(u),c.updateSequence(),c}case"boundingbox":{const h=this.attachmentLoader.newBoundingBoxAttachment(e,r,o);if(!h)return null;this.readVertices(t,h,t.vertexCount<<1);const l=z(t,"color",null);return l&&h.color.setFromString(l),h}case"mesh":case"linkedmesh":{const h=z(t,"path",o),l=this.readSequence(z(t,"sequence",null)),c=this.attachmentLoader.newMeshAttachment(e,r,o,h,l);if(!c)return null;c.path=h;const u=z(t,"color",null);u&&c.color.setFromString(u),c.width=z(t,"width",0)*a,c.height=z(t,"height",0)*a;const d=z(t,"source",null);if(d){let m=s;const p=z(t,"slot",null);if(p){const g=n.findSlot(p);if(!g)throw new Error(`Source mesh slot not found: ${p}`);m=g.index}return this.linkedMeshes.push(new iL(c,z(t,"skin",null),s,m,d,z(t,"timelines",!0))),c}const f=t.uvs;return this.readVertices(t,c,f.length),c.triangles=t.triangles,c.regionUVs=f,c.edges=z(t,"edges",null),c.hullLength=z(t,"hull",0)*2,c.updateSequence(),c}case"path":{const h=this.attachmentLoader.newPathAttachment(e,r,o);if(!h)return null;h.closed=z(t,"closed",!1),h.constantSpeed=z(t,"constantSpeed",!0);const l=t.vertexCount;this.readVertices(t,h,l<<1);const c=bt.newArray(l/3,0);for(let d=0;d<t.lengths.length;d++)c[d]=t.lengths[d]*a;h.lengths=c;const u=z(t,"color",null);return u&&h.color.setFromString(u),h}case"point":{const h=this.attachmentLoader.newPointAttachment(e,r,o);if(!h)return null;h.x=z(t,"x",0)*a,h.y=z(t,"y",0)*a,h.rotation=z(t,"rotation",0);const l=z(t,"color",null);return l&&h.color.setFromString(l),h}case"clipping":{const h=this.attachmentLoader.newClippingAttachment(e,r,o);if(!h)return null;const l=z(t,"end",null);l&&(h.endSlot=n.findSlot(l)),h.convex=z(t,"convex",!1),h.inverse=z(t,"inverse",!1);const c=t.vertexCount;this.readVertices(t,h,c<<1);const u=z(t,"color",null);return u&&h.color.setFromString(u),h}}return null}readSequence(t){if(t==null)return new nn(1,!1);const e=new nn(z(t,"count",0),!0);return e.start=z(t,"start",1),e.digits=z(t,"digits",0),e.setupIndex=z(t,"setup",0),e}readVertices(t,e,s){const r=this.scale;e.worldVerticesLength=s;const n=t.vertices;if(s===n.length){const h=bt.toFloatArray(n);if(r!==1)for(let l=0,c=n.length;l<c;l++)h[l]*=r;e.vertices=h;return}const a=[],o=[];for(let h=0,l=n.length;h<l;){const c=n[h++];o.push(c);for(let u=h+c*4;h<u;h+=4)o.push(n[h]),a.push(n[h+1]*r),a.push(n[h+2]*r),a.push(n[h+3])}e.bones=o,e.vertices=bt.toFloatArray(a)}readAnimation(t,e,s){const r=this.scale,n=[];if(t.slots)for(const l in t.slots){const c=t.slots[l],u=s.findSlot(l);if(!u)throw new Error(`Slot not found: ${l}`);const d=u.index;for(const f in c){const m=c[f];if(!m)continue;const p=m.length;switch(f){case"attachment":{const g=new Yn(p,d);for(let y=0;y<p;y++){const _=m[y];g.setFrame(y,z(_,"time",0),z(_,"name",null))}n.push(g);break}case"rgba":{const g=new mu(p,p<<2,d);let y=m[0],_=z(y,"time",0),v=Ft.fromString(y.color);for(let b=0,T=0;;b++){g.setFrame(b,_,v.r,v.g,v.b,v.a);const S=m[b+1];if(!S){g.shrink(T);break}const w=z(S,"time",0),E=Ft.fromString(S.color),A=y.curve;A&&(T=Qt(A,g,T,b,0,_,w,v.r,E.r,1),T=Qt(A,g,T,b,1,_,w,v.g,E.g,1),T=Qt(A,g,T,b,2,_,w,v.b,E.b,1),T=Qt(A,g,T,b,3,_,w,v.a,E.a,1)),_=w,v=E,y=S}n.push(g);break}case"rgb":{const g=new pu(p,p*3,d);let y=m[0],_=z(y,"time",0),v=Ft.fromString(y.color);for(let b=0,T=0;;b++){g.setFrame(b,_,v.r,v.g,v.b);const S=m[b+1];if(!S){g.shrink(T);break}const w=z(S,"time",0),E=Ft.fromString(S.color),A=y.curve;A&&(T=Qt(A,g,T,b,0,_,w,v.r,E.r,1),T=Qt(A,g,T,b,1,_,w,v.g,E.g,1),T=Qt(A,g,T,b,2,_,w,v.b,E.b,1)),_=w,v=E,y=S}n.push(g);break}case"alpha":{Fs(n,m,new gu(p,p,d),0,1);break}case"rgba2":{const g=new yu(p,p*7,d);let y=m[0],_=z(y,"time",0),v=Ft.fromString(y.light),b=Ft.fromString(y.dark);for(let T=0,S=0;;T++){g.setFrame(T,_,v.r,v.g,v.b,v.a,b.r,b.g,b.b);const w=m[T+1];if(!w){g.shrink(S);break}const E=z(w,"time",0),A=Ft.fromString(w.light),P=Ft.fromString(w.dark),I=y.curve;I&&(S=Qt(I,g,S,T,0,_,E,v.r,A.r,1),S=Qt(I,g,S,T,1,_,E,v.g,A.g,1),S=Qt(I,g,S,T,2,_,E,v.b,A.b,1),S=Qt(I,g,S,T,3,_,E,v.a,A.a,1),S=Qt(I,g,S,T,4,_,E,b.r,P.r,1),S=Qt(I,g,S,T,5,_,E,b.g,P.g,1),S=Qt(I,g,S,T,6,_,E,b.b,P.b,1)),_=E,v=A,b=P,y=w}n.push(g);break}case"rgb2":{const g=new xu(p,p*6,d);let y=m[0],_=z(y,"time",0),v=Ft.fromString(y.light),b=Ft.fromString(y.dark);for(let T=0,S=0;;T++){g.setFrame(T,_,v.r,v.g,v.b,b.r,b.g,b.b);const w=m[T+1];if(!w){g.shrink(S);break}const E=z(w,"time",0),A=Ft.fromString(w.light),P=Ft.fromString(w.dark),I=y.curve;I&&(S=Qt(I,g,S,T,0,_,E,v.r,A.r,1),S=Qt(I,g,S,T,1,_,E,v.g,A.g,1),S=Qt(I,g,S,T,2,_,E,v.b,A.b,1),S=Qt(I,g,S,T,3,_,E,b.r,P.r,1),S=Qt(I,g,S,T,4,_,E,b.g,P.g,1),S=Qt(I,g,S,T,5,_,E,b.b,P.b,1)),_=E,v=A,b=P,y=w}n.push(g);break}default:throw new Error(`Invalid timeline type for a slot: ${m.name} (${c.name})`)}}}if(t.bones)for(const l in t.bones){const c=t.bones[l],u=s.findBone(l);if(!u)throw new Error(`Bone not found: ${l}`);const d=u.index;for(const f in c){const m=c[f],p=m.length;if(p!==0)switch(f){case"rotate":Fs(n,m,new Wa(p,p,d),0,1);break;case"translate":Xf(n,m,new iu(p,p<<1,d),"x","y",0,r);break;case"translatex":Fs(n,m,new nu(p,p,d),0,r);break;case"translatey":Fs(n,m,new au(p,p,d),0,r);break;case"scale":Xf(n,m,new ou(p,p<<1,d),"x","y",1,1);break;case"scalex":Fs(n,m,new lu(p,p,d),1,1);break;case"scaley":Fs(n,m,new hu(p,p,d),1,1);break;case"shear":Xf(n,m,new cu(p,p<<1,d),"x","y",0,1);break;case"shearx":Fs(n,m,new uu(p,p,d),0,1);break;case"sheary":Fs(n,m,new du(p,p,d),0,1);break;case"inherit":{const g=new fu(p,u.index);for(let y=0;y<m.length;y++){const _=m[y];g.setFrame(y,z(_,"time",0),bt.enumValue(be,z(_,"inherit","Normal")))}n.push(g);break}default:throw new Error(`Invalid timeline type for a bone: ${m.name} (${c.name})`)}}}if(t.ik)for(const l in t.ik){const c=t.ik[l];let u=c[0];if(!u)continue;const d=s.findConstraint(l,Ba);if(!d)throw new Error(`IK Constraint not found: ${l}`);const f=new vu(c.length,c.length<<1,s.constraints.indexOf(d));let m=z(u,"time",0),p=z(u,"mix",1),g=z(u,"softness",0)*r;for(let y=0,_=0;;y++){f.setFrame(y,m,p,g,z(u,"bendPositive",!0)?1:-1,z(u,"compress",!1),z(u,"stretch",!1));const v=c[y+1];if(!v){f.shrink(_);break}const b=z(v,"time",0),T=z(v,"mix",1),S=z(v,"softness",0)*r,w=u.curve;w&&(_=Qt(w,f,_,y,0,m,b,p,T,1),_=Qt(w,f,_,y,1,m,b,g,S,r)),m=b,p=T,g=S,u=v}n.push(f)}if(t.transform)for(const l in t.transform){const c=t.transform[l];let u=c[0];if(!u)continue;const d=s.findConstraint(l,te);if(!d)throw new Error(`Transform constraint not found: ${l}`);const f=new _u(c.length,c.length*6,s.constraints.indexOf(d));let m=z(u,"time",0),p=z(u,"mixRotate",1),g=z(u,"mixX",1),y=z(u,"mixY",g),_=z(u,"mixScaleX",1),v=z(u,"mixScaleY",1),b=z(u,"mixShearY",1);for(let T=0,S=0;;T++){f.setFrame(T,m,p,g,y,_,v,b);const w=c[T+1];if(!w){f.shrink(S);break}const E=z(w,"time",0),A=z(w,"mixRotate",1),P=z(w,"mixX",1),I=z(w,"mixY",P),C=z(w,"mixScaleX",1),R=z(w,"mixScaleY",1),F=z(w,"mixShearY",1),D=u.curve;D&&(S=Qt(D,f,S,T,0,m,E,p,A,1),S=Qt(D,f,S,T,1,m,E,g,P,1),S=Qt(D,f,S,T,2,m,E,y,I,1),S=Qt(D,f,S,T,3,m,E,_,C,1),S=Qt(D,f,S,T,4,m,E,v,R,1),S=Qt(D,f,S,T,5,m,E,b,F,1)),m=E,p=A,g=P,y=I,_=C,v=R,b=F,u=w}n.push(f)}if(t.path)for(const l in t.path){const c=t.path[l],u=s.findConstraint(l,Oa);if(!u)throw new Error(`Path constraint not found: ${l}`);const d=s.constraints.indexOf(u);for(const f in c){const m=c[f];let p=m[0];if(!p)continue;const g=m.length;switch(f){case"position":{const y=new wu(g,g,d);Fs(n,m,y,0,u.positionMode===Qs.Fixed?r:1);break}case"spacing":{const y=new Tu(g,g,d);Fs(n,m,y,0,u.spacingMode===ke.Length||u.spacingMode===ke.Fixed?r:1);break}case"mix":{const y=new Su(g,g*3,d);let _=z(p,"time",0),v=z(p,"mixRotate",1),b=z(p,"mixX",1),T=z(p,"mixY",b);for(let S=0,w=0;;S++){y.setFrame(S,_,v,b,T);const E=m[S+1];if(!E){y.shrink(w);break}const A=z(E,"time",0),P=z(E,"mixRotate",1),I=z(E,"mixX",1),C=z(E,"mixY",I),R=p.curve;R&&(w=Qt(R,y,w,S,0,_,A,v,P,1),w=Qt(R,y,w,S,1,_,A,b,I,1),w=Qt(R,y,w,S,2,_,A,T,C,1)),_=A,v=P,b=I,T=C,p=E}n.push(y);break}}}}if(t.physics)for(const l in t.physics){const c=t.physics[l];let u=-1;if(l.length>0){const d=s.findConstraint(l,Da);if(!d)throw new Error(`Physics constraint not found: ${l}`);u=s.constraints.indexOf(d)}for(const d in c){const f=c[d];let m=f[0];if(!m)continue;const p=f.length;let g,y=0;if(d==="reset"){const _=new ja(p,u);for(let v=0;m!=null;m=f[v+1],v++)_.setFrame(v,z(m,"time",0));n.push(_);continue}switch(d){case"inertia":g=new Eu(p,p,u);break;case"strength":g=new Au(p,p,u);break;case"damping":g=new Cu(p,p,u);break;case"mass":g=new Iu(p,p,u);break;case"wind":g=new Pu(p,p,u);break;case"gravity":g=new Mu(p,p,u);break;case"mix":{y=1,g=new Ru(p,p,u);break}default:continue}Fs(n,f,g,y,1)}}if(t.slider)for(const l in t.slider){const c=t.slider[l],u=s.findConstraint(l,yi);if(!u)throw new Error(`Slider not found: ${l}`);const d=s.constraints.indexOf(u);for(const f in c){const m=c[f];if(!m[0])continue;const g=m.length;switch(f){case"time":Fs(n,m,new Fu(g,g,d),1,1);break;case"mix":Fs(n,m,new ku(g,g,d),1,1);break}}}if(t.attachments)for(const l in t.attachments){const c=t.attachments[l],u=s.findSkin(l);if(!u)throw new Error(`Skin not found: ${l}`);for(const d in c){const f=c[d],m=s.findSlot(d);if(!m)throw new Error(`Attachment slot not found: ${d}`);const p=m.index;for(const g in f){const y=f[g],_=u.getAttachment(p,g);if(!_)throw new Error(`Timeline attachment not found: ${g}`);for(const v in y){const b=y[v];let T=b[0];if(T){if(v==="deform"){const S=_.bones,w=_.vertices,E=S?w.length/3*2:w.length,A=new bu(b.length,b.length,p,_);let P=z(T,"time",0);for(let I=0,C=0;;I++){let R;const F=z(T,"vertices",null);if(!F)R=S?bt.newFloatArray(E):w;else{R=bt.newFloatArray(E);const k=z(T,"offset",0);if(bt.arrayCopy(F,0,R,k,F.length),r!==1)for(let N=k,B=N+F.length;N<B;N++)R[N]*=r;if(!S)for(let N=0;N<E;N++)R[N]+=w[N]}A.setFrame(I,P,R);const D=b[I+1];if(!D){A.shrink(C);break}const M=z(D,"time",0),O=T.curve;O&&(C=Qt(O,A,C,I,0,P,M,0,1,1)),P=M,T=D}n.push(A)}else if(v==="sequence"){const S=new za(b.length,p,_);let w=0;for(let E=0;E<b.length;E++){const A=z(T,"delay",w),P=z(T,"time",0),I=He[z(T,"mode","hold")],C=z(T,"index",0);S.setFrame(E,P,I,C,A),w=A,T=b[E+1]}n.push(S)}}}}}}if(t.drawOrder){const l=new Wr(t.drawOrder.length),c=s.slots.length;let u=0;for(const d of t.drawOrder)l.setFrame(u++,z(d,"time",0),ab(s,d,c,null));n.push(l)}if(t.drawOrderFolder)for(const l of t.drawOrderFolder){const c=z(l,"slots",[]),u=new Array(c.length);let d=0;for(const g of c){const y=s.findSlot(g);if(!y)throw new Error(`Draw order folder slot not found: ${g}`);u[d++]=y.index}const f=z(l,"keys",[]),m=new an(f.length,u,s.slots.length);let p=0;for(const g of f)m.setFrame(p++,z(g,"time",0),ab(s,g,u.length,u));n.push(m)}if(t.events){const l=new jn(t.events.length);let c=0;for(let u=0;u<t.events.length;u++,c++){const d=t.events[u],f=s.findEvent(d.name);if(!f)throw new Error(`Event not found: ${d.name}`);const m=f.setupPose,p=new kl(bt.toSinglePrecision(z(d,"time",0)),f);p.intValue=z(d,"int",m.intValue),p.floatValue=z(d,"float",m.floatValue),p.stringValue=z(d,"string",m.stringValue),p.data.audioPath&&(p.volume=z(d,"volume",m.volume),p.balance=z(d,"balance",m.volume)),l.setFrame(c,p)}n.push(l)}let a=0;for(let l=0,c=n.length;l<c;l++)a=Math.max(a,n[l].getDuration());const o=new Pl(e,n,a),h=z(t,"color",null);h!==null&&o.color.setFromString(h),s.animations.push(o)}}class iL{constructor(t,e,s,r,n,a){x(this,"source");x(this,"skin");x(this,"slotIndex");x(this,"sourceIndex");x(this,"mesh");x(this,"inheritTimelines");this.mesh=t,this.skin=e,this.slotIndex=s,this.sourceIndex=r,this.source=n,this.inheritTimelines=a}}function Fs(i,t,e,s,r){let n=t[0],a=n.time??0,o=(n.value??s)*r,h=0;for(let l=0;;l++){e.setFrame(l,a,o);const c=t[l+1];if(!c){e.shrink(h),i.push(e);return}const u=c.time??0,d=(c.value??s)*r;n.curve&&(h=Qt(n.curve,e,h,l,0,a,u,o,d,r)),a=u,o=d,n=c}}function Xf(i,t,e,s,r,n,a){let o=t[0],h=o.time??0,l=(o[s]??n)*a,c=(o[r]??n)*a,u=0;for(let d=0;;d++){e.setFrame(d,h,l,c);const f=t[d+1];if(!f){e.shrink(u),i.push(e);return}const m=f.time??0,p=(f[s]??n)*a,g=(f[r]??n)*a,y=o.curve;y&&(u=Qt(y,e,u,d,0,h,m,l,p,a),u=Qt(y,e,u,d,1,h,m,c,g,a)),h=m,l=p,c=g,o=f}}function ab(i,t,e,s){const r=t.offsets;if(!r)return null;const n=new Array(e).fill(-1),a=new Array(e-r.length);let o=0,h=0;for(const l of r){const c=i.findSlot(l.slot);if(c==null)throw new Error(`Draw order slot not found: ${l.slot}`);let u=0;if(!s)u=c.index;else{u=-1;for(let d=0;d<e;d++)if(s[d]===c.index){u=d;break}if(u===-1)throw new Error(`Slot not in folder: ${l.slot}`)}for(;o!==u;)a[h++]=o++;n[o+l.offset]=o++}for(;o<e;)a[h++]=o++;for(let l=e-1;l>=0;l--)n[l]===-1&&(n[l]=a[--h]);return n}function Qt(i,t,e,s,r,n,a,o,h,l){if(i==="stepped")return t.setStepped(s),e;const c=r<<2,u=i[c],d=i[c+1]*l,f=i[c+2],m=i[c+3]*l;return t.setBezier(e,s,r,n,o,u,d,f,m,a,h),e+1}function z(i,t,e){return i[t]!==void 0?i[t]:e}class pg{constructor(t,e,s={}){x(this,"skeleton");x(this,"adapter");x(this,"positionInheritanceFactorX",0);x(this,"positionInheritanceFactorY",0);x(this,"rotationInheritanceFactor",0);x(this,"hasLastTransform",!1);x(this,"lastX",0);x(this,"lastY",0);x(this,"lastZ",0);x(this,"lastRotation",0);x(this,"currentTransform",{x:0,y:0,z:0,rotation:0});x(this,"currentPosition",{x:0,y:0,z:0});x(this,"lastPosition",{x:0,y:0,z:0});this.skeleton=t,this.adapter=e,this.positionInheritanceFactorX=s.positionInheritanceX??0,this.positionInheritanceFactorY=s.positionInheritanceY??0,this.rotationInheritanceFactor=s.rotationInheritance??0}get positionInheritanceX(){return this.positionInheritanceFactorX}get positionInheritanceY(){return this.positionInheritanceFactorY}setPositionInheritance(t,e){const s=this.positionInheritanceFactorX===0&&this.positionInheritanceFactorY===0,r=t!==0||e!==0;this.positionInheritanceFactorX=t,this.positionInheritanceFactorY=e,s&&r&&this.resetPosition()}get rotationInheritance(){return this.rotationInheritanceFactor}set rotationInheritance(t){const e=this.rotationInheritanceFactor===0;this.rotationInheritanceFactor=t,e&&t!==0&&this.resetRotation()}resetPosition(){const t=this.currentTransform,e=!this.hasLastTransform&&this.rotationInheritanceFactor!==0;this.adapter.readTransform(t,e),this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z,e&&(this.lastRotation=t.rotation),this.hasLastTransform=!0}resetRotation(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.lastRotation=t.rotation,this.hasLastTransform||(this.lastX=t.x,this.lastY=t.y,this.lastZ=t.z),this.hasLastTransform=!0}resetTransform(){const t=this.currentTransform;this.adapter.readTransform(t,!0),this.setLastTransform(t.x,t.y,t.z,t.rotation)}applyTransformMovement(){const t=this.positionInheritanceFactorX!==0||this.positionInheritanceFactorY!==0,e=this.rotationInheritanceFactor!==0;if(!t&&!e)return;const s=this.currentTransform;this.adapter.readTransform(s,e);const{x:r,y:n,z:a}=s,o=e?s.rotation:this.lastRotation,h=r!==this.lastX||n!==this.lastY||a!==this.lastZ;if(this.hasLastTransform){if(!h&&o===this.lastRotation)return;t&&h&&this.applyPositionMovement(r,n,a),e&&o!==this.lastRotation&&this.applyRotationMovement(o)}this.setLastTransform(r,n,a,o)}applyPositionMovement(t,e,s){const r=this.currentPosition;r.x=t,r.y=e,r.z=s,this.adapter.worldToSkeleton(r);const n=this.lastPosition;n.x=this.lastX,n.y=this.lastY,n.z=this.lastZ,this.adapter.worldToSkeleton(n),this.skeleton.physicsTranslate((r.x-n.x)*this.positionInheritanceFactorX,(r.y-n.y)*this.positionInheritanceFactorY)}applyRotationMovement(t){const e=this.rotationInheritanceFactor;e!==0&&this.skeleton.physicsRotate(0,0,this.getRotationDelta(t,this.lastRotation)*e)}setLastTransform(t,e,s,r){this.lastX=t,this.lastY=e,this.lastZ=s,this.lastRotation=r,this.hasLastTransform=!0}getRotationDelta(t,e){let s=t-e;return s=(s+180)%360-180,s<-180?s+360:s}}class Bw{constructor(){x(this,"commandPool",new nL);x(this,"worldVertices",new Float32Array(12*1024));x(this,"quadIndices",new Uint16Array([0,1,2,2,3,0]));x(this,"clipping",new ao);x(this,"renderCommands",[])}render(t,e=!1,s,r=2,n=0){var l,c;this.commandPool.reset(),this.renderCommands.length=0;const a=this.clipping;let o=0;const h=t.drawOrder.appliedPose;for(let u=0,d=h.length;u<d;u++){const f=h[u];if(!f.bone.active){a.clipEnd(f);continue}const m=f.appliedPose,p=m.attachment;if(!p){a.clipEnd(f);continue}const g=m.color;if(g.a===0&&!(p instanceof zr)){a.clipEnd(f);continue}let _,v,b,T,S,w,E;if(p instanceof _r){if(w=p.color,w.a===0){a.clipEnd(f);continue}const R=p.sequence,F=R.resolveIndex(m);p.computeWorldVertices(f,p.getOffsets(m),this.worldVertices,0,r),_=this.worldVertices,v=4,b=R.getUVs(F),T=this.quadIndices,S=6,E=(l=R.regions[F])==null?void 0:l.texture}else if(p instanceof Vs){if(w=p.color,w.a===0){a.clipEnd(f);continue}this.worldVertices.length<p.worldVerticesLength&&(this.worldVertices=new Float32Array(p.worldVerticesLength)),p.computeWorldVertices(t,f,0,p.worldVerticesLength,this.worldVertices,0,r),_=this.worldVertices,v=p.worldVerticesLength>>1;const R=p.sequence,F=R.resolveIndex(m);b=R.getUVs(F),T=p.triangles,S=T.length,E=(c=R.regions[F])==null?void 0:c.texture}else if(p instanceof zr){a.clipEnd(f),a.clipStart(t,f,p);continue}else{a.clipEnd(f);continue}if(!E){a.clipEnd(f);continue}const A=t.color;let P,I;if(e){let R;if(s){R=Math.floor(s[3]*A.a*g.a*w.a*255);const F=Math.floor(R*s[0]*A.r*g.r*w.r),D=Math.floor(R*s[1]*A.g*g.g*w.g),M=Math.floor(R*s[2]*A.b*g.b*w.b);P=R<<24|F<<16|D<<8|M}else{R=Math.floor(A.a*g.a*w.a*255);const F=Math.floor(R*A.r*g.r*w.r),D=Math.floor(R*A.g*g.g*w.g),M=Math.floor(R*A.b*g.b*w.b);P=R<<24|F<<16|D<<8|M}if(I=4278190080,m.darkColor){const{r:F,g:D,b:M}=m.darkColor;I=4278190080|Math.floor(F*R)<<16|Math.floor(D*R)<<8|Math.floor(M*R)}}else{if(s){const R=Math.floor(s[3]*A.a*g.a*w.a*255),F=Math.floor(s[0]*A.r*g.r*w.r*255),D=Math.floor(s[1]*A.g*g.g*w.g*255),M=Math.floor(s[2]*A.b*g.b*w.b*255);P=R<<24|F<<16|D<<8|M}else{const R=Math.floor(A.a*g.a*w.a*255),F=Math.floor(A.r*g.r*w.r*255),D=Math.floor(A.g*g.g*w.g*255),M=Math.floor(A.b*g.b*w.b*255);P=R<<24|F<<16|D<<8|M}if(I=0,m.darkColor){const{r:R,g:F,b:D}=m.darkColor;I=Math.floor(R*255)<<16|Math.floor(F*255)<<8|Math.floor(D*255)}}a.isClipping()&&(a.clipTrianglesUnpacked(_,0,T,S,b,r),_=a.clippedVerticesTyped,v=a.clippedVerticesLength/r,b=a.clippedUVsTyped,T=a.clippedTrianglesTyped,S=a.clippedTrianglesLength);const C=this.commandPool.getCommand(v,S,r);if(C.blendMode=f.data.blendMode,C.texture=E,C.positions.set(_.subarray(0,v*r)),r>=3)for(let R=2,F=v*r;R<F;R+=r)C.positions[R]=o;C.uvs.set(b.subarray(0,v<<1));for(let R=0;R<v;R++)C.colors[R]=P,C.darkColors[R]=I;T instanceof Uint16Array?C.indices.set(T.subarray(0,S)):C.indices.set(T.slice(0,S)),this.renderCommands.push(C),o+=n,a.clipEnd(f)}return a.clipEnd(),this.batchCommands(r)}batchSubCommands(t,e,s,r,n,a){const o=t[e],h=this.commandPool.getCommand(r,n,a);h.blendMode=o.blendMode,h.texture=o.texture;let l=0,c=0,u=0,d=0,f=0;for(let m=e;m<=s;m++){const p=t[m];h.positions.set(p.positions,l),l+=p.numVertices*a,h.uvs.set(p.uvs,c),c+=p.numVertices<<1,h.colors.set(p.colors,u),h.darkColors.set(p.darkColors,u),u+=p.numVertices;for(let g=0;g<p.numIndices;g++)h.indices[d+g]=p.indices[g]+f;d+=p.numIndices,f+=p.numVertices}return h}batchCommands(t){if(this.renderCommands.length===0)return;let e,s,r=this.renderCommands[0],n=0,a=1,o=r.numVertices,h=r.numIndices;for(;a<=this.renderCommands.length;){const l=a<this.renderCommands.length?this.renderCommands[a]:null;if(l&&l.numVertices===0&&l.numIndices===0){a++;continue}if(l!==null&&l.texture===r.texture&&l.blendMode===r.blendMode&&l.colors[0]===r.colors[0]&&l.darkColors[0]===r.darkColors[0]&&h+l.numIndices<65535)o+=l.numVertices,h+=l.numIndices;else{const u=this.batchSubCommands(this.renderCommands,n,a-1,o,h,t);if(s?(s.next=u,s=u):e=s=u,a===this.renderCommands.length)break;r=this.renderCommands[a],n=a,o=r.numVertices,h=r.numIndices}a++}return e}}class nL{constructor(){x(this,"pool",[]);x(this,"inUse",[])}getCommand(t,e,s){let r;for(const n of this.pool)if(n._positions.length>=t*s&&n._indices.length>=e){r=n;break}if(r)this.pool.splice(this.pool.indexOf(r),1),r.next=void 0,r.numVertices=t,r.numIndices=e,r.positions=r._positions.subarray(0,t*s),r.uvs=r._uvs.subarray(0,t<<1),r.colors=r._colors.subarray(0,t),r.darkColors=r._darkColors.subarray(0,t),r.indices=r._indices.subarray(0,e);else{const n=new Float32Array(t*s),a=new Float32Array(t<<1),o=new Uint32Array(t),h=new Uint32Array(t),l=new Uint16Array(e);r={positions:n,uvs:a,colors:o,darkColors:h,indices:l,_positions:n,_uvs:a,_colors:o,_darkColors:h,_indices:l,numVertices:t,numIndices:e,blendMode:fr.Normal,texture:null}}return this.inUse.push(r),r}reset(){this.pool.push(...this.inUse),this.inUse.length=0}}const uO=Object.freeze(Object.defineProperty({__proto__:null,ATTACH_RETAIN:mc,ATTACH_SETUP:fc,AlphaTimeline:gu,Animation:Pl,AnimationState:qa,AnimationStateAdapter:kw,AnimationStateData:og,AssetCache:al,AssetManagerBase:Lw,AtlasAttachmentLoader:hg,Attachment:Ha,AttachmentTimeline:Yn,BinaryInput:dg,get BlendMode(){return fr},Bone:Gn,BoneData:io,BonePose:ol,BoneTimeline1:ki,BoneTimeline2:Ml,BoundingBoxAttachment:ro,CURRENT:cc,ClippingAttachment:zr,Color:Ft,Constraint:ta,ConstraintData:ea,ConstraintTimeline1:Qn,CurveTimeline:Fi,CurveTimeline1:dr,DebugUtils:Pw,DeformTimeline:bu,Downloader:lg,DrawOrder:cg,DrawOrderFolderTimeline:an,DrawOrderTimeline:Wr,Event:kl,EventData:Ou,EventQueue:ng,EventTimeline:jn,get EventType(){return ns},FIRST:uc,FakeTexture:Fw,FromProperty:dn,FromRotate:gl,FromScaleX:bl,FromScaleY:vl,FromShearY:_l,FromX:yl,FromY:xl,HOLD:va,IkConstraint:Ur,IkConstraintData:Ba,IkConstraintPose:ll,IkConstraintTimeline:vu,get Inherit(){return be},InheritTimeline:fu,IntSet:Cw,Interpolation:en,MODE:dc,MathUtils:pt,MeshAttachment:Vs,get MixFrom(){return At},PathAttachment:on,PathConstraint:cl,PathConstraintData:Oa,PathConstraintMixTimeline:Su,PathConstraintPose:hl,PathConstraintPositionTimeline:wu,PathConstraintSpacingTimeline:Tu,get Physics(){return Os},PhysicsConstraint:no,PhysicsConstraintDampingTimeline:Cu,PhysicsConstraintData:Da,PhysicsConstraintGravityTimeline:Mu,PhysicsConstraintInertiaTimeline:Eu,PhysicsConstraintMassTimeline:Iu,PhysicsConstraintMixTimeline:Ru,PhysicsConstraintPose:ul,PhysicsConstraintResetTimeline:ja,PhysicsConstraintStrengthTimeline:Au,PhysicsConstraintTimeline:Kr,PhysicsConstraintWindTimeline:Pu,PointAttachment:Rl,Pool:$a,Posed:Lu,PosedActive:Bu,PosedData:Fl,get PositionMode(){return Qs},Pow:Jp,PowOut:Iw,get Property(){return Bt},RGB2Timeline:xu,RGBA2Timeline:yu,RGBATimeline:mu,RGBTimeline:pu,RegionAttachment:_r,get RotateMode(){return Ti},RotateTimeline:Wa,SETUP:ag,ScaleTimeline:ou,ScaleXTimeline:lu,get ScaleYMode(){return es},ScaleYTimeline:hu,Sequence:nn,get SequenceMode(){return He},SequenceModeValues:ru,SequenceTimeline:za,ShearTimeline:cu,ShearXTimeline:uu,ShearYTimeline:du,Skeleton:Mi,SkeletonBinary:ug,SkeletonBounds:fg,SkeletonClipping:ao,SkeletonData:Bl,SkeletonJson:mg,SkeletonPhysicsMovement:pg,SkeletonRendererCore:Bw,Skin:Ka,SkinEntry:pc,Slider:ml,SliderData:yi,SliderMixTimeline:ku,SliderPose:fl,SliderTimeline:Fu,Slot:Ll,SlotCurveTimeline:so,SlotData:Du,SlotPose:dl,get SpacingMode(){return ke},StringSet:Zp,Texture:eu,TextureAtlas:nl,TextureAtlasPage:tg,TextureAtlasRegion:su,get TextureFilter(){return Oe},TextureRegion:Qp,get TextureWrap(){return xr},TimeKeeper:Mw,Timeline:ce,ToProperty:fn,ToRotate:Nu,ToScaleX:Vu,ToScaleY:Yu,ToShearY:Gu,ToX:Uu,ToY:Xu,TrackEntry:ig,TransformConstraint:Ol,TransformConstraintData:te,TransformConstraintPose:pl,TransformConstraintTimeline:_u,TranslateTimeline:iu,TranslateXTimeline:nu,TranslateYTimeline:au,Triangulator:Je,Utils:bt,Vector2:il,VertexAttachment:vr,WindowedMean:Rw,isBoneTimeline:sg,isConstraintTimeline:rg,isSlotTimeline:eg},Symbol.toStringTag,{value:"Module"}));if(typeof window<"u"&&window.PIXI){const i=window.require;window.require=t=>{if(i)return i(t);if(t.startsWith("@pixi/"))return window.PIXI}}const ni=class ni extends eu{constructor(e){super(e.resource.source);x(this,"texture");this.texture=Nt.from(e)}static from(e){return ni.textureMap.has(e)?ni.textureMap.get(e):new ni(e)}setFilters(e,s){this.texture.baseTexture.scaleMode=ni.toPixiTextureFilter(e),this.texture.baseTexture.mipmap=ni.toPixiMipMap(e)}setWraps(e,s){this.texture.baseTexture.wrapMode=ni.toPixiTextureWrap(e)}dispose(){this.texture.destroy()}static toPixiTextureFilter(e){switch(e){case Oe.Nearest:case Oe.MipMapNearestLinear:case Oe.MipMapNearestNearest:return Ns.NEAREST;case Oe.Linear:case Oe.MipMapLinearLinear:case Oe.MipMapLinearNearest:return Ns.LINEAR;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiMipMap(e){switch(e){case Oe.Nearest:case Oe.Linear:return Ms.OFF;case Oe.MipMapNearestLinear:case Oe.MipMapNearestNearest:case Oe.MipMapLinearLinear:case Oe.MipMapLinearNearest:return Ms.ON;default:throw new Error(`Unknown texture filter: ${String(e)}`)}}static toPixiTextureWrap(e){switch(e){case xr.ClampToEdge:return Ps.CLAMP;case xr.MirroredRepeat:return Ps.MIRRORED_REPEAT;case xr.Repeat:return Ps.REPEAT;default:throw new Error(`Unknown texture wrap: ${String(e)}`)}}static toPixiBlending(e){switch(e){case fr.Normal:return It.NORMAL;case fr.Additive:return It.ADD;case fr.Multiply:return It.MULTIPLY;case fr.Screen:return It.SCREEN;default:throw new Error(`Unknown blendMode: ${String(e)}`)}}};x(ni,"textureMap",new Map);let qn=ni;const ph="spineTextureAtlasLoader",aL={extension:gt.Asset,resolver:{test:i=>Ue(i,".atlas"),parse:i=>{var e,s;const t=i.split(".");return{resolution:parseFloat(((s=(e=_t.RETINA_PREFIX)==null?void 0:e.exec(i))==null?void 0:s[1])??"1"),format:t[t.length-2],src:i}}},loader:{name:ph,extension:{type:gt.LoadParser,priority:Ts.Normal,name:ph},test(i){return Ue(i,".atlas")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${ph}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return await t.text()},testParse(i,t){const e=Ue(t.src,".atlas"),s=typeof i=="string",r=t.loadParser===ph;return Promise.resolve((e||r)&&s)},unload(i){i.dispose()},async parse(i,t,e){var h;const s=t.data||{};let r=ye.dirname(t.src);r&&r.lastIndexOf("/")!==r.length-1&&(r+="/");const n=new nl(i);if(s.images instanceof Lt||typeof s.images=="string"){const l=s.images;s.images={},s.images[n.pages[0].name]=l}const a=[];let o=!0;for(const l of e.parsers)if(l.name==="loadTextures"){o=(h=l.config)==null?void 0:h.preferCreateImageBitmap;break}Cs.setPreferences({preferCreateImageBitmap:!1});for(const l of n.pages){const c=l.name,u=s!=null&&s.images?s.images[c]:void 0;if(u instanceof Lt)l.setTexture(qn.from(u));else{const d=u??ye.normalize([...r.split(ye.sep),c].join(ye.sep)),f={src:sl(d,t.src),data:{...s.imageMetadata,alphaMode:l.pma?Ke.PMA:Ke.UNPACK}},m=e.load(f).then(p=>{l.setTexture(qn.from(p.baseTexture))});a.push(m)}}return await Promise.all(a),Cs.setPreferences({preferCreateImageBitmap:o}),n}}};St.add(aL);const gh="spineSkeletonLoader";function oL(i){return i.hasOwnProperty("bones")}function lL(i){return i instanceof Uint8Array}const hL={extension:gt.Asset,loader:{name:gh,extension:{type:gt.LoadParser,priority:Ts.Normal,name:gh},test(i){return Ue(i,".skel")},async load(i){const t=await _t.ADAPTER.fetch(i);if(!t.ok)throw new Error(`[${gh}] Failed to fetch ${i}: ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())},testParse(i,t){const e=Ue(t.src,".json")&&oL(i),s=Ue(t.src,".skel")&&lL(i),r=t.loadParser===gh;return Promise.resolve(e||s||r)}}};St.add(hL);class Ow extends er{constructor(t=!1){super();const e=new ne(void 0),s=new ne(void 0,!0),r=new ne(void 0,!0,!0);this.addAttribute("aVertexPosition",e,2,!1,wt.FLOAT),this.addAttribute("aTextureCoord",s,2,!1,wt.FLOAT),this.addIndex(r)}}const cL=`
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform mat3 uTextureMatrix;
|
||
|
||
varying vec2 vTextureCoord;
|
||
|
||
void main(void)
|
||
{
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
|
||
}
|
||
`,uL=`
|
||
varying vec2 vTextureCoord;
|
||
uniform vec4 uColor;
|
||
uniform vec4 uDarkColor;
|
||
|
||
uniform sampler2D uSampler;
|
||
|
||
void main(void)
|
||
{
|
||
vec4 texColor = texture2D(uSampler, vTextureCoord);
|
||
gl_FragColor.a = texColor.a * uColor.a;
|
||
gl_FragColor.rgb = ((texColor.a - 1.0) * uDarkColor.a + 1.0 - texColor.rgb) * uDarkColor.rgb + texColor.rgb * uColor.rgb;
|
||
}
|
||
`;class Dw extends Js{constructor(e){const s={uSampler:e??Nt.EMPTY,alpha:1,uTextureMatrix:fe.IDENTITY,uColor:new Float32Array([1,1,1,1]),uDarkColor:new Float32Array([0,0,0,0])},r={tint:16777215,darkTint:0,alpha:1,pluginName:"darkTintBatch"};super(ur.from(cL,uL),s);x(this,"uvMatrix");x(this,"batchable");x(this,"pluginName");x(this,"_tintRGB");x(this,"_darkTintRGB");x(this,"_colorDirty");x(this,"_alpha");x(this,"_tintColor");x(this,"_darkTintColor");this._colorDirty=!1,this.uvMatrix=new jc(s.uSampler),this.batchable=!0,this.pluginName=r.pluginName,this._tintColor=new Wt(r.tint),this._darkTintColor=new Wt(r.darkTint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._alpha=r.alpha,this._colorDirty=!0}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}set darkTint(e){e!==this.darkTint&&(this._darkTintColor.setValue(e),this._darkTintRGB=this._darkTintColor.toLittleEndianNumber(),this._colorDirty=!0)}get darkTint(){return this._darkTintColor.value}get tintValue(){return this._tintColor.toNumber()}get darkTintValue(){return this._darkTintColor.toNumber()}update(){this._colorDirty&&(this._colorDirty=!1,Wt.shared.setValue(this._tintColor).premultiply(this._alpha,!0).toArray(this.uniforms.uColor),Wt.shared.setValue(this._darkTintColor).premultiply(this._alpha,!0).premultiply(1,!1).toArray(this.uniforms.uDarkColor)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class Nw extends zn{constructor(e){super(new Ow,new Dw(e),void 0,void 0);x(this,"_darkTintRGB",0)}get darkTint(){return"darkTint"in this.shader?this.shader.darkTint:null}set darkTint(e){this.shader.darkTint=e}get darkTintValue(){return this.shader.darkTintValue}_renderToBatch(e){const s=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=s.indexBuffer.data,this._tintRGB=r._tintRGB,this._darkTintRGB=r._darkTintRGB,this._texture=r.texture;const n=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[n]),e.plugins[n].render(this)}}const Ve=class Ve extends Nw{constructor(){super();x(this,"name","")}updateFromSpineData(e,s,r,n,a,o,h,l){var y,_;this.texture=e.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((y=u.data)==null?void 0:y.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((_=d.data)==null?void 0:_.length)!==c&&(d.data=new Float32Array(c));let f=0;const m=u.data,p=d.data;for(let v=0;v<a;v+=l?12:8){let b=v;p[f]=n[b++],p[f+1]=n[b++],b+=4,m[f]=n[b++],m[f+1]=n[b++],f+=2}l?(Ve.auxColor[0]=n[8],Ve.auxColor[1]=n[9],Ve.auxColor[2]=n[10],Ve.auxColor[3]=n[11],this.darkTint=Ve.auxColor,Ve.auxColor[0]=n[2],Ve.auxColor[1]=n[3],Ve.auxColor[2]=n[4],Ve.auxColor[3]=n[5],this.tint=Ve.auxColor):(Ve.auxColor[0]=n[2],Ve.auxColor[1]=n[3],Ve.auxColor[2]=n[4],Ve.auxColor[3]=n[5],this.tint=Ve.auxColor),this.blendMode=qn.toPixiBlending(s),this.alpha=Ve.auxColor[3];const g=this.geometry.indexBuffer;if(g.data.length!==o.length)g.data=new Uint32Array(o);else{const v=g.data;for(let b=0;b<h;b++)v[b]=o[b]}this.name=r,u.update(),d.update(),g.update()}};x(Ve,"auxColor",[0,0,0,0]);let gc=Ve;class Uw extends er{constructor(e=!1){super();x(this,"_buffer");x(this,"_indexBuffer");this._buffer=new ne(void 0,e,!1),this._indexBuffer=new ne(void 0,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,wt.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,wt.FLOAT).addAttribute("aColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aDarkColor",this._buffer,4,!0,wt.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,wt.FLOAT).addIndex(this._indexBuffer)}}const dL=`
|
||
precision highp float;
|
||
attribute vec2 aVertexPosition;
|
||
attribute vec2 aTextureCoord;
|
||
attribute vec4 aColor;
|
||
attribute vec4 aDarkColor;
|
||
attribute float aTextureId;
|
||
|
||
uniform mat3 projectionMatrix;
|
||
uniform mat3 translationMatrix;
|
||
uniform vec4 tint;
|
||
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
varying vec4 vDarkColor;
|
||
varying float vTextureId;
|
||
|
||
void main(void){
|
||
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
||
|
||
vTextureCoord = aTextureCoord;
|
||
vTextureId = aTextureId;
|
||
vColor = aColor * tint;
|
||
vDarkColor = aDarkColor * tint;
|
||
|
||
}
|
||
`,fL=`
|
||
varying vec2 vTextureCoord;
|
||
varying vec4 vColor;
|
||
varying vec4 vDarkColor;
|
||
varying float vTextureId;
|
||
uniform sampler2D uSamplers[%count%];
|
||
|
||
void main(void){
|
||
vec4 color;
|
||
%forloop%
|
||
|
||
|
||
gl_FragColor.a = color.a * vColor.a;
|
||
gl_FragColor.rgb = ((color.a - 1.0) * vDarkColor.a + 1.0 - color.rgb) * vDarkColor.rgb + color.rgb * vColor.rgb;
|
||
}
|
||
`;class gg extends li{constructor(t){super(t),this.shaderGenerator=new Np(dL,fL),this.geometryClass=Uw,this.vertexSize=7}packInterleavedGeometry(t,e,s,r,n){const{uint32View:a,float32View:o}=e,h=r/this.vertexSize,l=t.uvs,c=t.indices,u=t.vertexData,d=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),m=Wt.shared.setValue(t._tintRGB).toPremultiplied(f,!0),p=Wt.shared.setValue(t._darkTintRGB).premultiply(f,!0).toPremultiplied(1,!1);for(let g=0;g<u.length;g+=2)o[r++]=u[g],o[r++]=u[g+1],o[r++]=l[g],o[r++]=l[g+1],a[r++]=m,a[r++]=p,o[r++]=d;for(let g=0;g<c.length;g++)s[n++]=h+c[g]}}x(gg,"extension",{name:"darkTintBatch",type:gt.RendererPlugin});St.add(gg);const ai=class ai extends zn{constructor(){const e=new Zc;e.getBuffer("aVertexPosition").static=!1,e.getBuffer("aTextureCoord").static=!1;const s=new rl(Nt.EMPTY);super(e,s);x(this,"name","");x(this,"warnedTwoTint",!1)}updateFromSpineData(e,s,r,n,a,o,h,l){var y,_;this.texture=e.texture;const c=a/(l?12:8)*2,u=this.geometry.getBuffer("aTextureCoord");((y=u.data)==null?void 0:y.length)!==c&&(u.data=new Float32Array(c));const d=this.geometry.getBuffer("aVertexPosition");((_=d.data)==null?void 0:_.length)!==c&&(d.data=new Float32Array(c));let f=0;const m=u.data,p=d.data;for(let v=0;v<a;v+=l?12:8){let b=v;p[f]=n[b++],p[f+1]=n[b++],b+=4,m[f]=n[b++],m[f+1]=n[b++],f+=2}l&&!this.warnedTwoTint&&(console.warn("DarkTint is not enabled by default. To enable use a DarkSlotMesh factory while creating the Spine object."),this.warnedTwoTint=!0),ai.auxColor[0]=n[2],ai.auxColor[1]=n[3],ai.auxColor[2]=n[4],ai.auxColor[3]=n[5],this.tint=ai.auxColor,this.alpha=ai.auxColor[3],this.blendMode=qn.toPixiBlending(s);const g=this.geometry.indexBuffer;if(g.data.length!==o.length)g.data=new Uint32Array(o);else{const v=g.data;for(let b=0;b<h;b++)v[b]=o[b]}this.name=r,u.update(),d.update(),g.update()}};x(ai,"auxColor",[0,0,0,0]);let yc=ai;class mL{constructor(t,e,s,r){x(this,"x");x(this,"y");x(this,"width");x(this,"height");this.x=t,this.y=e,this.width=s,this.height=r}calculateBounds(){return{x:this.x,y:this.y,width:this.width,height:this.height}}}class pL{constructor(t=!1){x(this,"clipping");this.clipping=t}calculateBounds(t){if(!t.skeleton)return{x:0,y:0,width:0,height:0};const e=new Mi(t.skeleton.data);e.setupPose(),e.updateWorldTransform(Os.update);const s=e.getBoundsRect(this.clipping?new ao:void 0);return s.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:s}}class gL{constructor(t,e=[],s=.05,r=!1){x(this,"animation");x(this,"skins");x(this,"timeStep");x(this,"clipping");this.animation=t,this.skins=e,this.timeStep=s,this.clipping=r}calculateBounds(t){if(!t.skeleton||!t.state)return{x:0,y:0,width:0,height:0};const e=new qa(t.state.data),s=new Mi(t.skeleton.data),r=this.clipping?new ao:void 0,n=s.data;if(this.skins.length>0){const o=new Ka("custom-skin");for(const h of this.skins){const l=n.findSkin(h);l!=null&&o.addSkin(l)}s.setSkin(o)}s.setupPose();const a=this.animation!=null?n.findAnimation(this.animation):null;if(a==null){s.updateWorldTransform(Os.update);const o=s.getBoundsRect(r);return o.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:o}else{let o=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;e.clearTracks(),e.setAnimation(0,a,!1);const u=Math.max(a.duration/this.timeStep,1);for(let f=0;f<u;f++){const m=f>0?this.timeStep:0;e.update(m),e.apply(s),s.update(m),s.updateWorldTransform(Os.update);const p=s.getBoundsRect(r);o=Math.min(o,p.x),h=Math.min(h,p.y),l=Math.max(l,p.x+p.width),c=Math.max(c,p.y+p.height)}const d={x:o,y:h,width:l-o,height:c-h};return d.width===Number.NEGATIVE_INFINITY?{x:0,y:0,width:0,height:0}:d}}}const $t=class $t extends fs{constructor(e){super();x(this,"skeleton");x(this,"state");x(this,"skeletonPhysics");x(this,"darkTint",!1);x(this,"hasNeverUpdated",!0);x(this,"_debug");x(this,"slotMeshFactory",()=>new yc);x(this,"beforeUpdateWorldTransforms",()=>{});x(this,"afterUpdateWorldTransforms",()=>{});x(this,"_autoUpdate",!1);x(this,"_ticker",ss.shared);x(this,"meshesCache",new Map);x(this,"lightColor",new Ft);x(this,"darkColor",new Ft);x(this,"clippingVertAux",new Float32Array(6));x(this,"_boundsProvider");x(this,"_boundsPoint",new Kt);x(this,"_boundsSpineID",-1);x(this,"_boundsSpineDirty",!0);x(this,"slotsObject",new Map);x(this,"verticesCache",bt.newFloatArray(1024));x(this,"clippingSlotToPixiMasks",{});e instanceof Bl?e={skeletonData:e}:"skeleton"in e&&(e=new.target.createOptions(e));const{autoUpdate:s=!0,boundsProvider:r,darkTint:n,skeletonData:a,ticker:o}=e;this.skeleton=new Mi(a),this.skeletonPhysics=new pg(this.skeleton,{readTransform:(h,l)=>this.readPhysicsTransform(h,l),worldToSkeleton:h=>this.pixiWorldCoordinatesToSkeleton(h)}),this.state=new qa(new og(a)),o&&(this._ticker=o),this.autoUpdate=s,this.boundsProvider=r,this.darkTint=n===void 0?this.skeleton.slots.some(h=>!!h.data.setupPose.darkColor):n,this.darkTint&&(this.slotMeshFactory=()=>new gc)}get debug(){return this._debug}set debug(e){this._debug&&this._debug.unregisterSpine(this),e&&e.registerSpine(this),this._debug=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!e&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=e}get ticker(){return this._ticker}set ticker(e){e=e??ss.shared,this._ticker!==e&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),e.add(this.internalUpdate,this)),this._ticker=e)}get boundsProvider(){return this._boundsProvider}set boundsProvider(e){this._boundsProvider=e,e?(this._boundsSpineID=-1,this._boundsSpineDirty=!0,this.interactiveChildren=!1):(this.interactiveChildren=!0,this.hitArea=null),this.hasNeverUpdated||this.calculateBounds()}update(e){this.internalUpdate(0,e)}internalUpdate(e,s){this.hasNeverUpdated=!1;const r=s??this._ticker.deltaMS/1e3;this.state.update(r),this.state.apply(this.skeleton),this.skeletonPhysics.applyTransformMovement(),this.beforeUpdateWorldTransforms(this),this.skeleton.update(r),this.skeleton.updateWorldTransform(Os.update),this.afterUpdateWorldTransforms(this)}readPhysicsTransform(e,s){const r=this.worldTransform;if(e.x=r.tx,e.y=r.ty,e.z=0,!s)return;let n=0;for(let a=this;a;a=a.parent)n+=a.rotation+(a.skew.y-a.skew.x)/2;e.rotation=n*180/Math.PI}updateTransform(){var e;this.renderMeshes(),this.sortChildren(),(e=this.debug)==null||e.renderDebug(this),super.updateTransform()}destroy(e){this.autoUpdate&&(this.autoUpdate=!1),this._ticker=null;for(const[,s]of this.meshesCache)s==null||s.destroy();this.state.clearListeners(),this.debug=void 0,this.meshesCache.clear(),this.slotsObject.clear();for(const s in this.clippingSlotToPixiMasks)this.clippingSlotToPixiMasks[s].destroy(),delete this.clippingSlotToPixiMasks[s];super.destroy(e)}unloadFromCache(){var r;const e=(r=this.skeleton)==null?void 0:r.data;if(!e)return!1;const s=$t.skeletonDataCacheKeys.get(e);return!s||$t.skeletonCache[s]!==e?!1:(delete $t.skeletonCache[s],$t.skeletonDataCacheKeys.delete(e),!0)}resetMeshes(){for(const[,e]of this.meshesCache)e.zIndex=-1,e.visible=!1}_calculateBounds(){this.hasNeverUpdated&&(this.internalUpdate(0,0),this.renderMeshes())}hasMeshForSlot(e){return this.meshesCache.has(e)}getMeshForSlot(e){let s=this.hasMeshForSlot(e)?this.meshesCache.get(e):null;return s?s.visible=!0:(s=this.slotMeshFactory(),this.addChild(s),this.meshesCache.set(e,s)),s}getSlotFromRef(e){let s;if(typeof e=="number"?s=this.skeleton.slots[e]:typeof e=="string"?s=this.skeleton.findSlot(e):s=e,!s)throw new Error(`No slot found with the given slot reference: ${e}`);return s}addSlotObject(e,s,r){var o;const n=this.getSlotFromRef(e),a=(o=this.slotsObject.get(n))==null?void 0:o.container;if(!(a&&a===s)){for(const[h,{container:l}]of this.slotsObject)if(h!==n&&l===s){this.removeSlotObject(h,s);break}a&&this.removeChild(a),this.slotsObject.set(n,{container:s,followAttachmentTimeline:(r==null?void 0:r.followAttachmentTimeline)||!1,followSlotColor:(r==null?void 0:r.followSlotColor)||!1}),this.addChild(s)}}getSlotObject(e){const s=this.slotsObject.get(this.getSlotFromRef(e));return s?s.container:void 0}removeSlotObject(e,s){var a;const r=this.getSlotFromRef(e),n=(a=this.slotsObject.get(r))==null?void 0:a.container;n&&(s&&s!==n||(this.removeChild(n),this.slotsObject.delete(r)))}removeSlotObjects(){for(const[,e]of this.slotsObject)e.container.removeFromParent();this.slotsObject.clear()}pixiMaskCleanup(e){const s=this.clippingSlotToPixiMasks[e.data.name];s&&(delete this.clippingSlotToPixiMasks[e.data.name],s.destroy())}updateSlotObject(e,s,r){const{container:n,followAttachmentTimeline:a}=e,o=s.appliedPose,h=a?!!o.attachment:!0,l=this.skeleton.drawOrder.appliedPose;if(n.visible=l.includes(s)&&h,n.visible){const c=s.bone.appliedPose,u=n.localTransform;u.a=c.a,u.b=c.c,u.c=-c.b,u.d=-c.d,u.tx=c.worldX,u.ty=c.worldY,n.transform.setFromMatrix(u),n.zIndex=r+1,n.alpha=this.skeleton.color.a*o.color.a,e.followSlotColor&&this.setSlotObjectTint(n,255*this.skeleton.color.r*o.color.r<<16|255*this.skeleton.color.g*o.color.g<<8|255*this.skeleton.color.b*o.color.b)}}setSlotObjectTint(e,s){const r=e;"tint"in r&&(r.tint=s);for(const n of r.children??[])this.setSlotObjectTint(n,s)}updateAndSetPixiMask(e,s){if($t.clipper.isClipping()&&e){let r=this.clippingSlotToPixiMasks[e.slot.data.name];if(r||(r=new gs,this.clippingSlotToPixiMasks[e.slot.data.name]=r,this.addChild(r)),!e.computed){e.computed=!0;const n=e.slot.appliedPose.attachment,a=n.worldVerticesLength;this.clippingVertAux.length<a&&(this.clippingVertAux=new Float32Array(a)),n.computeWorldVertices(this.skeleton,e.slot,0,a,this.clippingVertAux,0,2),r.clear().lineStyle(0).beginFill(0),r.moveTo(this.clippingVertAux[0],this.clippingVertAux[1]);for(let o=2;o<a;o+=2)r.lineTo(this.clippingVertAux[o],this.clippingVertAux[o+1]);r.finishPoly()}s.mask=r}else s.mask&&(s.mask=null)}renderMeshes(){var o,h;this.resetMeshes();let e=null,s=null,r=null;const n=this.skeleton.drawOrder.appliedPose,a=n;for(let l=0,c=n.length,u=0;l<c;l++){const d=a[l],f=this.slotsObject.get(d),m=l+u;f&&(this.updateSlotObject(f,d,m+1),u++,this.updateAndSetPixiMask(r,f.container));const p=d.appliedPose,g=!!p.darkColor,y=g?$t.DARK_VERTEX_SIZE:$t.VERTEX_SIZE;if(!d.bone.active){$t.clipper.clipEnd(d),this.pixiMaskCleanup(d);continue}const _=p.attachment;let v,b,T=0;const S=this.skeleton;if(_ instanceof _r){v=_.color,T=y*4;const E=_.sequence,A=E.resolveIndex(p);_.computeWorldVertices(d,_.getOffsets(p),this.verticesCache,0,y),e=$t.QUAD_TRIANGLES,s=E.getUVs(A),b=(o=E.regions[A])==null?void 0:o.texture}else if(_ instanceof Vs){const w=_;v=w.color,T=(w.worldVerticesLength>>1)*y,T>this.verticesCache.length&&(this.verticesCache=bt.newFloatArray(T)),w.computeWorldVertices(S,d,0,w.worldVerticesLength,this.verticesCache,0,y),e=w.triangles;const E=_.sequence,A=E.resolveIndex(p);s=E.getUVs(A),b=(h=E.regions[A])==null?void 0:h.texture}else if(_ instanceof zr){$t.clipper.clipStart(S,d,_),r={slot:d,computed:!1};continue}else{this.hasMeshForSlot(d)&&(this.getMeshForSlot(d).visible=!1),$t.clipper.clipEnd(d),this.pixiMaskCleanup(d);continue}if(b!=null){const w=S.color,E=p.color,A=w.a*E.a*v.a;this.lightColor.set(w.r*E.r*v.r,w.g*E.g*v.g,w.b*E.b*v.b,A),p.darkColor!=null?this.darkColor.set(p.darkColor.r,p.darkColor.g,p.darkColor.b,1):this.darkColor.set(0,0,0,1);let P,I,C,R;if($t.clipper.isClipping()&&$t.clipper.clipTriangles(this.verticesCache,e,e.length,s,this.lightColor,this.darkColor,g,y))P=$t.clipper.clippedVertices,I=P.length,C=$t.clipper.clippedTriangles,R=C.length;else{const D=this.verticesCache;for(let M=2,O=0,k=T;M<k;M+=y,O+=2){let N=M;D[N++]=this.lightColor.r,D[N++]=this.lightColor.g,D[N++]=this.lightColor.b,D[N++]=this.lightColor.a,D[N++]=s[O],D[N++]=s[O+1],g&&(D[N++]=this.darkColor.r,D[N++]=this.darkColor.g,D[N++]=this.darkColor.b,D[N++]=this.darkColor.a)}P=this.verticesCache,I=T,C=e,R=e.length}if(I===0||R===0){$t.clipper.clipEnd(d);continue}const F=this.getMeshForSlot(d);F.renderable=!0,F.zIndex=m,F.updateFromSpineData(b,d.data.blendMode,d.data.name,P,I,C,R,g)}$t.clipper.clipEnd(d),this.pixiMaskCleanup(d)}$t.clipper.clipEnd()}calculateBounds(){if(!this._boundsProvider){super.calculateBounds();return}const e=this.transform;if(this._boundsSpineID===e._worldID)return;this.updateBounds();const s=this._localBounds,r=this._boundsPoint;r.set(s.minX,s.minY),e.worldTransform.apply(r,r),this._bounds.minX=r.x,this._bounds.minY=r.y,r.set(s.maxX,s.maxY),e.worldTransform.apply(r,r),this._bounds.maxX=r.x,this._bounds.maxY=r.y}updateBounds(){if(!this._boundsProvider||!this._boundsSpineDirty)return;this._boundsSpineDirty=!1,this._localBounds||(this._localBounds=new Ya);const e=this._boundsProvider.calculateBounds(this),s=this._localBounds;s.clear(),s.minX=e.x,s.minY=e.y,s.maxX=e.x+e.width,s.maxY=e.y+e.height,this.hitArea=this._localBounds.getRectangle()}setBonePosition(e,s){const r=typeof e=="string"?this.skeleton.findBone(e):e;if(!r)throw Error(`Cannot set bone position, bone ${String(e)} not found`);$t.vectorAux.set(s.x,s.y);const n=r.appliedPose;if(r.parent){const a=r.parent.appliedPose.worldToLocal($t.vectorAux);n.x=a.x,n.y=a.y}else n.x=$t.vectorAux.x,n.y=$t.vectorAux.y}getBonePosition(e,s){const r=typeof e=="string"?this.skeleton.findBone(e):e;return r?(s||(s={x:0,y:0}),s.x=r.appliedPose.worldX,s.y=r.appliedPose.worldY,s):(console.error(`Cannot get bone position! Bone ${String(e)} not found`),s)}skeletonToPixiWorldCoordinates(e){this.worldTransform.apply(e,e)}pixiWorldCoordinatesToSkeleton(e){this.worldTransform.applyInverse(e,e)}pixiWorldCoordinatesToBone(e,s){this.pixiWorldCoordinatesToSkeleton(e),s.parent?s.parent.appliedPose.worldToLocal(e):s.appliedPose.worldToLocal(e)}static getSkeletonCacheKey({skeleton:e,atlas:s,scale:r=1}){return`${e}-${s}-${r}`}static createOptions({skeleton:e,atlas:s,scale:r=1,darkTint:n,autoUpdate:a=!0,boundsProvider:o,allowMissingRegions:h,ticker:l}){const c=$t.getSkeletonCacheKey({skeleton:e,atlas:s,scale:r});let u=$t.skeletonCache[c];if(!u){const d=Cs.get(e),f=Cs.get(s),m=new hg(f,h),p=d instanceof Uint8Array?new ug(m):new mg(m);p.scale=r,u=p.readSkeletonData(d),$t.skeletonCache[c]=u}return $t.skeletonDataCacheKeys.set(u,c),{skeletonData:u,darkTint:n,autoUpdate:a,boundsProvider:o,ticker:l}}static from(e){return new $t($t.createOptions(e))}get tint(){return this.skeleton.color.toRgb888()}set tint(e){Ft.rgb888ToColor(this.skeleton.color,e)}};x($t,"vectorAux",new il),x($t,"clipper",new ao),x($t,"QUAD_TRIANGLES",[0,1,2,2,3,0]),x($t,"VERTEX_SIZE",8),x($t,"DARK_VERTEX_SIZE",12),x($t,"skeletonCache",Object.create(null)),x($t,"skeletonDataCacheKeys",new WeakMap);let Jm=$t;Mi.yDown=!0;class yL{constructor(){x(this,"registeredSpines",new Map);x(this,"drawMeshHull",!0);x(this,"drawMeshTriangles",!0);x(this,"drawBones",!0);x(this,"drawPaths",!0);x(this,"drawBoundingBoxes",!0);x(this,"drawClipping",!0);x(this,"drawRegionAttachments",!0);x(this,"drawEvents",!0);x(this,"lineWidth",1);x(this,"regionAttachmentsColor",30975);x(this,"meshHullColor",30975);x(this,"meshTrianglesColor",16763904);x(this,"clippingPolygonColor",16711935);x(this,"boundingBoxesRectColor",65280);x(this,"boundingBoxesPolygonColor",65280);x(this,"boundingBoxesCircleColor",65280);x(this,"pathsCurveColor",16711680);x(this,"pathsLineColor",16711935);x(this,"skeletonXYColor",16711680);x(this,"bonesColor",61132);x(this,"eventFontSize",24);x(this,"eventFontColor",0)}registerSpine(t){if(this.registeredSpines.has(t)){console.warn("SpineDebugRenderer.registerSpine() - this spine is already registered!",t);return}const e={parentDebugContainer:new fs,bones:new fs,skeletonXY:new gs,regionAttachmentsShape:new gs,meshTrianglesLine:new gs,meshHullLine:new gs,clippingPolygon:new gs,boundingBoxesRect:new gs,boundingBoxesCircle:new gs,boundingBoxesPolygon:new gs,pathsCurve:new gs,pathsLine:new gs,eventText:new fs,eventCallback:{event:(s,r)=>{if(this.drawEvents){const n=Math.abs(t.scale.x||t.scale.y||1),a=new Hp(r.data.name,{fontSize:this.eventFontSize/n,fill:this.eventFontColor,fontFamily:"monospace"});a.scale.x=Math.sign(t.scale.x),a.anchor.set(.5),e.eventText.addChild(a),setTimeout(()=>{a.destroyed||a.destroy()},250)}}}};e.parentDebugContainer.addChild(e.bones),e.parentDebugContainer.addChild(e.skeletonXY),e.parentDebugContainer.addChild(e.regionAttachmentsShape),e.parentDebugContainer.addChild(e.meshTrianglesLine),e.parentDebugContainer.addChild(e.meshHullLine),e.parentDebugContainer.addChild(e.clippingPolygon),e.parentDebugContainer.addChild(e.boundingBoxesRect),e.parentDebugContainer.addChild(e.boundingBoxesCircle),e.parentDebugContainer.addChild(e.boundingBoxesPolygon),e.parentDebugContainer.addChild(e.pathsCurve),e.parentDebugContainer.addChild(e.pathsLine),e.parentDebugContainer.addChild(e.eventText),e.parentDebugContainer.zIndex=9999999,e.parentDebugContainer.accessibleChildren=!1,e.parentDebugContainer.eventMode="none",e.parentDebugContainer.interactiveChildren=!1,t.addChild(e.parentDebugContainer),t.state.addListener(e.eventCallback),this.registeredSpines.set(t,e)}renderDebug(t){this.registeredSpines.has(t)||this.registerSpine(t);const e=this.registeredSpines.get(t);if(!e)return;t.addChild(e.parentDebugContainer),e.skeletonXY.clear(),e.regionAttachmentsShape.clear(),e.meshTrianglesLine.clear(),e.meshHullLine.clear(),e.clippingPolygon.clear(),e.boundingBoxesRect.clear(),e.boundingBoxesCircle.clear(),e.boundingBoxesPolygon.clear(),e.pathsCurve.clear(),e.pathsLine.clear();for(let n=e.bones.children.length;n>0;n--)e.bones.children[n-1].destroy({children:!0,texture:!0,baseTexture:!0});const s=Math.abs(t.scale.x||t.scale.y||1),r=this.lineWidth/s;if(this.drawBones&&this.drawBonesFunc(t,e,r,s),this.drawPaths&&this.drawPathsFunc(t,e,r),this.drawBoundingBoxes&&this.drawBoundingBoxesFunc(t,e,r),this.drawClipping&&this.drawClippingFunc(t,e,r),(this.drawMeshHull||this.drawMeshTriangles)&&this.drawMeshHullAndMeshTriangles(t,e,r),this.drawRegionAttachments&&this.drawRegionAttachmentsFunc(t,e,r),this.drawEvents)for(const n of e.eventText.children)n.alpha-=.05,n.y-=2}drawBonesFunc(t,e,s,r){const n=t.skeleton,a=n.x,o=n.y,h=n.bones;e.skeletonXY.lineStyle(s,this.skeletonXYColor,1);for(let c=0,u=h.length;c<u;c++){const d=h[c],f=d.data.length,m=d.appliedPose,p=a+m.worldX,g=o+m.worldY,y=a+f*m.a+m.worldX,_=o+f*m.b+m.worldY;if(d.data.name==="root"||d.data.parent===null)continue;const v=Math.abs(p-y),b=Math.abs(g-_),T=Math.pow(v,2),S=b,w=Math.pow(b,2),E=Math.sqrt(T+w),A=Math.pow(E,2),P=Math.PI/180,I=Math.acos((A+w-T)/(2*S*E))||0;if(E===0)continue;const C=new gs;e.bones.addChild(C);const R=E/50/r;C.beginFill(this.bonesColor,1),C.drawPolygon(0,0,0-R,E-R*3,0,E-R,0+R,E-R*3),C.endFill(),C.x=p,C.y=g,C.pivot.y=E;let F=0;p<y&&g<_?F=-I+180*P:p>y&&g<_?F=180*P+I:p>y&&g>_?F=-I:p<y&&g>_?F=I:g===_&&p<y?F=90*P:g===_&&p>y?F=-90*P:p===y&&g<_?F=180*P:p===y&&g>_&&(F=0),C.rotation=F,C.lineStyle(s+R/2.4,this.bonesColor,1),C.beginFill(0,.6),C.drawCircle(0,E,R*1.2),C.endFill()}const l=s*3;e.skeletonXY.moveTo(a-l,o-l),e.skeletonXY.lineTo(a+l,o+l),e.skeletonXY.moveTo(a+l,o-l),e.skeletonXY.lineTo(a-l,o+l)}drawRegionAttachmentsFunc(t,e,s){const n=t.skeleton.slots;e.regionAttachmentsShape.lineStyle(s,this.regionAttachmentsColor,1);for(let a=0,o=n.length;a<o;a++){const h=n[a],l=h.appliedPose.attachment;if(l==null||!(l instanceof _r))continue;const c=new Float32Array(8);l.computeWorldVertices(h,l.getOffsets(h.appliedPose),c,0,2),e.regionAttachmentsShape.drawPolygon(Array.from(c.slice(0,8)))}}drawMeshHullAndMeshTriangles(t,e,s){const r=t.skeleton,n=r.slots;e.meshHullLine.lineStyle(s,this.meshHullColor,1),e.meshTrianglesLine.lineStyle(s,this.meshTrianglesColor,1);for(let a=0,o=n.length;a<o;a++){const h=n[a];if(!h.bone.active)continue;const l=h.appliedPose.attachment;if(l==null||!(l instanceof Vs))continue;const c=l,u=new Float32Array(c.worldVerticesLength),d=c.triangles;let f=c.hullLength;if(c.computeWorldVertices(r,h,0,c.worldVerticesLength,u,0,2),this.drawMeshTriangles)for(let m=0,p=d.length;m<p;m+=3){const g=d[m]*2,y=d[m+1]*2,_=d[m+2]*2;e.meshTrianglesLine.moveTo(u[g],u[g+1]),e.meshTrianglesLine.lineTo(u[y],u[y+1]),e.meshTrianglesLine.lineTo(u[_],u[_+1])}if(this.drawMeshHull&&f>0){f=(f>>1)*2;let m=u[f-2],p=u[f-1];for(let g=0,y=f;g<y;g+=2){const _=u[g],v=u[g+1];e.meshHullLine.moveTo(_,v),e.meshHullLine.lineTo(m,p),m=_,p=v}}}}drawClippingFunc(t,e,s){const r=t.skeleton,n=r.slots;e.clippingPolygon.lineStyle(s,this.clippingPolygonColor,1);for(let a=0,o=n.length;a<o;a++){const h=n[a];if(!h.bone.active)continue;const l=h.appliedPose.attachment;if(l==null||!(l instanceof zr))continue;const c=l,u=c.worldVerticesLength,d=new Float32Array(u);c.computeWorldVertices(r,h,0,u,d,0,2),e.clippingPolygon.drawPolygon(Array.from(d))}}drawBoundingBoxesFunc(t,e,s){e.boundingBoxesRect.lineStyle(s,this.boundingBoxesRectColor,5);const r=new fg;r.update(t.skeleton,!0),r.minX!==1/0&&e.boundingBoxesRect.drawRect(r.minX,r.minY,r.getWidth(),r.getHeight());const n=r.polygons,a=(o,h,l)=>{if(e.boundingBoxesPolygon.lineStyle(s,this.boundingBoxesPolygonColor,1),e.boundingBoxesPolygon.beginFill(this.boundingBoxesPolygonColor,.1),l<3)throw new Error("Polygon must contain at least 3 vertices");const c=[],u=s*2;for(let d=0,f=o.length;d<f;d+=2){const m=o[d],p=o[d+1];e.boundingBoxesCircle.lineStyle(0),e.boundingBoxesCircle.beginFill(this.boundingBoxesCircleColor),e.boundingBoxesCircle.drawCircle(m,p,u),e.boundingBoxesCircle.endFill(),c.push(m,p)}e.boundingBoxesPolygon.drawPolygon(c),e.boundingBoxesPolygon.endFill()};for(let o=0,h=n.length;o<h;o++){const l=n[o];a(l,0,l.length)}}drawPathsFunc(t,e,s){const r=t.skeleton,n=r.slots;e.pathsCurve.lineStyle(s,this.pathsCurveColor,1),e.pathsLine.lineStyle(s,this.pathsLineColor,1);for(let a=0,o=n.length;a<o;a++){const h=n[a];if(!h.bone.active)continue;const l=h.appliedPose.attachment;if(l==null||!(l instanceof on))continue;const c=l;let u=c.worldVerticesLength;const d=new Float32Array(u);c.computeWorldVertices(r,h,0,u,d,0,2);let f=d[2],m=d[3],p=0,g=0;if(c.closed){const y=d[0],_=d[1],v=d[u-2],b=d[u-1];p=d[u-4],g=d[u-3],e.pathsCurve.moveTo(f,m),e.pathsCurve.bezierCurveTo(y,_,v,b,p,g),e.pathsLine.moveTo(f,m),e.pathsLine.lineTo(y,_),e.pathsLine.moveTo(p,g),e.pathsLine.lineTo(v,b)}u-=4;for(let y=4;y<u;y+=6){const _=d[y],v=d[y+1],b=d[y+2],T=d[y+3];p=d[y+4],g=d[y+5],e.pathsCurve.moveTo(f,m),e.pathsCurve.bezierCurveTo(_,v,b,T,p,g),e.pathsLine.moveTo(f,m),e.pathsLine.lineTo(_,v),e.pathsLine.moveTo(p,g),e.pathsLine.lineTo(b,T),f=p,m=g}}}unregisterSpine(t){this.registeredSpines.has(t)||console.warn("SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!",t);const e=this.registeredSpines.get(t);e&&(t.state.removeListener(e.eventCallback),e.parentDebugContainer.destroy({baseTexture:!0,children:!0,texture:!0}),this.registeredSpines.delete(t))}}const dO=Object.freeze(Object.defineProperty({__proto__:null,AABBRectangleBoundsProvider:mL,ATTACH_RETAIN:mc,ATTACH_SETUP:fc,AlphaTimeline:gu,Animation:Pl,AnimationState:qa,AnimationStateAdapter:kw,AnimationStateData:og,AssetCache:al,AssetManagerBase:Lw,AtlasAttachmentLoader:hg,Attachment:Ha,AttachmentTimeline:Yn,BinaryInput:dg,get BlendMode(){return fr},Bone:Gn,BoneData:io,BonePose:ol,BoneTimeline1:ki,BoneTimeline2:Ml,BoundingBoxAttachment:ro,CURRENT:cc,ClippingAttachment:zr,Color:Ft,Constraint:ta,ConstraintData:ea,ConstraintTimeline1:Qn,CurveTimeline:Fi,CurveTimeline1:dr,DarkSlotMesh:gc,DarkTintBatchGeometry:Uw,DarkTintGeometry:Ow,DarkTintMaterial:Dw,DarkTintMesh:Nw,DarkTintRenderer:gg,DebugUtils:Pw,DeformTimeline:bu,Downloader:lg,DrawOrder:cg,DrawOrderFolderTimeline:an,DrawOrderTimeline:Wr,Event:kl,EventData:Ou,EventQueue:ng,EventTimeline:jn,get EventType(){return ns},FIRST:uc,FakeTexture:Fw,FromProperty:dn,FromRotate:gl,FromScaleX:bl,FromScaleY:vl,FromShearY:_l,FromX:yl,FromY:xl,HOLD:va,IkConstraint:Ur,IkConstraintData:Ba,IkConstraintPose:ll,IkConstraintTimeline:vu,get Inherit(){return be},InheritTimeline:fu,IntSet:Cw,Interpolation:en,MODE:dc,MathUtils:pt,MeshAttachment:Vs,get MixFrom(){return At},PathAttachment:on,PathConstraint:cl,PathConstraintData:Oa,PathConstraintMixTimeline:Su,PathConstraintPose:hl,PathConstraintPositionTimeline:wu,PathConstraintSpacingTimeline:Tu,get Physics(){return Os},PhysicsConstraint:no,PhysicsConstraintDampingTimeline:Cu,PhysicsConstraintData:Da,PhysicsConstraintGravityTimeline:Mu,PhysicsConstraintInertiaTimeline:Eu,PhysicsConstraintMassTimeline:Iu,PhysicsConstraintMixTimeline:Ru,PhysicsConstraintPose:ul,PhysicsConstraintResetTimeline:ja,PhysicsConstraintStrengthTimeline:Au,PhysicsConstraintTimeline:Kr,PhysicsConstraintWindTimeline:Pu,PointAttachment:Rl,Pool:$a,Posed:Lu,PosedActive:Bu,PosedData:Fl,get PositionMode(){return Qs},Pow:Jp,PowOut:Iw,get Property(){return Bt},RGB2Timeline:xu,RGBA2Timeline:yu,RGBATimeline:mu,RGBTimeline:pu,RegionAttachment:_r,get RotateMode(){return Ti},RotateTimeline:Wa,SETUP:ag,ScaleTimeline:ou,ScaleXTimeline:lu,get ScaleYMode(){return es},ScaleYTimeline:hu,Sequence:nn,get SequenceMode(){return He},SequenceModeValues:ru,SequenceTimeline:za,SetupPoseBoundsProvider:pL,ShearTimeline:cu,ShearXTimeline:uu,ShearYTimeline:du,Skeleton:Mi,SkeletonBinary:ug,SkeletonBounds:fg,SkeletonClipping:ao,SkeletonData:Bl,SkeletonJson:mg,SkeletonPhysicsMovement:pg,SkeletonRendererCore:Bw,Skin:Ka,SkinEntry:pc,SkinsAndAnimationBoundsProvider:gL,Slider:ml,SliderData:yi,SliderMixTimeline:ku,SliderPose:fl,SliderTimeline:Fu,Slot:Ll,SlotCurveTimeline:so,SlotData:Du,SlotMesh:yc,SlotPose:dl,get SpacingMode(){return ke},Spine:Jm,SpineDebugRenderer:yL,SpineTexture:qn,StringSet:Zp,Texture:eu,TextureAtlas:nl,TextureAtlasPage:tg,TextureAtlasRegion:su,get TextureFilter(){return Oe},TextureRegion:Qp,get TextureWrap(){return xr},TimeKeeper:Mw,Timeline:ce,ToProperty:fn,ToRotate:Nu,ToScaleX:Vu,ToScaleY:Yu,ToShearY:Gu,ToX:Uu,ToY:Xu,TrackEntry:ig,TransformConstraint:Ol,TransformConstraintData:te,TransformConstraintPose:pl,TransformConstraintTimeline:_u,TranslateTimeline:iu,TranslateXTimeline:nu,TranslateYTimeline:au,Triangulator:Je,Utils:bt,Vector2:il,VertexAttachment:vr,WindowedMean:Rw,isBoneTimeline:sg,isConstraintTimeline:rg,isSlotTimeline:eg},Symbol.toStringTag,{value:"Module"}));export{ro as $,to as A,BL as B,fs as C,Hp as D,Ke as E,bs as F,gs as G,aO as H,eb as I,sb as J,dF as K,hc as L,fe as M,Jx as N,dp as O,Pc as P,bL as Q,CL as R,NL as S,_L as T,IL as U,PL as V,JM as W,mg as X,Qp as Y,_r as Z,Vs as _,xp as a,on as a0,Rl as a1,zr as a2,qp as a3,Qc as a4,hF as a5,oc as a6,pF as a7,Bo as a8,vL as a9,OT as aa,Ca as ab,Ce as ac,ML as ad,ep as ae,TL as af,EL as ag,kL as ah,LL as ai,uO as aj,dO as ak,Qf as b,OL as c,gp as d,SL as e,RL as f,gv as g,Lb as h,kS as i,Fb as j,Mn as k,fp as l,tn as m,sp as n,yp as o,Kb as p,ds as q,wL as r,FS as s,sT as t,Fp as u,tm as v,FL as w,BT as x,AL as y,Nt as z};
|