lyb-pixi-js 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/Custom/LibPixiButtonHover.d.ts +13 -5
- package/Components/Custom/LibPixiButtonHover.js +19 -10
- package/Components/Custom/LibPixiSubAddMinMax.d.ts +12 -12
- package/Components/Custom/LibPixiSubAddMinMax.js +15 -35
- package/README.md +68 -71
- package/Utils/LibPixiAudio.d.ts +2 -1
- package/Utils/LibPixiAudio.js +18 -13
- package/lyb-pixi.js +69 -69
- package/package.json +2 -1
package/lyb-pixi.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(qe){typeof define=="function"&&define.amd?define(qe):qe()})(function(){"use strict";var qe=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(qe||{}),$c=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))($c||{}),xo=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(xo||{}),K=(s=>(s[s.NORMAL=0]="NORMAL",s[s.ADD=1]="ADD",s[s.MULTIPLY=2]="MULTIPLY",s[s.SCREEN=3]="SCREEN",s[s.OVERLAY=4]="OVERLAY",s[s.DARKEN=5]="DARKEN",s[s.LIGHTEN=6]="LIGHTEN",s[s.COLOR_DODGE=7]="COLOR_DODGE",s[s.COLOR_BURN=8]="COLOR_BURN",s[s.HARD_LIGHT=9]="HARD_LIGHT",s[s.SOFT_LIGHT=10]="SOFT_LIGHT",s[s.DIFFERENCE=11]="DIFFERENCE",s[s.EXCLUSION=12]="EXCLUSION",s[s.HUE=13]="HUE",s[s.SATURATION=14]="SATURATION",s[s.COLOR=15]="COLOR",s[s.LUMINOSITY=16]="LUMINOSITY",s[s.NORMAL_NPM=17]="NORMAL_NPM",s[s.ADD_NPM=18]="ADD_NPM",s[s.SCREEN_NPM=19]="SCREEN_NPM",s[s.NONE=20]="NONE",s[s.SRC_OVER=0]="SRC_OVER",s[s.SRC_IN=21]="SRC_IN",s[s.SRC_OUT=22]="SRC_OUT",s[s.SRC_ATOP=23]="SRC_ATOP",s[s.DST_OVER=24]="DST_OVER",s[s.DST_IN=25]="DST_IN",s[s.DST_OUT=26]="DST_OUT",s[s.DST_ATOP=27]="DST_ATOP",s[s.ERASE=26]="ERASE",s[s.SUBTRACT=28]="SUBTRACT",s[s.XOR=29]="XOR",s))(K||{}),Ne=(s=>(s[s.POINTS=0]="POINTS",s[s.LINES=1]="LINES",s[s.LINE_LOOP=2]="LINE_LOOP",s[s.LINE_STRIP=3]="LINE_STRIP",s[s.TRIANGLES=4]="TRIANGLES",s[s.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",s[s.TRIANGLE_FAN=6]="TRIANGLE_FAN",s))(Ne||{}),O=(s=>(s[s.RGBA=6408]="RGBA",s[s.RGB=6407]="RGB",s[s.RG=33319]="RG",s[s.RED=6403]="RED",s[s.RGBA_INTEGER=36249]="RGBA_INTEGER",s[s.RGB_INTEGER=36248]="RGB_INTEGER",s[s.RG_INTEGER=33320]="RG_INTEGER",s[s.RED_INTEGER=36244]="RED_INTEGER",s[s.ALPHA=6406]="ALPHA",s[s.LUMINANCE=6409]="LUMINANCE",s[s.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",s[s.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",s[s.DEPTH_STENCIL=34041]="DEPTH_STENCIL",s))(O||{}),Ws=(s=>(s[s.TEXTURE_2D=3553]="TEXTURE_2D",s[s.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",s[s.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",s[s.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",s[s.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",s[s.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",s[s.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",s))(Ws||{}),Z=(s=>(s[s.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",s[s.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",s[s.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",s[s.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",s[s.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",s[s.UNSIGNED_INT=5125]="UNSIGNED_INT",s[s.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",s[s.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",s[s.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",s[s.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",s[s.BYTE=5120]="BYTE",s[s.SHORT=5122]="SHORT",s[s.INT=5124]="INT",s[s.FLOAT=5126]="FLOAT",s[s.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",s[s.HALF_FLOAT=36193]="HALF_FLOAT",s))(Z||{}),V=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(V||{}),bi=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(bi||{}),Ni=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Ni||{}),Ke=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(Ke||{}),he=(s=>(s[s.NPM=0]="NPM",s[s.UNPACK=1]="UNPACK",s[s.PMA=2]="PMA",s[s.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",s[s.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",s[s.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",s))(he||{}),Ze=(s=>(s[s.NO=0]="NO",s[s.YES=1]="YES",s[s.AUTO=2]="AUTO",s[s.BLEND=0]="BLEND",s[s.CLEAR=1]="CLEAR",s[s.BLIT=2]="BLIT",s))(Ze||{}),vo=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(vo||{}),Ce=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(Ce||{}),Vt=(s=>(s[s.NONE=0]="NONE",s[s.SCISSOR=1]="SCISSOR",s[s.STENCIL=2]="STENCIL",s[s.SPRITE=3]="SPRITE",s[s.COLOR=4]="COLOR",s))(Vt||{}),Gt=(s=>(s[s.NONE=0]="NONE",s[s.LOW=2]="LOW",s[s.MEDIUM=4]="MEDIUM",s[s.HIGH=8]="HIGH",s))(Gt||{}),Qe=(s=>(s[s.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",s[s.ARRAY_BUFFER=34962]="ARRAY_BUFFER",s[s.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",s))(Qe||{});const H={ADAPTER:{createCanvas:(s,t)=>{const e=document.createElement("canvas");return e.width=s,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,t)=>fetch(s,t),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var bo=/iPhone/i,Yc=/iPod/i,jc=/iPad/i,qc=/\biOS-universal(?:.+)Mac\b/i,To=/\bAndroid(?:.+)Mobile\b/i,Kc=/Android/i,Xs=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Bn=/Silk/i,Ti=/Windows Phone/i,Zc=/\bWindows(?:.+)ARM\b/i,Qc=/BlackBerry/i,Jc=/BB10/i,tu=/Opera Mini/i,eu=/\b(CriOS|Chrome)(?:.+)Mobile/i,iu=/Mobile(?:.+)Firefox\b/i,su=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function mg(s){return function(t){return t.test(s)}}function ru(s){var t={userAgent:"",platform:"",maxTouchPoints:0};!s&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof s=="string"?t.userAgent=s:s&&s.userAgent&&(t={userAgent:s.userAgent,platform:s.platform,maxTouchPoints:s.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var r=mg(e),n={apple:{phone:r(bo)&&!r(Ti),ipod:r(Yc),tablet:!r(bo)&&(r(jc)||su(t))&&!r(Ti),universal:r(qc),device:(r(bo)||r(Yc)||r(jc)||r(qc)||su(t))&&!r(Ti)},amazon:{phone:r(Xs),tablet:!r(Xs)&&r(Bn),device:r(Xs)||r(Bn)},android:{phone:!r(Ti)&&r(Xs)||!r(Ti)&&r(To),tablet:!r(Ti)&&!r(Xs)&&!r(To)&&(r(Bn)||r(Kc)),device:!r(Ti)&&(r(Xs)||r(Bn)||r(To)||r(Kc))||r(/\bokhttp\b/i)},windows:{phone:r(Ti),tablet:r(Zc),device:r(Ti)||r(Zc)},other:{blackberry:r(Qc),blackberry10:r(Jc),opera:r(tu),firefox:r(iu),chrome:r(eu),device:r(Qc)||r(Jc)||r(tu)||r(iu)||r(eu)},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 gg=ru.default??ru,wi=gg(globalThis.navigator);H.RETINA_PREFIX=/@([0-9\.]+)x/,H.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nu(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function _g(s){if(s.__esModule)return s;var t=s.default;if(typeof t=="function"){var e=function i(){return this instanceof i?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(s).forEach(function(i){var r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return s[i]}})}),e}var au={exports:{}};(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,d,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,d||h,u),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function a(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)t.call(c,d)&&l.push(e?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=e?e+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var u=0,f=d.length,p=new Array(f);u<f;u++)p[u]=d[u].fn;return p},o.prototype.listenerCount=function(l){var c=e?e+l:l,d=this._events[c];return d?d.fn?1:d.length:0},o.prototype.emit=function(l,c,d,u,f,p){var m=e?e+l:l;if(!this._events[m])return!1;var g=this._events[m],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,d),!0;case 4:return g.fn.call(g.context,c,d,u),!0;case 5:return g.fn.call(g.context,c,d,u,f),!0;case 6:return g.fn.call(g.context,c,d,u,f,p),!0}for(_=1,v=new Array(y-1);_<y;_++)v[_-1]=arguments[_];g.fn.apply(g.context,v)}else{var x=g.length,b;for(_=0;_<x;_++)switch(g[_].once&&this.removeListener(l,g[_].fn,void 0,!0),y){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,c);break;case 3:g[_].fn.call(g[_].context,c,d);break;case 4:g[_].fn.call(g[_].context,c,d,u);break;default:if(!v)for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];g[_].fn.apply(g[_].context,v)}}return!0},o.prototype.on=function(l,c,d){return n(this,l,c,d,!1)},o.prototype.once=function(l,c,d){return n(this,l,c,d,!0)},o.prototype.removeListener=function(l,c,d,u){var f=e?e+l:l;if(!this._events[f])return this;if(!c)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===c&&(!u||p.once)&&(!d||p.context===d)&&a(this,f);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==c||u&&!p[m].once||d&&p[m].context!==d)&&g.push(p[m]);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 i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,s.exports=o})(au);var yg=au.exports;const kr=nu(yg);var wo={exports:{}};wo.exports=On,wo.exports.default=On;function On(s,t,e){e=e||2;var i=t&&t.length,r=i?t[0]*e:s.length,n=ou(s,0,r,e,!0),a=[];if(!n||n.next===n.prev)return a;var o,h,l,c,d,u,f;if(i&&(n=wg(s,t,n,e)),s.length>80*e){o=l=s[0],h=c=s[1];for(var p=e;p<r;p+=e)d=s[p],u=s[p+1],d<o&&(o=d),u<h&&(h=u),d>l&&(l=d),u>c&&(c=u);f=Math.max(l-o,c-h),f=f!==0?32767/f:0}return Nr(n,a,e,o,h,f,0),a}function ou(s,t,e,i,r){var n,a;if(r===So(s,t,e,i)>0)for(n=t;n<e;n+=i)a=cu(n,s[n],s[n+1],a);else for(n=e-i;n>=t;n-=i)a=cu(n,s[n],s[n+1],a);return a&&Fn(a,a.next)&&(Gr(a),a=a.next),a}function us(s,t){if(!s)return s;t||(t=s);var e=s,i;do if(i=!1,!e.steiner&&(Fn(e,e.next)||wt(e.prev,e,e.next)===0)){if(Gr(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Nr(s,t,e,i,r,n,a){if(s){!a&&n&&Pg(s,i,r,n);for(var o=s,h,l;s.prev!==s.next;){if(h=s.prev,l=s.next,n?vg(s,i,r,n):xg(s)){t.push(h.i/e|0),t.push(s.i/e|0),t.push(l.i/e|0),Gr(s),s=l.next,o=l.next;continue}if(s=l,s===o){a?a===1?(s=bg(us(s),t,e),Nr(s,t,e,i,r,n,2)):a===2&&Tg(s,t,e,i,r,n):Nr(us(s),t,e,i,r,n,1);break}}}}function xg(s){var t=s.prev,e=s,i=s.next;if(wt(t,e,i)>=0)return!1;for(var r=t.x,n=e.x,a=i.x,o=t.y,h=e.y,l=i.y,c=r<n?r<a?r:a:n<a?n:a,d=o<h?o<l?o:l:h<l?h:l,u=r>n?r>a?r:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,p=i.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=d&&p.y<=f&&zs(r,o,n,h,a,l,p.x,p.y)&&wt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function vg(s,t,e,i){var r=s.prev,n=s,a=s.next;if(wt(r,n,a)>=0)return!1;for(var o=r.x,h=n.x,l=a.x,c=r.y,d=n.y,u=a.y,f=o<h?o<l?o:l:h<l?h:l,p=c<d?c<u?c:u:d<u?d:u,m=o>h?o>l?o:l:h>l?h:l,g=c>d?c>u?c:u:d>u?d:u,y=Eo(f,p,t,e,i),v=Eo(m,g,t,e,i),_=s.prevZ,x=s.nextZ;_&&_.z>=y&&x&&x.z<=v;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==r&&_!==a&&zs(o,c,h,d,l,u,_.x,_.y)&&wt(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==a&&zs(o,c,h,d,l,u,x.x,x.y)&&wt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=f&&_.x<=m&&_.y>=p&&_.y<=g&&_!==r&&_!==a&&zs(o,c,h,d,l,u,_.x,_.y)&&wt(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=v;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==a&&zs(o,c,h,d,l,u,x.x,x.y)&&wt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function bg(s,t,e){var i=s;do{var r=i.prev,n=i.next.next;!Fn(r,n)&&hu(r,i,i.next,n)&&Ur(r,n)&&Ur(n,r)&&(t.push(r.i/e|0),t.push(i.i/e|0),t.push(n.i/e|0),Gr(i),Gr(i.next),i=s=n),i=i.next}while(i!==s);return us(i)}function Tg(s,t,e,i,r,n){var a=s;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&Mg(a,o)){var h=lu(a,o);a=us(a,a.next),h=us(h,h.next),Nr(a,t,e,i,r,n,0),Nr(h,t,e,i,r,n,0);return}o=o.next}a=a.next}while(a!==s)}function wg(s,t,e,i){var r=[],n,a,o,h,l;for(n=0,a=t.length;n<a;n++)o=t[n]*i,h=n<a-1?t[n+1]*i:s.length,l=ou(s,o,h,i,!1),l===l.next&&(l.steiner=!0),r.push(Ig(l));for(r.sort(Eg),n=0;n<r.length;n++)e=Ag(r[n],e);return e}function Eg(s,t){return s.x-t.x}function Ag(s,t){var e=Sg(s,t);if(!e)return t;var i=lu(e,s);return us(i,i.next),us(e,e.next)}function Sg(s,t){var e=t,i=s.x,r=s.y,n=-1/0,a;do{if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){var o=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(o<=i&&o>n&&(n=o,a=e.x<e.next.x?e:e.next,o===i))return a}e=e.next}while(e!==t);if(!a)return null;var h=a,l=a.x,c=a.y,d=1/0,u;e=a;do i>=e.x&&e.x>=l&&i!==e.x&&zs(r<c?i:n,r,l,c,r<c?n:i,r,e.x,e.y)&&(u=Math.abs(r-e.y)/(i-e.x),Ur(e,s)&&(u<d||u===d&&(e.x>a.x||e.x===a.x&&Cg(a,e)))&&(a=e,d=u)),e=e.next;while(e!==h);return a}function Cg(s,t){return wt(s.prev,s,t.prev)<0&&wt(t.next,s,s.next)<0}function Pg(s,t,e,i){var r=s;do r.z===0&&(r.z=Eo(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==s);r.prevZ.nextZ=null,r.prevZ=null,Rg(r)}function Rg(s){var t,e,i,r,n,a,o,h,l=1;do{for(e=s,s=null,n=null,a=0;e;){for(a++,i=e,o=0,t=0;t<l&&(o++,i=i.nextZ,!!i);t++);for(h=l;o>0||h>0&&i;)o!==0&&(h===0||!i||e.z<=i.z)?(r=e,e=e.nextZ,o--):(r=i,i=i.nextZ,h--),n?n.nextZ=r:s=r,r.prevZ=n,n=r;e=i}n.nextZ=null,l*=2}while(a>1);return s}function Eo(s,t,e,i,r){return s=(s-e)*r|0,t=(t-i)*r|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,s|t<<1}function Ig(s){var t=s,e=s;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==s);return e}function zs(s,t,e,i,r,n,a,o){return(r-a)*(t-o)>=(s-a)*(n-o)&&(s-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(n-o)>=(r-a)*(i-o)}function Mg(s,t){return s.next.i!==t.i&&s.prev.i!==t.i&&!Dg(s,t)&&(Ur(s,t)&&Ur(t,s)&&Bg(s,t)&&(wt(s.prev,s,t.prev)||wt(s,t.prev,t))||Fn(s,t)&&wt(s.prev,s,s.next)>0&&wt(t.prev,t,t.next)>0)}function wt(s,t,e){return(t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y)}function Fn(s,t){return s.x===t.x&&s.y===t.y}function hu(s,t,e,i){var r=kn(wt(s,t,e)),n=kn(wt(s,t,i)),a=kn(wt(e,i,s)),o=kn(wt(e,i,t));return!!(r!==n&&a!==o||r===0&&Ln(s,e,t)||n===0&&Ln(s,i,t)||a===0&&Ln(e,s,i)||o===0&&Ln(e,t,i))}function Ln(s,t,e){return t.x<=Math.max(s.x,e.x)&&t.x>=Math.min(s.x,e.x)&&t.y<=Math.max(s.y,e.y)&&t.y>=Math.min(s.y,e.y)}function kn(s){return s>0?1:s<0?-1:0}function Dg(s,t){var e=s;do{if(e.i!==s.i&&e.next.i!==s.i&&e.i!==t.i&&e.next.i!==t.i&&hu(e,e.next,s,t))return!0;e=e.next}while(e!==s);return!1}function Ur(s,t){return wt(s.prev,s,s.next)<0?wt(s,t,s.next)>=0&&wt(s,s.prev,t)>=0:wt(s,t,s.prev)<0||wt(s,s.next,t)<0}function Bg(s,t){var e=s,i=!1,r=(s.x+t.x)/2,n=(s.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==s);return i}function lu(s,t){var e=new Ao(s.i,s.x,s.y),i=new Ao(t.i,t.x,t.y),r=s.next,n=t.prev;return s.next=t,t.prev=s,e.next=r,r.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function cu(s,t,e,i){var r=new Ao(s,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Gr(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Ao(s,t,e){this.i=s,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}On.deviation=function(s,t,e,i){var r=t&&t.length,n=r?t[0]*e:s.length,a=Math.abs(So(s,0,n,e));if(r)for(var o=0,h=t.length;o<h;o++){var l=t[o]*e,c=o<h-1?t[o+1]*e:s.length;a-=Math.abs(So(s,l,c,e))}var d=0;for(o=0;o<i.length;o+=3){var u=i[o]*e,f=i[o+1]*e,p=i[o+2]*e;d+=Math.abs((s[u]-s[p])*(s[f+1]-s[u+1])-(s[u]-s[f])*(s[p+1]-s[u+1]))}return a===0&&d===0?0:Math.abs((d-a)/a)};function So(s,t,e,i){for(var r=0,n=t,a=e-i;n<e;n+=i)r+=(s[a]-s[n])*(s[n+1]+s[a+1]),a=n;return r}On.flatten=function(s){for(var t=s[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,r=0;r<s.length;r++){for(var n=0;n<s[r].length;n++)for(var a=0;a<t;a++)e.vertices.push(s[r][n][a]);r>0&&(i+=s[r-1].length,e.holes.push(i))}return e};var Og=wo.exports;const Fg=nu(Og);var Nn={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Nn.exports,function(s,t){(function(e){var i=t&&!t.nodeType&&t,r=s&&!s.nodeType&&s,n=typeof Lr=="object"&&Lr;(n.global===n||n.window===n||n.self===n)&&(e=n);var a,o=2147483647,h=36,l=1,c=26,d=38,u=700,f=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,b=Math.floor,w=String.fromCharCode,T;function E(I){throw new RangeError(_[I])}function A(I,D){for(var z=I.length,$=[];z--;)$[z]=D(I[z]);return $}function P(I,D){var z=I.split("@"),$="";z.length>1&&($=z[0]+"@",I=z[1]),I=I.replace(v,".");var U=I.split("."),rt=A(U,D).join(".");return $+rt}function L(I){for(var D=[],z=0,$=I.length,U,rt;z<$;)U=I.charCodeAt(z++),U>=55296&&U<=56319&&z<$?(rt=I.charCodeAt(z++),(rt&64512)==56320?D.push(((U&1023)<<10)+(rt&1023)+65536):(D.push(U),z--)):D.push(U);return D}function M(I){return A(I,function(D){var z="";return D>65535&&(D-=65536,z+=w(D>>>10&1023|55296),D=56320|D&1023),z+=w(D),z}).join("")}function S(I){return I-48<10?I-22:I-65<26?I-65:I-97<26?I-97:h}function C(I,D){return I+22+75*(I<26)-((D!=0)<<5)}function R(I,D,z){var $=0;for(I=z?b(I/u):I>>1,I+=b(I/D);I>x*c>>1;$+=h)I=b(I/x);return b($+(x+1)*I/(I+d))}function N(I){var D=[],z=I.length,$,U=0,rt=p,dt=f,lt,xt,Dt,Lt,mt,Bt,Tt,me,Ae;for(lt=I.lastIndexOf(m),lt<0&&(lt=0),xt=0;xt<lt;++xt)I.charCodeAt(xt)>=128&&E("not-basic"),D.push(I.charCodeAt(xt));for(Dt=lt>0?lt+1:0;Dt<z;){for(Lt=U,mt=1,Bt=h;Dt>=z&&E("invalid-input"),Tt=S(I.charCodeAt(Dt++)),(Tt>=h||Tt>b((o-U)/mt))&&E("overflow"),U+=Tt*mt,me=Bt<=dt?l:Bt>=dt+c?c:Bt-dt,!(Tt<me);Bt+=h)Ae=h-me,mt>b(o/Ae)&&E("overflow"),mt*=Ae;$=D.length+1,dt=R(U-Lt,$,Lt==0),b(U/$)>o-rt&&E("overflow"),rt+=b(U/$),U%=$,D.splice(U++,0,rt)}return M(D)}function F(I){var D,z,$,U,rt,dt,lt,xt,Dt,Lt,mt,Bt=[],Tt,me,Ae,ls;for(I=L(I),Tt=I.length,D=p,z=0,rt=f,dt=0;dt<Tt;++dt)mt=I[dt],mt<128&&Bt.push(w(mt));for($=U=Bt.length,U&&Bt.push(m);$<Tt;){for(lt=o,dt=0;dt<Tt;++dt)mt=I[dt],mt>=D&&mt<lt&&(lt=mt);for(me=$+1,lt-D>b((o-z)/me)&&E("overflow"),z+=(lt-D)*me,D=lt,dt=0;dt<Tt;++dt)if(mt=I[dt],mt<D&&++z>o&&E("overflow"),mt==D){for(xt=z,Dt=h;Lt=Dt<=rt?l:Dt>=rt+c?c:Dt-rt,!(xt<Lt);Dt+=h)ls=xt-Lt,Ae=h-Lt,Bt.push(w(C(Lt+ls%Ae,0))),xt=b(ls/Ae);Bt.push(w(C(xt,0))),rt=R(z,me,$==U),z=0,++$}++z,++D}return Bt.join("")}function B(I){return P(I,function(D){return g.test(D)?N(D.slice(4).toLowerCase()):D})}function W(I){return P(I,function(D){return y.test(D)?"xn--"+F(D):D})}if(a={version:"1.4.1",ucs2:{decode:L,encode:M},decode:N,encode:F,toASCII:W,toUnicode:B},i&&r)if(s.exports==i)r.exports=a;else for(T in a)a.hasOwnProperty(T)&&(i[T]=a[T]);else e.punycode=a})(Lr)}(Nn,Nn.exports);var Lg=Nn.exports,$s=TypeError;const kg=_g(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Co=typeof Map=="function"&&Map.prototype,Po=Object.getOwnPropertyDescriptor&&Co?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Un=Co&&Po&&typeof Po.get=="function"?Po.get:null,uu=Co&&Map.prototype.forEach,Ro=typeof Set=="function"&&Set.prototype,Io=Object.getOwnPropertyDescriptor&&Ro?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Gn=Ro&&Io&&typeof Io.get=="function"?Io.get:null,du=Ro&&Set.prototype.forEach,Ng=typeof WeakMap=="function"&&WeakMap.prototype,Hr=Ng?WeakMap.prototype.has:null,Ug=typeof WeakSet=="function"&&WeakSet.prototype,Vr=Ug?WeakSet.prototype.has:null,Gg=typeof WeakRef=="function"&&WeakRef.prototype,fu=Gg?WeakRef.prototype.deref:null,Hg=Boolean.prototype.valueOf,Vg=Object.prototype.toString,Wg=Function.prototype.toString,Xg=String.prototype.match,Mo=String.prototype.slice,Ui=String.prototype.replace,zg=String.prototype.toUpperCase,pu=String.prototype.toLowerCase,mu=RegExp.prototype.test,gu=Array.prototype.concat,Je=Array.prototype.join,$g=Array.prototype.slice,_u=Math.floor,Do=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Bo=Object.getOwnPropertySymbols,Oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Jt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ys||"symbol")?Symbol.toStringTag:null,yu=Object.prototype.propertyIsEnumerable,xu=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function vu(s,t){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||mu.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var i=s<0?-_u(-s):_u(s);if(i!==s){var r=String(i),n=Mo.call(t,r.length+1);return Ui.call(r,e,"$&_")+"."+Ui.call(Ui.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ui.call(t,e,"$&_")}var Fo=kg,bu=Fo.custom,Tu=Su(bu)?bu:null,wu={__proto__:null,double:'"',single:"'"},Yg={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Hn=function s(t,e,i,r){var n=e||{};if(Ei(n,"quoteStyle")&&!Ei(wu,n.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ei(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Ei(n,"customInspect")?n.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ei(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ei(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=n.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Pu(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var h=String(t);return o?vu(t,h):h}if(typeof t=="bigint"){var l=String(t)+"n";return o?vu(t,l):l}var c=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return Lo(t)?"[Array]":"[Object]";var d=u_(n,i);if(typeof r>"u")r=[];else if(Cu(r,t)>=0)return"[Circular]";function u(S,C,R){if(C&&(r=$g.call(r),r.push(C)),R){var N={depth:n.depth};return Ei(n,"quoteStyle")&&(N.quoteStyle=n.quoteStyle),s(S,N,i+1,r)}return s(S,n,i+1,r)}if(typeof t=="function"&&!Au(t)){var f=i_(t),p=Vn(t,u);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+Je.call(p,", ")+" }":"")}if(Su(t)){var m=Ys?Ui.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Oo.call(t);return typeof t=="object"&&!Ys?Wr(m):m}if(h_(t)){for(var g="<"+pu.call(String(t.nodeName)),y=t.attributes||[],v=0;v<y.length;v++)g+=" "+y[v].name+"="+Eu(jg(y[v].value),"double",n);return g+=">",t.childNodes&&t.childNodes.length&&(g+="..."),g+="</"+pu.call(String(t.nodeName))+">",g}if(Lo(t)){if(t.length===0)return"[]";var _=Vn(t,u);return d&&!c_(_)?"["+No(_,d)+"]":"[ "+Je.call(_,", ")+" ]"}if(Kg(t)){var x=Vn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!yu.call(t,"cause")?"{ ["+String(t)+"] "+Je.call(gu.call("[cause]: "+u(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Je.call(x,", ")+" }"}if(typeof t=="object"&&a){if(Tu&&typeof t[Tu]=="function"&&Fo)return Fo(t,{depth:c-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(s_(t)){var b=[];return uu&&uu.call(t,function(S,C){b.push(u(C,t,!0)+" => "+u(S,t))}),Ru("Map",Un.call(t),b,d)}if(a_(t)){var w=[];return du&&du.call(t,function(S){w.push(u(S,t))}),Ru("Set",Gn.call(t),w,d)}if(r_(t))return ko("WeakMap");if(o_(t))return ko("WeakSet");if(n_(t))return ko("WeakRef");if(Qg(t))return Wr(u(Number(t)));if(t_(t))return Wr(u(Do.call(t)));if(Jg(t))return Wr(Hg.call(t));if(Zg(t))return Wr(u(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Lr<"u"&&t===Lr)return"{ [object globalThis] }";if(!qg(t)&&!Au(t)){var T=Vn(t,u),E=xu?xu(t)===Object.prototype:t instanceof Object||t.constructor===Object,A=t instanceof Object?"":"null prototype",P=!E&&Jt&&Object(t)===t&&Jt in t?Mo.call(Gi(t),8,-1):A?"Object":"",L=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",M=L+(P||A?"["+Je.call(gu.call([],P||[],A||[]),": ")+"] ":"");return T.length===0?M+"{}":d?M+"{"+No(T,d)+"}":M+"{ "+Je.call(T,", ")+" }"}return String(t)};function Eu(s,t,e){var i=e.quoteStyle||t,r=wu[i];return r+s+r}function jg(s){return Ui.call(String(s),/"/g,""")}function Lo(s){return Gi(s)==="[object Array]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function qg(s){return Gi(s)==="[object Date]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Au(s){return Gi(s)==="[object RegExp]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Kg(s){return Gi(s)==="[object Error]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Zg(s){return Gi(s)==="[object String]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Qg(s){return Gi(s)==="[object Number]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Jg(s){return Gi(s)==="[object Boolean]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Su(s){if(Ys)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!Oo)return!1;try{return Oo.call(s),!0}catch{}return!1}function t_(s){if(!s||typeof s!="object"||!Do)return!1;try{return Do.call(s),!0}catch{}return!1}var e_=Object.prototype.hasOwnProperty||function(s){return s in this};function Ei(s,t){return e_.call(s,t)}function Gi(s){return Vg.call(s)}function i_(s){if(s.name)return s.name;var t=Xg.call(Wg.call(s),/^function\s*([\w$]+)/);return t?t[1]:null}function Cu(s,t){if(s.indexOf)return s.indexOf(t);for(var e=0,i=s.length;e<i;e++)if(s[e]===t)return e;return-1}function s_(s){if(!Un||!s||typeof s!="object")return!1;try{Un.call(s);try{Gn.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function r_(s){if(!Hr||!s||typeof s!="object")return!1;try{Hr.call(s,Hr);try{Vr.call(s,Vr)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function n_(s){if(!fu||!s||typeof s!="object")return!1;try{return fu.call(s),!0}catch{}return!1}function a_(s){if(!Gn||!s||typeof s!="object")return!1;try{Gn.call(s);try{Un.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function o_(s){if(!Vr||!s||typeof s!="object")return!1;try{Vr.call(s,Vr);try{Hr.call(s,Hr)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function h_(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function Pu(s,t){if(s.length>t.maxStringLength){var e=s.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return Pu(Mo.call(s,0,t.maxStringLength),t)+i}var r=Yg[t.quoteStyle||"single"];r.lastIndex=0;var n=Ui.call(Ui.call(s,r,"\\$1"),/[\x00-\x1f]/g,l_);return Eu(n,"single",t)}function l_(s){var t=s.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+zg.call(t.toString(16))}function Wr(s){return"Object("+s+")"}function ko(s){return s+" { ? }"}function Ru(s,t,e,i){var r=i?No(e,i):Je.call(e,", ");return s+" ("+t+") {"+r+"}"}function c_(s){for(var t=0;t<s.length;t++)if(Cu(s[t],`
|
|
2
|
-
`)>=0)return!1;return!0}function
|
|
3
|
-
`+t.prev+t.base;return e+
|
|
4
|
-
`+t.prev}function Vn(s,t){var e=Lo(s),i=[];if(e){i.length=s.length;for(var r=0;r<s.length;r++)i[r]=Ei(s,r)?t(s[r],s):""}var n=typeof Bo=="function"?Bo(s):[],a;if(Ys){a={};for(var o=0;o<n.length;o++)a["$"+n[o]]=n[o]}for(var h in s)Ei(s,h)&&(e&&String(Number(h))===h&&h<s.length||Ys&&a["$"+h]instanceof Symbol||(mu.call(/[^\w$]/,h)?i.push(t(h,s)+": "+t(s[h],s)):i.push(h+": "+t(s[h],s))));if(typeof Bo=="function")for(var l=0;l<n.length;l++)yu.call(s,n[l])&&i.push("["+t(n[l])+"]: "+t(s[n[l]],s));return i}var d_=Hn,f_=$s,Wn=function(s,t,e){for(var i=s,r;(r=i.next)!=null;i=r)if(r.key===t)return i.next=r.next,e||(r.next=s.next,s.next=r),r},p_=function(s,t){if(s){var e=Wn(s,t);return e&&e.value}},m_=function(s,t,e){var i=Wn(s,t);i?i.value=e:s.next={key:t,next:s.next,value:e}},g_=function(s,t){return s?!!Wn(s,t):!1},__=function(s,t){if(s)return Wn(s,t,!0)},y_=function(){var t,e={assert:function(i){if(!e.has(i))throw new f_("Side channel does not contain "+d_(i))},delete:function(i){var r=t&&t.next,n=__(t,i);return n&&r&&r===n&&(t=void 0),!!n},get:function(i){return p_(t,i)},has:function(i){return g_(t,i)},set:function(i,r){t||(t={next:void 0}),m_(t,i,r)}};return e},Iu=Object,x_=Error,v_=EvalError,b_=RangeError,T_=ReferenceError,w_=SyntaxError,E_=URIError,A_=Math.abs,S_=Math.floor,C_=Math.max,P_=Math.min,R_=Math.pow,I_=Math.round,M_=Number.isNaN||function(t){return t!==t},D_=M_,B_=function(t){return D_(t)||t===0?t:t<0?-1:1},O_=Object.getOwnPropertyDescriptor,Xn=O_;if(Xn)try{Xn([],"length")}catch{Xn=null}var Mu=Xn,zn=Object.defineProperty||!1;if(zn)try{zn({},"a",{value:1})}catch{zn=!1}var F_=zn,Uo,Du;function L_(){return Du||(Du=1,Uo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[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}),Uo}var Go,Bu;function k_(){if(Bu)return Go;Bu=1;var s=typeof Symbol<"u"&&Symbol,t=L_();return Go=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Go}var Ho,Ou;function Fu(){return Ou||(Ou=1,Ho=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ho}var Vo,Lu;function ku(){if(Lu)return Vo;Lu=1;var s=Iu;return Vo=s.getPrototypeOf||null,Vo}var Wo,Nu;function N_(){if(Nu)return Wo;Nu=1;var s="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,i="[object Function]",r=function(h,l){for(var c=[],d=0;d<h.length;d+=1)c[d]=h[d];for(var u=0;u<l.length;u+=1)c[u+h.length]=l[u];return c},n=function(h,l){for(var c=[],d=l||0,u=0;d<h.length;d+=1,u+=1)c[u]=h[d];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 Wo=function(h){var l=this;if(typeof l!="function"||t.apply(l)!==i)throw new TypeError(s+l);for(var c=n(arguments,1),d,u=function(){if(this instanceof d){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),p=[],m=0;m<f;m++)p[m]="$"+m;if(d=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(u),l.prototype){var g=function(){};g.prototype=l.prototype,d.prototype=new g,g.prototype=null}return d},Wo}var Xo,Uu;function $n(){if(Uu)return Xo;Uu=1;var s=N_();return Xo=Function.prototype.bind||s,Xo}var zo,Gu;function $o(){return Gu||(Gu=1,zo=Function.prototype.call),zo}var Yo,Hu;function Vu(){return Hu||(Hu=1,Yo=Function.prototype.apply),Yo}var U_=typeof Reflect<"u"&&Reflect&&Reflect.apply,G_=$n(),H_=Vu(),V_=$o(),W_=U_,X_=W_||G_.call(V_,H_),z_=$n(),$_=$s,Y_=$o(),j_=X_,Wu=function(t){if(t.length<1||typeof t[0]!="function")throw new $_("a function is required");return j_(z_,Y_,t)},jo,Xu;function q_(){if(Xu)return jo;Xu=1;var s=Wu,t=Mu,e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&t&&t(Object.prototype,"__proto__"),r=Object,n=r.getPrototypeOf;return jo=i&&typeof i.get=="function"?s([i.get]):typeof n=="function"?function(o){return n(o==null?o:r(o))}:!1,jo}var qo,zu;function K_(){if(zu)return qo;zu=1;var s=Fu(),t=ku(),e=q_();return qo=s?function(r){return s(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,qo}var Ko,$u;function Z_(){if($u)return Ko;$u=1;var s=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=$n();return Ko=e.call(s,t),Ko}var nt,Q_=Iu,J_=x_,t0=v_,e0=b_,i0=T_,js=w_,qs=$s,s0=E_,r0=A_,n0=S_,a0=C_,o0=P_,h0=R_,l0=I_,c0=B_,Yu=Function,Zo=function(s){try{return Yu('"use strict"; return ('+s+").constructor;")()}catch{}},Xr=Mu,u0=F_,Qo=function(){throw new qs},d0=Xr?function(){try{return arguments.callee,Qo}catch{try{return Xr(arguments,"callee").get}catch{return Qo}}}():Qo,Ks=k_()(),Xt=K_(),f0=ku(),p0=Fu(),ju=Vu(),zr=$o(),Zs={},m0=typeof Uint8Array>"u"||!Xt?nt:Xt(Uint8Array),ds={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?nt:ArrayBuffer,"%ArrayIteratorPrototype%":Ks&&Xt?Xt([][Symbol.iterator]()):nt,"%AsyncFromSyncIteratorPrototype%":nt,"%AsyncFunction%":Zs,"%AsyncGenerator%":Zs,"%AsyncGeneratorFunction%":Zs,"%AsyncIteratorPrototype%":Zs,"%Atomics%":typeof Atomics>"u"?nt:Atomics,"%BigInt%":typeof BigInt>"u"?nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":J_,"%eval%":eval,"%EvalError%":t0,"%Float32Array%":typeof Float32Array>"u"?nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?nt:FinalizationRegistry,"%Function%":Yu,"%GeneratorFunction%":Zs,"%Int8Array%":typeof Int8Array>"u"?nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ks&&Xt?Xt(Xt([][Symbol.iterator]())):nt,"%JSON%":typeof JSON=="object"?JSON:nt,"%Map%":typeof Map>"u"?nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ks||!Xt?nt:Xt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Q_,"%Object.getOwnPropertyDescriptor%":Xr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?nt:Promise,"%Proxy%":typeof Proxy>"u"?nt:Proxy,"%RangeError%":e0,"%ReferenceError%":i0,"%Reflect%":typeof Reflect>"u"?nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ks||!Xt?nt:Xt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ks&&Xt?Xt(""[Symbol.iterator]()):nt,"%Symbol%":Ks?Symbol:nt,"%SyntaxError%":js,"%ThrowTypeError%":d0,"%TypedArray%":m0,"%TypeError%":qs,"%Uint8Array%":typeof Uint8Array>"u"?nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?nt:Uint32Array,"%URIError%":s0,"%WeakMap%":typeof WeakMap>"u"?nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?nt:WeakSet,"%Function.prototype.call%":zr,"%Function.prototype.apply%":ju,"%Object.defineProperty%":u0,"%Object.getPrototypeOf%":f0,"%Math.abs%":r0,"%Math.floor%":n0,"%Math.max%":a0,"%Math.min%":o0,"%Math.pow%":h0,"%Math.round%":l0,"%Math.sign%":c0,"%Reflect.getPrototypeOf%":p0};if(Xt)try{null.error}catch(s){var g0=Xt(Xt(s));ds["%Error.prototype%"]=g0}var _0=function s(t){var e;if(t==="%AsyncFunction%")e=Zo("async function () {}");else if(t==="%GeneratorFunction%")e=Zo("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Zo("async function* () {}");else if(t==="%AsyncGenerator%"){var i=s("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var r=s("%AsyncGenerator%");r&&Xt&&(e=Xt(r.prototype))}return ds[t]=e,e},qu={__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"]},$r=$n(),Yn=Z_(),y0=$r.call(zr,Array.prototype.concat),x0=$r.call(ju,Array.prototype.splice),Ku=$r.call(zr,String.prototype.replace),jn=$r.call(zr,String.prototype.slice),v0=$r.call(zr,RegExp.prototype.exec),b0=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T0=/\\(\\)?/g,w0=function(t){var e=jn(t,0,1),i=jn(t,-1);if(e==="%"&&i!=="%")throw new js("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new js("invalid intrinsic syntax, expected opening `%`");var r=[];return Ku(t,b0,function(n,a,o,h){r[r.length]=o?Ku(h,T0,"$1"):a||n}),r},E0=function(t,e){var i=t,r;if(Yn(qu,i)&&(r=qu[i],i="%"+r[0]+"%"),Yn(ds,i)){var n=ds[i];if(n===Zs&&(n=_0(i)),typeof n>"u"&&!e)throw new qs("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new js("intrinsic "+t+" does not exist!")},Jo=function(t,e){if(typeof t!="string"||t.length===0)throw new qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new qs('"allowMissing" argument must be a boolean');if(v0(/^%?[^%]*%?$/,t)===null)throw new js("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=w0(t),r=i.length>0?i[0]:"",n=E0("%"+r+"%",e),a=n.name,o=n.value,h=!1,l=n.alias;l&&(r=l[0],x0(i,y0([0,1],l)));for(var c=1,d=!0;c<i.length;c+=1){var u=i[c],f=jn(u,0,1),p=jn(u,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new js("property names with quotes must have matching quotes");if((u==="constructor"||!d)&&(h=!0),r+="."+u,a="%"+r+"%",Yn(ds,a))o=ds[a];else if(o!=null){if(!(u in o)){if(!e)throw new qs("base intrinsic for "+t+" exists, but the property is not available.");return}if(Xr&&c+1>=i.length){var m=Xr(o,u);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[u]}else d=Yn(o,u),o=o[u];d&&!h&&(ds[a]=o)}}return o},Zu=Jo,Qu=Wu,A0=Qu([Zu("%String.prototype.indexOf%")]),Ju=function(t,e){var i=Zu(t,!!e);return typeof i=="function"&&A0(t,".prototype.")>-1?Qu([i]):i},S0=Jo,Yr=Ju,C0=Hn,P0=$s,td=S0("%Map%",!0),R0=Yr("Map.prototype.get",!0),I0=Yr("Map.prototype.set",!0),M0=Yr("Map.prototype.has",!0),D0=Yr("Map.prototype.delete",!0),B0=Yr("Map.prototype.size",!0),ed=!!td&&function(){var t,e={assert:function(i){if(!e.has(i))throw new P0("Side channel does not contain "+C0(i))},delete:function(i){if(t){var r=D0(t,i);return B0(t)===0&&(t=void 0),r}return!1},get:function(i){if(t)return R0(t,i)},has:function(i){return t?M0(t,i):!1},set:function(i,r){t||(t=new td),I0(t,i,r)}};return e},O0=Jo,qn=Ju,F0=Hn,Kn=ed,L0=$s,Qs=O0("%WeakMap%",!0),k0=qn("WeakMap.prototype.get",!0),N0=qn("WeakMap.prototype.set",!0),U0=qn("WeakMap.prototype.has",!0),G0=qn("WeakMap.prototype.delete",!0),H0=Qs?function(){var t,e,i={assert:function(r){if(!i.has(r))throw new L0("Side channel does not contain "+F0(r))},delete:function(r){if(Qs&&r&&(typeof r=="object"||typeof r=="function")){if(t)return G0(t,r)}else if(Kn&&e)return e.delete(r);return!1},get:function(r){return Qs&&r&&(typeof r=="object"||typeof r=="function")&&t?k0(t,r):e&&e.get(r)},has:function(r){return Qs&&r&&(typeof r=="object"||typeof r=="function")&&t?U0(t,r):!!e&&e.has(r)},set:function(r,n){Qs&&r&&(typeof r=="object"||typeof r=="function")?(t||(t=new Qs),N0(t,r,n)):Kn&&(e||(e=Kn()),e.set(r,n))}};return i}:Kn,V0=$s,W0=Hn,X0=y_,z0=ed,$0=H0,Y0=$0||z0||X0,j0=function(){var t,e={assert:function(i){if(!e.has(i))throw new V0("Side channel does not contain "+W0(i))},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,r){t||(t=Y0()),t.set(i,r)}};return e},q0=String.prototype.replace,K0=/%20/g,th={RFC1738:"RFC1738",RFC3986:"RFC3986"},eh={default:th.RFC3986,formatters:{RFC1738:function(s){return q0.call(s,K0,"+")},RFC3986:function(s){return String(s)}},RFC1738:th.RFC1738,RFC3986:th.RFC3986},Z0=eh,ih=Object.prototype.hasOwnProperty,fs=Array.isArray,ti=function(){for(var s=[],t=0;t<256;++t)s.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return s}(),Q0=function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(fs(i)){for(var r=[],n=0;n<i.length;++n)typeof i[n]<"u"&&r.push(i[n]);e.obj[e.prop]=r}}},id=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},r=0;r<t.length;++r)typeof t[r]<"u"&&(i[r]=t[r]);return i},J0=function s(t,e,i){if(!e)return t;if(typeof e!="object"&&typeof e!="function"){if(fs(t))t.push(e);else if(t&&typeof t=="object")(i&&(i.plainObjects||i.allowPrototypes)||!ih.call(Object.prototype,e))&&(t[e]=!0);else return[t,e];return t}if(!t||typeof t!="object")return[t].concat(e);var r=t;return fs(t)&&!fs(e)&&(r=id(t,i)),fs(t)&&fs(e)?(e.forEach(function(n,a){if(ih.call(t,a)){var o=t[a];o&&typeof o=="object"&&n&&typeof n=="object"?t[a]=s(o,n,i):t.push(n)}else t[a]=n}),t):Object.keys(e).reduce(function(n,a){var o=e[a];return ih.call(n,a)?n[a]=s(n[a],o,i):n[a]=o,n},r)},ty=function(t,e){return Object.keys(e).reduce(function(i,r){return i[r]=e[r],i},t)},ey=function(s,t,e){var i=s.replace(/\+/g," ");if(e==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},sh=1024,iy=function(t,e,i,r,n){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var o="",h=0;h<a.length;h+=sh){for(var l=a.length>=sh?a.slice(h,h+sh):a,c=[],d=0;d<l.length;++d){var u=l.charCodeAt(d);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||n===Z0.RFC1738&&(u===40||u===41)){c[c.length]=l.charAt(d);continue}if(u<128){c[c.length]=ti[u];continue}if(u<2048){c[c.length]=ti[192|u>>6]+ti[128|u&63];continue}if(u<55296||u>=57344){c[c.length]=ti[224|u>>12]+ti[128|u>>6&63]+ti[128|u&63];continue}d+=1,u=65536+((u&1023)<<10|l.charCodeAt(d)&1023),c[c.length]=ti[240|u>>18]+ti[128|u>>12&63]+ti[128|u>>6&63]+ti[128|u&63]}o+=c.join("")}return o},sy=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],r=0;r<e.length;++r)for(var n=e[r],a=n.obj[n.prop],o=Object.keys(a),h=0;h<o.length;++h){var l=o[h],c=a[l];typeof c=="object"&&c!==null&&i.indexOf(c)===-1&&(e.push({obj:a,prop:l}),i.push(c))}return Q0(e),t},ry=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},ny=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},ay=function(t,e){return[].concat(t,e)},oy=function(t,e){if(fs(t)){for(var i=[],r=0;r<t.length;r+=1)i.push(e(t[r]));return i}return e(t)},sd={arrayToObject:id,assign:ty,combine:ay,compact:sy,decode:ey,encode:iy,isBuffer:ny,isRegExp:ry,maybeMap:oy,merge:J0},rd=j0,Zn=sd,jr=eh,hy=Object.prototype.hasOwnProperty,nd={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ei=Array.isArray,ly=Array.prototype.push,ad=function(s,t){ly.apply(s,ei(t)?t:[t])},cy=Date.prototype.toISOString,od=jr.default,Wt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Zn.encode,encodeValuesOnly:!1,filter:void 0,format:od,formatter:jr.formatters[od],indices:!1,serializeDate:function(t){return cy.call(t)},skipNulls:!1,strictNullHandling:!1},uy=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},rh={},dy=function s(t,e,i,r,n,a,o,h,l,c,d,u,f,p,m,g,y,v){for(var _=t,x=v,b=0,w=!1;(x=x.get(rh))!==void 0&&!w;){var T=x.get(t);if(b+=1,typeof T<"u"){if(T===b)throw new RangeError("Cyclic object value");w=!0}typeof x.get(rh)>"u"&&(b=0)}if(typeof c=="function"?_=c(e,_):_ instanceof Date?_=f(_):i==="comma"&&ei(_)&&(_=Zn.maybeMap(_,function(I){return I instanceof Date?f(I):I})),_===null){if(a)return l&&!g?l(e,Wt.encoder,y,"key",p):e;_=""}if(uy(_)||Zn.isBuffer(_)){if(l){var E=g?e:l(e,Wt.encoder,y,"key",p);return[m(E)+"="+m(l(_,Wt.encoder,y,"value",p))]}return[m(e)+"="+m(String(_))]}var A=[];if(typeof _>"u")return A;var P;if(i==="comma"&&ei(_))g&&l&&(_=Zn.maybeMap(_,l)),P=[{value:_.length>0?_.join(",")||null:void 0}];else if(ei(c))P=c;else{var L=Object.keys(_);P=d?L.sort(d):L}var M=h?String(e).replace(/\./g,"%2E"):String(e),S=r&&ei(_)&&_.length===1?M+"[]":M;if(n&&ei(_)&&_.length===0)return S+"[]";for(var C=0;C<P.length;++C){var R=P[C],N=typeof R=="object"&&R&&typeof R.value<"u"?R.value:_[R];if(!(o&&N===null)){var F=u&&h?String(R).replace(/\./g,"%2E"):String(R),B=ei(_)?typeof i=="function"?i(S,F):S:S+(u?"."+F:"["+F+"]");v.set(t,b);var W=rd();W.set(rh,v),ad(A,s(N,B,i,r,n,a,o,h,i==="comma"&&g&&ei(_)?null:l,c,d,u,f,p,m,g,y,W))}}return A},fy=function(t){if(!t)return Wt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var e=t.charset||Wt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=jr.default;if(typeof t.format<"u"){if(!hy.call(jr.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var r=jr.formatters[i],n=Wt.filter;(typeof t.filter=="function"||ei(t.filter))&&(n=t.filter);var a;if(t.arrayFormat in nd?a=t.arrayFormat:"indices"in t?a=t.indices?"indices":"repeat":a=Wt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var o=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Wt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Wt.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Wt.allowEmptyArrays,arrayFormat:a,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Wt.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Wt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Wt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Wt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Wt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Wt.encodeValuesOnly,filter:n,format:i,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Wt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Wt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Wt.strictNullHandling}},py=function(s,t){var e=s,i=fy(t),r,n;typeof i.filter=="function"?(n=i.filter,e=n("",e)):ei(i.filter)&&(n=i.filter,r=n);var a=[];if(typeof e!="object"||e===null)return"";var o=nd[i.arrayFormat],h=o==="comma"&&i.commaRoundTrip;r||(r=Object.keys(e)),i.sort&&r.sort(i.sort);for(var l=rd(),c=0;c<r.length;++c){var d=r[c],u=e[d];i.skipNulls&&u===null||ad(a,dy(u,d,o,h,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,l))}var f=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},ps=sd,nh=Object.prototype.hasOwnProperty,hd=Array.isArray,Ot={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ps.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},my=function(s){return s.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},ld=function(s,t,e){if(s&&typeof s=="string"&&t.comma&&s.indexOf(",")>-1)return s.split(",");if(t.throwOnLimitExceeded&&e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return s},gy="utf8=%26%2310003%3B",_y="utf8=%E2%9C%93",yy=function(t,e){var i={__proto__:null},r=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;r=r.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var n=e.parameterLimit===1/0?void 0:e.parameterLimit,a=r.split(e.delimiter,e.throwOnLimitExceeded?n+1:n);if(e.throwOnLimitExceeded&&a.length>n)throw new RangeError("Parameter limit exceeded. Only "+n+" parameter"+(n===1?"":"s")+" allowed.");var o=-1,h,l=e.charset;if(e.charsetSentinel)for(h=0;h<a.length;++h)a[h].indexOf("utf8=")===0&&(a[h]===_y?l="utf-8":a[h]===gy&&(l="iso-8859-1"),o=h,h=a.length);for(h=0;h<a.length;++h)if(h!==o){var c=a[h],d=c.indexOf("]="),u=d===-1?c.indexOf("="):d+1,f,p;u===-1?(f=e.decoder(c,Ot.decoder,l,"key"),p=e.strictNullHandling?null:""):(f=e.decoder(c.slice(0,u),Ot.decoder,l,"key"),p=ps.maybeMap(ld(c.slice(u+1),e,hd(i[f])?i[f].length:0),function(g){return e.decoder(g,Ot.decoder,l,"value")})),p&&e.interpretNumericEntities&&l==="iso-8859-1"&&(p=my(String(p))),c.indexOf("[]=")>-1&&(p=hd(p)?[p]:p);var m=nh.call(i,f);m&&e.duplicates==="combine"?i[f]=ps.combine(i[f],p):(!m||e.duplicates==="last")&&(i[f]=p)}return i},xy=function(s,t,e,i){var r=0;if(s.length>0&&s[s.length-1]==="[]"){var n=s.slice(0,-1).join("");r=Array.isArray(t)&&t[n]?t[n].length:0}for(var a=i?t:ld(t,e,r),o=s.length-1;o>=0;--o){var h,l=s[o];if(l==="[]"&&e.parseArrays)h=e.allowEmptyArrays&&(a===""||e.strictNullHandling&&a===null)?[]:ps.combine([],a);else{h=e.plainObjects?{__proto__:null}:{};var c=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,d=e.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(d,10);!e.parseArrays&&d===""?h={0:a}:!isNaN(u)&&l!==d&&String(u)===d&&u>=0&&e.parseArrays&&u<=e.arrayLimit?(h=[],h[u]=a):d!=="__proto__"&&(h[d]=a)}a=h}return a},vy=function(t,e,i,r){if(t){var n=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,h=i.depth>0&&a.exec(n),l=h?n.slice(0,h.index):n,c=[];if(l){if(!i.plainObjects&&nh.call(Object.prototype,l)&&!i.allowPrototypes)return;c.push(l)}for(var d=0;i.depth>0&&(h=o.exec(n))!==null&&d<i.depth;){if(d+=1,!i.plainObjects&&nh.call(Object.prototype,h[1].slice(1,-1))&&!i.allowPrototypes)return;c.push(h[1])}if(h){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");c.push("["+n.slice(h.index)+"]")}return xy(c,e,i,r)}},by=function(t){if(!t)return Ot;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=typeof t.charset>"u"?Ot.charset:t.charset,i=typeof t.duplicates>"u"?Ot.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var r=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Ot.allowDots:!!t.allowDots;return{allowDots:r,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ot.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Ot.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Ot.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Ot.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ot.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Ot.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Ot.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Ot.decoder,delimiter:typeof t.delimiter=="string"||ps.isRegExp(t.delimiter)?t.delimiter:Ot.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Ot.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Ot.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Ot.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Ot.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Ot.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ot.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},Ty=function(s,t){var e=by(t);if(s===""||s===null||typeof s>"u")return e.plainObjects?{__proto__:null}:{};for(var i=typeof s=="string"?yy(s,e):s,r=e.plainObjects?{__proto__:null}:{},n=Object.keys(i),a=0;a<n.length;++a){var o=n[a],h=vy(o,i[o],e,typeof s=="string");r=ps.merge(r,h,e)}return e.allowSparse===!0?r:ps.compact(r)},wy=py,Ey=Ty,Ay=eh,Sy={formats:Ay,parse:Ey,stringify:wy},Cy=Lg;function Ai(){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 Py=/^([a-z0-9.+-]+:)/i,Ry=/:[0-9]*$/,Iy=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,My=["<",">",'"',"`"," ","\r",`
|
|
5
|
-
`," "]
|
|
1
|
+
(function(qe){typeof define=="function"&&define.amd?define(qe):qe()})(function(){"use strict";var qe=(s=>(s[s.WEBGL_LEGACY=0]="WEBGL_LEGACY",s[s.WEBGL=1]="WEBGL",s[s.WEBGL2=2]="WEBGL2",s))(qe||{}),Jc=(s=>(s[s.UNKNOWN=0]="UNKNOWN",s[s.WEBGL=1]="WEBGL",s[s.CANVAS=2]="CANVAS",s))(Jc||{}),Eo=(s=>(s[s.COLOR=16384]="COLOR",s[s.DEPTH=256]="DEPTH",s[s.STENCIL=1024]="STENCIL",s))(Eo||{}),K=(s=>(s[s.NORMAL=0]="NORMAL",s[s.ADD=1]="ADD",s[s.MULTIPLY=2]="MULTIPLY",s[s.SCREEN=3]="SCREEN",s[s.OVERLAY=4]="OVERLAY",s[s.DARKEN=5]="DARKEN",s[s.LIGHTEN=6]="LIGHTEN",s[s.COLOR_DODGE=7]="COLOR_DODGE",s[s.COLOR_BURN=8]="COLOR_BURN",s[s.HARD_LIGHT=9]="HARD_LIGHT",s[s.SOFT_LIGHT=10]="SOFT_LIGHT",s[s.DIFFERENCE=11]="DIFFERENCE",s[s.EXCLUSION=12]="EXCLUSION",s[s.HUE=13]="HUE",s[s.SATURATION=14]="SATURATION",s[s.COLOR=15]="COLOR",s[s.LUMINOSITY=16]="LUMINOSITY",s[s.NORMAL_NPM=17]="NORMAL_NPM",s[s.ADD_NPM=18]="ADD_NPM",s[s.SCREEN_NPM=19]="SCREEN_NPM",s[s.NONE=20]="NONE",s[s.SRC_OVER=0]="SRC_OVER",s[s.SRC_IN=21]="SRC_IN",s[s.SRC_OUT=22]="SRC_OUT",s[s.SRC_ATOP=23]="SRC_ATOP",s[s.DST_OVER=24]="DST_OVER",s[s.DST_IN=25]="DST_IN",s[s.DST_OUT=26]="DST_OUT",s[s.DST_ATOP=27]="DST_ATOP",s[s.ERASE=26]="ERASE",s[s.SUBTRACT=28]="SUBTRACT",s[s.XOR=29]="XOR",s))(K||{}),Ue=(s=>(s[s.POINTS=0]="POINTS",s[s.LINES=1]="LINES",s[s.LINE_LOOP=2]="LINE_LOOP",s[s.LINE_STRIP=3]="LINE_STRIP",s[s.TRIANGLES=4]="TRIANGLES",s[s.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",s[s.TRIANGLE_FAN=6]="TRIANGLE_FAN",s))(Ue||{}),O=(s=>(s[s.RGBA=6408]="RGBA",s[s.RGB=6407]="RGB",s[s.RG=33319]="RG",s[s.RED=6403]="RED",s[s.RGBA_INTEGER=36249]="RGBA_INTEGER",s[s.RGB_INTEGER=36248]="RGB_INTEGER",s[s.RG_INTEGER=33320]="RG_INTEGER",s[s.RED_INTEGER=36244]="RED_INTEGER",s[s.ALPHA=6406]="ALPHA",s[s.LUMINANCE=6409]="LUMINANCE",s[s.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",s[s.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",s[s.DEPTH_STENCIL=34041]="DEPTH_STENCIL",s))(O||{}),Xs=(s=>(s[s.TEXTURE_2D=3553]="TEXTURE_2D",s[s.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",s[s.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",s[s.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",s[s.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",s[s.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",s[s.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",s[s.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",s))(Xs||{}),Z=(s=>(s[s.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",s[s.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",s[s.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",s[s.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",s[s.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",s[s.UNSIGNED_INT=5125]="UNSIGNED_INT",s[s.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",s[s.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",s[s.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",s[s.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",s[s.BYTE=5120]="BYTE",s[s.SHORT=5122]="SHORT",s[s.INT=5124]="INT",s[s.FLOAT=5126]="FLOAT",s[s.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",s[s.HALF_FLOAT=36193]="HALF_FLOAT",s))(Z||{}),V=(s=>(s[s.FLOAT=0]="FLOAT",s[s.INT=1]="INT",s[s.UINT=2]="UINT",s))(V||{}),Ti=(s=>(s[s.NEAREST=0]="NEAREST",s[s.LINEAR=1]="LINEAR",s))(Ti||{}),Ui=(s=>(s[s.CLAMP=33071]="CLAMP",s[s.REPEAT=10497]="REPEAT",s[s.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",s))(Ui||{}),Ke=(s=>(s[s.OFF=0]="OFF",s[s.POW2=1]="POW2",s[s.ON=2]="ON",s[s.ON_MANUAL=3]="ON_MANUAL",s))(Ke||{}),he=(s=>(s[s.NPM=0]="NPM",s[s.UNPACK=1]="UNPACK",s[s.PMA=2]="PMA",s[s.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",s[s.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",s[s.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",s))(he||{}),Ze=(s=>(s[s.NO=0]="NO",s[s.YES=1]="YES",s[s.AUTO=2]="AUTO",s[s.BLEND=0]="BLEND",s[s.CLEAR=1]="CLEAR",s[s.BLIT=2]="BLIT",s))(Ze||{}),Ao=(s=>(s[s.AUTO=0]="AUTO",s[s.MANUAL=1]="MANUAL",s))(Ao||{}),Ce=(s=>(s.LOW="lowp",s.MEDIUM="mediump",s.HIGH="highp",s))(Ce||{}),Wt=(s=>(s[s.NONE=0]="NONE",s[s.SCISSOR=1]="SCISSOR",s[s.STENCIL=2]="STENCIL",s[s.SPRITE=3]="SPRITE",s[s.COLOR=4]="COLOR",s))(Wt||{}),Ht=(s=>(s[s.NONE=0]="NONE",s[s.LOW=2]="LOW",s[s.MEDIUM=4]="MEDIUM",s[s.HIGH=8]="HIGH",s))(Ht||{}),Qe=(s=>(s[s.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",s[s.ARRAY_BUFFER=34962]="ARRAY_BUFFER",s[s.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",s))(Qe||{});const H={ADAPTER:{createCanvas:(s,t)=>{const e=document.createElement("canvas");return e.width=s,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,t)=>fetch(s,t),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var So=/iPhone/i,tu=/iPod/i,eu=/iPad/i,iu=/\biOS-universal(?:.+)Mac\b/i,Co=/\bAndroid(?:.+)Mobile\b/i,su=/Android/i,$s=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Fn=/Silk/i,wi=/Windows Phone/i,ru=/\bWindows(?:.+)ARM\b/i,nu=/BlackBerry/i,au=/BB10/i,ou=/Opera Mini/i,hu=/\b(CriOS|Chrome)(?:.+)Mobile/i,lu=/Mobile(?:.+)Firefox\b/i,cu=function(s){return typeof s<"u"&&s.platform==="MacIntel"&&typeof s.maxTouchPoints=="number"&&s.maxTouchPoints>1&&typeof MSStream>"u"};function P_(s){return function(t){return t.test(s)}}function uu(s){var t={userAgent:"",platform:"",maxTouchPoints:0};!s&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof s=="string"?t.userAgent=s:s&&s.userAgent&&(t={userAgent:s.userAgent,platform:s.platform,maxTouchPoints:s.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var r=P_(e),n={apple:{phone:r(So)&&!r(wi),ipod:r(tu),tablet:!r(So)&&(r(eu)||cu(t))&&!r(wi),universal:r(iu),device:(r(So)||r(tu)||r(eu)||r(iu)||cu(t))&&!r(wi)},amazon:{phone:r($s),tablet:!r($s)&&r(Fn),device:r($s)||r(Fn)},android:{phone:!r(wi)&&r($s)||!r(wi)&&r(Co),tablet:!r(wi)&&!r($s)&&!r(Co)&&(r(Fn)||r(su)),device:!r(wi)&&(r($s)||r(Fn)||r(Co)||r(su))||r(/\bokhttp\b/i)},windows:{phone:r(wi),tablet:r(ru),device:r(wi)||r(ru)},other:{blackberry:r(nu),blackberry10:r(au),opera:r(ou),firefox:r(lu),chrome:r(hu),device:r(nu)||r(au)||r(ou)||r(lu)||r(hu)},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 R_=uu.default??uu,Ei=R_(globalThis.navigator);H.RETINA_PREFIX=/@([0-9\.]+)x/,H.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Nr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function du(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function I_(s){if(s.__esModule)return s;var t=s.default;if(typeof t=="function"){var e=function i(){return this instanceof i?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(s).forEach(function(i){var r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:function(){return s[i]}})}),e}var fu={exports:{}};(function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function n(h,l,c,d,u){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new r(c,d||h,u),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function a(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)t.call(c,d)&&l.push(e?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},o.prototype.listeners=function(l){var c=e?e+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var u=0,f=d.length,p=new Array(f);u<f;u++)p[u]=d[u].fn;return p},o.prototype.listenerCount=function(l){var c=e?e+l:l,d=this._events[c];return d?d.fn?1:d.length:0},o.prototype.emit=function(l,c,d,u,f,p){var m=e?e+l:l;if(!this._events[m])return!1;var _=this._events[m],y=arguments.length,v,g;if(_.fn){switch(_.once&&this.removeListener(l,_.fn,void 0,!0),y){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,c),!0;case 3:return _.fn.call(_.context,c,d),!0;case 4:return _.fn.call(_.context,c,d,u),!0;case 5:return _.fn.call(_.context,c,d,u,f),!0;case 6:return _.fn.call(_.context,c,d,u,f,p),!0}for(g=1,v=new Array(y-1);g<y;g++)v[g-1]=arguments[g];_.fn.apply(_.context,v)}else{var x=_.length,b;for(g=0;g<x;g++)switch(_[g].once&&this.removeListener(l,_[g].fn,void 0,!0),y){case 1:_[g].fn.call(_[g].context);break;case 2:_[g].fn.call(_[g].context,c);break;case 3:_[g].fn.call(_[g].context,c,d);break;case 4:_[g].fn.call(_[g].context,c,d,u);break;default:if(!v)for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];_[g].fn.apply(_[g].context,v)}}return!0},o.prototype.on=function(l,c,d){return n(this,l,c,d,!1)},o.prototype.once=function(l,c,d){return n(this,l,c,d,!0)},o.prototype.removeListener=function(l,c,d,u){var f=e?e+l:l;if(!this._events[f])return this;if(!c)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===c&&(!u||p.once)&&(!d||p.context===d)&&a(this,f);else{for(var m=0,_=[],y=p.length;m<y;m++)(p[m].fn!==c||u&&!p[m].once||d&&p[m].context!==d)&&_.push(p[m]);_.length?this._events[f]=_.length===1?_[0]:_: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 i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,s.exports=o})(fu);var M_=fu.exports;const Je=du(M_);var Po={exports:{}};Po.exports=Ln,Po.exports.default=Ln;function Ln(s,t,e){e=e||2;var i=t&&t.length,r=i?t[0]*e:s.length,n=pu(s,0,r,e,!0),a=[];if(!n||n.next===n.prev)return a;var o,h,l,c,d,u,f;if(i&&(n=L_(s,t,n,e)),s.length>80*e){o=l=s[0],h=c=s[1];for(var p=e;p<r;p+=e)d=s[p],u=s[p+1],d<o&&(o=d),u<h&&(h=u),d>l&&(l=d),u>c&&(c=u);f=Math.max(l-o,c-h),f=f!==0?32767/f:0}return Ur(n,a,e,o,h,f,0),a}function pu(s,t,e,i,r){var n,a;if(r===Mo(s,t,e,i)>0)for(n=t;n<e;n+=i)a=gu(n,s[n],s[n+1],a);else for(n=e-i;n>=t;n-=i)a=gu(n,s[n],s[n+1],a);return a&&kn(a,a.next)&&(Hr(a),a=a.next),a}function ds(s,t){if(!s)return s;t||(t=s);var e=s,i;do if(i=!1,!e.steiner&&(kn(e,e.next)||Et(e.prev,e,e.next)===0)){if(Hr(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Ur(s,t,e,i,r,n,a){if(s){!a&&n&&H_(s,i,r,n);for(var o=s,h,l;s.prev!==s.next;){if(h=s.prev,l=s.next,n?B_(s,i,r,n):D_(s)){t.push(h.i/e|0),t.push(s.i/e|0),t.push(l.i/e|0),Hr(s),s=l.next,o=l.next;continue}if(s=l,s===o){a?a===1?(s=O_(ds(s),t,e),Ur(s,t,e,i,r,n,2)):a===2&&F_(s,t,e,i,r,n):Ur(ds(s),t,e,i,r,n,1);break}}}}function D_(s){var t=s.prev,e=s,i=s.next;if(Et(t,e,i)>=0)return!1;for(var r=t.x,n=e.x,a=i.x,o=t.y,h=e.y,l=i.y,c=r<n?r<a?r:a:n<a?n:a,d=o<h?o<l?o:l:h<l?h:l,u=r>n?r>a?r:a:n>a?n:a,f=o>h?o>l?o:l:h>l?h:l,p=i.next;p!==t;){if(p.x>=c&&p.x<=u&&p.y>=d&&p.y<=f&&zs(r,o,n,h,a,l,p.x,p.y)&&Et(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function B_(s,t,e,i){var r=s.prev,n=s,a=s.next;if(Et(r,n,a)>=0)return!1;for(var o=r.x,h=n.x,l=a.x,c=r.y,d=n.y,u=a.y,f=o<h?o<l?o:l:h<l?h:l,p=c<d?c<u?c:u:d<u?d:u,m=o>h?o>l?o:l:h>l?h:l,_=c>d?c>u?c:u:d>u?d:u,y=Ro(f,p,t,e,i),v=Ro(m,_,t,e,i),g=s.prevZ,x=s.nextZ;g&&g.z>=y&&x&&x.z<=v;){if(g.x>=f&&g.x<=m&&g.y>=p&&g.y<=_&&g!==r&&g!==a&&zs(o,c,h,d,l,u,g.x,g.y)&&Et(g.prev,g,g.next)>=0||(g=g.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=_&&x!==r&&x!==a&&zs(o,c,h,d,l,u,x.x,x.y)&&Et(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;g&&g.z>=y;){if(g.x>=f&&g.x<=m&&g.y>=p&&g.y<=_&&g!==r&&g!==a&&zs(o,c,h,d,l,u,g.x,g.y)&&Et(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;x&&x.z<=v;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=_&&x!==r&&x!==a&&zs(o,c,h,d,l,u,x.x,x.y)&&Et(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function O_(s,t,e){var i=s;do{var r=i.prev,n=i.next.next;!kn(r,n)&&mu(r,i,i.next,n)&&Gr(r,n)&&Gr(n,r)&&(t.push(r.i/e|0),t.push(i.i/e|0),t.push(n.i/e|0),Hr(i),Hr(i.next),i=s=n),i=i.next}while(i!==s);return ds(i)}function F_(s,t,e,i,r,n){var a=s;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&X_(a,o)){var h=_u(a,o);a=ds(a,a.next),h=ds(h,h.next),Ur(a,t,e,i,r,n,0),Ur(h,t,e,i,r,n,0);return}o=o.next}a=a.next}while(a!==s)}function L_(s,t,e,i){var r=[],n,a,o,h,l;for(n=0,a=t.length;n<a;n++)o=t[n]*i,h=n<a-1?t[n+1]*i:s.length,l=pu(s,o,h,i,!1),l===l.next&&(l.steiner=!0),r.push(W_(l));for(r.sort(k_),n=0;n<r.length;n++)e=N_(r[n],e);return e}function k_(s,t){return s.x-t.x}function N_(s,t){var e=U_(s,t);if(!e)return t;var i=_u(e,s);return ds(i,i.next),ds(e,e.next)}function U_(s,t){var e=t,i=s.x,r=s.y,n=-1/0,a;do{if(r<=e.y&&r>=e.next.y&&e.next.y!==e.y){var o=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(o<=i&&o>n&&(n=o,a=e.x<e.next.x?e:e.next,o===i))return a}e=e.next}while(e!==t);if(!a)return null;var h=a,l=a.x,c=a.y,d=1/0,u;e=a;do i>=e.x&&e.x>=l&&i!==e.x&&zs(r<c?i:n,r,l,c,r<c?n:i,r,e.x,e.y)&&(u=Math.abs(r-e.y)/(i-e.x),Gr(e,s)&&(u<d||u===d&&(e.x>a.x||e.x===a.x&&G_(a,e)))&&(a=e,d=u)),e=e.next;while(e!==h);return a}function G_(s,t){return Et(s.prev,s,t.prev)<0&&Et(t.next,s,s.next)<0}function H_(s,t,e,i){var r=s;do r.z===0&&(r.z=Ro(r.x,r.y,t,e,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==s);r.prevZ.nextZ=null,r.prevZ=null,V_(r)}function V_(s){var t,e,i,r,n,a,o,h,l=1;do{for(e=s,s=null,n=null,a=0;e;){for(a++,i=e,o=0,t=0;t<l&&(o++,i=i.nextZ,!!i);t++);for(h=l;o>0||h>0&&i;)o!==0&&(h===0||!i||e.z<=i.z)?(r=e,e=e.nextZ,o--):(r=i,i=i.nextZ,h--),n?n.nextZ=r:s=r,r.prevZ=n,n=r;e=i}n.nextZ=null,l*=2}while(a>1);return s}function Ro(s,t,e,i,r){return s=(s-e)*r|0,t=(t-i)*r|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,s|t<<1}function W_(s){var t=s,e=s;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==s);return e}function zs(s,t,e,i,r,n,a,o){return(r-a)*(t-o)>=(s-a)*(n-o)&&(s-a)*(i-o)>=(e-a)*(t-o)&&(e-a)*(n-o)>=(r-a)*(i-o)}function X_(s,t){return s.next.i!==t.i&&s.prev.i!==t.i&&!$_(s,t)&&(Gr(s,t)&&Gr(t,s)&&z_(s,t)&&(Et(s.prev,s,t.prev)||Et(s,t.prev,t))||kn(s,t)&&Et(s.prev,s,s.next)>0&&Et(t.prev,t,t.next)>0)}function Et(s,t,e){return(t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y)}function kn(s,t){return s.x===t.x&&s.y===t.y}function mu(s,t,e,i){var r=Un(Et(s,t,e)),n=Un(Et(s,t,i)),a=Un(Et(e,i,s)),o=Un(Et(e,i,t));return!!(r!==n&&a!==o||r===0&&Nn(s,e,t)||n===0&&Nn(s,i,t)||a===0&&Nn(e,s,i)||o===0&&Nn(e,t,i))}function Nn(s,t,e){return t.x<=Math.max(s.x,e.x)&&t.x>=Math.min(s.x,e.x)&&t.y<=Math.max(s.y,e.y)&&t.y>=Math.min(s.y,e.y)}function Un(s){return s>0?1:s<0?-1:0}function $_(s,t){var e=s;do{if(e.i!==s.i&&e.next.i!==s.i&&e.i!==t.i&&e.next.i!==t.i&&mu(e,e.next,s,t))return!0;e=e.next}while(e!==s);return!1}function Gr(s,t){return Et(s.prev,s,s.next)<0?Et(s,t,s.next)>=0&&Et(s,s.prev,t)>=0:Et(s,t,s.prev)<0||Et(s,s.next,t)<0}function z_(s,t){var e=s,i=!1,r=(s.x+t.x)/2,n=(s.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==s);return i}function _u(s,t){var e=new Io(s.i,s.x,s.y),i=new Io(t.i,t.x,t.y),r=s.next,n=t.prev;return s.next=t,t.prev=s,e.next=r,r.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}function gu(s,t,e,i){var r=new Io(s,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Hr(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Io(s,t,e){this.i=s,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ln.deviation=function(s,t,e,i){var r=t&&t.length,n=r?t[0]*e:s.length,a=Math.abs(Mo(s,0,n,e));if(r)for(var o=0,h=t.length;o<h;o++){var l=t[o]*e,c=o<h-1?t[o+1]*e:s.length;a-=Math.abs(Mo(s,l,c,e))}var d=0;for(o=0;o<i.length;o+=3){var u=i[o]*e,f=i[o+1]*e,p=i[o+2]*e;d+=Math.abs((s[u]-s[p])*(s[f+1]-s[u+1])-(s[u]-s[f])*(s[p+1]-s[u+1]))}return a===0&&d===0?0:Math.abs((d-a)/a)};function Mo(s,t,e,i){for(var r=0,n=t,a=e-i;n<e;n+=i)r+=(s[a]-s[n])*(s[n+1]+s[a+1]),a=n;return r}Ln.flatten=function(s){for(var t=s[0][0].length,e={vertices:[],holes:[],dimensions:t},i=0,r=0;r<s.length;r++){for(var n=0;n<s[r].length;n++)for(var a=0;a<t;a++)e.vertices.push(s[r][n][a]);r>0&&(i+=s[r-1].length,e.holes.push(i))}return e};var Y_=Po.exports;const j_=du(Y_);var Gn={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */Gn.exports,function(s,t){(function(e){var i=t&&!t.nodeType&&t,r=s&&!s.nodeType&&s,n=typeof Nr=="object"&&Nr;(n.global===n||n.window===n||n.self===n)&&(e=n);var a,o=2147483647,h=36,l=1,c=26,d=38,u=700,f=72,p=128,m="-",_=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,b=Math.floor,w=String.fromCharCode,T;function E(I){throw new RangeError(g[I])}function A(I,D){for(var $=I.length,Y=[];$--;)Y[$]=D(I[$]);return Y}function P(I,D){var $=I.split("@"),Y="";$.length>1&&(Y=$[0]+"@",I=$[1]),I=I.replace(v,".");var U=I.split("."),rt=A(U,D).join(".");return Y+rt}function L(I){for(var D=[],$=0,Y=I.length,U,rt;$<Y;)U=I.charCodeAt($++),U>=55296&&U<=56319&&$<Y?(rt=I.charCodeAt($++),(rt&64512)==56320?D.push(((U&1023)<<10)+(rt&1023)+65536):(D.push(U),$--)):D.push(U);return D}function M(I){return A(I,function(D){var $="";return D>65535&&(D-=65536,$+=w(D>>>10&1023|55296),D=56320|D&1023),$+=w(D),$}).join("")}function S(I){return I-48<10?I-22:I-65<26?I-65:I-97<26?I-97:h}function C(I,D){return I+22+75*(I<26)-((D!=0)<<5)}function R(I,D,$){var Y=0;for(I=$?b(I/u):I>>1,I+=b(I/D);I>x*c>>1;Y+=h)I=b(I/x);return b(Y+(x+1)*I/(I+d))}function N(I){var D=[],$=I.length,Y,U=0,rt=p,dt=f,lt,vt,Dt,kt,_t,Bt,wt,me,Ae;for(lt=I.lastIndexOf(m),lt<0&&(lt=0),vt=0;vt<lt;++vt)I.charCodeAt(vt)>=128&&E("not-basic"),D.push(I.charCodeAt(vt));for(Dt=lt>0?lt+1:0;Dt<$;){for(kt=U,_t=1,Bt=h;Dt>=$&&E("invalid-input"),wt=S(I.charCodeAt(Dt++)),(wt>=h||wt>b((o-U)/_t))&&E("overflow"),U+=wt*_t,me=Bt<=dt?l:Bt>=dt+c?c:Bt-dt,!(wt<me);Bt+=h)Ae=h-me,_t>b(o/Ae)&&E("overflow"),_t*=Ae;Y=D.length+1,dt=R(U-kt,Y,kt==0),b(U/Y)>o-rt&&E("overflow"),rt+=b(U/Y),U%=Y,D.splice(U++,0,rt)}return M(D)}function F(I){var D,$,Y,U,rt,dt,lt,vt,Dt,kt,_t,Bt=[],wt,me,Ae,cs;for(I=L(I),wt=I.length,D=p,$=0,rt=f,dt=0;dt<wt;++dt)_t=I[dt],_t<128&&Bt.push(w(_t));for(Y=U=Bt.length,U&&Bt.push(m);Y<wt;){for(lt=o,dt=0;dt<wt;++dt)_t=I[dt],_t>=D&&_t<lt&&(lt=_t);for(me=Y+1,lt-D>b((o-$)/me)&&E("overflow"),$+=(lt-D)*me,D=lt,dt=0;dt<wt;++dt)if(_t=I[dt],_t<D&&++$>o&&E("overflow"),_t==D){for(vt=$,Dt=h;kt=Dt<=rt?l:Dt>=rt+c?c:Dt-rt,!(vt<kt);Dt+=h)cs=vt-kt,Ae=h-kt,Bt.push(w(C(kt+cs%Ae,0))),vt=b(cs/Ae);Bt.push(w(C(vt,0))),rt=R($,me,Y==U),$=0,++Y}++$,++D}return Bt.join("")}function B(I){return P(I,function(D){return _.test(D)?N(D.slice(4).toLowerCase()):D})}function W(I){return P(I,function(D){return y.test(D)?"xn--"+F(D):D})}if(a={version:"1.4.1",ucs2:{decode:L,encode:M},decode:N,encode:F,toASCII:W,toUnicode:B},i&&r)if(s.exports==i)r.exports=a;else for(T in a)a.hasOwnProperty(T)&&(i[T]=a[T]);else e.punycode=a})(Nr)}(Gn,Gn.exports);var q_=Gn.exports,Ys=TypeError;const K_=I_(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Do=typeof Map=="function"&&Map.prototype,Bo=Object.getOwnPropertyDescriptor&&Do?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hn=Do&&Bo&&typeof Bo.get=="function"?Bo.get:null,yu=Do&&Map.prototype.forEach,Oo=typeof Set=="function"&&Set.prototype,Fo=Object.getOwnPropertyDescriptor&&Oo?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Vn=Oo&&Fo&&typeof Fo.get=="function"?Fo.get:null,xu=Oo&&Set.prototype.forEach,Z_=typeof WeakMap=="function"&&WeakMap.prototype,Vr=Z_?WeakMap.prototype.has:null,Q_=typeof WeakSet=="function"&&WeakSet.prototype,Wr=Q_?WeakSet.prototype.has:null,J_=typeof WeakRef=="function"&&WeakRef.prototype,vu=J_?WeakRef.prototype.deref:null,tg=Boolean.prototype.valueOf,eg=Object.prototype.toString,ig=Function.prototype.toString,sg=String.prototype.match,Lo=String.prototype.slice,Gi=String.prototype.replace,rg=String.prototype.toUpperCase,bu=String.prototype.toLowerCase,Tu=RegExp.prototype.test,wu=Array.prototype.concat,ti=Array.prototype.join,ng=Array.prototype.slice,Eu=Math.floor,ko=typeof BigInt=="function"?BigInt.prototype.valueOf:null,No=Object.getOwnPropertySymbols,Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,js=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Jt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===js||"symbol")?Symbol.toStringTag:null,Au=Object.prototype.propertyIsEnumerable,Su=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function Cu(s,t){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||Tu.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var i=s<0?-Eu(-s):Eu(s);if(i!==s){var r=String(i),n=Lo.call(t,r.length+1);return Gi.call(r,e,"$&_")+"."+Gi.call(Gi.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Gi.call(t,e,"$&_")}var Go=K_,Pu=Go.custom,Ru=Bu(Pu)?Pu:null,Iu={__proto__:null,double:'"',single:"'"},ag={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Wn=function s(t,e,i,r){var n=e||{};if(Ai(n,"quoteStyle")&&!Ai(Iu,n.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ai(n,"maxStringLength")&&(typeof n.maxStringLength=="number"?n.maxStringLength<0&&n.maxStringLength!==1/0:n.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Ai(n,"customInspect")?n.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ai(n,"indent")&&n.indent!==null&&n.indent!==" "&&!(parseInt(n.indent,10)===n.indent&&n.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ai(n,"numericSeparator")&&typeof n.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=n.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Fu(t,n);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var h=String(t);return o?Cu(t,h):h}if(typeof t=="bigint"){var l=String(t)+"n";return o?Cu(t,l):l}var c=typeof n.depth>"u"?5:n.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return Ho(t)?"[Array]":"[Object]";var d=Eg(n,i);if(typeof r>"u")r=[];else if(Ou(r,t)>=0)return"[Circular]";function u(S,C,R){if(C&&(r=ng.call(r),r.push(C)),R){var N={depth:n.depth};return Ai(n,"quoteStyle")&&(N.quoteStyle=n.quoteStyle),s(S,N,i+1,r)}return s(S,n,i+1,r)}if(typeof t=="function"&&!Du(t)){var f=mg(t),p=Xn(t,u);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+ti.call(p,", ")+" }":"")}if(Bu(t)){var m=js?Gi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Uo.call(t);return typeof t=="object"&&!js?Xr(m):m}if(bg(t)){for(var _="<"+bu.call(String(t.nodeName)),y=t.attributes||[],v=0;v<y.length;v++)_+=" "+y[v].name+"="+Mu(og(y[v].value),"double",n);return _+=">",t.childNodes&&t.childNodes.length&&(_+="..."),_+="</"+bu.call(String(t.nodeName))+">",_}if(Ho(t)){if(t.length===0)return"[]";var g=Xn(t,u);return d&&!wg(g)?"["+Wo(g,d)+"]":"[ "+ti.call(g,", ")+" ]"}if(lg(t)){var x=Xn(t,u);return!("cause"in Error.prototype)&&"cause"in t&&!Au.call(t,"cause")?"{ ["+String(t)+"] "+ti.call(wu.call("[cause]: "+u(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+ti.call(x,", ")+" }"}if(typeof t=="object"&&a){if(Ru&&typeof t[Ru]=="function"&&Go)return Go(t,{depth:c-i});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(_g(t)){var b=[];return yu&&yu.call(t,function(S,C){b.push(u(C,t,!0)+" => "+u(S,t))}),Lu("Map",Hn.call(t),b,d)}if(xg(t)){var w=[];return xu&&xu.call(t,function(S){w.push(u(S,t))}),Lu("Set",Vn.call(t),w,d)}if(gg(t))return Vo("WeakMap");if(vg(t))return Vo("WeakSet");if(yg(t))return Vo("WeakRef");if(ug(t))return Xr(u(Number(t)));if(fg(t))return Xr(u(ko.call(t)));if(dg(t))return Xr(tg.call(t));if(cg(t))return Xr(u(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Nr<"u"&&t===Nr)return"{ [object globalThis] }";if(!hg(t)&&!Du(t)){var T=Xn(t,u),E=Su?Su(t)===Object.prototype:t instanceof Object||t.constructor===Object,A=t instanceof Object?"":"null prototype",P=!E&&Jt&&Object(t)===t&&Jt in t?Lo.call(Hi(t),8,-1):A?"Object":"",L=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",M=L+(P||A?"["+ti.call(wu.call([],P||[],A||[]),": ")+"] ":"");return T.length===0?M+"{}":d?M+"{"+Wo(T,d)+"}":M+"{ "+ti.call(T,", ")+" }"}return String(t)};function Mu(s,t,e){var i=e.quoteStyle||t,r=Iu[i];return r+s+r}function og(s){return Gi.call(String(s),/"/g,""")}function Ho(s){return Hi(s)==="[object Array]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function hg(s){return Hi(s)==="[object Date]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Du(s){return Hi(s)==="[object RegExp]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function lg(s){return Hi(s)==="[object Error]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function cg(s){return Hi(s)==="[object String]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function ug(s){return Hi(s)==="[object Number]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function dg(s){return Hi(s)==="[object Boolean]"&&(!Jt||!(typeof s=="object"&&Jt in s))}function Bu(s){if(js)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!Uo)return!1;try{return Uo.call(s),!0}catch{}return!1}function fg(s){if(!s||typeof s!="object"||!ko)return!1;try{return ko.call(s),!0}catch{}return!1}var pg=Object.prototype.hasOwnProperty||function(s){return s in this};function Ai(s,t){return pg.call(s,t)}function Hi(s){return eg.call(s)}function mg(s){if(s.name)return s.name;var t=sg.call(ig.call(s),/^function\s*([\w$]+)/);return t?t[1]:null}function Ou(s,t){if(s.indexOf)return s.indexOf(t);for(var e=0,i=s.length;e<i;e++)if(s[e]===t)return e;return-1}function _g(s){if(!Hn||!s||typeof s!="object")return!1;try{Hn.call(s);try{Vn.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function gg(s){if(!Vr||!s||typeof s!="object")return!1;try{Vr.call(s,Vr);try{Wr.call(s,Wr)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function yg(s){if(!vu||!s||typeof s!="object")return!1;try{return vu.call(s),!0}catch{}return!1}function xg(s){if(!Vn||!s||typeof s!="object")return!1;try{Vn.call(s);try{Hn.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function vg(s){if(!Wr||!s||typeof s!="object")return!1;try{Wr.call(s,Wr);try{Vr.call(s,Vr)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function bg(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function Fu(s,t){if(s.length>t.maxStringLength){var e=s.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return Fu(Lo.call(s,0,t.maxStringLength),t)+i}var r=ag[t.quoteStyle||"single"];r.lastIndex=0;var n=Gi.call(Gi.call(s,r,"\\$1"),/[\x00-\x1f]/g,Tg);return Mu(n,"single",t)}function Tg(s){var t=s.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+rg.call(t.toString(16))}function Xr(s){return"Object("+s+")"}function Vo(s){return s+" { ? }"}function Lu(s,t,e,i){var r=i?Wo(e,i):ti.call(e,", ");return s+" ("+t+") {"+r+"}"}function wg(s){for(var t=0;t<s.length;t++)if(Ou(s[t],`
|
|
2
|
+
`)>=0)return!1;return!0}function Eg(s,t){var e;if(s.indent===" ")e=" ";else if(typeof s.indent=="number"&&s.indent>0)e=ti.call(Array(s.indent+1)," ");else return null;return{base:e,prev:ti.call(Array(t+1),e)}}function Wo(s,t){if(s.length===0)return"";var e=`
|
|
3
|
+
`+t.prev+t.base;return e+ti.call(s,","+e)+`
|
|
4
|
+
`+t.prev}function Xn(s,t){var e=Ho(s),i=[];if(e){i.length=s.length;for(var r=0;r<s.length;r++)i[r]=Ai(s,r)?t(s[r],s):""}var n=typeof No=="function"?No(s):[],a;if(js){a={};for(var o=0;o<n.length;o++)a["$"+n[o]]=n[o]}for(var h in s)Ai(s,h)&&(e&&String(Number(h))===h&&h<s.length||js&&a["$"+h]instanceof Symbol||(Tu.call(/[^\w$]/,h)?i.push(t(h,s)+": "+t(s[h],s)):i.push(h+": "+t(s[h],s))));if(typeof No=="function")for(var l=0;l<n.length;l++)Au.call(s,n[l])&&i.push("["+t(n[l])+"]: "+t(s[n[l]],s));return i}var Ag=Wn,Sg=Ys,$n=function(s,t,e){for(var i=s,r;(r=i.next)!=null;i=r)if(r.key===t)return i.next=r.next,e||(r.next=s.next,s.next=r),r},Cg=function(s,t){if(s){var e=$n(s,t);return e&&e.value}},Pg=function(s,t,e){var i=$n(s,t);i?i.value=e:s.next={key:t,next:s.next,value:e}},Rg=function(s,t){return s?!!$n(s,t):!1},Ig=function(s,t){if(s)return $n(s,t,!0)},Mg=function(){var t,e={assert:function(i){if(!e.has(i))throw new Sg("Side channel does not contain "+Ag(i))},delete:function(i){var r=t&&t.next,n=Ig(t,i);return n&&r&&r===n&&(t=void 0),!!n},get:function(i){return Cg(t,i)},has:function(i){return Rg(t,i)},set:function(i,r){t||(t={next:void 0}),Pg(t,i,r)}};return e},ku=Object,Dg=Error,Bg=EvalError,Og=RangeError,Fg=ReferenceError,Lg=SyntaxError,kg=URIError,Ng=Math.abs,Ug=Math.floor,Gg=Math.max,Hg=Math.min,Vg=Math.pow,Wg=Math.round,Xg=Number.isNaN||function(t){return t!==t},$g=Xg,zg=function(t){return $g(t)||t===0?t:t<0?-1:1},Yg=Object.getOwnPropertyDescriptor,zn=Yg;if(zn)try{zn([],"length")}catch{zn=null}var Nu=zn,Yn=Object.defineProperty||!1;if(Yn)try{Yn({},"a",{value:1})}catch{Yn=!1}var jg=Yn,Xo,Uu;function qg(){return Uu||(Uu=1,Xo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[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}),Xo}var $o,Gu;function Kg(){if(Gu)return $o;Gu=1;var s=typeof Symbol<"u"&&Symbol,t=qg();return $o=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},$o}var zo,Hu;function Vu(){return Hu||(Hu=1,zo=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),zo}var Yo,Wu;function Xu(){if(Wu)return Yo;Wu=1;var s=ku;return Yo=s.getPrototypeOf||null,Yo}var jo,$u;function Zg(){if($u)return jo;$u=1;var s="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,i="[object Function]",r=function(h,l){for(var c=[],d=0;d<h.length;d+=1)c[d]=h[d];for(var u=0;u<l.length;u+=1)c[u+h.length]=l[u];return c},n=function(h,l){for(var c=[],d=l||0,u=0;d<h.length;d+=1,u+=1)c[u]=h[d];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 jo=function(h){var l=this;if(typeof l!="function"||t.apply(l)!==i)throw new TypeError(s+l);for(var c=n(arguments,1),d,u=function(){if(this instanceof d){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),p=[],m=0;m<f;m++)p[m]="$"+m;if(d=Function("binder","return function ("+a(p,",")+"){ return binder.apply(this,arguments); }")(u),l.prototype){var _=function(){};_.prototype=l.prototype,d.prototype=new _,_.prototype=null}return d},jo}var qo,zu;function jn(){if(zu)return qo;zu=1;var s=Zg();return qo=Function.prototype.bind||s,qo}var Ko,Yu;function Zo(){return Yu||(Yu=1,Ko=Function.prototype.call),Ko}var Qo,ju;function qu(){return ju||(ju=1,Qo=Function.prototype.apply),Qo}var Qg=typeof Reflect<"u"&&Reflect&&Reflect.apply,Jg=jn(),t0=qu(),e0=Zo(),i0=Qg,s0=i0||Jg.call(e0,t0),r0=jn(),n0=Ys,a0=Zo(),o0=s0,Ku=function(t){if(t.length<1||typeof t[0]!="function")throw new n0("a function is required");return o0(r0,a0,t)},Jo,Zu;function h0(){if(Zu)return Jo;Zu=1;var s=Ku,t=Nu,e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!!e&&t&&t(Object.prototype,"__proto__"),r=Object,n=r.getPrototypeOf;return Jo=i&&typeof i.get=="function"?s([i.get]):typeof n=="function"?function(o){return n(o==null?o:r(o))}:!1,Jo}var th,Qu;function l0(){if(Qu)return th;Qu=1;var s=Vu(),t=Xu(),e=h0();return th=s?function(r){return s(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,th}var eh,Ju;function c0(){if(Ju)return eh;Ju=1;var s=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=jn();return eh=e.call(s,t),eh}var nt,u0=ku,d0=Dg,f0=Bg,p0=Og,m0=Fg,qs=Lg,Ks=Ys,_0=kg,g0=Ng,y0=Ug,x0=Gg,v0=Hg,b0=Vg,T0=Wg,w0=zg,td=Function,ih=function(s){try{return td('"use strict"; return ('+s+").constructor;")()}catch{}},$r=Nu,E0=jg,sh=function(){throw new Ks},A0=$r?function(){try{return arguments.callee,sh}catch{try{return $r(arguments,"callee").get}catch{return sh}}}():sh,Zs=Kg()(),$t=l0(),S0=Xu(),C0=Vu(),ed=qu(),zr=Zo(),Qs={},P0=typeof Uint8Array>"u"||!$t?nt:$t(Uint8Array),fs={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?nt:ArrayBuffer,"%ArrayIteratorPrototype%":Zs&&$t?$t([][Symbol.iterator]()):nt,"%AsyncFromSyncIteratorPrototype%":nt,"%AsyncFunction%":Qs,"%AsyncGenerator%":Qs,"%AsyncGeneratorFunction%":Qs,"%AsyncIteratorPrototype%":Qs,"%Atomics%":typeof Atomics>"u"?nt:Atomics,"%BigInt%":typeof BigInt>"u"?nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d0,"%eval%":eval,"%EvalError%":f0,"%Float32Array%":typeof Float32Array>"u"?nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?nt:FinalizationRegistry,"%Function%":td,"%GeneratorFunction%":Qs,"%Int8Array%":typeof Int8Array>"u"?nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zs&&$t?$t($t([][Symbol.iterator]())):nt,"%JSON%":typeof JSON=="object"?JSON:nt,"%Map%":typeof Map>"u"?nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Zs||!$t?nt:$t(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":u0,"%Object.getOwnPropertyDescriptor%":$r,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?nt:Promise,"%Proxy%":typeof Proxy>"u"?nt:Proxy,"%RangeError%":p0,"%ReferenceError%":m0,"%Reflect%":typeof Reflect>"u"?nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Zs||!$t?nt:$t(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zs&&$t?$t(""[Symbol.iterator]()):nt,"%Symbol%":Zs?Symbol:nt,"%SyntaxError%":qs,"%ThrowTypeError%":A0,"%TypedArray%":P0,"%TypeError%":Ks,"%Uint8Array%":typeof Uint8Array>"u"?nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?nt:Uint32Array,"%URIError%":_0,"%WeakMap%":typeof WeakMap>"u"?nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?nt:WeakSet,"%Function.prototype.call%":zr,"%Function.prototype.apply%":ed,"%Object.defineProperty%":E0,"%Object.getPrototypeOf%":S0,"%Math.abs%":g0,"%Math.floor%":y0,"%Math.max%":x0,"%Math.min%":v0,"%Math.pow%":b0,"%Math.round%":T0,"%Math.sign%":w0,"%Reflect.getPrototypeOf%":C0};if($t)try{null.error}catch(s){var R0=$t($t(s));fs["%Error.prototype%"]=R0}var I0=function s(t){var e;if(t==="%AsyncFunction%")e=ih("async function () {}");else if(t==="%GeneratorFunction%")e=ih("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=ih("async function* () {}");else if(t==="%AsyncGenerator%"){var i=s("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var r=s("%AsyncGenerator%");r&&$t&&(e=$t(r.prototype))}return fs[t]=e,e},id={__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"]},Yr=jn(),qn=c0(),M0=Yr.call(zr,Array.prototype.concat),D0=Yr.call(ed,Array.prototype.splice),sd=Yr.call(zr,String.prototype.replace),Kn=Yr.call(zr,String.prototype.slice),B0=Yr.call(zr,RegExp.prototype.exec),O0=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F0=/\\(\\)?/g,L0=function(t){var e=Kn(t,0,1),i=Kn(t,-1);if(e==="%"&&i!=="%")throw new qs("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new qs("invalid intrinsic syntax, expected opening `%`");var r=[];return sd(t,O0,function(n,a,o,h){r[r.length]=o?sd(h,F0,"$1"):a||n}),r},k0=function(t,e){var i=t,r;if(qn(id,i)&&(r=id[i],i="%"+r[0]+"%"),qn(fs,i)){var n=fs[i];if(n===Qs&&(n=I0(i)),typeof n>"u"&&!e)throw new Ks("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new qs("intrinsic "+t+" does not exist!")},rh=function(t,e){if(typeof t!="string"||t.length===0)throw new Ks("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ks('"allowMissing" argument must be a boolean');if(B0(/^%?[^%]*%?$/,t)===null)throw new qs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=L0(t),r=i.length>0?i[0]:"",n=k0("%"+r+"%",e),a=n.name,o=n.value,h=!1,l=n.alias;l&&(r=l[0],D0(i,M0([0,1],l)));for(var c=1,d=!0;c<i.length;c+=1){var u=i[c],f=Kn(u,0,1),p=Kn(u,-1);if((f==='"'||f==="'"||f==="`"||p==='"'||p==="'"||p==="`")&&f!==p)throw new qs("property names with quotes must have matching quotes");if((u==="constructor"||!d)&&(h=!0),r+="."+u,a="%"+r+"%",qn(fs,a))o=fs[a];else if(o!=null){if(!(u in o)){if(!e)throw new Ks("base intrinsic for "+t+" exists, but the property is not available.");return}if($r&&c+1>=i.length){var m=$r(o,u);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?o=m.get:o=o[u]}else d=qn(o,u),o=o[u];d&&!h&&(fs[a]=o)}}return o},rd=rh,nd=Ku,N0=nd([rd("%String.prototype.indexOf%")]),ad=function(t,e){var i=rd(t,!!e);return typeof i=="function"&&N0(t,".prototype.")>-1?nd([i]):i},U0=rh,jr=ad,G0=Wn,H0=Ys,od=U0("%Map%",!0),V0=jr("Map.prototype.get",!0),W0=jr("Map.prototype.set",!0),X0=jr("Map.prototype.has",!0),$0=jr("Map.prototype.delete",!0),z0=jr("Map.prototype.size",!0),hd=!!od&&function(){var t,e={assert:function(i){if(!e.has(i))throw new H0("Side channel does not contain "+G0(i))},delete:function(i){if(t){var r=$0(t,i);return z0(t)===0&&(t=void 0),r}return!1},get:function(i){if(t)return V0(t,i)},has:function(i){return t?X0(t,i):!1},set:function(i,r){t||(t=new od),W0(t,i,r)}};return e},Y0=rh,Zn=ad,j0=Wn,Qn=hd,q0=Ys,Js=Y0("%WeakMap%",!0),K0=Zn("WeakMap.prototype.get",!0),Z0=Zn("WeakMap.prototype.set",!0),Q0=Zn("WeakMap.prototype.has",!0),J0=Zn("WeakMap.prototype.delete",!0),ty=Js?function(){var t,e,i={assert:function(r){if(!i.has(r))throw new q0("Side channel does not contain "+j0(r))},delete:function(r){if(Js&&r&&(typeof r=="object"||typeof r=="function")){if(t)return J0(t,r)}else if(Qn&&e)return e.delete(r);return!1},get:function(r){return Js&&r&&(typeof r=="object"||typeof r=="function")&&t?K0(t,r):e&&e.get(r)},has:function(r){return Js&&r&&(typeof r=="object"||typeof r=="function")&&t?Q0(t,r):!!e&&e.has(r)},set:function(r,n){Js&&r&&(typeof r=="object"||typeof r=="function")?(t||(t=new Js),Z0(t,r,n)):Qn&&(e||(e=Qn()),e.set(r,n))}};return i}:Qn,ey=Ys,iy=Wn,sy=Mg,ry=hd,ny=ty,ay=ny||ry||sy,oy=function(){var t,e={assert:function(i){if(!e.has(i))throw new ey("Side channel does not contain "+iy(i))},delete:function(i){return!!t&&t.delete(i)},get:function(i){return t&&t.get(i)},has:function(i){return!!t&&t.has(i)},set:function(i,r){t||(t=ay()),t.set(i,r)}};return e},hy=String.prototype.replace,ly=/%20/g,nh={RFC1738:"RFC1738",RFC3986:"RFC3986"},ah={default:nh.RFC3986,formatters:{RFC1738:function(s){return hy.call(s,ly,"+")},RFC3986:function(s){return String(s)}},RFC1738:nh.RFC1738,RFC3986:nh.RFC3986},cy=ah,oh=Object.prototype.hasOwnProperty,ps=Array.isArray,ei=function(){for(var s=[],t=0;t<256;++t)s.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return s}(),uy=function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(ps(i)){for(var r=[],n=0;n<i.length;++n)typeof i[n]<"u"&&r.push(i[n]);e.obj[e.prop]=r}}},ld=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},r=0;r<t.length;++r)typeof t[r]<"u"&&(i[r]=t[r]);return i},dy=function s(t,e,i){if(!e)return t;if(typeof e!="object"&&typeof e!="function"){if(ps(t))t.push(e);else if(t&&typeof t=="object")(i&&(i.plainObjects||i.allowPrototypes)||!oh.call(Object.prototype,e))&&(t[e]=!0);else return[t,e];return t}if(!t||typeof t!="object")return[t].concat(e);var r=t;return ps(t)&&!ps(e)&&(r=ld(t,i)),ps(t)&&ps(e)?(e.forEach(function(n,a){if(oh.call(t,a)){var o=t[a];o&&typeof o=="object"&&n&&typeof n=="object"?t[a]=s(o,n,i):t.push(n)}else t[a]=n}),t):Object.keys(e).reduce(function(n,a){var o=e[a];return oh.call(n,a)?n[a]=s(n[a],o,i):n[a]=o,n},r)},fy=function(t,e){return Object.keys(e).reduce(function(i,r){return i[r]=e[r],i},t)},py=function(s,t,e){var i=s.replace(/\+/g," ");if(e==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},hh=1024,my=function(t,e,i,r,n){if(t.length===0)return t;var a=t;if(typeof t=="symbol"?a=Symbol.prototype.toString.call(t):typeof t!="string"&&(a=String(t)),i==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var o="",h=0;h<a.length;h+=hh){for(var l=a.length>=hh?a.slice(h,h+hh):a,c=[],d=0;d<l.length;++d){var u=l.charCodeAt(d);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||n===cy.RFC1738&&(u===40||u===41)){c[c.length]=l.charAt(d);continue}if(u<128){c[c.length]=ei[u];continue}if(u<2048){c[c.length]=ei[192|u>>6]+ei[128|u&63];continue}if(u<55296||u>=57344){c[c.length]=ei[224|u>>12]+ei[128|u>>6&63]+ei[128|u&63];continue}d+=1,u=65536+((u&1023)<<10|l.charCodeAt(d)&1023),c[c.length]=ei[240|u>>18]+ei[128|u>>12&63]+ei[128|u>>6&63]+ei[128|u&63]}o+=c.join("")}return o},_y=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],r=0;r<e.length;++r)for(var n=e[r],a=n.obj[n.prop],o=Object.keys(a),h=0;h<o.length;++h){var l=o[h],c=a[l];typeof c=="object"&&c!==null&&i.indexOf(c)===-1&&(e.push({obj:a,prop:l}),i.push(c))}return uy(e),t},gy=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},yy=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},xy=function(t,e){return[].concat(t,e)},vy=function(t,e){if(ps(t)){for(var i=[],r=0;r<t.length;r+=1)i.push(e(t[r]));return i}return e(t)},cd={arrayToObject:ld,assign:fy,combine:xy,compact:_y,decode:py,encode:my,isBuffer:yy,isRegExp:gy,maybeMap:vy,merge:dy},ud=oy,Jn=cd,qr=ah,by=Object.prototype.hasOwnProperty,dd={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ii=Array.isArray,Ty=Array.prototype.push,fd=function(s,t){Ty.apply(s,ii(t)?t:[t])},wy=Date.prototype.toISOString,pd=qr.default,Xt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Jn.encode,encodeValuesOnly:!1,filter:void 0,format:pd,formatter:qr.formatters[pd],indices:!1,serializeDate:function(t){return wy.call(t)},skipNulls:!1,strictNullHandling:!1},Ey=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},lh={},Ay=function s(t,e,i,r,n,a,o,h,l,c,d,u,f,p,m,_,y,v){for(var g=t,x=v,b=0,w=!1;(x=x.get(lh))!==void 0&&!w;){var T=x.get(t);if(b+=1,typeof T<"u"){if(T===b)throw new RangeError("Cyclic object value");w=!0}typeof x.get(lh)>"u"&&(b=0)}if(typeof c=="function"?g=c(e,g):g instanceof Date?g=f(g):i==="comma"&&ii(g)&&(g=Jn.maybeMap(g,function(I){return I instanceof Date?f(I):I})),g===null){if(a)return l&&!_?l(e,Xt.encoder,y,"key",p):e;g=""}if(Ey(g)||Jn.isBuffer(g)){if(l){var E=_?e:l(e,Xt.encoder,y,"key",p);return[m(E)+"="+m(l(g,Xt.encoder,y,"value",p))]}return[m(e)+"="+m(String(g))]}var A=[];if(typeof g>"u")return A;var P;if(i==="comma"&&ii(g))_&&l&&(g=Jn.maybeMap(g,l)),P=[{value:g.length>0?g.join(",")||null:void 0}];else if(ii(c))P=c;else{var L=Object.keys(g);P=d?L.sort(d):L}var M=h?String(e).replace(/\./g,"%2E"):String(e),S=r&&ii(g)&&g.length===1?M+"[]":M;if(n&&ii(g)&&g.length===0)return S+"[]";for(var C=0;C<P.length;++C){var R=P[C],N=typeof R=="object"&&R&&typeof R.value<"u"?R.value:g[R];if(!(o&&N===null)){var F=u&&h?String(R).replace(/\./g,"%2E"):String(R),B=ii(g)?typeof i=="function"?i(S,F):S:S+(u?"."+F:"["+F+"]");v.set(t,b);var W=ud();W.set(lh,v),fd(A,s(N,B,i,r,n,a,o,h,i==="comma"&&_&&ii(g)?null:l,c,d,u,f,p,m,_,y,W))}}return A},Sy=function(t){if(!t)return Xt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var e=t.charset||Xt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=qr.default;if(typeof t.format<"u"){if(!by.call(qr.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var r=qr.formatters[i],n=Xt.filter;(typeof t.filter=="function"||ii(t.filter))&&(n=t.filter);var a;if(t.arrayFormat in dd?a=t.arrayFormat:"indices"in t?a=t.indices?"indices":"repeat":a=Xt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var o=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Xt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Xt.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Xt.allowEmptyArrays,arrayFormat:a,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Xt.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Xt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Xt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Xt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Xt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Xt.encodeValuesOnly,filter:n,format:i,formatter:r,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Xt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Xt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Xt.strictNullHandling}},Cy=function(s,t){var e=s,i=Sy(t),r,n;typeof i.filter=="function"?(n=i.filter,e=n("",e)):ii(i.filter)&&(n=i.filter,r=n);var a=[];if(typeof e!="object"||e===null)return"";var o=dd[i.arrayFormat],h=o==="comma"&&i.commaRoundTrip;r||(r=Object.keys(e)),i.sort&&r.sort(i.sort);for(var l=ud(),c=0;c<r.length;++c){var d=r[c],u=e[d];i.skipNulls&&u===null||fd(a,Ay(u,d,o,h,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,l))}var f=a.join(i.delimiter),p=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},ms=cd,ch=Object.prototype.hasOwnProperty,md=Array.isArray,Ot={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ms.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Py=function(s){return s.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},_d=function(s,t,e){if(s&&typeof s=="string"&&t.comma&&s.indexOf(",")>-1)return s.split(",");if(t.throwOnLimitExceeded&&e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return s},Ry="utf8=%26%2310003%3B",Iy="utf8=%E2%9C%93",My=function(t,e){var i={__proto__:null},r=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;r=r.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var n=e.parameterLimit===1/0?void 0:e.parameterLimit,a=r.split(e.delimiter,e.throwOnLimitExceeded?n+1:n);if(e.throwOnLimitExceeded&&a.length>n)throw new RangeError("Parameter limit exceeded. Only "+n+" parameter"+(n===1?"":"s")+" allowed.");var o=-1,h,l=e.charset;if(e.charsetSentinel)for(h=0;h<a.length;++h)a[h].indexOf("utf8=")===0&&(a[h]===Iy?l="utf-8":a[h]===Ry&&(l="iso-8859-1"),o=h,h=a.length);for(h=0;h<a.length;++h)if(h!==o){var c=a[h],d=c.indexOf("]="),u=d===-1?c.indexOf("="):d+1,f,p;u===-1?(f=e.decoder(c,Ot.decoder,l,"key"),p=e.strictNullHandling?null:""):(f=e.decoder(c.slice(0,u),Ot.decoder,l,"key"),p=ms.maybeMap(_d(c.slice(u+1),e,md(i[f])?i[f].length:0),function(_){return e.decoder(_,Ot.decoder,l,"value")})),p&&e.interpretNumericEntities&&l==="iso-8859-1"&&(p=Py(String(p))),c.indexOf("[]=")>-1&&(p=md(p)?[p]:p);var m=ch.call(i,f);m&&e.duplicates==="combine"?i[f]=ms.combine(i[f],p):(!m||e.duplicates==="last")&&(i[f]=p)}return i},Dy=function(s,t,e,i){var r=0;if(s.length>0&&s[s.length-1]==="[]"){var n=s.slice(0,-1).join("");r=Array.isArray(t)&&t[n]?t[n].length:0}for(var a=i?t:_d(t,e,r),o=s.length-1;o>=0;--o){var h,l=s[o];if(l==="[]"&&e.parseArrays)h=e.allowEmptyArrays&&(a===""||e.strictNullHandling&&a===null)?[]:ms.combine([],a);else{h=e.plainObjects?{__proto__:null}:{};var c=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,d=e.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(d,10);!e.parseArrays&&d===""?h={0:a}:!isNaN(u)&&l!==d&&String(u)===d&&u>=0&&e.parseArrays&&u<=e.arrayLimit?(h=[],h[u]=a):d!=="__proto__"&&(h[d]=a)}a=h}return a},By=function(t,e,i,r){if(t){var n=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,h=i.depth>0&&a.exec(n),l=h?n.slice(0,h.index):n,c=[];if(l){if(!i.plainObjects&&ch.call(Object.prototype,l)&&!i.allowPrototypes)return;c.push(l)}for(var d=0;i.depth>0&&(h=o.exec(n))!==null&&d<i.depth;){if(d+=1,!i.plainObjects&&ch.call(Object.prototype,h[1].slice(1,-1))&&!i.allowPrototypes)return;c.push(h[1])}if(h){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");c.push("["+n.slice(h.index)+"]")}return Dy(c,e,i,r)}},Oy=function(t){if(!t)return Ot;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=typeof t.charset>"u"?Ot.charset:t.charset,i=typeof t.duplicates>"u"?Ot.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var r=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Ot.allowDots:!!t.allowDots;return{allowDots:r,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ot.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Ot.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Ot.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Ot.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ot.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Ot.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Ot.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Ot.decoder,delimiter:typeof t.delimiter=="string"||ms.isRegExp(t.delimiter)?t.delimiter:Ot.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Ot.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Ot.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Ot.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Ot.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Ot.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ot.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},Fy=function(s,t){var e=Oy(t);if(s===""||s===null||typeof s>"u")return e.plainObjects?{__proto__:null}:{};for(var i=typeof s=="string"?My(s,e):s,r=e.plainObjects?{__proto__:null}:{},n=Object.keys(i),a=0;a<n.length;++a){var o=n[a],h=By(o,i[o],e,typeof s=="string");r=ms.merge(r,h,e)}return e.allowSparse===!0?r:ms.compact(r)},Ly=Cy,ky=Fy,Ny=ah,Uy={formats:Ny,parse:ky,stringify:Ly},Gy=q_;function Si(){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 Hy=/^([a-z0-9.+-]+:)/i,Vy=/:[0-9]*$/,Wy=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Xy=["<",">",'"',"`"," ","\r",`
|
|
5
|
+
`," "],$y=["{","}","|","\\","^","`"].concat(Xy),uh=["'"].concat($y),gd=["%","/","?",";","#"].concat(uh),yd=["/","?","#"],zy=255,xd=/^[+a-z0-9A-Z_-]{0,63}$/,Yy=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jy={javascript:!0,"javascript:":!0},dh={javascript:!0,"javascript:":!0},tr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},fh=Uy;function qy(s,t,e){if(s&&typeof s=="object"&&s instanceof Si)return s;var i=new Si;return i.parse(s,t,e),i}Si.prototype.parse=function(s,t,e){if(typeof s!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof s);var i=s.indexOf("?"),r=i!==-1&&i<s.indexOf("#")?"?":"#",n=s.split(r),a=/\\/g;n[0]=n[0].replace(a,"/"),s=n.join(r);var o=s;if(o=o.trim(),!e&&s.split("#").length===1){var h=Wy.exec(o);if(h)return this.path=o,this.href=o,this.pathname=h[1],h[2]?(this.search=h[2],t?this.query=fh.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var l=Hy.exec(o);if(l){l=l[0];var c=l.toLowerCase();this.protocol=c,o=o.substr(l.length)}if(e||l||o.match(/^\/\/[^@/]+@[^@/]+/)){var d=o.substr(0,2)==="//";d&&!(l&&dh[l])&&(o=o.substr(2),this.slashes=!0)}if(!dh[l]&&(d||l&&!tr[l])){for(var u=-1,f=0;f<yd.length;f++){var p=o.indexOf(yd[f]);p!==-1&&(u===-1||p<u)&&(u=p)}var m,_;u===-1?_=o.lastIndexOf("@"):_=o.lastIndexOf("@",u),_!==-1&&(m=o.slice(0,_),o=o.slice(_+1),this.auth=decodeURIComponent(m)),u=-1;for(var f=0;f<gd.length;f++){var p=o.indexOf(gd[f]);p!==-1&&(u===-1||p<u)&&(u=p)}u===-1&&(u=o.length),this.host=o.slice(0,u),o=o.slice(u),this.parseHost(),this.hostname=this.hostname||"";var y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y)for(var v=this.hostname.split(/\./),f=0,g=v.length;f<g;f++){var x=v[f];if(x&&!x.match(xd)){for(var b="",w=0,T=x.length;w<T;w++)x.charCodeAt(w)>127?b+="x":b+=x[w];if(!b.match(xd)){var E=v.slice(0,f),A=v.slice(f+1),P=x.match(Yy);P&&(E.push(P[1]),A.unshift(P[2])),A.length&&(o="/"+A.join(".")+o),this.hostname=E.join(".");break}}}this.hostname.length>zy?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=Gy.toASCII(this.hostname));var L=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+L,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!jy[c])for(var f=0,g=uh.length;f<g;f++){var S=uh[f];if(o.indexOf(S)!==-1){var C=encodeURIComponent(S);C===S&&(C=escape(S)),o=o.split(S).join(C)}}var R=o.indexOf("#");R!==-1&&(this.hash=o.substr(R),o=o.slice(0,R));var N=o.indexOf("?");if(N!==-1?(this.search=o.substr(N),this.query=o.substr(N+1),t&&(this.query=fh.parse(this.query)),o=o.slice(0,N)):t&&(this.search="",this.query={}),o&&(this.pathname=o),tr[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var L=this.pathname||"",F=this.search||"";this.path=L+F}return this.href=this.format(),this},Si.prototype.format=function(){var s=this.auth||"";s&&(s=encodeURIComponent(s),s=s.replace(/%3A/i,":"),s+="@");var t=this.protocol||"",e=this.pathname||"",i=this.hash||"",r=!1,n="";this.host?r=s+this.host:this.hostname&&(r=s+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(n=fh.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||n&&"?"+n||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||tr[t])&&r!==!1?(r="//"+(r||""),e&&e.charAt(0)!=="/"&&(e="/"+e)):r||(r=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),e=e.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),t+r+e+a+i},Si.prototype.resolve=function(s){return this.resolveObject(qy(s,!1,!0)).format()},Si.prototype.resolveObject=function(s){if(typeof s=="string"){var t=new Si;t.parse(s,!1,!0),s=t}for(var e=new Si,i=Object.keys(this),r=0;r<i.length;r++){var n=i[r];e[n]=this[n]}if(e.hash=s.hash,s.href==="")return e.href=e.format(),e;if(s.slashes&&!s.protocol){for(var a=Object.keys(s),o=0;o<a.length;o++){var h=a[o];h!=="protocol"&&(e[h]=s[h])}return tr[e.protocol]&&e.hostname&&!e.pathname&&(e.pathname="/",e.path=e.pathname),e.href=e.format(),e}if(s.protocol&&s.protocol!==e.protocol){if(!tr[s.protocol]){for(var l=Object.keys(s),c=0;c<l.length;c++){var d=l[c];e[d]=s[d]}return e.href=e.format(),e}if(e.protocol=s.protocol,!s.host&&!dh[s.protocol]){for(var g=(s.pathname||"").split("/");g.length&&!(s.host=g.shift()););s.host||(s.host=""),s.hostname||(s.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),e.pathname=g.join("/")}else e.pathname=s.pathname;if(e.search=s.search,e.query=s.query,e.host=s.host||"",e.auth=s.auth,e.hostname=s.hostname||s.host,e.port=s.port,e.pathname||e.search){var u=e.pathname||"",f=e.search||"";e.path=u+f}return e.slashes=e.slashes||s.slashes,e.href=e.format(),e}var p=e.pathname&&e.pathname.charAt(0)==="/",m=s.host||s.pathname&&s.pathname.charAt(0)==="/",_=m||p||e.host&&s.pathname,y=_,v=e.pathname&&e.pathname.split("/")||[],g=s.pathname&&s.pathname.split("/")||[],x=e.protocol&&!tr[e.protocol];if(x&&(e.hostname="",e.port=null,e.host&&(v[0]===""?v[0]=e.host:v.unshift(e.host)),e.host="",s.protocol&&(s.hostname=null,s.port=null,s.host&&(g[0]===""?g[0]=s.host:g.unshift(s.host)),s.host=null),_=_&&(g[0]===""||v[0]==="")),m)e.host=s.host||s.host===""?s.host:e.host,e.hostname=s.hostname||s.hostname===""?s.hostname:e.hostname,e.search=s.search,e.query=s.query,v=g;else if(g.length)v||(v=[]),v.pop(),v=v.concat(g),e.search=s.search,e.query=s.query;else if(s.search!=null){if(x){e.host=v.shift(),e.hostname=e.host;var b=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;b&&(e.auth=b.shift(),e.hostname=b.shift(),e.host=e.hostname)}return e.search=s.search,e.query=s.query,(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!v.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var w=v.slice(-1)[0],T=(e.host||s.host||v.length>1)&&(w==="."||w==="..")||w==="",E=0,A=v.length;A>=0;A--)w=v[A],w==="."?v.splice(A,1):w===".."?(v.splice(A,1),E++):E&&(v.splice(A,1),E--);if(!_&&!y)for(;E--;E)v.unshift("..");_&&v[0]!==""&&(!v[0]||v[0].charAt(0)!=="/")&&v.unshift(""),T&&v.join("/").substr(-1)!=="/"&&v.push("");var P=v[0]===""||v[0]&&v[0].charAt(0)==="/";if(x){e.hostname=P?"":v.length?v.shift():"",e.host=e.hostname;var b=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;b&&(e.auth=b.shift(),e.hostname=b.shift(),e.host=e.hostname)}return _=_||e.host&&v.length,_&&!P&&v.unshift(""),v.length>0?e.pathname=v.join("/"):(e.pathname=null,e.path=null),(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=s.auth||e.auth,e.slashes=e.slashes||s.slashes,e.href=e.format(),e},Si.prototype.parseHost=function(){var s=this.host,t=Vy.exec(s);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),s=s.substr(0,s.length-t.length)),s&&(this.hostname=s)};const vd={};function it(s,t,e=3){if(vd[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t}
|
|
6
6
|
Deprecated since v${s}`):(i=i.split(`
|
|
7
7
|
`).splice(e).join(`
|
|
8
8
|
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t}
|
|
9
9
|
Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t}
|
|
10
|
-
Deprecated since v${s}`),console.warn(i))),fd[t]=!0}function Ue(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function qr(s){return s.split("?")[0].split("#")[0]}function ky(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ny(s,t,e){return s.replace(new RegExp(ky(t),"g"),e)}function Uy(s,t){let e="",i=0,r=-1,n=0,a=-1;for(let o=0;o<=s.length;++o){if(o<s.length)a=s.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||i!==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="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),r=o,n=0;continue}}else if(e.length===2||e.length===1){e="",i=0,r=o,n=0;continue}}t&&(e.length>0?e+="/..":e="..",i=2)}else e.length>0?e+=`/${s.slice(r+1,o)}`:e=s.slice(r+1,o),i=o-r-1;r=o,n=0}else a===46&&n!==-1?++n:n=-1}return e}const zt={toPosix(s){return Ny(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){Ue(s),s=this.toPosix(s);const t=/^file:\/\/\//.exec(s);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(s);return e?e[0]:""},toAbsolute(s,t,e){if(Ue(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=qr(this.toPosix(t??H.ADAPTER.getBaseUrl())),r=qr(this.toPosix(e??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?zt.join(r,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(Ue(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let t="";const e=s.startsWith("/");this.hasProtocol(s)&&(t=this.rootname(s),s=s.slice(t.length));const i=s.endsWith("/");return s=Uy(s,!1),s.length>0&&i&&(s+="/"),e?`/${s}`:t+s},isAbsolute(s){return Ue(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let t;for(let e=0;e<s.length;++e){const i=s[e];if(Ue(i),i.length>0)if(t===void 0)t=i;else{const r=s[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(s){if(Ue(s),s.length===0)return".";s=this.toPosix(s);let t=s.charCodeAt(0);const e=t===47;let i=-1,r=!0;const n=this.getProtocol(s),a=s;s=s.slice(n.length);for(let o=s.length-1;o>=1;--o)if(t=s.charCodeAt(o),t===47){if(!r){i=o;break}}else r=!1;return i===-1?e?"/":this.isUrl(a)?n+s:n:e&&i===1?"//":n+s.slice(0,i)},rootname(s){Ue(s),s=this.toPosix(s);let t="";if(s.startsWith("/")?t="/":t=this.getProtocol(s),this.isUrl(s)){const e=s.indexOf("/",t.length);e!==-1?t=s.slice(0,e):t=s,t.endsWith("/")||(t+="/")}return t},basename(s,t){Ue(s),t&&Ue(t),s=qr(this.toPosix(s));let e=0,i=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=s.length){if(t.length===s.length&&t===s)return"";let a=t.length-1,o=-1;for(n=s.length-1;n>=0;--n){const h=s.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&&(i=n):(a=-1,i=o))}return e===i?i=o:i===-1&&(i=s.length),s.slice(e,i)}for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!r){e=n+1;break}}else i===-1&&(r=!1,i=n+1);return i===-1?"":s.slice(e,i)},extname(s){Ue(s),s=qr(this.toPosix(s));let t=-1,e=0,i=-1,r=!0,n=0;for(let a=s.length-1;a>=0;--a){const o=s.charCodeAt(a);if(o===47){if(!r){e=a+1;break}continue}i===-1&&(r=!1,i=a+1),o===46?t===-1?t=a:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||i===-1||n===0||n===1&&t===i-1&&t===e+1?"":s.slice(t,i)},parse(s){Ue(s);const t={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return t;s=qr(this.toPosix(s));let e=s.charCodeAt(0);const i=this.isAbsolute(s);let r;t.root=this.rootname(s),i||this.hasProtocol(s)?r=1:r=0;let n=-1,a=0,o=-1,h=!0,l=s.length-1,c=0;for(;l>=r;--l){if(e=s.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&&i?t.base=t.name=s.slice(1,o):t.base=t.name=s.slice(a,o)):(a===0&&i?(t.name=s.slice(1,n),t.base=s.slice(1,o)):(t.name=s.slice(a,n),t.base=s.slice(a,o)),t.ext=s.slice(n,o)),t.dir=this.dirname(s),t},sep:"/",delimiter:":",joinExtensions:[".html"]};let lh;async function Gy(){return lh??(lh=(async()=>{var n;const s=document.createElement("canvas").getContext("webgl");if(!s)return he.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 he.UNPACK;const e=s.createTexture();s.bindTexture(s.TEXTURE_2D,e);const i=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,i),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e,0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t);const r=new Uint8Array(4);return s.readPixels(0,0,1,1,s.RGBA,s.UNSIGNED_BYTE,r),s.deleteFramebuffer(i),s.deleteTexture(e),(n=s.getExtension("WEBGL_lose_context"))==null||n.loseContext(),r[0]<=r[3]?he.PMA:he.UNPACK})()),lh}let ch;function Hy(){return typeof ch>"u"&&(ch=function(){var t;const s={stencil:!0,failIfMajorPerformanceCaveat:H.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!H.ADAPTER.getWebGLRenderingContext())return!1;const e=H.ADAPTER.createCanvas();let i=e.getContext("webgl",s)||e.getContext("experimental-webgl",s);const r=!!((t=i==null?void 0:i.getContextAttributes())!=null&&t.stencil);if(i){const n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch{return!1}}()),ch}var Vy={grad:.9,turn:360,rad:360/(2*Math.PI)},Si=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},$t=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*s)/e+0},Pe=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),s>e?e:s>t?s:t},pd=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},md=function(s){return{r:Pe(s.r,0,255),g:Pe(s.g,0,255),b:Pe(s.b,0,255),a:Pe(s.a)}},uh=function(s){return{r:$t(s.r),g:$t(s.g),b:$t(s.b),a:$t(s.a,3)}},Wy=/^#([0-9a-f]{3,8})$/i,Qn=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},gd=function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=Math.max(t,e,i),a=n-Math.min(t,e,i),o=a?n===t?(e-i)/a:n===e?2+(i-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}},_d=function(s){var t=s.h,e=s.s,i=s.v,r=s.a;t=t/360*6,e/=100,i/=100;var n=Math.floor(t),a=i*(1-e),o=i*(1-(t-n)*e),h=i*(1-(1-t+n)*e),l=n%6;return{r:255*[i,o,a,a,h,i][l],g:255*[h,i,i,o,a,a][l],b:255*[a,a,h,i,i,o][l],a:r}},yd=function(s){return{h:pd(s.h),s:Pe(s.s,0,100),l:Pe(s.l,0,100),a:Pe(s.a)}},xd=function(s){return{h:$t(s.h),s:$t(s.s),l:$t(s.l),a:$t(s.a,3)}},vd=function(s){return _d((e=(t=s).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Kr=function(s){return{h:(t=gd(s)).h,s:(r=(200-(e=t.s))*(i=t.v)/100)>0&&r<200?e*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,i,r},Xy=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zy=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$y=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yy=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dh={string:[[function(s){var t=Wy.exec(s);return t?(s=t[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?$t(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?$t(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var t=$y.exec(s)||Yy.exec(s);return t?t[2]!==t[4]||t[4]!==t[6]?null:md({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(s){var t=Xy.exec(s)||zy.exec(s);if(!t)return null;var e,i,r=yd({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(Vy[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return vd(r)},"hsl"]],object:[[function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=r===void 0?1:r;return Si(t)&&Si(e)&&Si(i)?md({r:Number(t),g:Number(e),b:Number(i),a:Number(n)}):null},"rgb"],[function(s){var t=s.h,e=s.s,i=s.l,r=s.a,n=r===void 0?1:r;if(!Si(t)||!Si(e)||!Si(i))return null;var a=yd({h:Number(t),s:Number(e),l:Number(i),a:Number(n)});return vd(a)},"hsl"],[function(s){var t=s.h,e=s.s,i=s.v,r=s.a,n=r===void 0?1:r;if(!Si(t)||!Si(e)||!Si(i))return null;var a=function(o){return{h:pd(o.h),s:Pe(o.s,0,100),v:Pe(o.v,0,100),a:Pe(o.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(n)});return _d(a)},"hsv"]]},bd=function(s,t){for(var e=0;e<t.length;e++){var i=t[e][0](s);if(i)return[i,t[e][1]]}return[null,void 0]},jy=function(s){return typeof s=="string"?bd(s.trim(),dh.string):typeof s=="object"&&s!==null?bd(s,dh.object):[null,void 0]},fh=function(s,t){var e=Kr(s);return{h:e.h,s:Pe(e.s+100*t,0,100),l:e.l,a:e.a}},ph=function(s){return(299*s.r+587*s.g+114*s.b)/1e3/255},Td=function(s,t){var e=Kr(s);return{h:e.h,s:e.s,l:Pe(e.l+100*t,0,100),a:e.a}},mh=function(){function s(t){this.parsed=jy(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return s.prototype.isValid=function(){return this.parsed!==null},s.prototype.brightness=function(){return $t(ph(this.rgba),2)},s.prototype.isDark=function(){return ph(this.rgba)<.5},s.prototype.isLight=function(){return ph(this.rgba)>=.5},s.prototype.toHex=function(){return t=uh(this.rgba),e=t.r,i=t.g,r=t.b,a=(n=t.a)<1?Qn($t(255*n)):"","#"+Qn(e)+Qn(i)+Qn(r)+a;var t,e,i,r,n,a},s.prototype.toRgb=function(){return uh(this.rgba)},s.prototype.toRgbString=function(){return t=uh(this.rgba),e=t.r,i=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+i+", "+r+", "+n+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,n},s.prototype.toHsl=function(){return xd(Kr(this.rgba))},s.prototype.toHslString=function(){return t=xd(Kr(this.rgba)),e=t.h,i=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+n+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,n},s.prototype.toHsv=function(){return t=gd(this.rgba),{h:$t(t.h),s:$t(t.s),v:$t(t.v),a:$t(t.a,3)};var t},s.prototype.invert=function(){return ii({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},s.prototype.saturate=function(t){return t===void 0&&(t=.1),ii(fh(this.rgba,t))},s.prototype.desaturate=function(t){return t===void 0&&(t=.1),ii(fh(this.rgba,-t))},s.prototype.grayscale=function(){return ii(fh(this.rgba,-1))},s.prototype.lighten=function(t){return t===void 0&&(t=.1),ii(Td(this.rgba,t))},s.prototype.darken=function(t){return t===void 0&&(t=.1),ii(Td(this.rgba,-t))},s.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},s.prototype.alpha=function(t){return typeof t=="number"?ii({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):$t(this.rgba.a,3);var e},s.prototype.hue=function(t){var e=Kr(this.rgba);return typeof t=="number"?ii({h:t,s:e.s,l:e.l,a:e.a}):$t(e.h)},s.prototype.isEqual=function(t){return this.toHex()===ii(t).toHex()},s}(),ii=function(s){return s instanceof mh?s:new mh(s)},wd=[],qy=function(s){s.forEach(function(t){wd.indexOf(t)<0&&(t(mh,dh),wd.push(t))})};function Ky(s,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"},i={};for(var r in e)i[e[r]]=r;var n={};s.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,h,l=i[this.toHex()];if(l)return l;if(a!=null&&a.closest){var c=this.toRgb(),d=1/0,u="black";if(!n.length)for(var f in e)n[f]=new s(e[f]).toRgb();for(var p in e){var m=(o=c,h=n[p],Math.pow(o.r-h.r,2)+Math.pow(o.g-h.g,2)+Math.pow(o.b-h.b,2));m<d&&(d=m,u=p)}return u}},t.string.push([function(a){var o=a.toLowerCase(),h=o==="transparent"?"#0000":e[o];return h?new s(h).toRgb():null},"name"])}qy([Ky]);const tr=class po{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 po)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 i=typeof t;if(i!==typeof e)return!1;if(i==="number"||i==="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,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toRgbArray(t){t=t??[];const[e,i,r]=this._components;return t[0]=e,t[1]=i,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,i,r,n]=po.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,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 i=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(i=i*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(i<<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,i,r]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(i*t)/t,this._components[2]=Math.round(r*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,i,r,n]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}normalize(t){let e,i,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const a=t;e=(a>>16&255)/255,i=(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,i,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,i,r,n=255]=t,e/=255,i/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const o=po.HEX_PATTERN.exec(t);o&&(t=`#${o[2]}`)}const a=ii(t);a.isValid()&&({r:e,g:i,b:r,a:n}=a.rgba,e/=255,i/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,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,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),i)}),t)}};tr.shared=new tr,tr.temp=new tr,tr.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let ft=tr;function Ed(s,t=[]){return it("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),ft.shared.setValue(s).toRgbArray(t)}function Zy(s){return it("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),ft.shared.setValue(s).toHex()}function Zr(s){return it("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),ft.shared.setValue(s).toNumber()}function Qy(){const s=[],t=[];for(let i=0;i<32;i++)s[i]=i,t[i]=i;s[K.NORMAL_NPM]=K.NORMAL,s[K.ADD_NPM]=K.ADD,s[K.SCREEN_NPM]=K.SCREEN,t[K.NORMAL]=K.NORMAL_NPM,t[K.ADD]=K.ADD_NPM,t[K.SCREEN]=K.SCREEN_NPM;const e=[];return e.push(t),e.push(s),e}const Ad=Qy();function Sd(s,t){return Ad[t?1:0][s]}function Jy(s,t=null){const e=s*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 i=0,r=0;i<e;i+=6,r+=4)t[i+0]=r+0,t[i+1]=r+1,t[i+2]=r+2,t[i+3]=r+0,t[i+4]=r+2,t[i+5]=r+3;return t}function Cd(s){if(s.BYTES_PER_ELEMENT===4)return s instanceof Float32Array?"Float32Array":s instanceof Uint32Array?"Uint32Array":"Int32Array";if(s.BYTES_PER_ELEMENT===2){if(s instanceof Uint16Array)return"Uint16Array"}else if(s.BYTES_PER_ELEMENT===1&&s instanceof Uint8Array)return"Uint8Array";return null}function Jn(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Pd(s){return!(s&s-1)&&!!s}function Rd(s){let t=(s>65535?1:0)<<4;s>>>=t;let e=(s>255?1:0)<<3;return s>>>=e,t|=e,e=(s>15?1:0)<<2,s>>>=e,t|=e,e=(s>3?1:0)<<1,s>>>=e,t|=e,t|s>>1}function er(s,t,e){const i=s.length;let r;if(t>=i||e===0)return;e=t+e>i?i-t:e;const n=i-e;for(r=t;r<n;++r)s[r]=s[r+e];s.length=n}function Hi(s){return s===0?0:s<0?-1:1}let tx=0;function ms(){return++tx}const gh=class{constructor(s,t,e,i){this.left=s,this.top=t,this.right=e,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};gh.EMPTY=new gh(0,0,0,0);let Id=gh;const Md={},si=Object.create(null),Vi=Object.create(null);class ex{constructor(t,e,i){this._canvas=H.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=i||H.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 Dd(s,t,e){for(let i=0,r=4*e*t;i<t;++i,r+=4)if(s[r+3]!==0)return!1;return!0}function Bd(s,t,e,i,r){const n=4*t;for(let a=i,o=i*n+4*e;a<=r;++a,o+=n)if(s[o+3]!==0)return!1;return!0}function ix(s){const{width:t,height:e}=s,i=s.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const r=i.getImageData(0,0,t,e).data;let n=0,a=0,o=t-1,h=e-1;for(;a<e&&Dd(r,t,a);)++a;if(a===e)return Id.EMPTY;for(;Dd(r,t,h);)--h;for(;Bd(r,t,n,a,h);)++n;for(;Bd(r,t,o,a,h);)--o;return++o,++h,new Id(n,a,o,h)}function sx(s){const t=ix(s),{width:e,height:i}=t;let r=null;if(!t.isEmpty()){const n=s.getContext("2d");if(n===null)throw new TypeError("Failed to get canvas 2D context");r=n.getImageData(t.left,t.top,e,i)}return{width:e,height:i,data:r}}function rx(s,t=globalThis.location){if(s.startsWith("data:"))return"";t=t||globalThis.location;const e=new URL(s,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function Ci(s,t=1){var i;const e=(i=H.RETINA_PREFIX)==null?void 0:i.exec(s);return e?parseFloat(e[1]):t}var G=(s=>(s.Renderer="renderer",s.Application="application",s.RendererSystem="renderer-webgl-system",s.RendererPlugin="renderer-webgl-plugin",s.CanvasRendererSystem="renderer-canvas-system",s.CanvasRendererPlugin="renderer-canvas-plugin",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s))(G||{});const _h=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},Od=(s,t)=>_h(s).priority??t,Y={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(_h).forEach(t=>{t.type.forEach(e=>{var i,r;return(r=(i=this._removeHandlers)[e])==null?void 0:r.call(i,t)})}),this},add(...s){return s.map(_h).forEach(t=>{t.type.forEach(e=>{var n,a;const i=this._addHandlers,r=this._queue;i[e]?(n=i[e])==null||n.call(i,t):(r[e]=r[e]||[],(a=r[e])==null||a.push(t))})}),this},handle(s,t,e){var a;const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&((a=n[s])==null||a.forEach(o=>t(o)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>Od(n,e)-Od(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})}};class yh{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 nx=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
11
|
-
`);function
|
|
12
|
-
else `),e<s-1&&(t+=`if(test == ${e}.0){}`);return t}function ox(s,t){if(s===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const e=t.createShader(t.FRAGMENT_SHADER);for(;;){const i=nx.replace(/%forloop%/gi,ax(s));if(t.shaderSource(e,i),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))s=s/2|0;else break}return s}const xh=0,vh=1,bh=2,Th=3,wh=4,Eh=5;class ri{constructor(){this.data=0,this.blendMode=K.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<xh)}set blend(t){!!(this.data&1<<xh)!==t&&(this.data^=1<<xh)}get offsets(){return!!(this.data&1<<vh)}set offsets(t){!!(this.data&1<<vh)!==t&&(this.data^=1<<vh)}get culling(){return!!(this.data&1<<bh)}set culling(t){!!(this.data&1<<bh)!==t&&(this.data^=1<<bh)}get depthTest(){return!!(this.data&1<<Th)}set depthTest(t){!!(this.data&1<<Th)!==t&&(this.data^=1<<Th)}get depthMask(){return!!(this.data&1<<Eh)}set depthMask(t){!!(this.data&1<<Eh)!==t&&(this.data^=1<<Eh)}get clockwiseFrontFace(){return!!(this.data&1<<wh)}set clockwiseFrontFace(t){!!(this.data&1<<wh)!==t&&(this.data^=1<<wh)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==K.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new ri;return t.depthTest=!1,t.blend=!0,t}}ri.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const Ah=[];function Fd(s,t){if(!s)return null;let e="";if(typeof s=="string"){const i=/\.(\w{3,4})(?:$|\?|#)/i.exec(s);i&&(e=i[1].toLowerCase())}for(let i=Ah.length-1;i>=0;--i){const r=Ah[i];if(r.test&&r.test(s,e))return new r(s,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class Ge{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,i,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 d=0,u=c.length;d<u;d++)c[d][l](t,e,i,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(Ge.prototype,{dispatch:{value:Ge.prototype.emit},run:{value:Ge.prototype.emit}});class Qr{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ge("setRealSize"),this.onUpdate=new Ge("update"),this.onError=new Ge("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,i){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 ta extends Qr{constructor(t,e){const{width:i,height:r}=e||{};if(!i||!r)throw new Error("BufferResource width or height invalid");super(i,r),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,i){const r=t.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,this.unpackAlignment),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===he.UNPACK);const n=e.realWidth,a=e.realHeight;return i.width===n&&i.height===a?r.texSubImage2D(e.target,0,0,0,n,a,e.format,i.type,this.data):(i.width=n,i.height=a,r.texImage2D(e.target,0,i.internalFormat,n,a,0,e.format,i.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 hx={scaleMode:bi.NEAREST,alphaMode:he.NPM},Sh=class Dr extends kr{constructor(t=null,e=null){super(),e=Object.assign({},Dr.defaultOptions,e);const{alphaMode:i,mipmap:r,anisotropicLevel:n,scaleMode:a,width:o,height:h,wrapMode:l,format:c,type:d,target:u,resolution:f,resourceOptions:p}=e;t&&!(t instanceof Qr)&&(t=Fd(t,p),t.internal=!0),this.resolution=f||H.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=d,this.target=u,this.alphaMode=i,this.uid=ms(),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 i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this}setSize(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)}setRealSize(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Pd(this.realWidth)&&Pd(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 Vi[this.cacheId],delete si[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Dr.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,i=H.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}_${ms()}`}n=t._pixiId}let a=Vi[n];if(r&&i&&!a)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return a||(a=new Dr(t,e),a.cacheId=n,Dr.addToCache(a,n)),a}static fromBuffer(t,e,i,r){t=t||new Float32Array(e*i*4);const n=new ta(t,{width:e,height:i,...r==null?void 0:r.resourceOptions});let a,o;return t instanceof Float32Array?(a=O.RGBA,o=Z.FLOAT):t instanceof Int32Array?(a=O.RGBA_INTEGER,o=Z.INT):t instanceof Uint32Array?(a=O.RGBA_INTEGER,o=Z.UNSIGNED_INT):t instanceof Int16Array?(a=O.RGBA_INTEGER,o=Z.SHORT):t instanceof Uint16Array?(a=O.RGBA_INTEGER,o=Z.UNSIGNED_SHORT):t instanceof Int8Array?(a=O.RGBA,o=Z.BYTE):(a=O.RGBA,o=Z.UNSIGNED_BYTE),n.internal=!0,new Dr(n,Object.assign({},hx,{type:o,format:a},r))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Vi[e]&&Vi[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Vi[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Vi[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Vi[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Vi[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};Sh.defaultOptions={mipmap:Ke.POW2,anisotropicLevel:0,scaleMode:bi.LINEAR,wrapMode:Ni.CLAMP,alphaMode:he.UNPACK,target:Ws.TEXTURE_2D,format:O.RGBA,type:Z.UNSIGNED_BYTE},Sh._globalBatch=0;let J=Sh;class Ch{constructor(){this.texArray=null,this.blend=0,this.type=Ne.TRIANGLES,this.start=0,this.size=0,this.data=null}}let lx=0;class kt{constructor(t,e=!0,i=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=lx++,this.disposeRunner=new Ge("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?Qe.ELEMENT_ARRAY_BUFFER:Qe.ARRAY_BUFFER}get index(){return this.type===Qe.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new kt(t)}}class ea{constructor(t,e=0,i=!1,r=Z.FLOAT,n,a,o,h=1){this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=a,this.instance=o,this.divisor=h}destroy(){this.buffer=null}static from(t,e,i,r,n){return new ea(t,e,i,r,n)}}const cx={Float32Array,Uint32Array,Int32Array,Uint8Array};function ux(s,t){let e=0,i=0;const r={};for(let h=0;h<s.length;h++)i+=t[h],e+=s[h].length;const n=new ArrayBuffer(e*4);let a=null,o=0;for(let h=0;h<s.length;h++){const l=t[h],c=s[h],d=Cd(c);r[d]||(r[d]=new cx[d](n)),a=r[d];for(let u=0;u<c.length;u++){const f=(u/l|0)*i+o,p=u%l;a[f+p]=c[u]}o+=l}return new Float32Array(n)}const Ld={5126:4,5123:2,5121:1};let dx=0;const fx={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Wi{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=dx++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Ge("disposeGeometry"),this.refCount=0}addAttribute(t,e,i=0,r=!1,n,a,o,h=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof kt||(e instanceof Array&&(e=new Float32Array(e)),e=new kt(e));const l=t.split("|");if(l.length>1){for(let d=0;d<l.length;d++)this.addAttribute(l[d],e,i,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 ea(c,i,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 kt||(t instanceof Array&&(t=new Uint16Array(t)),t=new kt(t)),t.type=Qe.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=[],i=new kt;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*Ld[n.type]/4),n.buffer=0}for(i.data=ux(t,e),r=0;r<this.buffers.length;r++)this.buffers[r]!==this.indexBuffer&&this.buffers[r].destroy();return this.buffers=[i],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 Wi;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new kt(this.buffers[e].data.slice(0));for(const e in this.attributes){const i=this.attributes[e];t.attributes[e]=new ea(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=Qe.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new Wi,i=[],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++)i[o]=new fx[Cd(a.buffers[o].data)](r[o]),e.buffers[o]=new kt(i[o]);for(let o=0;o<t.length;o++){a=t[o];for(let h=0;h<a.buffers.length;h++)i[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=Qe.ELEMENT_ARRAY_BUFFER;let o=0,h=0,l=0,c=0;for(let d=0;d<a.buffers.length;d++)if(a.buffers[d]!==a.indexBuffer){c=d;break}for(const d in a.attributes){const u=a.attributes[d];(u.buffer|0)===c&&(h+=u.size*Ld[u.type]/4)}for(let d=0;d<t.length;d++){const u=t[d].indexBuffer.data;for(let f=0;f<u.length;f++)e.indexBuffer.data[f+l]+=o;o+=t[d].buffers[c].data.length/h,l+=u.length}}return e}}class kd extends Wi{constructor(t=!1){super(),this._buffer=new kt(null,t,!1),this._indexBuffer=new kt(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Z.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Z.FLOAT).addAttribute("aColor",this._buffer,4,!0,Z.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Z.FLOAT).addIndex(this._indexBuffer)}}const ia=Math.PI*2,px=180/Math.PI,Ph=Math.PI/180;var Zt=(s=>(s[s.POLY=0]="POLY",s[s.RECT=1]="RECT",s[s.CIRC=2]="CIRC",s[s.ELIP=3]="ELIP",s[s.RREC=4]="RREC",s))(Zt||{});class tt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new tt(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}}tt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const sa=[new tt,new tt,new tt,new tt];let st=class Nc{constructor(t=0,e=0,i=0,r=0){this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=Zt.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 Nc(0,0,0,0)}clone(){return new Nc(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 i=this.left,r=this.right,n=this.top,a=this.bottom;if(r<=i||a<=n)return!1;const o=sa[0].set(t.left,t.top),h=sa[1].set(t.left,t.bottom),l=sa[2].set(t.right,t.top),c=sa[3].set(t.right,t.bottom);if(l.x<=o.x||h.y<=o.y)return!1;const d=Math.sign(e.a*e.d-e.b*e.c);if(d===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)<=i||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 u=d*(h.y-o.y),f=d*(o.x-h.x),p=u*i+f*n,m=u*r+f*n,g=u*i+f*a,y=u*r+f*a;if(Math.max(p,m,g,y)<=u*o.x+f*o.y||Math.min(p,m,g,y)>=u*c.x+f*c.y)return!1;const v=d*(o.y-l.y),_=d*(l.x-o.x),x=v*i+_*n,b=v*r+_*n,w=v*i+_*a,T=v*r+_*a;return!(Math.max(x,b,w,T)<=v*o.x+_*o.y||Math.min(x,b,w,T)>=v*c.x+_*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),i=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(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=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=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=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=i-e,this.y=r,this.height=n-r,this}};st.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class ra{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.radius=i,this.type=Zt.CIRC}clone(){return new ra(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i}getBounds(){return new st(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}ra.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class na{constructor(t=0,e=0,i=0,r=0){this.x=t,this.y=e,this.width=i,this.height=r,this.type=Zt.ELIP}clone(){return new na(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let i=(t-this.x)/this.width,r=(e-this.y)/this.height;return i*=i,r*=r,i+r<=1}getBounds(){return new st(this.x-this.width,this.y-this.height,this.width,this.height)}}na.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Xi{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let r=0,n=e.length;r<n;r++)i.push(e[r].x,e[r].y);e=i}this.points=e,this.type=Zt.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new Xi(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let i=!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&&(i=!i)}return i}}Xi.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,t)=>`${s}, ${t}`,"")}]`};class aa{constructor(t=0,e=0,i=0,r=0,n=20){this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=Zt.RREC}clone(){return new aa(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 i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=e-(this.y+i);const a=i*i;if(r*r+n*n<=a||(r=t-(this.x+this.width-i),r*r+n*n<=a)||(n=e-(this.y+this.height-i),r*r+n*n<=a)||(r=t-(this.x+i),r*r+n*n<=a))return!0}return!1}}aa.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class gt{constructor(t=1,e=0,i=0,r=1,n=0,a=0){this.array=null,this.a=t,this.b=e,this.c=i,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,i,r,n,a){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=a,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new tt;const i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e}applyInverse(t,e){e=e||new tt;const i=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*i*r+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,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),i=Math.sin(t),r=this.a,n=this.c,a=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=a*e-this.ty*i,this.ty=a*i+this.ty*e,this}append(t){const e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this}setTransform(t,e,i,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-(i*this.a+r*this.c),this.ty=e-(i*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 i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*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,i=this.b,r=this.c,n=this.d,a=t.pivot,o=-Math.atan2(-r,n),h=Math.atan2(i,e),l=Math.abs(o+h);return l<1e-5||Math.abs(ia-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+i*i),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*i+a.y*n),t}invert(){const t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,a=t*r-e*i;return this.a=r/a,this.b=-e/a,this.c=-i/a,this.d=t/a,this.tx=(i*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 gt;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 gt}static get TEMP_MATRIX(){return new gt}}gt.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 gs=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],_s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ys=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],xs=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Rh=[],Nd=[],oa=Math.sign;function mx(){for(let s=0;s<16;s++){const t=[];Rh.push(t);for(let e=0;e<16;e++){const i=oa(gs[s]*gs[e]+ys[s]*_s[e]),r=oa(_s[s]*gs[e]+xs[s]*_s[e]),n=oa(gs[s]*ys[e]+ys[s]*xs[e]),a=oa(_s[s]*ys[e]+xs[s]*xs[e]);for(let o=0;o<16;o++)if(gs[o]===i&&_s[o]===r&&ys[o]===n&&xs[o]===a){t.push(o);break}}}for(let s=0;s<16;s++){const t=new gt;t.set(gs[s],_s[s],ys[s],xs[s],0,0),Nd.push(t)}}mx();const Et={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:s=>gs[s],uY:s=>_s[s],vX:s=>ys[s],vY:s=>xs[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>Rh[s][t],sub:(s,t)=>Rh[s][Et.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?Et.S:Et.N:Math.abs(t)*2<=Math.abs(s)?s>0?Et.E:Et.W:t>0?s>0?Et.SE:Et.SW:s>0?Et.NE:Et.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=Nd[Et.inv(t)];r.tx=e,r.ty=i,s.append(r)}};class ni{constructor(t,e,i=0,r=0){this._x=i,this._y=r,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new ni(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))}}ni.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Ih=class{constructor(){this.worldTransform=new gt,this.localTransform=new gt,this.position=new ni(this.onChange,this,0,0),this.scale=new ni(this.onChange,this,1,1),this.pivot=new ni(this.onChange,this,0,0),this.skew=new ni(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 s=this.localTransform;this._localID!==this._currentLocalID&&(s.a=this._cx*this.scale.x,s.b=this._sx*this.scale.x,s.c=this._cy*this.scale.y,s.d=this._sy*this.scale.y,s.tx=this.position.x-(this.pivot.x*s.a+this.pivot.y*s.c),s.ty=this.position.y-(this.pivot.x*s.b+this.pivot.y*s.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(s){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!==s._worldID){const e=s.worldTransform,i=this.worldTransform;i.a=t.a*e.a+t.b*e.c,i.b=t.a*e.b+t.b*e.d,i.c=t.c*e.a+t.d*e.c,i.d=t.c*e.b+t.d*e.d,i.tx=t.tx*e.a+t.ty*e.c+e.tx,i.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=s._worldID,this._worldID++}}setFromMatrix(s){s.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(s){this._rotation!==s&&(this._rotation=s,this.updateSkew())}};Ih.IDENTITY=new Ih;let ha=Ih;ha.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 gx=`varying vec2 vTextureCoord;
|
|
10
|
+
Deprecated since v${s}`),console.warn(i))),vd[t]=!0}function Ge(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function Kr(s){return s.split("?")[0].split("#")[0]}function Ky(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zy(s,t,e){return s.replace(new RegExp(Ky(t),"g"),e)}function Qy(s,t){let e="",i=0,r=-1,n=0,a=-1;for(let o=0;o<=s.length;++o){if(o<s.length)a=s.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||i!==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="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),r=o,n=0;continue}}else if(e.length===2||e.length===1){e="",i=0,r=o,n=0;continue}}t&&(e.length>0?e+="/..":e="..",i=2)}else e.length>0?e+=`/${s.slice(r+1,o)}`:e=s.slice(r+1,o),i=o-r-1;r=o,n=0}else a===46&&n!==-1?++n:n=-1}return e}const Ft={toPosix(s){return Zy(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){Ge(s),s=this.toPosix(s);const t=/^file:\/\/\//.exec(s);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(s);return e?e[0]:""},toAbsolute(s,t,e){if(Ge(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=Kr(this.toPosix(t??H.ADAPTER.getBaseUrl())),r=Kr(this.toPosix(e??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?Ft.join(r,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(Ge(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let t="";const e=s.startsWith("/");this.hasProtocol(s)&&(t=this.rootname(s),s=s.slice(t.length));const i=s.endsWith("/");return s=Qy(s,!1),s.length>0&&i&&(s+="/"),e?`/${s}`:t+s},isAbsolute(s){return Ge(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let t;for(let e=0;e<s.length;++e){const i=s[e];if(Ge(i),i.length>0)if(t===void 0)t=i;else{const r=s[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(s){if(Ge(s),s.length===0)return".";s=this.toPosix(s);let t=s.charCodeAt(0);const e=t===47;let i=-1,r=!0;const n=this.getProtocol(s),a=s;s=s.slice(n.length);for(let o=s.length-1;o>=1;--o)if(t=s.charCodeAt(o),t===47){if(!r){i=o;break}}else r=!1;return i===-1?e?"/":this.isUrl(a)?n+s:n:e&&i===1?"//":n+s.slice(0,i)},rootname(s){Ge(s),s=this.toPosix(s);let t="";if(s.startsWith("/")?t="/":t=this.getProtocol(s),this.isUrl(s)){const e=s.indexOf("/",t.length);e!==-1?t=s.slice(0,e):t=s,t.endsWith("/")||(t+="/")}return t},basename(s,t){Ge(s),t&&Ge(t),s=Kr(this.toPosix(s));let e=0,i=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=s.length){if(t.length===s.length&&t===s)return"";let a=t.length-1,o=-1;for(n=s.length-1;n>=0;--n){const h=s.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&&(i=n):(a=-1,i=o))}return e===i?i=o:i===-1&&(i=s.length),s.slice(e,i)}for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!r){e=n+1;break}}else i===-1&&(r=!1,i=n+1);return i===-1?"":s.slice(e,i)},extname(s){Ge(s),s=Kr(this.toPosix(s));let t=-1,e=0,i=-1,r=!0,n=0;for(let a=s.length-1;a>=0;--a){const o=s.charCodeAt(a);if(o===47){if(!r){e=a+1;break}continue}i===-1&&(r=!1,i=a+1),o===46?t===-1?t=a:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||i===-1||n===0||n===1&&t===i-1&&t===e+1?"":s.slice(t,i)},parse(s){Ge(s);const t={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return t;s=Kr(this.toPosix(s));let e=s.charCodeAt(0);const i=this.isAbsolute(s);let r;t.root=this.rootname(s),i||this.hasProtocol(s)?r=1:r=0;let n=-1,a=0,o=-1,h=!0,l=s.length-1,c=0;for(;l>=r;--l){if(e=s.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&&i?t.base=t.name=s.slice(1,o):t.base=t.name=s.slice(a,o)):(a===0&&i?(t.name=s.slice(1,n),t.base=s.slice(1,o)):(t.name=s.slice(a,n),t.base=s.slice(a,o)),t.ext=s.slice(n,o)),t.dir=this.dirname(s),t},sep:"/",delimiter:":",joinExtensions:[".html"]};let ph;async function Jy(){return ph??(ph=(async()=>{var n;const s=document.createElement("canvas").getContext("webgl");if(!s)return he.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 he.UNPACK;const e=s.createTexture();s.bindTexture(s.TEXTURE_2D,e);const i=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,i),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e,0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t);const r=new Uint8Array(4);return s.readPixels(0,0,1,1,s.RGBA,s.UNSIGNED_BYTE,r),s.deleteFramebuffer(i),s.deleteTexture(e),(n=s.getExtension("WEBGL_lose_context"))==null||n.loseContext(),r[0]<=r[3]?he.PMA:he.UNPACK})()),ph}let mh;function tx(){return typeof mh>"u"&&(mh=function(){var t;const s={stencil:!0,failIfMajorPerformanceCaveat:H.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!H.ADAPTER.getWebGLRenderingContext())return!1;const e=H.ADAPTER.createCanvas();let i=e.getContext("webgl",s)||e.getContext("experimental-webgl",s);const r=!!((t=i==null?void 0:i.getContextAttributes())!=null&&t.stencil);if(i){const n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch{return!1}}()),mh}var ex={grad:.9,turn:360,rad:360/(2*Math.PI)},Ci=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},zt=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*s)/e+0},Pe=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),s>e?e:s>t?s:t},bd=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},Td=function(s){return{r:Pe(s.r,0,255),g:Pe(s.g,0,255),b:Pe(s.b,0,255),a:Pe(s.a)}},_h=function(s){return{r:zt(s.r),g:zt(s.g),b:zt(s.b),a:zt(s.a,3)}},ix=/^#([0-9a-f]{3,8})$/i,ta=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},wd=function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=Math.max(t,e,i),a=n-Math.min(t,e,i),o=a?n===t?(e-i)/a:n===e?2+(i-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}},Ed=function(s){var t=s.h,e=s.s,i=s.v,r=s.a;t=t/360*6,e/=100,i/=100;var n=Math.floor(t),a=i*(1-e),o=i*(1-(t-n)*e),h=i*(1-(1-t+n)*e),l=n%6;return{r:255*[i,o,a,a,h,i][l],g:255*[h,i,i,o,a,a][l],b:255*[a,a,h,i,i,o][l],a:r}},Ad=function(s){return{h:bd(s.h),s:Pe(s.s,0,100),l:Pe(s.l,0,100),a:Pe(s.a)}},Sd=function(s){return{h:zt(s.h),s:zt(s.s),l:zt(s.l),a:zt(s.a,3)}},Cd=function(s){return Ed((e=(t=s).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Zr=function(s){return{h:(t=wd(s)).h,s:(r=(200-(e=t.s))*(i=t.v)/100)>0&&r<200?e*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,i,r},sx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,nx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ax=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gh={string:[[function(s){var t=ix.exec(s);return t?(s=t[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?zt(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?zt(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var t=nx.exec(s)||ax.exec(s);return t?t[2]!==t[4]||t[4]!==t[6]?null:Td({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(s){var t=sx.exec(s)||rx.exec(s);if(!t)return null;var e,i,r=Ad({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(ex[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Cd(r)},"hsl"]],object:[[function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=r===void 0?1:r;return Ci(t)&&Ci(e)&&Ci(i)?Td({r:Number(t),g:Number(e),b:Number(i),a:Number(n)}):null},"rgb"],[function(s){var t=s.h,e=s.s,i=s.l,r=s.a,n=r===void 0?1:r;if(!Ci(t)||!Ci(e)||!Ci(i))return null;var a=Ad({h:Number(t),s:Number(e),l:Number(i),a:Number(n)});return Cd(a)},"hsl"],[function(s){var t=s.h,e=s.s,i=s.v,r=s.a,n=r===void 0?1:r;if(!Ci(t)||!Ci(e)||!Ci(i))return null;var a=function(o){return{h:bd(o.h),s:Pe(o.s,0,100),v:Pe(o.v,0,100),a:Pe(o.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(n)});return Ed(a)},"hsv"]]},Pd=function(s,t){for(var e=0;e<t.length;e++){var i=t[e][0](s);if(i)return[i,t[e][1]]}return[null,void 0]},ox=function(s){return typeof s=="string"?Pd(s.trim(),gh.string):typeof s=="object"&&s!==null?Pd(s,gh.object):[null,void 0]},yh=function(s,t){var e=Zr(s);return{h:e.h,s:Pe(e.s+100*t,0,100),l:e.l,a:e.a}},xh=function(s){return(299*s.r+587*s.g+114*s.b)/1e3/255},Rd=function(s,t){var e=Zr(s);return{h:e.h,s:e.s,l:Pe(e.l+100*t,0,100),a:e.a}},vh=function(){function s(t){this.parsed=ox(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return s.prototype.isValid=function(){return this.parsed!==null},s.prototype.brightness=function(){return zt(xh(this.rgba),2)},s.prototype.isDark=function(){return xh(this.rgba)<.5},s.prototype.isLight=function(){return xh(this.rgba)>=.5},s.prototype.toHex=function(){return t=_h(this.rgba),e=t.r,i=t.g,r=t.b,a=(n=t.a)<1?ta(zt(255*n)):"","#"+ta(e)+ta(i)+ta(r)+a;var t,e,i,r,n,a},s.prototype.toRgb=function(){return _h(this.rgba)},s.prototype.toRgbString=function(){return t=_h(this.rgba),e=t.r,i=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+i+", "+r+", "+n+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,n},s.prototype.toHsl=function(){return Sd(Zr(this.rgba))},s.prototype.toHslString=function(){return t=Sd(Zr(this.rgba)),e=t.h,i=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+n+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,n},s.prototype.toHsv=function(){return t=wd(this.rgba),{h:zt(t.h),s:zt(t.s),v:zt(t.v),a:zt(t.a,3)};var t},s.prototype.invert=function(){return si({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},s.prototype.saturate=function(t){return t===void 0&&(t=.1),si(yh(this.rgba,t))},s.prototype.desaturate=function(t){return t===void 0&&(t=.1),si(yh(this.rgba,-t))},s.prototype.grayscale=function(){return si(yh(this.rgba,-1))},s.prototype.lighten=function(t){return t===void 0&&(t=.1),si(Rd(this.rgba,t))},s.prototype.darken=function(t){return t===void 0&&(t=.1),si(Rd(this.rgba,-t))},s.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},s.prototype.alpha=function(t){return typeof t=="number"?si({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):zt(this.rgba.a,3);var e},s.prototype.hue=function(t){var e=Zr(this.rgba);return typeof t=="number"?si({h:t,s:e.s,l:e.l,a:e.a}):zt(e.h)},s.prototype.isEqual=function(t){return this.toHex()===si(t).toHex()},s}(),si=function(s){return s instanceof vh?s:new vh(s)},Id=[],hx=function(s){s.forEach(function(t){Id.indexOf(t)<0&&(t(vh,gh),Id.push(t))})};function lx(s,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"},i={};for(var r in e)i[e[r]]=r;var n={};s.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,h,l=i[this.toHex()];if(l)return l;if(a!=null&&a.closest){var c=this.toRgb(),d=1/0,u="black";if(!n.length)for(var f in e)n[f]=new s(e[f]).toRgb();for(var p in e){var m=(o=c,h=n[p],Math.pow(o.r-h.r,2)+Math.pow(o.g-h.g,2)+Math.pow(o.b-h.b,2));m<d&&(d=m,u=p)}return u}},t.string.push([function(a){var o=a.toLowerCase(),h=o==="transparent"?"#0000":e[o];return h?new s(h).toRgb():null},"name"])}hx([lx]);const er=class xo{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 xo)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 i=typeof t;if(i!==typeof e)return!1;if(i==="number"||i==="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,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toRgbArray(t){t=t??[];const[e,i,r]=this._components;return t[0]=e,t[1]=i,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,i,r,n]=xo.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,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 i=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(i=i*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(i<<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,i,r]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(i*t)/t,this._components[2]=Math.round(r*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,i,r,n]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}normalize(t){let e,i,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const a=t;e=(a>>16&255)/255,i=(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,i,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,i,r,n=255]=t,e/=255,i/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const o=xo.HEX_PATTERN.exec(t);o&&(t=`#${o[2]}`)}const a=si(t);a.isValid()&&({r:e,g:i,b:r,a:n}=a.rgba,e/=255,i/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,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,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),i)}),t)}};er.shared=new er,er.temp=new er,er.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let pt=er;function Md(s,t=[]){return it("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),pt.shared.setValue(s).toRgbArray(t)}function cx(s){return it("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),pt.shared.setValue(s).toHex()}function Qr(s){return it("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),pt.shared.setValue(s).toNumber()}function ux(){const s=[],t=[];for(let i=0;i<32;i++)s[i]=i,t[i]=i;s[K.NORMAL_NPM]=K.NORMAL,s[K.ADD_NPM]=K.ADD,s[K.SCREEN_NPM]=K.SCREEN,t[K.NORMAL]=K.NORMAL_NPM,t[K.ADD]=K.ADD_NPM,t[K.SCREEN]=K.SCREEN_NPM;const e=[];return e.push(t),e.push(s),e}const Dd=ux();function Bd(s,t){return Dd[t?1:0][s]}function dx(s,t=null){const e=s*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 i=0,r=0;i<e;i+=6,r+=4)t[i+0]=r+0,t[i+1]=r+1,t[i+2]=r+2,t[i+3]=r+0,t[i+4]=r+2,t[i+5]=r+3;return t}function Od(s){if(s.BYTES_PER_ELEMENT===4)return s instanceof Float32Array?"Float32Array":s instanceof Uint32Array?"Uint32Array":"Int32Array";if(s.BYTES_PER_ELEMENT===2){if(s instanceof Uint16Array)return"Uint16Array"}else if(s.BYTES_PER_ELEMENT===1&&s instanceof Uint8Array)return"Uint8Array";return null}function ea(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Fd(s){return!(s&s-1)&&!!s}function Ld(s){let t=(s>65535?1:0)<<4;s>>>=t;let e=(s>255?1:0)<<3;return s>>>=e,t|=e,e=(s>15?1:0)<<2,s>>>=e,t|=e,e=(s>3?1:0)<<1,s>>>=e,t|=e,t|s>>1}function ir(s,t,e){const i=s.length;let r;if(t>=i||e===0)return;e=t+e>i?i-t:e;const n=i-e;for(r=t;r<n;++r)s[r]=s[r+e];s.length=n}function Vi(s){return s===0?0:s<0?-1:1}let fx=0;function _s(){return++fx}const bh=class{constructor(s,t,e,i){this.left=s,this.top=t,this.right=e,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};bh.EMPTY=new bh(0,0,0,0);let kd=bh;const Nd={},ri=Object.create(null),Wi=Object.create(null);class px{constructor(t,e,i){this._canvas=H.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=i||H.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 Ud(s,t,e){for(let i=0,r=4*e*t;i<t;++i,r+=4)if(s[r+3]!==0)return!1;return!0}function Gd(s,t,e,i,r){const n=4*t;for(let a=i,o=i*n+4*e;a<=r;++a,o+=n)if(s[o+3]!==0)return!1;return!0}function mx(s){const{width:t,height:e}=s,i=s.getContext("2d",{willReadFrequently:!0});if(i===null)throw new TypeError("Failed to get canvas 2D context");const r=i.getImageData(0,0,t,e).data;let n=0,a=0,o=t-1,h=e-1;for(;a<e&&Ud(r,t,a);)++a;if(a===e)return kd.EMPTY;for(;Ud(r,t,h);)--h;for(;Gd(r,t,n,a,h);)++n;for(;Gd(r,t,o,a,h);)--o;return++o,++h,new kd(n,a,o,h)}function _x(s){const t=mx(s),{width:e,height:i}=t;let r=null;if(!t.isEmpty()){const n=s.getContext("2d");if(n===null)throw new TypeError("Failed to get canvas 2D context");r=n.getImageData(t.left,t.top,e,i)}return{width:e,height:i,data:r}}function gx(s,t=globalThis.location){if(s.startsWith("data:"))return"";t=t||globalThis.location;const e=new URL(s,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function Pi(s,t=1){var i;const e=(i=H.RETINA_PREFIX)==null?void 0:i.exec(s);return e?parseFloat(e[1]):t}var G=(s=>(s.Renderer="renderer",s.Application="application",s.RendererSystem="renderer-webgl-system",s.RendererPlugin="renderer-webgl-plugin",s.CanvasRendererSystem="renderer-canvas-system",s.CanvasRendererPlugin="renderer-canvas-plugin",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s))(G||{});const Th=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},Hd=(s,t)=>Th(s).priority??t,z={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(Th).forEach(t=>{t.type.forEach(e=>{var i,r;return(r=(i=this._removeHandlers)[e])==null?void 0:r.call(i,t)})}),this},add(...s){return s.map(Th).forEach(t=>{t.type.forEach(e=>{var n,a;const i=this._addHandlers,r=this._queue;i[e]?(n=i[e])==null||n.call(i,t):(r[e]=r[e]||[],(a=r[e])==null||a.push(t))})}),this},handle(s,t,e){var a;const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&((a=n[s])==null||a.forEach(o=>t(o)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>Hd(n,e)-Hd(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})}};class wh{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 yx=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
11
|
+
`);function xx(s){let t="";for(let e=0;e<s;++e)e>0&&(t+=`
|
|
12
|
+
else `),e<s-1&&(t+=`if(test == ${e}.0){}`);return t}function vx(s,t){if(s===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const e=t.createShader(t.FRAGMENT_SHADER);for(;;){const i=yx.replace(/%forloop%/gi,xx(s));if(t.shaderSource(e,i),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))s=s/2|0;else break}return s}const Eh=0,Ah=1,Sh=2,Ch=3,Ph=4,Rh=5;class ni{constructor(){this.data=0,this.blendMode=K.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Eh)}set blend(t){!!(this.data&1<<Eh)!==t&&(this.data^=1<<Eh)}get offsets(){return!!(this.data&1<<Ah)}set offsets(t){!!(this.data&1<<Ah)!==t&&(this.data^=1<<Ah)}get culling(){return!!(this.data&1<<Sh)}set culling(t){!!(this.data&1<<Sh)!==t&&(this.data^=1<<Sh)}get depthTest(){return!!(this.data&1<<Ch)}set depthTest(t){!!(this.data&1<<Ch)!==t&&(this.data^=1<<Ch)}get depthMask(){return!!(this.data&1<<Rh)}set depthMask(t){!!(this.data&1<<Rh)!==t&&(this.data^=1<<Rh)}get clockwiseFrontFace(){return!!(this.data&1<<Ph)}set clockwiseFrontFace(t){!!(this.data&1<<Ph)!==t&&(this.data^=1<<Ph)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==K.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new ni;return t.depthTest=!1,t.blend=!0,t}}ni.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const Ih=[];function Vd(s,t){if(!s)return null;let e="";if(typeof s=="string"){const i=/\.(\w{3,4})(?:$|\?|#)/i.exec(s);i&&(e=i[1].toLowerCase())}for(let i=Ih.length-1;i>=0;--i){const r=Ih[i];if(r.test&&r.test(s,e))return new r(s,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class He{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,i,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 d=0,u=c.length;d<u;d++)c[d][l](t,e,i,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(He.prototype,{dispatch:{value:He.prototype.emit},run:{value:He.prototype.emit}});class Jr{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize"),this.onUpdate=new He("update"),this.onError=new He("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,i){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 ia extends Jr{constructor(t,e){const{width:i,height:r}=e||{};if(!i||!r)throw new Error("BufferResource width or height invalid");super(i,r),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,i){const r=t.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,this.unpackAlignment),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===he.UNPACK);const n=e.realWidth,a=e.realHeight;return i.width===n&&i.height===a?r.texSubImage2D(e.target,0,0,0,n,a,e.format,i.type,this.data):(i.width=n,i.height=a,r.texImage2D(e.target,0,i.internalFormat,n,a,0,e.format,i.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 bx={scaleMode:Ti.NEAREST,alphaMode:he.NPM},Mh=class Or extends Je{constructor(t=null,e=null){super(),e=Object.assign({},Or.defaultOptions,e);const{alphaMode:i,mipmap:r,anisotropicLevel:n,scaleMode:a,width:o,height:h,wrapMode:l,format:c,type:d,target:u,resolution:f,resourceOptions:p}=e;t&&!(t instanceof Jr)&&(t=Vd(t,p),t.internal=!0),this.resolution=f||H.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=d,this.target=u,this.alphaMode=i,this.uid=_s(),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 i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this}setSize(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)}setRealSize(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Fd(this.realWidth)&&Fd(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 Wi[this.cacheId],delete ri[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Or.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,i=H.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}_${_s()}`}n=t._pixiId}let a=Wi[n];if(r&&i&&!a)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return a||(a=new Or(t,e),a.cacheId=n,Or.addToCache(a,n)),a}static fromBuffer(t,e,i,r){t=t||new Float32Array(e*i*4);const n=new ia(t,{width:e,height:i,...r==null?void 0:r.resourceOptions});let a,o;return t instanceof Float32Array?(a=O.RGBA,o=Z.FLOAT):t instanceof Int32Array?(a=O.RGBA_INTEGER,o=Z.INT):t instanceof Uint32Array?(a=O.RGBA_INTEGER,o=Z.UNSIGNED_INT):t instanceof Int16Array?(a=O.RGBA_INTEGER,o=Z.SHORT):t instanceof Uint16Array?(a=O.RGBA_INTEGER,o=Z.UNSIGNED_SHORT):t instanceof Int8Array?(a=O.RGBA,o=Z.BYTE):(a=O.RGBA,o=Z.UNSIGNED_BYTE),n.internal=!0,new Or(n,Object.assign({},bx,{type:o,format:a},r))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Wi[e]&&Wi[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Wi[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Wi[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Wi[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Wi[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};Mh.defaultOptions={mipmap:Ke.POW2,anisotropicLevel:0,scaleMode:Ti.LINEAR,wrapMode:Ui.CLAMP,alphaMode:he.UNPACK,target:Xs.TEXTURE_2D,format:O.RGBA,type:Z.UNSIGNED_BYTE},Mh._globalBatch=0;let J=Mh;class Dh{constructor(){this.texArray=null,this.blend=0,this.type=Ue.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Tx=0;class Nt{constructor(t,e=!0,i=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Tx++,this.disposeRunner=new He("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?Qe.ELEMENT_ARRAY_BUFFER:Qe.ARRAY_BUFFER}get index(){return this.type===Qe.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new Nt(t)}}class sa{constructor(t,e=0,i=!1,r=Z.FLOAT,n,a,o,h=1){this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=a,this.instance=o,this.divisor=h}destroy(){this.buffer=null}static from(t,e,i,r,n){return new sa(t,e,i,r,n)}}const wx={Float32Array,Uint32Array,Int32Array,Uint8Array};function Ex(s,t){let e=0,i=0;const r={};for(let h=0;h<s.length;h++)i+=t[h],e+=s[h].length;const n=new ArrayBuffer(e*4);let a=null,o=0;for(let h=0;h<s.length;h++){const l=t[h],c=s[h],d=Od(c);r[d]||(r[d]=new wx[d](n)),a=r[d];for(let u=0;u<c.length;u++){const f=(u/l|0)*i+o,p=u%l;a[f+p]=c[u]}o+=l}return new Float32Array(n)}const Wd={5126:4,5123:2,5121:1};let Ax=0;const Sx={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Xi{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ax++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new He("disposeGeometry"),this.refCount=0}addAttribute(t,e,i=0,r=!1,n,a,o,h=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof Nt||(e instanceof Array&&(e=new Float32Array(e)),e=new Nt(e));const l=t.split("|");if(l.length>1){for(let d=0;d<l.length;d++)this.addAttribute(l[d],e,i,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 sa(c,i,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 Nt||(t instanceof Array&&(t=new Uint16Array(t)),t=new Nt(t)),t.type=Qe.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=[],i=new Nt;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*Wd[n.type]/4),n.buffer=0}for(i.data=Ex(t,e),r=0;r<this.buffers.length;r++)this.buffers[r]!==this.indexBuffer&&this.buffers[r].destroy();return this.buffers=[i],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 Xi;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new Nt(this.buffers[e].data.slice(0));for(const e in this.attributes){const i=this.attributes[e];t.attributes[e]=new sa(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=Qe.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new Xi,i=[],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++)i[o]=new Sx[Od(a.buffers[o].data)](r[o]),e.buffers[o]=new Nt(i[o]);for(let o=0;o<t.length;o++){a=t[o];for(let h=0;h<a.buffers.length;h++)i[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=Qe.ELEMENT_ARRAY_BUFFER;let o=0,h=0,l=0,c=0;for(let d=0;d<a.buffers.length;d++)if(a.buffers[d]!==a.indexBuffer){c=d;break}for(const d in a.attributes){const u=a.attributes[d];(u.buffer|0)===c&&(h+=u.size*Wd[u.type]/4)}for(let d=0;d<t.length;d++){const u=t[d].indexBuffer.data;for(let f=0;f<u.length;f++)e.indexBuffer.data[f+l]+=o;o+=t[d].buffers[c].data.length/h,l+=u.length}}return e}}class Xd extends Xi{constructor(t=!1){super(),this._buffer=new Nt(null,t,!1),this._indexBuffer=new Nt(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Z.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Z.FLOAT).addAttribute("aColor",this._buffer,4,!0,Z.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Z.FLOAT).addIndex(this._indexBuffer)}}const ra=Math.PI*2,Cx=180/Math.PI,Bh=Math.PI/180;var Zt=(s=>(s[s.POLY=0]="POLY",s[s.RECT=1]="RECT",s[s.CIRC=2]="CIRC",s[s.ELIP=3]="ELIP",s[s.RREC=4]="RREC",s))(Zt||{});class tt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new tt(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}}tt.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const na=[new tt,new tt,new tt,new tt];let st=class $c{constructor(t=0,e=0,i=0,r=0){this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=Zt.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 $c(0,0,0,0)}clone(){return new $c(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 i=this.left,r=this.right,n=this.top,a=this.bottom;if(r<=i||a<=n)return!1;const o=na[0].set(t.left,t.top),h=na[1].set(t.left,t.bottom),l=na[2].set(t.right,t.top),c=na[3].set(t.right,t.bottom);if(l.x<=o.x||h.y<=o.y)return!1;const d=Math.sign(e.a*e.d-e.b*e.c);if(d===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)<=i||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 u=d*(h.y-o.y),f=d*(o.x-h.x),p=u*i+f*n,m=u*r+f*n,_=u*i+f*a,y=u*r+f*a;if(Math.max(p,m,_,y)<=u*o.x+f*o.y||Math.min(p,m,_,y)>=u*c.x+f*c.y)return!1;const v=d*(o.y-l.y),g=d*(l.x-o.x),x=v*i+g*n,b=v*r+g*n,w=v*i+g*a,T=v*r+g*a;return!(Math.max(x,b,w,T)<=v*o.x+g*o.y||Math.min(x,b,w,T)>=v*c.x+g*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),i=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(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=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=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=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=i-e,this.y=r,this.height=n-r,this}};st.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class aa{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.radius=i,this.type=Zt.CIRC}clone(){return new aa(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i}getBounds(){return new st(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}aa.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class oa{constructor(t=0,e=0,i=0,r=0){this.x=t,this.y=e,this.width=i,this.height=r,this.type=Zt.ELIP}clone(){return new oa(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let i=(t-this.x)/this.width,r=(e-this.y)/this.height;return i*=i,r*=r,i+r<=1}getBounds(){return new st(this.x-this.width,this.y-this.height,this.width,this.height)}}oa.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class $i{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let r=0,n=e.length;r<n;r++)i.push(e[r].x,e[r].y);e=i}this.points=e,this.type=Zt.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new $i(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let i=!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&&(i=!i)}return i}}$i.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((s,t)=>`${s}, ${t}`,"")}]`};class ha{constructor(t=0,e=0,i=0,r=0,n=20){this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=Zt.RREC}clone(){return new ha(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 i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=e-(this.y+i);const a=i*i;if(r*r+n*n<=a||(r=t-(this.x+this.width-i),r*r+n*n<=a)||(n=e-(this.y+this.height-i),r*r+n*n<=a)||(r=t-(this.x+i),r*r+n*n<=a))return!0}return!1}}ha.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class gt{constructor(t=1,e=0,i=0,r=1,n=0,a=0){this.array=null,this.a=t,this.b=e,this.c=i,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,i,r,n,a){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=a,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new tt;const i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e}applyInverse(t,e){e=e||new tt;const i=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*i*r+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,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),i=Math.sin(t),r=this.a,n=this.c,a=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=a*e-this.ty*i,this.ty=a*i+this.ty*e,this}append(t){const e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this}setTransform(t,e,i,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-(i*this.a+r*this.c),this.ty=e-(i*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 i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*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,i=this.b,r=this.c,n=this.d,a=t.pivot,o=-Math.atan2(-r,n),h=Math.atan2(i,e),l=Math.abs(o+h);return l<1e-5||Math.abs(ra-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+i*i),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*i+a.y*n),t}invert(){const t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,a=t*r-e*i;return this.a=r/a,this.b=-e/a,this.c=-i/a,this.d=t/a,this.tx=(i*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 gt;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 gt}static get TEMP_MATRIX(){return new gt}}gt.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 gs=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ys=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],xs=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vs=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Oh=[],$d=[],la=Math.sign;function Px(){for(let s=0;s<16;s++){const t=[];Oh.push(t);for(let e=0;e<16;e++){const i=la(gs[s]*gs[e]+xs[s]*ys[e]),r=la(ys[s]*gs[e]+vs[s]*ys[e]),n=la(gs[s]*xs[e]+xs[s]*vs[e]),a=la(ys[s]*xs[e]+vs[s]*vs[e]);for(let o=0;o<16;o++)if(gs[o]===i&&ys[o]===r&&xs[o]===n&&vs[o]===a){t.push(o);break}}}for(let s=0;s<16;s++){const t=new gt;t.set(gs[s],ys[s],xs[s],vs[s],0,0),$d.push(t)}}Px();const At={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:s=>gs[s],uY:s=>ys[s],vX:s=>xs[s],vY:s=>vs[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>Oh[s][t],sub:(s,t)=>Oh[s][At.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?At.S:At.N:Math.abs(t)*2<=Math.abs(s)?s>0?At.E:At.W:t>0?s>0?At.SE:At.SW:s>0?At.NE:At.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=$d[At.inv(t)];r.tx=e,r.ty=i,s.append(r)}};class ai{constructor(t,e,i=0,r=0){this._x=i,this._y=r,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new ai(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))}}ai.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Fh=class{constructor(){this.worldTransform=new gt,this.localTransform=new gt,this.position=new ai(this.onChange,this,0,0),this.scale=new ai(this.onChange,this,1,1),this.pivot=new ai(this.onChange,this,0,0),this.skew=new ai(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 s=this.localTransform;this._localID!==this._currentLocalID&&(s.a=this._cx*this.scale.x,s.b=this._sx*this.scale.x,s.c=this._cy*this.scale.y,s.d=this._sy*this.scale.y,s.tx=this.position.x-(this.pivot.x*s.a+this.pivot.y*s.c),s.ty=this.position.y-(this.pivot.x*s.b+this.pivot.y*s.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(s){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!==s._worldID){const e=s.worldTransform,i=this.worldTransform;i.a=t.a*e.a+t.b*e.c,i.b=t.a*e.b+t.b*e.d,i.c=t.c*e.a+t.d*e.c,i.d=t.c*e.b+t.d*e.d,i.tx=t.tx*e.a+t.ty*e.c+e.tx,i.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=s._worldID,this._worldID++}}setFromMatrix(s){s.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(s){this._rotation!==s&&(this._rotation=s,this.updateSkew())}};Fh.IDENTITY=new Fh;let ca=Fh;ca.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 Rx=`varying vec2 vTextureCoord;
|
|
13
13
|
|
|
14
14
|
uniform sampler2D uSampler;
|
|
15
15
|
|
|
16
16
|
void main(void){
|
|
17
17
|
gl_FragColor *= texture2D(uSampler, vTextureCoord);
|
|
18
|
-
}`,
|
|
18
|
+
}`,Ix=`attribute vec2 aVertexPosition;
|
|
19
19
|
attribute vec2 aTextureCoord;
|
|
20
20
|
|
|
21
21
|
uniform mat3 projectionMatrix;
|
|
@@ -26,7 +26,7 @@ void main(void){
|
|
|
26
26
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
27
27
|
vTextureCoord = aTextureCoord;
|
|
28
28
|
}
|
|
29
|
-
`;function
|
|
29
|
+
`;function zd(s,t,e){const i=s.createShader(t);return s.shaderSource(i,e),s.compileShader(i),i}function Lh(s){const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=!1;return t}function Yd(s,t){switch(s){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 Lh(2*t);case"bvec3":return Lh(3*t);case"bvec4":return Lh(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 sr=[{test:s=>s.type==="float"&&s.size===1&&!s.isArray,code:s=>`
|
|
30
30
|
if(uv["${s}"] !== ud["${s}"].value)
|
|
31
31
|
{
|
|
32
32
|
ud["${s}"].value = uv["${s}"]
|
|
@@ -146,7 +146,7 @@ void main(void){
|
|
|
146
146
|
cv[3] = v[3];
|
|
147
147
|
|
|
148
148
|
gl.uniform4f(ud["${s}"].location, v[0], v[1], v[2], v[3])
|
|
149
|
-
}`}],
|
|
149
|
+
}`}],Mx={float:`
|
|
150
150
|
if (cv !== v)
|
|
151
151
|
{
|
|
152
152
|
cu.value = v;
|
|
@@ -282,7 +282,7 @@ void main(void){
|
|
|
282
282
|
cu.value = v;
|
|
283
283
|
|
|
284
284
|
gl.uniform1i(location, v);
|
|
285
|
-
}`},
|
|
285
|
+
}`},Dx={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 Bx(s,t){var i;const e=[`
|
|
286
286
|
var v = null;
|
|
287
287
|
var cv = null;
|
|
288
288
|
var cu = null;
|
|
@@ -292,18 +292,18 @@ void main(void){
|
|
|
292
292
|
renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}');
|
|
293
293
|
`):e.push(`
|
|
294
294
|
renderer.shader.syncUniformGroup(uv.${r}, syncData);
|
|
295
|
-
`));continue}const a=s.uniforms[r];let o=!1;for(let h=0;h<
|
|
295
|
+
`));continue}const a=s.uniforms[r];let o=!1;for(let h=0;h<sr.length;h++)if(sr[h].test(n,a)){e.push(sr[h].code(r,a)),o=!0;break}if(!o){const h=(n.size===1&&!n.isArray?Mx:Dx)[n.type].replace("location",`ud["${r}"].location`);e.push(`
|
|
296
296
|
cu = ud["${r}"];
|
|
297
297
|
cv = cu.value;
|
|
298
298
|
v = uv["${r}"];
|
|
299
299
|
${h};`)}}return new Function("ud","uv","renderer","syncData",e.join(`
|
|
300
|
-
`))}const
|
|
300
|
+
`))}const jd={};let rr=jd;function Ox(){if(rr===jd||rr!=null&&rr.isContextLost()){const s=H.ADAPTER.createCanvas();let t;H.PREFER_ENV>=qe.WEBGL2&&(t=s.getContext("webgl2",{})),t||(t=s.getContext("webgl",{})||s.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),rr=t}return rr}let ua;function Fx(){if(!ua){ua=Ce.MEDIUM;const s=Ox();if(s&&s.getShaderPrecisionFormat){const t=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);t&&(ua=t.precision?Ce.HIGH:Ce.MEDIUM)}}return ua}function qd(s,t){const e=s.getShaderSource(t).split(`
|
|
301
301
|
`).map((l,c)=>`${c}: ${l}`),i=s.getShaderInfoLog(t),r=i.split(`
|
|
302
302
|
`),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(`
|
|
303
|
-
`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function
|
|
304
|
-
${s}`}else if(e!==Ce.HIGH&&s.substring(0,15)==="precision highp")return s.replace("precision highp","precision mediump");return s}let
|
|
303
|
+
`);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...o),console.groupEnd()}function Lx(s,t,e,i){s.getProgramParameter(t,s.LINK_STATUS)||(s.getShaderParameter(e,s.COMPILE_STATUS)||qd(s,e),s.getShaderParameter(i,s.COMPILE_STATUS)||qd(s,i),console.error("PixiJS Error: Could not initialize shader."),s.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",s.getProgramInfoLog(t)))}const kx={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 Kd(s){return kx[s]}let da=null;const Zd={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 Qd(s,t){if(!da){const e=Object.keys(Zd);da={};for(let i=0;i<e.length;++i){const r=e[i];da[s[r]]=Zd[r]}}return da[t]}function Jd(s,t,e){if(s.substring(0,9)!=="precision"){let i=t;return t===Ce.HIGH&&e!==Ce.HIGH&&(i=Ce.MEDIUM),`precision ${i} float;
|
|
304
|
+
${s}`}else if(e!==Ce.HIGH&&s.substring(0,15)==="precision highp")return s.replace("precision highp","precision mediump");return s}let tn;function Nx(){if(typeof tn=="boolean")return tn;try{tn=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{tn=!1}return tn}let Ux=0;const fa={},kh=class Fr{constructor(t,e,i="pixi-shader",r={}){this.extra={},this.id=Ux++,this.vertexSrc=t||Fr.defaultVertexSrc,this.fragmentSrc=e||Fr.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=r,this.vertexSrc.substring(0,8)!=="#version"&&(i=i.replace(/\s+/g,"-"),fa[i]?(fa[i]++,i+=`-${fa[i]}`):fa[i]=1,this.vertexSrc=`#define SHADER_NAME ${i}
|
|
305
305
|
${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${i}
|
|
306
|
-
${this.fragmentSrc}`,this.vertexSrc
|
|
306
|
+
${this.fragmentSrc}`,this.vertexSrc=Jd(this.vertexSrc,Fr.defaultVertexPrecision,Ce.HIGH),this.fragmentSrc=Jd(this.fragmentSrc,Fr.defaultFragmentPrecision,Fx())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return Ix}static get defaultFragmentSrc(){return Rx}static from(t,e,i){const r=t+e;let n=Nd[r];return n||(Nd[r]=n=new Fr(t,e,i)),n}};kh.defaultVertexPrecision=Ce.HIGH,kh.defaultFragmentPrecision=Ei.apple.device?Ce.HIGH:Ce.MEDIUM;let Ri=kh,Gx=0;class Ve{constructor(t,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Gx++,this.static=!!e,this.ubo=!!i,t instanceof Nt?(this.buffer=t,this.buffer.type=Qe.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Nt(new Float32Array(1)),this.buffer.type=Qe.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,e,i){if(!this.ubo)this.uniforms[t]=new Ve(e,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(t,e,i){return new Ve(t,e,i)}static uboFrom(t,e){return new Ve(t,e??!0,!0)}}class oi{constructor(t,e){this.uniformBindCount=0,this.program=t,e?e instanceof Ve?this.uniformGroup=e:this.uniformGroup=new Ve(e):this.uniformGroup=new Ve({}),this.disposeRunner=new He("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const i in e.uniforms){const r=e.uniforms[i];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,i){const r=Ri.from(t,e);return new oi(r,i)}}class Hx{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 i=new Int32Array(t);for(let n=0;n<t;n++)i[n]=n;this.defaultGroupCache[t]=Ve.from({uSamplers:i},!0);let r=this.fragTemplate;r=r.replace(/%count%/gi,`${t}`),r=r.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Ri(this.vertexSrc,r)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new gt,default:this.defaultGroupCache[t]};return new oi(this.programCache[t],e)}generateSampleSrc(t){let e="";e+=`
|
|
307
307
|
`,e+=`
|
|
308
308
|
`;for(let i=0;i<t;i++)i>0&&(e+=`
|
|
309
309
|
else `),i<t-1&&(e+=`if(vTextureId < ${i}.5)`),e+=`
|
|
@@ -311,7 +311,7 @@ else `),i<t-1&&(e+=`if(vTextureId < ${i}.5)`),e+=`
|
|
|
311
311
|
color = texture2D(uSamplers[${i}], vTextureCoord);`,e+=`
|
|
312
312
|
}`;return e+=`
|
|
313
313
|
`,e+=`
|
|
314
|
-
`,e}}class
|
|
314
|
+
`,e}}class Nh{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 Vx(){return!Ei.apple.device}function Wx(s){let t=!0;const e=H.ADAPTER.getNavigator();if(Ei.tablet||Ei.phone){if(Ei.apple.device){const i=e.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)<11&&(t=!1)}if(Ei.android.device){const i=e.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)<7&&(t=!1)}}return t?s:4}class pa{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}var Xx=`varying vec2 vTextureCoord;
|
|
315
315
|
varying vec4 vColor;
|
|
316
316
|
varying float vTextureId;
|
|
317
317
|
uniform sampler2D uSamplers[%count%];
|
|
@@ -321,7 +321,7 @@ void main(void){
|
|
|
321
321
|
%forloop%
|
|
322
322
|
gl_FragColor = color * vColor;
|
|
323
323
|
}
|
|
324
|
-
|
|
324
|
+
`,$x=`precision highp float;
|
|
325
325
|
attribute vec2 aVertexPosition;
|
|
326
326
|
attribute vec2 aTextureCoord;
|
|
327
327
|
attribute vec4 aColor;
|
|
@@ -342,14 +342,14 @@ void main(void){
|
|
|
342
342
|
vTextureId = aTextureId;
|
|
343
343
|
vColor = aColor * tint;
|
|
344
344
|
}
|
|
345
|
-
`;const
|
|
345
|
+
`;const en=class je extends pa{constructor(t){super(t),this.setShaderGenerator(),this.geometryClass=Xd,this.vertexSize=6,this.state=ni.for2d(),this.size=je.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??Wx(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??Vx(),this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return it("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return $x}static get defaultFragmentTemplate(){return Xx}setShaderGenerator({vertex:t=je.defaultVertexSrc,fragment:e=je.defaultFragmentTemplate}={}){this.shaderGenerator=new Hx(t,e)}contextChange(){const t=this.renderer.gl;H.PREFER_ENV===qe.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),je.defaultMaxTextures),this.maxTextures=vx(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}=je,i=this.size/4,r=Math.floor(i/this.maxTextures)+1;for(;t.length<i;)t.push(new Dh);for(;e.length<r;)e.push(new Nh);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,i=je._textureArrayPool,r=this.renderer.batch,n=this._tempBoundTextures,a=this.renderer.textureGC.count;let o=++J._globalBatch,h=0,l=i[0],c=0;r.copyBoundTextures(n,e);for(let d=0;d<this._bufferSize;++d){const u=t[d];t[d]=null,u._batchEnabled!==o&&(l.count>=e&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,c,d),c=d,l=i[++h],++o),u._batchEnabled=o,u.touched=a,l.elements[l.count++]=u)}l.count>0&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,c,this._bufferSize),++h,++o);for(let d=0;d<n.length;d++)n[d]=null;J._globalBatch=o}buildDrawCalls(t,e,i){const{_bufferedElements:r,_attributeBuffer:n,_indexBuffer:a,vertexSize:o}=this,h=je._drawCallPool;let l=this._dcIndex,c=this._aIndex,d=this._iIndex,u=h[l];u.start=this._iIndex,u.texArray=t;for(let f=e;f<i;++f){const p=r[f],m=p._texture.baseTexture,_=Dd[m.alphaMode?1:0][p.blendMode];r[f]=null,e<f&&u.blend!==_&&(u.size=d-u.start,e=f,u=h[++l],u.texArray=t,u.start=d),this.packInterleavedGeometry(p,n,a,c,d),c+=p.vertexData.length/2*o,d+=p.indices.length,u.blend=_}e<i&&(u.size=d-u.start,++l),this._dcIndex=l,this._aIndex=c,this._iIndex=d}bindAndClearTexArray(t){const e=this.renderer.texture;for(let i=0;i<t.count;i++)e.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0}updateGeometry(){const{_packedGeometries:t,_attributeBuffer:e,_indexBuffer:i}=this;je.canUploadSameBuffer?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(i),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(i),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const t=this._dcIndex,{gl:e,state:i}=this.renderer,r=je._drawCallPool;let n=null;for(let a=0;a<t;a++){const{texArray:o,type:h,size:l,start:c,blend:d}=r[a];n!==o&&(n=o,this.bindAndClearTexArray(o)),this.state.blendMode=d,i.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),je.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=ea(Math.ceil(t/8)),i=Ld(e),r=e*8;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);let n=this._aBuffers[r];return n||(this._aBuffers[r]=n=new wh(r*this.vertexSize*4)),n}getIndexBuffer(t){const e=ea(Math.ceil(t/12)),i=Ld(e),r=e*12;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);let n=this._iBuffers[i];return n||(this._iBuffers[i]=n=new Uint16Array(r)),n}packInterleavedGeometry(t,e,i,r,n){const{uint32View:a,float32View:o}=e,h=r/this.vertexSize,l=t.uvs,c=t.indices,d=t.vertexData,u=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),p=pt.shared.setValue(t._tintRGB).toPremultiplied(f,t._texture.baseTexture.alphaMode>0);for(let m=0;m<d.length;m+=2)o[r++]=d[m],o[r++]=d[m+1],o[r++]=l[m],o[r++]=l[m+1],a[r++]=p,o[r++]=u;for(let m=0;m<c.length;m++)i[n++]=h+c[m]}};en.defaultBatchSize=4096,en.extension={name:"batch",type:G.RendererPlugin},en._drawCallPool=[],en._textureArrayPool=[];let bs=en;z.add(bs);var zx=`varying vec2 vTextureCoord;
|
|
346
346
|
|
|
347
347
|
uniform sampler2D uSampler;
|
|
348
348
|
|
|
349
349
|
void main(void){
|
|
350
350
|
gl_FragColor = texture2D(uSampler, vTextureCoord);
|
|
351
351
|
}
|
|
352
|
-
`,
|
|
352
|
+
`,Yx=`attribute vec2 aVertexPosition;
|
|
353
353
|
|
|
354
354
|
uniform mat3 projectionMatrix;
|
|
355
355
|
|
|
@@ -375,7 +375,7 @@ void main(void)
|
|
|
375
375
|
gl_Position = filterVertexPosition();
|
|
376
376
|
vTextureCoord = filterTextureCoord();
|
|
377
377
|
}
|
|
378
|
-
`;const Oh=class Pn extends ai{constructor(t,e,i){const r=Pi.from(t||Pn.defaultVertexSrc,e||Pn.defaultFragmentSrc);super(r,i),this.padding=0,this.resolution=Pn.defaultResolution,this.multisample=Pn.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new ri}apply(t,e,i,r,n){t.applyFilter(this,e,i,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 Ox}static get defaultFragmentSrc(){return Bx}};Oh.defaultResolution=1,Oh.defaultMultisample=Gt.NONE;let Yt=Oh;class fa{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new ft(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:i,backgroundAlpha:r}=t,n=i??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(){}}fa.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},fa.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"background"},Y.add(fa);class Yd{constructor(t){this.renderer=t,this.emptyRenderer=new da(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:i}=this.renderer.texture;for(let r=e-1;r>=0;--r)t[r]=i[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,e,i,r){const{elements:n,ids:a,count:o}=t;let h=0;for(let l=0;l<o;l++){const c=n[l],d=c._batchLocation;if(d>=0&&d<r&&e[d]===c){a[l]=d;continue}for(;h<r;){const u=e[h];if(u&&u._batchEnabled===i&&u._batchLocation===h){h++;continue}a[l]=h,c._batchLocation=h,e[h]=c;break}}}destroy(){this.renderer=null}}Yd.extension={type:G.RendererSystem,name:"batch"},Y.add(Yd);let jd=0;class pa{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=jd++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,i=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:i,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=jd++,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 i;if(H.PREFER_ENV>=qe.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,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(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=i||!!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")}}pa.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},pa.extension={type:G.RendererSystem,name:"context"},Y.add(pa);class Fh{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 Ge("disposeFramebuffer"),this.multisample=Gt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new J(null,{scaleMode:bi.NEAREST,resolution:1,mipmap:Ke.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new J(null,{scaleMode:bi.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ke.OFF,format:O.DEPTH_COMPONENT,type:Z.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 i=0;i<this.colorTextures.length;i++){const r=this.colorTextures[i],n=r.resolution;r.setSize(t/n,e/n)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(t/i,e/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class qd extends J{constructor(t={}){if(typeof t=="number"){const e=arguments[0],i=arguments[1],r=arguments[2],n=arguments[3];t={width:e,height:i,scaleMode:r,resolution:n}}t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=Gt.NONE),super(null,t),this.mipmap=Ke.OFF,this.valid=!0,this._clear=new ft([0,0,0,0]),this.framebuffer=new Fh(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 Ri extends Qr{constructor(t){const e=t,i=e.naturalWidth||e.videoWidth||e.displayWidth||e.width,r=e.naturalHeight||e.videoHeight||e.displayHeight||e.height;super(i,r),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,i){i===void 0&&!e.startsWith("data:")?t.crossOrigin=rx(e):i!==!1&&(t.crossOrigin=typeof i=="string"?i:"anonymous")}upload(t,e,i,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===he.UNPACK),!this.noSubImage&&e.target===n.TEXTURE_2D&&i.width===a&&i.height===o?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,i.type,r):(i.width=a,i.height=o,n.texImage2D(e.target,0,i.internalFormat,e.format,i.type,r)),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,i=t.naturalHeight||t.videoHeight||t.height;this.resize(e,i),super.update()}dispose(){this.source=null}}class Kd extends Ri{constructor(t,e){if(e=e||{},typeof t=="string"){const i=new Image;Ri.crossOrigin(i,t,e.crossorigin),i.src=t,t=i}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??H.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,i)=>{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=>{i(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,i=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:i?"cors":"no-cors"}).then(r=>r.blob()).then(r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===he.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,i){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,i,this.bitmap),!this.preserveBitmap){let r=!0;const n=e._glTextures;for(const a in n){const o=n[a];if(o!==i&&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 Lh{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,i){const r=e.width,n=e.height;if(i){const a=t.width/2/r,o=t.height/2/n,h=t.x/r+a,l=t.y/n+o;i=Et.add(i,Et.NW),this.x0=h+a*Et.uX(i),this.y0=l+o*Et.uY(i),i=Et.add(i,2),this.x1=h+a*Et.uX(i),this.y1=l+o*Et.uY(i),i=Et.add(i,2),this.x2=h+a*Et.uX(i),this.y2=l+o*Et.uY(i),i=Et.add(i,2),this.x3=h+a*Et.uX(i),this.y3=l+o*Et.uY(i)}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}}Lh.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 Zd=new Lh;function ma(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}class X extends kr{constructor(t,e,i,r,n,a,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new st(0,0,1,1)),t instanceof X&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=r,this.valid=!1,this.destroyed=!1,this._uvs=Zd,this.uvMatrix=null,this.orig=i||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 tt(a.x,a.y):new tt(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&&si[e.url]&&X.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,X.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(),i=new X(this.baseTexture,!this.noFrame&&t,e,(r=this.trim)==null?void 0:r.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=t),i}updateUvs(){this._uvs===Zd&&(this._uvs=new Lh),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},i=H.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else if(t instanceof J){if(!t.cacheId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${ms()}`,J.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${ms()}`}n=t._pixiId}let a=si[n];if(r&&i&&!a)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!a&&!(t instanceof J)?(e.resolution||(e.resolution=Ci(t)),a=new X(new J(t,e)),a.baseTexture.cacheId=n,J.addToCache(a.baseTexture,n),X.addToCache(a,n)):!a&&t instanceof J&&(a=new X(t),X.addToCache(a,n)),a}static fromURL(t,e){const i=Object.assign({autoLoad:!1},e==null?void 0:e.resourceOptions),r=X.from(t,Object.assign({resourceOptions:i},e),!1),n=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):n.load().then(()=>Promise.resolve(r))}static fromBuffer(t,e,i,r){return new X(J.fromBuffer(t,e,i,r))}static fromLoader(t,e,i,r){const n=new J(t,Object.assign({scaleMode:J.defaultOptions.scaleMode,resolution:Ci(e)},r)),{resource:a}=n;a instanceof Kd&&(a.url=e);const o=new X(n);return i||(i=e),J.addToCache(o.baseTexture,i),X.addToCache(o,i),i!==e&&(J.addToCache(o.baseTexture,e),X.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),si[e]&&si[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),si[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=si[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete si[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)si[t.textureCacheIds[e]]===t&&delete si[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:i,width:r,height:n}=t,a=e+r>this.baseTexture.width,o=i+n>this.baseTexture.height;if(a||o){const h=a&&o?"and":"or",l=`X: ${e} + ${r} = ${e+r} > ${this.baseTexture.width}`,c=`Y: ${i} + ${n} = ${i+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 X._EMPTY||(X._EMPTY=new X(new J),ma(X._EMPTY),ma(X._EMPTY.baseTexture)),X._EMPTY}static get WHITE(){if(!X._WHITE){const t=H.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),X._WHITE=new X(J.from(t)),ma(X._WHITE),ma(X._WHITE.baseTexture)}return X._WHITE}}class bs extends X{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,i=!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,i&&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 bs(new qd(t))}}class Qd{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,i=Gt.NONE){const r=new qd(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new bs(r)}getOptimalTexture(t,e,i=1,r=Gt.NONE){let n;t=Math.max(Math.ceil(t*i-1e-6),1),e=Math.max(Math.ceil(e*i-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=Jn(t),e=Jn(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(i),a}getFilterTexture(t,e,i){const r=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||Gt.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 i=this.texturePool[e];if(i)for(let r=0;r<i.length;r++)i[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 i=this.texturePool[e];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}Qd.SCREEN_KEY=-1;class Fx extends Wi{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class Jd extends Wi{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 kt(this.vertices),this.uvBuffer=new kt(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let i=0,r=0;return this.uvs[0]=i,this.uvs[1]=r,this.uvs[2]=i+e.width/t.width,this.uvs[3]=r,this.uvs[4]=i+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=i,this.uvs[7]=r+e.height/t.height,i=e.x,r=e.y,this.vertices[0]=i,this.vertices[1]=r,this.vertices[2]=i+e.width,this.vertices[3]=r,this.vertices[4]=i+e.width,this.vertices[5]=r+e.height,this.vertices[6]=i,this.vertices[7]=r+e.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class Lx{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Gt.NONE,this.sourceFrame=new st,this.destinationFrame=new st,this.bindingSourceFrame=new st,this.bindingDestinationFrame=new st,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const ga=[new tt,new tt,new tt,new tt],kh=new gt;class tf{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new Qd,this.statePool=[],this.quad=new Fx,this.quadUv=new Jd,this.tempRect=new st,this.activeState={},this.globalUniforms=new He({outputFrame:new st,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 i=this.renderer,r=this.defaultFilterStack,n=this.statePool.pop()||new Lx,a=i.renderTexture;let o,h;if(a.current){const g=a.current;o=g.resolution,h=g.multisample}else o=i.resolution,h=i.multisample;let l=e[0].resolution||o,c=e[0].multisample??h,d=e[0].padding,u=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),d=this.useMaxPadding?Math.max(d,y.padding):d+y.padding,u=u&&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(d);const p=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(kh.copyFrom(i.projection.transform).invert(),p),u?(n.sourceFrame.fit(p),(n.sourceFrame.width<=0||n.sourceFrame.height<=0)&&(n.sourceFrame.width=0,n.sourceFrame.height=0)):n.sourceFrame.intersects(p)||(n.sourceFrame.width=0,n.sourceFrame.height=0),this.roundFrame(n.sourceFrame,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.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 m=this.tempRect;m.x=0,m.y=0,m.width=n.sourceFrame.width,m.height=n.sourceFrame.height,n.renderTexture.filterFrame=n.sourceFrame,n.bindingSourceFrame.copyFrom(a.sourceFrame),n.bindingDestinationFrame.copyFrom(a.destinationFrame),n.transform=i.projection.transform,i.projection.transform=null,a.bind(n.renderTexture,n.sourceFrame,m),i.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),i=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(),i.length===1)i[0].apply(this,e.renderTexture,h.renderTexture,Ze.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 d=0;for(d=0;d<i.length-1;++d){d===1&&e.multisample>1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),i[d].apply(this,l,c,Ze.CLEAR,e);const u=l;l=c,c=u}i[d].apply(this,l,h.renderTexture,Ze.BLEND,e),d>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=Ze.CLEAR){const{renderTexture:i,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,i.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=r.stateId&1||this.forceClear;(e===Ze.CLEAR||e===Ze.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,i,r){const n=this.renderer;n.state.set(t.state),this.bindAndClear(i,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(Ne.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(Ne.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:i,destinationFrame:r}=this.activeState,{orig:n}=e._texture,a=t.set(r.width,0,0,r.height,i.x,i.y),o=e.worldTransform.copyTo(gt.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,i=1,r=Gt.NONE){return this.texturePool.getOptimalTexture(t,e,i,r)}getFilterTexture(t,e,i){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,i||Gt.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 i=ga[0],r=ga[1],n=ga[2],a=ga[3];i.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(i,i),t.apply(r,r),t.apply(n,n),t.apply(a,a);const o=Math.min(i.x,r.x,n.x,a.x),h=Math.min(i.y,r.y,n.y,a.y),l=Math.max(i.x,r.x,n.x,a.x),c=Math.max(i.y,r.y,n.y,a.y);e.x=o,e.y=h,e.width=l-o,e.height=c-h}roundFrame(t,e,i,r,n){if(!(t.width<=0||t.height<=0||i.width<=0||i.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?kh.copyFrom(n):kh.identity(),n.translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}}}tf.extension={type:G.RendererSystem,name:"filter"},Y.add(tf);class kx{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Gt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Nx=new st;class ef{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Fh(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 st,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;H.PREFER_ENV===qe.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=r=>e.drawBuffersWEBGL(r):(this.hasMRT=!1,t.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,i=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!==i&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=i),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):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>>i,o=e.height>>i,h=a/e.width;this.setViewport(e.x*h,e.y*h,a,o)}else{const a=t.width>>i,o=t.height>>i;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,i,r){const n=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),(n.width!==i||n.height!==r||n.x!==t||n.y!==e)&&(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,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,i,r,n=xo.COLOR|xo.DEPTH){const{gl:a}=this;a.clearColor(t,e,i,r),a.clear(n)}initFramebuffer(t){const{gl:e}=this,i=new kx(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i}resizeFramebuffer(t){const{gl:e}=this,i=t.glFramebuffers[this.CONTEXT_UID];if(i.stencil){e.bindRenderbuffer(e.RENDERBUFFER,i.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,i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.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&&i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.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:i}=this,r=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures;let a=n.length;i.drawBuffers||(a=Math.min(a,1)),r.multisample>1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||i.createRenderbuffer():r.msaaBuffer&&(i.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?(i.bindRenderbuffer(i.RENDERBUFFER,r.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,r.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,l.target,c._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){r.stencil=r.stencil||i.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):t.depth&&t.stencil?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):t.depth?(h=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(h=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,r.stencil),r.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,l,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,l,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,h,i.RENDERBUFFER,r.stencil)}else r.stencil&&(i.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 i=Gt.NONE;if(t<=1||e===null)return i;for(let r=0;r<e.length;r++)if(e[r]<=t){i=e[r];break}return i===1&&(i=Gt.NONE),i}blit(t,e,i){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 Fh(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=Nx,e.width=r.width,e.height=r.height),i||(i=e);const l=e.width===i.width&&e.height===i.height;this.bind(t),a.bindFramebuffer(a.READ_FRAMEBUFFER,h.framebuffer),a.blitFramebuffer(e.left,e.top,e.right,e.bottom,i.left,i.top,i.right,i.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 i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(!i)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(i.framebuffer),i.msaaBuffer&&r.deleteRenderbuffer(i.msaaBuffer),i.stencil&&r.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<e.length;i++)this.disposeFramebuffer(e[i],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 i=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,i,r):n.renderbufferStorage(n.RENDERBUFFER,h,i,r),n.framebufferRenderbuffer(n.FRAMEBUFFER,o,n.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new st}destroy(){this.renderer=null}}ef.extension={type:G.RendererSystem,name:"framebuffer"},Y.add(ef);const Nh={5126:4,5123:2,5121:1};class sf{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 i=this.renderer.context.extensions.vertexArrayObject;H.PREFER_ENV===qe.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=()=>i.createVertexArrayOES(),t.bindVertexArray=r=>i.bindVertexArrayOES(r),t.deleteVertexArray=r=>i.deleteVertexArrayOES(r)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=(r,n)=>i.vertexAttribDivisorANGLE(r,n),t.drawElementsInstanced=(r,n,a,o,h)=>i.drawElementsInstancedANGLE(r,n,a,o,h),t.drawArraysInstanced=(r,n,a,o)=>i.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:i}=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?i.bindVertexArray(a):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let i=0;i<t.buffers.length;i++){const r=t.buffers[i];e.update(r)}}checkCompatibility(t,e){const i=t.attributes,r=e.attributeData;for(const n in r)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(t,e){const i=t.attributes,r=e.attributeData,n=["g",t.id];for(const a in i)r[a]&&n.push(a,r[a].location);return n.join("-")}initGeometryVao(t,e,i=!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 d=t.buffers,u=t.attributes,f={},p={};for(const m in d)f[m]=0,p[m]=0;for(const m in u)!u[m].size&&o.attributeData[m]?u[m].size=o.attributeData[m].size:u[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),f[u[m].buffer]+=u[m].size*Nh[u[m].type];for(const m in u){const g=u[m],y=g.size;g.stride===void 0&&(f[g.buffer]===y*Nh[g.type]?g.stride=0:g.stride=f[g.buffer]),g.start===void 0&&(g.start=p[g.buffer],p[g.buffer]+=y*Nh[g.type])}c=r.createVertexArray(),r.bindVertexArray(c);for(let m=0;m<d.length;m++){const g=d[m];a.bind(g),i&&g._glBuffers[n].refCount++}return this.activateVao(t,o),l[o.id]=c,l[h]=c,r.bindVertexArray(null),a.unbind(Qe.ARRAY_BUFFER),c}disposeGeometry(t,e){var o;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const i=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),!!i){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 i)if(h[0]==="g"){const l=i[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 i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t)}activateVao(t,e){const i=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],d=a[c.buffer],u=d._glBuffers[r];if(e.attributeData[l]){h!==u&&(n.bind(d),h=u);const f=e.attributeData[l].location;if(i.enableVertexAttribArray(f),i.vertexAttribPointer(f,c.size,c.type||i.FLOAT,c.normalized,c.stride,c.start),c.instance)if(this.hasInstance)i.vertexAttribDivisor(f,c.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,e,i,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,(i||0)*o,r||1):n.drawElements(t,e||a.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?n.drawArraysInstanced(t,i,e||a.getSize(),r||1):n.drawArrays(t,i,e||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}sf.extension={type:G.RendererSystem,name:"geometry"},Y.add(sf);const rf=new gt;class nf{constructor(t,e){this._texture=t,this.mapCoord=new gt,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 i=this.mapCoord;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];e[r]=n*i.a+a*i.c+i.tx,e[r+1]=n*i.b+a*i.d+i.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 i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const r=e.orig,n=e.trim;n&&(rf.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(rf));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 Ux=`varying vec2 vMaskCoord;
|
|
378
|
+
`;const Uh=class In extends oi{constructor(t,e,i){const r=Ri.from(t||In.defaultVertexSrc,e||In.defaultFragmentSrc);super(r,i),this.padding=0,this.resolution=In.defaultResolution,this.multisample=In.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new ni}apply(t,e,i,r,n){t.applyFilter(this,e,i,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 Yx}static get defaultFragmentSrc(){return zx}};Uh.defaultResolution=1,Uh.defaultMultisample=Ht.NONE;let Yt=Uh;class ma{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new pt(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:i,backgroundAlpha:r}=t,n=i??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(){}}ma.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},ma.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"background"},z.add(ma);class tf{constructor(t){this.renderer=t,this.emptyRenderer=new pa(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:i}=this.renderer.texture;for(let r=e-1;r>=0;--r)t[r]=i[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,e,i,r){const{elements:n,ids:a,count:o}=t;let h=0;for(let l=0;l<o;l++){const c=n[l],d=c._batchLocation;if(d>=0&&d<r&&e[d]===c){a[l]=d;continue}for(;h<r;){const u=e[h];if(u&&u._batchEnabled===i&&u._batchLocation===h){h++;continue}a[l]=h,c._batchLocation=h,e[h]=c;break}}}destroy(){this.renderer=null}}tf.extension={type:G.RendererSystem,name:"batch"},z.add(tf);let ef=0;class _a{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=ef++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,i=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:i,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=ef++,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 i;if(H.PREFER_ENV>=qe.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,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(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=i||!!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")}}_a.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},_a.extension={type:G.RendererSystem,name:"context"},z.add(_a);class Gh{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 He("disposeFramebuffer"),this.multisample=Ht.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new J(null,{scaleMode:Ti.NEAREST,resolution:1,mipmap:Ke.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new J(null,{scaleMode:Ti.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ke.OFF,format:O.DEPTH_COMPONENT,type:Z.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 i=0;i<this.colorTextures.length;i++){const r=this.colorTextures[i],n=r.resolution;r.setSize(t/n,e/n)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(t/i,e/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class sf extends J{constructor(t={}){if(typeof t=="number"){const e=arguments[0],i=arguments[1],r=arguments[2],n=arguments[3];t={width:e,height:i,scaleMode:r,resolution:n}}t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=Ht.NONE),super(null,t),this.mipmap=Ke.OFF,this.valid=!0,this._clear=new pt([0,0,0,0]),this.framebuffer=new Gh(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 Jr{constructor(t){const e=t,i=e.naturalWidth||e.videoWidth||e.displayWidth||e.width,r=e.naturalHeight||e.videoHeight||e.displayHeight||e.height;super(i,r),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,i){i===void 0&&!e.startsWith("data:")?t.crossOrigin=gx(e):i!==!1&&(t.crossOrigin=typeof i=="string"?i:"anonymous")}upload(t,e,i,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===he.UNPACK),!this.noSubImage&&e.target===n.TEXTURE_2D&&i.width===a&&i.height===o?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,i.type,r):(i.width=a,i.height=o,n.texImage2D(e.target,0,i.internalFormat,e.format,i.type,r)),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,i=t.naturalHeight||t.videoHeight||t.height;this.resize(e,i),super.update()}dispose(){this.source=null}}class rf extends Ii{constructor(t,e){if(e=e||{},typeof t=="string"){const i=new Image;Ii.crossOrigin(i,t,e.crossorigin),i.src=t,t=i}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??H.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,i)=>{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=>{i(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,i=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:i?"cors":"no-cors"}).then(r=>r.blob()).then(r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===he.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,i){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,i,this.bitmap),!this.preserveBitmap){let r=!0;const n=e._glTextures;for(const a in n){const o=n[a];if(o!==i&&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 Hh{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,i){const r=e.width,n=e.height;if(i){const a=t.width/2/r,o=t.height/2/n,h=t.x/r+a,l=t.y/n+o;i=At.add(i,At.NW),this.x0=h+a*At.uX(i),this.y0=l+o*At.uY(i),i=At.add(i,2),this.x1=h+a*At.uX(i),this.y1=l+o*At.uY(i),i=At.add(i,2),this.x2=h+a*At.uX(i),this.y2=l+o*At.uY(i),i=At.add(i,2),this.x3=h+a*At.uX(i),this.y3=l+o*At.uY(i)}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}}Hh.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 nf=new Hh;function ga(s){s.destroy=function(){},s.on=function(){},s.once=function(){},s.emit=function(){}}class X extends Je{constructor(t,e,i,r,n,a,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new st(0,0,1,1)),t instanceof X&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=r,this.valid=!1,this.destroyed=!1,this._uvs=nf,this.uvMatrix=null,this.orig=i||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 tt(a.x,a.y):new tt(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&&ri[e.url]&&X.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,X.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(),i=new X(this.baseTexture,!this.noFrame&&t,e,(r=this.trim)==null?void 0:r.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=t),i}updateUvs(){this._uvs===nf&&(this._uvs=new Hh),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},i=H.STRICT_TEXTURE_CACHE){const r=typeof t=="string";let n=null;if(r)n=t;else if(t instanceof J){if(!t.cacheId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${o}-${_s()}`,J.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){const o=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${o}_${_s()}`}n=t._pixiId}let a=ri[n];if(r&&i&&!a)throw new Error(`The cacheId "${n}" does not exist in TextureCache.`);return!a&&!(t instanceof J)?(e.resolution||(e.resolution=Pi(t)),a=new X(new J(t,e)),a.baseTexture.cacheId=n,J.addToCache(a.baseTexture,n),X.addToCache(a,n)):!a&&t instanceof J&&(a=new X(t),X.addToCache(a,n)),a}static fromURL(t,e){const i=Object.assign({autoLoad:!1},e==null?void 0:e.resourceOptions),r=X.from(t,Object.assign({resourceOptions:i},e),!1),n=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):n.load().then(()=>Promise.resolve(r))}static fromBuffer(t,e,i,r){return new X(J.fromBuffer(t,e,i,r))}static fromLoader(t,e,i,r){const n=new J(t,Object.assign({scaleMode:J.defaultOptions.scaleMode,resolution:Pi(e)},r)),{resource:a}=n;a instanceof rf&&(a.url=e);const o=new X(n);return i||(i=e),J.addToCache(o.baseTexture,i),X.addToCache(o,i),i!==e&&(J.addToCache(o.baseTexture,e),X.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),ri[e]&&ri[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),ri[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=ri[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete ri[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)ri[t.textureCacheIds[e]]===t&&delete ri[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:i,width:r,height:n}=t,a=e+r>this.baseTexture.width,o=i+n>this.baseTexture.height;if(a||o){const h=a&&o?"and":"or",l=`X: ${e} + ${r} = ${e+r} > ${this.baseTexture.width}`,c=`Y: ${i} + ${n} = ${i+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 X._EMPTY||(X._EMPTY=new X(new J),ga(X._EMPTY),ga(X._EMPTY.baseTexture)),X._EMPTY}static get WHITE(){if(!X._WHITE){const t=H.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),X._WHITE=new X(J.from(t)),ga(X._WHITE),ga(X._WHITE.baseTexture)}return X._WHITE}}class Ts extends X{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,i=!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,i&&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 Ts(new sf(t))}}class af{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,i=Ht.NONE){const r=new sf(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new Ts(r)}getOptimalTexture(t,e,i=1,r=Ht.NONE){let n;t=Math.max(Math.ceil(t*i-1e-6),1),e=Math.max(Math.ceil(e*i-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=ea(t),e=ea(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(i),a}getFilterTexture(t,e,i){const r=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||Ht.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 i=this.texturePool[e];if(i)for(let r=0;r<i.length;r++)i[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 i=this.texturePool[e];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}af.SCREEN_KEY=-1;class jx extends Xi{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class of extends Xi{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 Nt(this.vertices),this.uvBuffer=new Nt(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let i=0,r=0;return this.uvs[0]=i,this.uvs[1]=r,this.uvs[2]=i+e.width/t.width,this.uvs[3]=r,this.uvs[4]=i+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=i,this.uvs[7]=r+e.height/t.height,i=e.x,r=e.y,this.vertices[0]=i,this.vertices[1]=r,this.vertices[2]=i+e.width,this.vertices[3]=r,this.vertices[4]=i+e.width,this.vertices[5]=r+e.height,this.vertices[6]=i,this.vertices[7]=r+e.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class qx{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Ht.NONE,this.sourceFrame=new st,this.destinationFrame=new st,this.bindingSourceFrame=new st,this.bindingDestinationFrame=new st,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const ya=[new tt,new tt,new tt,new tt],Vh=new gt;class hf{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new af,this.statePool=[],this.quad=new jx,this.quadUv=new of,this.tempRect=new st,this.activeState={},this.globalUniforms=new Ve({outputFrame:new st,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 i=this.renderer,r=this.defaultFilterStack,n=this.statePool.pop()||new qx,a=i.renderTexture;let o,h;if(a.current){const _=a.current;o=_.resolution,h=_.multisample}else o=i.resolution,h=i.multisample;let l=e[0].resolution||o,c=e[0].multisample??h,d=e[0].padding,u=e[0].autoFit,f=e[0].legacy??!0;for(let _=1;_<e.length;_++){const y=e[_];l=Math.min(l,y.resolution||o),c=Math.min(c,y.multisample??h),d=this.useMaxPadding?Math.max(d,y.padding):d+y.padding,u=u&&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(d);const p=this.tempRect.copyFrom(a.sourceFrame);i.projection.transform&&this.transformAABB(Vh.copyFrom(i.projection.transform).invert(),p),u?(n.sourceFrame.fit(p),(n.sourceFrame.width<=0||n.sourceFrame.height<=0)&&(n.sourceFrame.width=0,n.sourceFrame.height=0)):n.sourceFrame.intersects(p)||(n.sourceFrame.width=0,n.sourceFrame.height=0),this.roundFrame(n.sourceFrame,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.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 m=this.tempRect;m.x=0,m.y=0,m.width=n.sourceFrame.width,m.height=n.sourceFrame.height,n.renderTexture.filterFrame=n.sourceFrame,n.bindingSourceFrame.copyFrom(a.sourceFrame),n.bindingDestinationFrame.copyFrom(a.destinationFrame),n.transform=i.projection.transform,i.projection.transform=null,a.bind(n.renderTexture,n.sourceFrame,m),i.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),i=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(),i.length===1)i[0].apply(this,e.renderTexture,h.renderTexture,Ze.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 d=0;for(d=0;d<i.length-1;++d){d===1&&e.multisample>1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),i[d].apply(this,l,c,Ze.CLEAR,e);const u=l;l=c,c=u}i[d].apply(this,l,h.renderTexture,Ze.BLEND,e),d>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=Ze.CLEAR){const{renderTexture:i,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,i.bind(t,t.filterFrame,a)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=r.stateId&1||this.forceClear;(e===Ze.CLEAR||e===Ze.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,i,r){const n=this.renderer;n.state.set(t.state),this.bindAndClear(i,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(Ue.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(Ue.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:i,destinationFrame:r}=this.activeState,{orig:n}=e._texture,a=t.set(r.width,0,0,r.height,i.x,i.y),o=e.worldTransform.copyTo(gt.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,i=1,r=Ht.NONE){return this.texturePool.getOptimalTexture(t,e,i,r)}getFilterTexture(t,e,i){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,i||Ht.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 i=ya[0],r=ya[1],n=ya[2],a=ya[3];i.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(i,i),t.apply(r,r),t.apply(n,n),t.apply(a,a);const o=Math.min(i.x,r.x,n.x,a.x),h=Math.min(i.y,r.y,n.y,a.y),l=Math.max(i.x,r.x,n.x,a.x),c=Math.max(i.y,r.y,n.y,a.y);e.x=o,e.y=h,e.width=l-o,e.height=c-h}roundFrame(t,e,i,r,n){if(!(t.width<=0||t.height<=0||i.width<=0||i.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?Vh.copyFrom(n):Vh.identity(),n.translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.height).translate(r.x,r.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}}}hf.extension={type:G.RendererSystem,name:"filter"},z.add(hf);class Kx{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Ht.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const Zx=new st;class lf{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Gh(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 st,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;H.PREFER_ENV===qe.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=r=>e.drawBuffersWEBGL(r):(this.hasMRT=!1,t.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,i=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!==i&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=i),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):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>>i,o=e.height>>i,h=a/e.width;this.setViewport(e.x*h,e.y*h,a,o)}else{const a=t.width>>i,o=t.height>>i;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,i,r){const n=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),(n.width!==i||n.height!==r||n.x!==t||n.y!==e)&&(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,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,i,r,n=Eo.COLOR|Eo.DEPTH){const{gl:a}=this;a.clearColor(t,e,i,r),a.clear(n)}initFramebuffer(t){const{gl:e}=this,i=new Kx(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i}resizeFramebuffer(t){const{gl:e}=this,i=t.glFramebuffers[this.CONTEXT_UID];if(i.stencil){e.bindRenderbuffer(e.RENDERBUFFER,i.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,i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.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&&i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.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:i}=this,r=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures;let a=n.length;i.drawBuffers||(a=Math.min(a,1)),r.multisample>1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||i.createRenderbuffer():r.msaaBuffer&&(i.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?(i.bindRenderbuffer(i.RENDERBUFFER,r.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,c._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,r.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,l.target,c._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){r.stencil=r.stencil||i.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):t.depth&&t.stencil?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):t.depth?(h=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(h=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,r.stencil),r.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,l,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,l,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,h,i.RENDERBUFFER,r.stencil)}else r.stencil&&(i.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 i=Ht.NONE;if(t<=1||e===null)return i;for(let r=0;r<e.length;r++)if(e[r]<=t){i=e[r];break}return i===1&&(i=Ht.NONE),i}blit(t,e,i){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 Gh(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=Zx,e.width=r.width,e.height=r.height),i||(i=e);const l=e.width===i.width&&e.height===i.height;this.bind(t),a.bindFramebuffer(a.READ_FRAMEBUFFER,h.framebuffer),a.blitFramebuffer(e.left,e.top,e.right,e.bottom,i.left,i.top,i.right,i.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 i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(!i)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(i.framebuffer),i.msaaBuffer&&r.deleteRenderbuffer(i.msaaBuffer),i.stencil&&r.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<e.length;i++)this.disposeFramebuffer(e[i],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 i=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,i,r):n.renderbufferStorage(n.RENDERBUFFER,h,i,r),n.framebufferRenderbuffer(n.FRAMEBUFFER,o,n.RENDERBUFFER,a)}reset(){this.current=this.unknownFramebuffer,this.viewport=new st}destroy(){this.renderer=null}}lf.extension={type:G.RendererSystem,name:"framebuffer"},z.add(lf);const Wh={5126:4,5123:2,5121:1};class cf{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 i=this.renderer.context.extensions.vertexArrayObject;H.PREFER_ENV===qe.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=()=>i.createVertexArrayOES(),t.bindVertexArray=r=>i.bindVertexArrayOES(r),t.deleteVertexArray=r=>i.deleteVertexArrayOES(r)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=(r,n)=>i.vertexAttribDivisorANGLE(r,n),t.drawElementsInstanced=(r,n,a,o,h)=>i.drawElementsInstancedANGLE(r,n,a,o,h),t.drawArraysInstanced=(r,n,a,o)=>i.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:i}=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?i.bindVertexArray(a):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let i=0;i<t.buffers.length;i++){const r=t.buffers[i];e.update(r)}}checkCompatibility(t,e){const i=t.attributes,r=e.attributeData;for(const n in r)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(t,e){const i=t.attributes,r=e.attributeData,n=["g",t.id];for(const a in i)r[a]&&n.push(a,r[a].location);return n.join("-")}initGeometryVao(t,e,i=!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 d=t.buffers,u=t.attributes,f={},p={};for(const m in d)f[m]=0,p[m]=0;for(const m in u)!u[m].size&&o.attributeData[m]?u[m].size=o.attributeData[m].size:u[m].size||console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`),f[u[m].buffer]+=u[m].size*Wh[u[m].type];for(const m in u){const _=u[m],y=_.size;_.stride===void 0&&(f[_.buffer]===y*Wh[_.type]?_.stride=0:_.stride=f[_.buffer]),_.start===void 0&&(_.start=p[_.buffer],p[_.buffer]+=y*Wh[_.type])}c=r.createVertexArray(),r.bindVertexArray(c);for(let m=0;m<d.length;m++){const _=d[m];a.bind(_),i&&_._glBuffers[n].refCount++}return this.activateVao(t,o),l[o.id]=c,l[h]=c,r.bindVertexArray(null),a.unbind(Qe.ARRAY_BUFFER),c}disposeGeometry(t,e){var o;if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const i=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),!!i){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 i)if(h[0]==="g"){const l=i[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 i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t)}activateVao(t,e){const i=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],d=a[c.buffer],u=d._glBuffers[r];if(e.attributeData[l]){h!==u&&(n.bind(d),h=u);const f=e.attributeData[l].location;if(i.enableVertexAttribArray(f),i.vertexAttribPointer(f,c.size,c.type||i.FLOAT,c.normalized,c.stride,c.start),c.instance)if(this.hasInstance)i.vertexAttribDivisor(f,c.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(t,e,i,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,(i||0)*o,r||1):n.drawElements(t,e||a.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?n.drawArraysInstanced(t,i,e||a.getSize(),r||1):n.drawArrays(t,i,e||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}cf.extension={type:G.RendererSystem,name:"geometry"},z.add(cf);const uf=new gt;class df{constructor(t,e){this._texture=t,this.mapCoord=new gt,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 i=this.mapCoord;for(let r=0;r<t.length;r+=2){const n=t[r],a=t[r+1];e[r]=n*i.a+a*i.c+i.tx,e[r+1]=n*i.b+a*i.d+i.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 i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const r=e.orig,n=e.trim;n&&(uf.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(uf));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 Qx=`varying vec2 vMaskCoord;
|
|
379
379
|
varying vec2 vTextureCoord;
|
|
380
380
|
|
|
381
381
|
uniform sampler2D uSampler;
|
|
@@ -400,7 +400,7 @@ void main(void)
|
|
|
400
400
|
|
|
401
401
|
gl_FragColor = original;
|
|
402
402
|
}
|
|
403
|
-
`,
|
|
403
|
+
`,Jx=`attribute vec2 aVertexPosition;
|
|
404
404
|
attribute vec2 aTextureCoord;
|
|
405
405
|
|
|
406
406
|
uniform mat3 projectionMatrix;
|
|
@@ -416,7 +416,7 @@ void main(void)
|
|
|
416
416
|
vTextureCoord = aTextureCoord;
|
|
417
417
|
vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
|
|
418
418
|
}
|
|
419
|
-
`;class Hx extends Yt{constructor(t,e,i){let r=null;typeof t!="string"&&e===void 0&&i===void 0&&(r=t,t=void 0,e=void 0,i=void 0),super(t||Gx,e||Ux,i),this.maskSprite=r,this.maskMatrix=new gt}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,i,r){const n=this._maskSprite,a=n._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new nf(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,i,r))}}class Vx{constructor(t=null){this.type=Vt.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Yt.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=Vt.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 af{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 i=e;if(!i.isMaskData){const n=this.maskDataPool.pop()||new Vx;n.pooled=!0,n.maskObject=e,i=n}const r=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(r),i._colorMask=r?r._colorMask:15,i.autoDetect&&this.detect(i),i._target=t,i.type!==Vt.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Vt.SCISSOR:this.renderer.scissor.push(i);break;case Vt.STENCIL:this.renderer.stencil.push(i);break;case Vt.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Vt.COLOR:this.pushColorMask(i);break}i.type===Vt.SPRITE&&this.maskStack.push(i)}pop(t){const e=this.maskStack.pop();if(!(!e||e._target!==t)){if(e.enabled)switch(e.type){case Vt.SCISSOR:this.renderer.scissor.pop(e);break;case Vt.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case Vt.SPRITE:this.popSpriteMask(e);break;case Vt.COLOR:this.popColorMask(e);break}if(e.reset(),e.pooled&&this.maskDataPool.push(e),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===Vt.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=Vt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Vt.SCISSOR:t.type=Vt.STENCIL:t.type=Vt.COLOR}pushSpriteMask(t){const{maskObject:e}=t,i=t._target;let r=t._filters;r||(r=this.alphaMaskPool[this.alphaMaskIndex],r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new Hx])),r[0].resolution=t.resolution,r[0].multisample=t.multisample,r[0].maskSprite=e;const n=i.filterArea;i.filterArea=e.getBounds(!0),this.renderer.filter.push(i,r),i.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,i=t._colorMask=e&t.colorMask;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(t){const e=t._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}af.extension={type:G.RendererSystem,name:"mask"},Y.add(af);class of{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,i=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==i&&(r===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const hf=new gt,lf=[],cf=class mo extends of{constructor(t){super(t),this.glConst=H.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:i}=t,{renderer:r}=this,n=r.renderTexture,a=i.getBounds(!0,lf.pop()??new st);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:i,c:r,d:n}=t;return(Math.abs(i)>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()||mo.isMatrixRotated(e.worldTransform)||mo.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const i=t._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(t,e,i,r,n){mo.isMatrixRotated(n)||(n=n?hf.copyFrom(n):hf.identity(),n.translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.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&&lf.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)}};cf.extension={type:G.RendererSystem,name:"scissor"};let Wx=cf;Y.add(Wx);class uf extends of{constructor(t){super(t),this.glConst=H.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:i}=this.renderer,r=t._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;const n=t._colorMask;n!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,r,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(t._colorMask=n,i.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 i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,r=i?i._colorMask:15;r!==0&&(i._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&&(i._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)}}uf.extension={type:G.RendererSystem,name:"stencil"},Y.add(uf);class df{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return it("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return it("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return it("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}}df.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"_plugin"},Y.add(df);class ff{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new gt,this.transform=null}update(t,e,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,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,i,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}}ff.extension={type:G.RendererSystem,name:"projection"},Y.add(ff);const Xx=new ha,pf=new st;class mf{constructor(t){this.renderer=t,this._tempMatrix=new gt}generateTexture(t,e){const{region:i,...r}=e||{},n=(i==null?void 0:i.copyTo(pf))||t.getLocalBounds(pf,!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=bs.create(r);this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const h=t.transform;return t.transform=Xx,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=h,o}destroy(){}}mf.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"textureGenerator"},Y.add(mf);const Ts=new st,en=new st;class gf{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new st,this.destinationFrame=new st,this.viewportFrame=new st}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,i){const r=this.renderer;this.current=t;let n,a,o;t?(n=t.baseTexture,o=n.resolution,e||(Ts.width=t.frame.width,Ts.height=t.frame.height,e=Ts),i||(en.x=t.frame.x,en.y=t.frame.y,en.width=e.width,en.height=e.height,i=en),a=n.framebuffer):(o=r.resolution,e||(Ts.width=r._view.screen.width,Ts.height=r._view.screen.height,e=Ts),i||(i=Ts,i.width=e.width,i.height=e.height));const h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,t||(h.y=r.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,e,o,!a),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)}clear(t,e){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=ft.shared.setValue(t||i);(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:d}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),d=Math.round(d),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,d)}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}}gf.extension={type:G.RendererSystem,name:"renderTexture"},Y.add(gf);class zx{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 $x(s,t){const e={},i=t.getProgramParameter(s,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const n=t.getActiveAttrib(s,r);if(n.name.startsWith("gl_"))continue;const a=zd(t,n.type),o={type:a,name:n.name,size:Wd(a),location:t.getAttribLocation(s,n.name)};e[n.name]=o}return e}function Yx(s,t){const e={},i=t.getProgramParameter(s,t.ACTIVE_UNIFORMS);for(let r=0;r<i;r++){const n=t.getActiveUniform(s,r),a=n.name.replace(/\[.*?\]$/,""),o=!!n.name.match(/\[.*?\]$/),h=zd(t,n.type);e[a]={name:a,index:r,type:h,size:n.size,isArray:o,value:Gd(h,n.size)}}return e}function jx(s,t){var o;const e=Ud(s,s.VERTEX_SHADER,t.vertexSrc),i=Ud(s,s.FRAGMENT_SHADER,t.fragmentSrc),r=s.createProgram();s.attachShader(r,e),s.attachShader(r,i);const n=(o=t.extra)==null?void 0:o.transformFeedbackVaryings;if(n&&(typeof s.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):s.transformFeedbackVaryings(r,n.names,n.bufferMode==="separate"?s.SEPARATE_ATTRIBS:s.INTERLEAVED_ATTRIBS)),s.linkProgram(r),s.getProgramParameter(r,s.LINK_STATUS)||wx(s,r,e,i),t.attributeData=$x(r,s),t.uniformData=Yx(r,s),!/^[ \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,s.bindAttribLocation(r,l,h[l]);s.linkProgram(r)}s.deleteShader(e),s.deleteShader(i);const a={};for(const h in t.uniformData){const l=t.uniformData[h];a[h]={location:s.getUniformLocation(r,h),value:Gd(l.type,l.size)}}return new zx(r,a)}function qx(s,t,e,i,r){e.buffer.update(r)}const Kx={float:`
|
|
419
|
+
`;class tv extends Yt{constructor(t,e,i){let r=null;typeof t!="string"&&e===void 0&&i===void 0&&(r=t,t=void 0,e=void 0,i=void 0),super(t||Jx,e||Qx,i),this.maskSprite=r,this.maskMatrix=new gt}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,i,r){const n=this._maskSprite,a=n._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new df(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,i,r))}}class ev{constructor(t=null){this.type=Wt.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Yt.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=Wt.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 ff{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 i=e;if(!i.isMaskData){const n=this.maskDataPool.pop()||new ev;n.pooled=!0,n.maskObject=e,i=n}const r=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(r),i._colorMask=r?r._colorMask:15,i.autoDetect&&this.detect(i),i._target=t,i.type!==Wt.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Wt.SCISSOR:this.renderer.scissor.push(i);break;case Wt.STENCIL:this.renderer.stencil.push(i);break;case Wt.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Wt.COLOR:this.pushColorMask(i);break}i.type===Wt.SPRITE&&this.maskStack.push(i)}pop(t){const e=this.maskStack.pop();if(!(!e||e._target!==t)){if(e.enabled)switch(e.type){case Wt.SCISSOR:this.renderer.scissor.pop(e);break;case Wt.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case Wt.SPRITE:this.popSpriteMask(e);break;case Wt.COLOR:this.popColorMask(e);break}if(e.reset(),e.pooled&&this.maskDataPool.push(e),this.maskStack.length!==0){const i=this.maskStack[this.maskStack.length-1];i.type===Wt.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=Wt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=Wt.SCISSOR:t.type=Wt.STENCIL:t.type=Wt.COLOR}pushSpriteMask(t){const{maskObject:e}=t,i=t._target;let r=t._filters;r||(r=this.alphaMaskPool[this.alphaMaskIndex],r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new tv])),r[0].resolution=t.resolution,r[0].multisample=t.multisample,r[0].maskSprite=e;const n=i.filterArea;i.filterArea=e.getBounds(!0),this.renderer.filter.push(i,r),i.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,i=t._colorMask=e&t.colorMask;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}popColorMask(t){const e=t._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}ff.extension={type:G.RendererSystem,name:"mask"},z.add(ff);class pf{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,i=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==i&&(r===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const mf=new gt,_f=[],gf=class vo extends pf{constructor(t){super(t),this.glConst=H.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:i}=t,{renderer:r}=this,n=r.renderTexture,a=i.getBounds(!0,_f.pop()??new st);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:i,c:r,d:n}=t;return(Math.abs(i)>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()||vo.isMatrixRotated(e.worldTransform)||vo.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const i=t._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(t,e,i,r,n){vo.isMatrixRotated(n)||(n=n?mf.copyFrom(n):mf.identity(),n.translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.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&&_f.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)}};gf.extension={type:G.RendererSystem,name:"scissor"};let iv=gf;z.add(iv);class yf extends pf{constructor(t){super(t),this.glConst=H.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:i}=this.renderer,r=t._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;const n=t._colorMask;n!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,r,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,n!==0&&(t._colorMask=n,i.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 i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,r=i?i._colorMask:15;r!==0&&(i._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&&(i._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)}}yf.extension={type:G.RendererSystem,name:"stencil"},z.add(yf);class xf{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return it("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return it("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return it("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}}xf.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"_plugin"},z.add(xf);class vf{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new gt,this.transform=null}update(t,e,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,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,i,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}}vf.extension={type:G.RendererSystem,name:"projection"},z.add(vf);const sv=new ca,bf=new st;class Tf{constructor(t){this.renderer=t,this._tempMatrix=new gt}generateTexture(t,e){const{region:i,...r}=e||{},n=(i==null?void 0:i.copyTo(bf))||t.getLocalBounds(bf,!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=Ts.create(r);this._tempMatrix.tx=-n.x,this._tempMatrix.ty=-n.y;const h=t.transform;return t.transform=sv,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=h,o}destroy(){}}Tf.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"textureGenerator"},z.add(Tf);const ws=new st,sn=new st;class wf{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new st,this.destinationFrame=new st,this.viewportFrame=new st}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,i){const r=this.renderer;this.current=t;let n,a,o;t?(n=t.baseTexture,o=n.resolution,e||(ws.width=t.frame.width,ws.height=t.frame.height,e=ws),i||(sn.x=t.frame.x,sn.y=t.frame.y,sn.width=e.width,sn.height=e.height,i=sn),a=n.framebuffer):(o=r.resolution,e||(ws.width=r._view.screen.width,ws.height=r._view.screen.height,e=ws),i||(i=ws,i.width=e.width,i.height=e.height));const h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,t||(h.y=r.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,e,o,!a),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)}clear(t,e){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=pt.shared.setValue(t||i);(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:d}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),d=Math.round(d),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,d)}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}}wf.extension={type:G.RendererSystem,name:"renderTexture"},z.add(wf);class rv{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 nv(s,t){const e={},i=t.getProgramParameter(s,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const n=t.getActiveAttrib(s,r);if(n.name.startsWith("gl_"))continue;const a=Qd(t,n.type),o={type:a,name:n.name,size:Kd(a),location:t.getAttribLocation(s,n.name)};e[n.name]=o}return e}function av(s,t){const e={},i=t.getProgramParameter(s,t.ACTIVE_UNIFORMS);for(let r=0;r<i;r++){const n=t.getActiveUniform(s,r),a=n.name.replace(/\[.*?\]$/,""),o=!!n.name.match(/\[.*?\]$/),h=Qd(t,n.type);e[a]={name:a,index:r,type:h,size:n.size,isArray:o,value:Yd(h,n.size)}}return e}function ov(s,t){var o;const e=zd(s,s.VERTEX_SHADER,t.vertexSrc),i=zd(s,s.FRAGMENT_SHADER,t.fragmentSrc),r=s.createProgram();s.attachShader(r,e),s.attachShader(r,i);const n=(o=t.extra)==null?void 0:o.transformFeedbackVaryings;if(n&&(typeof s.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):s.transformFeedbackVaryings(r,n.names,n.bufferMode==="separate"?s.SEPARATE_ATTRIBS:s.INTERLEAVED_ATTRIBS)),s.linkProgram(r),s.getProgramParameter(r,s.LINK_STATUS)||Lx(s,r,e,i),t.attributeData=nv(r,s),t.uniformData=av(r,s),!/^[ \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,s.bindAttribLocation(r,l,h[l]);s.linkProgram(r)}s.deleteShader(e),s.deleteShader(i);const a={};for(const h in t.uniformData){const l=t.uniformData[h];a[h]={location:s.getUniformLocation(r,h),value:Yd(l.type,l.size)}}return new rv(r,a)}function hv(s,t,e,i,r){e.buffer.update(r)}const lv={float:`
|
|
420
420
|
data[offset] = v;
|
|
421
421
|
`,vec2:`
|
|
422
422
|
data[offset] = v[0];
|
|
@@ -454,7 +454,7 @@ void main(void)
|
|
|
454
454
|
{
|
|
455
455
|
data[offset + i] = v[i];
|
|
456
456
|
}
|
|
457
|
-
`},
|
|
457
|
+
`},Ef={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:16*2,mat3:16*3,mat4:16*4};function cv(s){const t=s.map(n=>({data:n,offset:0,dataLen:0,dirty:0}));let e=0,i=0,r=0;for(let n=0;n<t.length;n++){const a=t[n];if(e=Ef[a.data.type],a.data.size>1&&(e=Math.max(e,16)*a.data.size),a.dataLen=e,i%e!==0&&i<16){const o=i%e%16;i+=o,r+=o}i+e>16?(r=Math.ceil(r/16)*16,a.offset=r,r+=e,i=e):(a.offset=r,i+=e,r+=e)}return r=Math.ceil(r/16)*16,{uboElements:t,size:r}}function uv(s,t){const e=[];for(const i in s)t[i]&&e.push(t[i]);return e.sort((i,r)=>i.index-r.index),e}function dv(s,t){if(!s.autoManage)return{size:0,syncFunc:hv};const e=uv(s.uniforms,t),{uboElements:i,size:r}=cv(e),n=[`
|
|
458
458
|
var v = null;
|
|
459
459
|
var v2 = null;
|
|
460
460
|
var cv = null;
|
|
@@ -462,7 +462,7 @@ void main(void)
|
|
|
462
462
|
var gl = renderer.gl
|
|
463
463
|
var index = 0;
|
|
464
464
|
var data = buffer.data;
|
|
465
|
-
`];for(let a=0;a<i.length;a++){const o=i[a],h=s.uniforms[o.data.name],l=o.data.name;let c=!1;for(let d=0;d<
|
|
465
|
+
`];for(let a=0;a<i.length;a++){const o=i[a],h=s.uniforms[o.data.name],l=o.data.name;let c=!1;for(let d=0;d<sr.length;d++){const u=sr[d];if(u.codeUbo&&u.test(o.data,h)){n.push(`offset = ${o.offset/4};`,sr[d].codeUbo(o.data.name,h)),c=!0;break}}if(!c)if(o.data.size>1){const d=Kd(o.data.type),u=Math.max(Ef[o.data.type]/16,1),f=d/u,p=(4-f%4)%4;n.push(`
|
|
466
466
|
cv = ud.${l}.value;
|
|
467
467
|
v = uv.${l};
|
|
468
468
|
offset = ${o.offset/4};
|
|
@@ -478,7 +478,7 @@ void main(void)
|
|
|
478
478
|
offset += ${p};
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
`)}else{const d=
|
|
481
|
+
`)}else{const d=lv[o.data.type];n.push(`
|
|
482
482
|
cv = ud.${l}.value;
|
|
483
483
|
v = uv.${l};
|
|
484
484
|
offset = ${o.offset/4};
|
|
@@ -486,7 +486,7 @@ void main(void)
|
|
|
486
486
|
`)}}return n.push(`
|
|
487
487
|
renderer.buffer.update(buffer);
|
|
488
488
|
`),{size:r,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join(`
|
|
489
|
-
`))}}let tv=0;const _a={textureCount:0,uboCount:0};class yf{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=tv++}systemCheck(){if(!Ax())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 i=t.program,r=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(r.program)),e||(_a.textureCount=0,_a.uboCount=0,this.syncUniformGroup(t.uniformGroup,_a)),r}setUniforms(t){const e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)}syncUniformGroup(t,e){const i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))}syncUniforms(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=vx(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const i=this.getGlProgram();if(!t.static||t.dirtyId!==0||!i.uniformGroups[t.id]){t.dirtyId=0;const r=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),r(i.uniformData,t.uniforms,this.renderer,_a,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])}createSyncBufferGroup(t,e,i){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const n=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=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]=Jx(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,i){const r=t.uniforms,n=[`${i}-`];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,i=t.program,r=jx(e,i);return i.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}}yf.extension={type:G.RendererSystem,name:"shader"},Y.add(yf);class ya{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.2 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}ya.defaultOptions={hello:!1},ya.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"startup"},Y.add(ya);function ev(s,t=[]){return t[K.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.ADD]=[s.ONE,s.ONE],t[K.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.NONE]=[0,0],t[K.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],t[K.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SRC_IN]=[s.DST_ALPHA,s.ZERO],t[K.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],t[K.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],t[K.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],t[K.DST_IN]=[s.ZERO,s.SRC_ALPHA],t[K.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],t[K.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],t[K.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],t[K.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],t}const iv=0,sv=1,rv=2,nv=3,av=4,ov=5,xf=class Uc{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=K.NONE,this._blendEq=!1,this.map=[],this.map[iv]=this.setBlend,this.map[sv]=this.setOffset,this.map[rv]=this.setCullFace,this.map[nv]=this.setDepthTest,this.map[av]=this.setFrontFace,this.map[ov]=this.setDepthMask,this.checks=[],this.defaultState=new ri,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=ev(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;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(Uc.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(Uc.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],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.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 i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};xf.extension={type:G.RendererSystem,name:"state"};let hv=xf;Y.add(hv);class lv extends kr{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter(r=>t.systems[r]),i=[...e,...Object.keys(t.systems).filter(r=>!e.includes(r))];for(const r of i)this.addSystem(t.systems[r],r)}addRunners(...t){t.forEach(e=>{this.runners[e]=new Ge(e)})}addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}emitWithCustomOptions(t,e){const i=Object.keys(this._systemsHash);t.items.forEach(r=>{const n=i.find(a=>this._systemsHash[a]===r);r[t.name](e[n])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const sn=class go{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=go.defaultMaxIdle,this.checkCountMax=go.defaultCheckCountMax,this.mode=go.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==vo.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let i=!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,i=!0)}if(i){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,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(let r=t.children.length-1;r>=0;r--)this.unload(t.children[r])}destroy(){this.renderer=null}};sn.defaultMode=vo.AUTO,sn.defaultMaxIdle=60*60,sn.defaultCheckCountMax=60*10,sn.extension={type:G.RendererSystem,name:"textureGC"};let ws=sn;Y.add(ws);class Uh{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=Z.UNSIGNED_BYTE,this.internalFormat=O.RGBA,this.samplerType=0}}function cv(s){let t;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?t={[s.RGB]:V.FLOAT,[s.RGBA]:V.FLOAT,[s.ALPHA]:V.FLOAT,[s.LUMINANCE]:V.FLOAT,[s.LUMINANCE_ALPHA]:V.FLOAT,[s.R8]:V.FLOAT,[s.R8_SNORM]:V.FLOAT,[s.RG8]:V.FLOAT,[s.RG8_SNORM]:V.FLOAT,[s.RGB8]:V.FLOAT,[s.RGB8_SNORM]:V.FLOAT,[s.RGB565]:V.FLOAT,[s.RGBA4]:V.FLOAT,[s.RGB5_A1]:V.FLOAT,[s.RGBA8]:V.FLOAT,[s.RGBA8_SNORM]:V.FLOAT,[s.RGB10_A2]:V.FLOAT,[s.RGB10_A2UI]:V.FLOAT,[s.SRGB8]:V.FLOAT,[s.SRGB8_ALPHA8]:V.FLOAT,[s.R16F]:V.FLOAT,[s.RG16F]:V.FLOAT,[s.RGB16F]:V.FLOAT,[s.RGBA16F]:V.FLOAT,[s.R32F]:V.FLOAT,[s.RG32F]:V.FLOAT,[s.RGB32F]:V.FLOAT,[s.RGBA32F]:V.FLOAT,[s.R11F_G11F_B10F]:V.FLOAT,[s.RGB9_E5]:V.FLOAT,[s.R8I]:V.INT,[s.R8UI]:V.UINT,[s.R16I]:V.INT,[s.R16UI]:V.UINT,[s.R32I]:V.INT,[s.R32UI]:V.UINT,[s.RG8I]:V.INT,[s.RG8UI]:V.UINT,[s.RG16I]:V.INT,[s.RG16UI]:V.UINT,[s.RG32I]:V.INT,[s.RG32UI]:V.UINT,[s.RGB8I]:V.INT,[s.RGB8UI]:V.UINT,[s.RGB16I]:V.INT,[s.RGB16UI]:V.UINT,[s.RGB32I]:V.INT,[s.RGB32UI]:V.UINT,[s.RGBA8I]:V.INT,[s.RGBA8UI]:V.UINT,[s.RGBA16I]:V.INT,[s.RGBA16UI]:V.UINT,[s.RGBA32I]:V.INT,[s.RGBA32UI]:V.UINT,[s.DEPTH_COMPONENT16]:V.FLOAT,[s.DEPTH_COMPONENT24]:V.FLOAT,[s.DEPTH_COMPONENT32F]:V.FLOAT,[s.DEPTH_STENCIL]:V.FLOAT,[s.DEPTH24_STENCIL8]:V.FLOAT,[s.DEPTH32F_STENCIL8]:V.FLOAT}:t={[s.RGB]:V.FLOAT,[s.RGBA]:V.FLOAT,[s.ALPHA]:V.FLOAT,[s.LUMINANCE]:V.FLOAT,[s.LUMINANCE_ALPHA]:V.FLOAT,[s.DEPTH_STENCIL]:V.FLOAT},t}function uv(s){let t;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?t={[Z.UNSIGNED_BYTE]:{[O.RGBA]:s.RGBA8,[O.RGB]:s.RGB8,[O.RG]:s.RG8,[O.RED]:s.R8,[O.RGBA_INTEGER]:s.RGBA8UI,[O.RGB_INTEGER]:s.RGB8UI,[O.RG_INTEGER]:s.RG8UI,[O.RED_INTEGER]:s.R8UI,[O.ALPHA]:s.ALPHA,[O.LUMINANCE]:s.LUMINANCE,[O.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Z.BYTE]:{[O.RGBA]:s.RGBA8_SNORM,[O.RGB]:s.RGB8_SNORM,[O.RG]:s.RG8_SNORM,[O.RED]:s.R8_SNORM,[O.RGBA_INTEGER]:s.RGBA8I,[O.RGB_INTEGER]:s.RGB8I,[O.RG_INTEGER]:s.RG8I,[O.RED_INTEGER]:s.R8I},[Z.UNSIGNED_SHORT]:{[O.RGBA_INTEGER]:s.RGBA16UI,[O.RGB_INTEGER]:s.RGB16UI,[O.RG_INTEGER]:s.RG16UI,[O.RED_INTEGER]:s.R16UI,[O.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[Z.SHORT]:{[O.RGBA_INTEGER]:s.RGBA16I,[O.RGB_INTEGER]:s.RGB16I,[O.RG_INTEGER]:s.RG16I,[O.RED_INTEGER]:s.R16I},[Z.UNSIGNED_INT]:{[O.RGBA_INTEGER]:s.RGBA32UI,[O.RGB_INTEGER]:s.RGB32UI,[O.RG_INTEGER]:s.RG32UI,[O.RED_INTEGER]:s.R32UI,[O.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[Z.INT]:{[O.RGBA_INTEGER]:s.RGBA32I,[O.RGB_INTEGER]:s.RGB32I,[O.RG_INTEGER]:s.RG32I,[O.RED_INTEGER]:s.R32I},[Z.FLOAT]:{[O.RGBA]:s.RGBA32F,[O.RGB]:s.RGB32F,[O.RG]:s.RG32F,[O.RED]:s.R32F,[O.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[Z.HALF_FLOAT]:{[O.RGBA]:s.RGBA16F,[O.RGB]:s.RGB16F,[O.RG]:s.RG16F,[O.RED]:s.R16F},[Z.UNSIGNED_SHORT_5_6_5]:{[O.RGB]:s.RGB565},[Z.UNSIGNED_SHORT_4_4_4_4]:{[O.RGBA]:s.RGBA4},[Z.UNSIGNED_SHORT_5_5_5_1]:{[O.RGBA]:s.RGB5_A1},[Z.UNSIGNED_INT_2_10_10_10_REV]:{[O.RGBA]:s.RGB10_A2,[O.RGBA_INTEGER]:s.RGB10_A2UI},[Z.UNSIGNED_INT_10F_11F_11F_REV]:{[O.RGB]:s.R11F_G11F_B10F},[Z.UNSIGNED_INT_5_9_9_9_REV]:{[O.RGB]:s.RGB9_E5},[Z.UNSIGNED_INT_24_8]:{[O.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[Z.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[O.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:t={[Z.UNSIGNED_BYTE]:{[O.RGBA]:s.RGBA,[O.RGB]:s.RGB,[O.ALPHA]:s.ALPHA,[O.LUMINANCE]:s.LUMINANCE,[O.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Z.UNSIGNED_SHORT_5_6_5]:{[O.RGB]:s.RGB},[Z.UNSIGNED_SHORT_4_4_4_4]:{[O.RGBA]:s.RGBA},[Z.UNSIGNED_SHORT_5_5_5_1]:{[O.RGBA]:s.RGBA}},t}class vf{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new J,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=uv(t),this.samplerTypes=cv(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 i=new Uh(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.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]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Uh(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:i}=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,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,r.texture)),r.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)):r.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.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:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let r=0;r<i.length;r++)i[r]===this.unknownTexture&&this.bind(null,r)}for(let r=0;r<i.length;r++)i[r]===t&&(this.currentLocation!==r&&(e.activeTexture(e.TEXTURE0+r),this.currentLocation=r),e.bindTexture(t.target,this.emptyTextures[t.target].texture),i[r]=null)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:i,CONTEXT_UID:r}=this;if(i)for(let n=t-1;n>=0;--n){const a=e[n];a&&a._glTextures[r].samplerType!==V.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const e=new Uh(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 i;e.internalFormat=((i=this.internalFormats[t.type])==null?void 0:i[t.format])??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??V.FLOAT,this.webGLVersion===2&&t.type===Z.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 i=this.renderer;if(this.initTextureType(t,e),(r=t.resource)==null?void 0:r.upload(i,t,e))e.samplerType!==V.FLOAT&&(this.hasIntegerTextures=!0);else{const n=t.realWidth,a=t.realHeight,o=i.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:i}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.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&&er(this.managedTextures,r,1)}}updateTextureStyle(t){var i;const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===Ke.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ni.CLAMP:e.wrapMode=t.wrapMode,(i=t.resource)!=null&&i.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const i=this.gl;if(e.mipmap&&t.mipmap!==Ke.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===bi.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===bi.LINEAR){const n=Math.min(t.anisotropicLevel,i.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===bi.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===bi.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}vf.extension={type:G.RendererSystem,name:"texture"},Y.add(vf);class bf{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:i}=this,r=t._glTransformFeedbacks[i]||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:i,renderer:r}=this;e&&r.shader.bind(e),i.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:i,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&&(i.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 i=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))}i&&(e||r.deleteTransformFeedback(i),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}bf.extension={type:G.RendererSystem,name:"transformFeedback"},Y.add(bf);class xa{constructor(t){this.renderer=t}init(t){this.screen=new st(0,0,t.width,t.height),this.element=t.view||H.ADAPTER.createCanvas(),this.resolution=t.resolution||H.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 i=this.element.width/this.resolution,r=this.element.height/this.resolution;this.screen.width=i,this.screen.height=r,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${r}px`),this.renderer.emit("resize",i,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}}xa.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},xa.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"_view"},Y.add(xa),H.PREFER_ENV=qe.WEBGL2,H.STRICT_TEXTURE_CACHE=!1,H.RENDER_OPTIONS={...pa.defaultOptions,...fa.defaultOptions,...xa.defaultOptions,...ya.defaultOptions},Object.defineProperties(H,{WRAP_MODE:{get(){return J.defaultOptions.wrapMode},set(s){it("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),J.defaultOptions.wrapMode=s}},SCALE_MODE:{get(){return J.defaultOptions.scaleMode},set(s){it("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),J.defaultOptions.scaleMode=s}},MIPMAP_TEXTURES:{get(){return J.defaultOptions.mipmap},set(s){it("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),J.defaultOptions.mipmap=s}},ANISOTROPIC_LEVEL:{get(){return J.defaultOptions.anisotropicLevel},set(s){it("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),J.defaultOptions.anisotropicLevel=s}},FILTER_RESOLUTION:{get(){return it("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Yt.defaultResolution},set(s){Yt.defaultResolution=s}},FILTER_MULTISAMPLE:{get(){return it("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Yt.defaultMultisample},set(s){Yt.defaultMultisample=s}},SPRITE_MAX_TEXTURES:{get(){return vs.defaultMaxTextures},set(s){it("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),vs.defaultMaxTextures=s}},SPRITE_BATCH_SIZE:{get(){return vs.defaultBatchSize},set(s){it("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),vs.defaultBatchSize=s}},CAN_UPLOAD_SAME_BUFFER:{get(){return vs.canUploadSameBuffer},set(s){it("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),vs.canUploadSameBuffer=s}},GC_MODE:{get(){return ws.defaultMode},set(s){it("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),ws.defaultMode=s}},GC_MAX_IDLE:{get(){return ws.defaultMaxIdle},set(s){it("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),ws.defaultMaxIdle=s}},GC_MAX_CHECK_COUNT:{get(){return ws.defaultCheckCountMax},set(s){it("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),ws.defaultCheckCountMax=s}},PRECISION_VERTEX:{get(){return Pi.defaultVertexPrecision},set(s){it("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Pi.defaultVertexPrecision=s}},PRECISION_FRAGMENT:{get(){return Pi.defaultFragmentPrecision},set(s){it("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Pi.defaultFragmentPrecision=s}}});var zi=(s=>(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(zi||{});class Gh{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,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 Tf=class Se{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 Gh(null,null,1/0),this.deltaMS=1/Se.targetFPMS,this.elapsedMS=1/Se.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,i=zi.NORMAL){return this._addListener(new Gh(t,e,i))}addOnce(t,e,i=zi.NORMAL){return this._addListener(new Gh(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.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*Se.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this.deltaTime);i.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),i=Math.min(Math.max(0,e)/1e3,Se.targetFPMS);this._maxElapsedMS=1/i}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(!Se._shared){const t=Se._shared=new Se;t.autoStart=!0,t._protected=!0}return Se._shared}static get system(){if(!Se._system){const t=Se._system=new Se;t.autoStart=!0,t._protected=!0}return Se._system}};Tf.targetFPMS=.06;let At=Tf;Object.defineProperties(H,{TARGET_FPMS:{get(){return At.targetFPMS},set(s){it("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),At.targetFPMS=s}}});class wf{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,zi.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?At.shared:new At,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}wf.extension=G.Application,Y.add(wf);const Ef=[];Y.handleByList(G.Renderer,Ef);function dv(s){for(const t of Ef)if(t.test(s))return new t(s);throw new Error("Unable to auto-detect a suitable renderer.")}var fv=`attribute vec2 aVertexPosition;
|
|
489
|
+
`))}}let fv=0;const xa={textureCount:0,uboCount:0};class Af{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=fv++}systemCheck(){if(!Nx())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 i=t.program,r=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(r.program)),e||(xa.textureCount=0,xa.uboCount=0,this.syncUniformGroup(t.uniformGroup,xa)),r}setUniforms(t){const e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)}syncUniformGroup(t,e){const i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))}syncUniforms(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=Bx(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const i=this.getGlProgram();if(!t.static||t.dirtyId!==0||!i.uniformGroups[t.id]){t.dirtyId=0;const r=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),r(i.uniformData,t.uniforms,this.renderer,xa,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])}createSyncBufferGroup(t,e,i){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const n=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=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]=dv(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,i){const r=t.uniforms,n=[`${i}-`];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,i=t.program,r=ov(e,i);return i.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}}Af.extension={type:G.RendererSystem,name:"shader"},z.add(Af);class va{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.2 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}va.defaultOptions={hello:!1},va.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"startup"},z.add(va);function pv(s,t=[]){return t[K.NORMAL]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.ADD]=[s.ONE,s.ONE],t[K.MULTIPLY]=[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SCREEN]=[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.OVERLAY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.DARKEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.LIGHTEN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.COLOR_DODGE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.COLOR_BURN]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.HARD_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SOFT_LIGHT]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.DIFFERENCE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.EXCLUSION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.HUE]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SATURATION]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.COLOR]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.LUMINOSITY]=[s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.NONE]=[0,0],t[K.NORMAL_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.ADD_NPM]=[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],t[K.SCREEN_NPM]=[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],t[K.SRC_IN]=[s.DST_ALPHA,s.ZERO],t[K.SRC_OUT]=[s.ONE_MINUS_DST_ALPHA,s.ZERO],t[K.SRC_ATOP]=[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],t[K.DST_OVER]=[s.ONE_MINUS_DST_ALPHA,s.ONE],t[K.DST_IN]=[s.ZERO,s.SRC_ALPHA],t[K.DST_OUT]=[s.ZERO,s.ONE_MINUS_SRC_ALPHA],t[K.DST_ATOP]=[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],t[K.XOR]=[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],t[K.SUBTRACT]=[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD],t}const mv=0,_v=1,gv=2,yv=3,xv=4,vv=5,Sf=class zc{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=K.NONE,this._blendEq=!1,this.map=[],this.map[mv]=this.setBlend,this.map[_v]=this.setOffset,this.map[gv]=this.setCullFace,this.map[yv]=this.setDepthTest,this.map[xv]=this.setFrontFace,this.map[vv]=this.setDepthMask,this.checks=[],this.defaultState=new ni,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=pv(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;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(zc.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this.updateCheck(zc.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],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.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 i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};Sf.extension={type:G.RendererSystem,name:"state"};let bv=Sf;z.add(bv);class Tv extends Je{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter(r=>t.systems[r]),i=[...e,...Object.keys(t.systems).filter(r=>!e.includes(r))];for(const r of i)this.addSystem(t.systems[r],r)}addRunners(...t){t.forEach(e=>{this.runners[e]=new He(e)})}addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}emitWithCustomOptions(t,e){const i=Object.keys(this._systemsHash);t.items.forEach(r=>{const n=i.find(a=>this._systemsHash[a]===r);r[t.name](e[n])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const rn=class bo{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=bo.defaultMaxIdle,this.checkCountMax=bo.defaultCheckCountMax,this.mode=bo.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Ao.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let i=!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,i=!0)}if(i){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,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(let r=t.children.length-1;r>=0;r--)this.unload(t.children[r])}destroy(){this.renderer=null}};rn.defaultMode=Ao.AUTO,rn.defaultMaxIdle=60*60,rn.defaultCheckCountMax=60*10,rn.extension={type:G.RendererSystem,name:"textureGC"};let Es=rn;z.add(Es);class Xh{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=Z.UNSIGNED_BYTE,this.internalFormat=O.RGBA,this.samplerType=0}}function wv(s){let t;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?t={[s.RGB]:V.FLOAT,[s.RGBA]:V.FLOAT,[s.ALPHA]:V.FLOAT,[s.LUMINANCE]:V.FLOAT,[s.LUMINANCE_ALPHA]:V.FLOAT,[s.R8]:V.FLOAT,[s.R8_SNORM]:V.FLOAT,[s.RG8]:V.FLOAT,[s.RG8_SNORM]:V.FLOAT,[s.RGB8]:V.FLOAT,[s.RGB8_SNORM]:V.FLOAT,[s.RGB565]:V.FLOAT,[s.RGBA4]:V.FLOAT,[s.RGB5_A1]:V.FLOAT,[s.RGBA8]:V.FLOAT,[s.RGBA8_SNORM]:V.FLOAT,[s.RGB10_A2]:V.FLOAT,[s.RGB10_A2UI]:V.FLOAT,[s.SRGB8]:V.FLOAT,[s.SRGB8_ALPHA8]:V.FLOAT,[s.R16F]:V.FLOAT,[s.RG16F]:V.FLOAT,[s.RGB16F]:V.FLOAT,[s.RGBA16F]:V.FLOAT,[s.R32F]:V.FLOAT,[s.RG32F]:V.FLOAT,[s.RGB32F]:V.FLOAT,[s.RGBA32F]:V.FLOAT,[s.R11F_G11F_B10F]:V.FLOAT,[s.RGB9_E5]:V.FLOAT,[s.R8I]:V.INT,[s.R8UI]:V.UINT,[s.R16I]:V.INT,[s.R16UI]:V.UINT,[s.R32I]:V.INT,[s.R32UI]:V.UINT,[s.RG8I]:V.INT,[s.RG8UI]:V.UINT,[s.RG16I]:V.INT,[s.RG16UI]:V.UINT,[s.RG32I]:V.INT,[s.RG32UI]:V.UINT,[s.RGB8I]:V.INT,[s.RGB8UI]:V.UINT,[s.RGB16I]:V.INT,[s.RGB16UI]:V.UINT,[s.RGB32I]:V.INT,[s.RGB32UI]:V.UINT,[s.RGBA8I]:V.INT,[s.RGBA8UI]:V.UINT,[s.RGBA16I]:V.INT,[s.RGBA16UI]:V.UINT,[s.RGBA32I]:V.INT,[s.RGBA32UI]:V.UINT,[s.DEPTH_COMPONENT16]:V.FLOAT,[s.DEPTH_COMPONENT24]:V.FLOAT,[s.DEPTH_COMPONENT32F]:V.FLOAT,[s.DEPTH_STENCIL]:V.FLOAT,[s.DEPTH24_STENCIL8]:V.FLOAT,[s.DEPTH32F_STENCIL8]:V.FLOAT}:t={[s.RGB]:V.FLOAT,[s.RGBA]:V.FLOAT,[s.ALPHA]:V.FLOAT,[s.LUMINANCE]:V.FLOAT,[s.LUMINANCE_ALPHA]:V.FLOAT,[s.DEPTH_STENCIL]:V.FLOAT},t}function Ev(s){let t;return"WebGL2RenderingContext"in globalThis&&s instanceof globalThis.WebGL2RenderingContext?t={[Z.UNSIGNED_BYTE]:{[O.RGBA]:s.RGBA8,[O.RGB]:s.RGB8,[O.RG]:s.RG8,[O.RED]:s.R8,[O.RGBA_INTEGER]:s.RGBA8UI,[O.RGB_INTEGER]:s.RGB8UI,[O.RG_INTEGER]:s.RG8UI,[O.RED_INTEGER]:s.R8UI,[O.ALPHA]:s.ALPHA,[O.LUMINANCE]:s.LUMINANCE,[O.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Z.BYTE]:{[O.RGBA]:s.RGBA8_SNORM,[O.RGB]:s.RGB8_SNORM,[O.RG]:s.RG8_SNORM,[O.RED]:s.R8_SNORM,[O.RGBA_INTEGER]:s.RGBA8I,[O.RGB_INTEGER]:s.RGB8I,[O.RG_INTEGER]:s.RG8I,[O.RED_INTEGER]:s.R8I},[Z.UNSIGNED_SHORT]:{[O.RGBA_INTEGER]:s.RGBA16UI,[O.RGB_INTEGER]:s.RGB16UI,[O.RG_INTEGER]:s.RG16UI,[O.RED_INTEGER]:s.R16UI,[O.DEPTH_COMPONENT]:s.DEPTH_COMPONENT16},[Z.SHORT]:{[O.RGBA_INTEGER]:s.RGBA16I,[O.RGB_INTEGER]:s.RGB16I,[O.RG_INTEGER]:s.RG16I,[O.RED_INTEGER]:s.R16I},[Z.UNSIGNED_INT]:{[O.RGBA_INTEGER]:s.RGBA32UI,[O.RGB_INTEGER]:s.RGB32UI,[O.RG_INTEGER]:s.RG32UI,[O.RED_INTEGER]:s.R32UI,[O.DEPTH_COMPONENT]:s.DEPTH_COMPONENT24},[Z.INT]:{[O.RGBA_INTEGER]:s.RGBA32I,[O.RGB_INTEGER]:s.RGB32I,[O.RG_INTEGER]:s.RG32I,[O.RED_INTEGER]:s.R32I},[Z.FLOAT]:{[O.RGBA]:s.RGBA32F,[O.RGB]:s.RGB32F,[O.RG]:s.RG32F,[O.RED]:s.R32F,[O.DEPTH_COMPONENT]:s.DEPTH_COMPONENT32F},[Z.HALF_FLOAT]:{[O.RGBA]:s.RGBA16F,[O.RGB]:s.RGB16F,[O.RG]:s.RG16F,[O.RED]:s.R16F},[Z.UNSIGNED_SHORT_5_6_5]:{[O.RGB]:s.RGB565},[Z.UNSIGNED_SHORT_4_4_4_4]:{[O.RGBA]:s.RGBA4},[Z.UNSIGNED_SHORT_5_5_5_1]:{[O.RGBA]:s.RGB5_A1},[Z.UNSIGNED_INT_2_10_10_10_REV]:{[O.RGBA]:s.RGB10_A2,[O.RGBA_INTEGER]:s.RGB10_A2UI},[Z.UNSIGNED_INT_10F_11F_11F_REV]:{[O.RGB]:s.R11F_G11F_B10F},[Z.UNSIGNED_INT_5_9_9_9_REV]:{[O.RGB]:s.RGB9_E5},[Z.UNSIGNED_INT_24_8]:{[O.DEPTH_STENCIL]:s.DEPTH24_STENCIL8},[Z.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[O.DEPTH_STENCIL]:s.DEPTH32F_STENCIL8}}:t={[Z.UNSIGNED_BYTE]:{[O.RGBA]:s.RGBA,[O.RGB]:s.RGB,[O.ALPHA]:s.ALPHA,[O.LUMINANCE]:s.LUMINANCE,[O.LUMINANCE_ALPHA]:s.LUMINANCE_ALPHA},[Z.UNSIGNED_SHORT_5_6_5]:{[O.RGB]:s.RGB},[Z.UNSIGNED_SHORT_4_4_4_4]:{[O.RGBA]:s.RGBA},[Z.UNSIGNED_SHORT_5_5_5_1]:{[O.RGBA]:s.RGBA}},t}class Cf{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new J,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=Ev(t),this.samplerTypes=wv(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 i=new Xh(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.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]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Xh(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:i}=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,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,r.texture)),r.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)):r.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.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:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let r=0;r<i.length;r++)i[r]===this.unknownTexture&&this.bind(null,r)}for(let r=0;r<i.length;r++)i[r]===t&&(this.currentLocation!==r&&(e.activeTexture(e.TEXTURE0+r),this.currentLocation=r),e.bindTexture(t.target,this.emptyTextures[t.target].texture),i[r]=null)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:i,CONTEXT_UID:r}=this;if(i)for(let n=t-1;n>=0;--n){const a=e[n];a&&a._glTextures[r].samplerType!==V.FLOAT&&this.renderer.texture.unbind(a)}}initTexture(t){const e=new Xh(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 i;e.internalFormat=((i=this.internalFormats[t.type])==null?void 0:i[t.format])??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??V.FLOAT,this.webGLVersion===2&&t.type===Z.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 i=this.renderer;if(this.initTextureType(t,e),(r=t.resource)==null?void 0:r.upload(i,t,e))e.samplerType!==V.FLOAT&&(this.hasIntegerTextures=!0);else{const n=t.realWidth,a=t.realHeight,o=i.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:i}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.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&&ir(this.managedTextures,r,1)}}updateTextureStyle(t){var i;const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===Ke.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ui.CLAMP:e.wrapMode=t.wrapMode,(i=t.resource)!=null&&i.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const i=this.gl;if(e.mipmap&&t.mipmap!==Ke.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Ti.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===Ti.LINEAR){const n=Math.min(t.anisotropicLevel,i.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Ti.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===Ti.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}Cf.extension={type:G.RendererSystem,name:"texture"},z.add(Cf);class Pf{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:i}=this,r=t._glTransformFeedbacks[i]||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:i,renderer:r}=this;e&&r.shader.bind(e),i.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:i,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&&(i.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 i=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))}i&&(e||r.deleteTransformFeedback(i),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}Pf.extension={type:G.RendererSystem,name:"transformFeedback"},z.add(Pf);class ba{constructor(t){this.renderer=t}init(t){this.screen=new st(0,0,t.width,t.height),this.element=t.view||H.ADAPTER.createCanvas(),this.resolution=t.resolution||H.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 i=this.element.width/this.resolution,r=this.element.height/this.resolution;this.screen.width=i,this.screen.height=r,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${r}px`),this.renderer.emit("resize",i,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}}ba.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},ba.extension={type:[G.RendererSystem,G.CanvasRendererSystem],name:"_view"},z.add(ba),H.PREFER_ENV=qe.WEBGL2,H.STRICT_TEXTURE_CACHE=!1,H.RENDER_OPTIONS={..._a.defaultOptions,...ma.defaultOptions,...ba.defaultOptions,...va.defaultOptions},Object.defineProperties(H,{WRAP_MODE:{get(){return J.defaultOptions.wrapMode},set(s){it("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),J.defaultOptions.wrapMode=s}},SCALE_MODE:{get(){return J.defaultOptions.scaleMode},set(s){it("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),J.defaultOptions.scaleMode=s}},MIPMAP_TEXTURES:{get(){return J.defaultOptions.mipmap},set(s){it("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),J.defaultOptions.mipmap=s}},ANISOTROPIC_LEVEL:{get(){return J.defaultOptions.anisotropicLevel},set(s){it("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),J.defaultOptions.anisotropicLevel=s}},FILTER_RESOLUTION:{get(){return it("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Yt.defaultResolution},set(s){Yt.defaultResolution=s}},FILTER_MULTISAMPLE:{get(){return it("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Yt.defaultMultisample},set(s){Yt.defaultMultisample=s}},SPRITE_MAX_TEXTURES:{get(){return bs.defaultMaxTextures},set(s){it("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),bs.defaultMaxTextures=s}},SPRITE_BATCH_SIZE:{get(){return bs.defaultBatchSize},set(s){it("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),bs.defaultBatchSize=s}},CAN_UPLOAD_SAME_BUFFER:{get(){return bs.canUploadSameBuffer},set(s){it("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),bs.canUploadSameBuffer=s}},GC_MODE:{get(){return Es.defaultMode},set(s){it("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),Es.defaultMode=s}},GC_MAX_IDLE:{get(){return Es.defaultMaxIdle},set(s){it("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),Es.defaultMaxIdle=s}},GC_MAX_CHECK_COUNT:{get(){return Es.defaultCheckCountMax},set(s){it("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),Es.defaultCheckCountMax=s}},PRECISION_VERTEX:{get(){return Ri.defaultVertexPrecision},set(s){it("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Ri.defaultVertexPrecision=s}},PRECISION_FRAGMENT:{get(){return Ri.defaultFragmentPrecision},set(s){it("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Ri.defaultFragmentPrecision=s}}});var zi=(s=>(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(zi||{});class $h{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,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 Rf=class Se{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 $h(null,null,1/0),this.deltaMS=1/Se.targetFPMS,this.elapsedMS=1/Se.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,i=zi.NORMAL){return this._addListener(new $h(t,e,i))}addOnce(t,e,i=zi.NORMAL){return this._addListener(new $h(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.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*Se.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this.deltaTime);i.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),i=Math.min(Math.max(0,e)/1e3,Se.targetFPMS);this._maxElapsedMS=1/i}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(!Se._shared){const t=Se._shared=new Se;t.autoStart=!0,t._protected=!0}return Se._shared}static get system(){if(!Se._system){const t=Se._system=new Se;t.autoStart=!0,t._protected=!0}return Se._system}};Rf.targetFPMS=.06;let ft=Rf;Object.defineProperties(H,{TARGET_FPMS:{get(){return ft.targetFPMS},set(s){it("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),ft.targetFPMS=s}}});class If{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,zi.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ft.shared:new ft,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}If.extension=G.Application,z.add(If);const Mf=[];z.handleByList(G.Renderer,Mf);function Av(s){for(const t of Mf)if(t.test(s))return new t(s);throw new Error("Unable to auto-detect a suitable renderer.")}var Sv=`attribute vec2 aVertexPosition;
|
|
490
490
|
attribute vec2 aTextureCoord;
|
|
491
491
|
|
|
492
492
|
uniform mat3 projectionMatrix;
|
|
@@ -497,7 +497,7 @@ void main(void)
|
|
|
497
497
|
{
|
|
498
498
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
499
499
|
vTextureCoord = aTextureCoord;
|
|
500
|
-
}`,
|
|
500
|
+
}`,Cv=`attribute vec2 aVertexPosition;
|
|
501
501
|
|
|
502
502
|
uniform mat3 projectionMatrix;
|
|
503
503
|
|
|
@@ -523,7 +523,7 @@ void main(void)
|
|
|
523
523
|
gl_Position = filterVertexPosition();
|
|
524
524
|
vTextureCoord = filterTextureCoord();
|
|
525
525
|
}
|
|
526
|
-
`;const mv=fv,Af=pv;class Sf{constructor(t){this.renderer=t}contextChange(t){let e;if(this.renderer.context.webGLVersion===1){const i=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,i)}else{const i=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,i)}e>=Gt.HIGH?this.multisample=Gt.HIGH:e>=Gt.MEDIUM?this.multisample=Gt.MEDIUM:e>=Gt.LOW?this.multisample=Gt.LOW:this.multisample=Gt.NONE}destroy(){}}Sf.extension={type:G.RendererSystem,name:"_multisample"},Y.add(Sf);class gv{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Cf{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:i}=this,r=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:i,CONTEXT_UID:r}=this;if(this.boundBufferBases[e]!==t){const n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,n.buffer)}}bindBufferRange(t,e,i){const{gl:r,CONTEXT_UID:n}=this;i=i||0;const a=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,e||0,a.buffer,i*256,256)}update(t){const{gl:e,CONTEXT_UID:i}=this,r=t._glBuffers[i]||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 i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let i=0;i<e.length;i++)this.dispose(this.managedBuffers[e[i]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:i}=this;return t._glBuffers[e]=new gv(i.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}Cf.extension={type:G.RendererSystem,name:"buffer"},Y.add(Cf);class Pf{constructor(t){this.renderer=t}render(t,e){const i=this.renderer;let r,n,a,o;if(e&&(r=e.renderTexture,n=e.clear,a=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!r,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=a,!i.context.isLost){if(r||(this.lastObjectRendered=t),!o){const h=t.enableTempParent();t.updateTransform(),t.disableTempParent(h)}i.renderTexture.bind(r),i.batch.currentRenderer.start(),(n??i.background.clearBeforeRender)&&i.renderTexture.clear(),t.render(i),i.batch.currentRenderer.flush(),r&&(e.blit&&i.framebuffer.blit(),r.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}Pf.extension={type:G.RendererSystem,name:"objectRenderer"},Y.add(Pf);const va=class Gc extends lv{constructor(t){super(),this.type=$c.WEBGL,t=Object.assign({},H.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new He({projectionMatrix:new gt},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Gc.__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&&(it("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=Gc.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:Hy()}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 it("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return it("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return it("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return it("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){it("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return it("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){it("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return it("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)}};va.extension={type:G.Renderer,priority:1},va.__plugins={},va.__systems={};let Hh=va;Y.handleByMap(G.RendererPlugin,Hh.__plugins),Y.handleByMap(G.RendererSystem,Hh.__systems),Y.add(Hh);class Rf extends Qr{constructor(t,e){const{width:i,height:r}=e||{};super(i,r),this.items=[],this.itemDirtyIds=[];for(let n=0;n<t;n++){const a=new J;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof Qr?this.addResourceAt(t[i],i):this.addResourceAt(Fd(t[i],e),i))}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:i}=this.items[0];return this.resize(e,i),this.update(),Promise.resolve(this)}),this._load}}class _v extends Rf{constructor(t,e){const{width:i,height:r}=e||{};let n,a;Array.isArray(t)?(n=t,a=t.length):a=t,super(a,{width:i,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=Ws.TEXTURE_2D_ARRAY}upload(t,e,i){const{length:r,itemDirtyIds:n,items:a}=this,{gl:o}=t;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,r,0,e.format,i.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,i.type,l.resource.source))}return!0}}class yv extends Ri{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return e&&t instanceof e?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const If=class Rn extends Rf{constructor(t,e){const{width:i,height:r,autoLoad:n,linkBaseTexture:a}=e||{};if(t&&t.length!==Rn.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:i,height:r});for(let o=0;o<Rn.SIDES;o++)this.items[o].target=Ws.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=Ws.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,i){if(i===void 0&&(i=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=Ws.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,i){const r=this.itemDirtyIds;for(let n=0;n<Rn.SIDES;n++){const a=this.items[n];(r[n]<a.dirtyId||i.dirtyId<e.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(t,a,i),r[n]=a.dirtyId):r[n]<-1&&(t.gl.texImage2D(a.target,0,i.internalFormat,e.realWidth,e.realHeight,0,e.format,i.type,null),r[n]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===Rn.SIDES}};If.SIDES=6;let xv=If;class rr extends Ri{constructor(t,e){e=e||{};let i,r,n;typeof t=="string"?(i=rr.EMPTY,r=t,n=!0):(i=t,r=null,n=!1),super(i),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 i=await H.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await i.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===he.UNPACK?"premultiply":"none"});if(this.destroyed){n.close();return}this.source=n,this.update(),t(this)}catch(i){if(this.destroyed)return;e(i),this.onError.emit(i)}}),this._load)}upload(t,e,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,i)):(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 rr._EMPTY=rr._EMPTY??H.ADAPTER.createCanvas(0,0),rr._EMPTY}}const Vh=class _o extends Ri{constructor(t,e){e=e||{},super(H.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)},_o.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;Ri.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,i=t.height;if(!e||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let r=e*this.scale,n=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(r=this._overrideWidth||this._overrideHeight/i*e,n=this._overrideHeight||this._overrideWidth/e*i),r=Math.round(r),n=Math.round(n);const a=this.source;a.width=r,a.height=n,a._pixiId=`canvas_${ms()}`,a.getContext("2d").drawImage(t,0,0,e,i,0,0,r,n),this._resolve(),this._resolve=null}}static getSize(t){const e=_o.SVG_SIZE.exec(t),i={};return e&&(i[e[1]]=Math.round(parseFloat(e[3])),i[e[5]]=Math.round(parseFloat(e[7]))),i}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"&&_o.SVG_XML.test(t)}};Vh.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Vh.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Wh=Vh;class vv extends Ri{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}}const Xh=class Hc extends Ri{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const i=document.createElement("video");e.autoLoad!==!1&&i.setAttribute("preload","auto"),e.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),e.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),e.loop===!0&&i.setAttribute("loop",""),e.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const r=t[0].src||t[0];Ri.crossOrigin(i,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||Hc.MIME_TYPES[c]||`video/${c}`}a.src=o,h&&(a.type=h),i.appendChild(a)}t=i}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=At.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,i)=>{this.valid?e(this):(this._resolve=e,this._reject=i,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&&(At.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||(At.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(At.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||Hc.TYPES.includes(e)}};Xh.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Xh.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Mf=Xh;Ah.push(rr,Kd,yv,Mf,vv,Wh,ta,xv,_v);class ba{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?st.EMPTY:(t=t||new st(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:i,b:r,c:n,d:a,tx:o,ty:h}=t,l=i*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,i=this.minY,r=this.maxX,n=this.maxY,a=t[0],o=t[1];e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,a=t[2],o=t[3],e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,a=t[4],o=t[5],e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,a=t[6],o=t[7],e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n}addFrame(t,e,i,r,n){this.addFrameMatrix(t.worldTransform,e,i,r,n)}addFrameMatrix(t,e,i,r,n){const a=t.a,o=t.b,h=t.c,l=t.d,c=t.tx,d=t.ty;let u=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=a*e+h*i+c,y=o*e+l*i+d;u=g<u?g:u,f=y<f?y:f,p=g>p?g:p,m=y>m?y:m,g=a*r+h*i+c,y=o*r+l*i+d,u=g<u?g:u,f=y<f?y:f,p=g>p?g:p,m=y>m?y:m,g=a*e+h*n+c,y=o*e+l*n+d,u=g<u?g:u,f=y<f?y:f,p=g>p?g:p,m=y>m?y:m,g=a*r+h*n+c,y=o*r+l*n+d,u=g<u?g:u,f=y<f?y:f,p=g>p?g:p,m=y>m?y:m,this.minX=u,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(t,e,i){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;for(let h=e;h<i;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,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)}addVerticesMatrix(t,e,i,r,n=0,a=n){const o=t.a,h=t.b,l=t.c,c=t.d,d=t.tx,u=t.ty;let f=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let y=i;y<r;y+=2){const v=e[y],_=e[y+1],x=o*v+l*_+d,b=c*_+h*v+u;f=Math.min(f,x-n),m=Math.max(m,x+n),p=Math.min(p,b-a),g=Math.max(g,b+a)}this.minX=f,this.minY=p,this.maxX=m,this.maxY=g}addBounds(t){const e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n}addBoundsMask(t,e){const i=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(i<=n&&r<=a){const o=this.minX,h=this.minY,l=this.maxX,c=this.maxY;this.minX=i<o?i: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 i=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(i<=n&&r<=a){const o=this.minX,h=this.minY,l=this.maxX,c=this.maxY;this.minX=i<o?i: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,i,r,n,a){t-=n,e-=a,i+=n,r+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r}}class St extends kr{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new ha,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 ba,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 i=0;i<e.length;++i){const r=e[i];Object.defineProperty(St.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 st),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new st),t=this._localBoundsRect),this._localBounds||(this._localBounds=new ba);const e=this.transform,i=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(i==null?void 0:i.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=i,this.transform=e,this._bounds=r,this._bounds.updateID+=this._boundsID-n,a}toGlobal(t,e,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(t,e,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)}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,i=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=i||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 bv),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*px}set angle(t){this.transform.rotation=t*Ph}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 bv extends St{constructor(){super(...arguments),this.sortDirty=null}}St.prototype.displayObjectUpdateTransform=St.prototype.updateTransform;const Tv=new gt;function wv(s,t){return s.zIndex===t.zIndex?s._lastSortedIndex-t._lastSortedIndex:s.zIndex-t.zIndex}const Df=class Vc extends St{constructor(){super(),this.children=[],this.sortableChildren=Vc.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 i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i<r?i: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 i=this.getChildIndex(t);er(this.children,i,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],i=this.children.indexOf(e);if(i===-1)return null;e.parent=null,e.transform._parentID=-1,er(this.children,i,1),this._boundsID++,this.onChildrenChange(i),e.emit("removed",this),this.emit("childRemoved",e,this,i)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,er(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 i=t,r=e,n=r-i;let a;if(n>0&&n<=r){a=this.children.splice(i,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,i=this.children.length;e<i;++e){const r=this.children[e];r._lastSortedIndex=e,!t&&r.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(wv),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 i=this.children[t];i.visible&&i.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 i=e._mask.isMaskData?e._mask.maskObject:e._mask;i?(i.calculateBounds(),this._bounds.addBoundsMask(e._bounds,i._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 i=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 i}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let i,r;this.cullArea?(i=this.cullArea,r=this.worldTransform):this._render!==Vc.prototype._render&&(i=this.getBounds(!0));const n=t.projection.transform;if(n&&(r?(r=Tv.copyFrom(r),r.prepend(n)):r=n),i&&e.intersects(i,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 i=0,r=this.children.length;i<r;++i)this.children[i].render(t)}}renderAdvanced(t){var n,a,o;const e=this.filters,i=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)||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==Vt.NONE));if(r&&t.batch.flush(),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.push(this,this._enabledFilters),i&&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(),i&&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,i=this.removeChildren(0,this.children.length);if(e)for(let r=0;r<i.length;++r)i[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}};Df.defaultSortableChildren=!1;let vt=Df;vt.prototype.containerUpdateTransform=vt.prototype.updateTransform,Object.defineProperties(H,{SORTABLE_CHILDREN:{get(){return vt.defaultSortableChildren},set(s){it("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),vt.defaultSortableChildren=s}}});const rn=new tt,Ev=new Uint16Array([0,1,2,0,2,3]);class ge extends vt{constructor(t){super(),this._anchor=new ni(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 ft(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=K.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||X.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=Ev,this.pluginName="batch",this.isSprite=!0,this._roundPixels=H.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Hi(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Hi(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,i=e.a,r=e.b,n=e.c,a=e.d,o=e.tx,h=e.ty,l=this.vertexData,c=t.trim,d=t.orig,u=this._anchor;let f=0,p=0,m=0,g=0;if(c?(p=c.x-u._x*d.width,f=p+c.width,g=c.y-u._y*d.height,m=g+c.height):(p=-u._x*d.width,f=p+d.width,g=-u._y*d.height,m=g+d.height),l[0]=i*p+n*g+o,l[1]=a*g+r*p+h,l[2]=i*f+n*g+o,l[3]=a*g+r*f+h,l[4]=i*f+n*m+o,l[5]=a*m+r*f+h,l[6]=i*p+n*m+o,l[7]=a*m+r*p+h,this._roundPixels){const y=H.RESOLUTION;for(let v=0;v<l.length;++v)l[v]=Math.round(l[v]*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,i=t.orig,r=this._anchor,n=this.transform.worldTransform,a=n.a,o=n.b,h=n.c,l=n.d,c=n.tx,d=n.ty,u=-r._x*i.width,f=u+i.width,p=-r._y*i.height,m=p+i.height;if(e[0]=a*u+h*p+c,e[1]=l*p+o*u+d,e[2]=a*f+h*p+c,e[3]=l*p+o*f+d,e[4]=a*f+h*m+c,e[5]=l*m+o*f+d,e[6]=a*u+h*m+c,e[7]=l*m+o*u+d,this._roundPixels){const g=H.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 ba),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 st),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,rn);const e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x;let n=0;return rn.x>=r&&rn.x<r+e&&(n=-i*this.anchor.y,rn.y>=n&&rn.y<n+i)}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 i=t instanceof X?t:X.from(t,e);return new ge(i)}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=Hi(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=Hi(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||X.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const Bf=new gt;St.prototype._cacheAsBitmap=!1,St.prototype._cacheData=null,St.prototype._cacheAsBitmapResolution=null,St.prototype._cacheAsBitmapMultisample=null;class Av{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(St.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(s){s!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=s,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(s){s!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=s,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(s){if(this._cacheAsBitmap===s)return;this._cacheAsBitmap=s;let t;s?(this._cacheData||(this._cacheData=new Av),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)}}}),St.prototype._renderCached=function(s){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(s),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(s))},St.prototype._initCachedDisplayObject=function(s){var u,f;if((u=this._cacheData)!=null&&u.sprite)return;const t=this.alpha;this.alpha=1,s.batch.flush();const e=this.getLocalBounds(new st,!0);if((f=this.filters)!=null&&f.length){const p=this.filters[0].padding;e.pad(p)}const i=this.cacheAsBitmapResolution||s.resolution;e.ceil(i),e.width=Math.max(e.width,1/i),e.height=Math.max(e.height,1/i);const r=s.renderTexture.current,n=s.renderTexture.sourceFrame.clone(),a=s.renderTexture.destinationFrame.clone(),o=s.projection.transform,h=bs.create({width:e.width,height:e.height,resolution:i,multisample:this.cacheAsBitmapMultisample??s.multisample}),l=`cacheAsBitmap_${ms()}`;this._cacheData.textureCacheId=l,J.addToCache(h.baseTexture,l),X.addToCache(h,l);const c=this.transform.localTransform.copyTo(Bf).invert().translate(-e.x,-e.y);this.render=this._cacheData.originalRender,s.render(this,{renderTexture:h,clear:!0,transform:c,skipUpdateTransform:!1}),s.framebuffer.blit(),s.projection.transform=o,s.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 d=new ge(h);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(e.x/e.width),d.anchor.y=-(e.y/e.height),d.alpha=t,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)},St.prototype._renderCachedCanvas=function(s){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(s),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(s))},St.prototype._initCachedDisplayObjectCanvas=function(s){var c;if((c=this._cacheData)!=null&&c.sprite)return;const t=this.getLocalBounds(new st,!0),e=this.alpha;this.alpha=1;const i=s.canvasContext.activeContext,r=s._projTransform,n=this.cacheAsBitmapResolution||s.resolution;t.ceil(n),t.width=Math.max(t.width,1/n),t.height=Math.max(t.height,1/n);const a=bs.create({width:t.width,height:t.height,resolution:n}),o=`cacheAsBitmap_${ms()}`;this._cacheData.textureCacheId=o,J.addToCache(a.baseTexture,o),X.addToCache(a,o);const h=Bf;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,s.render(this,{renderTexture:a,clear:!0,transform:h,skipUpdateTransform:!1}),s.canvasContext.activeContext=i,s._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 ge(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=s._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)},St.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},St.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},St.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,J.removeFromCache(this._cacheData.textureCacheId),X.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},St.prototype._cacheAsBitmapDestroy=function(s){this.cacheAsBitmap=!1,this.destroy(s)},St.prototype.name=null,vt.prototype.getChildByName=function(s,t){for(let e=0,i=this.children.length;e<i;e++)if(this.children[e].name===s)return this.children[e];if(t)for(let e=0,i=this.children.length;e<i;e++){const r=this.children[e];if(!r.getChildByName)continue;const n=r.getChildByName(s,!0);if(n)return n}return null},St.prototype.getGlobalPosition=function(s=new tt,t=!1){return this.parent?this.parent.toGlobal(this.position,s,t):(s.x=this.position.x,s.y=this.position.y),s};var Sv=`varying vec2 vTextureCoord;
|
|
526
|
+
`;const Pv=Sv,Df=Cv;class Bf{constructor(t){this.renderer=t}contextChange(t){let e;if(this.renderer.context.webGLVersion===1){const i=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,i)}else{const i=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,i)}e>=Ht.HIGH?this.multisample=Ht.HIGH:e>=Ht.MEDIUM?this.multisample=Ht.MEDIUM:e>=Ht.LOW?this.multisample=Ht.LOW:this.multisample=Ht.NONE}destroy(){}}Bf.extension={type:G.RendererSystem,name:"_multisample"},z.add(Bf);class Rv{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Of{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:i}=this,r=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:i,CONTEXT_UID:r}=this;if(this.boundBufferBases[e]!==t){const n=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,n.buffer)}}bindBufferRange(t,e,i){const{gl:r,CONTEXT_UID:n}=this;i=i||0;const a=t._glBuffers[n]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,e||0,a.buffer,i*256,256)}update(t){const{gl:e,CONTEXT_UID:i}=this,r=t._glBuffers[i]||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 i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let i=0;i<e.length;i++)this.dispose(this.managedBuffers[e[i]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:i}=this;return t._glBuffers[e]=new Rv(i.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}Of.extension={type:G.RendererSystem,name:"buffer"},z.add(Of);class Ff{constructor(t){this.renderer=t}render(t,e){const i=this.renderer;let r,n,a,o;if(e&&(r=e.renderTexture,n=e.clear,a=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!r,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=a,!i.context.isLost){if(r||(this.lastObjectRendered=t),!o){const h=t.enableTempParent();t.updateTransform(),t.disableTempParent(h)}i.renderTexture.bind(r),i.batch.currentRenderer.start(),(n??i.background.clearBeforeRender)&&i.renderTexture.clear(),t.render(i),i.batch.currentRenderer.flush(),r&&(e.blit&&i.framebuffer.blit(),r.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}Ff.extension={type:G.RendererSystem,name:"objectRenderer"},z.add(Ff);const Ta=class Yc extends Tv{constructor(t){super(),this.type=Jc.WEBGL,t=Object.assign({},H.RENDER_OPTIONS,t),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new Ve({projectionMatrix:new gt},!0);const e={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Yc.__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&&(it("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=Yc.__plugins,this.options=t,this.startup.run(this.options)}static test(t){return t!=null&&t.forceCanvas?!1:tx()}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 it("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return it("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return it("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return it("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){it("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return it("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){it("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return it("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)}};Ta.extension={type:G.Renderer,priority:1},Ta.__plugins={},Ta.__systems={};let zh=Ta;z.handleByMap(G.RendererPlugin,zh.__plugins),z.handleByMap(G.RendererSystem,zh.__systems),z.add(zh);class Lf extends Jr{constructor(t,e){const{width:i,height:r}=e||{};super(i,r),this.items=[],this.itemDirtyIds=[];for(let n=0;n<t;n++){const a=new J;this.items.push(a),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof Jr?this.addResourceAt(t[i],i):this.addResourceAt(Vd(t[i],e),i))}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:i}=this.items[0];return this.resize(e,i),this.update(),Promise.resolve(this)}),this._load}}class Iv extends Lf{constructor(t,e){const{width:i,height:r}=e||{};let n,a;Array.isArray(t)?(n=t,a=t.length):a=t,super(a,{width:i,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=Xs.TEXTURE_2D_ARRAY}upload(t,e,i){const{length:r,itemDirtyIds:n,items:a}=this,{gl:o}=t;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,r,0,e.format,i.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,i.type,l.resource.source))}return!0}}class Mv 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 kf=class Mn extends Lf{constructor(t,e){const{width:i,height:r,autoLoad:n,linkBaseTexture:a}=e||{};if(t&&t.length!==Mn.SIDES)throw new Error(`Invalid length. Got ${t.length}, expected 6`);super(6,{width:i,height:r});for(let o=0;o<Mn.SIDES;o++)this.items[o].target=Xs.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=Xs.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,i){if(i===void 0&&(i=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=Xs.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,i){const r=this.itemDirtyIds;for(let n=0;n<Mn.SIDES;n++){const a=this.items[n];(r[n]<a.dirtyId||i.dirtyId<e.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(t,a,i),r[n]=a.dirtyId):r[n]<-1&&(t.gl.texImage2D(a.target,0,i.internalFormat,e.realWidth,e.realHeight,0,e.format,i.type,null),r[n]=-1))}return!0}static test(t){return Array.isArray(t)&&t.length===Mn.SIDES}};kf.SIDES=6;let Dv=kf;class nr extends Ii{constructor(t,e){e=e||{};let i,r,n;typeof t=="string"?(i=nr.EMPTY,r=t,n=!0):(i=t,r=null,n=!1),super(i),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 i=await H.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await i.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===he.UNPACK?"premultiply":"none"});if(this.destroyed){n.close();return}this.source=n,this.update(),t(this)}catch(i){if(this.destroyed)return;e(i),this.onError.emit(i)}}),this._load)}upload(t,e,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,i)):(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 nr._EMPTY=nr._EMPTY??H.ADAPTER.createCanvas(0,0),nr._EMPTY}}const Yh=class To extends Ii{constructor(t,e){e=e||{},super(H.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)},To.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,i=t.height;if(!e||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let r=e*this.scale,n=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(r=this._overrideWidth||this._overrideHeight/i*e,n=this._overrideHeight||this._overrideWidth/e*i),r=Math.round(r),n=Math.round(n);const a=this.source;a.width=r,a.height=n,a._pixiId=`canvas_${_s()}`,a.getContext("2d").drawImage(t,0,0,e,i,0,0,r,n),this._resolve(),this._resolve=null}}static getSize(t){const e=To.SVG_SIZE.exec(t),i={};return e&&(i[e[1]]=Math.round(parseFloat(e[3])),i[e[5]]=Math.round(parseFloat(e[7]))),i}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"&&To.SVG_XML.test(t)}};Yh.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Yh.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let jh=Yh;class Bv extends Ii{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}}const qh=class jc extends Ii{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const i=document.createElement("video");e.autoLoad!==!1&&i.setAttribute("preload","auto"),e.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),e.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),e.loop===!0&&i.setAttribute("loop",""),e.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const r=t[0].src||t[0];Ii.crossOrigin(i,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||jc.MIME_TYPES[c]||`video/${c}`}a.src=o,h&&(a.type=h),i.appendChild(a)}t=i}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=ft.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,i)=>{this.valid?e(this):(this._resolve=e,this._reject=i,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&&(ft.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||(ft.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ft.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||jc.TYPES.includes(e)}};qh.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],qh.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Nf=qh;Ih.push(nr,rf,Mv,Nf,Bv,jh,ia,Dv,Iv);class wa{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?st.EMPTY:(t=t||new st(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:i,b:r,c:n,d:a,tx:o,ty:h}=t,l=i*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,i=this.minY,r=this.maxX,n=this.maxY,a=t[0],o=t[1];e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,a=t[2],o=t[3],e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,a=t[4],o=t[5],e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,a=t[6],o=t[7],e=a<e?a:e,i=o<i?o:i,r=a>r?a:r,n=o>n?o:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n}addFrame(t,e,i,r,n){this.addFrameMatrix(t.worldTransform,e,i,r,n)}addFrameMatrix(t,e,i,r,n){const a=t.a,o=t.b,h=t.c,l=t.d,c=t.tx,d=t.ty;let u=this.minX,f=this.minY,p=this.maxX,m=this.maxY,_=a*e+h*i+c,y=o*e+l*i+d;u=_<u?_:u,f=y<f?y:f,p=_>p?_:p,m=y>m?y:m,_=a*r+h*i+c,y=o*r+l*i+d,u=_<u?_:u,f=y<f?y:f,p=_>p?_:p,m=y>m?y:m,_=a*e+h*n+c,y=o*e+l*n+d,u=_<u?_:u,f=y<f?y:f,p=_>p?_:p,m=y>m?y:m,_=a*r+h*n+c,y=o*r+l*n+d,u=_<u?_:u,f=y<f?y:f,p=_>p?_:p,m=y>m?y:m,this.minX=u,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(t,e,i){let r=this.minX,n=this.minY,a=this.maxX,o=this.maxY;for(let h=e;h<i;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,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)}addVerticesMatrix(t,e,i,r,n=0,a=n){const o=t.a,h=t.b,l=t.c,c=t.d,d=t.tx,u=t.ty;let f=this.minX,p=this.minY,m=this.maxX,_=this.maxY;for(let y=i;y<r;y+=2){const v=e[y],g=e[y+1],x=o*v+l*g+d,b=c*g+h*v+u;f=Math.min(f,x-n),m=Math.max(m,x+n),p=Math.min(p,b-a),_=Math.max(_,b+a)}this.minX=f,this.minY=p,this.maxX=m,this.maxY=_}addBounds(t){const e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n}addBoundsMask(t,e){const i=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(i<=n&&r<=a){const o=this.minX,h=this.minY,l=this.maxX,c=this.maxY;this.minX=i<o?i: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 i=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(i<=n&&r<=a){const o=this.minX,h=this.minY,l=this.maxX,c=this.maxY;this.minX=i<o?i: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,i,r,n,a){t-=n,e-=a,i+=n,r+=a,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r}}class St extends Je{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new ca,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 wa,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 i=0;i<e.length;++i){const r=e[i];Object.defineProperty(St.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 st),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new st),t=this._localBoundsRect),this._localBounds||(this._localBounds=new wa);const e=this.transform,i=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(i==null?void 0:i.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=i,this.transform=e,this._bounds=r,this._bounds.updateID+=this._boundsID-n,a}toGlobal(t,e,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(t,e,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)}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,i=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=i||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 Ov),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*Cx}set angle(t){this.transform.rotation=t*Bh}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 Ov extends St{constructor(){super(...arguments),this.sortDirty=null}}St.prototype.displayObjectUpdateTransform=St.prototype.updateTransform;const Fv=new gt;function Lv(s,t){return s.zIndex===t.zIndex?s._lastSortedIndex-t._lastSortedIndex:s.zIndex-t.zIndex}const Uf=class qc extends St{constructor(){super(),this.children=[],this.sortableChildren=qc.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 i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i<r?i: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 i=this.getChildIndex(t);ir(this.children,i,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],i=this.children.indexOf(e);if(i===-1)return null;e.parent=null,e.transform._parentID=-1,ir(this.children,i,1),this._boundsID++,this.onChildrenChange(i),e.emit("removed",this),this.emit("childRemoved",e,this,i)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,ir(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 i=t,r=e,n=r-i;let a;if(n>0&&n<=r){a=this.children.splice(i,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,i=this.children.length;e<i;++e){const r=this.children[e];r._lastSortedIndex=e,!t&&r.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(Lv),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 i=this.children[t];i.visible&&i.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 i=e._mask.isMaskData?e._mask.maskObject:e._mask;i?(i.calculateBounds(),this._bounds.addBoundsMask(e._bounds,i._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 i=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 i}_calculateBounds(){}_renderWithCulling(t){const e=t.renderTexture.sourceFrame;if(!(e.width>0&&e.height>0))return;let i,r;this.cullArea?(i=this.cullArea,r=this.worldTransform):this._render!==qc.prototype._render&&(i=this.getBounds(!0));const n=t.projection.transform;if(n&&(r?(r=Fv.copyFrom(r),r.prepend(n)):r=n),i&&e.intersects(i,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 i=0,r=this.children.length;i<r;++i)this.children[i].render(t)}}renderAdvanced(t){var n,a,o;const e=this.filters,i=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)||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==Wt.NONE));if(r&&t.batch.flush(),e&&((a=this._enabledFilters)!=null&&a.length)&&t.filter.push(this,this._enabledFilters),i&&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(),i&&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,i=this.removeChildren(0,this.children.length);if(e)for(let r=0;r<i.length;++r)i[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}};Uf.defaultSortableChildren=!1;let bt=Uf;bt.prototype.containerUpdateTransform=bt.prototype.updateTransform,Object.defineProperties(H,{SORTABLE_CHILDREN:{get(){return bt.defaultSortableChildren},set(s){it("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),bt.defaultSortableChildren=s}}});const nn=new tt,kv=new Uint16Array([0,1,2,0,2,3]);class _e extends bt{constructor(t){super(),this._anchor=new ai(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 pt(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=K.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||X.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=kv,this.pluginName="batch",this.isSprite=!0,this._roundPixels=H.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Vi(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Vi(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,i=e.a,r=e.b,n=e.c,a=e.d,o=e.tx,h=e.ty,l=this.vertexData,c=t.trim,d=t.orig,u=this._anchor;let f=0,p=0,m=0,_=0;if(c?(p=c.x-u._x*d.width,f=p+c.width,_=c.y-u._y*d.height,m=_+c.height):(p=-u._x*d.width,f=p+d.width,_=-u._y*d.height,m=_+d.height),l[0]=i*p+n*_+o,l[1]=a*_+r*p+h,l[2]=i*f+n*_+o,l[3]=a*_+r*f+h,l[4]=i*f+n*m+o,l[5]=a*m+r*f+h,l[6]=i*p+n*m+o,l[7]=a*m+r*p+h,this._roundPixels){const y=H.RESOLUTION;for(let v=0;v<l.length;++v)l[v]=Math.round(l[v]*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,i=t.orig,r=this._anchor,n=this.transform.worldTransform,a=n.a,o=n.b,h=n.c,l=n.d,c=n.tx,d=n.ty,u=-r._x*i.width,f=u+i.width,p=-r._y*i.height,m=p+i.height;if(e[0]=a*u+h*p+c,e[1]=l*p+o*u+d,e[2]=a*f+h*p+c,e[3]=l*p+o*f+d,e[4]=a*f+h*m+c,e[5]=l*m+o*f+d,e[6]=a*u+h*m+c,e[7]=l*m+o*u+d,this._roundPixels){const _=H.RESOLUTION;for(let y=0;y<e.length;++y)e[y]=Math.round(e[y]*_)/_}}_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 wa),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 st),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,nn);const e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x;let n=0;return nn.x>=r&&nn.x<r+e&&(n=-i*this.anchor.y,nn.y>=n&&nn.y<n+i)}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 i=t instanceof X?t:X.from(t,e);return new _e(i)}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=Vi(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=Vi(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||X.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const Gf=new gt;St.prototype._cacheAsBitmap=!1,St.prototype._cacheData=null,St.prototype._cacheAsBitmapResolution=null,St.prototype._cacheAsBitmapMultisample=null;class Nv{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(St.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(s){s!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=s,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(s){s!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=s,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(s){if(this._cacheAsBitmap===s)return;this._cacheAsBitmap=s;let t;s?(this._cacheData||(this._cacheData=new Nv),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)}}}),St.prototype._renderCached=function(s){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(s),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(s))},St.prototype._initCachedDisplayObject=function(s){var u,f;if((u=this._cacheData)!=null&&u.sprite)return;const t=this.alpha;this.alpha=1,s.batch.flush();const e=this.getLocalBounds(new st,!0);if((f=this.filters)!=null&&f.length){const p=this.filters[0].padding;e.pad(p)}const i=this.cacheAsBitmapResolution||s.resolution;e.ceil(i),e.width=Math.max(e.width,1/i),e.height=Math.max(e.height,1/i);const r=s.renderTexture.current,n=s.renderTexture.sourceFrame.clone(),a=s.renderTexture.destinationFrame.clone(),o=s.projection.transform,h=Ts.create({width:e.width,height:e.height,resolution:i,multisample:this.cacheAsBitmapMultisample??s.multisample}),l=`cacheAsBitmap_${_s()}`;this._cacheData.textureCacheId=l,J.addToCache(h.baseTexture,l),X.addToCache(h,l);const c=this.transform.localTransform.copyTo(Gf).invert().translate(-e.x,-e.y);this.render=this._cacheData.originalRender,s.render(this,{renderTexture:h,clear:!0,transform:c,skipUpdateTransform:!1}),s.framebuffer.blit(),s.projection.transform=o,s.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 d=new _e(h);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(e.x/e.width),d.anchor.y=-(e.y/e.height),d.alpha=t,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)},St.prototype._renderCachedCanvas=function(s){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(s),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(s))},St.prototype._initCachedDisplayObjectCanvas=function(s){var c;if((c=this._cacheData)!=null&&c.sprite)return;const t=this.getLocalBounds(new st,!0),e=this.alpha;this.alpha=1;const i=s.canvasContext.activeContext,r=s._projTransform,n=this.cacheAsBitmapResolution||s.resolution;t.ceil(n),t.width=Math.max(t.width,1/n),t.height=Math.max(t.height,1/n);const a=Ts.create({width:t.width,height:t.height,resolution:n}),o=`cacheAsBitmap_${_s()}`;this._cacheData.textureCacheId=o,J.addToCache(a.baseTexture,o),X.addToCache(a,o);const h=Gf;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,s.render(this,{renderTexture:a,clear:!0,transform:h,skipUpdateTransform:!1}),s.canvasContext.activeContext=i,s._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 _e(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=s._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)},St.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},St.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},St.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,J.removeFromCache(this._cacheData.textureCacheId),X.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},St.prototype._cacheAsBitmapDestroy=function(s){this.cacheAsBitmap=!1,this.destroy(s)},St.prototype.name=null,bt.prototype.getChildByName=function(s,t){for(let e=0,i=this.children.length;e<i;e++)if(this.children[e].name===s)return this.children[e];if(t)for(let e=0,i=this.children.length;e<i;e++){const r=this.children[e];if(!r.getChildByName)continue;const n=r.getChildByName(s,!0);if(n)return n}return null},St.prototype.getGlobalPosition=function(s=new tt,t=!1){return this.parent?this.parent.toGlobal(this.position,s,t):(s.x=this.position.x,s.y=this.position.y),s};var Uv=`varying vec2 vTextureCoord;
|
|
527
527
|
|
|
528
528
|
uniform sampler2D uSampler;
|
|
529
529
|
uniform float uAlpha;
|
|
@@ -532,9 +532,9 @@ void main(void)
|
|
|
532
532
|
{
|
|
533
533
|
gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
|
|
534
534
|
}
|
|
535
|
-
`;class
|
|
536
|
-
`);function
|
|
537
|
-
`}return i=i.replace("%blur%",r),i=i.replace("%size%",s.toString()),i}const
|
|
535
|
+
`;class Gv extends Yt{constructor(t=1){super(Pv,Uv,{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}const Hv={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]},Vv=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
|
|
536
|
+
`);function Wv(s){const t=Hv[s],e=t.length;let i=Vv,r="";const n="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;";let a;for(let o=0;o<s;o++){let h=n.replace("%index%",o.toString());a=o,o>=e&&(a=s-o-1),h=h.replace("%value%",t[a].toString()),r+=h,r+=`
|
|
537
|
+
`}return i=i.replace("%blur%",r),i=i.replace("%size%",s.toString()),i}const Xv=`
|
|
538
538
|
attribute vec2 aVertexPosition;
|
|
539
539
|
|
|
540
540
|
uniform mat3 projectionMatrix;
|
|
@@ -564,8 +564,8 @@ void main(void)
|
|
|
564
564
|
|
|
565
565
|
vec2 textureCoord = filterTextureCoord();
|
|
566
566
|
%blur%
|
|
567
|
-
}`;function
|
|
568
|
-
`}return i=i.replace("%blur%",r),i=i.replace("%size%",s.toString()),i}class
|
|
567
|
+
}`;function $v(s,t){const e=Math.ceil(s/2);let i=Xv,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<s;a++){let o=n.replace("%index%",a.toString());o=o.replace("%sampleIndex%",`${a-(e-1)}.0`),r+=o,r+=`
|
|
568
|
+
`}return i=i.replace("%blur%",r),i=i.replace("%size%",s.toString()),i}class Kh extends Yt{constructor(t,e=8,i=4,r=Yt.defaultResolution,n=5){const a=$v(n,t),o=Wv(n);super(a,o),this.horizontal=t,this.resolution=r,this._quality=0,this.quality=i,this.blur=e}apply(t,e,i,r){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.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,i,r);else{const n=t.getFilterTexture(),a=t.renderer;let o=e,h=n;this.state.blend=!1,t.applyFilter(this,o,h,Ze.CLEAR);for(let l=1;l<this.passes-1;l++){t.bindAndClear(o,Ze.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,i,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 Hf extends Yt{constructor(t=8,e=4,i=Yt.defaultResolution,r=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new Kh(!0,t,e,i,r),this.blurYFilter=new Kh(!1,t,e,i,r),this.resolution=i,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,i,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,Ze.CLEAR),this.blurYFilter.apply(t,o,i,r),t.returnFilterTexture(o)}else a?this.blurYFilter.apply(t,e,i,r):this.blurXFilter.apply(t,e,i,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 zv=`varying vec2 vTextureCoord;
|
|
569
569
|
uniform sampler2D uSampler;
|
|
570
570
|
uniform float m[20];
|
|
571
571
|
uniform float uAlpha;
|
|
@@ -617,7 +617,7 @@ void main(void)
|
|
|
617
617
|
|
|
618
618
|
gl_FragColor = vec4(rgb, result.a);
|
|
619
619
|
}
|
|
620
|
-
`;class
|
|
620
|
+
`;class ar extends Yt{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(Df,zv,t),this.alpha=1}_loadMatrix(t,e=!1){let i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[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 i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)}tint(t,e){const[i,r,n]=pt.shared.setValue(t).toArray(),a=[i,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 i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,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 i=Math.cos(t),r=Math.sin(t),n=Math.sqrt,a=1/3,o=n(a),h=i+(1-i)*a,l=a*(1-i)-o*r,c=a*(1-i)+o*r,d=a*(1-i)+o*r,u=i+a*(1-i),f=a*(1-i)-o*r,p=a*(1-i)-o*r,m=a*(1-i)+o*r,_=i+a*(1-i),y=[h,l,c,0,0,d,u,f,0,0,p,m,_,0,0,0,0,0,1,0];this._loadMatrix(y,e)}contrast(t,e){const i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)}saturate(t=0,e){const i=t*2/3+1,r=(i-1)*-.5,n=[i,r,r,0,0,r,i,r,0,0,r,r,i,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,i,r,n){t=t||.2,e=e||.15,i=i||16770432,r=r||3375104;const a=pt.shared,[o,h,l]=a.setValue(i).toArray(),[c,d,u]=a.setValue(r).toArray(),f=[.3,.59,.11,0,0,o,h,l,t,0,c,d,u,e,0,o-c,h-d,l-u,0,0];this._loadMatrix(f,n)}night(t,e){t=t||.1;const i=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(i,e)}predator(t,e){const i=[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(i,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}}ar.prototype.grayscale=ar.prototype.greyscale;var Yv=`varying vec2 vFilterCoord;
|
|
621
621
|
varying vec2 vTextureCoord;
|
|
622
622
|
|
|
623
623
|
uniform vec2 scale;
|
|
@@ -637,7 +637,7 @@ void main(void)
|
|
|
637
637
|
|
|
638
638
|
gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
|
|
639
639
|
}
|
|
640
|
-
`,
|
|
640
|
+
`,jv=`attribute vec2 aVertexPosition;
|
|
641
641
|
|
|
642
642
|
uniform mat3 projectionMatrix;
|
|
643
643
|
uniform mat3 filterMatrix;
|
|
@@ -666,7 +666,7 @@ void main(void)
|
|
|
666
666
|
vTextureCoord = filterTextureCoord();
|
|
667
667
|
vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
|
|
668
668
|
}
|
|
669
|
-
`;class
|
|
669
|
+
`;class qv extends Yt{constructor(t,e){const i=new gt;t.renderable=!1,super(jv,Yv,{mapSampler:t._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=i,e==null&&(e=20),this.scale=new tt(e,e)}apply(t,e,i,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,i,r)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}var Kv=`varying vec2 v_rgbNW;
|
|
670
670
|
varying vec2 v_rgbNE;
|
|
671
671
|
varying vec2 v_rgbSW;
|
|
672
672
|
varying vec2 v_rgbSE;
|
|
@@ -787,7 +787,7 @@ void main() {
|
|
|
787
787
|
|
|
788
788
|
gl_FragColor = color;
|
|
789
789
|
}
|
|
790
|
-
`,
|
|
790
|
+
`,Zv=`
|
|
791
791
|
attribute vec2 aVertexPosition;
|
|
792
792
|
|
|
793
793
|
uniform mat3 projectionMatrix;
|
|
@@ -829,7 +829,7 @@ void main(void) {
|
|
|
829
829
|
|
|
830
830
|
texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
|
|
831
831
|
}
|
|
832
|
-
`;class
|
|
832
|
+
`;class Qv extends Yt{constructor(){super(Zv,Kv)}}var Jv=`precision highp float;
|
|
833
833
|
|
|
834
834
|
varying vec2 vTextureCoord;
|
|
835
835
|
varying vec4 vColor;
|
|
@@ -863,8 +863,8 @@ void main()
|
|
|
863
863
|
|
|
864
864
|
gl_FragColor = color;
|
|
865
865
|
}
|
|
866
|
-
`;class Hv extends Yt{constructor(t=.5,e=Math.random()){super(Af,Gv,{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 Ff={AlphaFilter:Cv,BlurFilter:Of,BlurFilterPass:zh,ColorMatrixFilter:nr,DisplacementFilter:Lv,FXAAFilter:Uv,NoiseFilter:Hv};Object.entries(Ff).forEach(([s,t])=>{Object.defineProperty(Ff,s,{get(){return it("7.1.0",`filters.${s} has moved to ${s}`),t}})});class Vv{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||(At.system.add(this.tickerUpdate,this,zi.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(At.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 $i=new Vv;class nn{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=nn.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new tt,this.page=new tt,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,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,i,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 Ta extends nn{constructor(){super(...arguments),this.client=new tt,this.movement=new tt,this.offset=new tt,this.global=new tt,this.screen=new tt}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,i){return t.worldTransform.applyInverse(i||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,r,n,a,o,h,l,c,d,u,f,p,m){throw new Error("Method not implemented.")}}class Ve extends Ta{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 ar extends Ta{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}ar.DOM_DELTA_PIXEL=0,ar.DOM_DELTA_LINE=1,ar.DOM_DELTA_PAGE=2;const Wv=2048,Xv=new tt,$h=new tt;class zv{constructor(t){this.dispatch=new kr,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((i,r)=>i.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 i=0,r=e.length;i<r;i++)e[i].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){$i.pauseUpdate=!0;const i=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",r=this[i](this.rootTarget,this.rootTarget.eventMode,Xv.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let r=0,n=i.length-1;r<n;r++)if(t.currentTarget=i[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=i.length-2;r>=0;r--)if(t.currentTarget=i[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,i=this._allInteractiveElements){if(i.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(e)?e:[e];for(let n=i.length-1;n>=0;n--)r.forEach(a=>{t.currentTarget=i[n],this.notifyTarget(t,a)})}propagationPath(t){const e=[t];for(let i=0;i<Wv&&t!==this.rootTarget;i++){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,i,r,n,a=!1){let o=!1;if(this._interactivePrune(t))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&($i.pauseUpdate=!1),t.interactiveChildren&&t.children){const c=t.children;for(let d=c.length-1;d>=0;d--){const u=c[d],f=this.hitTestMoveRecursive(u,this._isInteractive(e)?e:u.eventMode,i,r,n,a||n(t,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=t.isInteractive();(f.length>0||p)&&(p&&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,i)&&r(t,i)?l?[t]:[]:null}hitTestRecursive(t,e,i,r,n){if(this._interactivePrune(t)||n(t,i))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&($i.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],d=this.hitTestRecursive(c,this._isInteractive(e)?e:c.eventMode,i,r,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;const u=t.isInteractive();return(d.length>0||u)&&d.push(t),d}}}const a=this._isInteractive(e),o=t.isInteractive();return a&&r(t,i)?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 i;if(t.hitArea&&(t.worldTransform.applyInverse(e,$h),!t.hitArea.contains($h.x,$h.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!((i=r.containsPoint)!=null&&i.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 i=`on${e}`;(a=(n=t.currentTarget)[i])==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 Ve)){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 i=this.trackingData(t.pointerId);i.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var h,l;if(!(t instanceof Ve)){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 i=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",d=this.createPointerEvent(t,c,n);if(this.dispatchEvent(d,"pointerout"),i&&this.dispatchEvent(d,"mouseout"),!e.composedPath().includes(n)){const u=this.createPointerEvent(t,"pointerleave",n);for(u.eventPhase=u.AT_TARGET;u.target&&!e.composedPath().includes(u.target);)u.currentTarget=u.target,this.notifyTarget(u),i&&this.notifyTarget(u,"mouseleave"),u.target=u.target.parent;this.freeEvent(u)}this.freeEvent(d)}if(n!==e.target){const c=t.type==="mousemove"?"mouseover":"pointerover",d=this.clonePointerEvent(e,c);this.dispatchEvent(d,"pointerover"),i&&this.dispatchEvent(d,"mouseover");let u=n==null?void 0:n.parent;for(;u&&u!==this.rootTarget.parent&&u!==e.target;)u=u.parent;if(!u||u===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),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(d)}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")),i&&(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 Ve)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.createPointerEvent(t),r=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(a=i.target)==null?void 0:a.cursor);const n=this.clonePointerEvent(i,"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=i.composedPath(),this.freeEvent(i),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof Ve)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId);if(e.overTargets){const i=t.pointerType==="mouse"||t.pointerType==="pen",r=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(n),i&&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),i&&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 Ve)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const o=i.button===2;this.dispatchEvent(i,o?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]);let a=n;if(n&&!i.composedPath().includes(n)){let o=n;for(;o&&!i.composedPath().includes(o);){if(i.currentTarget=o,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const h=i.button===2;this.notifyTarget(i,h?"rightupoutside":"mouseupoutside")}o=o.parent}delete r.pressTargetsByButton[t.button],a=o}if(a){const o=this.clonePointerEvent(i,"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(i)}mapPointerUpOutside(t){if(!(t instanceof Ve)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.findMountedTarget(e.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(i){let n=i;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 ar)){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 i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const r=this.allocateEvent(Ve);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=i??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof e=="string"&&(r.type=e),r}createWheelEvent(t){const e=this.allocateEvent(ar);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 i=this.allocateEvent(Ve);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Ve&&e instanceof Ve&&(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 Ta&&e instanceof Ta&&(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 i=t.currentTarget._events[e];if(i&&t.currentTarget.isInteractive())if("fn"in i)i.once&&t.currentTarget.removeListener(e,i.fn,void 0,!0),i.fn.call(i.context,t);else for(let r=0,n=i.length;r<n&&!t.propagationImmediatelyStopped;r++)i[r].once&&t.currentTarget.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(i[r].context,t)}}const $v=1,Yv={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Yh=class Wc{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new zv(null),$i.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new Ve(null),this.rootWheelEvent=new ar(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Wc.defaultEventFeatures},{set:(e,i,r)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=r),e[i]=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:i}=this.renderer;this.setTargetElement(e),this.resolution=i,Wc._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 i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.domElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.domElement.style,i);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 i=0,r=e.length;i<r;i++){const n=e[i],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,$i.pointerMoved();const e=this.normalizeToPointerData(t);for(let i=0,r=e.length;i<r;i++){const n=this.bootstrapEvent(this.rootPointerEvent,e[i]);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 i=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+=i,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 i=0,r=e.length;i<r;i++){const n=this.bootstrapEvent(this.rootPointerEvent,e[i]);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,$i.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;$i.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;$i.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,i){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,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=(i-r.top)*(this.domElement.height/r.height)*n}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let i=0,r=t.changedTouches.length;i<r;i++){const n=t.changedTouches[i];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 i=t;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=$v),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}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=Yv[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}};Yh.extension={name:"events",type:[G.RendererSystem,G.CanvasRendererSystem]},Yh.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let jh=Yh;Y.add(jh);function Lf(s){return s==="dynamic"||s==="static"}const jv={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??Lf(jh.defaultEventMode)},set interactive(s){it("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=s,this.eventMode=s?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??jh.defaultEventMode},set eventMode(s){this._internalInteractive=Lf(s),this._internalEventMode=s},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(s,t,e){const i=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;s=i?`${s}capture`:s;const o=typeof t=="function"?t:t.handleEvent,h=this;r&&r.addEventListener("abort",()=>{h.off(s,o,a)}),n?h.once(s,o,a):h.on(s,o,a)},removeEventListener(s,t,e){const i=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,r=typeof t=="function"?void 0:t;s=i?`${s}capture`:s,t=typeof t=="function"?t:t.handleEvent,this.off(s,t,r)},dispatchEvent(s){if(!(s instanceof nn))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=null,s.target=this,s.manager.dispatchEvent(s),!s.defaultPrevented}};St.mixin(jv);const qv={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};St.mixin(qv);const Kv=9,wa=100,Zv=0,Qv=0,kf=2,Nf=1,Jv=-1e3,t1=-1e3,e1=2;class Uf{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,(wi.tablet||wi.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width=`${wa}px`,e.style.height=`${wa}px`,e.style.position="absolute",e.style.top=`${Zv}px`,e.style.left=`${Qv}px`,e.style.zIndex=kf.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=`${Nf}px`,t.style.height=`${Nf}px`,t.style.position="absolute",t.style.top=`${Jv}px`,t.style.left=`${t1}px`,t.style.zIndex=e1.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 i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}update(){const t=performance.now();if(wi.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:i,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 d=this.div;d.style.left=`${e}px`,d.style.top=`${i}px`,d.style.width=`${a}px`,d.style.height=`${o}px`;for(let u=0;u<this.children.length;u++){const f=this.children[u];if(f.renderId!==this.renderId)f._accessibleActive=!1,er(this.children,u,1),this.div.removeChild(f._accessibleDiv),this.pool.push(f._accessibleDiv),f._accessibleDiv=null,u--;else{d=f._accessibleDiv;let p=f.hitArea;const m=f.worldTransform;f.hitArea?(d.style.left=`${(m.tx+p.x*m.a)*l}px`,d.style.top=`${(m.ty+p.y*m.d)*c}px`,d.style.width=`${p.width*m.a*l}px`,d.style.height=`${p.height*m.d*c}px`):(p=f.getBounds(),this.capHitArea(p),d.style.left=`${p.x*l}px`,d.style.top=`${p.y*c}px`,d.style.width=`${p.width*l}px`,d.style.height=`${p.height*c}px`,d.title!==f.accessibleTitle&&f.accessibleTitle!==null&&(d.title=f.accessibleTitle),d.getAttribute("aria-label")!==f.accessibleHint&&f.accessibleHint!==null&&d.setAttribute("aria-label",f.accessibleHint)),(f.accessibleTitle!==d.title||f.tabIndex!==d.tabIndex)&&(d.title=f.accessibleTitle,d.tabIndex=f.tabIndex,this.debug&&this.updateDebugHTML(d))}}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:i}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>i&&(t.height=i-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=`${wa}px`,e.style.height=`${wa}px`,e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=kf.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:i}=t.target,r=this.renderer.events.rootBoundary,n=Object.assign(new nn(r),{target:i});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===Kv&&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}}Uf.extension={name:"accessibility",type:[G.RendererPlugin,G.CanvasRendererPlugin]},Y.add(Uf);const Gf=class Xc{constructor(t){this.stage=new vt,t=Object.assign({forceCanvas:!1},t),this.renderer=dv(t),Xc._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 i=Xc._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Gf._plugins=[];let i1=Gf;Y.handleByList(G.Application,i1._plugins);class Hf{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,i;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;e=r,i=n}this.renderer.resize(e,i),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}}Hf.extension=G.Application,Y.add(Hf);const Vf={loader:G.LoadParser,resolver:G.ResolveParser,cache:G.CacheParser,detection:G.DetectionParser};Y.handle(G.Asset,s=>{const t=s.ref;Object.entries(Vf).filter(([e])=>!!t[e]).forEach(([e,i])=>Y.add(Object.assign(t[e],{extension:t[e].extension??i})))},s=>{const t=s.ref;Object.keys(Vf).filter(e=>!!t[e]).forEach(e=>Y.remove(t[e]))});class s1{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 i=0;i<e;i++)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 or(s,t){if(Array.isArray(t)){for(const e of t)if(s.startsWith(`data:${e}`))return!0;return!1}return s.startsWith(`data:${t}`)}function Yi(s,t){const e=s.split("?")[0],i=zt.extname(e).toLowerCase();return Array.isArray(t)?t.includes(i):i===t}const We=(s,t,e=!1)=>(Array.isArray(s)||(s=[s]),t?s.map(i=>typeof i=="string"||e?t(i):i):s),qh=(s,t)=>{const e=t.split("?")[1];return e&&(s+=`?${e}`),s};function Wf(s,t,e,i,r){const n=t[e];for(let a=0;a<n.length;a++){const o=n[a];e<t.length-1?Wf(s.replace(i[e],o),t,e+1,i,r):r.push(s.replace(i[e],o))}}function r1(s){const t=/\{(.*?)\}/g,e=s.match(t),i=[];if(e){const r=[];e.forEach(n=>{const a=n.substring(1,n.length-1).split(",");r.push(a)}),Wf(s,r,0,e,i)}else i.push(s);return i}const Ea=s=>!Array.isArray(s);class n1{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 i=We(t);let r;for(let o=0;o<this.parsers.length;o++){const h=this.parsers[o];if(h.test(e)){r=h.getCacheableAssets(i,e);break}}r||(r={},i.forEach(o=>{r[o]=e}));const n=Object.keys(r),a={cacheKeys:n,keys:i};if(i.forEach(o=>{this._cacheMap.set(o,a)}),n.forEach(o=>{this._cache.has(o)&&this._cache.get(o)!==e&&console.warn("[Cache] already has key:",o),this._cache.set(o,r[o])}),e instanceof X){const o=e;i.forEach(h=>{o.baseTexture!==X.EMPTY.baseTexture&&J.addToCache(o.baseTexture,h),X.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(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const Es=new n1;class a1{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,i)=>(this._parsersValidated=!1,t[e]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const i={promise:null,parser:null};return i.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),i.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,i.parser=l)}return r})(),i}async load(t,e){this._parsersValidated||this._validateParsers();let i=0;const r={},n=Ea(t),a=We(t,l=>({alias:[l],src:l})),o=a.length,h=a.map(async l=>{const c=zt.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(++i/o)}catch(d){throw delete this.promiseCache[c],delete r[l.src],new Error(`[Loader.load] Failed to load ${c}.
|
|
867
|
-
${d}`)}});return await Promise.all(h),n?r[a[0].src]:r}async unload(t){const e=
|
|
866
|
+
`;class t1 extends Yt{constructor(t=.5,e=Math.random()){super(Df,Jv,{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 Vf={AlphaFilter:Gv,BlurFilter:Hf,BlurFilterPass:Kh,ColorMatrixFilter:ar,DisplacementFilter:qv,FXAAFilter:Qv,NoiseFilter:t1};Object.entries(Vf).forEach(([s,t])=>{Object.defineProperty(Vf,s,{get(){return it("7.1.0",`filters.${s} has moved to ${s}`),t}})});class e1{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||(ft.system.add(this.tickerUpdate,this,zi.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(ft.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 Yi=new e1;class an{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=an.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new tt,this.page=new tt,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,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,i,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 Ea extends an{constructor(){super(...arguments),this.client=new tt,this.movement=new tt,this.offset=new tt,this.global=new tt,this.screen=new tt}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,i){return t.worldTransform.applyInverse(i||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,r,n,a,o,h,l,c,d,u,f,p,m){throw new Error("Method not implemented.")}}class We extends Ea{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 or extends Ea{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}or.DOM_DELTA_PIXEL=0,or.DOM_DELTA_LINE=1,or.DOM_DELTA_PAGE=2;const i1=2048,s1=new tt,Zh=new tt;class r1{constructor(t){this.dispatch=new Je,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((i,r)=>i.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 i=0,r=e.length;i<r;i++)e[i].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){Yi.pauseUpdate=!0;const i=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",r=this[i](this.rootTarget,this.rootTarget.eventMode,s1.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let r=0,n=i.length-1;r<n;r++)if(t.currentTarget=i[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=i.length-2;r>=0;r--)if(t.currentTarget=i[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,i=this._allInteractiveElements){if(i.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(e)?e:[e];for(let n=i.length-1;n>=0;n--)r.forEach(a=>{t.currentTarget=i[n],this.notifyTarget(t,a)})}propagationPath(t){const e=[t];for(let i=0;i<i1&&t!==this.rootTarget;i++){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,i,r,n,a=!1){let o=!1;if(this._interactivePrune(t))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(Yi.pauseUpdate=!1),t.interactiveChildren&&t.children){const c=t.children;for(let d=c.length-1;d>=0;d--){const u=c[d],f=this.hitTestMoveRecursive(u,this._isInteractive(e)?e:u.eventMode,i,r,n,a||n(t,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=t.isInteractive();(f.length>0||p)&&(p&&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,i)&&r(t,i)?l?[t]:[]:null}hitTestRecursive(t,e,i,r,n){if(this._interactivePrune(t)||n(t,i))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(Yi.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],d=this.hitTestRecursive(c,this._isInteractive(e)?e:c.eventMode,i,r,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;const u=t.isInteractive();return(d.length>0||u)&&d.push(t),d}}}const a=this._isInteractive(e),o=t.isInteractive();return a&&r(t,i)?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 i;if(t.hitArea&&(t.worldTransform.applyInverse(e,Zh),!t.hitArea.contains(Zh.x,Zh.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!((i=r.containsPoint)!=null&&i.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 i=`on${e}`;(a=(n=t.currentTarget)[i])==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 We)){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 i=this.trackingData(t.pointerId);i.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var h,l;if(!(t instanceof We)){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 i=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",d=this.createPointerEvent(t,c,n);if(this.dispatchEvent(d,"pointerout"),i&&this.dispatchEvent(d,"mouseout"),!e.composedPath().includes(n)){const u=this.createPointerEvent(t,"pointerleave",n);for(u.eventPhase=u.AT_TARGET;u.target&&!e.composedPath().includes(u.target);)u.currentTarget=u.target,this.notifyTarget(u),i&&this.notifyTarget(u,"mouseleave"),u.target=u.target.parent;this.freeEvent(u)}this.freeEvent(d)}if(n!==e.target){const c=t.type==="mousemove"?"mouseover":"pointerover",d=this.clonePointerEvent(e,c);this.dispatchEvent(d,"pointerover"),i&&this.dispatchEvent(d,"mouseover");let u=n==null?void 0:n.parent;for(;u&&u!==this.rootTarget.parent&&u!==e.target;)u=u.parent;if(!u||u===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),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(d)}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")),i&&(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 We)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.createPointerEvent(t),r=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(a=i.target)==null?void 0:a.cursor);const n=this.clonePointerEvent(i,"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=i.composedPath(),this.freeEvent(i),this.freeEvent(n)}mapPointerOut(t){if(!(t instanceof We)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId);if(e.overTargets){const i=t.pointerType==="mouse"||t.pointerType==="pen",r=this.findMountedTarget(e.overTargets),n=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(n),i&&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),i&&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 We)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const o=i.button===2;this.dispatchEvent(i,o?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[t.button]);let a=n;if(n&&!i.composedPath().includes(n)){let o=n;for(;o&&!i.composedPath().includes(o);){if(i.currentTarget=o,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const h=i.button===2;this.notifyTarget(i,h?"rightupoutside":"mouseupoutside")}o=o.parent}delete r.pressTargetsByButton[t.button],a=o}if(a){const o=this.clonePointerEvent(i,"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(i)}mapPointerUpOutside(t){if(!(t instanceof We)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.findMountedTarget(e.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(i){let n=i;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 or)){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 i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const r=this.allocateEvent(We);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=i??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof e=="string"&&(r.type=e),r}createWheelEvent(t){const e=this.allocateEvent(or);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 i=this.allocateEvent(We);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof We&&e instanceof We&&(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 Ea&&e instanceof Ea&&(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 i=t.currentTarget._events[e];if(i&&t.currentTarget.isInteractive())if("fn"in i)i.once&&t.currentTarget.removeListener(e,i.fn,void 0,!0),i.fn.call(i.context,t);else for(let r=0,n=i.length;r<n&&!t.propagationImmediatelyStopped;r++)i[r].once&&t.currentTarget.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(i[r].context,t)}}const n1=1,a1={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Qh=class Kc{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new r1(null),Yi.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new We(null),this.rootWheelEvent=new or(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Kc.defaultEventFeatures},{set:(e,i,r)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=r),e[i]=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:i}=this.renderer;this.setTargetElement(e),this.resolution=i,Kc._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 i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.domElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.domElement.style,i);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 i=0,r=e.length;i<r;i++){const n=e[i],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,Yi.pointerMoved();const e=this.normalizeToPointerData(t);for(let i=0,r=e.length;i<r;i++){const n=this.bootstrapEvent(this.rootPointerEvent,e[i]);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 i=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+=i,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 i=0,r=e.length;i<r;i++){const n=this.bootstrapEvent(this.rootPointerEvent,e[i]);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,Yi.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;Yi.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;Yi.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,i){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,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=(i-r.top)*(this.domElement.height/r.height)*n}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let i=0,r=t.changedTouches.length;i<r;i++){const n=t.changedTouches[i];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 i=t;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=n1),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}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=a1[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}};Qh.extension={name:"events",type:[G.RendererSystem,G.CanvasRendererSystem]},Qh.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Jh=Qh;z.add(Jh);function Wf(s){return s==="dynamic"||s==="static"}const o1={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??Wf(Jh.defaultEventMode)},set interactive(s){it("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=s,this.eventMode=s?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Jh.defaultEventMode},set eventMode(s){this._internalInteractive=Wf(s),this._internalEventMode=s},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(s,t,e){const i=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;s=i?`${s}capture`:s;const o=typeof t=="function"?t:t.handleEvent,h=this;r&&r.addEventListener("abort",()=>{h.off(s,o,a)}),n?h.once(s,o,a):h.on(s,o,a)},removeEventListener(s,t,e){const i=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,r=typeof t=="function"?void 0:t;s=i?`${s}capture`:s,t=typeof t=="function"?t:t.handleEvent,this.off(s,t,r)},dispatchEvent(s){if(!(s instanceof an))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return s.defaultPrevented=!1,s.path=null,s.target=this,s.manager.dispatchEvent(s),!s.defaultPrevented}};St.mixin(o1);const h1={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};St.mixin(h1);const l1=9,Aa=100,c1=0,u1=0,Xf=2,$f=1,d1=-1e3,f1=-1e3,p1=2;class zf{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,(Ei.tablet||Ei.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width=`${Aa}px`,e.style.height=`${Aa}px`,e.style.position="absolute",e.style.top=`${c1}px`,e.style.left=`${u1}px`,e.style.zIndex=Xf.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=`${$f}px`,t.style.height=`${$f}px`,t.style.position="absolute",t.style.top=`${d1}px`,t.style.left=`${f1}px`,t.style.zIndex=p1.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 i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}update(){const t=performance.now();if(Ei.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:i,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 d=this.div;d.style.left=`${e}px`,d.style.top=`${i}px`,d.style.width=`${a}px`,d.style.height=`${o}px`;for(let u=0;u<this.children.length;u++){const f=this.children[u];if(f.renderId!==this.renderId)f._accessibleActive=!1,ir(this.children,u,1),this.div.removeChild(f._accessibleDiv),this.pool.push(f._accessibleDiv),f._accessibleDiv=null,u--;else{d=f._accessibleDiv;let p=f.hitArea;const m=f.worldTransform;f.hitArea?(d.style.left=`${(m.tx+p.x*m.a)*l}px`,d.style.top=`${(m.ty+p.y*m.d)*c}px`,d.style.width=`${p.width*m.a*l}px`,d.style.height=`${p.height*m.d*c}px`):(p=f.getBounds(),this.capHitArea(p),d.style.left=`${p.x*l}px`,d.style.top=`${p.y*c}px`,d.style.width=`${p.width*l}px`,d.style.height=`${p.height*c}px`,d.title!==f.accessibleTitle&&f.accessibleTitle!==null&&(d.title=f.accessibleTitle),d.getAttribute("aria-label")!==f.accessibleHint&&f.accessibleHint!==null&&d.setAttribute("aria-label",f.accessibleHint)),(f.accessibleTitle!==d.title||f.tabIndex!==d.tabIndex)&&(d.title=f.accessibleTitle,d.tabIndex=f.tabIndex,this.debug&&this.updateDebugHTML(d))}}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:i}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>i&&(t.height=i-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=`${Aa}px`,e.style.height=`${Aa}px`,e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=Xf.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:i}=t.target,r=this.renderer.events.rootBoundary,n=Object.assign(new an(r),{target:i});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===l1&&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}}zf.extension={name:"accessibility",type:[G.RendererPlugin,G.CanvasRendererPlugin]},z.add(zf);const Yf=class Zc{constructor(t){this.stage=new bt,t=Object.assign({forceCanvas:!1},t),this.renderer=Av(t),Zc._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 i=Zc._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Yf._plugins=[];let m1=Yf;z.handleByList(G.Application,m1._plugins);class jf{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,i;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;e=r,i=n}this.renderer.resize(e,i),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}}jf.extension=G.Application,z.add(jf);const qf={loader:G.LoadParser,resolver:G.ResolveParser,cache:G.CacheParser,detection:G.DetectionParser};z.handle(G.Asset,s=>{const t=s.ref;Object.entries(qf).filter(([e])=>!!t[e]).forEach(([e,i])=>z.add(Object.assign(t[e],{extension:t[e].extension??i})))},s=>{const t=s.ref;Object.keys(qf).filter(e=>!!t[e]).forEach(e=>z.remove(t[e]))});class _1{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 i=0;i<e;i++)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 hr(s,t){if(Array.isArray(t)){for(const e of t)if(s.startsWith(`data:${e}`))return!0;return!1}return s.startsWith(`data:${t}`)}function ji(s,t){const e=s.split("?")[0],i=Ft.extname(e).toLowerCase();return Array.isArray(t)?t.includes(i):i===t}const Xe=(s,t,e=!1)=>(Array.isArray(s)||(s=[s]),t?s.map(i=>typeof i=="string"||e?t(i):i):s),tl=(s,t)=>{const e=t.split("?")[1];return e&&(s+=`?${e}`),s};function Kf(s,t,e,i,r){const n=t[e];for(let a=0;a<n.length;a++){const o=n[a];e<t.length-1?Kf(s.replace(i[e],o),t,e+1,i,r):r.push(s.replace(i[e],o))}}function g1(s){const t=/\{(.*?)\}/g,e=s.match(t),i=[];if(e){const r=[];e.forEach(n=>{const a=n.substring(1,n.length-1).split(",");r.push(a)}),Kf(s,r,0,e,i)}else i.push(s);return i}const Sa=s=>!Array.isArray(s);class y1{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 i=Xe(t);let r;for(let o=0;o<this.parsers.length;o++){const h=this.parsers[o];if(h.test(e)){r=h.getCacheableAssets(i,e);break}}r||(r={},i.forEach(o=>{r[o]=e}));const n=Object.keys(r),a={cacheKeys:n,keys:i};if(i.forEach(o=>{this._cacheMap.set(o,a)}),n.forEach(o=>{this._cache.has(o)&&this._cache.get(o)!==e&&console.warn("[Cache] already has key:",o),this._cache.set(o,r[o])}),e instanceof X){const o=e;i.forEach(h=>{o.baseTexture!==X.EMPTY.baseTexture&&J.addToCache(o.baseTexture,h),X.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(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const As=new y1;class x1{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,i)=>(this._parsersValidated=!1,t[e]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const i={promise:null,parser:null};return i.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),i.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,i.parser=l)}return r})(),i}async load(t,e){this._parsersValidated||this._validateParsers();let i=0;const r={},n=Sa(t),a=Xe(t,l=>({alias:[l],src:l})),o=a.length,h=a.map(async l=>{const c=Ft.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(++i/o)}catch(d){throw delete this.promiseCache[c],delete r[l.src],new Error(`[Loader.load] Failed to load ${c}.
|
|
867
|
+
${d}`)}});return await Promise.all(h),n?r[a[0].src]:r}async unload(t){const e=Xe(t,i=>({alias:[i],src:i})).map(async i=>{var a,o;const r=Ft.toAbsolute(i.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,i,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 Re=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(Re||{});const v1=".json",b1="application/json",T1={extension:{type:G.LoadParser,priority:Re.Low},name:"loadJson",test(s){return hr(s,b1)||ji(s,v1)},async load(s){return await(await H.ADAPTER.fetch(s)).json()}};z.add(T1);const w1=".txt",E1="text/plain",A1={name:"loadTxt",extension:{type:G.LoadParser,priority:Re.Low},test(s){return hr(s,E1)||ji(s,w1)},async load(s){return await(await H.ADAPTER.fetch(s)).text()}};z.add(A1);const S1=["normal","bold","100","200","300","400","500","600","700","800","900"],C1=[".ttf",".otf",".woff",".woff2"],P1=["font/ttf","font/otf","font/woff","font/woff2"],R1=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function I1(s){const t=Ft.extname(s),e=Ft.basename(s,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1));let i=e.length>0;for(const n of e)if(!n.match(R1)){i=!1;break}let r=e.join(" ");return i||(r=`"${r.replace(/[\\"]/g,"\\$&")}"`),r}const M1=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function D1(s){return M1.test(s)?s:encodeURI(s)}const B1={extension:{type:G.LoadParser,priority:Re.Low},name:"loadWebFont",test(s){return hr(s,P1)||ji(s,C1)},async load(s,t){var i,r,n;const e=H.ADAPTER.getFontFaceSet();if(e){const a=[],o=((i=t.data)==null?void 0:i.family)??I1(s),h=((n=(r=t.data)==null?void 0:r.weights)==null?void 0:n.filter(c=>S1.includes(c)))??["normal"],l=t.data??{};for(let c=0;c<h.length;c++){const d=h[c],u=new FontFace(o,`url(${D1(s)})`,{...l,weight:d});await u.load(),e.add(u),a.push(u)}return a.length===1?a[0]:a}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(s){(Array.isArray(s)?s:[s]).forEach(t=>H.ADAPTER.getFontFaceSet().delete(t))}};z.add(B1);const O1=`(function() {
|
|
868
868
|
"use strict";
|
|
869
869
|
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
|
870
870
|
async function checkImageBitmap() {
|
|
@@ -881,7 +881,7 @@ ${d}`)}});return await Promise.all(h),n?r[a[0].src]:r}async unload(t){const e=We
|
|
|
881
881
|
self.postMessage(result);
|
|
882
882
|
});
|
|
883
883
|
})();
|
|
884
|
-
`;let
|
|
884
|
+
`;let lr=null,el=class{constructor(){lr||(lr=URL.createObjectURL(new Blob([O1],{type:"application/javascript"}))),this.worker=new Worker(lr)}};el.revokeObjectURL=function(){lr&&(URL.revokeObjectURL(lr),lr=null)};const F1=`(function() {
|
|
885
885
|
"use strict";
|
|
886
886
|
async function loadImageBitmap(url) {
|
|
887
887
|
const response = await fetch(url);
|
|
@@ -907,8 +907,8 @@ ${d}`)}});return await Promise.all(h),n?r[a[0].src]:r}async unload(t){const e=We
|
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
})();
|
|
910
|
-
`;let
|
|
911
|
-
Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:t,src:e,data:i,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`)},We(a).forEach(h=>{const{src:l,srcs:c}=h;let{data:d,format:u,loadParser:f}=h;const p=We(l||c).map(y=>typeof y=="string"?r1(y):Array.isArray(y)?y:[y]),m=this.getAlias(h);Array.isArray(m)?m.forEach(o):o(m);const g=[];p.forEach(y=>{y.forEach(v=>{let _={};if(typeof v!="object"){_.src=v;for(let x=0;x<this._parsers.length;x++){const b=this._parsers[x];if(b.test(v)){_=b.parse(v);break}}}else d=v.data??d,u=v.format??u,f=v.loadParser??f,_={..._,...v};if(!m)throw new Error(`[Resolver] alias is undefined for this asset: ${_.src}`);_=this.buildResolvedAsset(_,{aliases:m,data:d,format:u,loadParser:f}),g.push(_)})}),m.forEach(y=>{this._assetMap[y]=g})})}resolveBundle(t){const e=Ea(t);t=We(t);const i={};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}i[r]=o}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const r in e)i[r]=e[r].src;return i}return e.src}resolve(t){const e=Ea(t);t=We(t);const i={};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(d=>d[h]?d[h]===l:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]??a}else this._resolverHash[r]=this.buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const i=t[0],r=this._preferredOrder.find(n=>n.params.format.includes(i.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:i,data:r,loadParser:n,format:a}=e;return(this._basePath||this._rootPath)&&(t.src=zt.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??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??zt.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}class O1{constructor(){this._detections=[],this._initialized=!1,this.resolver=new B1,this.loader=new a1,this.cache=Es,this._backgroundLoader=new s1(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,i=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:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,r,n){this.resolver.add(t,e,i,r,n)}async load(t,e){this._initialized||await this.init();const i=Ea(t),r=We(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 i?a[r[0]]:a}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);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(d=>{const u=r[d];return h+=Object.keys(u).length,this._mapLoadToResolve(u,l).then(f=>{n[d]=f})});return await Promise.all(c),i?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(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return Es.get(t);const e={};for(let i=0;i<t.length;i++)e[i]=Es.get(t[i]);return e}async _mapLoadToResolve(t,e){const i=Object.values(t),r=Object.keys(t);this._backgroundLoader.active=!1;const n=await this.loader.load(i,e);this._backgroundLoader.active=!0;const a={};return i.forEach((o,h)=>{const l=n[o.src],c=[o.src];o.alias&&c.push(...o.alias),a[r[h]]=l,Es.set(c,l)}),a}async unload(t){this._initialized||await this.init();const e=We(t).map(r=>typeof r!="string"?r.src:r),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=We(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map(r=>this._unloadFromResolved(e[r]));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(i=>{Es.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,r)=>e.indexOf(i)===r),e}get detections(){return this._detections}get preferWorkers(){return Aa.config.preferWorkers}set preferWorkers(t){it("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(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}}const ji=new O1;Y.handleByList(G.LoadParser,ji.loader.parsers).handleByList(G.ResolveParser,ji.resolver.parsers).handleByList(G.CacheParser,ji.cache.parsers).handleByList(G.DetectionParser,ji.detections);const F1={extension:G.CacheParser,test:s=>Array.isArray(s)&&s.every(t=>t instanceof X),getCacheableAssets:(s,t)=>{const e={};return s.forEach(i=>{t.forEach((r,n)=>{e[i+(n===0?"":n+1)]=r})}),e}};Y.add(F1);async function Yf(s){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=s});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(s)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const L1={extension:{type:G.DetectionParser,priority:1},test:async()=>Yf("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(t=>t!=="avif")};Y.add(L1);const k1={extension:{type:G.DetectionParser,priority:0},test:async()=>Yf("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(t=>t!=="webp")};Y.add(k1);const jf=["png","jpg","jpeg"],N1={extension:{type:G.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...jf],remove:async s=>s.filter(t=>!jf.includes(t))};Y.add(N1);const U1="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Qh(s){return U1?!1:document.createElement("video").canPlayType(s)!==""}const G1={extension:{type:G.DetectionParser,priority:0},test:async()=>Qh("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(t=>t!=="webm")};Y.add(G1);const H1={extension:{type:G.DetectionParser,priority:0},test:async()=>Qh("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(t=>t!=="mp4"&&t!=="m4v")};Y.add(H1);const V1={extension:{type:G.DetectionParser,priority:0},test:async()=>Qh("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(t=>t!=="ogv")};Y.add(V1);const W1={extension:G.ResolveParser,test:Aa.test,parse:s=>{var t;return{resolution:parseFloat(((t=H.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:zt.extname(s).slice(1),src:s}}};Y.add(W1);var Qt=(s=>(s[s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",s[s.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",s[s.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",s[s.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",s[s.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",s[s.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",s[s.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",s[s.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",s[s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",s[s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",s[s.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",s[s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",s[s.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",s[s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",s[s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",s[s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",s))(Qt||{});const Sa={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 oi,cr;function qf(){cr={bptc:oi.getExtension("EXT_texture_compression_bptc"),astc:oi.getExtension("WEBGL_compressed_texture_astc"),etc:oi.getExtension("WEBGL_compressed_texture_etc"),s3tc:oi.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:oi.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:oi.getExtension("WEBGL_compressed_texture_pvrtc")||oi.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:oi.getExtension("WEBGL_compressed_texture_etc1"),atc:oi.getExtension("WEBGL_compressed_texture_atc")}}const X1={extension:{type:G.DetectionParser,priority:2},test:async()=>{const s=H.ADAPTER.createCanvas().getContext("webgl");return s?(oi=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{cr||qf();const t=[];for(const e in cr)cr[e]&&t.push(e);return[...t,...s]},remove:async s=>(cr||qf(),s.filter(t=>!(t in cr)))};Y.add(X1);class z1 extends ta{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,r;typeof t=="string"?(i=t,r=new Uint8Array):(i=null,r=t),super(r,e),this.origin=i,this.buffer=r?new yh(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 yh(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class As extends z1{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=As._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||As._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){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=As._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,i,r,n,a,o){const h=new Array(i);let l=t.byteOffset,c=a,d=o,u=c+r-1&~(r-1),f=d+n-1&~(n-1),p=u*f*Sa[e];for(let m=0;m<i;m++)h[m]={levelID:m,levelWidth:i>1?c:u,levelHeight:i>1?d:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,d=d>>1||1,u=c+r-1&~(r-1),f=d+n-1&~(n-1),p=u*f*Sa[e];return h}}const Jh=4,Ca=124,$1=32,Kf=20,Y1=542327876,Pa={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},j1={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},Ra={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},q1=1,K1=2,Z1=4,Q1=64,J1=512,tb=131072,eb=827611204,ib=861165636,sb=894720068,rb=808540228,nb=4,ab={[eb]:Qt.COMPRESSED_RGBA_S3TC_DXT1_EXT,[ib]:Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT,[sb]:Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT},ob={70:Qt.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Qt.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Qt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Qt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Qt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Qt.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Qt.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Qt.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Qt.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function hb(s){const t=new Uint32Array(s);if(t[0]!==Y1)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(s,0,Ca/Uint32Array.BYTES_PER_ELEMENT),i=e[Pa.HEIGHT],r=e[Pa.WIDTH],n=e[Pa.MIPMAP_COUNT],a=new Uint32Array(s,Pa.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,$1/Uint32Array.BYTES_PER_ELEMENT),o=a[q1];if(o&Z1){const h=a[j1.FOURCC];if(h!==rb){const v=ab[h],_=Jh+Ca,x=new Uint8Array(s,_);return[new As(x,{format:v,width:r,height:i,levels:n})]}const l=Jh+Ca,c=new Uint32Array(t.buffer,l,Kf/Uint32Array.BYTES_PER_ELEMENT),d=c[Ra.DXGI_FORMAT],u=c[Ra.RESOURCE_DIMENSION],f=c[Ra.MISC_FLAG],p=c[Ra.ARRAY_SIZE],m=ob[d];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${d}`);if(f===nb)throw new Error("DDSParser does not support cubemap textures");if(u===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,y=Jh+Ca+Kf;if(p===1)g.push(new Uint8Array(s,y));else{const v=Sa[m];let _=0,x=r,b=i;for(let T=0;T<n;T++){const E=Math.max(1,x+3&-4),A=Math.max(1,b+3&-4),P=E*A*v;_+=P,x=x>>>1,b=b>>>1}let w=y;for(let T=0;T<p;T++)g.push(new Uint8Array(s,w,_)),w+=_}return g.map(v=>new As(v,{format:m,width:r,height:i,levels:n}))}throw o&Q1?new Error("DDSParser does not support uncompressed texture data."):o&J1?new Error("DDSParser does not supported YUV uncompressed texture data."):o&tb?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&K1?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 Zf=[171,75,84,88,32,49,49,187,13,10,26,10],lb=67305985,ze={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,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},tl=64,Qf={[Z.UNSIGNED_BYTE]:1,[Z.UNSIGNED_SHORT]:2,[Z.INT]:4,[Z.UNSIGNED_INT]:4,[Z.FLOAT]:4,[Z.HALF_FLOAT]:8},cb={[O.RGBA]:4,[O.RGB]:3,[O.RG]:2,[O.RED]:1,[O.LUMINANCE]:1,[O.LUMINANCE_ALPHA]:2,[O.ALPHA]:1},ub={[Z.UNSIGNED_SHORT_4_4_4_4]:2,[Z.UNSIGNED_SHORT_5_5_5_1]:2,[Z.UNSIGNED_SHORT_5_6_5]:2};function db(s,t,e=!1){const i=new DataView(t);if(!fb(s,i))return null;const r=i.getUint32(ze.ENDIANNESS,!0)===lb,n=i.getUint32(ze.GL_TYPE,r),a=i.getUint32(ze.GL_FORMAT,r),o=i.getUint32(ze.GL_INTERNAL_FORMAT,r),h=i.getUint32(ze.PIXEL_WIDTH,r),l=i.getUint32(ze.PIXEL_HEIGHT,r)||1,c=i.getUint32(ze.PIXEL_DEPTH,r)||1,d=i.getUint32(ze.NUMBER_OF_ARRAY_ELEMENTS,r)||1,u=i.getUint32(ze.NUMBER_OF_FACES,r),f=i.getUint32(ze.NUMBER_OF_MIPMAP_LEVELS,r),p=i.getUint32(ze.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(u!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(d!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,y=h+3&-4,v=l+3&-4,_=new Array(d);let x=h*l;n===0&&(x=y*v);let b;if(n!==0?Qf[n]?b=Qf[n]*cb[a]:b=ub[n]:b=Sa[o],b===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const w=e?mb(i,p,r):null;let T=x*b,E=h,A=l,P=y,L=v,M=tl+p;for(let S=0;S<f;S++){const C=i.getUint32(M,r);let R=M+4;for(let N=0;N<d;N++){let F=_[N];F||(F=_[N]=new Array(f)),F[S]={levelID:S,levelWidth:f>1||n!==0?E:P,levelHeight:f>1||n!==0?A:L,levelBuffer:new Uint8Array(t,R,T)},R+=T}M+=C+4,M=M%4!==0?M+4-M%4:M,E=E>>1||1,A=A>>1||1,P=E+m-1&~(m-1),L=A+g-1&~(g-1),T=P*L*b}return n!==0?{uncompressed:_.map(S=>{let C=S[0].levelBuffer,R=!1;return n===Z.FLOAT?C=new Float32Array(S[0].levelBuffer.buffer,S[0].levelBuffer.byteOffset,S[0].levelBuffer.byteLength/4):n===Z.UNSIGNED_INT?(R=!0,C=new Uint32Array(S[0].levelBuffer.buffer,S[0].levelBuffer.byteOffset,S[0].levelBuffer.byteLength/4)):n===Z.INT&&(R=!0,C=new Int32Array(S[0].levelBuffer.buffer,S[0].levelBuffer.byteOffset,S[0].levelBuffer.byteLength/4)),{resource:new ta(C,{width:S[0].levelWidth,height:S[0].levelHeight}),type:n,format:R?pb(a):a}}),kvData:w}:{compressed:_.map(S=>new As(null,{format:o,width:h,height:l,levels:f,levelBuffers:S})),kvData:w}}function fb(s,t){for(let e=0;e<Zf.length;e++)if(t.getUint8(e)!==Zf[e])return console.error(`${s} is not a valid *.ktx file!`),!1;return!0}function pb(s){switch(s){case O.RGBA:return O.RGBA_INTEGER;case O.RGB:return O.RGB_INTEGER;case O.RG:return O.RG_INTEGER;case O.RED:return O.RED_INTEGER;default:return s}}function mb(s,t,e){const i=new Map;let r=0;for(;r<t;){const n=s.getUint32(tl+r,e),a=tl+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&&s.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(s.buffer,a,h)),c=new DataView(s.buffer,a+h+1,n-h-1);i.set(l,c),r+=4+n+o}return i}const gb={extension:{type:G.LoadParser,priority:Xe.High},name:"loadDDS",test(s){return Yi(s,".dds")},async load(s,t,e){const i=await(await H.ADAPTER.fetch(s)).arrayBuffer(),r=hb(i).map(n=>{const a=new J(n,{mipmap:Ke.OFF,alphaMode:he.NO_PREMULTIPLIED_ALPHA,resolution:Ci(s),...t.data});return an(a,e,s)});return r.length===1?r[0]:r},unload(s){Array.isArray(s)?s.forEach(t=>t.destroy(!0)):s.destroy(!0)}};Y.add(gb);const _b={extension:{type:G.LoadParser,priority:Xe.High},name:"loadKTX",test(s){return Yi(s,".ktx")},async load(s,t,e){const i=await(await H.ADAPTER.fetch(s)).arrayBuffer(),{compressed:r,uncompressed:n,kvData:a}=db(s,i),o=r??n,h={mipmap:Ke.OFF,alphaMode:he.NO_PREMULTIPLIED_ALPHA,resolution:Ci(s),...t.data},l=o.map(c=>{o===n&&Object.assign(h,{type:c.type,format:c.format});const d=c.resource??c,u=new J(d,h);return u.ktxKeyValueData=a,an(u,e,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(t=>t.destroy(!0)):s.destroy(!0)}};Y.add(_b);const yb=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],xb={extension:G.ResolveParser,test:s=>{const t=zt.extname(s).slice(1);return["basis","ktx","dds"].includes(t)},parse:s=>{var i,r;const t=s.split("."),e=t.pop();if(["ktx","dds"].includes(e)){const n=t.pop();if(yb.includes(n))return{resolution:parseFloat(((i=H.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:n,src:s}}return{resolution:parseFloat(((r=H.RETINA_PREFIX.exec(s))==null?void 0:r[1])??"1"),format:e,src:s}}};Y.add(xb);const Ia=new st,vb=4,Jf=class In{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,i,r){const n=new Image;return n.src=await this.base64(t,e,i,r),n}async base64(t,e,i,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,i)});if(n.toDataURL!==void 0)return n.toDataURL(e,i);if(n.convertToBlob!==void 0){const a=await n.convertToBlob({type:e,quality:i});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:i,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);a&&In._flipY(i,r,n),o&&In._unpremultiplyAlpha(i);const h=new ex(r,n,1),l=new ImageData(new Uint8ClampedArray(i.buffer),r,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:i,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);return a&&In._flipY(i,r,n),o&&In._unpremultiplyAlpha(i),i}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let r,n=!1,a=!1,o,h=!1;t&&(t instanceof bs?o=t:(o=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(Ia.width=e.width,Ia.height=e.height,e=Ia)));const l=i.gl;if(o){if(r=o.baseTexture.resolution,e=e??o.frame,n=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===O.RGBA,!h){i.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else r=i.resolution,e||(e=Ia,e.width=i.width/r,e.height=i.height/r),n=!0,a=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(e.width*r),1),d=Math.max(Math.round(e.height*r),1),u=new Uint8Array(vb*c*d);return l.readPixels(Math.round(e.x*r),Math.round(e.y*r),c,d,l.RGBA,l.UNSIGNED_BYTE,u),h&&(o==null||o.destroy(!0)),{pixels:u,width:c,height:d,flipY:n,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,i){const r=e<<2,n=i>>1,a=new Uint8Array(r);for(let o=0;o<n;o++){const h=o*r,l=(i-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 i=0;i<e;i+=4){const r=t[i+3];if(r!==0){const n=255.001/r;t[i]=t[i]*n+.5,t[i+1]=t[i+1]*n+.5,t[i+2]=t[i+2]*n+.5}}}};Jf.extension={name:"extract",type:G.RendererSystem};let bb=Jf;Y.add(bb);const Ma={build(s){const t=s.points;let e,i,r,n,a,o;if(s.type===Zt.CIRC){const p=s.shape;e=p.x,i=p.y,a=o=p.radius,r=n=0}else if(s.type===Zt.ELIP){const p=s.shape;e=p.x,i=p.y,a=p.width,o=p.height,r=n=0}else{const p=s.shape,m=p.width/2,g=p.height/2;e=p.x+m,i=p.y+g,a=o=Math.max(0,Math.min(p.radius,Math.min(m,g))),r=m-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]=i+n,t[2]=t[4]=e-r,t[5]=t[7]=i-n;return}let c=0,d=h*4+(r?2:0)+2,u=d,f=l;{const p=r+a,m=n,g=e+p,y=e-p,v=i+m;if(t[c++]=g,t[c++]=v,t[--d]=v,t[--d]=y,n){const _=i-m;t[u++]=y,t[u++]=_,t[--f]=_,t[--f]=g}}for(let p=1;p<h;p++){const m=Math.PI/2*(p/h),g=r+Math.cos(m)*a,y=n+Math.sin(m)*o,v=e+g,_=e-g,x=i+y,b=i-y;t[c++]=v,t[c++]=x,t[--d]=x,t[--d]=_,t[u++]=_,t[u++]=b,t[--f]=b,t[--f]=v}{const p=r,m=n+o,g=e+p,y=e-p,v=i+m,_=i-m;t[c++]=g,t[c++]=v,t[--f]=_,t[--f]=g,r&&(t[c++]=y,t[c++]=v,t[--f]=_,t[--f]=y)}},triangulate(s,t){const e=s.points,i=t.points,r=t.indices;if(e.length===0)return;let n=i.length/2;const a=n;let o,h;if(s.type!==Zt.RREC){const c=s.shape;o=c.x,h=c.y}else{const c=s.shape;o=c.x+c.width/2,h=c.y+c.height/2}const l=s.matrix;i.push(s.matrix?l.a*o+l.c*h+l.tx:o,s.matrix?l.b*o+l.d*h+l.ty:h),n++,i.push(e[0],e[1]);for(let c=2;c<e.length;c+=2)i.push(e[c],e[c+1]),r.push(n++,a,n);r.push(a+1,a,n)}};function tp(s,t=!1){const e=s.length;if(e<6)return;let i=0;for(let r=0,n=s[e-2],a=s[e-1];r<e;r+=2){const o=s[r],h=s[r+1];i+=(o-n)*(h+a),n=o,a=h}if(!t&&i>0||t&&i<=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;[s[a],s[h]]=[s[h],s[a]],[s[o],s[l]]=[s[l],s[o]]}}}const ep={build(s){s.points=s.shape.points.slice()},triangulate(s,t){let e=s.points;const i=s.holes,r=t.points,n=t.indices;if(e.length>=6){tp(e,!1);const a=[];for(let l=0;l<i.length;l++){const c=i[l];tp(c.points,!0),a.push(e.length/2),e=e.concat(c.points)}const o=Fg(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])}}},Tb={build(s){const t=s.shape,e=t.x,i=t.y,r=t.width,n=t.height,a=s.points;a.length=0,r>=0&&n>=0&&a.push(e,i,e+r,i,e+r,i+n,e,i+n)},triangulate(s,t){const e=s.points,i=t.points;if(e.length===0)return;const r=i.length/2;i.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)}},wb={build(s){Ma.build(s)},triangulate(s,t){Ma.triangulate(s,t)}};var Re=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(Re||{}),qi=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(qi||{});const ur={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,t=20){if(!this.adaptive||!s||isNaN(s))return t;let e=Math.ceil(s/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class ip{static curveTo(t,e,i,r,n,a){const o=a[a.length-2],h=a[a.length-1]-e,l=o-t,c=r-e,d=i-t,u=Math.abs(h*d-l*c);if(u<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,p=c*c+d*d,m=h*c+l*d,g=n*Math.sqrt(f)/u,y=n*Math.sqrt(p)/u,v=g*m/f,_=y*m/p,x=g*d+y*l,b=g*c+y*h,w=l*(y+v),T=h*(y+v),E=d*(g+_),A=c*(g+_),P=Math.atan2(T-b,w-x),L=Math.atan2(A-b,E-x);return{cx:x+t,cy:b+e,radius:n,startAngle:P,endAngle:L,anticlockwise:l*c>d*h}}static arc(t,e,i,r,n,a,o,h,l){const c=o-a,d=ur._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/ia)*40),u=c/(d*2),f=u*2,p=Math.cos(u),m=Math.sin(u),g=d-1,y=g%1/g;for(let v=0;v<=g;++v){const _=v+y*v,x=u+a+f*_,b=Math.cos(x),w=-Math.sin(x);l.push((p*b+m*w)*n+i,(p*-w+m*b)*n+r)}}}class Eb{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}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 el{static curveLength(t,e,i,r,n,a,o,h){let l=0,c=0,d=0,u=0,f=0,p=0,m=0,g=0,y=0,v=0,_=0,x=t,b=e;for(let w=1;w<=10;++w)c=w/10,d=c*c,u=d*c,f=1-c,p=f*f,m=p*f,g=m*t+3*p*c*i+3*f*d*n+u*o,y=m*e+3*p*c*r+3*f*d*a+u*h,v=x-g,_=b-y,x=g,b=y,l+=Math.sqrt(v*v+_*_);return l}static curveTo(t,e,i,r,n,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const c=ur._segmentsCount(el.curveLength(h,l,t,e,i,r,n,a));let d=0,u=0,f=0,p=0,m=0;o.push(h,l);for(let g=1,y=0;g<=c;++g)y=g/c,d=1-y,u=d*d,f=u*d,p=y*y,m=p*y,o.push(f*h+3*u*y*t+3*d*p*i+m*n,f*l+3*u*y*e+3*d*p*r+m*a)}}function sp(s,t,e,i,r,n,a,o){const h=s-e*r,l=t-i*r,c=s+e*n,d=t+i*n;let u,f;a?(u=i,f=-e):(u=-i,f=e);const p=h+u,m=l+f,g=c+u,y=d+f;return o.push(p,m,g,y),2}function Ss(s,t,e,i,r,n,a,o){const h=e-s,l=i-t;let c=Math.atan2(h,l),d=Math.atan2(r-s,n-t);o&&c<d?c+=Math.PI*2:!o&&c>d&&(d+=Math.PI*2);let u=c;const f=d-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,y=f/g;if(u+=y,o){a.push(s,t,e,i);for(let v=1,_=u;v<g;v++,_+=y)a.push(s,t,s+Math.sin(_)*m,t+Math.cos(_)*m);a.push(s,t,r,n)}else{a.push(e,i,s,t);for(let v=1,_=u;v<g;v++,_+=y)a.push(s+Math.sin(_)*m,t+Math.cos(_)*m,s,t);a.push(r,n,s,t)}return g*2}function Ab(s,t){const e=s.shape;let i=s.points||e.points.slice();const r=t.closePointEps;if(i.length===0)return;const n=s.lineStyle,a=new tt(i[0],i[1]),o=new tt(i[i.length-2],i[i.length-1]),h=e.type!==Zt.POLY||e.closeStroke,l=Math.abs(a.x-o.x)<r&&Math.abs(a.y-o.y)<r;if(h){i=i.slice(),l&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const F=(a.x+o.x)*.5,B=(o.y+a.y)*.5;i.unshift(F,B),i.push(F,B)}const c=t.points,d=i.length/2;let u=i.length;const f=c.length/2,p=n.width/2,m=p*p,g=n.miterLimit*n.miterLimit;let y=i[0],v=i[1],_=i[2],x=i[3],b=0,w=0,T=-(v-x),E=y-_,A=0,P=0,L=Math.sqrt(T*T+E*E);T/=L,E/=L,T*=p,E*=p;const M=n.alignment,S=(1-M)*2,C=M*2;h||(n.cap===qi.ROUND?u+=Ss(y-T*(S-C)*.5,v-E*(S-C)*.5,y-T*S,v-E*S,y+T*C,v+E*C,c,!0)+2:n.cap===qi.SQUARE&&(u+=sp(y,v,T,E,S,C,!0,c))),c.push(y-T*S,v-E*S,y+T*C,v+E*C);for(let F=1;F<d-1;++F){y=i[(F-1)*2],v=i[(F-1)*2+1],_=i[F*2],x=i[F*2+1],b=i[(F+1)*2],w=i[(F+1)*2+1],T=-(v-x),E=y-_,L=Math.sqrt(T*T+E*E),T/=L,E/=L,T*=p,E*=p,A=-(x-w),P=_-b,L=Math.sqrt(A*A+P*P),A/=L,P/=L,A*=p,P*=p;const B=_-y,W=v-x,I=_-b,D=w-x,z=B*I+W*D,$=W*I-D*B,U=$<0;if(Math.abs($)<.001*Math.abs(z)){c.push(_-T*S,x-E*S,_+T*C,x+E*C),z>=0&&(n.join===Re.ROUND?u+=Ss(_,x,_-T*S,x-E*S,_-A*S,x-P*S,c,!1)+4:u+=2,c.push(_-A*C,x-P*C,_+A*S,x+P*S));continue}const rt=(-T+y)*(-E+x)-(-T+_)*(-E+v),dt=(-A+b)*(-P+x)-(-A+_)*(-P+w),lt=(B*dt-I*rt)/$,xt=(D*rt-W*dt)/$,Dt=(lt-_)*(lt-_)+(xt-x)*(xt-x),Lt=_+(lt-_)*S,mt=x+(xt-x)*S,Bt=_-(lt-_)*C,Tt=x-(xt-x)*C,me=Math.min(B*B+W*W,I*I+D*D),Ae=U?S:C,ls=me+Ae*Ae*m,Rr=Dt<=ls;let cs=n.join;if(cs===Re.MITER&&Dt/m>g&&(cs=Re.BEVEL),Rr)switch(cs){case Re.MITER:{c.push(Lt,mt,Bt,Tt);break}case Re.BEVEL:{U?c.push(Lt,mt,_+T*C,x+E*C,Lt,mt,_+A*C,x+P*C):c.push(_-T*S,x-E*S,Bt,Tt,_-A*S,x-P*S,Bt,Tt),u+=2;break}case Re.ROUND:{U?(c.push(Lt,mt,_+T*C,x+E*C),u+=Ss(_,x,_+T*C,x+E*C,_+A*C,x+P*C,c,!0)+4,c.push(Lt,mt,_+A*C,x+P*C)):(c.push(_-T*S,x-E*S,Bt,Tt),u+=Ss(_,x,_-T*S,x-E*S,_-A*S,x-P*S,c,!1)+4,c.push(_-A*S,x-P*S,Bt,Tt));break}}else{switch(c.push(_-T*S,x-E*S,_+T*C,x+E*C),cs){case Re.MITER:{U?c.push(Bt,Tt,Bt,Tt):c.push(Lt,mt,Lt,mt),u+=2;break}case Re.ROUND:{U?u+=Ss(_,x,_+T*C,x+E*C,_+A*C,x+P*C,c,!0)+2:u+=Ss(_,x,_-T*S,x-E*S,_-A*S,x-P*S,c,!1)+2;break}}c.push(_-A*S,x-P*S,_+A*C,x+P*C),u+=2}}y=i[(d-2)*2],v=i[(d-2)*2+1],_=i[(d-1)*2],x=i[(d-1)*2+1],T=-(v-x),E=y-_,L=Math.sqrt(T*T+E*E),T/=L,E/=L,T*=p,E*=p,c.push(_-T*S,x-E*S,_+T*C,x+E*C),h||(n.cap===qi.ROUND?u+=Ss(_-T*(S-C)*.5,x-E*(S-C)*.5,_-T*S,x-E*S,_+T*C,x+E*C,c,!1)+2:n.cap===qi.SQUARE&&(u+=sp(_,x,T,E,S,C,!1,c)));const R=t.indices,N=ur.epsilon*ur.epsilon;for(let F=f;F<u+f-2;++F)y=c[F*2],v=c[F*2+1],_=c[(F+1)*2],x=c[(F+1)*2+1],b=c[(F+2)*2],w=c[(F+2)*2+1],!(Math.abs(y*(x-w)+_*(w-v)+b*(v-x))<N)&&R.push(F,F+1,F+2)}function Sb(s,t){let e=0;const i=s.shape,r=s.points||i.points,n=i.type!==Zt.POLY||i.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 rp(s,t){s.lineStyle.native?Sb(s,t):Ab(s,t)}class il{static curveLength(t,e,i,r,n,a){const o=t-2*i+n,h=e-2*r+a,l=2*i-2*t,c=2*r-2*e,d=4*(o*o+h*h),u=4*(o*l+h*c),f=l*l+c*c,p=2*Math.sqrt(d+u+f),m=Math.sqrt(d),g=2*d*m,y=2*Math.sqrt(f),v=u/m;return(g*p+m*u*(p-y)+(4*f*d-u*u)*Math.log((2*m+v+p)/(v+y)))/(4*g)}static curveTo(t,e,i,r,n){const a=n[n.length-2],o=n[n.length-1],h=ur._segmentsCount(il.curveLength(a,o,t,e,i,r));let l=0,c=0;for(let d=1;d<=h;++d){const u=d/h;l=a+(t-a)*u,c=o+(e-o)*u,n.push(l+(t+(i-t)*u-l)*u,c+(e+(r-e)*u-c)*u)}}}const sl={[Zt.POLY]:ep,[Zt.CIRC]:Ma,[Zt.ELIP]:Ma,[Zt.RECT]:Tb,[Zt.RREC]:wb},np=[],Da=[];class Ba{constructor(t,e=null,i=null,r=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type}clone(){return new Ba(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 dr=new tt,ap=class ug extends kd{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 ba,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(),Da.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),np.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,i=null,r=null){const n=new Ba(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new Ba(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),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 i=0;i<e.length;++i){const r=e[i];if(r.fillStyle.visible&&r.shape&&(r.matrix?r.matrix.applyInverse(t,dr):dr.copyFrom(t),r.shape.contains(dr.x,dr.y))){let n=!1;if(r.holes){for(let a=0;a<r.holes.length;a++)if(r.holes[a].shape.contains(dr.x,dr.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 i=null,r=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],r=i.style);for(let h=this.shapeIndex;h<e.length;h++){this.shapeIndex++;const l=e[h],c=l.fillStyle,d=l.lineStyle;sl[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(c.visible||d.visible)&&this.processHoles(l.holes);for(let u=0;u<2;u++){const f=u===0?c:d;if(!f.visible)continue;const p=f.texture.baseTexture,m=this.indices.length,g=this.points.length/2;p.wrapMode=Ni.REPEAT,u===0?this.processFill(l):this.processLine(l);const y=this.points.length/2-g;y!==0&&(i&&!this._compareStyles(r,f)&&(i.end(m,g),i=null),i||(i=np.pop()||new Eb,i.begin(f,m,g),this.batches.push(i),r=f),this.addUvs(this.points,t,f.texture,g,y,f.matrix))}}const n=this.indices.length,a=this.points.length/2;if(i&&i.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 i=this.graphicsData[t],r=i.fillStyle,n=i.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,i=t.length;e<i;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<ug.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++J._globalBatch;for(let d=0;d<this.drawCalls.length;d++)this.drawCalls[d].texArray.clear(),Da.push(this.drawCalls[d]);this.drawCalls.length=0;const e=this.colors,i=this.textureIds;let r=Da.pop();r||(r=new Ch,r.texArray=new Bh),r.texArray.count=0,r.start=0,r.size=0,r.type=Ne.TRIANGLES;let n=0,a=null,o=0,h=!1,l=Ne.TRIANGLES,c=0;this.drawCalls.push(r);for(let d=0;d<this.batches.length;d++){const u=this.batches[d],f=8,p=u.style,m=p.texture.baseTexture;h!==!!p.native&&(h=!!p.native,l=h?Ne.LINES:Ne.TRIANGLES,a=null,n=f,t++),a!==m&&(a=m,m._batchEnabled!==t&&(n===f&&(t++,n=0,r.size>0&&(r=Da.pop(),r||(r=new Ch,r.texArray=new Bh),this.drawCalls.push(r)),r.start=c,r.size=0,r.texArray.count=0,r.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=Ni.REPEAT,r.texArray.elements[r.texArray.count++]=m,n++)),r.size+=u.size,c+=u.size,o=m._batchLocation,this.addColors(e,p.color,p.alpha,u.attribSize,u.attribStart),this.addTextureIds(i,o,u.attribSize,u.attribStart)}J._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=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++]=i[l],a[h++]=r[l];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?ep.triangulate(t,this):sl[t.type].triangulate(t,this)}processLine(t){rp(t,this);for(let e=0;e<t.holes.length;e++)rp(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const i=t[e];sl[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.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 i=0;i<t.length/2;i++){const r=t[i*2],n=t[i*2+1];t[i*2]=e.a*r+e.c*n+e.tx,t[i*2+1]=e.b*r+e.d*n+e.ty}}addColors(t,e,i,r,n=0){const a=ft.shared.setValue(e).toLittleEndianNumber(),o=ft.shared.setValue(a).toPremultiplied(i);t.length=Math.max(t.length,n+r);for(let h=0;h<r;h++)t[n+h]=o}addTextureIds(t,e,i,r=0){t.length=Math.max(t.length,r+i);for(let n=0;n<i;n++)t[r+n]=e}addUvs(t,e,i,r,n,a=null){let o=0;const h=e.length,l=i.frame;for(;o<n;){let d=t[(r+o)*2],u=t[(r+o)*2+1];if(a){const f=a.a*d+a.c*u+a.tx;u=a.b*d+a.d*u+a.ty,d=f}o++,e.push(d/l.width,u/l.height)}const c=i.baseTexture;(l.width<c.width||l.height<c.height)&&this.adjustUvs(e,i,h,n)}adjustUvs(t,e,i,r){const n=e.baseTexture,a=1e-6,o=i+r*2,h=e.frame,l=h.width/n.width,c=h.height/n.height;let d=h.x/h.width,u=h.y/h.height,f=Math.floor(t[i]+a),p=Math.floor(t[i+1]+a);for(let m=i+2;m<o;m+=2)f=Math.min(f,Math.floor(t[m]+a)),p=Math.min(p,Math.floor(t[m+1]+a));d-=f,u-=p;for(let m=i;m<o;m+=2)t[m]=(t[m]+d)*l,t[m+1]=(t[m+1]+u)*c}};ap.BATCHABLE_SIZE=100;let Cb=ap;class Oa{constructor(){this.color=16777215,this.alpha=1,this.texture=X.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new Oa;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=X.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class rl extends Oa{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=qi.BUTT,this.join=Re.MITER,this.miterLimit=10}clone(){const t=new rl;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=qi.BUTT,this.join=Re.MITER,this.miterLimit=10}}const nl={},al=class yo extends vt{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 Oa,this._lineStyle=new rl,this._matrix=null,this._holeMode=!1,this.state=ri.for2d(),this._geometry=t||new Cb,this._geometry.refCount++,this._transformID=-1,this._tintColor=new ft(16777215),this.blendMode=K.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new yo(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,i,r=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:i,alignment:r,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:X.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:qi.BUTT,join:Re.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},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 Xi,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Xi,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 i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return(r!==t||n!==e)&&i.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,i,r){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),il.curveTo(t,e,i,r,n),this}bezierCurveTo(t,e,i,r,n,a){return this._initCurve(),el.curveTo(t,e,i,r,n,a,this.currentPath.points),this}arcTo(t,e,i,r,n){this._initCurve(t,e);const a=this.currentPath.points,o=ip.curveTo(t,e,i,r,n,a);if(o){const{cx:h,cy:l,radius:c,startAngle:d,endAngle:u,anticlockwise:f}=o;this.arc(h,l,c,d,u,f)}return this}arc(t,e,i,r,n,a=!1){if(r===n)return this;if(!a&&n<=r?n+=ia:a&&r<=n&&(r+=ia),n-r===0)return this;const o=t+Math.cos(r)*i,h=e+Math.sin(r)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const d=Math.abs(c[c.length-2]-o),u=Math.abs(c[c.length-1]-h);d<l&&u<l||c.push(o,h)}else this.moveTo(o,h),c=this.currentPath.points;return ip.arc(o,h,t,e,i,r,n,a,c),this}beginFill(t=0,e){return this.beginTextureFill({texture:X.WHITE,color:t,alpha:e})}normalizeColor(t){const e=ft.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:X.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,r){return this.drawShape(new st(t,e,i,r))}drawRoundedRect(t,e,i,r,n){return this.drawShape(new aa(t,e,i,r,n))}drawCircle(t,e,i){return this.drawShape(new ra(t,e,i))}drawEllipse(t,e,i,r){return this.drawShape(new na(t,e,i,r))}drawPolygon(...t){let e,i=!0;const r=t[0];r.points?(i=r.closeStroke,e=r.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new Xi(e);return n.closeStroke=i,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===Zt.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,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let r=0;r<i;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:ft.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,i=this.batches.length;e<i;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),i=this._geometry,r=this.worldAlpha,n=e.uniforms,a=i.drawCalls;n.translationMatrix=this.transform.worldTransform,ft.shared.setValue(this._tintColor).premultiply(r).toArray(n.tint),t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(let o=0,h=a.length;o<h;o++)this._renderDrawCallDirect(t,i.drawCalls[o])}_renderDrawCallDirect(t,e){const{texArray:i,type:r,size:n,start:a}=e,o=i.count;for(let h=0;h<o;h++)t.texture.bind(i.elements[h],h);t.geometry.draw(r,n,a)}_resolveDirectShader(t){let e=this.shader;const i=this.pluginName;if(!e){if(!nl[i]){const{maxTextures:r}=t.plugins[i],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 gt,default:He.from({uSamplers:n},!0)},o=t.plugins[i]._shader.program;nl[i]=new ai(o,a)}e=nl[i]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:i,maxX:r,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,i,r,n)}containsPoint(t){return this.worldTransform.applyInverse(t,yo._TEMP_POINT),this._geometry.containsPoint(yo._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=ft.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,i=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 d=0;for(let u=0;u<l.length;u+=2){const f=l[u],p=l[u+1];c[d++]=i*f+n*p+o,c[d++]=a*p+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)}};al.curves=ur,al._TEMP_POINT=new tt;let hi=al;class Pb{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 ol=new tt,op=new Xi,hp=class dg extends vt{constructor(t,e,i,r=Ne.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=i||ri.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=H.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===Ne.TRIANGLES&&e.length<dg.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,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.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,i=t._updateID;if(i===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,d=this.vertexData;for(let u=0;u<d.length/2;u++){const f=e[u*2],p=e[u*2+1];d[u*2]=n*f+o*p+l,d[u*2+1]=a*f+h*p+c}if(this._roundPixels){const u=H.RESOLUTION;for(let f=0;f<d.length;++f)d[f]=Math.round(d[f]*u)/u}this.vertexDirty=i}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new Pb(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,ol);const e=this.geometry.getBuffer("aVertexPosition").data,i=op.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(i[0]=e[h],i[1]=e[h+1],i[2]=e[l],i[3]=e[l+1],i[4]=e[c],i[5]=e[c+1],op.contains(ol.x,ol.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}};hp.BATCHABLE_SIZE=100;let Fa=hp;class hl extends Wi{constructor(t,e,i){super();const r=new kt(t),n=new kt(e,!0),a=new kt(i,!0,!0);this.addAttribute("aVertexPosition",r,2,!1,Z.FLOAT).addAttribute("aTextureCoord",n,2,!1,Z.FLOAT).addIndex(a),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var Rb=`varying vec2 vTextureCoord;
|
|
910
|
+
`;let cr=null;class Zf{constructor(){cr||(cr=URL.createObjectURL(new Blob([F1],{type:"application/javascript"}))),this.worker=new Worker(cr)}}Zf.revokeObjectURL=function(){cr&&(URL.revokeObjectURL(cr),cr=null)};let Qf=0,il;class L1{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 el;e.addEventListener("message",i=>{e.terminate(),el.revokeObjectURL(),t(i.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){il===void 0&&(il=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<il&&(this._createdWorkers++,t=new Zf().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 i=new Promise((r,n)=>{this.queue.push({id:t,arguments:e,resolve:r,reject:n})});return this.next(),i}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),i=e.id;this.resolveHash[Qf]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Qf++,id:i})}}const Jf=new L1;function on(s,t,e){s.resource.internal=!0;const i=new X(s),r=()=>{delete t.promiseCache[e],As.has(e)&&As.remove(e)};return i.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())}),i.once("destroyed",()=>{s.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),r())}),i}const k1=[".jpeg",".jpg",".png",".webp",".avif"],N1=["image/jpeg","image/png","image/webp","image/avif"];async function U1(s){const t=await H.ADAPTER.fetch(s);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${s}: ${t.status} ${t.statusText}`);const e=await t.blob();return await createImageBitmap(e)}const Ca={name:"loadTextures",extension:{type:G.LoadParser,priority:Re.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(s){return hr(s,N1)||ji(s,k1)},async load(s,t,e){var o;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let r;i?this.config.preferWorkers&&await Jf.isImageBitmapSupported()?r=await Jf.loadImageBitmap(s):r=await U1(s):r=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=s,c.complete?h(c):(c.onload=()=>h(c),c.onerror=d=>l(d))});const n={...t.data};n.resolution??(n.resolution=Pi(s)),i&&((o=n.resourceOptions)==null?void 0:o.ownsImageBitmap)===void 0&&(n.resourceOptions={...n.resourceOptions},n.resourceOptions.ownsImageBitmap=!0);const a=new J(r,n);return a.resource.src=s,on(a,e,s)},unload(s){s.destroy(!0)}};z.add(Ca);const G1=".svg",H1="image/svg+xml",V1={extension:{type:G.LoadParser,priority:Re.High},name:"loadSVG",test(s){return hr(s,H1)||ji(s,G1)},async testParse(s){return jh.test(s)},async parse(s,t,e){var n;const i=new jh(s,(n=t==null?void 0:t.data)==null?void 0:n.resourceOptions);await i.load();const r=new J(i,{resolution:Pi(s),...t==null?void 0:t.data});return r.resource.src=t.src,on(r,e,t.src)},async load(s,t){return(await H.ADAPTER.fetch(s)).text()},unload:Ca.unload};z.add(V1);const W1=[".mp4",".m4v",".webm",".ogv"],X1=["video/mp4","video/webm","video/ogg"],$1={name:"loadVideo",extension:{type:G.LoadParser,priority:Re.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(s){return hr(s,X1)||ji(s,W1)},async load(s,t,e){var a;let i;const r=await(await H.ADAPTER.fetch(s)).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 Nf(n,o);await h.load();const l=new J(h,{alphaMode:await Jy(),resolution:Pi(s),...t==null?void 0:t.data});l.resource.src=s,i=on(l,e,s),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(n)})}catch(o){throw URL.revokeObjectURL(n),o}return i},unload(s){s.destroy(!0)}};z.add($1);class z1{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(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,name:i,src:r,srcs:n}=t;return Xe(e||i||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 i=[];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);i.push(h),o=[a,h]}else{const h=a.map(l=>this._createBundleAssetId(t,l));i.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]})}i.push(...n)}),this._bundles[t]=i}add(t,e,i,r,n){const a=[];typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"?(it("7.2.0",`Assets.add now uses an object instead of individual parameters.
|
|
911
|
+
Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),a.push({alias:t,src:e,data:i,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`)},Xe(a).forEach(h=>{const{src:l,srcs:c}=h;let{data:d,format:u,loadParser:f}=h;const p=Xe(l||c).map(y=>typeof y=="string"?g1(y):Array.isArray(y)?y:[y]),m=this.getAlias(h);Array.isArray(m)?m.forEach(o):o(m);const _=[];p.forEach(y=>{y.forEach(v=>{let g={};if(typeof v!="object"){g.src=v;for(let x=0;x<this._parsers.length;x++){const b=this._parsers[x];if(b.test(v)){g=b.parse(v);break}}}else d=v.data??d,u=v.format??u,f=v.loadParser??f,g={...g,...v};if(!m)throw new Error(`[Resolver] alias is undefined for this asset: ${g.src}`);g=this.buildResolvedAsset(g,{aliases:m,data:d,format:u,loadParser:f}),_.push(g)})}),m.forEach(y=>{this._assetMap[y]=_})})}resolveBundle(t){const e=Sa(t);t=Xe(t);const i={};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}i[r]=o}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const r in e)i[r]=e[r].src;return i}return e.src}resolve(t){const e=Sa(t);t=Xe(t);const i={};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(d=>d[h]?d[h]===l:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]??a}else this._resolverHash[r]=this.buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const i=t[0],r=this._preferredOrder.find(n=>n.params.format.includes(i.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:i,data:r,loadParser:n,format:a}=e;return(this._basePath||this._rootPath)&&(t.src=Ft.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??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??Ft.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}class Y1{constructor(){this._detections=[],this._initialized=!1,this.resolver=new z1,this.loader=new x1,this.cache=As,this._backgroundLoader=new _1(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,i=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:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,r,n){this.resolver.add(t,e,i,r,n)}async load(t,e){this._initialized||await this.init();const i=Sa(t),r=Xe(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 i?a[r[0]]:a}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);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(d=>{const u=r[d];return h+=Object.keys(u).length,this._mapLoadToResolve(u,l).then(f=>{n[d]=f})});return await Promise.all(c),i?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(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return As.get(t);const e={};for(let i=0;i<t.length;i++)e[i]=As.get(t[i]);return e}async _mapLoadToResolve(t,e){const i=Object.values(t),r=Object.keys(t);this._backgroundLoader.active=!1;const n=await this.loader.load(i,e);this._backgroundLoader.active=!0;const a={};return i.forEach((o,h)=>{const l=n[o.src],c=[o.src];o.alias&&c.push(...o.alias),a[r[h]]=l,As.set(c,l)}),a}async unload(t){this._initialized||await this.init();const e=Xe(t).map(r=>typeof r!="string"?r.src:r),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=Xe(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map(r=>this._unloadFromResolved(e[r]));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(i=>{As.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,r)=>e.indexOf(i)===r),e}get detections(){return this._detections}get preferWorkers(){return Ca.config.preferWorkers}set preferWorkers(t){it("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(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}}const qi=new Y1;z.handleByList(G.LoadParser,qi.loader.parsers).handleByList(G.ResolveParser,qi.resolver.parsers).handleByList(G.CacheParser,qi.cache.parsers).handleByList(G.DetectionParser,qi.detections);const j1={extension:G.CacheParser,test:s=>Array.isArray(s)&&s.every(t=>t instanceof X),getCacheableAssets:(s,t)=>{const e={};return s.forEach(i=>{t.forEach((r,n)=>{e[i+(n===0?"":n+1)]=r})}),e}};z.add(j1);async function tp(s){if("Image"in globalThis)return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=s});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const t=await(await fetch(s)).blob();await createImageBitmap(t)}catch{return!1}return!0}return!1}const q1={extension:{type:G.DetectionParser,priority:1},test:async()=>tp("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async s=>[...s,"avif"],remove:async s=>s.filter(t=>t!=="avif")};z.add(q1);const K1={extension:{type:G.DetectionParser,priority:0},test:async()=>tp("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async s=>[...s,"webp"],remove:async s=>s.filter(t=>t!=="webp")};z.add(K1);const ep=["png","jpg","jpeg"],Z1={extension:{type:G.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async s=>[...s,...ep],remove:async s=>s.filter(t=>!ep.includes(t))};z.add(Z1);const Q1="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function sl(s){return Q1?!1:document.createElement("video").canPlayType(s)!==""}const J1={extension:{type:G.DetectionParser,priority:0},test:async()=>sl("video/webm"),add:async s=>[...s,"webm"],remove:async s=>s.filter(t=>t!=="webm")};z.add(J1);const tb={extension:{type:G.DetectionParser,priority:0},test:async()=>sl("video/mp4"),add:async s=>[...s,"mp4","m4v"],remove:async s=>s.filter(t=>t!=="mp4"&&t!=="m4v")};z.add(tb);const eb={extension:{type:G.DetectionParser,priority:0},test:async()=>sl("video/ogg"),add:async s=>[...s,"ogv"],remove:async s=>s.filter(t=>t!=="ogv")};z.add(eb);const ib={extension:G.ResolveParser,test:Ca.test,parse:s=>{var t;return{resolution:parseFloat(((t=H.RETINA_PREFIX.exec(s))==null?void 0:t[1])??"1"),format:Ft.extname(s).slice(1),src:s}}};z.add(ib);var Qt=(s=>(s[s.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",s[s.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",s[s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",s[s.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",s[s.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",s[s.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",s[s.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",s[s.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",s[s.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",s[s.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",s[s.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",s[s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",s[s.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",s[s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",s[s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",s[s.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",s[s.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",s[s.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",s[s.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",s[s.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",s[s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",s[s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",s[s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",s))(Qt||{});const Pa={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 hi,ur;function ip(){ur={bptc:hi.getExtension("EXT_texture_compression_bptc"),astc:hi.getExtension("WEBGL_compressed_texture_astc"),etc:hi.getExtension("WEBGL_compressed_texture_etc"),s3tc:hi.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:hi.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:hi.getExtension("WEBGL_compressed_texture_pvrtc")||hi.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:hi.getExtension("WEBGL_compressed_texture_etc1"),atc:hi.getExtension("WEBGL_compressed_texture_atc")}}const sb={extension:{type:G.DetectionParser,priority:2},test:async()=>{const s=H.ADAPTER.createCanvas().getContext("webgl");return s?(hi=s,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async s=>{ur||ip();const t=[];for(const e in ur)ur[e]&&t.push(e);return[...t,...s]},remove:async s=>(ur||ip(),s.filter(t=>!(t in ur)))};z.add(sb);class rb extends ia{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,r;typeof t=="string"?(i=t,r=new Uint8Array):(i=null,r=t),super(r,e),this.origin=i,this.buffer=r?new wh(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 wh(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class Ss extends rb{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=Ss._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||Ss._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){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=Ss._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,i,r,n,a,o){const h=new Array(i);let l=t.byteOffset,c=a,d=o,u=c+r-1&~(r-1),f=d+n-1&~(n-1),p=u*f*Pa[e];for(let m=0;m<i;m++)h[m]={levelID:m,levelWidth:i>1?c:u,levelHeight:i>1?d:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,d=d>>1||1,u=c+r-1&~(r-1),f=d+n-1&~(n-1),p=u*f*Pa[e];return h}}const rl=4,Ra=124,nb=32,sp=20,ab=542327876,Ia={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},ob={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},Ma={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},hb=1,lb=2,cb=4,ub=64,db=512,fb=131072,pb=827611204,mb=861165636,_b=894720068,gb=808540228,yb=4,xb={[pb]:Qt.COMPRESSED_RGBA_S3TC_DXT1_EXT,[mb]:Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT,[_b]:Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT},vb={70:Qt.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Qt.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Qt.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Qt.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Qt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Qt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Qt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:Qt.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:Qt.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:Qt.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:Qt.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function bb(s){const t=new Uint32Array(s);if(t[0]!==ab)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(s,0,Ra/Uint32Array.BYTES_PER_ELEMENT),i=e[Ia.HEIGHT],r=e[Ia.WIDTH],n=e[Ia.MIPMAP_COUNT],a=new Uint32Array(s,Ia.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,nb/Uint32Array.BYTES_PER_ELEMENT),o=a[hb];if(o&cb){const h=a[ob.FOURCC];if(h!==gb){const v=xb[h],g=rl+Ra,x=new Uint8Array(s,g);return[new Ss(x,{format:v,width:r,height:i,levels:n})]}const l=rl+Ra,c=new Uint32Array(t.buffer,l,sp/Uint32Array.BYTES_PER_ELEMENT),d=c[Ma.DXGI_FORMAT],u=c[Ma.RESOURCE_DIMENSION],f=c[Ma.MISC_FLAG],p=c[Ma.ARRAY_SIZE],m=vb[d];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${d}`);if(f===yb)throw new Error("DDSParser does not support cubemap textures");if(u===6)throw new Error("DDSParser does not supported 3D texture data");const _=new Array,y=rl+Ra+sp;if(p===1)_.push(new Uint8Array(s,y));else{const v=Pa[m];let g=0,x=r,b=i;for(let T=0;T<n;T++){const E=Math.max(1,x+3&-4),A=Math.max(1,b+3&-4),P=E*A*v;g+=P,x=x>>>1,b=b>>>1}let w=y;for(let T=0;T<p;T++)_.push(new Uint8Array(s,w,g)),w+=g}return _.map(v=>new Ss(v,{format:m,width:r,height:i,levels:n}))}throw o&ub?new Error("DDSParser does not support uncompressed texture data."):o&db?new Error("DDSParser does not supported YUV uncompressed texture data."):o&fb?new Error("DDSParser does not support single-channel (lumninance) texture data!"):o&lb?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 rp=[171,75,84,88,32,49,49,187,13,10,26,10],Tb=67305985,$e={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,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},nl=64,np={[Z.UNSIGNED_BYTE]:1,[Z.UNSIGNED_SHORT]:2,[Z.INT]:4,[Z.UNSIGNED_INT]:4,[Z.FLOAT]:4,[Z.HALF_FLOAT]:8},wb={[O.RGBA]:4,[O.RGB]:3,[O.RG]:2,[O.RED]:1,[O.LUMINANCE]:1,[O.LUMINANCE_ALPHA]:2,[O.ALPHA]:1},Eb={[Z.UNSIGNED_SHORT_4_4_4_4]:2,[Z.UNSIGNED_SHORT_5_5_5_1]:2,[Z.UNSIGNED_SHORT_5_6_5]:2};function Ab(s,t,e=!1){const i=new DataView(t);if(!Sb(s,i))return null;const r=i.getUint32($e.ENDIANNESS,!0)===Tb,n=i.getUint32($e.GL_TYPE,r),a=i.getUint32($e.GL_FORMAT,r),o=i.getUint32($e.GL_INTERNAL_FORMAT,r),h=i.getUint32($e.PIXEL_WIDTH,r),l=i.getUint32($e.PIXEL_HEIGHT,r)||1,c=i.getUint32($e.PIXEL_DEPTH,r)||1,d=i.getUint32($e.NUMBER_OF_ARRAY_ELEMENTS,r)||1,u=i.getUint32($e.NUMBER_OF_FACES,r),f=i.getUint32($e.NUMBER_OF_MIPMAP_LEVELS,r),p=i.getUint32($e.BYTES_OF_KEY_VALUE_DATA,r);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(u!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(d!==1)throw new Error("WebGL does not support array textures");const m=4,_=4,y=h+3&-4,v=l+3&-4,g=new Array(d);let x=h*l;n===0&&(x=y*v);let b;if(n!==0?np[n]?b=np[n]*wb[a]:b=Eb[n]:b=Pa[o],b===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const w=e?Pb(i,p,r):null;let T=x*b,E=h,A=l,P=y,L=v,M=nl+p;for(let S=0;S<f;S++){const C=i.getUint32(M,r);let R=M+4;for(let N=0;N<d;N++){let F=g[N];F||(F=g[N]=new Array(f)),F[S]={levelID:S,levelWidth:f>1||n!==0?E:P,levelHeight:f>1||n!==0?A:L,levelBuffer:new Uint8Array(t,R,T)},R+=T}M+=C+4,M=M%4!==0?M+4-M%4:M,E=E>>1||1,A=A>>1||1,P=E+m-1&~(m-1),L=A+_-1&~(_-1),T=P*L*b}return n!==0?{uncompressed:g.map(S=>{let C=S[0].levelBuffer,R=!1;return n===Z.FLOAT?C=new Float32Array(S[0].levelBuffer.buffer,S[0].levelBuffer.byteOffset,S[0].levelBuffer.byteLength/4):n===Z.UNSIGNED_INT?(R=!0,C=new Uint32Array(S[0].levelBuffer.buffer,S[0].levelBuffer.byteOffset,S[0].levelBuffer.byteLength/4)):n===Z.INT&&(R=!0,C=new Int32Array(S[0].levelBuffer.buffer,S[0].levelBuffer.byteOffset,S[0].levelBuffer.byteLength/4)),{resource:new ia(C,{width:S[0].levelWidth,height:S[0].levelHeight}),type:n,format:R?Cb(a):a}}),kvData:w}:{compressed:g.map(S=>new Ss(null,{format:o,width:h,height:l,levels:f,levelBuffers:S})),kvData:w}}function Sb(s,t){for(let e=0;e<rp.length;e++)if(t.getUint8(e)!==rp[e])return console.error(`${s} is not a valid *.ktx file!`),!1;return!0}function Cb(s){switch(s){case O.RGBA:return O.RGBA_INTEGER;case O.RGB:return O.RGB_INTEGER;case O.RG:return O.RG_INTEGER;case O.RED:return O.RED_INTEGER;default:return s}}function Pb(s,t,e){const i=new Map;let r=0;for(;r<t;){const n=s.getUint32(nl+r,e),a=nl+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&&s.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(s.buffer,a,h)),c=new DataView(s.buffer,a+h+1,n-h-1);i.set(l,c),r+=4+n+o}return i}const Rb={extension:{type:G.LoadParser,priority:Re.High},name:"loadDDS",test(s){return ji(s,".dds")},async load(s,t,e){const i=await(await H.ADAPTER.fetch(s)).arrayBuffer(),r=bb(i).map(n=>{const a=new J(n,{mipmap:Ke.OFF,alphaMode:he.NO_PREMULTIPLIED_ALPHA,resolution:Pi(s),...t.data});return on(a,e,s)});return r.length===1?r[0]:r},unload(s){Array.isArray(s)?s.forEach(t=>t.destroy(!0)):s.destroy(!0)}};z.add(Rb);const Ib={extension:{type:G.LoadParser,priority:Re.High},name:"loadKTX",test(s){return ji(s,".ktx")},async load(s,t,e){const i=await(await H.ADAPTER.fetch(s)).arrayBuffer(),{compressed:r,uncompressed:n,kvData:a}=Ab(s,i),o=r??n,h={mipmap:Ke.OFF,alphaMode:he.NO_PREMULTIPLIED_ALPHA,resolution:Pi(s),...t.data},l=o.map(c=>{o===n&&Object.assign(h,{type:c.type,format:c.format});const d=c.resource??c,u=new J(d,h);return u.ktxKeyValueData=a,on(u,e,s)});return l.length===1?l[0]:l},unload(s){Array.isArray(s)?s.forEach(t=>t.destroy(!0)):s.destroy(!0)}};z.add(Ib);const Mb=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],Db={extension:G.ResolveParser,test:s=>{const t=Ft.extname(s).slice(1);return["basis","ktx","dds"].includes(t)},parse:s=>{var i,r;const t=s.split("."),e=t.pop();if(["ktx","dds"].includes(e)){const n=t.pop();if(Mb.includes(n))return{resolution:parseFloat(((i=H.RETINA_PREFIX.exec(s))==null?void 0:i[1])??"1"),format:n,src:s}}return{resolution:parseFloat(((r=H.RETINA_PREFIX.exec(s))==null?void 0:r[1])??"1"),format:e,src:s}}};z.add(Db);const Da=new st,Bb=4,ap=class Dn{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,i,r){const n=new Image;return n.src=await this.base64(t,e,i,r),n}async base64(t,e,i,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,i)});if(n.toDataURL!==void 0)return n.toDataURL(e,i);if(n.convertToBlob!==void 0){const a=await n.convertToBlob({type:e,quality:i});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:i,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);a&&Dn._flipY(i,r,n),o&&Dn._unpremultiplyAlpha(i);const h=new px(r,n,1),l=new ImageData(new Uint8ClampedArray(i.buffer),r,n);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:i,width:r,height:n,flipY:a,premultipliedAlpha:o}=this._rawPixels(t,e);return a&&Dn._flipY(i,r,n),o&&Dn._unpremultiplyAlpha(i),i}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let r,n=!1,a=!1,o,h=!1;t&&(t instanceof Ts?o=t:(o=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(Da.width=e.width,Da.height=e.height,e=Da)));const l=i.gl;if(o){if(r=o.baseTexture.resolution,e=e??o.frame,n=!1,a=o.baseTexture.alphaMode>0&&o.baseTexture.format===O.RGBA,!h){i.renderTexture.bind(o);const f=o.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else r=i.resolution,e||(e=Da,e.width=i.width/r,e.height=i.height/r),n=!0,a=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(e.width*r),1),d=Math.max(Math.round(e.height*r),1),u=new Uint8Array(Bb*c*d);return l.readPixels(Math.round(e.x*r),Math.round(e.y*r),c,d,l.RGBA,l.UNSIGNED_BYTE,u),h&&(o==null||o.destroy(!0)),{pixels:u,width:c,height:d,flipY:n,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,i){const r=e<<2,n=i>>1,a=new Uint8Array(r);for(let o=0;o<n;o++){const h=o*r,l=(i-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 i=0;i<e;i+=4){const r=t[i+3];if(r!==0){const n=255.001/r;t[i]=t[i]*n+.5,t[i+1]=t[i+1]*n+.5,t[i+2]=t[i+2]*n+.5}}}};ap.extension={name:"extract",type:G.RendererSystem};let Ob=ap;z.add(Ob);const Ba={build(s){const t=s.points;let e,i,r,n,a,o;if(s.type===Zt.CIRC){const p=s.shape;e=p.x,i=p.y,a=o=p.radius,r=n=0}else if(s.type===Zt.ELIP){const p=s.shape;e=p.x,i=p.y,a=p.width,o=p.height,r=n=0}else{const p=s.shape,m=p.width/2,_=p.height/2;e=p.x+m,i=p.y+_,a=o=Math.max(0,Math.min(p.radius,Math.min(m,_))),r=m-a,n=_-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]=i+n,t[2]=t[4]=e-r,t[5]=t[7]=i-n;return}let c=0,d=h*4+(r?2:0)+2,u=d,f=l;{const p=r+a,m=n,_=e+p,y=e-p,v=i+m;if(t[c++]=_,t[c++]=v,t[--d]=v,t[--d]=y,n){const g=i-m;t[u++]=y,t[u++]=g,t[--f]=g,t[--f]=_}}for(let p=1;p<h;p++){const m=Math.PI/2*(p/h),_=r+Math.cos(m)*a,y=n+Math.sin(m)*o,v=e+_,g=e-_,x=i+y,b=i-y;t[c++]=v,t[c++]=x,t[--d]=x,t[--d]=g,t[u++]=g,t[u++]=b,t[--f]=b,t[--f]=v}{const p=r,m=n+o,_=e+p,y=e-p,v=i+m,g=i-m;t[c++]=_,t[c++]=v,t[--f]=g,t[--f]=_,r&&(t[c++]=y,t[c++]=v,t[--f]=g,t[--f]=y)}},triangulate(s,t){const e=s.points,i=t.points,r=t.indices;if(e.length===0)return;let n=i.length/2;const a=n;let o,h;if(s.type!==Zt.RREC){const c=s.shape;o=c.x,h=c.y}else{const c=s.shape;o=c.x+c.width/2,h=c.y+c.height/2}const l=s.matrix;i.push(s.matrix?l.a*o+l.c*h+l.tx:o,s.matrix?l.b*o+l.d*h+l.ty:h),n++,i.push(e[0],e[1]);for(let c=2;c<e.length;c+=2)i.push(e[c],e[c+1]),r.push(n++,a,n);r.push(a+1,a,n)}};function op(s,t=!1){const e=s.length;if(e<6)return;let i=0;for(let r=0,n=s[e-2],a=s[e-1];r<e;r+=2){const o=s[r],h=s[r+1];i+=(o-n)*(h+a),n=o,a=h}if(!t&&i>0||t&&i<=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;[s[a],s[h]]=[s[h],s[a]],[s[o],s[l]]=[s[l],s[o]]}}}const hp={build(s){s.points=s.shape.points.slice()},triangulate(s,t){let e=s.points;const i=s.holes,r=t.points,n=t.indices;if(e.length>=6){op(e,!1);const a=[];for(let l=0;l<i.length;l++){const c=i[l];op(c.points,!0),a.push(e.length/2),e=e.concat(c.points)}const o=j_(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])}}},Fb={build(s){const t=s.shape,e=t.x,i=t.y,r=t.width,n=t.height,a=s.points;a.length=0,r>=0&&n>=0&&a.push(e,i,e+r,i,e+r,i+n,e,i+n)},triangulate(s,t){const e=s.points,i=t.points;if(e.length===0)return;const r=i.length/2;i.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)}},Lb={build(s){Ba.build(s)},triangulate(s,t){Ba.triangulate(s,t)}};var Ie=(s=>(s.MITER="miter",s.BEVEL="bevel",s.ROUND="round",s))(Ie||{}),Ki=(s=>(s.BUTT="butt",s.ROUND="round",s.SQUARE="square",s))(Ki||{});const dr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,t=20){if(!this.adaptive||!s||isNaN(s))return t;let e=Math.ceil(s/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class lp{static curveTo(t,e,i,r,n,a){const o=a[a.length-2],h=a[a.length-1]-e,l=o-t,c=r-e,d=i-t,u=Math.abs(h*d-l*c);if(u<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,p=c*c+d*d,m=h*c+l*d,_=n*Math.sqrt(f)/u,y=n*Math.sqrt(p)/u,v=_*m/f,g=y*m/p,x=_*d+y*l,b=_*c+y*h,w=l*(y+v),T=h*(y+v),E=d*(_+g),A=c*(_+g),P=Math.atan2(T-b,w-x),L=Math.atan2(A-b,E-x);return{cx:x+t,cy:b+e,radius:n,startAngle:P,endAngle:L,anticlockwise:l*c>d*h}}static arc(t,e,i,r,n,a,o,h,l){const c=o-a,d=dr._segmentsCount(Math.abs(c)*n,Math.ceil(Math.abs(c)/ra)*40),u=c/(d*2),f=u*2,p=Math.cos(u),m=Math.sin(u),_=d-1,y=_%1/_;for(let v=0;v<=_;++v){const g=v+y*v,x=u+a+f*g,b=Math.cos(x),w=-Math.sin(x);l.push((p*b+m*w)*n+i,(p*-w+m*b)*n+r)}}}class kb{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}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 al{static curveLength(t,e,i,r,n,a,o,h){let l=0,c=0,d=0,u=0,f=0,p=0,m=0,_=0,y=0,v=0,g=0,x=t,b=e;for(let w=1;w<=10;++w)c=w/10,d=c*c,u=d*c,f=1-c,p=f*f,m=p*f,_=m*t+3*p*c*i+3*f*d*n+u*o,y=m*e+3*p*c*r+3*f*d*a+u*h,v=x-_,g=b-y,x=_,b=y,l+=Math.sqrt(v*v+g*g);return l}static curveTo(t,e,i,r,n,a,o){const h=o[o.length-2],l=o[o.length-1];o.length-=2;const c=dr._segmentsCount(al.curveLength(h,l,t,e,i,r,n,a));let d=0,u=0,f=0,p=0,m=0;o.push(h,l);for(let _=1,y=0;_<=c;++_)y=_/c,d=1-y,u=d*d,f=u*d,p=y*y,m=p*y,o.push(f*h+3*u*y*t+3*d*p*i+m*n,f*l+3*u*y*e+3*d*p*r+m*a)}}function cp(s,t,e,i,r,n,a,o){const h=s-e*r,l=t-i*r,c=s+e*n,d=t+i*n;let u,f;a?(u=i,f=-e):(u=-i,f=e);const p=h+u,m=l+f,_=c+u,y=d+f;return o.push(p,m,_,y),2}function Cs(s,t,e,i,r,n,a,o){const h=e-s,l=i-t;let c=Math.atan2(h,l),d=Math.atan2(r-s,n-t);o&&c<d?c+=Math.PI*2:!o&&c>d&&(d+=Math.PI*2);let u=c;const f=d-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),_=(15*p*Math.sqrt(m)/Math.PI>>0)+1,y=f/_;if(u+=y,o){a.push(s,t,e,i);for(let v=1,g=u;v<_;v++,g+=y)a.push(s,t,s+Math.sin(g)*m,t+Math.cos(g)*m);a.push(s,t,r,n)}else{a.push(e,i,s,t);for(let v=1,g=u;v<_;v++,g+=y)a.push(s+Math.sin(g)*m,t+Math.cos(g)*m,s,t);a.push(r,n,s,t)}return _*2}function Nb(s,t){const e=s.shape;let i=s.points||e.points.slice();const r=t.closePointEps;if(i.length===0)return;const n=s.lineStyle,a=new tt(i[0],i[1]),o=new tt(i[i.length-2],i[i.length-1]),h=e.type!==Zt.POLY||e.closeStroke,l=Math.abs(a.x-o.x)<r&&Math.abs(a.y-o.y)<r;if(h){i=i.slice(),l&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));const F=(a.x+o.x)*.5,B=(o.y+a.y)*.5;i.unshift(F,B),i.push(F,B)}const c=t.points,d=i.length/2;let u=i.length;const f=c.length/2,p=n.width/2,m=p*p,_=n.miterLimit*n.miterLimit;let y=i[0],v=i[1],g=i[2],x=i[3],b=0,w=0,T=-(v-x),E=y-g,A=0,P=0,L=Math.sqrt(T*T+E*E);T/=L,E/=L,T*=p,E*=p;const M=n.alignment,S=(1-M)*2,C=M*2;h||(n.cap===Ki.ROUND?u+=Cs(y-T*(S-C)*.5,v-E*(S-C)*.5,y-T*S,v-E*S,y+T*C,v+E*C,c,!0)+2:n.cap===Ki.SQUARE&&(u+=cp(y,v,T,E,S,C,!0,c))),c.push(y-T*S,v-E*S,y+T*C,v+E*C);for(let F=1;F<d-1;++F){y=i[(F-1)*2],v=i[(F-1)*2+1],g=i[F*2],x=i[F*2+1],b=i[(F+1)*2],w=i[(F+1)*2+1],T=-(v-x),E=y-g,L=Math.sqrt(T*T+E*E),T/=L,E/=L,T*=p,E*=p,A=-(x-w),P=g-b,L=Math.sqrt(A*A+P*P),A/=L,P/=L,A*=p,P*=p;const B=g-y,W=v-x,I=g-b,D=w-x,$=B*I+W*D,Y=W*I-D*B,U=Y<0;if(Math.abs(Y)<.001*Math.abs($)){c.push(g-T*S,x-E*S,g+T*C,x+E*C),$>=0&&(n.join===Ie.ROUND?u+=Cs(g,x,g-T*S,x-E*S,g-A*S,x-P*S,c,!1)+4:u+=2,c.push(g-A*C,x-P*C,g+A*S,x+P*S));continue}const rt=(-T+y)*(-E+x)-(-T+g)*(-E+v),dt=(-A+b)*(-P+x)-(-A+g)*(-P+w),lt=(B*dt-I*rt)/Y,vt=(D*rt-W*dt)/Y,Dt=(lt-g)*(lt-g)+(vt-x)*(vt-x),kt=g+(lt-g)*S,_t=x+(vt-x)*S,Bt=g-(lt-g)*C,wt=x-(vt-x)*C,me=Math.min(B*B+W*W,I*I+D*D),Ae=U?S:C,cs=me+Ae*Ae*m,Mr=Dt<=cs;let us=n.join;if(us===Ie.MITER&&Dt/m>_&&(us=Ie.BEVEL),Mr)switch(us){case Ie.MITER:{c.push(kt,_t,Bt,wt);break}case Ie.BEVEL:{U?c.push(kt,_t,g+T*C,x+E*C,kt,_t,g+A*C,x+P*C):c.push(g-T*S,x-E*S,Bt,wt,g-A*S,x-P*S,Bt,wt),u+=2;break}case Ie.ROUND:{U?(c.push(kt,_t,g+T*C,x+E*C),u+=Cs(g,x,g+T*C,x+E*C,g+A*C,x+P*C,c,!0)+4,c.push(kt,_t,g+A*C,x+P*C)):(c.push(g-T*S,x-E*S,Bt,wt),u+=Cs(g,x,g-T*S,x-E*S,g-A*S,x-P*S,c,!1)+4,c.push(g-A*S,x-P*S,Bt,wt));break}}else{switch(c.push(g-T*S,x-E*S,g+T*C,x+E*C),us){case Ie.MITER:{U?c.push(Bt,wt,Bt,wt):c.push(kt,_t,kt,_t),u+=2;break}case Ie.ROUND:{U?u+=Cs(g,x,g+T*C,x+E*C,g+A*C,x+P*C,c,!0)+2:u+=Cs(g,x,g-T*S,x-E*S,g-A*S,x-P*S,c,!1)+2;break}}c.push(g-A*S,x-P*S,g+A*C,x+P*C),u+=2}}y=i[(d-2)*2],v=i[(d-2)*2+1],g=i[(d-1)*2],x=i[(d-1)*2+1],T=-(v-x),E=y-g,L=Math.sqrt(T*T+E*E),T/=L,E/=L,T*=p,E*=p,c.push(g-T*S,x-E*S,g+T*C,x+E*C),h||(n.cap===Ki.ROUND?u+=Cs(g-T*(S-C)*.5,x-E*(S-C)*.5,g-T*S,x-E*S,g+T*C,x+E*C,c,!1)+2:n.cap===Ki.SQUARE&&(u+=cp(g,x,T,E,S,C,!1,c)));const R=t.indices,N=dr.epsilon*dr.epsilon;for(let F=f;F<u+f-2;++F)y=c[F*2],v=c[F*2+1],g=c[(F+1)*2],x=c[(F+1)*2+1],b=c[(F+2)*2],w=c[(F+2)*2+1],!(Math.abs(y*(x-w)+g*(w-v)+b*(v-x))<N)&&R.push(F,F+1,F+2)}function Ub(s,t){let e=0;const i=s.shape,r=s.points||i.points,n=i.type!==Zt.POLY||i.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 up(s,t){s.lineStyle.native?Ub(s,t):Nb(s,t)}class ol{static curveLength(t,e,i,r,n,a){const o=t-2*i+n,h=e-2*r+a,l=2*i-2*t,c=2*r-2*e,d=4*(o*o+h*h),u=4*(o*l+h*c),f=l*l+c*c,p=2*Math.sqrt(d+u+f),m=Math.sqrt(d),_=2*d*m,y=2*Math.sqrt(f),v=u/m;return(_*p+m*u*(p-y)+(4*f*d-u*u)*Math.log((2*m+v+p)/(v+y)))/(4*_)}static curveTo(t,e,i,r,n){const a=n[n.length-2],o=n[n.length-1],h=dr._segmentsCount(ol.curveLength(a,o,t,e,i,r));let l=0,c=0;for(let d=1;d<=h;++d){const u=d/h;l=a+(t-a)*u,c=o+(e-o)*u,n.push(l+(t+(i-t)*u-l)*u,c+(e+(r-e)*u-c)*u)}}}const hl={[Zt.POLY]:hp,[Zt.CIRC]:Ba,[Zt.ELIP]:Ba,[Zt.RECT]:Fb,[Zt.RREC]:Lb},dp=[],Oa=[];class Fa{constructor(t,e=null,i=null,r=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type}clone(){return new Fa(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 fr=new tt,fp=class E_ extends Xd{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 wa,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(),Oa.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),dp.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,i=null,r=null){const n=new Fa(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new Fa(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),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 i=0;i<e.length;++i){const r=e[i];if(r.fillStyle.visible&&r.shape&&(r.matrix?r.matrix.applyInverse(t,fr):fr.copyFrom(t),r.shape.contains(fr.x,fr.y))){let n=!1;if(r.holes){for(let a=0;a<r.holes.length;a++)if(r.holes[a].shape.contains(fr.x,fr.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 i=null,r=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],r=i.style);for(let h=this.shapeIndex;h<e.length;h++){this.shapeIndex++;const l=e[h],c=l.fillStyle,d=l.lineStyle;hl[l.type].build(l),l.matrix&&this.transformPoints(l.points,l.matrix),(c.visible||d.visible)&&this.processHoles(l.holes);for(let u=0;u<2;u++){const f=u===0?c:d;if(!f.visible)continue;const p=f.texture.baseTexture,m=this.indices.length,_=this.points.length/2;p.wrapMode=Ui.REPEAT,u===0?this.processFill(l):this.processLine(l);const y=this.points.length/2-_;y!==0&&(i&&!this._compareStyles(r,f)&&(i.end(m,_),i=null),i||(i=dp.pop()||new kb,i.begin(f,m,_),this.batches.push(i),r=f),this.addUvs(this.points,t,f.texture,_,y,f.matrix))}}const n=this.indices.length,a=this.points.length/2;if(i&&i.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 i=this.graphicsData[t],r=i.fillStyle,n=i.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,i=t.length;e<i;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<E_.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++J._globalBatch;for(let d=0;d<this.drawCalls.length;d++)this.drawCalls[d].texArray.clear(),Oa.push(this.drawCalls[d]);this.drawCalls.length=0;const e=this.colors,i=this.textureIds;let r=Oa.pop();r||(r=new Dh,r.texArray=new Nh),r.texArray.count=0,r.start=0,r.size=0,r.type=Ue.TRIANGLES;let n=0,a=null,o=0,h=!1,l=Ue.TRIANGLES,c=0;this.drawCalls.push(r);for(let d=0;d<this.batches.length;d++){const u=this.batches[d],f=8,p=u.style,m=p.texture.baseTexture;h!==!!p.native&&(h=!!p.native,l=h?Ue.LINES:Ue.TRIANGLES,a=null,n=f,t++),a!==m&&(a=m,m._batchEnabled!==t&&(n===f&&(t++,n=0,r.size>0&&(r=Oa.pop(),r||(r=new Dh,r.texArray=new Nh),this.drawCalls.push(r)),r.start=c,r.size=0,r.texArray.count=0,r.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=Ui.REPEAT,r.texArray.elements[r.texArray.count++]=m,n++)),r.size+=u.size,c+=u.size,o=m._batchLocation,this.addColors(e,p.color,p.alpha,u.attribSize,u.attribStart),this.addTextureIds(i,o,u.attribSize,u.attribStart)}J._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=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++]=i[l],a[h++]=r[l];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?hp.triangulate(t,this):hl[t.type].triangulate(t,this)}processLine(t){up(t,this);for(let e=0;e<t.holes.length;e++)up(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const i=t[e];hl[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.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 i=0;i<t.length/2;i++){const r=t[i*2],n=t[i*2+1];t[i*2]=e.a*r+e.c*n+e.tx,t[i*2+1]=e.b*r+e.d*n+e.ty}}addColors(t,e,i,r,n=0){const a=pt.shared.setValue(e).toLittleEndianNumber(),o=pt.shared.setValue(a).toPremultiplied(i);t.length=Math.max(t.length,n+r);for(let h=0;h<r;h++)t[n+h]=o}addTextureIds(t,e,i,r=0){t.length=Math.max(t.length,r+i);for(let n=0;n<i;n++)t[r+n]=e}addUvs(t,e,i,r,n,a=null){let o=0;const h=e.length,l=i.frame;for(;o<n;){let d=t[(r+o)*2],u=t[(r+o)*2+1];if(a){const f=a.a*d+a.c*u+a.tx;u=a.b*d+a.d*u+a.ty,d=f}o++,e.push(d/l.width,u/l.height)}const c=i.baseTexture;(l.width<c.width||l.height<c.height)&&this.adjustUvs(e,i,h,n)}adjustUvs(t,e,i,r){const n=e.baseTexture,a=1e-6,o=i+r*2,h=e.frame,l=h.width/n.width,c=h.height/n.height;let d=h.x/h.width,u=h.y/h.height,f=Math.floor(t[i]+a),p=Math.floor(t[i+1]+a);for(let m=i+2;m<o;m+=2)f=Math.min(f,Math.floor(t[m]+a)),p=Math.min(p,Math.floor(t[m+1]+a));d-=f,u-=p;for(let m=i;m<o;m+=2)t[m]=(t[m]+d)*l,t[m+1]=(t[m+1]+u)*c}};fp.BATCHABLE_SIZE=100;let Gb=fp;class La{constructor(){this.color=16777215,this.alpha=1,this.texture=X.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new La;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=X.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class ll extends La{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Ki.BUTT,this.join=Ie.MITER,this.miterLimit=10}clone(){const t=new ll;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=Ki.BUTT,this.join=Ie.MITER,this.miterLimit=10}}const cl={},ul=class wo extends bt{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 La,this._lineStyle=new ll,this._matrix=null,this._holeMode=!1,this.state=ni.for2d(),this._geometry=t||new Gb,this._geometry.refCount++,this._transformID=-1,this._tintColor=new pt(16777215),this.blendMode=K.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new wo(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,i,r=.5,n=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:i,alignment:r,native:n}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:X.WHITE,color:t!=null&&t.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Ki.BUTT,join:Ie.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},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 $i,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new $i,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 i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return(r!==t||n!==e)&&i.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,i,r){this._initCurve();const n=this.currentPath.points;return n.length===0&&this.moveTo(0,0),ol.curveTo(t,e,i,r,n),this}bezierCurveTo(t,e,i,r,n,a){return this._initCurve(),al.curveTo(t,e,i,r,n,a,this.currentPath.points),this}arcTo(t,e,i,r,n){this._initCurve(t,e);const a=this.currentPath.points,o=lp.curveTo(t,e,i,r,n,a);if(o){const{cx:h,cy:l,radius:c,startAngle:d,endAngle:u,anticlockwise:f}=o;this.arc(h,l,c,d,u,f)}return this}arc(t,e,i,r,n,a=!1){if(r===n)return this;if(!a&&n<=r?n+=ra:a&&r<=n&&(r+=ra),n-r===0)return this;const o=t+Math.cos(r)*i,h=e+Math.sin(r)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const d=Math.abs(c[c.length-2]-o),u=Math.abs(c[c.length-1]-h);d<l&&u<l||c.push(o,h)}else this.moveTo(o,h),c=this.currentPath.points;return lp.arc(o,h,t,e,i,r,n,a,c),this}beginFill(t=0,e){return this.beginTextureFill({texture:X.WHITE,color:t,alpha:e})}normalizeColor(t){const e=pt.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:X.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,r){return this.drawShape(new st(t,e,i,r))}drawRoundedRect(t,e,i,r,n){return this.drawShape(new ha(t,e,i,r,n))}drawCircle(t,e,i){return this.drawShape(new aa(t,e,i))}drawEllipse(t,e,i,r){return this.drawShape(new oa(t,e,i,r))}drawPolygon(...t){let e,i=!0;const r=t[0];r.points?(i=r.closeStroke,e=r.points):Array.isArray(t[0])?e=t[0]:e=t;const n=new $i(e);return n.closeStroke=i,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===Zt.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,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let r=0;r<i;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:pt.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,i=this.batches.length;e<i;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),i=this._geometry,r=this.worldAlpha,n=e.uniforms,a=i.drawCalls;n.translationMatrix=this.transform.worldTransform,pt.shared.setValue(this._tintColor).premultiply(r).toArray(n.tint),t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(let o=0,h=a.length;o<h;o++)this._renderDrawCallDirect(t,i.drawCalls[o])}_renderDrawCallDirect(t,e){const{texArray:i,type:r,size:n,start:a}=e,o=i.count;for(let h=0;h<o;h++)t.texture.bind(i.elements[h],h);t.geometry.draw(r,n,a)}_resolveDirectShader(t){let e=this.shader;const i=this.pluginName;if(!e){if(!cl[i]){const{maxTextures:r}=t.plugins[i],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 gt,default:Ve.from({uSamplers:n},!0)},o=t.plugins[i]._shader.program;cl[i]=new oi(o,a)}e=cl[i]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:i,maxX:r,maxY:n}=t.bounds;this._bounds.addFrame(this.transform,e,i,r,n)}containsPoint(t){return this.worldTransform.applyInverse(t,wo._TEMP_POINT),this._geometry.containsPoint(wo._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=pt.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,i=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 d=0;for(let u=0;u<l.length;u+=2){const f=l[u],p=l[u+1];c[d++]=i*f+n*p+o,c[d++]=a*p+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)}};ul.curves=dr,ul._TEMP_POINT=new tt;let li=ul;class Hb{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 dl=new tt,pp=new $i,mp=class A_ extends bt{constructor(t,e,i,r=Ue.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=i||ni.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=H.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===Ue.TRIANGLES&&e.length<A_.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,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.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,i=t._updateID;if(i===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,d=this.vertexData;for(let u=0;u<d.length/2;u++){const f=e[u*2],p=e[u*2+1];d[u*2]=n*f+o*p+l,d[u*2+1]=a*f+h*p+c}if(this._roundPixels){const u=H.RESOLUTION;for(let f=0;f<d.length;++f)d[f]=Math.round(d[f]*u)/u}this.vertexDirty=i}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new Hb(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,dl);const e=this.geometry.getBuffer("aVertexPosition").data,i=pp.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(i[0]=e[h],i[1]=e[h+1],i[2]=e[l],i[3]=e[l+1],i[4]=e[c],i[5]=e[c+1],pp.contains(dl.x,dl.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}};mp.BATCHABLE_SIZE=100;let ka=mp;class fl extends Xi{constructor(t,e,i){super();const r=new Nt(t),n=new Nt(e,!0),a=new Nt(i,!0,!0);this.addAttribute("aVertexPosition",r,2,!1,Z.FLOAT).addAttribute("aTextureCoord",n,2,!1,Z.FLOAT).addIndex(a),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var Vb=`varying vec2 vTextureCoord;
|
|
912
912
|
uniform vec4 uColor;
|
|
913
913
|
|
|
914
914
|
uniform sampler2D uSampler;
|
|
@@ -917,7 +917,7 @@ void main(void)
|
|
|
917
917
|
{
|
|
918
918
|
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
|
|
919
919
|
}
|
|
920
|
-
`,
|
|
920
|
+
`,Wb=`attribute vec2 aVertexPosition;
|
|
921
921
|
attribute vec2 aTextureCoord;
|
|
922
922
|
|
|
923
923
|
uniform mat3 projectionMatrix;
|
|
@@ -932,7 +932,7 @@ void main(void)
|
|
|
932
932
|
|
|
933
933
|
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
|
|
934
934
|
}
|
|
935
|
-
`;class
|
|
935
|
+
`;class Na extends oi{constructor(t,e){const i={uSampler:t,alpha:1,uTextureMatrix:gt.IDENTITY,uColor:new Float32Array([1,1,1,1])};e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e),e.uniforms&&Object.assign(i,e.uniforms),super(e.program||Ri.from(Wb,Vb),i),this._colorDirty=!1,this.uvMatrix=new df(t),this.batchable=e.program===void 0,this.pluginName=e.pluginName,this._tintColor=new pt(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;pt.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class Xb extends fl{constructor(t=100,e=100,i=10,r=10){super(),this.segWidth=i,this.segHeight=r,this.width=t,this.height=e,this.build()}build(){const t=this.segWidth*this.segHeight,e=[],i=[],r=[],n=this.segWidth-1,a=this.segHeight-1,o=this.width/n,h=this.height/a;for(let c=0;c<t;c++){const d=c%this.segWidth,u=c/this.segWidth|0;e.push(d*o,u*h),i.push(d/n,u/a)}const l=n*a;for(let c=0;c<l;c++){const d=c%n,u=c/n|0,f=u*this.segWidth+d,p=u*this.segWidth+d+1,m=(u+1)*this.segWidth+d,_=(u+1)*this.segWidth+d+1;r.push(f,p,m,p,_,m)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(r),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}}class $b extends ka{constructor(t,e,i){const r=new Xb(t.width,t.height,e,i),n=new Na(X.WHITE);super(r,n),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:e,height:i}=this.shader.texture;this.autoResize&&(t.width!==e||t.height!==i)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}const Ua=10;class zb extends $b{constructor(t,e,i,r,n){var a,o,h,l;super(X.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=e??((a=t.defaultBorders)==null?void 0:a.left)??Ua,this._rightWidth=r??((o=t.defaultBorders)==null?void 0:o.right)??Ua,this._topHeight=i??((h=t.defaultBorders)==null?void 0:h.top)??Ua,this._bottomHeight=n??((l=t.defaultBorders)==null?void 0:l.bottom)??Ua,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,r=this._height>i?1:this._height/i;return Math.min(e,r)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class Yb extends ka{constructor(t=X.EMPTY,e,i,r,n){const a=new fl(e,i,r);a.getBuffer("aVertexPosition").static=!1;const o=new Na(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 jb extends bt{constructor(t=1500,e,i=16384,r=!1){super();const n=16384;i>n&&(i=n),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=K.NORMAL,this.autoResize=r,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e),this._tintColor=new pt(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",()=>this.onChildrenChange(0))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const e=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID}dispose(){if(this._buffers){for(let t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}}destroy(t){super.destroy(t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}}class _p{constructor(t,e,i){this.geometry=new Xi,this.indexBuffer=null,this.size=i,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||Z.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 Nt(dx(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 i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new Nt(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 Nt(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===Z.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===Z.UNSIGNED_BYTE,o.type,this.staticStride*4,o.offset*4)}}uploadDynamic(t,e,i){for(let r=0;r<this.dynamicProperties.length;r++){const n=this.dynamicProperties[r];n.uploadFunction(t,e,i,n.type===Z.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,i){for(let r=0;r<this.staticProperties.length;r++){const n=this.staticProperties[r];n.uploadFunction(t,e,i,n.type===Z.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 qb=`varying vec2 vTextureCoord;
|
|
936
936
|
varying vec4 vColor;
|
|
937
937
|
|
|
938
938
|
uniform sampler2D uSampler;
|
|
@@ -940,7 +940,7 @@ uniform sampler2D uSampler;
|
|
|
940
940
|
void main(void){
|
|
941
941
|
vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
|
|
942
942
|
gl_FragColor = color;
|
|
943
|
-
}`,
|
|
943
|
+
}`,Kb=`attribute vec2 aVertexPosition;
|
|
944
944
|
attribute vec2 aTextureCoord;
|
|
945
945
|
attribute vec4 aColor;
|
|
946
946
|
|
|
@@ -965,8 +965,8 @@ void main(void){
|
|
|
965
965
|
vTextureCoord = aTextureCoord;
|
|
966
966
|
vColor = aColor * uColor;
|
|
967
967
|
}
|
|
968
|
-
`;class
|
|
969
|
-
`:t,t}static getFromCache(t,e,i,r){let n=i[t];return typeof n!="number"&&(n=q._measureText(t,e,r)+e,i[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 i=t[e];if(!q.isBreakingSpace(i))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:q._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:q._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let i="";if(typeof t!="string")return e;for(let r=0;r<t.length;r++){const n=t[r],a=t[r+1];if(q.isBreakingSpace(n,a)||q.isNewline(n)){i!==""&&(e.push(i),i=""),e.push(n);continue}i+=n}return i!==""&&e.push(i),e}static canBreakWords(t,e){return e}static canBreakChars(t,e,i,r,n){return!0}static wordWrapSplit(t){return q.graphemeSegmenter(t)}static measureFont(t){if(q._fonts[t])return q._fonts[t];const e={ascent:0,descent:0,fontSize:0},i=q._canvas,r=q._context;r.font=t;const n=q.METRICS_STRING+q.BASELINE_SYMBOL,a=Math.ceil(r.measureText(n).width);let o=Math.ceil(r.measureText(q.BASELINE_SYMBOL).width);const h=Math.ceil(q.HEIGHT_MULTIPLIER*o);if(o=o*q.BASELINE_MULTIPLIER|0,a===0||h===0)return q._fonts[t]=e,e;i.width=a,i.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,d=a*4;let u=0,f=0,p=!1;for(u=0;u<o;++u){for(let m=0;m<d;m+=4)if(l[f+m]!==255){p=!0;break}if(!p)f+=d;else break}for(e.ascent=o-u,f=c-d,p=!1,u=h;u>o;--u){for(let m=0;m<d;m+=4)if(l[f+m]!==255){p=!0;break}if(!p)f-=d;else break}return e.descent=u-o,e.fontSize=e.ascent+e.descent,q._fonts[t]=e,e}static clearMetrics(t=""){t?delete q._fonts[t]:q._fonts={}}static get _canvas(){var t;if(!q.__canvas){let e;try{const i=new OffscreenCanvas(0,0);if((t=i.getContext("2d",Ua))!=null&&t.measureText)return q.__canvas=i,i;e=H.ADAPTER.createCanvas()}catch{e=H.ADAPTER.createCanvas()}e.width=e.height=10,q.__canvas=e}return q.__canvas}static get _context(){return q.__context||(q.__context=q._canvas.getContext("2d",Ua)),q.__context}};li.METRICS_STRING="|ÉqÅ",li.BASELINE_SYMBOL="M",li.BASELINE_MULTIPLIER=1.4,li.HEIGHT_MULTIPLIER=2,li.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const s=new Intl.Segmenter;return t=>[...s.segment(t)].map(e=>e.segment)}return s=>[...s]})(),li.experimentalLetterSpacing=!1,li._fonts={},li._newlines=[10,13],li._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Ki=li;const Nb=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],up=class Mn{constructor(t){this.styleID=0,this.reset(),cl(this,t,t)}clone(){const t={};return cl(t,this,Mn.defaultStyle),new Mn(t)}reset(){cl(this,Mn.defaultStyle,Mn.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=ll(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=ll(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){Ub(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=ll(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 i=e.length-1;i>=0;i--){let r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!Nb.includes(r)&&(r=`"${r}"`),e[i]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};up.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Na.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 Ii=up;function ll(s){const t=ft.shared,e=i=>{const r=t.setValue(i);return r.alpha===1?r.toHex():r.toRgbaString()};return Array.isArray(s)?s.map(e):e(s)}function Ub(s,t){if(!Array.isArray(s)||!Array.isArray(t)||s.length!==t.length)return!1;for(let e=0;e<s.length;++e)if(s[e]!==t[e])return!1;return!0}function cl(s,t,e){for(const i in e)Array.isArray(t[i])?s[i]=t[i].slice():s[i]=t[i]}const Gb={texture:!0,children:!1,baseTexture:!0},dp=class zc extends ge{constructor(t,e,i){let r=!1;i||(i=H.ADAPTER.createCanvas(),r=!0),i.width=3,i.height=3;const n=X.from(i);n.orig=new st,n.trim=new st,super(n),this._ownCanvas=r,this.canvas=i,this.context=i.getContext("2d",{willReadFrequently:!0}),this._resolution=zc.defaultResolution??H.RESOLUTION,this._autoResolution=zc.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 Ki.experimentalLetterSpacing}static set experimentalLetterSpacing(t){it("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),Ki.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 i=this.context,r=Ki.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,d=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),i.scale(this._resolution,this._resolution),i.clearRect(0,0,this.canvas.width,this.canvas.height),i.font=this._font,i.lineWidth=e.strokeThickness,i.textBaseline=e.textBaseline,i.lineJoin=e.lineJoin,i.miterLimit=e.miterLimit;let u,f;const p=e.dropShadow?2:1;for(let m=0;m<p;++m){const g=e.dropShadow&&m===0,y=g?Math.ceil(Math.max(1,a)+e.padding*2):0,v=y*this._resolution;if(g){i.fillStyle="black",i.strokeStyle="black";const x=e.dropShadowColor,b=e.dropShadowBlur*this._resolution,w=e.dropShadowDistance*this._resolution;i.shadowColor=ft.shared.setValue(x).setAlpha(e.dropShadowAlpha).toRgbaString(),i.shadowBlur=b,i.shadowOffsetX=Math.cos(e.dropShadowAngle)*w,i.shadowOffsetY=Math.sin(e.dropShadowAngle)*w+v}else i.fillStyle=this._generateFillStyle(e,o,r),i.strokeStyle=e.stroke,i.shadowColor="black",i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0;let _=(h-d.fontSize)/2;h-d.fontSize<0&&(_=0);for(let x=0;x<o.length;x++)u=e.strokeThickness/2,f=e.strokeThickness/2+x*h+d.ascent+_,e.align==="right"?u+=c-l[x]:e.align==="center"&&(u+=(c-l[x])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(o[x],u+e.padding,f+e.padding-y,!0),e.fill&&this.drawLetterSpacing(o[x],u+e.padding,f+e.padding-y)}this.updateTexture()}drawLetterSpacing(t,e,i,r=!1){const n=this._style.letterSpacing;let a=!1;if(Ki.experimentalLetterSpacingSupported&&(Ki.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,i):this.context.fillText(t,e,i);return}let o=e;const h=Ki.graphemeSegmenter(t);let l=this.context.measureText(t).width,c=0;for(let d=0;d<h.length;++d){const u=h[d];r?this.context.strokeText(u,o,i):this.context.fillText(u,o,i);let f="";for(let p=d+1;p<h.length;++p)f+=h[p];c=this.context.measureText(f).width,o+=l-c+n,l=c}}updateTexture(){const t=this.canvas;if(this._style.trim){const a=sx(t);a.data&&(t.width=a.width,t.height=a.height,this.context.putImageData(a.data,0,0))}const e=this._texture,i=this._style,r=i.trim?0:i.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,i){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(),d=t.fillGradientStops.slice();if(!d.length){const u=c.length+1;for(let f=1;f<u;++f)d.push(f/u)}if(c.unshift(r[0]),d.unshift(0),c.push(r[r.length-1]),d.push(1),t.fillGradientType===Na.LINEAR_VERTICAL){n=this.context.createLinearGradient(h/2,o,h/2,l+o);const u=i.fontProperties.fontSize+t.strokeThickness;for(let f=0;f<e.length;f++){const p=i.lineHeight*(f-1)+u,m=i.lineHeight*f;let g=m;f>0&&p>m&&(g=(m+p)/2);const y=m+u,v=i.lineHeight*(f+1);let _=y;f+1<e.length&&v<y&&(_=(y+v)/2);const x=(_-g)/l;for(let b=0;b<c.length;b++){let w=0;typeof d[b]=="number"?w=d[b]:w=b/c.length;let T=Math.min(1,Math.max(0,g/l+w*x));T=Number(T.toFixed(5)),n.addColorStop(T,c[b])}}}else{n=this.context.createLinearGradient(o,l/2,h+o,l/2);const u=c.length+1;let f=1;for(let p=0;p<c.length;p++){let m;typeof d[p]=="number"?m=d[p]:m=f/u,n.addColorStop(m,c[p]),f++}}return n}destroy(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Gb,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=Hi(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=Hi(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 Ii?this._style=t:this._style=new Ii(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)}};dp.defaultAutoResolution=!0;let Ga=dp;class Hb{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function Vb(s,t){var i;let e=!1;if((i=s==null?void 0:s._textures)!=null&&i.length){for(let r=0;r<s._textures.length;r++)if(s._textures[r]instanceof X){const n=s._textures[r].baseTexture;t.includes(n)||(t.push(n),e=!0)}}return e}function Wb(s,t){if(s.baseTexture instanceof J){const e=s.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function Xb(s,t){if(s._texture&&s._texture instanceof X){const e=s._texture.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function zb(s,t){return t instanceof Ga?(t.updateText(!0),!0):!1}function $b(s,t){if(t instanceof Ii){const e=t.toFontString();return Ki.measureFont(e),!0}return!1}function Yb(s,t){if(s instanceof Ga){t.includes(s.style)||t.push(s.style),t.includes(s)||t.push(s);const e=s._texture.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function jb(s,t){return s instanceof Ii?(t.includes(s)||t.push(s),!0):!1}const fp=class fg{constructor(t){this.limiter=new Hb(fg.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(Yb),this.registerFindHook(jb),this.registerFindHook(Vb),this.registerFindHook(Wb),this.registerFindHook(Xb),this.registerUploadHook(zb),this.registerUploadHook($b)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,At.system.addOnce(this.tick,this,zi.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 i=0,r=this.uploadHooks.length;i<r;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}}e||this.queue.shift()}if(this.queue.length)At.system.addOnce(this.tick,this,zi.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,i=t.length;e<i;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,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof vt)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&At.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}};fp.uploadsPerFrame=4;let ul=fp;Object.defineProperties(H,{UPLOADS_PER_FRAME:{get(){return ul.uploadsPerFrame},set(s){it("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),ul.uploadsPerFrame=s}}});function pp(s,t){return t instanceof J?(t._glTextures[s.CONTEXT_UID]||s.texture.bind(t),!0):!1}function qb(s,t){if(!(t instanceof hi))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:i}=e;for(let r=0;r<i.length;r++){const{texture:n}=i[r].style;n&&pp(s,n.baseTexture)}return e.batchable||s.geometry.bind(e,t._resolveDirectShader(s)),!0}function Kb(s,t){return s instanceof hi?(t.push(s),!0):!1}class mp extends ul{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(Kb),this.registerUploadHook(pp),this.registerUploadHook(qb)}}mp.extension={name:"prepare",type:G.RendererSystem},Y.add(mp);var Zb=`#version 300 es
|
|
968
|
+
`;class gp extends pa{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new gt,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:Z.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=oi.from(Kb,qb,{}),this.state=ni.for2d()}render(t){const e=t.children,i=t._maxSize,r=t._batchSize,n=this.renderer;let a=e.length;if(a===0)return;a>i&&!t.autoResize&&(a=i);let o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=Bd(t.blendMode,l),n.state.set(this.state);const c=n.gl,d=t.worldTransform.copyTo(this.tempMatrix);d.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=d.toArray(!0),this.shader.uniforms.uColor=pt.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 u=!1;for(let f=0,p=0;f<a;f+=r,p+=1){let m=a-f;m>r&&(m=r),p>=o.length&&o.push(this._generateOneMoreBuffer(t));const _=o[p];_.uploadDynamic(e,f,m);const y=t._bufferUpdateIDs[p]||0;u=u||_._updateID<y,u&&(_._updateID=t._updateID,_.uploadStatic(e,f,m)),n.geometry.bind(_.geometry),c.drawElements(c.TRIANGLES,m*6,c.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],i=t._maxSize,r=t._batchSize,n=t._properties;for(let a=0;a<i;a+=r)e.push(new _p(this.properties,n,r));return e}_generateOneMoreBuffer(t){const e=t._batchSize,i=t._properties;return new _p(this.properties,i,e)}uploadVertices(t,e,i,r,n,a){let o=0,h=0,l=0,c=0;for(let d=0;d<i;++d){const u=t[e+d],f=u._texture,p=u.scale.x,m=u.scale.y,_=f.trim,y=f.orig;_?(h=_.x-u.anchor.x*y.width,o=h+_.width,c=_.y-u.anchor.y*y.height,l=c+_.height):(o=y.width*(1-u.anchor.x),h=y.width*-u.anchor.x,l=y.height*(1-u.anchor.y),c=y.height*-u.anchor.y),r[a]=h*p,r[a+1]=c*m,r[a+n]=o*p,r[a+n+1]=c*m,r[a+n*2]=o*p,r[a+n*2+1]=l*m,r[a+n*3]=h*p,r[a+n*3+1]=l*m,a+=n*4}}uploadPosition(t,e,i,r,n,a){for(let o=0;o<i;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,i,r,n,a){for(let o=0;o<i;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,i,r,n,a){for(let o=0;o<i;++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,i,r,n,a){for(let o=0;o<i;++o){const h=t[e+o],l=pt.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}}gp.extension={name:"particle",type:G.RendererPlugin},z.add(gp);var Ga=(s=>(s[s.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",s[s.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",s))(Ga||{});const Ha={willReadFrequently:!0},ci=class q{static get experimentalLetterSpacingSupported(){let t=q._experimentalLetterSpacingSupported;if(t!==void 0){const e=H.ADAPTER.getCanvasRenderingContext2D().prototype;t=q._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,i,r,n,a,o,h,l){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=l}static measureText(t,e,i,r=q._canvas){i=i??e.wordWrap;const n=e.toFontString(),a=q.measureFont(n);a.fontSize===0&&(a.fontSize=e.fontSize,a.ascent=e.fontSize);const o=r.getContext("2d",Ha);o.font=n;const h=(i?q.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let p=0;p<h.length;p++){const m=q._measureText(h[p],e.letterSpacing,o);l[p]=m,c=Math.max(c,m)}let d=c+e.strokeThickness;e.dropShadow&&(d+=e.dropShadowDistance);const u=e.lineHeight||a.fontSize+e.strokeThickness;let f=Math.max(u,a.fontSize+e.strokeThickness*2)+e.leading+(h.length-1)*(u+e.leading);return e.dropShadow&&(f+=e.dropShadowDistance),new q(t,e,d,f,h,l,u+e.leading,c,a)}static _measureText(t,e,i){let r=!1;q.experimentalLetterSpacingSupported&&(q.experimentalLetterSpacing?(i.letterSpacing=`${e}px`,i.textLetterSpacing=`${e}px`,r=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(t).width;return n>0&&(r?n-=e:n+=(q.graphemeSegmenter(t).length-1)*e),n}static wordWrap(t,e,i=q._canvas){const r=i.getContext("2d",Ha);let n=0,a="",o="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,d=q.collapseSpaces(c),u=q.collapseNewlines(c);let f=!d;const p=e.wordWrapWidth+l,m=q.tokenize(t);for(let _=0;_<m.length;_++){let y=m[_];if(q.isNewline(y)){if(!u){o+=q.addLine(a),f=!d,a="",n=0;continue}y=" "}if(d){const g=q.isBreakingSpace(y),x=q.isBreakingSpace(a[a.length-1]);if(g&&x)continue}const v=q.getFromCache(y,l,h,r);if(v>p)if(a!==""&&(o+=q.addLine(a),a="",n=0),q.canBreakWords(y,e.breakWords)){const g=q.wordWrapSplit(y);for(let x=0;x<g.length;x++){let b=g[x],w=b,T=1;for(;g[x+T];){const A=g[x+T];if(!q.canBreakChars(w,A,y,x,e.breakWords))b+=A;else break;w=A,T++}x+=T-1;const E=q.getFromCache(b,l,h,r);E+n>p&&(o+=q.addLine(a),f=!1,a="",n=0),a+=b,n+=E}}else{a.length>0&&(o+=q.addLine(a),a="",n=0);const g=_===m.length-1;o+=q.addLine(y,!g),f=!1,a="",n=0}else v+n>p&&(f=!1,o+=q.addLine(a),a="",n=0),(a.length>0||!q.isBreakingSpace(y)||f)&&(a+=y,n+=v)}return o+=q.addLine(a,!1),o}static addLine(t,e=!0){return t=q.trimRight(t),t=e?`${t}
|
|
969
|
+
`:t,t}static getFromCache(t,e,i,r){let n=i[t];return typeof n!="number"&&(n=q._measureText(t,e,r)+e,i[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 i=t[e];if(!q.isBreakingSpace(i))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:q._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:q._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let i="";if(typeof t!="string")return e;for(let r=0;r<t.length;r++){const n=t[r],a=t[r+1];if(q.isBreakingSpace(n,a)||q.isNewline(n)){i!==""&&(e.push(i),i=""),e.push(n);continue}i+=n}return i!==""&&e.push(i),e}static canBreakWords(t,e){return e}static canBreakChars(t,e,i,r,n){return!0}static wordWrapSplit(t){return q.graphemeSegmenter(t)}static measureFont(t){if(q._fonts[t])return q._fonts[t];const e={ascent:0,descent:0,fontSize:0},i=q._canvas,r=q._context;r.font=t;const n=q.METRICS_STRING+q.BASELINE_SYMBOL,a=Math.ceil(r.measureText(n).width);let o=Math.ceil(r.measureText(q.BASELINE_SYMBOL).width);const h=Math.ceil(q.HEIGHT_MULTIPLIER*o);if(o=o*q.BASELINE_MULTIPLIER|0,a===0||h===0)return q._fonts[t]=e,e;i.width=a,i.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,d=a*4;let u=0,f=0,p=!1;for(u=0;u<o;++u){for(let m=0;m<d;m+=4)if(l[f+m]!==255){p=!0;break}if(!p)f+=d;else break}for(e.ascent=o-u,f=c-d,p=!1,u=h;u>o;--u){for(let m=0;m<d;m+=4)if(l[f+m]!==255){p=!0;break}if(!p)f-=d;else break}return e.descent=u-o,e.fontSize=e.ascent+e.descent,q._fonts[t]=e,e}static clearMetrics(t=""){t?delete q._fonts[t]:q._fonts={}}static get _canvas(){var t;if(!q.__canvas){let e;try{const i=new OffscreenCanvas(0,0);if((t=i.getContext("2d",Ha))!=null&&t.measureText)return q.__canvas=i,i;e=H.ADAPTER.createCanvas()}catch{e=H.ADAPTER.createCanvas()}e.width=e.height=10,q.__canvas=e}return q.__canvas}static get _context(){return q.__context||(q.__context=q._canvas.getContext("2d",Ha)),q.__context}};ci.METRICS_STRING="|ÉqÅ",ci.BASELINE_SYMBOL="M",ci.BASELINE_MULTIPLIER=1.4,ci.HEIGHT_MULTIPLIER=2,ci.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const s=new Intl.Segmenter;return t=>[...s.segment(t)].map(e=>e.segment)}return s=>[...s]})(),ci.experimentalLetterSpacing=!1,ci._fonts={},ci._newlines=[10,13],ci._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let Zi=ci;const Zb=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],yp=class Bn{constructor(t){this.styleID=0,this.reset(),ml(this,t,t)}clone(){const t={};return ml(t,this,Bn.defaultStyle),new Bn(t)}reset(){ml(this,Bn.defaultStyle,Bn.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=pl(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=pl(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){Qb(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=pl(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 i=e.length-1;i>=0;i--){let r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!Zb.includes(r)&&(r=`"${r}"`),e[i]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};yp.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Ga.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 Mi=yp;function pl(s){const t=pt.shared,e=i=>{const r=t.setValue(i);return r.alpha===1?r.toHex():r.toRgbaString()};return Array.isArray(s)?s.map(e):e(s)}function Qb(s,t){if(!Array.isArray(s)||!Array.isArray(t)||s.length!==t.length)return!1;for(let e=0;e<s.length;++e)if(s[e]!==t[e])return!1;return!0}function ml(s,t,e){for(const i in e)Array.isArray(t[i])?s[i]=t[i].slice():s[i]=t[i]}const Jb={texture:!0,children:!1,baseTexture:!0},xp=class Qc extends _e{constructor(t,e,i){let r=!1;i||(i=H.ADAPTER.createCanvas(),r=!0),i.width=3,i.height=3;const n=X.from(i);n.orig=new st,n.trim=new st,super(n),this._ownCanvas=r,this.canvas=i,this.context=i.getContext("2d",{willReadFrequently:!0}),this._resolution=Qc.defaultResolution??H.RESOLUTION,this._autoResolution=Qc.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 Zi.experimentalLetterSpacing}static set experimentalLetterSpacing(t){it("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),Zi.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 i=this.context,r=Zi.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,d=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),i.scale(this._resolution,this._resolution),i.clearRect(0,0,this.canvas.width,this.canvas.height),i.font=this._font,i.lineWidth=e.strokeThickness,i.textBaseline=e.textBaseline,i.lineJoin=e.lineJoin,i.miterLimit=e.miterLimit;let u,f;const p=e.dropShadow?2:1;for(let m=0;m<p;++m){const _=e.dropShadow&&m===0,y=_?Math.ceil(Math.max(1,a)+e.padding*2):0,v=y*this._resolution;if(_){i.fillStyle="black",i.strokeStyle="black";const x=e.dropShadowColor,b=e.dropShadowBlur*this._resolution,w=e.dropShadowDistance*this._resolution;i.shadowColor=pt.shared.setValue(x).setAlpha(e.dropShadowAlpha).toRgbaString(),i.shadowBlur=b,i.shadowOffsetX=Math.cos(e.dropShadowAngle)*w,i.shadowOffsetY=Math.sin(e.dropShadowAngle)*w+v}else i.fillStyle=this._generateFillStyle(e,o,r),i.strokeStyle=e.stroke,i.shadowColor="black",i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0;let g=(h-d.fontSize)/2;h-d.fontSize<0&&(g=0);for(let x=0;x<o.length;x++)u=e.strokeThickness/2,f=e.strokeThickness/2+x*h+d.ascent+g,e.align==="right"?u+=c-l[x]:e.align==="center"&&(u+=(c-l[x])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(o[x],u+e.padding,f+e.padding-y,!0),e.fill&&this.drawLetterSpacing(o[x],u+e.padding,f+e.padding-y)}this.updateTexture()}drawLetterSpacing(t,e,i,r=!1){const n=this._style.letterSpacing;let a=!1;if(Zi.experimentalLetterSpacingSupported&&(Zi.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,i):this.context.fillText(t,e,i);return}let o=e;const h=Zi.graphemeSegmenter(t);let l=this.context.measureText(t).width,c=0;for(let d=0;d<h.length;++d){const u=h[d];r?this.context.strokeText(u,o,i):this.context.fillText(u,o,i);let f="";for(let p=d+1;p<h.length;++p)f+=h[p];c=this.context.measureText(f).width,o+=l-c+n,l=c}}updateTexture(){const t=this.canvas;if(this._style.trim){const a=_x(t);a.data&&(t.width=a.width,t.height=a.height,this.context.putImageData(a.data,0,0))}const e=this._texture,i=this._style,r=i.trim?0:i.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,i){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(),d=t.fillGradientStops.slice();if(!d.length){const u=c.length+1;for(let f=1;f<u;++f)d.push(f/u)}if(c.unshift(r[0]),d.unshift(0),c.push(r[r.length-1]),d.push(1),t.fillGradientType===Ga.LINEAR_VERTICAL){n=this.context.createLinearGradient(h/2,o,h/2,l+o);const u=i.fontProperties.fontSize+t.strokeThickness;for(let f=0;f<e.length;f++){const p=i.lineHeight*(f-1)+u,m=i.lineHeight*f;let _=m;f>0&&p>m&&(_=(m+p)/2);const y=m+u,v=i.lineHeight*(f+1);let g=y;f+1<e.length&&v<y&&(g=(y+v)/2);const x=(g-_)/l;for(let b=0;b<c.length;b++){let w=0;typeof d[b]=="number"?w=d[b]:w=b/c.length;let T=Math.min(1,Math.max(0,_/l+w*x));T=Number(T.toFixed(5)),n.addColorStop(T,c[b])}}}else{n=this.context.createLinearGradient(o,l/2,h+o,l/2);const u=c.length+1;let f=1;for(let p=0;p<c.length;p++){let m;typeof d[p]=="number"?m=d[p]:m=f/u,n.addColorStop(m,c[p]),f++}}return n}destroy(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Jb,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=Vi(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=Vi(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 Mi?this._style=t:this._style=new Mi(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)}};xp.defaultAutoResolution=!0;let Va=xp;class tT{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function eT(s,t){var i;let e=!1;if((i=s==null?void 0:s._textures)!=null&&i.length){for(let r=0;r<s._textures.length;r++)if(s._textures[r]instanceof X){const n=s._textures[r].baseTexture;t.includes(n)||(t.push(n),e=!0)}}return e}function iT(s,t){if(s.baseTexture instanceof J){const e=s.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function sT(s,t){if(s._texture&&s._texture instanceof X){const e=s._texture.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function rT(s,t){return t instanceof Va?(t.updateText(!0),!0):!1}function nT(s,t){if(t instanceof Mi){const e=t.toFontString();return Zi.measureFont(e),!0}return!1}function aT(s,t){if(s instanceof Va){t.includes(s.style)||t.push(s.style),t.includes(s)||t.push(s);const e=s._texture.baseTexture;return t.includes(e)||t.push(e),!0}return!1}function oT(s,t){return s instanceof Mi?(t.includes(s)||t.push(s),!0):!1}const vp=class S_{constructor(t){this.limiter=new tT(S_.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(aT),this.registerFindHook(oT),this.registerFindHook(eT),this.registerFindHook(iT),this.registerFindHook(sT),this.registerUploadHook(rT),this.registerUploadHook(nT)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,ft.system.addOnce(this.tick,this,zi.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 i=0,r=this.uploadHooks.length;i<r;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}}e||this.queue.shift()}if(this.queue.length)ft.system.addOnce(this.tick,this,zi.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,i=t.length;e<i;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,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof bt)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&ft.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}};vp.uploadsPerFrame=4;let _l=vp;Object.defineProperties(H,{UPLOADS_PER_FRAME:{get(){return _l.uploadsPerFrame},set(s){it("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),_l.uploadsPerFrame=s}}});function bp(s,t){return t instanceof J?(t._glTextures[s.CONTEXT_UID]||s.texture.bind(t),!0):!1}function hT(s,t){if(!(t instanceof li))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:i}=e;for(let r=0;r<i.length;r++){const{texture:n}=i[r].style;n&&bp(s,n.baseTexture)}return e.batchable||s.geometry.bind(e,t._resolveDirectShader(s)),!0}function lT(s,t){return s instanceof li?(t.push(s),!0):!1}class Tp extends _l{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(lT),this.registerUploadHook(bp),this.registerUploadHook(hT)}}Tp.extension={name:"prepare",type:G.RendererSystem},z.add(Tp);var cT=`#version 300 es
|
|
970
970
|
#define SHADER_NAME Tiling-Sprite-100
|
|
971
971
|
|
|
972
972
|
precision lowp float;
|
|
@@ -992,7 +992,7 @@ void main(void)
|
|
|
992
992
|
|
|
993
993
|
fragmentColor = texSample * uColor;
|
|
994
994
|
}
|
|
995
|
-
`,
|
|
995
|
+
`,uT=`#version 300 es
|
|
996
996
|
#define SHADER_NAME Tiling-Sprite-300
|
|
997
997
|
|
|
998
998
|
precision lowp float;
|
|
@@ -1012,7 +1012,7 @@ void main(void)
|
|
|
1012
1012
|
|
|
1013
1013
|
vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
|
|
1014
1014
|
}
|
|
1015
|
-
`,
|
|
1015
|
+
`,dT=`#version 100
|
|
1016
1016
|
#ifdef GL_EXT_shader_texture_lod
|
|
1017
1017
|
#extension GL_EXT_shader_texture_lod : enable
|
|
1018
1018
|
#endif
|
|
@@ -1045,7 +1045,7 @@ void main(void)
|
|
|
1045
1045
|
|
|
1046
1046
|
gl_FragColor = texSample * uColor;
|
|
1047
1047
|
}
|
|
1048
|
-
`,
|
|
1048
|
+
`,wp=`#version 100
|
|
1049
1049
|
#define SHADER_NAME Tiling-Sprite-100
|
|
1050
1050
|
|
|
1051
1051
|
precision lowp float;
|
|
@@ -1065,7 +1065,7 @@ void main(void)
|
|
|
1065
1065
|
|
|
1066
1066
|
vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
|
|
1067
1067
|
}
|
|
1068
|
-
`,
|
|
1068
|
+
`,fT=`#version 100
|
|
1069
1069
|
#define SHADER_NAME Tiling-Sprite-Simple-100
|
|
1070
1070
|
|
|
1071
1071
|
precision lowp float;
|
|
@@ -1080,7 +1080,7 @@ void main(void)
|
|
|
1080
1080
|
vec4 texSample = texture2D(uSampler, vTextureCoord);
|
|
1081
1081
|
gl_FragColor = texSample * uColor;
|
|
1082
1082
|
}
|
|
1083
|
-
`;const Ha=new gt;class _p extends da{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new Jd,this.state=ri.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=ai.from(gp,tT,e),this.shader=t.context.webGLVersion>1?ai.from(Qb,Zb,e):ai.from(gp,Jb,e)}render(t){const e=this.renderer,i=this.quad;let r=i.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=i.uvs,r[0]=r[6]=-n,r[1]=r[3]=-a,r[2]=r[4]=1-n,r[5]=r[7]=1-a,i.invalidate();const o=t._texture,h=o.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,d=t.uvMatrix;let u=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;u&&(h._glTextures[e.CONTEXT_UID]?u=h.wrapMode!==Ni.CLAMP:h.wrapMode===Ni.CLAMP&&(h.wrapMode=Ni.REPEAT));const f=u?this.simpleShader:this.shader,p=o.width,m=o.height,g=t._width,y=t._height;Ha.set(c.a*p/g,c.b*p/y,c.c*m/g,c.d*m/y,c.tx/g,c.ty/y),Ha.invert(),u?Ha.prepend(d.mapCoord):(f.uniforms.uMapCoord=d.mapCoord.toArray(!0),f.uniforms.uClampFrame=d.uClampFrame,f.uniforms.uClampOffset=d.uClampOffset),f.uniforms.uTransform=Ha.toArray(!0),f.uniforms.uColor=ft.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(i),this.state.blendMode=Sd(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}_p.extension={name:"tilingSprite",type:G.RendererPlugin},Y.add(_p);const yp=class Dn{constructor(t,e,i){this.linkedSheets=[],(t instanceof J||t instanceof X)&&(t={texture:t,data:e,resolutionFilename:i});const{texture:r,data:n,resolutionFilename:a=null,cachePrefix:o=""}=t;this.cachePrefix=o,this._texture=r instanceof X?r:null,this.baseTexture=r instanceof J?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 i=Ci(t,null);return i===null&&(i=typeof e=="number"?e:parseFloat(e??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Dn.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=Dn.BATCH_SIZE;for(;e-t<i&&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 st(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?o=new st(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 st(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 st(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 X(this.baseTexture,o,c,h,n.rotated?2:0,n.anchor,n.borders),X.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 i=0;i<t[e].length;i++){const r=t[e][i];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*Dn.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Dn.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var e;for(const i in this.textures)this.textures[i].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=[]}};yp.BATCH_SIZE=1e3;let xp=yp;const eT=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function vp(s,t,e){const i={};if(s.forEach(r=>{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[`${t.cachePrefix}${r}`]=t.textures[r]}),!e){const r=zt.dirname(s[0]);t.linkedSheets.forEach((n,a)=>{Object.assign(i,vp([`${r}/${t.data.meta.related_multi_packs[a]}`],n,!0))})}return i}const iT={extension:G.Asset,cache:{test:s=>s instanceof xp,getCacheableAssets:(s,t)=>vp(s,t,!1)},resolver:{test:s=>{const t=s.split("?")[0].split("."),e=t.pop(),i=t.pop();return e==="json"&&eT.includes(i)},parse:s=>{var e;const t=s.split(".");return{resolution:parseFloat(((e=H.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:t[t.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:G.LoadParser,priority:Xe.Normal},async testParse(s,t){return zt.extname(t.src).toLowerCase()===".json"&&!!s.frames},async parse(s,t,e){var c,d;const{texture:i,imageFilename:r,cachePrefix:n}=(t==null?void 0:t.data)??{};let a=zt.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let o;if(i&&i.baseTexture)o=i;else{const u=qh(a+(r??s.meta.image),t.src);o=(await e.load([u]))[u]}const h=new xp({texture:o.baseTexture,data:s,resolutionFilename:t.src,cachePrefix:n});await h.parse();const l=(c=s==null?void 0:s.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(l)){const u=[];for(const p of l){if(typeof p!="string")continue;let m=a+p;(d=t.data)!=null&&d.ignoreMultiPack||(m=qh(m,t.src),u.push(e.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(u);h.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[h].concat(h.linkedSheets.filter(m=>m!==p))})}return h},unload(s){s.destroy(!0)}}};Y.add(iT);class Va{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Wa{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),i={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("="),d=c[0],u=c[1].replace(/"/gm,""),f=parseFloat(u),p=isNaN(f)?u:f;h[d]=p}i[a].push(h)}const r=new Va;return i.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),i.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),i.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),i.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)})),i.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),i.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class dl{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 Va,i=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<i.length;l++)e.info.push({face:i[l].getAttribute("face"),size:parseInt(i[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 fl{static test(t){return typeof t=="string"&&t.includes("<font>")?dl.test(H.ADAPTER.parseXML(t)):!1}static parse(t){return dl.parse(H.ADAPTER.parseXML(t))}}const pl=[Wa,dl,fl];function sT(s){for(let t=0;t<pl.length;t++)if(pl[t].test(s))return pl[t];return null}function rT(s,t,e,i,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=s.width/i-h-l*2,d=s.height/i-h-l*2,u=a.slice(),f=e.fillGradientStops.slice();if(!f.length){const p=u.length+1;for(let m=1;m<p;++m)f.push(m/p)}if(u.unshift(a[0]),f.unshift(0),u.push(a[a.length-1]),f.push(1),e.fillGradientType===Na.LINEAR_VERTICAL){o=t.createLinearGradient(c/2,l,c/2,d+l);let p=0;const m=(n.fontProperties.fontSize+e.strokeThickness)/d;for(let g=0;g<r.length;g++){const y=n.lineHeight*g;for(let v=0;v<u.length;v++){let _=0;typeof f[v]=="number"?_=f[v]:_=v/u.length;const x=y/d+_*m;let b=Math.max(p,x);b=Math.min(b,1),o.addColorStop(b,u[v]),p=b}}}else{o=t.createLinearGradient(l,d/2,c+l,d/2);const p=u.length+1;let m=1;for(let g=0;g<u.length;g++){let y;typeof f[g]=="number"?y=f[g]:y=m/p,o.addColorStop(y,u[g]),m++}}return o}function nT(s,t,e,i,r,n,a){const o=e.text,h=e.fontProperties;t.translate(i,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=rT(s,t,a,n,[o],e),t.strokeStyle=a.stroke,a.dropShadow){const d=a.dropShadowColor,u=a.dropShadowBlur*n,f=a.dropShadowDistance*n;t.shadowColor=ft.shared.setValue(d).setAlpha(a.dropShadowAlpha).toRgbaString(),t.shadowBlur=u,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 Xa(s){return s.codePointAt?s.codePointAt(0):s.charCodeAt(0)}function bp(s){return Array.from?Array.from(s):s.split("")}function aT(s){typeof s=="string"&&(s=[s]);const t=[];for(let e=0,i=s.length;e<i;e++){const r=s[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(...bp(r))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}const Zi=class vi{constructor(t,e,i){var c;const[r]=t.info,[n]=t.common,[a]=t.page,[o]=t.distanceField,h=Ci(a.file),l={};this._ownsTextures=i,this.font=r.face,this.size=r.size,this.lineHeight=n.lineHeight/h,this.chars={},this.pageTextures=l;for(let d=0;d<t.page.length;d++){const{id:u,file:f}=t.page[d];l[u]=e instanceof Array?e[d]:e[f],o!=null&&o.fieldType&&o.fieldType!=="none"&&(l[u].baseTexture.alphaMode=he.NO_PREMULTIPLIED_ALPHA,l[u].baseTexture.mipmap=Ke.OFF)}for(let d=0;d<t.char.length;d++){const{id:u,page:f}=t.char[d];let{x:p,y:m,width:g,height:y,xoffset:v,yoffset:_,xadvance:x}=t.char[d];p/=h,m/=h,g/=h,y/=h,v/=h,_/=h,x/=h;const b=new st(p+l[f].frame.x/h,m+l[f].frame.y/h,g,y);this.chars[u]={xOffset:v,yOffset:_,xAdvance:x,kerning:{},texture:new X(l[f].baseTexture,b),page:f}}for(let d=0;d<t.kerning.length;d++){let{first:u,second:f,amount:p}=t.kerning[d];u/=h,f/=h,p/=h,this.chars[f]&&(this.chars[f].kerning[u]=p)}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,i){let r;if(t instanceof Va)r=t;else{const a=sT(t);if(!a)throw new Error("Unrecognized data format for font.");r=a.parse(t)}e instanceof X&&(e=[e]);const n=new vi(r,e,i);return vi.available[n.font]=n,n}static uninstall(t){const e=vi.available[t];if(!e)throw new Error(`No font found named '${t}'`);e.destroy(),delete vi.available[t]}static from(t,e,i){if(!t)throw new Error("[BitmapFont] Property `name` is required.");const{chars:r,padding:n,resolution:a,textureWidth:o,textureHeight:h,...l}=Object.assign({},vi.defaultOptions,i),c=aT(r),d=e instanceof Ii?e:new Ii(e),u=o,f=new Va;f.info[0]={face:d.fontFamily,size:d.fontSize},f.common[0]={lineHeight:d.fontSize};let p=0,m=0,g,y,v,_=0;const x=[];for(let w=0;w<c.length;w++){g||(g=H.ADAPTER.createCanvas(),g.width=o,g.height=h,y=g.getContext("2d"),v=new J(g,{resolution:a,...l}),x.push(new X(v)),f.page.push({id:x.length-1,file:""}));const T=c[w],E=Ki.measureText(T,d,!1,g),A=E.width,P=Math.ceil(E.height),L=Math.ceil((d.fontStyle==="italic"?2:1)*A);if(m>=h-P*a){if(m===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${T}')`);--w,g=null,y=null,v=null,m=0,p=0,_=0;continue}if(_=Math.max(P+E.fontProperties.descent,_),L*a+p>=u){if(p===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${T}')`);--w,m+=_*a,m=Math.ceil(m),p=0,_=0;continue}nT(g,y,E,p,m,a,d);const M=Xa(E.text);f.char.push({id:M,page:x.length-1,x:p/a,y:m/a,width:L,height:P,xoffset:0,yoffset:0,xadvance:A-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),p+=(L+2*n)*a,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let w=0,T=c.length;w<T;w++){const E=c[w];for(let A=0;A<T;A++){const P=c[A],L=y.measureText(E).width,M=y.measureText(P).width,S=y.measureText(E+P).width-(L+M);S&&f.kerning.push({first:Xa(E),second:Xa(P),amount:S})}}const b=new vi(f,x,!0);return vi.available[t]!==void 0&&vi.uninstall(t),vi.available[t]=b,b}};Zi.ALPHA=[["a","z"],["A","Z"]," "],Zi.NUMERIC=[["0","9"]],Zi.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Zi.ASCII=[[" ","~"]],Zi.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Zi.ALPHANUMERIC},Zi.available={};let Qi=Zi;var oT=`// Pixi texture info\r
|
|
1083
|
+
`;const Wa=new gt;class Ep extends pa{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new of,this.state=ni.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=oi.from(wp,fT,e),this.shader=t.context.webGLVersion>1?oi.from(uT,cT,e):oi.from(wp,dT,e)}render(t){const e=this.renderer,i=this.quad;let r=i.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=i.uvs,r[0]=r[6]=-n,r[1]=r[3]=-a,r[2]=r[4]=1-n,r[5]=r[7]=1-a,i.invalidate();const o=t._texture,h=o.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,d=t.uvMatrix;let u=h.isPowerOfTwo&&o.frame.width===h.width&&o.frame.height===h.height;u&&(h._glTextures[e.CONTEXT_UID]?u=h.wrapMode!==Ui.CLAMP:h.wrapMode===Ui.CLAMP&&(h.wrapMode=Ui.REPEAT));const f=u?this.simpleShader:this.shader,p=o.width,m=o.height,_=t._width,y=t._height;Wa.set(c.a*p/_,c.b*p/y,c.c*m/_,c.d*m/y,c.tx/_,c.ty/y),Wa.invert(),u?Wa.prepend(d.mapCoord):(f.uniforms.uMapCoord=d.mapCoord.toArray(!0),f.uniforms.uClampFrame=d.uClampFrame,f.uniforms.uClampOffset=d.uClampOffset),f.uniforms.uTransform=Wa.toArray(!0),f.uniforms.uColor=pt.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(i),this.state.blendMode=Bd(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Ep.extension={name:"tilingSprite",type:G.RendererPlugin},z.add(Ep);const Ap=class On{constructor(t,e,i){this.linkedSheets=[],(t instanceof J||t instanceof X)&&(t={texture:t,data:e,resolutionFilename:i});const{texture:r,data:n,resolutionFilename:a=null,cachePrefix:o=""}=t;this.cachePrefix=o,this._texture=r instanceof X?r:null,this.baseTexture=r instanceof J?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 i=Pi(t,null);return i===null&&(i=typeof e=="number"?e:parseFloat(e??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=On.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=On.BATCH_SIZE;for(;e-t<i&&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 st(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?o=new st(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 st(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 st(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 X(this.baseTexture,o,c,h,n.rotated?2:0,n.anchor,n.borders),X.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 i=0;i<t[e].length;i++){const r=t[e][i];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*On.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*On.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var e;for(const i in this.textures)this.textures[i].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=[]}};Ap.BATCH_SIZE=1e3;let Sp=Ap;const pT=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function Cp(s,t,e){const i={};if(s.forEach(r=>{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[`${t.cachePrefix}${r}`]=t.textures[r]}),!e){const r=Ft.dirname(s[0]);t.linkedSheets.forEach((n,a)=>{Object.assign(i,Cp([`${r}/${t.data.meta.related_multi_packs[a]}`],n,!0))})}return i}const mT={extension:G.Asset,cache:{test:s=>s instanceof Sp,getCacheableAssets:(s,t)=>Cp(s,t,!1)},resolver:{test:s=>{const t=s.split("?")[0].split("."),e=t.pop(),i=t.pop();return e==="json"&&pT.includes(i)},parse:s=>{var e;const t=s.split(".");return{resolution:parseFloat(((e=H.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:t[t.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:G.LoadParser,priority:Re.Normal},async testParse(s,t){return Ft.extname(t.src).toLowerCase()===".json"&&!!s.frames},async parse(s,t,e){var c,d;const{texture:i,imageFilename:r,cachePrefix:n}=(t==null?void 0:t.data)??{};let a=Ft.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let o;if(i&&i.baseTexture)o=i;else{const u=tl(a+(r??s.meta.image),t.src);o=(await e.load([u]))[u]}const h=new Sp({texture:o.baseTexture,data:s,resolutionFilename:t.src,cachePrefix:n});await h.parse();const l=(c=s==null?void 0:s.meta)==null?void 0:c.related_multi_packs;if(Array.isArray(l)){const u=[];for(const p of l){if(typeof p!="string")continue;let m=a+p;(d=t.data)!=null&&d.ignoreMultiPack||(m=tl(m,t.src),u.push(e.load({src:m,data:{ignoreMultiPack:!0}})))}const f=await Promise.all(u);h.linkedSheets=f,f.forEach(p=>{p.linkedSheets=[h].concat(h.linkedSheets.filter(m=>m!==p))})}return h},unload(s){s.destroy(!0)}}};z.add(mT);class Xa{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class $a{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),i={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("="),d=c[0],u=c[1].replace(/"/gm,""),f=parseFloat(u),p=isNaN(f)?u:f;h[d]=p}i[a].push(h)}const r=new Xa;return i.info.forEach(n=>r.info.push({face:n.face,size:parseInt(n.size,10)})),i.common.forEach(n=>r.common.push({lineHeight:parseInt(n.lineHeight,10)})),i.page.forEach(n=>r.page.push({id:parseInt(n.id,10),file:n.file})),i.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)})),i.kerning.forEach(n=>r.kerning.push({first:parseInt(n.first,10),second:parseInt(n.second,10),amount:parseInt(n.amount,10)})),i.distanceField.forEach(n=>r.distanceField.push({distanceRange:parseInt(n.distanceRange,10),fieldType:n.fieldType})),r}}class gl{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 Xa,i=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<i.length;l++)e.info.push({face:i[l].getAttribute("face"),size:parseInt(i[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 yl{static test(t){return typeof t=="string"&&t.includes("<font>")?gl.test(H.ADAPTER.parseXML(t)):!1}static parse(t){return gl.parse(H.ADAPTER.parseXML(t))}}const xl=[$a,gl,yl];function _T(s){for(let t=0;t<xl.length;t++)if(xl[t].test(s))return xl[t];return null}function gT(s,t,e,i,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=s.width/i-h-l*2,d=s.height/i-h-l*2,u=a.slice(),f=e.fillGradientStops.slice();if(!f.length){const p=u.length+1;for(let m=1;m<p;++m)f.push(m/p)}if(u.unshift(a[0]),f.unshift(0),u.push(a[a.length-1]),f.push(1),e.fillGradientType===Ga.LINEAR_VERTICAL){o=t.createLinearGradient(c/2,l,c/2,d+l);let p=0;const m=(n.fontProperties.fontSize+e.strokeThickness)/d;for(let _=0;_<r.length;_++){const y=n.lineHeight*_;for(let v=0;v<u.length;v++){let g=0;typeof f[v]=="number"?g=f[v]:g=v/u.length;const x=y/d+g*m;let b=Math.max(p,x);b=Math.min(b,1),o.addColorStop(b,u[v]),p=b}}}else{o=t.createLinearGradient(l,d/2,c+l,d/2);const p=u.length+1;let m=1;for(let _=0;_<u.length;_++){let y;typeof f[_]=="number"?y=f[_]:y=m/p,o.addColorStop(y,u[_]),m++}}return o}function yT(s,t,e,i,r,n,a){const o=e.text,h=e.fontProperties;t.translate(i,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=gT(s,t,a,n,[o],e),t.strokeStyle=a.stroke,a.dropShadow){const d=a.dropShadowColor,u=a.dropShadowBlur*n,f=a.dropShadowDistance*n;t.shadowColor=pt.shared.setValue(d).setAlpha(a.dropShadowAlpha).toRgbaString(),t.shadowBlur=u,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 za(s){return s.codePointAt?s.codePointAt(0):s.charCodeAt(0)}function Pp(s){return Array.from?Array.from(s):s.split("")}function xT(s){typeof s=="string"&&(s=[s]);const t=[];for(let e=0,i=s.length;e<i;e++){const r=s[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(...Pp(r))}if(t.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return t}const Qi=class bi{constructor(t,e,i){var c;const[r]=t.info,[n]=t.common,[a]=t.page,[o]=t.distanceField,h=Pi(a.file),l={};this._ownsTextures=i,this.font=r.face,this.size=r.size,this.lineHeight=n.lineHeight/h,this.chars={},this.pageTextures=l;for(let d=0;d<t.page.length;d++){const{id:u,file:f}=t.page[d];l[u]=e instanceof Array?e[d]:e[f],o!=null&&o.fieldType&&o.fieldType!=="none"&&(l[u].baseTexture.alphaMode=he.NO_PREMULTIPLIED_ALPHA,l[u].baseTexture.mipmap=Ke.OFF)}for(let d=0;d<t.char.length;d++){const{id:u,page:f}=t.char[d];let{x:p,y:m,width:_,height:y,xoffset:v,yoffset:g,xadvance:x}=t.char[d];p/=h,m/=h,_/=h,y/=h,v/=h,g/=h,x/=h;const b=new st(p+l[f].frame.x/h,m+l[f].frame.y/h,_,y);this.chars[u]={xOffset:v,yOffset:g,xAdvance:x,kerning:{},texture:new X(l[f].baseTexture,b),page:f}}for(let d=0;d<t.kerning.length;d++){let{first:u,second:f,amount:p}=t.kerning[d];u/=h,f/=h,p/=h,this.chars[f]&&(this.chars[f].kerning[u]=p)}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,i){let r;if(t instanceof Xa)r=t;else{const a=_T(t);if(!a)throw new Error("Unrecognized data format for font.");r=a.parse(t)}e instanceof X&&(e=[e]);const n=new bi(r,e,i);return bi.available[n.font]=n,n}static uninstall(t){const e=bi.available[t];if(!e)throw new Error(`No font found named '${t}'`);e.destroy(),delete bi.available[t]}static from(t,e,i){if(!t)throw new Error("[BitmapFont] Property `name` is required.");const{chars:r,padding:n,resolution:a,textureWidth:o,textureHeight:h,...l}=Object.assign({},bi.defaultOptions,i),c=xT(r),d=e instanceof Mi?e:new Mi(e),u=o,f=new Xa;f.info[0]={face:d.fontFamily,size:d.fontSize},f.common[0]={lineHeight:d.fontSize};let p=0,m=0,_,y,v,g=0;const x=[];for(let w=0;w<c.length;w++){_||(_=H.ADAPTER.createCanvas(),_.width=o,_.height=h,y=_.getContext("2d"),v=new J(_,{resolution:a,...l}),x.push(new X(v)),f.page.push({id:x.length-1,file:""}));const T=c[w],E=Zi.measureText(T,d,!1,_),A=E.width,P=Math.ceil(E.height),L=Math.ceil((d.fontStyle==="italic"?2:1)*A);if(m>=h-P*a){if(m===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${T}')`);--w,_=null,y=null,v=null,m=0,p=0,g=0;continue}if(g=Math.max(P+E.fontProperties.descent,g),L*a+p>=u){if(p===0)throw new Error(`[BitmapFont] textureWidth ${o}px is too small (fontFamily: '${d.fontFamily}', fontSize: ${d.fontSize}px, char: '${T}')`);--w,m+=g*a,m=Math.ceil(m),p=0,g=0;continue}yT(_,y,E,p,m,a,d);const M=za(E.text);f.char.push({id:M,page:x.length-1,x:p/a,y:m/a,width:L,height:P,xoffset:0,yoffset:0,xadvance:A-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0)}),p+=(L+2*n)*a,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let w=0,T=c.length;w<T;w++){const E=c[w];for(let A=0;A<T;A++){const P=c[A],L=y.measureText(E).width,M=y.measureText(P).width,S=y.measureText(E+P).width-(L+M);S&&f.kerning.push({first:za(E),second:za(P),amount:S})}}const b=new bi(f,x,!0);return bi.available[t]!==void 0&&bi.uninstall(t),bi.available[t]=b,b}};Qi.ALPHA=[["a","z"],["A","Z"]," "],Qi.NUMERIC=[["0","9"]],Qi.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Qi.ASCII=[[" ","~"]],Qi.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Qi.ALPHANUMERIC},Qi.available={};let Ji=Qi;var vT=`// Pixi texture info\r
|
|
1084
1084
|
varying vec2 vTextureCoord;\r
|
|
1085
1085
|
uniform sampler2D uSampler;\r
|
|
1086
1086
|
\r
|
|
@@ -1118,7 +1118,7 @@ void main(void) {\r
|
|
|
1118
1118
|
// NPM Textures, NPM outputs\r
|
|
1119
1119
|
gl_FragColor = vec4(uColor.rgb, coverage);\r
|
|
1120
1120
|
}\r
|
|
1121
|
-
`,
|
|
1121
|
+
`,bT=`// Mesh material default fragment\r
|
|
1122
1122
|
attribute vec2 aVertexPosition;\r
|
|
1123
1123
|
attribute vec2 aTextureCoord;\r
|
|
1124
1124
|
\r
|
|
@@ -1134,17 +1134,17 @@ void main(void)\r
|
|
|
1134
1134
|
\r
|
|
1135
1135
|
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
|
|
1136
1136
|
}\r
|
|
1137
|
-
`;const
|
|
1138
|
-
`)||" ",l=
|
|
1139
|
-
`){a.push(f),o.push(-1),p=Math.max(p,f),++m,++v,r.x=0,r.y+=t.lineHeight,u=null,x=0;continue}const R=t.chars[C];if(!R)continue;u&&R.kerning[u]&&(r.x+=R.kerning[u]);const N=
|
|
1140
|
-
`&&(/(?:\s)/.test(b)&&(f=y),a.push(f),p=Math.max(p,f),o.push(-1));const w=[];for(let M=0;M<=m;M++){let S=0;this._align==="right"?S=p-a[M]:this._align==="center"?S=(p-a[M])/2:this._align==="justify"&&(S=o[M]<0?0:(p-a[M])/o[M]),w.push(S)}const T=n.length,E={},A=[],P=this._activePagesMeshData;d.push(...P);for(let M=0;M<T;M++){const S=n[M].texture,C=S.baseTexture.uid;if(!E[C]){let R=d.pop();if(!R){const F=new
|
|
1137
|
+
`;const Rp=[],Ip=[],Mp=[],Dp=class C_ extends bt{constructor(t,e={}){super();const{align:i,tint:r,maxWidth:n,letterSpacing:a,fontName:o,fontSize:h}=Object.assign({},C_.styleDefaults,e);if(!Ji.available[o])throw new Error(`Missing BitmapFont "${o}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new pt(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 ai(()=>{this.dirty=!0},this,0,0),this._roundPixels=H.ROUND_PIXELS,this.dirty=!0,this._resolution=H.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var L;const t=Ji.available[this._fontName],e=this.fontSize,i=e/t.size,r=new tt,n=[],a=[],o=[],h=this._text.replace(/(?:\r\n|\r)/g,`
|
|
1138
|
+
`)||" ",l=Pp(h),c=this._maxWidth*t.size/e,d=t.distanceFieldType==="none"?Rp:Ip;let u=null,f=0,p=0,m=0,_=-1,y=0,v=0,g=0,x=0;for(let M=0;M<l.length;M++){const S=l[M],C=za(S);if(/(?:\s)/.test(S)&&(_=M,y=f,x++),S==="\r"||S===`
|
|
1139
|
+
`){a.push(f),o.push(-1),p=Math.max(p,f),++m,++v,r.x=0,r.y+=t.lineHeight,u=null,x=0;continue}const R=t.chars[C];if(!R)continue;u&&R.kerning[u]&&(r.x+=R.kerning[u]);const N=Mp.pop()||{texture:X.EMPTY,line:0,charCode:0,prevSpaces:0,position:new tt};N.texture=R.texture,N.line=m,N.charCode=C,N.position.x=Math.round(r.x+R.xOffset+this._letterSpacing/2),N.position.y=Math.round(r.y+R.yOffset),N.prevSpaces=x,n.push(N),f=N.position.x+Math.max(R.xAdvance-R.xOffset,R.texture.orig.width),r.x+=R.xAdvance+this._letterSpacing,g=Math.max(g,R.yOffset+R.texture.height),u=C,_!==-1&&c>0&&r.x>c&&(++v,ir(n,1+_-v,1+M-_),M=_,_=-1,a.push(y),o.push(n.length>0?n[n.length-1].prevSpaces:0),p=Math.max(p,y),m++,r.x=0,r.y+=t.lineHeight,u=null,x=0)}const b=l[l.length-1];b!=="\r"&&b!==`
|
|
1140
|
+
`&&(/(?:\s)/.test(b)&&(f=y),a.push(f),p=Math.max(p,f),o.push(-1));const w=[];for(let M=0;M<=m;M++){let S=0;this._align==="right"?S=p-a[M]:this._align==="center"?S=(p-a[M])/2:this._align==="justify"&&(S=o[M]<0?0:(p-a[M])/o[M]),w.push(S)}const T=n.length,E={},A=[],P=this._activePagesMeshData;d.push(...P);for(let M=0;M<T;M++){const S=n[M].texture,C=S.baseTexture.uid;if(!E[C]){let R=d.pop();if(!R){const F=new fl;let B,W;t.distanceFieldType==="none"?(B=new Na(X.EMPTY),W=K.NORMAL):(B=new Na(X.EMPTY,{program:Ri.from(bT,vT),uniforms:{uFWidth:0}}),W=K.NORMAL_NPM);const I=new ka(F,B);I.blendMode=W,R={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:I,vertices:null,uvs:null,indices:null}}R.index=0,R.indexCount=0,R.vertexCount=0,R.uvsCount=0,R.total=0;const{_textureCache:N}=this;N[C]=N[C]||new X(S.baseTexture),R.mesh.texture=N[C],R.mesh.tint=this._tintColor.value,A.push(R),E[C]=R}E[C].total++}for(let M=0;M<P.length;M++)A.includes(P[M])||this.removeChild(P[M].mesh);for(let M=0;M<A.length;M++)A[M].mesh.parent!==this&&this.addChild(A[M].mesh);this._activePagesMeshData=A;for(const M in E){const S=E[M],C=S.total;if(!(((L=S.indices)==null?void 0:L.length)>6*C)||S.vertices.length<ka.BATCHABLE_SIZE*2)S.vertices=new Float32Array(4*2*C),S.uvs=new Float32Array(4*2*C),S.indices=new Uint16Array(6*C);else{const R=S.total,N=S.vertices;for(let F=R*4*2;F<N.length;F++)N[F]=0}S.mesh.size=6*C}for(let M=0;M<T;M++){const S=n[M];let C=S.position.x+w[S.line]*(this._align==="justify"?S.prevSpaces:1);this._roundPixels&&(C=Math.round(C));const R=C*i,N=S.position.y*i,F=S.texture,B=E[F.baseTexture.uid],W=F.frame,I=F._uvs,D=B.index++;B.indices[D*6+0]=0+D*4,B.indices[D*6+1]=1+D*4,B.indices[D*6+2]=2+D*4,B.indices[D*6+3]=0+D*4,B.indices[D*6+4]=2+D*4,B.indices[D*6+5]=3+D*4,B.vertices[D*8+0]=R,B.vertices[D*8+1]=N,B.vertices[D*8+2]=R+W.width*i,B.vertices[D*8+3]=N,B.vertices[D*8+4]=R+W.width*i,B.vertices[D*8+5]=N+W.height*i,B.vertices[D*8+6]=R,B.vertices[D*8+7]=N+W.height*i,B.uvs[D*8+0]=I.x0,B.uvs[D*8+1]=I.y0,B.uvs[D*8+2]=I.x1,B.uvs[D*8+3]=I.y1,B.uvs[D*8+4]=I.x2,B.uvs[D*8+5]=I.y2,B.uvs[D*8+6]=I.x3,B.uvs[D*8+7]=I.y3}this._textWidth=p*i,this._textHeight=(r.y+t.lineHeight)*i;for(const M in E){const S=E[M];if(this.anchor.x!==0||this.anchor.y!==0){let F=0;const B=this._textWidth*this.anchor.x,W=this._textHeight*this.anchor.y;for(let I=0;I<S.total;I++)S.vertices[F++]-=B,S.vertices[F++]-=W,S.vertices[F++]-=B,S.vertices[F++]-=W,S.vertices[F++]-=B,S.vertices[F++]-=W,S.vertices[F++]-=B,S.vertices[F++]-=W}this._maxLineHeight=g*i;const C=S.mesh.geometry.getBuffer("aVertexPosition"),R=S.mesh.geometry.getBuffer("aTextureCoord"),N=S.mesh.geometry.getIndex();C.data=S.vertices,R.data=S.uvs,N.data=S.indices,C.update(),R.update(),N.update()}for(let M=0;M<n.length;M++)Mp.push(n[M]);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:i,size:r}=Ji.available[this._fontName];if(i!=="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),d=(Math.abs(l)+Math.abs(c))/2,u=this.fontSize/r,f=t._view.resolution;for(const p of this._activePagesMeshData)p.mesh.shader.uniforms.uFWidth=d*e*u*f}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=Ji.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(!Ji.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){return this._fontSize??Ji.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,i=Ji.available[this._fontName].distanceFieldType==="none"?Rp:Ip;i.push(...this._activePagesMeshData);for(const r of this._activePagesMeshData)this.removeChild(r.mesh);this._activePagesMeshData=[],i.filter(r=>e[r.mesh.texture.baseTexture.uid]).forEach(r=>{r.mesh.texture=X.EMPTY});for(const r in e)e[r].destroy(),delete e[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};Dp.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};let TT=Dp;const wT=[".xml",".fnt"],ET={extension:{type:G.LoadParser,priority:Re.Normal},name:"loadBitmapFont",test(s){return wT.includes(Ft.extname(s).toLowerCase())},async testParse(s){return $a.test(s)||yl.test(s)},async parse(s,t,e){const i=$a.test(s)?$a.parse(s):yl.parse(s),{src:r}=t,{page:n}=i,a=[];for(let l=0;l<n.length;++l){const c=n[l].file;let d=Ft.join(Ft.dirname(r),c);d=tl(d,r),a.push(d)}const o=await e.load(a),h=a.map(l=>o[l]);return Ji.install(i,h,!0)},async load(s,t){return(await H.ADAPTER.fetch(s)).text()},unload(s){s.destroy()}};z.add(ET);const vl=class Lr extends Mi{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new Lr(Object.keys(Lr.defaultOptions).reduce((e,i)=>({...e,[i]:t[i]}),{}))}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 Lr.availableFonts[t.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:i}=Lr;if(i[t]){const r=i[t];return this._fonts.push(r),r.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return H.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:Ft.basename(t,Ft.extname(t)),weight:"normal",style:"normal",display:"auto",src:r,dataSrc:n,refs:1,originalUrl:t,fontFace:null},e);i[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(i=>!this._overrides.includes(i));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(i=>this._overrides.includes(i));e.length>0&&(this._overrides=this._overrides.filter(i=>!e.includes(i)),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}
|
|
1141
1141
|
@font-face {
|
|
1142
1142
|
font-family: "${e.family}";
|
|
1143
1143
|
src: url('${e.dataSrc}');
|
|
1144
1144
|
font-weight: ${e.weight};
|
|
1145
1145
|
font-style: ${e.style};
|
|
1146
1146
|
font-display: ${e.display};
|
|
1147
|
-
}`,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=
|
|
1147
|
+
}`,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=Qr(t)),typeof t=="number"?cx(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=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=`${i}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,Lr.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}=H.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}};vl.availableFonts={},vl.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 bl=vl;const Ya=class kr extends _e{constructor(t="",e={}){super(X.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,r=X.from(i,{scaleMode:H.SCALE_MODE,resourceOptions:{autoLoad:!1}});r.orig=new st,r.trim=new st,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=kr.defaultMaxWidth,this.maxHeight=kr.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=o,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=kr.defaultAutoResolution,this._resolution=kr.defaultResolution??H.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,d;const{text:e,style:i,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(r)}),this._styleElement.textContent=i.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),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(r)}),this._styleElement.textContent=(d=this._style)==null?void 0:d.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_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();i.width=r.width=Math.ceil(Math.max(1,n)),i.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(),i.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:i,resolution:r}=this,{padding:n}=t,{baseTexture:a}=e;e.trim.width=e._frame.width=i.width/r,e.trim.height=e._frame.height=i.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(i.width,i.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 i,r,n,a,o;typeof t=="boolean"&&(t={children:t}),t=Object.assign({},kr.defaultDestroyOptions,t),super.destroy(t);const e=null;this.ownsStyle&&((i=this._style)==null||i.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=Vi(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=Vi(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 bl?(this.ownsStyle=!1,this._style=t):t instanceof Mi?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=bl.from(t)):(this.ownsStyle=!0,this._style=new bl(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," ")}};Ya.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Ya.defaultMaxWidth=2024,Ya.defaultMaxHeight=2024,Ya.defaultAutoResolution=!0;class AT{constructor(t,e){this._fontName=t,this._defaultFontSize=e}createText(t,e){return new TT(t.toString(),{fontName:this._fontName,fontSize:this._defaultFontSize||e})}}function Di(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Bp(s,t){s.prototype=Object.create(t.prototype),s.prototype.constructor=s,s.__proto__=t}/*!
|
|
1148
1148
|
* GSAP 3.12.5
|
|
1149
1149
|
* https://gsap.com
|
|
1150
1150
|
*
|
|
@@ -1152,7 +1152,7 @@ void main(void)\r
|
|
|
1152
1152
|
* Subject to the terms at https://gsap.com/standard-license or for
|
|
1153
1153
|
* Club GSAP members, the agreement issued with that membership.
|
|
1154
1154
|
* @author: Jack Doyle, jack@greensock.com
|
|
1155
|
-
*/var _e={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},fr={duration:.5,overwrite:!1,delay:0},_l,te,bt,Ie=1e8,_t=1/Ie,yl=Math.PI*2,fT=yl/4,pT=0,Cp=Math.sqrt,mT=Math.cos,gT=Math.sin,jt=function(t){return typeof t=="string"},Ft=function(t){return typeof t=="function"},Di=function(t){return typeof t=="number"},xl=function(t){return typeof t>"u"},ci=function(t){return typeof t=="object"},le=function(t){return t!==!1},vl=function(){return typeof window<"u"},$a=function(t){return Ft(t)||jt(t)},Pp=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ee=Array.isArray,bl=/(?:-?\.?\d|\.)+/gi,Rp=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,pr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Tl=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ip=/[+-]=-?[.\d]+/,Mp=/[^,'"\[\]\s]+/gi,_T=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ct,ui,wl,El,ye={},Ya={},Dp,Bp=function(t){return(Ya=Ps(t,ye))&&de},Al=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},on=function(t,e){return!e&&console.warn(t)},Op=function(t,e){return t&&(ye[t]=e)&&Ya&&(Ya[t]=e)||ye},hn=function(){return 0},yT={suppressEvents:!0,isStart:!0,kill:!1},ja={suppressEvents:!0,kill:!1},xT={suppressEvents:!0},Sl={},Ji=[],Cl={},Fp,xe={},Pl={},Lp=30,qa=[],Rl="",Il=function(t){var e=t[0],i,r;if(ci(e)||Ft(e)||(t=[t]),!(i=(e._gsap||{}).harness)){for(r=qa.length;r--&&!qa[r].targetTest(e););i=qa[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new um(t[r],i)))||t.splice(r,1);return t},Cs=function(t){return t._gsap||Il(Be(t))[0]._gsap},kp=function(t,e,i){return(i=t[e])&&Ft(i)?t[e]():xl(i)&&t.getAttribute&&t.getAttribute(e)||i},ce=function(t,e){return(t=t.split(",")).forEach(e)||t},Nt=function(t){return Math.round(t*1e5)/1e5||0},qt=function(t){return Math.round(t*1e7)/1e7||0},mr=function(t,e){var i=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),i==="+"?t+r:i==="-"?t-r:i==="*"?t*r:t/r},vT=function(t,e){for(var i=e.length,r=0;t.indexOf(e[r])<0&&++r<i;);return r<i},Ka=function(){var t=Ji.length,e=Ji.slice(0),i,r;for(Cl={},Ji.length=0,i=0;i<t;i++)r=e[i],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},Np=function(t,e,i,r){Ji.length&&!te&&Ka(),t.render(e,i,r||te&&e<0&&(t._initted||t._startAt)),Ji.length&&!te&&Ka()},Up=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Mp).length<2?e:jt(t)?t.trim():t},Gp=function(t){return t},Me=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},bT=function(t){return function(e,i){for(var r in i)r in e||r==="duration"&&t||r==="ease"||(e[r]=i[r])}},Ps=function(t,e){for(var i in e)t[i]=e[i];return t},Hp=function s(t,e){for(var i in e)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(t[i]=ci(e[i])?s(t[i]||(t[i]={}),e[i]):e[i]);return t},Za=function(t,e){var i={},r;for(r in t)r in e||(i[r]=t[r]);return i},ln=function(t){var e=t.parent||Ct,i=t.keyframes?bT(ee(t.keyframes)):Me;if(le(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},TT=function(t,e){for(var i=t.length,r=i===e.length;r&&i--&&t[i]===e[i];);return i<0},Vp=function(t,e,i,r,n){i===void 0&&(i="_first"),r===void 0&&(r="_last");var a=t[r],o;if(n)for(o=e[n];a&&a[n]>o;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[r]=e,e._prev=a,e.parent=e._dp=t,e},Qa=function(t,e,i,r){i===void 0&&(i="_first"),r===void 0&&(r="_last");var n=e._prev,a=e._next;n?n._next=a:t[i]===e&&(t[i]=a),a?a._prev=n:t[r]===e&&(t[r]=n),e._next=e._prev=e.parent=null},ts=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Rs=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},wT=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Ml=function(t,e,i,r){return t._startAt&&(te?t._startAt.revert(ja):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},ET=function s(t){return!t||t._ts&&s(t.parent)},Wp=function(t){return t._repeat?gr(t._tTime,t=t.duration()+t._rDelay)*t:0},gr=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},Ja=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},to=function(t){return t._end=qt(t._start+(t._tDur/Math.abs(t._ts||t._rts||_t)||0))},eo=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=qt(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),to(t),i._dirty||Rs(i,t)),t},Xp=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=Ja(t.rawTime(),e),(!e._dur||un(0,e.totalDuration(),i)-e._tTime>_t)&&e.render(i,!0)),Rs(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-_t}},di=function(t,e,i,r){return e.parent&&ts(e),e._start=qt((Di(i)?i:i||t!==Ct?De(t,i,e):t._time)+e._delay),e._end=qt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Vp(t,e,"_first","_last",t._sort?"_start":0),Dl(e)||(t._recent=e),r||Xp(t,e),t._ts<0&&eo(t,t._tTime),t},zp=function(t,e){return(ye.ScrollTrigger||Al("scrollTrigger",e))&&ye.ScrollTrigger.create(e,t)},$p=function(t,e,i,r,n){if(Hl(t,e,n),!t._initted)return 1;if(!i&&t._pt&&!te&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Fp!==be.frame)return Ji.push(t),t._lazy=[n,r],1},AT=function s(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||s(e))},Dl=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},ST=function(t,e,i,r){var n=t.ratio,a=e<0||!e&&(!t._start&&AT(t)&&!(!t._initted&&Dl(t))||(t._ts<0||t._dp._ts<0)&&!Dl(t))?0:1,o=t._rDelay,h=0,l,c,d;if(o&&t._repeat&&(h=un(0,t._tDur,e),c=gr(h,o),t._yoyo&&c&1&&(a=1-a),c!==gr(t._tTime,o)&&(n=1-a,t.vars.repeatRefresh&&t._initted&&t.invalidate())),a!==n||te||r||t._zTime===_t||!e&&t._zTime){if(!t._initted&&$p(t,e,r,i,h))return;for(d=t._zTime,t._zTime=e||(i?_t:0),i||(i=e&&!d),t.ratio=a,t._from&&(a=1-a),t._time=0,t._tTime=h,l=t._pt;l;)l.r(a,l.d),l=l._next;e<0&&Ml(t,e,i,!0),t._onUpdate&&!i&&ve(t,"onUpdate"),h&&t._repeat&&!i&&t.parent&&ve(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===a&&(a&&ts(t,1),!i&&!te&&(ve(t,a?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},CT=function(t,e,i){var r;if(i>e)for(r=t._first;r&&r._start<=i;){if(r.data==="isPause"&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=i;){if(r.data==="isPause"&&r._start<e)return r;r=r._prev}},_r=function(t,e,i,r){var n=t._repeat,a=qt(e)||0,o=t._tTime/t._tDur;return o&&!r&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:qt(a*(n+1)+t._rDelay*n):a,o>0&&!r&&eo(t,t._tTime=t._tDur*o),t.parent&&to(t),i||Rs(t.parent,t),t},Yp=function(t){return t instanceof ne?Rs(t):_r(t,t._dur)},PT={_start:0,endTime:hn,totalDuration:hn},De=function s(t,e,i){var r=t.labels,n=t._recent||PT,a=t.duration()>=Ie?n.endTime(!1):t._dur,o,h,l;return jt(e)&&(isNaN(e)||e in r)?(h=e.charAt(0),l=e.substr(-1)==="%",o=e.indexOf("="),h==="<"||h===">"?(o>=0&&(e=e.replace(/=/,"")),(h==="<"?n._start:n.endTime(n._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(o<0?n:i).totalDuration()/100:1)):o<0?(e in r||(r[e]=a),r[e]):(h=parseFloat(e.charAt(o-1)+e.substr(o+1)),l&&i&&(h=h/100*(ee(i)?i[0]:i).totalDuration()),o>1?s(t,e.substr(0,o-1),i)+h:a+h)):e==null?a:+e},cn=function(t,e,i){var r=Di(e[1]),n=(r?2:1)+(t<2?0:1),a=e[n],o,h;if(r&&(a.duration=e[1]),a.parent=i,t){for(o=a,h=i;h&&!("immediateRender"in o);)o=h.vars.defaults||{},h=le(h.vars.inherit)&&h.parent;a.immediateRender=le(o.immediateRender),t<2?a.runBackwards=1:a.startAt=e[n-1]}return new Ht(e[0],a,e[n+1])},es=function(t,e){return t||t===0?e(t):e},un=function(t,e,i){return i<t?t:i>e?e:i},ie=function(t,e){return!jt(t)||!(e=_T.exec(t))?"":e[1]},RT=function(t,e,i){return es(i,function(r){return un(t,e,r)})},Bl=[].slice,jp=function(t,e){return t&&ci(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&ci(t[0]))&&!t.nodeType&&t!==ui},IT=function(t,e,i){return i===void 0&&(i=[]),t.forEach(function(r){var n;return jt(r)&&!e||jp(r,1)?(n=i).push.apply(n,Be(r)):i.push(r)})||i},Be=function(t,e,i){return bt&&!e&&bt.selector?bt.selector(t):jt(t)&&!i&&(wl||!xr())?Bl.call((e||El).querySelectorAll(t),0):ee(t)?IT(t,i):jp(t)?Bl.call(t,0):t?[t]:[]},Ol=function(t){return t=Be(t)[0]||on("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return Be(e,i.querySelectorAll?i:i===t?on("Invalid scope")||El.createElement("div"):t)}},qp=function(t){return t.sort(function(){return .5-Math.random()})},Kp=function(t){if(Ft(t))return t;var e=ci(t)?t:{each:t},i=Is(e.ease),r=e.from||0,n=parseFloat(e.base)||0,a={},o=r>0&&r<1,h=isNaN(r)||o,l=e.axis,c=r,d=r;return jt(r)?c=d={center:.5,edges:.5,end:1}[r]||0:!o&&h&&(c=r[0],d=r[1]),function(u,f,p){var m=(p||e).length,g=a[m],y,v,_,x,b,w,T,E,A;if(!g){if(A=e.grid==="auto"?0:(e.grid||[1,Ie])[1],!A){for(T=-Ie;T<(T=p[A++].getBoundingClientRect().left)&&A<m;);A<m&&A--}for(g=a[m]=[],y=h?Math.min(A,m)*c-.5:r%A,v=A===Ie?0:h?m*d/A-.5:r/A|0,T=0,E=Ie,w=0;w<m;w++)_=w%A-y,x=v-(w/A|0),g[w]=b=l?Math.abs(l==="y"?x:_):Cp(_*_+x*x),b>T&&(T=b),b<E&&(E=b);r==="random"&&qp(g),g.max=T-E,g.min=E,g.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(A>m?m-1:l?l==="y"?m/A:A:Math.max(A,m/A))||0)*(r==="edges"?-1:1),g.b=m<0?n-m:n,g.u=ie(e.amount||e.each)||0,i=i&&m<0?hm(i):i}return m=(g[u]-g.min)/g.max||0,qt(g.b+(i?i(m):m)*g.v)+g.u}},Fl=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var r=qt(Math.round(parseFloat(i)/t)*t*e);return(r-r%1)/e+(Di(i)?0:ie(i))}},Zp=function(t,e){var i=ee(t),r,n;return!i&&ci(t)&&(r=i=t.radius||Ie,t.values?(t=Be(t.values),(n=!Di(t[0]))&&(r*=r)):t=Fl(t.increment)),es(e,i?Ft(t)?function(a){return n=t(a),Math.abs(n-a)<=r?n:a}:function(a){for(var o=parseFloat(n?a.x:a),h=parseFloat(n?a.y:0),l=Ie,c=0,d=t.length,u,f;d--;)n?(u=t[d].x-o,f=t[d].y-h,u=u*u+f*f):u=Math.abs(t[d]-o),u<l&&(l=u,c=d);return c=!r||l<=r?t[c]:a,n||c===a||Di(a)?c:c+ie(a)}:Fl(t))},Qp=function(t,e,i,r){return es(ee(t)?!e:i===!0?!!(i=0):!r,function(){return ee(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(r=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+i*.99))/i)*i*r)/r})},MT=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(r){return e.reduce(function(n,a){return a(n)},r)}},DT=function(t,e){return function(i){return t(parseFloat(i))+(e||ie(i))}},BT=function(t,e,i){return tm(t,e,0,1,i)},Jp=function(t,e,i){return es(i,function(r){return t[~~e(r)]})},OT=function s(t,e,i){var r=e-t;return ee(t)?Jp(t,s(0,t.length),e):es(i,function(n){return(r+(n-t)%r)%r+t})},FT=function s(t,e,i){var r=e-t,n=r*2;return ee(t)?Jp(t,s(0,t.length-1),e):es(i,function(a){return a=(n+(a-t)%n)%n||0,t+(a>r?n-a:a)})},dn=function(t){for(var e=0,i="",r,n,a,o;~(r=t.indexOf("random(",e));)a=t.indexOf(")",r),o=t.charAt(r+7)==="[",n=t.substr(r+7,a-r-7).match(o?Mp:bl),i+=t.substr(e,r-e)+Qp(o?n:+n[0],o?0:+n[1],+n[2]||1e-5),e=a+1;return i+t.substr(e,t.length-e)},tm=function(t,e,i,r,n){var a=e-t,o=r-i;return es(n,function(h){return i+((h-t)/a*o||0)})},LT=function s(t,e,i,r){var n=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!n){var a=jt(t),o={},h,l,c,d,u;if(i===!0&&(r=1)&&(i=null),a)t={p:t},e={p:e};else if(ee(t)&&!ee(e)){for(c=[],d=t.length,u=d-2,l=1;l<d;l++)c.push(s(t[l-1],t[l]));d--,n=function(p){p*=d;var m=Math.min(u,~~p);return c[m](p-m)},i=e}else r||(t=Ps(ee(t)?[]:{},t));if(!c){for(h in e)Ul.call(o,t,h,"get",e[h]);n=function(p){return Xl(p,o)||(a?t.p:t)}}}return es(i,n)},em=function(t,e,i){var r=t.labels,n=Ie,a,o,h;for(a in r)o=r[a]-e,o<0==!!i&&o&&n>(o=Math.abs(o))&&(h=a,n=o);return h},ve=function(t,e,i){var r=t.vars,n=r[e],a=bt,o=t._ctx,h,l,c;if(n)return h=r[e+"Params"],l=r.callbackScope||t,i&&Ji.length&&Ka(),o&&(bt=o),c=h?n.apply(l,h):n.call(l),bt=a,c},fn=function(t){return ts(t),t.scrollTrigger&&t.scrollTrigger.kill(!!te),t.progress()<1&&ve(t,"onInterrupt"),t},yr,im=[],sm=function(t){if(t)if(t=!t.name&&t.default||t,vl()||t.headless){var e=t.name,i=Ft(t),r=e&&!i&&t.init?function(){this._props=[]}:t,n={init:hn,render:Xl,add:Ul,kill:QT,modifier:ZT,rawVars:0},a={targetTest:0,get:0,getSetter:Wl,aliases:{},register:0};if(xr(),t!==r){if(xe[e])return;Me(r,Me(Za(t,n),a)),Ps(r.prototype,Ps(n,Za(t,a))),xe[r.prop=e]=r,t.targetTest&&(qa.push(r),Sl[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Op(e,r),t.register&&t.register(de,r,ue)}else im.push(t)},pt=255,pn={aqua:[0,pt,pt],lime:[0,pt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,pt],navy:[0,0,128],white:[pt,pt,pt],olive:[128,128,0],yellow:[pt,pt,0],orange:[pt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[pt,0,0],pink:[pt,192,203],cyan:[0,pt,pt],transparent:[pt,pt,pt,0]},Ll=function(t,e,i){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(i-e)*t*6:t<.5?i:t*3<2?e+(i-e)*(2/3-t)*6:e)*pt+.5|0},rm=function(t,e,i){var r=t?Di(t)?[t>>16,t>>8&pt,t&pt]:0:pn.black,n,a,o,h,l,c,d,u,f,p;if(!r){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),pn[t])r=pn[t];else if(t.charAt(0)==="#"){if(t.length<6&&(n=t.charAt(1),a=t.charAt(2),o=t.charAt(3),t="#"+n+n+a+a+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return r=parseInt(t.substr(1,6),16),[r>>16,r>>8&pt,r&pt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),r=[t>>16,t>>8&pt,t&pt]}else if(t.substr(0,3)==="hsl"){if(r=p=t.match(bl),!e)h=+r[0]%360/360,l=+r[1]/100,c=+r[2]/100,a=c<=.5?c*(l+1):c+l-c*l,n=c*2-a,r.length>3&&(r[3]*=1),r[0]=Ll(h+1/3,n,a),r[1]=Ll(h,n,a),r[2]=Ll(h-1/3,n,a);else if(~t.indexOf("="))return r=t.match(Rp),i&&r.length<4&&(r[3]=1),r}else r=t.match(bl)||pn.transparent;r=r.map(Number)}return e&&!p&&(n=r[0]/pt,a=r[1]/pt,o=r[2]/pt,d=Math.max(n,a,o),u=Math.min(n,a,o),c=(d+u)/2,d===u?h=l=0:(f=d-u,l=c>.5?f/(2-d-u):f/(d+u),h=d===n?(a-o)/f+(a<o?6:0):d===a?(o-n)/f+2:(n-a)/f+4,h*=60),r[0]=~~(h+.5),r[1]=~~(l*100+.5),r[2]=~~(c*100+.5)),i&&r.length<4&&(r[3]=1),r},nm=function(t){var e=[],i=[],r=-1;return t.split(is).forEach(function(n){var a=n.match(pr)||[];e.push.apply(e,a),i.push(r+=a.length+1)}),e.c=i,e},am=function(t,e,i){var r="",n=(t+r).match(is),a=e?"hsla(":"rgba(",o=0,h,l,c,d;if(!n)return t;if(n=n.map(function(u){return(u=rm(u,e,1))&&a+(e?u[0]+","+u[1]+"%,"+u[2]+"%,"+u[3]:u.join(","))+")"}),i&&(c=nm(t),h=i.c,h.join(r)!==c.c.join(r)))for(l=t.replace(is,"1").split(pr),d=l.length-1;o<d;o++)r+=l[o]+(~h.indexOf(o)?n.shift()||a+"0,0,0,0)":(c.length?c:n.length?n:i).shift());if(!l)for(l=t.split(is),d=l.length-1;o<d;o++)r+=l[o]+n[o];return r+l[d]},is=function(){var s="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in pn)s+="|"+t+"\\b";return new RegExp(s+")","gi")}(),kT=/hsl[a]?\(/,om=function(t){var e=t.join(" "),i;if(is.lastIndex=0,is.test(e))return i=kT.test(e),t[1]=am(t[1],i),t[0]=am(t[0],i,nm(t[1])),!0},mn,be=function(){var s=Date.now,t=500,e=33,i=s(),r=i,n=1e3/240,a=n,o=[],h,l,c,d,u,f,p=function m(g){var y=s()-r,v=g===!0,_,x,b,w;if((y>t||y<0)&&(i+=y-e),r+=y,b=r-i,_=b-a,(_>0||v)&&(w=++d.frame,u=b-d.time*1e3,d.time=b=b/1e3,a+=_+(_>=n?4:n-_),x=1),v||(h=l(m)),x)for(f=0;f<o.length;f++)o[f](b,u,w,g)};return d={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(g){return u/(1e3/(g||60))},wake:function(){Dp&&(!wl&&vl()&&(ui=wl=window,El=ui.document||{},ye.gsap=de,(ui.gsapVersions||(ui.gsapVersions=[])).push(de.version),Bp(Ya||ui.GreenSockGlobals||!ui.gsap&&ui||{}),im.forEach(sm)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&d.sleep(),l=c||function(g){return setTimeout(g,a-d.time*1e3+1|0)},mn=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),mn=0,l=hn},lagSmoothing:function(g,y){t=g||1/0,e=Math.min(y||33,t)},fps:function(g){n=1e3/(g||240),a=d.time*1e3+n},add:function(g,y,v){var _=y?function(x,b,w,T){g(x,b,w,T),d.remove(_)}:g;return d.remove(g),o[v?"unshift":"push"](_),xr(),_},remove:function(g,y){~(y=o.indexOf(g))&&o.splice(y,1)&&f>=y&&f--},_listeners:o},d}(),xr=function(){return!mn&&be.wake()},at={},NT=/^[\d.\-M][\d.\-,\s]/,UT=/["']/g,GT=function(t){for(var e={},i=t.substr(1,t.length-3).split(":"),r=i[0],n=1,a=i.length,o,h,l;n<a;n++)h=i[n],o=n!==a-1?h.lastIndexOf(","):h.length,l=h.substr(0,o),e[r]=isNaN(l)?l.replace(UT,"").trim():+l,r=h.substr(o+1).trim();return e},HT=function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),r=t.indexOf("(",e);return t.substring(e,~r&&r<i?t.indexOf(")",i+1):i)},VT=function(t){var e=(t+"").split("("),i=at[e[0]];return i&&e.length>1&&i.config?i.config.apply(null,~t.indexOf("{")?[GT(e[1])]:HT(t).split(",").map(Up)):at._CE&&NT.test(t)?at._CE("",t):i},hm=function(t){return function(e){return 1-t(1-e)}},lm=function s(t,e){for(var i=t._first,r;i;)i instanceof ne?s(i,e):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==e&&(i.timeline?s(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next},Is=function(t,e){return t&&(Ft(t)?t:at[t]||VT(t))||e},Ms=function(t,e,i,r){i===void 0&&(i=function(h){return 1-e(1-h)}),r===void 0&&(r=function(h){return h<.5?e(h*2)/2:1-e((1-h)*2)/2});var n={easeIn:e,easeOut:i,easeInOut:r},a;return ce(t,function(o){at[o]=ye[o]=n,at[a=o.toLowerCase()]=i;for(var h in n)at[a+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=at[o+"."+h]=n[h]}),n},cm=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},kl=function s(t,e,i){var r=e>=1?e:1,n=(i||(t?.3:.45))/(e<1?e:1),a=n/yl*(Math.asin(1/r)||0),o=function(c){return c===1?1:r*Math.pow(2,-10*c)*gT((c-a)*n)+1},h=t==="out"?o:t==="in"?function(l){return 1-o(1-l)}:cm(o);return n=yl/n,h.config=function(l,c){return s(t,l,c)},h},Nl=function s(t,e){e===void 0&&(e=1.70158);var i=function(a){return a?--a*a*((e+1)*a+e)+1:0},r=t==="out"?i:t==="in"?function(n){return 1-i(1-n)}:cm(i);return r.config=function(n){return s(t,n)},r};ce("Linear,Quad,Cubic,Quart,Quint,Strong",function(s,t){var e=t<5?t+1:t;Ms(s+",Power"+(e-1),t?function(i){return Math.pow(i,e)}:function(i){return i},function(i){return 1-Math.pow(1-i,e)},function(i){return i<.5?Math.pow(i*2,e)/2:1-Math.pow((1-i)*2,e)/2})}),at.Linear.easeNone=at.none=at.Linear.easeIn,Ms("Elastic",kl("in"),kl("out"),kl()),function(s,t){var e=1/t,i=2*e,r=2.5*e,n=function(o){return o<e?s*o*o:o<i?s*Math.pow(o-1.5/t,2)+.75:o<r?s*(o-=2.25/t)*o+.9375:s*Math.pow(o-2.625/t,2)+.984375};Ms("Bounce",function(a){return 1-n(1-a)},n)}(7.5625,2.75),Ms("Expo",function(s){return s?Math.pow(2,10*(s-1)):0}),Ms("Circ",function(s){return-(Cp(1-s*s)-1)}),Ms("Sine",function(s){return s===1?1:-mT(s*fT)+1}),Ms("Back",Nl("in"),Nl("out"),Nl()),at.SteppedEase=at.steps=ye.SteppedEase={config:function(t,e){t===void 0&&(t=1);var i=1/t,r=t+(e?0:1),n=e?1:0,a=1-_t;return function(o){return((r*un(0,a,o)|0)+n)*i}}},fr.ease=at["quad.out"],ce("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(s){return Rl+=s+","+s+"Params,"});var um=function(t,e){this.id=pT++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:kp,this.set=e?e.getSetter:Wl},gn=function(){function s(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,_r(this,+e.duration,1,1),this.data=e.data,bt&&(this._ctx=bt,bt.data.push(this)),mn||be.wake()}var t=s.prototype;return t.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},t.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},t.totalDuration=function(i){return arguments.length?(this._dirty=0,_r(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(i,r){if(xr(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(eo(this,i),!n._dp||n.parent||Xp(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&di(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===_t||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),Np(this,i,r)),this},t.time=function(i,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+Wp(this))%(this._dur+this._rDelay)||(i?this._dur:0),r):this._time},t.totalProgress=function(i,r){return arguments.length?this.totalTime(this.totalDuration()*i,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(i,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+Wp(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(i,r){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*n,r):this._repeat?gr(this._tTime,n)+1:1},t.timeScale=function(i,r){if(!arguments.length)return this._rts===-_t?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?Ja(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-_t?0:this._rts,this.totalTime(un(-Math.abs(this._delay),this._tDur,n),r!==!1),to(this),wT(this)},t.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(xr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==_t&&(this._tTime-=_t)))),this):this._ps},t.startTime=function(i){if(arguments.length){this._start=i;var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&di(r,this,i-this._delay),this}return this._start},t.endTime=function(i){return this._start+(le(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(i){var r=this.parent||this._dp;return r?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ja(r.rawTime(i),this):this._tTime:this._tTime},t.revert=function(i){i===void 0&&(i=xT);var r=te;return te=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),te=r,this},t.globalTime=function(i){for(var r=this,n=arguments.length?i:r.rawTime();r;)n=r._start+n/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(i):n},t.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,Yp(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(i){if(arguments.length){var r=this._time;return this._rDelay=i,Yp(this),r?this.time(r):this}return this._rDelay},t.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},t.seek=function(i,r){return this.totalTime(De(this,i),le(r))},t.restart=function(i,r){return this.play().totalTime(i?-this._delay:0,le(r))},t.play=function(i,r){return i!=null&&this.seek(i,r),this.reversed(!1).paused(!1)},t.reverse=function(i,r){return i!=null&&this.seek(i||this.totalDuration(),r),this.reversed(!0).paused(!1)},t.pause=function(i,r){return i!=null&&this.seek(i,r),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-_t:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-_t,this},t.isActive=function(){var i=this.parent||this._dp,r=this._start,n;return!!(!i||this._ts&&this._initted&&i.isActive()&&(n=i.rawTime(!0))>=r&&n<this.endTime(!0)-_t)},t.eventCallback=function(i,r,n){var a=this.vars;return arguments.length>1?(r?(a[i]=r,n&&(a[i+"Params"]=n),i==="onUpdate"&&(this._onUpdate=r)):delete a[i],this):a[i]},t.then=function(i){var r=this;return new Promise(function(n){var a=Ft(i)?i:Gp,o=function(){var l=r.then;r.then=null,Ft(a)&&(a=a(r))&&(a.then||a===r)&&(r.then=l),n(a),r.then=l};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?o():r._prom=o})},t.kill=function(){fn(this)},s}();Me(gn.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-_t,_prom:0,_ps:!1,_rts:1});var ne=function(s){Sp(t,s);function t(i,r){var n;return i===void 0&&(i={}),n=s.call(this,i)||this,n.labels={},n.smoothChildTiming=!!i.smoothChildTiming,n.autoRemoveChildren=!!i.autoRemoveChildren,n._sort=le(i.sortChildren),Ct&&di(i.parent||Ct,Mi(n),r),i.reversed&&n.reverse(),i.paused&&n.paused(!0),i.scrollTrigger&&zp(Mi(n),i.scrollTrigger),n}var e=t.prototype;return e.to=function(r,n,a){return cn(0,arguments,this),this},e.from=function(r,n,a){return cn(1,arguments,this),this},e.fromTo=function(r,n,a,o){return cn(2,arguments,this),this},e.set=function(r,n,a){return n.duration=0,n.parent=this,ln(n).repeatDelay||(n.repeat=0),n.immediateRender=!!n.immediateRender,new Ht(r,n,De(this,a),1),this},e.call=function(r,n,a){return di(this,Ht.delayedCall(0,r,n),a)},e.staggerTo=function(r,n,a,o,h,l,c){return a.duration=n,a.stagger=a.stagger||o,a.onComplete=l,a.onCompleteParams=c,a.parent=this,new Ht(r,a,De(this,h)),this},e.staggerFrom=function(r,n,a,o,h,l,c){return a.runBackwards=1,ln(a).immediateRender=le(a.immediateRender),this.staggerTo(r,n,a,o,h,l,c)},e.staggerFromTo=function(r,n,a,o,h,l,c,d){return o.startAt=a,ln(o).immediateRender=le(o.immediateRender),this.staggerTo(r,n,o,h,l,c,d)},e.render=function(r,n,a){var o=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=r<=0?0:qt(r),d=this._zTime<0!=r<0&&(this._initted||!l),u,f,p,m,g,y,v,_,x,b,w,T;if(this!==Ct&&c>h&&r>=0&&(c=h),c!==this._tTime||a||d){if(o!==this._time&&l&&(c+=this._time-o,r+=this._time-o),u=c,x=this._start,_=this._ts,y=!_,d&&(l||(o=this._zTime),(r||!n)&&(this._zTime=r)),this._repeat){if(w=this._yoyo,g=l+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(g*100+r,n,a);if(u=qt(c%g),c===h?(m=this._repeat,u=l):(m=~~(c/g),m&&m===c/g&&(u=l,m--),u>l&&(u=l)),b=gr(this._tTime,g),!o&&this._tTime&&b!==m&&this._tTime-b*g-this._dur<=0&&(b=m),w&&m&1&&(u=l-u,T=1),m!==b&&!this._lock){var E=w&&b&1,A=E===(w&&m&1);if(m<b&&(E=!E),o=E?0:c%l?l:c,this._lock=1,this.render(o||(T?0:qt(m*g)),n,!l)._lock=0,this._tTime=c,!n&&this.parent&&ve(this,"onRepeat"),this.vars.repeatRefresh&&!T&&(this.invalidate()._lock=1),o&&o!==this._time||y!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,A&&(this._lock=2,o=E?l:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!T&&this.invalidate()),this._lock=0,!this._ts&&!y)return this;lm(this,T)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=CT(this,qt(o),qt(u)),v&&(c-=u-(u=v._start))),this._tTime=c,this._time=u,this._act=!_,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=r,o=0),!o&&u&&!n&&!m&&(ve(this,"onStart"),this._tTime!==c))return this;if(u>=o&&r>=0)for(f=this._first;f;){if(p=f._next,(f._act||u>=f._start)&&f._ts&&v!==f){if(f.parent!==this)return this.render(r,n,a);if(f.render(f._ts>0?(u-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(u-f._start)*f._ts,n,a),u!==this._time||!this._ts&&!y){v=0,p&&(c+=this._zTime=-_t);break}}f=p}else{f=this._last;for(var P=r<0?r:u;f;){if(p=f._prev,(f._act||P<=f._end)&&f._ts&&v!==f){if(f.parent!==this)return this.render(r,n,a);if(f.render(f._ts>0?(P-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(P-f._start)*f._ts,n,a||te&&(f._initted||f._startAt)),u!==this._time||!this._ts&&!y){v=0,p&&(c+=this._zTime=P?-_t:_t);break}}f=p}}if(v&&!n&&(this.pause(),v.render(u>=o?0:-_t)._zTime=u>=o?1:-1,this._ts))return this._start=x,to(this),this.render(r,n,a);this._onUpdate&&!n&&ve(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&o)&&(x===this._start||Math.abs(_)!==Math.abs(this._ts))&&(this._lock||((r||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&ts(this,1),!n&&!(r<0&&!o)&&(c||o||!h)&&(ve(this,c===h&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(r,n){var a=this;if(Di(n)||(n=De(this,n,r)),!(r instanceof gn)){if(ee(r))return r.forEach(function(o){return a.add(o,n)}),this;if(jt(r))return this.addLabel(r,n);if(Ft(r))r=Ht.delayedCall(0,r);else return this}return this!==r?di(this,r,n):this},e.getChildren=function(r,n,a,o){r===void 0&&(r=!0),n===void 0&&(n=!0),a===void 0&&(a=!0),o===void 0&&(o=-Ie);for(var h=[],l=this._first;l;)l._start>=o&&(l instanceof Ht?n&&h.push(l):(a&&h.push(l),r&&h.push.apply(h,l.getChildren(!0,n,a)))),l=l._next;return h},e.getById=function(r){for(var n=this.getChildren(1,1,1),a=n.length;a--;)if(n[a].vars.id===r)return n[a]},e.remove=function(r){return jt(r)?this.removeLabel(r):Ft(r)?this.killTweensOf(r):(Qa(this,r),r===this._recent&&(this._recent=this._last),Rs(this))},e.totalTime=function(r,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=qt(be.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),s.prototype.totalTime.call(this,r,n),this._forcing=0,this):this._tTime},e.addLabel=function(r,n){return this.labels[r]=De(this,n),this},e.removeLabel=function(r){return delete this.labels[r],this},e.addPause=function(r,n,a){var o=Ht.delayedCall(0,n||hn,a);return o.data="isPause",this._hasPause=1,di(this,o,De(this,r))},e.removePause=function(r){var n=this._first;for(r=De(this,r);n;)n._start===r&&n.data==="isPause"&&ts(n),n=n._next},e.killTweensOf=function(r,n,a){for(var o=this.getTweensOf(r,a),h=o.length;h--;)ss!==o[h]&&o[h].kill(r,n);return this},e.getTweensOf=function(r,n){for(var a=[],o=Be(r),h=this._first,l=Di(n),c;h;)h instanceof Ht?vT(h._targets,o)&&(l?(!ss||h._initted&&h._ts)&&h.globalTime(0)<=n&&h.globalTime(h.totalDuration())>n:!n||h.isActive())&&a.push(h):(c=h.getTweensOf(o,n)).length&&a.push.apply(a,c),h=h._next;return a},e.tweenTo=function(r,n){n=n||{};var a=this,o=De(a,r),h=n,l=h.startAt,c=h.onStart,d=h.onStartParams,u=h.immediateRender,f,p=Ht.to(a,Me({ease:n.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:n.duration||Math.abs((o-(l&&"time"in l?l.time:a._time))/a.timeScale())||_t,onStart:function(){if(a.pause(),!f){var g=n.duration||Math.abs((o-(l&&"time"in l?l.time:a._time))/a.timeScale());p._dur!==g&&_r(p,g,0,1).render(p._time,!0,!0),f=1}c&&c.apply(p,d||[])}},n));return u?p.render(0):p},e.tweenFromTo=function(r,n,a){return this.tweenTo(n,Me({startAt:{time:De(this,r)}},a))},e.recent=function(){return this._recent},e.nextLabel=function(r){return r===void 0&&(r=this._time),em(this,De(this,r))},e.previousLabel=function(r){return r===void 0&&(r=this._time),em(this,De(this,r),1)},e.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+_t)},e.shiftChildren=function(r,n,a){a===void 0&&(a=0);for(var o=this._first,h=this.labels,l;o;)o._start>=a&&(o._start+=r,o._end+=r),o=o._next;if(n)for(l in h)h[l]>=a&&(h[l]+=r);return Rs(this)},e.invalidate=function(r){var n=this._first;for(this._lock=0;n;)n.invalidate(r),n=n._next;return s.prototype.invalidate.call(this,r)},e.clear=function(r){r===void 0&&(r=!0);for(var n=this._first,a;n;)a=n._next,this.remove(n),n=a;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),Rs(this)},e.totalDuration=function(r){var n=0,a=this,o=a._last,h=Ie,l,c,d;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-r:r));if(a._dirty){for(d=a.parent;o;)l=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>h&&a._sort&&o._ts&&!a._lock?(a._lock=1,di(a,o,c-o._delay,1)._lock=0):h=c,c<0&&o._ts&&(n-=c,(!d&&!a._dp||d&&d.smoothChildTiming)&&(a._start+=c/a._ts,a._time-=c,a._tTime-=c),a.shiftChildren(-c,!1,-1/0),h=0),o._end>n&&o._ts&&(n=o._end),o=l;_r(a,a===Ct&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},t.updateRoot=function(r){if(Ct._ts&&(Np(Ct,Ja(r,Ct)),Fp=be.frame),be.frame>=Lp){Lp+=_e.autoSleep||120;var n=Ct._first;if((!n||!n._ts)&&_e.autoSleep&&be._listeners.length<2){for(;n&&!n._ts;)n=n._next;n||be.sleep()}}},t}(gn);Me(ne.prototype,{_lock:0,_hasPause:0,_forcing:0});var WT=function(t,e,i,r,n,a,o){var h=new ue(this._pt,t,e,0,1,_m,null,n),l=0,c=0,d,u,f,p,m,g,y,v;for(h.b=i,h.e=r,i+="",r+="",(y=~r.indexOf("random("))&&(r=dn(r)),a&&(v=[i,r],a(v,t,e),i=v[0],r=v[1]),u=i.match(Tl)||[];d=Tl.exec(r);)p=d[0],m=r.substring(l,d.index),f?f=(f+1)%5:m.substr(-5)==="rgba("&&(f=1),p!==u[c++]&&(g=parseFloat(u[c-1])||0,h._pt={_next:h._pt,p:m||c===1?m:",",s:g,c:p.charAt(1)==="="?mr(g,p)-g:parseFloat(p)-g,m:f&&f<4?Math.round:0},l=Tl.lastIndex);return h.c=l<r.length?r.substring(l,r.length):"",h.fp=o,(Ip.test(r)||y)&&(h.e=0),this._pt=h,h},Ul=function(t,e,i,r,n,a,o,h,l,c){Ft(r)&&(r=r(n||0,t,a));var d=t[e],u=i!=="get"?i:Ft(d)?l?t[e.indexOf("set")||!Ft(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():d,f=Ft(d)?l?jT:mm:Vl,p;if(jt(r)&&(~r.indexOf("random(")&&(r=dn(r)),r.charAt(1)==="="&&(p=mr(u,r)+(ie(u)||0),(p||p===0)&&(r=p))),!c||u!==r||Gl)return!isNaN(u*r)&&r!==""?(p=new ue(this._pt,t,e,+u||0,r-(u||0),typeof d=="boolean"?KT:gm,0,f),l&&(p.fp=l),o&&p.modifier(o,this,t),this._pt=p):(!d&&!(e in t)&&Al(e,r),WT.call(this,t,e,u,r,f,h||_e.stringFilter,l))},XT=function(t,e,i,r,n){if(Ft(t)&&(t=_n(t,n,e,i,r)),!ci(t)||t.style&&t.nodeType||ee(t)||Pp(t))return jt(t)?_n(t,n,e,i,r):t;var a={},o;for(o in t)a[o]=_n(t[o],n,e,i,r);return a},dm=function(t,e,i,r,n,a){var o,h,l,c;if(xe[t]&&(o=new xe[t]).init(n,o.rawVars?e[t]:XT(e[t],r,n,a,i),i,r,a)!==!1&&(i._pt=h=new ue(i._pt,n,t,0,1,o.render,o,0,o.priority),i!==yr))for(l=i._ptLookup[i._targets.indexOf(n)],c=o._props.length;c--;)l[o._props[c]]=h;return o},ss,Gl,Hl=function s(t,e,i){var r=t.vars,n=r.ease,a=r.startAt,o=r.immediateRender,h=r.lazy,l=r.onUpdate,c=r.runBackwards,d=r.yoyoEase,u=r.keyframes,f=r.autoRevert,p=t._dur,m=t._startAt,g=t._targets,y=t.parent,v=y&&y.data==="nested"?y.vars.targets:g,_=t._overwrite==="auto"&&!_l,x=t.timeline,b,w,T,E,A,P,L,M,S,C,R,N,F;if(x&&(!u||!n)&&(n="none"),t._ease=Is(n,fr.ease),t._yEase=d?hm(Is(d===!0?n:d,fr.ease)):0,d&&t._yoyo&&!t._repeat&&(d=t._yEase,t._yEase=t._ease,t._ease=d),t._from=!x&&!!r.runBackwards,!x||u&&!r.stagger){if(M=g[0]?Cs(g[0]).harness:0,N=M&&r[M.prop],b=Za(r,Sl),m&&(m._zTime<0&&m.progress(1),e<0&&c&&o&&!f?m.render(-1,!0):m.revert(c&&p?ja:yT),m._lazy=0),a){if(ts(t._startAt=Ht.set(g,Me({data:"isStart",overwrite:!1,parent:y,immediateRender:!0,lazy:!m&&le(h),startAt:null,delay:0,onUpdate:l&&function(){return ve(t,"onUpdate")},stagger:0},a))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(te||!o&&!f)&&t._startAt.revert(ja),o&&p&&e<=0&&i<=0){e&&(t._zTime=e);return}}else if(c&&p&&!m){if(e&&(o=!1),T=Me({overwrite:!1,data:"isFromStart",lazy:o&&!m&&le(h),immediateRender:o,stagger:0,parent:y},b),N&&(T[M.prop]=N),ts(t._startAt=Ht.set(g,T)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(te?t._startAt.revert(ja):t._startAt.render(-1,!0)),t._zTime=e,!o)s(t._startAt,_t,_t);else if(!e)return}for(t._pt=t._ptCache=0,h=p&&le(h)||h&&!p,w=0;w<g.length;w++){if(A=g[w],L=A._gsap||Il(g)[w]._gsap,t._ptLookup[w]=C={},Cl[L.id]&&Ji.length&&Ka(),R=v===g?w:v.indexOf(A),M&&(S=new M).init(A,N||b,t,R,v)!==!1&&(t._pt=E=new ue(t._pt,A,S.name,0,1,S.render,S,0,S.priority),S._props.forEach(function(B){C[B]=E}),S.priority&&(P=1)),!M||N)for(T in b)xe[T]&&(S=dm(T,b,t,R,A,v))?S.priority&&(P=1):C[T]=E=Ul.call(t,A,T,"get",b[T],R,v,0,r.stringFilter);t._op&&t._op[w]&&t.kill(A,t._op[w]),_&&t._pt&&(ss=t,Ct.killTweensOf(A,C,t.globalTime(e)),F=!t.parent,ss=0),t._pt&&h&&(Cl[L.id]=1)}P&&ym(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!F,u&&e<=0&&x.render(Ie,!0,!0)},zT=function(t,e,i,r,n,a,o,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[e],c,d,u,f;if(!l)for(l=t._ptCache[e]=[],u=t._ptLookup,f=t._targets.length;f--;){if(c=u[f][e],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return Gl=1,t.vars[e]="+=0",Hl(t,o),Gl=0,h?on(e+" not eligible for reset"):1;l.push(c)}for(f=l.length;f--;)d=l[f],c=d._pt||d,c.s=(r||r===0)&&!n?r:c.s+(r||0)+a*c.c,c.c=i-c.s,d.e&&(d.e=Nt(i)+ie(d.e)),d.b&&(d.b=c.s+ie(d.b))},$T=function(t,e){var i=t[0]?Cs(t[0]).harness:0,r=i&&i.aliases,n,a,o,h;if(!r)return e;n=Ps({},e);for(a in r)if(a in n)for(h=r[a].split(","),o=h.length;o--;)n[h[o]]=n[a];return n},YT=function(t,e,i,r){var n=e.ease||r||"power1.inOut",a,o;if(ee(e))o=i[t]||(i[t]=[]),e.forEach(function(h,l){return o.push({t:l/(e.length-1)*100,v:h,e:n})});else for(a in e)o=i[a]||(i[a]=[]),a==="ease"||o.push({t:parseFloat(t),v:e[a],e:n})},_n=function(t,e,i,r,n){return Ft(t)?t.call(e,i,r,n):jt(t)&&~t.indexOf("random(")?dn(t):t},fm=Rl+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",pm={};ce(fm+",id,stagger,delay,duration,paused,scrollTrigger",function(s){return pm[s]=1});var Ht=function(s){Sp(t,s);function t(i,r,n,a){var o;typeof r=="number"&&(n.duration=r,r=n,n=null),o=s.call(this,a?r:ln(r))||this;var h=o.vars,l=h.duration,c=h.delay,d=h.immediateRender,u=h.stagger,f=h.overwrite,p=h.keyframes,m=h.defaults,g=h.scrollTrigger,y=h.yoyoEase,v=r.parent||Ct,_=(ee(i)||Pp(i)?Di(i[0]):"length"in r)?[i]:Be(i),x,b,w,T,E,A,P,L;if(o._targets=_.length?Il(_):on("GSAP target "+i+" not found. https://gsap.com",!_e.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=f,p||u||$a(l)||$a(c)){if(r=o.vars,x=o.timeline=new ne({data:"nested",defaults:m||{},targets:v&&v.data==="nested"?v.vars.targets:_}),x.kill(),x.parent=x._dp=Mi(o),x._start=0,u||$a(l)||$a(c)){if(T=_.length,P=u&&Kp(u),ci(u))for(E in u)~fm.indexOf(E)&&(L||(L={}),L[E]=u[E]);for(b=0;b<T;b++)w=Za(r,pm),w.stagger=0,y&&(w.yoyoEase=y),L&&Ps(w,L),A=_[b],w.duration=+_n(l,Mi(o),b,A,_),w.delay=(+_n(c,Mi(o),b,A,_)||0)-o._delay,!u&&T===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),x.to(A,w,P?P(b,A,_):0),x._ease=at.none;x.duration()?l=c=0:o.timeline=0}else if(p){ln(Me(x.vars.defaults,{ease:"none"})),x._ease=Is(p.ease||r.ease||"none");var M=0,S,C,R;if(ee(p))p.forEach(function(N){return x.to(_,N,">")}),x.duration();else{w={};for(E in p)E==="ease"||E==="easeEach"||YT(E,p[E],w,p.easeEach);for(E in w)for(S=w[E].sort(function(N,F){return N.t-F.t}),M=0,b=0;b<S.length;b++)C=S[b],R={ease:C.e,duration:(C.t-(b?S[b-1].t:0))/100*l},R[E]=C.v,x.to(_,R,M),M+=R.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||o.duration(l=x.duration())}else o.timeline=0;return f===!0&&!_l&&(ss=Mi(o),Ct.killTweensOf(_),ss=0),di(v,Mi(o),n),r.reversed&&o.reverse(),r.paused&&o.paused(!0),(d||!l&&!p&&o._start===qt(v._time)&&le(d)&&ET(Mi(o))&&v.data!=="nested")&&(o._tTime=-_t,o.render(Math.max(0,-c)||0)),g&&zp(Mi(o),g),o}var e=t.prototype;return e.render=function(r,n,a){var o=this._time,h=this._tDur,l=this._dur,c=r<0,d=r>h-_t&&!c?h:r<_t?0:r,u,f,p,m,g,y,v,_,x;if(!l)ST(this,r,n,a);else if(d!==this._tTime||!r||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c){if(u=d,_=this.timeline,this._repeat){if(m=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(m*100+r,n,a);if(u=qt(d%m),d===h?(p=this._repeat,u=l):(p=~~(d/m),p&&p===qt(d/m)&&(u=l,p--),u>l&&(u=l)),y=this._yoyo&&p&1,y&&(x=this._yEase,u=l-u),g=gr(this._tTime,m),u===o&&!a&&this._initted&&p===g)return this._tTime=d,this;p!==g&&(_&&this._yEase&&lm(_,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==m&&this._initted&&(this._lock=a=1,this.render(qt(m*p),!0).invalidate()._lock=0))}if(!this._initted){if($p(this,c?r:u,a,n,d))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&p!==g))return this;if(l!==this._dur)return this.render(r,n,a)}if(this._tTime=d,this._time=u,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=v=(x||this._ease)(u/l),this._from&&(this.ratio=v=1-v),u&&!o&&!n&&!p&&(ve(this,"onStart"),this._tTime!==d))return this;for(f=this._pt;f;)f.r(v,f.d),f=f._next;_&&_.render(r<0?r:_._dur*_._ease(u/this._dur),n,a)||this._startAt&&(this._zTime=r),this._onUpdate&&!n&&(c&&Ml(this,r,n,a),ve(this,"onUpdate")),this._repeat&&p!==g&&this.vars.onRepeat&&!n&&this.parent&&ve(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(c&&!this._onUpdate&&Ml(this,r,!0,!0),(r||!l)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ts(this,1),!n&&!(c&&!o)&&(d||o||y)&&(ve(this,d===h?"onComplete":"onReverseComplete",!0),this._prom&&!(d<h&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),s.prototype.invalidate.call(this,r)},e.resetTo=function(r,n,a,o,h){mn||be.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||Hl(this,l),c=this._ease(l/this._dur),zT(this,r,n,a,o,c,l,h)?this.resetTo(r,n,a,o,1):(eo(this,0),this.parent||Vp(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(r,n){if(n===void 0&&(n="all"),!r&&(!n||n==="all"))return this._lazy=this._pt=0,this.parent?fn(this):this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(r,n,ss&&ss.vars.overwrite!==!0)._first||fn(this),this.parent&&a!==this.timeline.totalDuration()&&_r(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,h=r?Be(r):o,l=this._ptLookup,c=this._pt,d,u,f,p,m,g,y;if((!n||n==="all")&&TT(o,h))return n==="all"&&(this._pt=0),fn(this);for(d=this._op=this._op||[],n!=="all"&&(jt(n)&&(m={},ce(n,function(v){return m[v]=1}),n=m),n=$T(o,n)),y=o.length;y--;)if(~h.indexOf(o[y])){u=l[y],n==="all"?(d[y]=n,p=u,f={}):(f=d[y]=d[y]||{},p=n);for(m in p)g=u&&u[m],g&&((!("kill"in g.d)||g.d.kill(m)===!0)&&Qa(this,g,"_pt"),delete u[m]),f!=="all"&&(f[m]=1)}return this._initted&&!this._pt&&c&&fn(this),this},t.to=function(r,n){return new t(r,n,arguments[2])},t.from=function(r,n){return cn(1,arguments)},t.delayedCall=function(r,n,a,o){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:n,onReverseComplete:n,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},t.fromTo=function(r,n,a){return cn(2,arguments)},t.set=function(r,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(r,n)},t.killTweensOf=function(r,n,a){return Ct.killTweensOf(r,n,a)},t}(gn);Me(Ht.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ce("staggerTo,staggerFrom,staggerFromTo",function(s){Ht[s]=function(){var t=new ne,e=Bl.call(arguments,0);return e.splice(s==="staggerFromTo"?5:4,0,0),t[s].apply(t,e)}});var Vl=function(t,e,i){return t[e]=i},mm=function(t,e,i){return t[e](i)},jT=function(t,e,i,r){return t[e](r.fp,i)},qT=function(t,e,i){return t.setAttribute(e,i)},Wl=function(t,e){return Ft(t[e])?mm:xl(t[e])&&t.setAttribute?qT:Vl},gm=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},KT=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},_m=function(t,e){var i=e._pt,r="";if(!t&&e.b)r=e.b;else if(t===1&&e.e)r=e.e;else{for(;i;)r=i.p+(i.m?i.m(i.s+i.c*t):Math.round((i.s+i.c*t)*1e4)/1e4)+r,i=i._next;r+=e.c}e.set(e.t,e.p,r,e)},Xl=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},ZT=function(t,e,i,r){for(var n=this._pt,a;n;)a=n._next,n.p===r&&n.modifier(t,e,i),n=a},QT=function(t){for(var e=this._pt,i,r;e;)r=e._next,e.p===t&&!e.op||e.op===t?Qa(this,e,"_pt"):e.dep||(i=1),e=r;return!i},JT=function(t,e,i,r){r.mSet(t,e,r.m.call(r.tween,i,r.mt),r)},ym=function(t){for(var e=t._pt,i,r,n,a;e;){for(i=e._next,r=n;r&&r.pr>e.pr;)r=r._next;(e._prev=r?r._prev:a)?e._prev._next=e:n=e,(e._next=r)?r._prev=e:a=e,e=i}t._pt=n},ue=function(){function s(e,i,r,n,a,o,h,l,c){this.t=i,this.s=n,this.c=a,this.p=r,this.r=o||gm,this.d=h||this,this.set=l||Vl,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=s.prototype;return t.modifier=function(i,r,n){this.mSet=this.mSet||this.set,this.set=JT,this.m=i,this.mt=n,this.tween=r},s}();ce(Rl+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(s){return Sl[s]=1}),ye.TweenMax=ye.TweenLite=Ht,ye.TimelineLite=ye.TimelineMax=ne,Ct=new ne({sortChildren:!1,defaults:fr,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),_e.stringFilter=om;var Ds=[],io={},tw=[],xm=0,ew=0,zl=function(t){return(io[t]||tw).map(function(e){return e()})},$l=function(){var t=Date.now(),e=[];t-xm>2&&(zl("matchMediaInit"),Ds.forEach(function(i){var r=i.queries,n=i.conditions,a,o,h,l;for(o in r)a=ui.matchMedia(r[o]).matches,a&&(h=1),a!==n[o]&&(n[o]=a,l=1);l&&(i.revert(),h&&e.push(i))}),zl("matchMediaRevert"),e.forEach(function(i){return i.onMatch(i,function(r){return i.add(null,r)})}),xm=t,zl("matchMedia"))},vm=function(){function s(e,i){this.selector=i&&Ol(i),this.data=[],this._r=[],this.isReverted=!1,this.id=ew++,e&&this.add(e)}var t=s.prototype;return t.add=function(i,r,n){Ft(i)&&(n=r,r=i,i=Ft);var a=this,o=function(){var l=bt,c=a.selector,d;return l&&l!==a&&l.data.push(a),n&&(a.selector=Ol(n)),bt=a,d=r.apply(a,arguments),Ft(d)&&a._r.push(d),bt=l,a.selector=c,a.isReverted=!1,d};return a.last=o,i===Ft?o(a,function(h){return a.add(null,h)}):i?a[i]=o:o},t.ignore=function(i){var r=bt;bt=null,i(this),bt=r},t.getTweens=function(){var i=[];return this.data.forEach(function(r){return r instanceof s?i.push.apply(i,r.getTweens()):r instanceof Ht&&!(r.parent&&r.parent.data==="nested")&&i.push(r)}),i},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(i,r){var n=this;if(i?function(){for(var o=n.getTweens(),h=n.data.length,l;h--;)l=n.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,d){return d.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),h=n.data.length;h--;)l=n.data[h],l instanceof ne?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ht)&&l.revert&&l.revert(i);n._r.forEach(function(c){return c(i,n)}),n.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),r)for(var a=Ds.length;a--;)Ds[a].id===this.id&&Ds.splice(a,1)},t.revert=function(i){this.kill(i||{})},s}(),iw=function(){function s(e){this.contexts=[],this.scope=e,bt&&bt.data.push(this)}var t=s.prototype;return t.add=function(i,r,n){ci(i)||(i={matches:i});var a=new vm(0,n||this.scope),o=a.conditions={},h,l,c;bt&&!a.selector&&(a.selector=bt.selector),this.contexts.push(a),r=a.add("onMatch",r),a.queries=i;for(l in i)l==="all"?c=1:(h=ui.matchMedia(i[l]),h&&(Ds.indexOf(a)<0&&Ds.push(a),(o[l]=h.matches)&&(c=1),h.addListener?h.addListener($l):h.addEventListener("change",$l)));return c&&r(a,function(d){return a.add(null,d)}),this},t.revert=function(i){this.kill(i||{})},t.kill=function(i){this.contexts.forEach(function(r){return r.kill(i,!0)})},s}(),so={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(r){return sm(r)})},timeline:function(t){return new ne(t)},getTweensOf:function(t,e){return Ct.getTweensOf(t,e)},getProperty:function(t,e,i,r){jt(t)&&(t=Be(t)[0]);var n=Cs(t||{}).get,a=i?Gp:Up;return i==="native"&&(i=""),t&&(e?a((xe[e]&&xe[e].get||n)(t,e,i,r)):function(o,h,l){return a((xe[o]&&xe[o].get||n)(t,o,h,l))})},quickSetter:function(t,e,i){if(t=Be(t),t.length>1){var r=t.map(function(c){return de.quickSetter(c,e,i)}),n=r.length;return function(c){for(var d=n;d--;)r[d](c)}}t=t[0]||{};var a=xe[e],o=Cs(t),h=o.harness&&(o.harness.aliases||{})[e]||e,l=a?function(c){var d=new a;yr._pt=0,d.init(t,i?c+i:c,yr,0,[t]),d.render(1,d),yr._pt&&Xl(1,yr)}:o.set(t,h);return a?l:function(c){return l(t,h,i?c+i:c,o,1)}},quickTo:function(t,e,i){var r,n=de.to(t,Ps((r={},r[e]="+=0.1",r.paused=!0,r),i||{})),a=function(h,l,c){return n.resetTo(e,h,l,c)};return a.tween=n,a},isTweening:function(t){return Ct.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Is(t.ease,fr.ease)),Hp(fr,t||{})},config:function(t){return Hp(_e,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,r=t.plugins,n=t.defaults,a=t.extendTimeline;(r||"").split(",").forEach(function(o){return o&&!xe[o]&&!ye[o]&&on(e+" effect requires "+o+" plugin.")}),Pl[e]=function(o,h,l){return i(Be(o),Me(h||{},n),l)},a&&(ne.prototype[e]=function(o,h,l){return this.add(Pl[e](o,ci(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,e){at[t]=Is(e)},parseEase:function(t,e){return arguments.length?Is(t,e):at},getById:function(t){return Ct.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var i=new ne(t),r,n;for(i.smoothChildTiming=le(t.smoothChildTiming),Ct.remove(i),i._dp=0,i._time=i._tTime=Ct._time,r=Ct._first;r;)n=r._next,(e||!(!r._dur&&r instanceof Ht&&r.vars.onComplete===r._targets[0]))&&di(i,r,r._start-r._delay),r=n;return di(Ct,i,0),i},context:function(t,e){return t?new vm(t,e):bt},matchMedia:function(t){return new iw(t)},matchMediaRefresh:function(){return Ds.forEach(function(t){var e=t.conditions,i,r;for(r in e)e[r]&&(e[r]=!1,i=1);i&&t.revert()})||$l()},addEventListener:function(t,e){var i=io[t]||(io[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=io[t],r=i&&i.indexOf(e);r>=0&&i.splice(r,1)},utils:{wrap:OT,wrapYoyo:FT,distribute:Kp,random:Qp,snap:Zp,normalize:BT,getUnit:ie,clamp:RT,splitColor:rm,toArray:Be,selector:Ol,mapRange:tm,pipe:MT,unitize:DT,interpolate:LT,shuffle:qp},install:Bp,effects:Pl,ticker:be,updateRoot:ne.updateRoot,plugins:xe,globalTimeline:Ct,core:{PropTween:ue,globals:Op,Tween:Ht,Timeline:ne,Animation:gn,getCache:Cs,_removeLinkedListItem:Qa,reverting:function(){return te},context:function(t){return t&&bt&&(bt.data.push(t),t._ctx=bt),bt},suppressOverwrites:function(t){return _l=t}}};ce("to,from,fromTo,delayedCall,set,killTweensOf",function(s){return so[s]=Ht[s]}),be.add(ne.updateRoot),yr=so.to({},{duration:0});var sw=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},rw=function(t,e){var i=t._targets,r,n,a;for(r in e)for(n=i.length;n--;)a=t._ptLookup[n][r],a&&(a=a.d)&&(a._pt&&(a=sw(a,r)),a&&a.modifier&&a.modifier(e[r],t,i[n],r))},Yl=function(t,e){return{name:t,rawVars:1,init:function(r,n,a){a._onInit=function(o){var h,l;if(jt(n)&&(h={},ce(n,function(c){return h[c]=1}),n=h),e){h={};for(l in n)h[l]=e(n[l]);n=h}rw(o,n)}}}},de=so.registerPlugin({name:"attr",init:function(t,e,i,r,n){var a,o,h;this.tween=i;for(a in e)h=t.getAttribute(a)||"",o=this.add(t,"setAttribute",(h||0)+"",e[a],r,n,0,0,a),o.op=a,o.b=h,this._props.push(a)},render:function(t,e){for(var i=e._pt;i;)te?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},Yl("roundProps",Fl),Yl("modifiers"),Yl("snap",Zp))||so;Ht.version=ne.version=de.version="3.12.5",Dp=1,vl()&&xr(),at.Power0,at.Power1,at.Power2,at.Power3,at.Power4,at.Linear,at.Quad,at.Cubic,at.Quart,at.Quint,at.Strong,at.Elastic,at.Back,at.SteppedEase,at.Bounce,at.Sine,at.Expo,at.Circ;/*!
|
|
1155
|
+
*/var ge={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},pr={duration:.5,overwrite:!1,delay:0},Tl,te,Tt,Me=1e8,yt=1/Me,wl=Math.PI*2,ST=wl/4,CT=0,Op=Math.sqrt,PT=Math.cos,RT=Math.sin,jt=function(t){return typeof t=="string"},Lt=function(t){return typeof t=="function"},Bi=function(t){return typeof t=="number"},El=function(t){return typeof t>"u"},ui=function(t){return typeof t=="object"},le=function(t){return t!==!1},Al=function(){return typeof window<"u"},ja=function(t){return Lt(t)||jt(t)},Fp=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ee=Array.isArray,Sl=/(?:-?\.?\d|\.)+/gi,Lp=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,mr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Cl=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,kp=/[+-]=-?[.\d]+/,Np=/[^,'"\[\]\s]+/gi,IT=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ct,di,Pl,Rl,ye={},qa={},Up,Gp=function(t){return(qa=Rs(t,ye))&&de},Il=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},hn=function(t,e){return!e&&console.warn(t)},Hp=function(t,e){return t&&(ye[t]=e)&&qa&&(qa[t]=e)||ye},ln=function(){return 0},MT={suppressEvents:!0,isStart:!0,kill:!1},Ka={suppressEvents:!0,kill:!1},DT={suppressEvents:!0},Ml={},ts=[],Dl={},Vp,xe={},Bl={},Wp=30,Za=[],Ol="",Fl=function(t){var e=t[0],i,r;if(ui(e)||Lt(e)||(t=[t]),!(i=(e._gsap||{}).harness)){for(r=Za.length;r--&&!Za[r].targetTest(e););i=Za[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new ym(t[r],i)))||t.splice(r,1);return t},Ps=function(t){return t._gsap||Fl(Oe(t))[0]._gsap},Xp=function(t,e,i){return(i=t[e])&&Lt(i)?t[e]():El(i)&&t.getAttribute&&t.getAttribute(e)||i},ce=function(t,e){return(t=t.split(",")).forEach(e)||t},Ut=function(t){return Math.round(t*1e5)/1e5||0},qt=function(t){return Math.round(t*1e7)/1e7||0},_r=function(t,e){var i=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),i==="+"?t+r:i==="-"?t-r:i==="*"?t*r:t/r},BT=function(t,e){for(var i=e.length,r=0;t.indexOf(e[r])<0&&++r<i;);return r<i},Qa=function(){var t=ts.length,e=ts.slice(0),i,r;for(Dl={},ts.length=0,i=0;i<t;i++)r=e[i],r&&r._lazy&&(r.render(r._lazy[0],r._lazy[1],!0)._lazy=0)},$p=function(t,e,i,r){ts.length&&!te&&Qa(),t.render(e,i,r||te&&e<0&&(t._initted||t._startAt)),ts.length&&!te&&Qa()},zp=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Np).length<2?e:jt(t)?t.trim():t},Yp=function(t){return t},De=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},OT=function(t){return function(e,i){for(var r in i)r in e||r==="duration"&&t||r==="ease"||(e[r]=i[r])}},Rs=function(t,e){for(var i in e)t[i]=e[i];return t},jp=function s(t,e){for(var i in e)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(t[i]=ui(e[i])?s(t[i]||(t[i]={}),e[i]):e[i]);return t},Ja=function(t,e){var i={},r;for(r in t)r in e||(i[r]=t[r]);return i},cn=function(t){var e=t.parent||Ct,i=t.keyframes?OT(ee(t.keyframes)):De;if(le(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},FT=function(t,e){for(var i=t.length,r=i===e.length;r&&i--&&t[i]===e[i];);return i<0},qp=function(t,e,i,r,n){i===void 0&&(i="_first"),r===void 0&&(r="_last");var a=t[r],o;if(n)for(o=e[n];a&&a[n]>o;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[r]=e,e._prev=a,e.parent=e._dp=t,e},to=function(t,e,i,r){i===void 0&&(i="_first"),r===void 0&&(r="_last");var n=e._prev,a=e._next;n?n._next=a:t[i]===e&&(t[i]=a),a?a._prev=n:t[r]===e&&(t[r]=n),e._next=e._prev=e.parent=null},es=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Is=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},LT=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Ll=function(t,e,i,r){return t._startAt&&(te?t._startAt.revert(Ka):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},kT=function s(t){return!t||t._ts&&s(t.parent)},Kp=function(t){return t._repeat?gr(t._tTime,t=t.duration()+t._rDelay)*t:0},gr=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},eo=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},io=function(t){return t._end=qt(t._start+(t._tDur/Math.abs(t._ts||t._rts||yt)||0))},so=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=qt(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),io(t),i._dirty||Is(i,t)),t},Zp=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=eo(t.rawTime(),e),(!e._dur||dn(0,e.totalDuration(),i)-e._tTime>yt)&&e.render(i,!0)),Is(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-yt}},fi=function(t,e,i,r){return e.parent&&es(e),e._start=qt((Bi(i)?i:i||t!==Ct?Be(t,i,e):t._time)+e._delay),e._end=qt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),qp(t,e,"_first","_last",t._sort?"_start":0),kl(e)||(t._recent=e),r||Zp(t,e),t._ts<0&&so(t,t._tTime),t},Qp=function(t,e){return(ye.ScrollTrigger||Il("scrollTrigger",e))&&ye.ScrollTrigger.create(e,t)},Jp=function(t,e,i,r,n){if(zl(t,e,n),!t._initted)return 1;if(!i&&t._pt&&!te&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Vp!==be.frame)return ts.push(t),t._lazy=[n,r],1},NT=function s(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||s(e))},kl=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},UT=function(t,e,i,r){var n=t.ratio,a=e<0||!e&&(!t._start&&NT(t)&&!(!t._initted&&kl(t))||(t._ts<0||t._dp._ts<0)&&!kl(t))?0:1,o=t._rDelay,h=0,l,c,d;if(o&&t._repeat&&(h=dn(0,t._tDur,e),c=gr(h,o),t._yoyo&&c&1&&(a=1-a),c!==gr(t._tTime,o)&&(n=1-a,t.vars.repeatRefresh&&t._initted&&t.invalidate())),a!==n||te||r||t._zTime===yt||!e&&t._zTime){if(!t._initted&&Jp(t,e,r,i,h))return;for(d=t._zTime,t._zTime=e||(i?yt:0),i||(i=e&&!d),t.ratio=a,t._from&&(a=1-a),t._time=0,t._tTime=h,l=t._pt;l;)l.r(a,l.d),l=l._next;e<0&&Ll(t,e,i,!0),t._onUpdate&&!i&&ve(t,"onUpdate"),h&&t._repeat&&!i&&t.parent&&ve(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===a&&(a&&es(t,1),!i&&!te&&(ve(t,a?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},GT=function(t,e,i){var r;if(i>e)for(r=t._first;r&&r._start<=i;){if(r.data==="isPause"&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=i;){if(r.data==="isPause"&&r._start<e)return r;r=r._prev}},yr=function(t,e,i,r){var n=t._repeat,a=qt(e)||0,o=t._tTime/t._tDur;return o&&!r&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:qt(a*(n+1)+t._rDelay*n):a,o>0&&!r&&so(t,t._tTime=t._tDur*o),t.parent&&io(t),i||Is(t.parent,t),t},tm=function(t){return t instanceof ne?Is(t):yr(t,t._dur)},HT={_start:0,endTime:ln,totalDuration:ln},Be=function s(t,e,i){var r=t.labels,n=t._recent||HT,a=t.duration()>=Me?n.endTime(!1):t._dur,o,h,l;return jt(e)&&(isNaN(e)||e in r)?(h=e.charAt(0),l=e.substr(-1)==="%",o=e.indexOf("="),h==="<"||h===">"?(o>=0&&(e=e.replace(/=/,"")),(h==="<"?n._start:n.endTime(n._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(o<0?n:i).totalDuration()/100:1)):o<0?(e in r||(r[e]=a),r[e]):(h=parseFloat(e.charAt(o-1)+e.substr(o+1)),l&&i&&(h=h/100*(ee(i)?i[0]:i).totalDuration()),o>1?s(t,e.substr(0,o-1),i)+h:a+h)):e==null?a:+e},un=function(t,e,i){var r=Bi(e[1]),n=(r?2:1)+(t<2?0:1),a=e[n],o,h;if(r&&(a.duration=e[1]),a.parent=i,t){for(o=a,h=i;h&&!("immediateRender"in o);)o=h.vars.defaults||{},h=le(h.vars.inherit)&&h.parent;a.immediateRender=le(o.immediateRender),t<2?a.runBackwards=1:a.startAt=e[n-1]}return new Vt(e[0],a,e[n+1])},is=function(t,e){return t||t===0?e(t):e},dn=function(t,e,i){return i<t?t:i>e?e:i},ie=function(t,e){return!jt(t)||!(e=IT.exec(t))?"":e[1]},VT=function(t,e,i){return is(i,function(r){return dn(t,e,r)})},Nl=[].slice,em=function(t,e){return t&&ui(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&ui(t[0]))&&!t.nodeType&&t!==di},WT=function(t,e,i){return i===void 0&&(i=[]),t.forEach(function(r){var n;return jt(r)&&!e||em(r,1)?(n=i).push.apply(n,Oe(r)):i.push(r)})||i},Oe=function(t,e,i){return Tt&&!e&&Tt.selector?Tt.selector(t):jt(t)&&!i&&(Pl||!vr())?Nl.call((e||Rl).querySelectorAll(t),0):ee(t)?WT(t,i):em(t)?Nl.call(t,0):t?[t]:[]},Ul=function(t){return t=Oe(t)[0]||hn("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return Oe(e,i.querySelectorAll?i:i===t?hn("Invalid scope")||Rl.createElement("div"):t)}},im=function(t){return t.sort(function(){return .5-Math.random()})},sm=function(t){if(Lt(t))return t;var e=ui(t)?t:{each:t},i=Ms(e.ease),r=e.from||0,n=parseFloat(e.base)||0,a={},o=r>0&&r<1,h=isNaN(r)||o,l=e.axis,c=r,d=r;return jt(r)?c=d={center:.5,edges:.5,end:1}[r]||0:!o&&h&&(c=r[0],d=r[1]),function(u,f,p){var m=(p||e).length,_=a[m],y,v,g,x,b,w,T,E,A;if(!_){if(A=e.grid==="auto"?0:(e.grid||[1,Me])[1],!A){for(T=-Me;T<(T=p[A++].getBoundingClientRect().left)&&A<m;);A<m&&A--}for(_=a[m]=[],y=h?Math.min(A,m)*c-.5:r%A,v=A===Me?0:h?m*d/A-.5:r/A|0,T=0,E=Me,w=0;w<m;w++)g=w%A-y,x=v-(w/A|0),_[w]=b=l?Math.abs(l==="y"?x:g):Op(g*g+x*x),b>T&&(T=b),b<E&&(E=b);r==="random"&&im(_),_.max=T-E,_.min=E,_.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(A>m?m-1:l?l==="y"?m/A:A:Math.max(A,m/A))||0)*(r==="edges"?-1:1),_.b=m<0?n-m:n,_.u=ie(e.amount||e.each)||0,i=i&&m<0?mm(i):i}return m=(_[u]-_.min)/_.max||0,qt(_.b+(i?i(m):m)*_.v)+_.u}},Gl=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var r=qt(Math.round(parseFloat(i)/t)*t*e);return(r-r%1)/e+(Bi(i)?0:ie(i))}},rm=function(t,e){var i=ee(t),r,n;return!i&&ui(t)&&(r=i=t.radius||Me,t.values?(t=Oe(t.values),(n=!Bi(t[0]))&&(r*=r)):t=Gl(t.increment)),is(e,i?Lt(t)?function(a){return n=t(a),Math.abs(n-a)<=r?n:a}:function(a){for(var o=parseFloat(n?a.x:a),h=parseFloat(n?a.y:0),l=Me,c=0,d=t.length,u,f;d--;)n?(u=t[d].x-o,f=t[d].y-h,u=u*u+f*f):u=Math.abs(t[d]-o),u<l&&(l=u,c=d);return c=!r||l<=r?t[c]:a,n||c===a||Bi(a)?c:c+ie(a)}:Gl(t))},nm=function(t,e,i,r){return is(ee(t)?!e:i===!0?!!(i=0):!r,function(){return ee(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(r=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+i*.99))/i)*i*r)/r})},XT=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(r){return e.reduce(function(n,a){return a(n)},r)}},$T=function(t,e){return function(i){return t(parseFloat(i))+(e||ie(i))}},zT=function(t,e,i){return om(t,e,0,1,i)},am=function(t,e,i){return is(i,function(r){return t[~~e(r)]})},YT=function s(t,e,i){var r=e-t;return ee(t)?am(t,s(0,t.length),e):is(i,function(n){return(r+(n-t)%r)%r+t})},jT=function s(t,e,i){var r=e-t,n=r*2;return ee(t)?am(t,s(0,t.length-1),e):is(i,function(a){return a=(n+(a-t)%n)%n||0,t+(a>r?n-a:a)})},fn=function(t){for(var e=0,i="",r,n,a,o;~(r=t.indexOf("random(",e));)a=t.indexOf(")",r),o=t.charAt(r+7)==="[",n=t.substr(r+7,a-r-7).match(o?Np:Sl),i+=t.substr(e,r-e)+nm(o?n:+n[0],o?0:+n[1],+n[2]||1e-5),e=a+1;return i+t.substr(e,t.length-e)},om=function(t,e,i,r,n){var a=e-t,o=r-i;return is(n,function(h){return i+((h-t)/a*o||0)})},qT=function s(t,e,i,r){var n=isNaN(t+e)?0:function(f){return(1-f)*t+f*e};if(!n){var a=jt(t),o={},h,l,c,d,u;if(i===!0&&(r=1)&&(i=null),a)t={p:t},e={p:e};else if(ee(t)&&!ee(e)){for(c=[],d=t.length,u=d-2,l=1;l<d;l++)c.push(s(t[l-1],t[l]));d--,n=function(p){p*=d;var m=Math.min(u,~~p);return c[m](p-m)},i=e}else r||(t=Rs(ee(t)?[]:{},t));if(!c){for(h in e)Xl.call(o,t,h,"get",e[h]);n=function(p){return ql(p,o)||(a?t.p:t)}}}return is(i,n)},hm=function(t,e,i){var r=t.labels,n=Me,a,o,h;for(a in r)o=r[a]-e,o<0==!!i&&o&&n>(o=Math.abs(o))&&(h=a,n=o);return h},ve=function(t,e,i){var r=t.vars,n=r[e],a=Tt,o=t._ctx,h,l,c;if(n)return h=r[e+"Params"],l=r.callbackScope||t,i&&ts.length&&Qa(),o&&(Tt=o),c=h?n.apply(l,h):n.call(l),Tt=a,c},pn=function(t){return es(t),t.scrollTrigger&&t.scrollTrigger.kill(!!te),t.progress()<1&&ve(t,"onInterrupt"),t},xr,lm=[],cm=function(t){if(t)if(t=!t.name&&t.default||t,Al()||t.headless){var e=t.name,i=Lt(t),r=e&&!i&&t.init?function(){this._props=[]}:t,n={init:ln,render:ql,add:Xl,kill:uw,modifier:cw,rawVars:0},a={targetTest:0,get:0,getSetter:jl,aliases:{},register:0};if(vr(),t!==r){if(xe[e])return;De(r,De(Ja(t,n),a)),Rs(r.prototype,Rs(n,Ja(t,a))),xe[r.prop=e]=r,t.targetTest&&(Za.push(r),Ml[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Hp(e,r),t.register&&t.register(de,r,ue)}else lm.push(t)},mt=255,mn={aqua:[0,mt,mt],lime:[0,mt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,mt],navy:[0,0,128],white:[mt,mt,mt],olive:[128,128,0],yellow:[mt,mt,0],orange:[mt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[mt,0,0],pink:[mt,192,203],cyan:[0,mt,mt],transparent:[mt,mt,mt,0]},Hl=function(t,e,i){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(i-e)*t*6:t<.5?i:t*3<2?e+(i-e)*(2/3-t)*6:e)*mt+.5|0},um=function(t,e,i){var r=t?Bi(t)?[t>>16,t>>8&mt,t&mt]:0:mn.black,n,a,o,h,l,c,d,u,f,p;if(!r){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),mn[t])r=mn[t];else if(t.charAt(0)==="#"){if(t.length<6&&(n=t.charAt(1),a=t.charAt(2),o=t.charAt(3),t="#"+n+n+a+a+o+o+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return r=parseInt(t.substr(1,6),16),[r>>16,r>>8&mt,r&mt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),r=[t>>16,t>>8&mt,t&mt]}else if(t.substr(0,3)==="hsl"){if(r=p=t.match(Sl),!e)h=+r[0]%360/360,l=+r[1]/100,c=+r[2]/100,a=c<=.5?c*(l+1):c+l-c*l,n=c*2-a,r.length>3&&(r[3]*=1),r[0]=Hl(h+1/3,n,a),r[1]=Hl(h,n,a),r[2]=Hl(h-1/3,n,a);else if(~t.indexOf("="))return r=t.match(Lp),i&&r.length<4&&(r[3]=1),r}else r=t.match(Sl)||mn.transparent;r=r.map(Number)}return e&&!p&&(n=r[0]/mt,a=r[1]/mt,o=r[2]/mt,d=Math.max(n,a,o),u=Math.min(n,a,o),c=(d+u)/2,d===u?h=l=0:(f=d-u,l=c>.5?f/(2-d-u):f/(d+u),h=d===n?(a-o)/f+(a<o?6:0):d===a?(o-n)/f+2:(n-a)/f+4,h*=60),r[0]=~~(h+.5),r[1]=~~(l*100+.5),r[2]=~~(c*100+.5)),i&&r.length<4&&(r[3]=1),r},dm=function(t){var e=[],i=[],r=-1;return t.split(ss).forEach(function(n){var a=n.match(mr)||[];e.push.apply(e,a),i.push(r+=a.length+1)}),e.c=i,e},fm=function(t,e,i){var r="",n=(t+r).match(ss),a=e?"hsla(":"rgba(",o=0,h,l,c,d;if(!n)return t;if(n=n.map(function(u){return(u=um(u,e,1))&&a+(e?u[0]+","+u[1]+"%,"+u[2]+"%,"+u[3]:u.join(","))+")"}),i&&(c=dm(t),h=i.c,h.join(r)!==c.c.join(r)))for(l=t.replace(ss,"1").split(mr),d=l.length-1;o<d;o++)r+=l[o]+(~h.indexOf(o)?n.shift()||a+"0,0,0,0)":(c.length?c:n.length?n:i).shift());if(!l)for(l=t.split(ss),d=l.length-1;o<d;o++)r+=l[o]+n[o];return r+l[d]},ss=function(){var s="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in mn)s+="|"+t+"\\b";return new RegExp(s+")","gi")}(),KT=/hsl[a]?\(/,pm=function(t){var e=t.join(" "),i;if(ss.lastIndex=0,ss.test(e))return i=KT.test(e),t[1]=fm(t[1],i),t[0]=fm(t[0],i,dm(t[1])),!0},_n,be=function(){var s=Date.now,t=500,e=33,i=s(),r=i,n=1e3/240,a=n,o=[],h,l,c,d,u,f,p=function m(_){var y=s()-r,v=_===!0,g,x,b,w;if((y>t||y<0)&&(i+=y-e),r+=y,b=r-i,g=b-a,(g>0||v)&&(w=++d.frame,u=b-d.time*1e3,d.time=b=b/1e3,a+=g+(g>=n?4:n-g),x=1),v||(h=l(m)),x)for(f=0;f<o.length;f++)o[f](b,u,w,_)};return d={time:0,frame:0,tick:function(){p(!0)},deltaRatio:function(_){return u/(1e3/(_||60))},wake:function(){Up&&(!Pl&&Al()&&(di=Pl=window,Rl=di.document||{},ye.gsap=de,(di.gsapVersions||(di.gsapVersions=[])).push(de.version),Gp(qa||di.GreenSockGlobals||!di.gsap&&di||{}),lm.forEach(cm)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&d.sleep(),l=c||function(_){return setTimeout(_,a-d.time*1e3+1|0)},_n=1,p(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),_n=0,l=ln},lagSmoothing:function(_,y){t=_||1/0,e=Math.min(y||33,t)},fps:function(_){n=1e3/(_||240),a=d.time*1e3+n},add:function(_,y,v){var g=y?function(x,b,w,T){_(x,b,w,T),d.remove(g)}:_;return d.remove(_),o[v?"unshift":"push"](g),vr(),g},remove:function(_,y){~(y=o.indexOf(_))&&o.splice(y,1)&&f>=y&&f--},_listeners:o},d}(),vr=function(){return!_n&&be.wake()},at={},ZT=/^[\d.\-M][\d.\-,\s]/,QT=/["']/g,JT=function(t){for(var e={},i=t.substr(1,t.length-3).split(":"),r=i[0],n=1,a=i.length,o,h,l;n<a;n++)h=i[n],o=n!==a-1?h.lastIndexOf(","):h.length,l=h.substr(0,o),e[r]=isNaN(l)?l.replace(QT,"").trim():+l,r=h.substr(o+1).trim();return e},tw=function(t){var e=t.indexOf("(")+1,i=t.indexOf(")"),r=t.indexOf("(",e);return t.substring(e,~r&&r<i?t.indexOf(")",i+1):i)},ew=function(t){var e=(t+"").split("("),i=at[e[0]];return i&&e.length>1&&i.config?i.config.apply(null,~t.indexOf("{")?[JT(e[1])]:tw(t).split(",").map(zp)):at._CE&&ZT.test(t)?at._CE("",t):i},mm=function(t){return function(e){return 1-t(1-e)}},_m=function s(t,e){for(var i=t._first,r;i;)i instanceof ne?s(i,e):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==e&&(i.timeline?s(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next},Ms=function(t,e){return t&&(Lt(t)?t:at[t]||ew(t))||e},Ds=function(t,e,i,r){i===void 0&&(i=function(h){return 1-e(1-h)}),r===void 0&&(r=function(h){return h<.5?e(h*2)/2:1-e((1-h)*2)/2});var n={easeIn:e,easeOut:i,easeInOut:r},a;return ce(t,function(o){at[o]=ye[o]=n,at[a=o.toLowerCase()]=i;for(var h in n)at[a+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=at[o+"."+h]=n[h]}),n},gm=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Vl=function s(t,e,i){var r=e>=1?e:1,n=(i||(t?.3:.45))/(e<1?e:1),a=n/wl*(Math.asin(1/r)||0),o=function(c){return c===1?1:r*Math.pow(2,-10*c)*RT((c-a)*n)+1},h=t==="out"?o:t==="in"?function(l){return 1-o(1-l)}:gm(o);return n=wl/n,h.config=function(l,c){return s(t,l,c)},h},Wl=function s(t,e){e===void 0&&(e=1.70158);var i=function(a){return a?--a*a*((e+1)*a+e)+1:0},r=t==="out"?i:t==="in"?function(n){return 1-i(1-n)}:gm(i);return r.config=function(n){return s(t,n)},r};ce("Linear,Quad,Cubic,Quart,Quint,Strong",function(s,t){var e=t<5?t+1:t;Ds(s+",Power"+(e-1),t?function(i){return Math.pow(i,e)}:function(i){return i},function(i){return 1-Math.pow(1-i,e)},function(i){return i<.5?Math.pow(i*2,e)/2:1-Math.pow((1-i)*2,e)/2})}),at.Linear.easeNone=at.none=at.Linear.easeIn,Ds("Elastic",Vl("in"),Vl("out"),Vl()),function(s,t){var e=1/t,i=2*e,r=2.5*e,n=function(o){return o<e?s*o*o:o<i?s*Math.pow(o-1.5/t,2)+.75:o<r?s*(o-=2.25/t)*o+.9375:s*Math.pow(o-2.625/t,2)+.984375};Ds("Bounce",function(a){return 1-n(1-a)},n)}(7.5625,2.75),Ds("Expo",function(s){return s?Math.pow(2,10*(s-1)):0}),Ds("Circ",function(s){return-(Op(1-s*s)-1)}),Ds("Sine",function(s){return s===1?1:-PT(s*ST)+1}),Ds("Back",Wl("in"),Wl("out"),Wl()),at.SteppedEase=at.steps=ye.SteppedEase={config:function(t,e){t===void 0&&(t=1);var i=1/t,r=t+(e?0:1),n=e?1:0,a=1-yt;return function(o){return((r*dn(0,a,o)|0)+n)*i}}},pr.ease=at["quad.out"],ce("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(s){return Ol+=s+","+s+"Params,"});var ym=function(t,e){this.id=CT++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Xp,this.set=e?e.getSetter:jl},gn=function(){function s(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,yr(this,+e.duration,1,1),this.data=e.data,Tt&&(this._ctx=Tt,Tt.data.push(this)),_n||be.wake()}var t=s.prototype;return t.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},t.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},t.totalDuration=function(i){return arguments.length?(this._dirty=0,yr(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(i,r){if(vr(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(so(this,i),!n._dp||n.parent||Zp(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&fi(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===yt||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),$p(this,i,r)),this},t.time=function(i,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+Kp(this))%(this._dur+this._rDelay)||(i?this._dur:0),r):this._time},t.totalProgress=function(i,r){return arguments.length?this.totalTime(this.totalDuration()*i,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(i,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+Kp(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(i,r){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*n,r):this._repeat?gr(this._tTime,n)+1:1},t.timeScale=function(i,r){if(!arguments.length)return this._rts===-yt?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?eo(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-yt?0:this._rts,this.totalTime(dn(-Math.abs(this._delay),this._tDur,n),r!==!1),io(this),LT(this)},t.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(vr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==yt&&(this._tTime-=yt)))),this):this._ps},t.startTime=function(i){if(arguments.length){this._start=i;var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&fi(r,this,i-this._delay),this}return this._start},t.endTime=function(i){return this._start+(le(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(i){var r=this.parent||this._dp;return r?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?eo(r.rawTime(i),this):this._tTime:this._tTime},t.revert=function(i){i===void 0&&(i=DT);var r=te;return te=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),te=r,this},t.globalTime=function(i){for(var r=this,n=arguments.length?i:r.rawTime();r;)n=r._start+n/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(i):n},t.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,tm(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(i){if(arguments.length){var r=this._time;return this._rDelay=i,tm(this),r?this.time(r):this}return this._rDelay},t.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},t.seek=function(i,r){return this.totalTime(Be(this,i),le(r))},t.restart=function(i,r){return this.play().totalTime(i?-this._delay:0,le(r))},t.play=function(i,r){return i!=null&&this.seek(i,r),this.reversed(!1).paused(!1)},t.reverse=function(i,r){return i!=null&&this.seek(i||this.totalDuration(),r),this.reversed(!0).paused(!1)},t.pause=function(i,r){return i!=null&&this.seek(i,r),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-yt:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-yt,this},t.isActive=function(){var i=this.parent||this._dp,r=this._start,n;return!!(!i||this._ts&&this._initted&&i.isActive()&&(n=i.rawTime(!0))>=r&&n<this.endTime(!0)-yt)},t.eventCallback=function(i,r,n){var a=this.vars;return arguments.length>1?(r?(a[i]=r,n&&(a[i+"Params"]=n),i==="onUpdate"&&(this._onUpdate=r)):delete a[i],this):a[i]},t.then=function(i){var r=this;return new Promise(function(n){var a=Lt(i)?i:Yp,o=function(){var l=r.then;r.then=null,Lt(a)&&(a=a(r))&&(a.then||a===r)&&(r.then=l),n(a),r.then=l};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?o():r._prom=o})},t.kill=function(){pn(this)},s}();De(gn.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-yt,_prom:0,_ps:!1,_rts:1});var ne=function(s){Bp(t,s);function t(i,r){var n;return i===void 0&&(i={}),n=s.call(this,i)||this,n.labels={},n.smoothChildTiming=!!i.smoothChildTiming,n.autoRemoveChildren=!!i.autoRemoveChildren,n._sort=le(i.sortChildren),Ct&&fi(i.parent||Ct,Di(n),r),i.reversed&&n.reverse(),i.paused&&n.paused(!0),i.scrollTrigger&&Qp(Di(n),i.scrollTrigger),n}var e=t.prototype;return e.to=function(r,n,a){return un(0,arguments,this),this},e.from=function(r,n,a){return un(1,arguments,this),this},e.fromTo=function(r,n,a,o){return un(2,arguments,this),this},e.set=function(r,n,a){return n.duration=0,n.parent=this,cn(n).repeatDelay||(n.repeat=0),n.immediateRender=!!n.immediateRender,new Vt(r,n,Be(this,a),1),this},e.call=function(r,n,a){return fi(this,Vt.delayedCall(0,r,n),a)},e.staggerTo=function(r,n,a,o,h,l,c){return a.duration=n,a.stagger=a.stagger||o,a.onComplete=l,a.onCompleteParams=c,a.parent=this,new Vt(r,a,Be(this,h)),this},e.staggerFrom=function(r,n,a,o,h,l,c){return a.runBackwards=1,cn(a).immediateRender=le(a.immediateRender),this.staggerTo(r,n,a,o,h,l,c)},e.staggerFromTo=function(r,n,a,o,h,l,c,d){return o.startAt=a,cn(o).immediateRender=le(o.immediateRender),this.staggerTo(r,n,o,h,l,c,d)},e.render=function(r,n,a){var o=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=r<=0?0:qt(r),d=this._zTime<0!=r<0&&(this._initted||!l),u,f,p,m,_,y,v,g,x,b,w,T;if(this!==Ct&&c>h&&r>=0&&(c=h),c!==this._tTime||a||d){if(o!==this._time&&l&&(c+=this._time-o,r+=this._time-o),u=c,x=this._start,g=this._ts,y=!g,d&&(l||(o=this._zTime),(r||!n)&&(this._zTime=r)),this._repeat){if(w=this._yoyo,_=l+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(_*100+r,n,a);if(u=qt(c%_),c===h?(m=this._repeat,u=l):(m=~~(c/_),m&&m===c/_&&(u=l,m--),u>l&&(u=l)),b=gr(this._tTime,_),!o&&this._tTime&&b!==m&&this._tTime-b*_-this._dur<=0&&(b=m),w&&m&1&&(u=l-u,T=1),m!==b&&!this._lock){var E=w&&b&1,A=E===(w&&m&1);if(m<b&&(E=!E),o=E?0:c%l?l:c,this._lock=1,this.render(o||(T?0:qt(m*_)),n,!l)._lock=0,this._tTime=c,!n&&this.parent&&ve(this,"onRepeat"),this.vars.repeatRefresh&&!T&&(this.invalidate()._lock=1),o&&o!==this._time||y!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,A&&(this._lock=2,o=E?l:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!T&&this.invalidate()),this._lock=0,!this._ts&&!y)return this;_m(this,T)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=GT(this,qt(o),qt(u)),v&&(c-=u-(u=v._start))),this._tTime=c,this._time=u,this._act=!g,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=r,o=0),!o&&u&&!n&&!m&&(ve(this,"onStart"),this._tTime!==c))return this;if(u>=o&&r>=0)for(f=this._first;f;){if(p=f._next,(f._act||u>=f._start)&&f._ts&&v!==f){if(f.parent!==this)return this.render(r,n,a);if(f.render(f._ts>0?(u-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(u-f._start)*f._ts,n,a),u!==this._time||!this._ts&&!y){v=0,p&&(c+=this._zTime=-yt);break}}f=p}else{f=this._last;for(var P=r<0?r:u;f;){if(p=f._prev,(f._act||P<=f._end)&&f._ts&&v!==f){if(f.parent!==this)return this.render(r,n,a);if(f.render(f._ts>0?(P-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(P-f._start)*f._ts,n,a||te&&(f._initted||f._startAt)),u!==this._time||!this._ts&&!y){v=0,p&&(c+=this._zTime=P?-yt:yt);break}}f=p}}if(v&&!n&&(this.pause(),v.render(u>=o?0:-yt)._zTime=u>=o?1:-1,this._ts))return this._start=x,io(this),this.render(r,n,a);this._onUpdate&&!n&&ve(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&o)&&(x===this._start||Math.abs(g)!==Math.abs(this._ts))&&(this._lock||((r||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&es(this,1),!n&&!(r<0&&!o)&&(c||o||!h)&&(ve(this,c===h&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(r,n){var a=this;if(Bi(n)||(n=Be(this,n,r)),!(r instanceof gn)){if(ee(r))return r.forEach(function(o){return a.add(o,n)}),this;if(jt(r))return this.addLabel(r,n);if(Lt(r))r=Vt.delayedCall(0,r);else return this}return this!==r?fi(this,r,n):this},e.getChildren=function(r,n,a,o){r===void 0&&(r=!0),n===void 0&&(n=!0),a===void 0&&(a=!0),o===void 0&&(o=-Me);for(var h=[],l=this._first;l;)l._start>=o&&(l instanceof Vt?n&&h.push(l):(a&&h.push(l),r&&h.push.apply(h,l.getChildren(!0,n,a)))),l=l._next;return h},e.getById=function(r){for(var n=this.getChildren(1,1,1),a=n.length;a--;)if(n[a].vars.id===r)return n[a]},e.remove=function(r){return jt(r)?this.removeLabel(r):Lt(r)?this.killTweensOf(r):(to(this,r),r===this._recent&&(this._recent=this._last),Is(this))},e.totalTime=function(r,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=qt(be.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),s.prototype.totalTime.call(this,r,n),this._forcing=0,this):this._tTime},e.addLabel=function(r,n){return this.labels[r]=Be(this,n),this},e.removeLabel=function(r){return delete this.labels[r],this},e.addPause=function(r,n,a){var o=Vt.delayedCall(0,n||ln,a);return o.data="isPause",this._hasPause=1,fi(this,o,Be(this,r))},e.removePause=function(r){var n=this._first;for(r=Be(this,r);n;)n._start===r&&n.data==="isPause"&&es(n),n=n._next},e.killTweensOf=function(r,n,a){for(var o=this.getTweensOf(r,a),h=o.length;h--;)rs!==o[h]&&o[h].kill(r,n);return this},e.getTweensOf=function(r,n){for(var a=[],o=Oe(r),h=this._first,l=Bi(n),c;h;)h instanceof Vt?BT(h._targets,o)&&(l?(!rs||h._initted&&h._ts)&&h.globalTime(0)<=n&&h.globalTime(h.totalDuration())>n:!n||h.isActive())&&a.push(h):(c=h.getTweensOf(o,n)).length&&a.push.apply(a,c),h=h._next;return a},e.tweenTo=function(r,n){n=n||{};var a=this,o=Be(a,r),h=n,l=h.startAt,c=h.onStart,d=h.onStartParams,u=h.immediateRender,f,p=Vt.to(a,De({ease:n.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:n.duration||Math.abs((o-(l&&"time"in l?l.time:a._time))/a.timeScale())||yt,onStart:function(){if(a.pause(),!f){var _=n.duration||Math.abs((o-(l&&"time"in l?l.time:a._time))/a.timeScale());p._dur!==_&&yr(p,_,0,1).render(p._time,!0,!0),f=1}c&&c.apply(p,d||[])}},n));return u?p.render(0):p},e.tweenFromTo=function(r,n,a){return this.tweenTo(n,De({startAt:{time:Be(this,r)}},a))},e.recent=function(){return this._recent},e.nextLabel=function(r){return r===void 0&&(r=this._time),hm(this,Be(this,r))},e.previousLabel=function(r){return r===void 0&&(r=this._time),hm(this,Be(this,r),1)},e.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+yt)},e.shiftChildren=function(r,n,a){a===void 0&&(a=0);for(var o=this._first,h=this.labels,l;o;)o._start>=a&&(o._start+=r,o._end+=r),o=o._next;if(n)for(l in h)h[l]>=a&&(h[l]+=r);return Is(this)},e.invalidate=function(r){var n=this._first;for(this._lock=0;n;)n.invalidate(r),n=n._next;return s.prototype.invalidate.call(this,r)},e.clear=function(r){r===void 0&&(r=!0);for(var n=this._first,a;n;)a=n._next,this.remove(n),n=a;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),Is(this)},e.totalDuration=function(r){var n=0,a=this,o=a._last,h=Me,l,c,d;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-r:r));if(a._dirty){for(d=a.parent;o;)l=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>h&&a._sort&&o._ts&&!a._lock?(a._lock=1,fi(a,o,c-o._delay,1)._lock=0):h=c,c<0&&o._ts&&(n-=c,(!d&&!a._dp||d&&d.smoothChildTiming)&&(a._start+=c/a._ts,a._time-=c,a._tTime-=c),a.shiftChildren(-c,!1,-1/0),h=0),o._end>n&&o._ts&&(n=o._end),o=l;yr(a,a===Ct&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},t.updateRoot=function(r){if(Ct._ts&&($p(Ct,eo(r,Ct)),Vp=be.frame),be.frame>=Wp){Wp+=ge.autoSleep||120;var n=Ct._first;if((!n||!n._ts)&&ge.autoSleep&&be._listeners.length<2){for(;n&&!n._ts;)n=n._next;n||be.sleep()}}},t}(gn);De(ne.prototype,{_lock:0,_hasPause:0,_forcing:0});var iw=function(t,e,i,r,n,a,o){var h=new ue(this._pt,t,e,0,1,Em,null,n),l=0,c=0,d,u,f,p,m,_,y,v;for(h.b=i,h.e=r,i+="",r+="",(y=~r.indexOf("random("))&&(r=fn(r)),a&&(v=[i,r],a(v,t,e),i=v[0],r=v[1]),u=i.match(Cl)||[];d=Cl.exec(r);)p=d[0],m=r.substring(l,d.index),f?f=(f+1)%5:m.substr(-5)==="rgba("&&(f=1),p!==u[c++]&&(_=parseFloat(u[c-1])||0,h._pt={_next:h._pt,p:m||c===1?m:",",s:_,c:p.charAt(1)==="="?_r(_,p)-_:parseFloat(p)-_,m:f&&f<4?Math.round:0},l=Cl.lastIndex);return h.c=l<r.length?r.substring(l,r.length):"",h.fp=o,(kp.test(r)||y)&&(h.e=0),this._pt=h,h},Xl=function(t,e,i,r,n,a,o,h,l,c){Lt(r)&&(r=r(n||0,t,a));var d=t[e],u=i!=="get"?i:Lt(d)?l?t[e.indexOf("set")||!Lt(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():d,f=Lt(d)?l?ow:Tm:Yl,p;if(jt(r)&&(~r.indexOf("random(")&&(r=fn(r)),r.charAt(1)==="="&&(p=_r(u,r)+(ie(u)||0),(p||p===0)&&(r=p))),!c||u!==r||$l)return!isNaN(u*r)&&r!==""?(p=new ue(this._pt,t,e,+u||0,r-(u||0),typeof d=="boolean"?lw:wm,0,f),l&&(p.fp=l),o&&p.modifier(o,this,t),this._pt=p):(!d&&!(e in t)&&Il(e,r),iw.call(this,t,e,u,r,f,h||ge.stringFilter,l))},sw=function(t,e,i,r,n){if(Lt(t)&&(t=yn(t,n,e,i,r)),!ui(t)||t.style&&t.nodeType||ee(t)||Fp(t))return jt(t)?yn(t,n,e,i,r):t;var a={},o;for(o in t)a[o]=yn(t[o],n,e,i,r);return a},xm=function(t,e,i,r,n,a){var o,h,l,c;if(xe[t]&&(o=new xe[t]).init(n,o.rawVars?e[t]:sw(e[t],r,n,a,i),i,r,a)!==!1&&(i._pt=h=new ue(i._pt,n,t,0,1,o.render,o,0,o.priority),i!==xr))for(l=i._ptLookup[i._targets.indexOf(n)],c=o._props.length;c--;)l[o._props[c]]=h;return o},rs,$l,zl=function s(t,e,i){var r=t.vars,n=r.ease,a=r.startAt,o=r.immediateRender,h=r.lazy,l=r.onUpdate,c=r.runBackwards,d=r.yoyoEase,u=r.keyframes,f=r.autoRevert,p=t._dur,m=t._startAt,_=t._targets,y=t.parent,v=y&&y.data==="nested"?y.vars.targets:_,g=t._overwrite==="auto"&&!Tl,x=t.timeline,b,w,T,E,A,P,L,M,S,C,R,N,F;if(x&&(!u||!n)&&(n="none"),t._ease=Ms(n,pr.ease),t._yEase=d?mm(Ms(d===!0?n:d,pr.ease)):0,d&&t._yoyo&&!t._repeat&&(d=t._yEase,t._yEase=t._ease,t._ease=d),t._from=!x&&!!r.runBackwards,!x||u&&!r.stagger){if(M=_[0]?Ps(_[0]).harness:0,N=M&&r[M.prop],b=Ja(r,Ml),m&&(m._zTime<0&&m.progress(1),e<0&&c&&o&&!f?m.render(-1,!0):m.revert(c&&p?Ka:MT),m._lazy=0),a){if(es(t._startAt=Vt.set(_,De({data:"isStart",overwrite:!1,parent:y,immediateRender:!0,lazy:!m&&le(h),startAt:null,delay:0,onUpdate:l&&function(){return ve(t,"onUpdate")},stagger:0},a))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(te||!o&&!f)&&t._startAt.revert(Ka),o&&p&&e<=0&&i<=0){e&&(t._zTime=e);return}}else if(c&&p&&!m){if(e&&(o=!1),T=De({overwrite:!1,data:"isFromStart",lazy:o&&!m&&le(h),immediateRender:o,stagger:0,parent:y},b),N&&(T[M.prop]=N),es(t._startAt=Vt.set(_,T)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(te?t._startAt.revert(Ka):t._startAt.render(-1,!0)),t._zTime=e,!o)s(t._startAt,yt,yt);else if(!e)return}for(t._pt=t._ptCache=0,h=p&&le(h)||h&&!p,w=0;w<_.length;w++){if(A=_[w],L=A._gsap||Fl(_)[w]._gsap,t._ptLookup[w]=C={},Dl[L.id]&&ts.length&&Qa(),R=v===_?w:v.indexOf(A),M&&(S=new M).init(A,N||b,t,R,v)!==!1&&(t._pt=E=new ue(t._pt,A,S.name,0,1,S.render,S,0,S.priority),S._props.forEach(function(B){C[B]=E}),S.priority&&(P=1)),!M||N)for(T in b)xe[T]&&(S=xm(T,b,t,R,A,v))?S.priority&&(P=1):C[T]=E=Xl.call(t,A,T,"get",b[T],R,v,0,r.stringFilter);t._op&&t._op[w]&&t.kill(A,t._op[w]),g&&t._pt&&(rs=t,Ct.killTweensOf(A,C,t.globalTime(e)),F=!t.parent,rs=0),t._pt&&h&&(Dl[L.id]=1)}P&&Am(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!F,u&&e<=0&&x.render(Me,!0,!0)},rw=function(t,e,i,r,n,a,o,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[e],c,d,u,f;if(!l)for(l=t._ptCache[e]=[],u=t._ptLookup,f=t._targets.length;f--;){if(c=u[f][e],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==e&&c.fp!==e;)c=c._next;if(!c)return $l=1,t.vars[e]="+=0",zl(t,o),$l=0,h?hn(e+" not eligible for reset"):1;l.push(c)}for(f=l.length;f--;)d=l[f],c=d._pt||d,c.s=(r||r===0)&&!n?r:c.s+(r||0)+a*c.c,c.c=i-c.s,d.e&&(d.e=Ut(i)+ie(d.e)),d.b&&(d.b=c.s+ie(d.b))},nw=function(t,e){var i=t[0]?Ps(t[0]).harness:0,r=i&&i.aliases,n,a,o,h;if(!r)return e;n=Rs({},e);for(a in r)if(a in n)for(h=r[a].split(","),o=h.length;o--;)n[h[o]]=n[a];return n},aw=function(t,e,i,r){var n=e.ease||r||"power1.inOut",a,o;if(ee(e))o=i[t]||(i[t]=[]),e.forEach(function(h,l){return o.push({t:l/(e.length-1)*100,v:h,e:n})});else for(a in e)o=i[a]||(i[a]=[]),a==="ease"||o.push({t:parseFloat(t),v:e[a],e:n})},yn=function(t,e,i,r,n){return Lt(t)?t.call(e,i,r,n):jt(t)&&~t.indexOf("random(")?fn(t):t},vm=Ol+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",bm={};ce(vm+",id,stagger,delay,duration,paused,scrollTrigger",function(s){return bm[s]=1});var Vt=function(s){Bp(t,s);function t(i,r,n,a){var o;typeof r=="number"&&(n.duration=r,r=n,n=null),o=s.call(this,a?r:cn(r))||this;var h=o.vars,l=h.duration,c=h.delay,d=h.immediateRender,u=h.stagger,f=h.overwrite,p=h.keyframes,m=h.defaults,_=h.scrollTrigger,y=h.yoyoEase,v=r.parent||Ct,g=(ee(i)||Fp(i)?Bi(i[0]):"length"in r)?[i]:Oe(i),x,b,w,T,E,A,P,L;if(o._targets=g.length?Fl(g):hn("GSAP target "+i+" not found. https://gsap.com",!ge.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=f,p||u||ja(l)||ja(c)){if(r=o.vars,x=o.timeline=new ne({data:"nested",defaults:m||{},targets:v&&v.data==="nested"?v.vars.targets:g}),x.kill(),x.parent=x._dp=Di(o),x._start=0,u||ja(l)||ja(c)){if(T=g.length,P=u&&sm(u),ui(u))for(E in u)~vm.indexOf(E)&&(L||(L={}),L[E]=u[E]);for(b=0;b<T;b++)w=Ja(r,bm),w.stagger=0,y&&(w.yoyoEase=y),L&&Rs(w,L),A=g[b],w.duration=+yn(l,Di(o),b,A,g),w.delay=(+yn(c,Di(o),b,A,g)||0)-o._delay,!u&&T===1&&w.delay&&(o._delay=c=w.delay,o._start+=c,w.delay=0),x.to(A,w,P?P(b,A,g):0),x._ease=at.none;x.duration()?l=c=0:o.timeline=0}else if(p){cn(De(x.vars.defaults,{ease:"none"})),x._ease=Ms(p.ease||r.ease||"none");var M=0,S,C,R;if(ee(p))p.forEach(function(N){return x.to(g,N,">")}),x.duration();else{w={};for(E in p)E==="ease"||E==="easeEach"||aw(E,p[E],w,p.easeEach);for(E in w)for(S=w[E].sort(function(N,F){return N.t-F.t}),M=0,b=0;b<S.length;b++)C=S[b],R={ease:C.e,duration:(C.t-(b?S[b-1].t:0))/100*l},R[E]=C.v,x.to(g,R,M),M+=R.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||o.duration(l=x.duration())}else o.timeline=0;return f===!0&&!Tl&&(rs=Di(o),Ct.killTweensOf(g),rs=0),fi(v,Di(o),n),r.reversed&&o.reverse(),r.paused&&o.paused(!0),(d||!l&&!p&&o._start===qt(v._time)&&le(d)&&kT(Di(o))&&v.data!=="nested")&&(o._tTime=-yt,o.render(Math.max(0,-c)||0)),_&&Qp(Di(o),_),o}var e=t.prototype;return e.render=function(r,n,a){var o=this._time,h=this._tDur,l=this._dur,c=r<0,d=r>h-yt&&!c?h:r<yt?0:r,u,f,p,m,_,y,v,g,x;if(!l)UT(this,r,n,a);else if(d!==this._tTime||!r||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c){if(u=d,g=this.timeline,this._repeat){if(m=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(m*100+r,n,a);if(u=qt(d%m),d===h?(p=this._repeat,u=l):(p=~~(d/m),p&&p===qt(d/m)&&(u=l,p--),u>l&&(u=l)),y=this._yoyo&&p&1,y&&(x=this._yEase,u=l-u),_=gr(this._tTime,m),u===o&&!a&&this._initted&&p===_)return this._tTime=d,this;p!==_&&(g&&this._yEase&&_m(g,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==m&&this._initted&&(this._lock=a=1,this.render(qt(m*p),!0).invalidate()._lock=0))}if(!this._initted){if(Jp(this,c?r:u,a,n,d))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&p!==_))return this;if(l!==this._dur)return this.render(r,n,a)}if(this._tTime=d,this._time=u,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=v=(x||this._ease)(u/l),this._from&&(this.ratio=v=1-v),u&&!o&&!n&&!p&&(ve(this,"onStart"),this._tTime!==d))return this;for(f=this._pt;f;)f.r(v,f.d),f=f._next;g&&g.render(r<0?r:g._dur*g._ease(u/this._dur),n,a)||this._startAt&&(this._zTime=r),this._onUpdate&&!n&&(c&&Ll(this,r,n,a),ve(this,"onUpdate")),this._repeat&&p!==_&&this.vars.onRepeat&&!n&&this.parent&&ve(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(c&&!this._onUpdate&&Ll(this,r,!0,!0),(r||!l)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&es(this,1),!n&&!(c&&!o)&&(d||o||y)&&(ve(this,d===h?"onComplete":"onReverseComplete",!0),this._prom&&!(d<h&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),s.prototype.invalidate.call(this,r)},e.resetTo=function(r,n,a,o,h){_n||be.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||zl(this,l),c=this._ease(l/this._dur),rw(this,r,n,a,o,c,l,h)?this.resetTo(r,n,a,o,1):(so(this,0),this.parent||qp(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(r,n){if(n===void 0&&(n="all"),!r&&(!n||n==="all"))return this._lazy=this._pt=0,this.parent?pn(this):this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(r,n,rs&&rs.vars.overwrite!==!0)._first||pn(this),this.parent&&a!==this.timeline.totalDuration()&&yr(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,h=r?Oe(r):o,l=this._ptLookup,c=this._pt,d,u,f,p,m,_,y;if((!n||n==="all")&&FT(o,h))return n==="all"&&(this._pt=0),pn(this);for(d=this._op=this._op||[],n!=="all"&&(jt(n)&&(m={},ce(n,function(v){return m[v]=1}),n=m),n=nw(o,n)),y=o.length;y--;)if(~h.indexOf(o[y])){u=l[y],n==="all"?(d[y]=n,p=u,f={}):(f=d[y]=d[y]||{},p=n);for(m in p)_=u&&u[m],_&&((!("kill"in _.d)||_.d.kill(m)===!0)&&to(this,_,"_pt"),delete u[m]),f!=="all"&&(f[m]=1)}return this._initted&&!this._pt&&c&&pn(this),this},t.to=function(r,n){return new t(r,n,arguments[2])},t.from=function(r,n){return un(1,arguments)},t.delayedCall=function(r,n,a,o){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:n,onReverseComplete:n,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},t.fromTo=function(r,n,a){return un(2,arguments)},t.set=function(r,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(r,n)},t.killTweensOf=function(r,n,a){return Ct.killTweensOf(r,n,a)},t}(gn);De(Vt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ce("staggerTo,staggerFrom,staggerFromTo",function(s){Vt[s]=function(){var t=new ne,e=Nl.call(arguments,0);return e.splice(s==="staggerFromTo"?5:4,0,0),t[s].apply(t,e)}});var Yl=function(t,e,i){return t[e]=i},Tm=function(t,e,i){return t[e](i)},ow=function(t,e,i,r){return t[e](r.fp,i)},hw=function(t,e,i){return t.setAttribute(e,i)},jl=function(t,e){return Lt(t[e])?Tm:El(t[e])&&t.setAttribute?hw:Yl},wm=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},lw=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Em=function(t,e){var i=e._pt,r="";if(!t&&e.b)r=e.b;else if(t===1&&e.e)r=e.e;else{for(;i;)r=i.p+(i.m?i.m(i.s+i.c*t):Math.round((i.s+i.c*t)*1e4)/1e4)+r,i=i._next;r+=e.c}e.set(e.t,e.p,r,e)},ql=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},cw=function(t,e,i,r){for(var n=this._pt,a;n;)a=n._next,n.p===r&&n.modifier(t,e,i),n=a},uw=function(t){for(var e=this._pt,i,r;e;)r=e._next,e.p===t&&!e.op||e.op===t?to(this,e,"_pt"):e.dep||(i=1),e=r;return!i},dw=function(t,e,i,r){r.mSet(t,e,r.m.call(r.tween,i,r.mt),r)},Am=function(t){for(var e=t._pt,i,r,n,a;e;){for(i=e._next,r=n;r&&r.pr>e.pr;)r=r._next;(e._prev=r?r._prev:a)?e._prev._next=e:n=e,(e._next=r)?r._prev=e:a=e,e=i}t._pt=n},ue=function(){function s(e,i,r,n,a,o,h,l,c){this.t=i,this.s=n,this.c=a,this.p=r,this.r=o||wm,this.d=h||this,this.set=l||Yl,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=s.prototype;return t.modifier=function(i,r,n){this.mSet=this.mSet||this.set,this.set=dw,this.m=i,this.mt=n,this.tween=r},s}();ce(Ol+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(s){return Ml[s]=1}),ye.TweenMax=ye.TweenLite=Vt,ye.TimelineLite=ye.TimelineMax=ne,Ct=new ne({sortChildren:!1,defaults:pr,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),ge.stringFilter=pm;var Bs=[],ro={},fw=[],Sm=0,pw=0,Kl=function(t){return(ro[t]||fw).map(function(e){return e()})},Zl=function(){var t=Date.now(),e=[];t-Sm>2&&(Kl("matchMediaInit"),Bs.forEach(function(i){var r=i.queries,n=i.conditions,a,o,h,l;for(o in r)a=di.matchMedia(r[o]).matches,a&&(h=1),a!==n[o]&&(n[o]=a,l=1);l&&(i.revert(),h&&e.push(i))}),Kl("matchMediaRevert"),e.forEach(function(i){return i.onMatch(i,function(r){return i.add(null,r)})}),Sm=t,Kl("matchMedia"))},Cm=function(){function s(e,i){this.selector=i&&Ul(i),this.data=[],this._r=[],this.isReverted=!1,this.id=pw++,e&&this.add(e)}var t=s.prototype;return t.add=function(i,r,n){Lt(i)&&(n=r,r=i,i=Lt);var a=this,o=function(){var l=Tt,c=a.selector,d;return l&&l!==a&&l.data.push(a),n&&(a.selector=Ul(n)),Tt=a,d=r.apply(a,arguments),Lt(d)&&a._r.push(d),Tt=l,a.selector=c,a.isReverted=!1,d};return a.last=o,i===Lt?o(a,function(h){return a.add(null,h)}):i?a[i]=o:o},t.ignore=function(i){var r=Tt;Tt=null,i(this),Tt=r},t.getTweens=function(){var i=[];return this.data.forEach(function(r){return r instanceof s?i.push.apply(i,r.getTweens()):r instanceof Vt&&!(r.parent&&r.parent.data==="nested")&&i.push(r)}),i},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(i,r){var n=this;if(i?function(){for(var o=n.getTweens(),h=n.data.length,l;h--;)l=n.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,d){return d.g-c.g||-1/0}).forEach(function(c){return c.t.revert(i)}),h=n.data.length;h--;)l=n.data[h],l instanceof ne?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Vt)&&l.revert&&l.revert(i);n._r.forEach(function(c){return c(i,n)}),n.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),r)for(var a=Bs.length;a--;)Bs[a].id===this.id&&Bs.splice(a,1)},t.revert=function(i){this.kill(i||{})},s}(),mw=function(){function s(e){this.contexts=[],this.scope=e,Tt&&Tt.data.push(this)}var t=s.prototype;return t.add=function(i,r,n){ui(i)||(i={matches:i});var a=new Cm(0,n||this.scope),o=a.conditions={},h,l,c;Tt&&!a.selector&&(a.selector=Tt.selector),this.contexts.push(a),r=a.add("onMatch",r),a.queries=i;for(l in i)l==="all"?c=1:(h=di.matchMedia(i[l]),h&&(Bs.indexOf(a)<0&&Bs.push(a),(o[l]=h.matches)&&(c=1),h.addListener?h.addListener(Zl):h.addEventListener("change",Zl)));return c&&r(a,function(d){return a.add(null,d)}),this},t.revert=function(i){this.kill(i||{})},t.kill=function(i){this.contexts.forEach(function(r){return r.kill(i,!0)})},s}(),no={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach(function(r){return cm(r)})},timeline:function(t){return new ne(t)},getTweensOf:function(t,e){return Ct.getTweensOf(t,e)},getProperty:function(t,e,i,r){jt(t)&&(t=Oe(t)[0]);var n=Ps(t||{}).get,a=i?Yp:zp;return i==="native"&&(i=""),t&&(e?a((xe[e]&&xe[e].get||n)(t,e,i,r)):function(o,h,l){return a((xe[o]&&xe[o].get||n)(t,o,h,l))})},quickSetter:function(t,e,i){if(t=Oe(t),t.length>1){var r=t.map(function(c){return de.quickSetter(c,e,i)}),n=r.length;return function(c){for(var d=n;d--;)r[d](c)}}t=t[0]||{};var a=xe[e],o=Ps(t),h=o.harness&&(o.harness.aliases||{})[e]||e,l=a?function(c){var d=new a;xr._pt=0,d.init(t,i?c+i:c,xr,0,[t]),d.render(1,d),xr._pt&&ql(1,xr)}:o.set(t,h);return a?l:function(c){return l(t,h,i?c+i:c,o,1)}},quickTo:function(t,e,i){var r,n=de.to(t,Rs((r={},r[e]="+=0.1",r.paused=!0,r),i||{})),a=function(h,l,c){return n.resetTo(e,h,l,c)};return a.tween=n,a},isTweening:function(t){return Ct.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Ms(t.ease,pr.ease)),jp(pr,t||{})},config:function(t){return jp(ge,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,r=t.plugins,n=t.defaults,a=t.extendTimeline;(r||"").split(",").forEach(function(o){return o&&!xe[o]&&!ye[o]&&hn(e+" effect requires "+o+" plugin.")}),Bl[e]=function(o,h,l){return i(Oe(o),De(h||{},n),l)},a&&(ne.prototype[e]=function(o,h,l){return this.add(Bl[e](o,ui(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,e){at[t]=Ms(e)},parseEase:function(t,e){return arguments.length?Ms(t,e):at},getById:function(t){return Ct.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var i=new ne(t),r,n;for(i.smoothChildTiming=le(t.smoothChildTiming),Ct.remove(i),i._dp=0,i._time=i._tTime=Ct._time,r=Ct._first;r;)n=r._next,(e||!(!r._dur&&r instanceof Vt&&r.vars.onComplete===r._targets[0]))&&fi(i,r,r._start-r._delay),r=n;return fi(Ct,i,0),i},context:function(t,e){return t?new Cm(t,e):Tt},matchMedia:function(t){return new mw(t)},matchMediaRefresh:function(){return Bs.forEach(function(t){var e=t.conditions,i,r;for(r in e)e[r]&&(e[r]=!1,i=1);i&&t.revert()})||Zl()},addEventListener:function(t,e){var i=ro[t]||(ro[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=ro[t],r=i&&i.indexOf(e);r>=0&&i.splice(r,1)},utils:{wrap:YT,wrapYoyo:jT,distribute:sm,random:nm,snap:rm,normalize:zT,getUnit:ie,clamp:VT,splitColor:um,toArray:Oe,selector:Ul,mapRange:om,pipe:XT,unitize:$T,interpolate:qT,shuffle:im},install:Gp,effects:Bl,ticker:be,updateRoot:ne.updateRoot,plugins:xe,globalTimeline:Ct,core:{PropTween:ue,globals:Hp,Tween:Vt,Timeline:ne,Animation:gn,getCache:Ps,_removeLinkedListItem:to,reverting:function(){return te},context:function(t){return t&&Tt&&(Tt.data.push(t),t._ctx=Tt),Tt},suppressOverwrites:function(t){return Tl=t}}};ce("to,from,fromTo,delayedCall,set,killTweensOf",function(s){return no[s]=Vt[s]}),be.add(ne.updateRoot),xr=no.to({},{duration:0});var _w=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},gw=function(t,e){var i=t._targets,r,n,a;for(r in e)for(n=i.length;n--;)a=t._ptLookup[n][r],a&&(a=a.d)&&(a._pt&&(a=_w(a,r)),a&&a.modifier&&a.modifier(e[r],t,i[n],r))},Ql=function(t,e){return{name:t,rawVars:1,init:function(r,n,a){a._onInit=function(o){var h,l;if(jt(n)&&(h={},ce(n,function(c){return h[c]=1}),n=h),e){h={};for(l in n)h[l]=e(n[l]);n=h}gw(o,n)}}}},de=no.registerPlugin({name:"attr",init:function(t,e,i,r,n){var a,o,h;this.tween=i;for(a in e)h=t.getAttribute(a)||"",o=this.add(t,"setAttribute",(h||0)+"",e[a],r,n,0,0,a),o.op=a,o.b=h,this._props.push(a)},render:function(t,e){for(var i=e._pt;i;)te?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},Ql("roundProps",Gl),Ql("modifiers"),Ql("snap",rm))||no;Vt.version=ne.version=de.version="3.12.5",Up=1,Al()&&vr(),at.Power0,at.Power1,at.Power2,at.Power3,at.Power4,at.Linear,at.Quad,at.Cubic,at.Quart,at.Quint,at.Strong,at.Elastic,at.Back,at.SteppedEase,at.Bounce,at.Sine,at.Expo,at.Circ;/*!
|
|
1156
1156
|
* CSSPlugin 3.12.5
|
|
1157
1157
|
* https://gsap.com
|
|
1158
1158
|
*
|
|
@@ -1160,13 +1160,13 @@ void main(void)\r
|
|
|
1160
1160
|
* Subject to the terms at https://gsap.com/standard-license or for
|
|
1161
1161
|
* Club GSAP members, the agreement issued with that membership.
|
|
1162
1162
|
* @author: Jack Doyle, jack@greensock.com
|
|
1163
|
-
*/var bm,rs,vr,jl,Bs,Tm,ql,nw=function(){return typeof window<"u"},Bi={},Os=180/Math.PI,br=Math.PI/180,Tr=Math.atan2,wm=1e8,Kl=/([A-Z])/g,aw=/(left|right|width|margin|padding|x)/i,ow=/[\s,\(]\S/,fi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Zl=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},hw=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},lw=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},cw=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},Em=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Am=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},uw=function(t,e,i){return t.style[e]=i},dw=function(t,e,i){return t.style.setProperty(e,i)},fw=function(t,e,i){return t._gsap[e]=i},pw=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},mw=function(t,e,i,r,n){var a=t._gsap;a.scaleX=a.scaleY=i,a.renderTransform(n,a)},gw=function(t,e,i,r,n){var a=t._gsap;a[e]=i,a.renderTransform(n,a)},Pt="transform",fe=Pt+"Origin",_w=function s(t,e){var i=this,r=this.target,n=r.style,a=r._gsap;if(t in Bi&&n){if(this.tfm=this.tfm||{},t!=="transform")t=fi[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return i.tfm[o]=Oi(r,o)}):this.tfm[t]=a.x?a[t]:Oi(r,t),t===fe&&(this.tfm.zOrigin=a.zOrigin);else return fi.transform.split(",").forEach(function(o){return s.call(i,o,e)});if(this.props.indexOf(Pt)>=0)return;a.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(fe,e,"")),t=Pt}(n||e)&&this.props.push(t,e,n[t])},Sm=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},yw=function(){var t=this.props,e=this.target,i=e.style,r=e._gsap,n,a;for(n=0;n<t.length;n+=3)t[n+1]?e[t[n]]=t[n+2]:t[n+2]?i[t[n]]=t[n+2]:i.removeProperty(t[n].substr(0,2)==="--"?t[n]:t[n].replace(Kl,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)r[a]=this.tfm[a];r.svg&&(r.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),n=ql(),(!n||!n.isStart)&&!i[Pt]&&(Sm(i),r.zOrigin&&i[fe]&&(i[fe]+=" "+r.zOrigin+"px",r.zOrigin=0,r.renderTransform()),r.uncache=1)}},Cm=function(t,e){var i={target:t,props:[],revert:yw,save:_w};return t._gsap||de.core.getCache(t),e&&e.split(",").forEach(function(r){return i.save(r)}),i},Pm,Ql=function(t,e){var i=rs.createElementNS?rs.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):rs.createElement(t);return i&&i.style?i:rs.createElement(t)},pi=function s(t,e,i){var r=getComputedStyle(t);return r[e]||r.getPropertyValue(e.replace(Kl,"-$1").toLowerCase())||r.getPropertyValue(e)||!i&&s(t,wr(e)||e,1)||""},Rm="O,Moz,ms,Ms,Webkit".split(","),wr=function(t,e,i){var r=e||Bs,n=r.style,a=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);a--&&!(Rm[a]+t in n););return a<0?null:(a===3?"ms":a>=0?Rm[a]:"")+t},Jl=function(){nw()&&window.document&&(bm=window,rs=bm.document,vr=rs.documentElement,Bs=Ql("div")||{style:{}},Ql("div"),Pt=wr(Pt),fe=Pt+"Origin",Bs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Pm=!!wr("perspective"),ql=de.core.reverting,jl=1)},tc=function s(t){var e=Ql("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,r=this.nextSibling,n=this.style.cssText,a;if(vr.appendChild(e),e.appendChild(this),this.style.display="block",t)try{a=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=s}catch{}else this._gsapBBox&&(a=this._gsapBBox());return i&&(r?i.insertBefore(this,r):i.appendChild(this)),vr.removeChild(e),this.style.cssText=n,a},Im=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},Mm=function(t){var e;try{e=t.getBBox()}catch{e=tc.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===tc||(e=tc.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Im(t,["x","cx","x1"])||0,y:+Im(t,["y","cy","y1"])||0,width:0,height:0}:e},Dm=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Mm(t))},Fs=function(t,e){if(e){var i=t.style,r;e in Bi&&e!==fe&&(e=Pt),i.removeProperty?(r=e.substr(0,2),(r==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(r==="--"?e:e.replace(Kl,"-$1").toLowerCase())):i.removeAttribute(e)}},ns=function(t,e,i,r,n,a){var o=new ue(t._pt,e,i,0,1,a?Am:Em);return t._pt=o,o.b=r,o.e=n,t._props.push(i),o},Bm={deg:1,rad:1,turn:1},xw={grid:1,flex:1},as=function s(t,e,i,r){var n=parseFloat(i)||0,a=(i+"").trim().substr((n+"").length)||"px",o=Bs.style,h=aw.test(e),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),d=100,u=r==="px",f=r==="%",p,m,g,y;if(r===a||!n||Bm[r]||Bm[a])return n;if(a!=="px"&&!u&&(n=s(t,e,i,"px")),y=t.getCTM&&Dm(t),(f||a==="%")&&(Bi[e]||~e.indexOf("adius")))return p=y?t.getBBox()[h?"width":"height"]:t[c],Nt(f?n/p*d:n/100*p);if(o[h?"width":"height"]=d+(u?a:r),m=~e.indexOf("adius")||r==="em"&&t.appendChild&&!l?t:t.parentNode,y&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===rs||!m.appendChild)&&(m=rs.body),g=m._gsap,g&&f&&g.width&&h&&g.time===be.time&&!g.uncache)return Nt(n/g.width*d);if(f&&(e==="height"||e==="width")){var v=t.style[e];t.style[e]=d+r,p=t[c],v?t.style[e]=v:Fs(t,e)}else(f||a==="%")&&!xw[pi(m,"display")]&&(o.position=pi(t,"position")),m===t&&(o.position="static"),m.appendChild(Bs),p=Bs[c],m.removeChild(Bs),o.position="absolute";return h&&f&&(g=Cs(m),g.time=be.time,g.width=m[c]),Nt(u?p*n/d:p&&n?d/p*n:0)},Oi=function(t,e,i,r){var n;return jl||Jl(),e in fi&&e!=="transform"&&(e=fi[e],~e.indexOf(",")&&(e=e.split(",")[0])),Bi[e]&&e!=="transform"?(n=xn(t,r),n=e!=="transformOrigin"?n[e]:n.svg?n.origin:no(pi(t,fe))+" "+n.zOrigin+"px"):(n=t.style[e],(!n||n==="auto"||r||~(n+"").indexOf("calc("))&&(n=ro[e]&&ro[e](t,e,i)||pi(t,e)||kp(t,e)||(e==="opacity"?1:0))),i&&!~(n+"").trim().indexOf(" ")?as(t,e,n,i)+i:n},vw=function(t,e,i,r){if(!i||i==="none"){var n=wr(e,t,1),a=n&&pi(t,n,1);a&&a!==i?(e=n,i=a):e==="borderColor"&&(i=pi(t,"borderTopColor"))}var o=new ue(this._pt,t.style,e,0,1,_m),h=0,l=0,c,d,u,f,p,m,g,y,v,_,x,b;if(o.b=i,o.e=r,i+="",r+="",r==="auto"&&(m=t.style[e],t.style[e]=r,r=pi(t,e)||r,m?t.style[e]=m:Fs(t,e)),c=[i,r],om(c),i=c[0],r=c[1],u=i.match(pr)||[],b=r.match(pr)||[],b.length){for(;d=pr.exec(r);)g=d[0],v=r.substring(h,d.index),p?p=(p+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(p=1),g!==(m=u[l++]||"")&&(f=parseFloat(m)||0,x=m.substr((f+"").length),g.charAt(1)==="="&&(g=mr(f,g)+x),y=parseFloat(g),_=g.substr((y+"").length),h=pr.lastIndex-_.length,_||(_=_||_e.units[e]||x,h===r.length&&(r+=_,o.e+=_)),x!==_&&(f=as(t,e,m,_)||0),o._pt={_next:o._pt,p:v||l===1?v:",",s:f,c:y-f,m:p&&p<4||e==="zIndex"?Math.round:0});o.c=h<r.length?r.substring(h,r.length):""}else o.r=e==="display"&&r==="none"?Am:Em;return Ip.test(r)&&(o.e=0),this._pt=o,o},Om={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},bw=function(t){var e=t.split(" "),i=e[0],r=e[1]||"50%";return(i==="top"||i==="bottom"||r==="left"||r==="right")&&(t=i,i=r,r=t),e[0]=Om[i]||i,e[1]=Om[r]||r,e.join(" ")},Tw=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,r=i.style,n=e.u,a=i._gsap,o,h,l;if(n==="all"||n===!0)r.cssText="",h=1;else for(n=n.split(","),l=n.length;--l>-1;)o=n[l],Bi[o]&&(h=1,o=o==="transformOrigin"?fe:Pt),Fs(i,o);h&&(Fs(i,Pt),a&&(a.svg&&i.removeAttribute("transform"),xn(i,1),a.uncache=1,Sm(r)))}},ro={clearProps:function(t,e,i,r,n){if(n.data!=="isFromStart"){var a=t._pt=new ue(t._pt,e,i,0,0,Tw);return a.u=r,a.pr=-10,a.tween=n,t._props.push(i),1}}},yn=[1,0,0,1,0,0],Fm={},Lm=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},km=function(t){var e=pi(t,Pt);return Lm(e)?yn:e.substr(7).match(Rp).map(Nt)},ec=function(t,e){var i=t._gsap||Cs(t),r=t.style,n=km(t),a,o,h,l;return i.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,n=[h.a,h.b,h.c,h.d,h.e,h.f],n.join(",")==="1,0,0,1,0,0"?yn:n):(n===yn&&!t.offsetParent&&t!==vr&&!i.svg&&(h=r.display,r.display="block",a=t.parentNode,(!a||!t.offsetParent)&&(l=1,o=t.nextElementSibling,vr.appendChild(t)),n=km(t),h?r.display=h:Fs(t,"display"),l&&(o?a.insertBefore(t,o):a?a.appendChild(t):vr.removeChild(t))),e&&n.length>6?[n[0],n[1],n[4],n[5],n[12],n[13]]:n)},ic=function(t,e,i,r,n,a){var o=t._gsap,h=n||ec(t,!0),l=o.xOrigin||0,c=o.yOrigin||0,d=o.xOffset||0,u=o.yOffset||0,f=h[0],p=h[1],m=h[2],g=h[3],y=h[4],v=h[5],_=e.split(" "),x=parseFloat(_[0])||0,b=parseFloat(_[1])||0,w,T,E,A;i?h!==yn&&(T=f*g-p*m)&&(E=x*(g/T)+b*(-m/T)+(m*v-g*y)/T,A=x*(-p/T)+b*(f/T)-(f*v-p*y)/T,x=E,b=A):(w=Mm(t),x=w.x+(~_[0].indexOf("%")?x/100*w.width:x),b=w.y+(~(_[1]||_[0]).indexOf("%")?b/100*w.height:b)),r||r!==!1&&o.smooth?(y=x-l,v=b-c,o.xOffset=d+(y*f+v*m)-y,o.yOffset=u+(y*p+v*g)-v):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=b,o.smooth=!!r,o.origin=e,o.originIsAbsolute=!!i,t.style[fe]="0px 0px",a&&(ns(a,o,"xOrigin",l,x),ns(a,o,"yOrigin",c,b),ns(a,o,"xOffset",d,o.xOffset),ns(a,o,"yOffset",u,o.yOffset)),t.setAttribute("data-svg-origin",x+" "+b)},xn=function(t,e){var i=t._gsap||new um(t);if("x"in i&&!e&&!i.uncache)return i;var r=t.style,n=i.scaleX<0,a="px",o="deg",h=getComputedStyle(t),l=pi(t,fe)||"0",c,d,u,f,p,m,g,y,v,_,x,b,w,T,E,A,P,L,M,S,C,R,N,F,B,W,I,D,z,$,U,rt;return c=d=u=m=g=y=v=_=x=0,f=p=1,i.svg=!!(t.getCTM&&Dm(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(r[Pt]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Pt]!=="none"?h[Pt]:"")),r.scale=r.rotate=r.translate="none"),T=ec(t,i.svg),i.svg&&(i.uncache?(B=t.getBBox(),l=i.xOrigin-B.x+"px "+(i.yOrigin-B.y)+"px",F=""):F=!e&&t.getAttribute("data-svg-origin"),ic(t,F||l,!!F||i.originIsAbsolute,i.smooth!==!1,T)),b=i.xOrigin||0,w=i.yOrigin||0,T!==yn&&(L=T[0],M=T[1],S=T[2],C=T[3],c=R=T[4],d=N=T[5],T.length===6?(f=Math.sqrt(L*L+M*M),p=Math.sqrt(C*C+S*S),m=L||M?Tr(M,L)*Os:0,v=S||C?Tr(S,C)*Os+m:0,v&&(p*=Math.abs(Math.cos(v*br))),i.svg&&(c-=b-(b*L+w*S),d-=w-(b*M+w*C))):(rt=T[6],$=T[7],I=T[8],D=T[9],z=T[10],U=T[11],c=T[12],d=T[13],u=T[14],E=Tr(rt,z),g=E*Os,E&&(A=Math.cos(-E),P=Math.sin(-E),F=R*A+I*P,B=N*A+D*P,W=rt*A+z*P,I=R*-P+I*A,D=N*-P+D*A,z=rt*-P+z*A,U=$*-P+U*A,R=F,N=B,rt=W),E=Tr(-S,z),y=E*Os,E&&(A=Math.cos(-E),P=Math.sin(-E),F=L*A-I*P,B=M*A-D*P,W=S*A-z*P,U=C*P+U*A,L=F,M=B,S=W),E=Tr(M,L),m=E*Os,E&&(A=Math.cos(E),P=Math.sin(E),F=L*A+M*P,B=R*A+N*P,M=M*A-L*P,N=N*A-R*P,L=F,R=B),g&&Math.abs(g)+Math.abs(m)>359.9&&(g=m=0,y=180-y),f=Nt(Math.sqrt(L*L+M*M+S*S)),p=Nt(Math.sqrt(N*N+rt*rt)),E=Tr(R,N),v=Math.abs(E)>2e-4?E*Os:0,x=U?1/(U<0?-U:U):0),i.svg&&(F=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Lm(pi(t,Pt)),F&&t.setAttribute("transform",F))),Math.abs(v)>90&&Math.abs(v)<270&&(n?(f*=-1,v+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,v+=v<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+a,i.y=d-((i.yPercent=d&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-d)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+a,i.z=u+a,i.scaleX=Nt(f),i.scaleY=Nt(p),i.rotation=Nt(m)+o,i.rotationX=Nt(g)+o,i.rotationY=Nt(y)+o,i.skewX=v+o,i.skewY=_+o,i.transformPerspective=x+a,(i.zOrigin=parseFloat(l.split(" ")[2])||!e&&i.zOrigin||0)&&(r[fe]=no(l)),i.xOffset=i.yOffset=0,i.force3D=_e.force3D,i.renderTransform=i.svg?Ew:Pm?Nm:ww,i.uncache=0,i},no=function(t){return(t=t.split(" "))[0]+" "+t[1]},sc=function(t,e,i){var r=ie(e);return Nt(parseFloat(e)+parseFloat(as(t,"x",i+"px",r)))+r},ww=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Nm(t,e)},Ls="0deg",vn="0px",ks=") ",Nm=function(t,e){var i=e||this,r=i.xPercent,n=i.yPercent,a=i.x,o=i.y,h=i.z,l=i.rotation,c=i.rotationY,d=i.rotationX,u=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,g=i.transformPerspective,y=i.force3D,v=i.target,_=i.zOrigin,x="",b=y==="auto"&&t&&t!==1||y===!0;if(_&&(d!==Ls||c!==Ls)){var w=parseFloat(c)*br,T=Math.sin(w),E=Math.cos(w),A;w=parseFloat(d)*br,A=Math.cos(w),a=sc(v,a,T*A*-_),o=sc(v,o,-Math.sin(w)*-_),h=sc(v,h,E*A*-_+_)}g!==vn&&(x+="perspective("+g+ks),(r||n)&&(x+="translate("+r+"%, "+n+"%) "),(b||a!==vn||o!==vn||h!==vn)&&(x+=h!==vn||b?"translate3d("+a+", "+o+", "+h+") ":"translate("+a+", "+o+ks),l!==Ls&&(x+="rotate("+l+ks),c!==Ls&&(x+="rotateY("+c+ks),d!==Ls&&(x+="rotateX("+d+ks),(u!==Ls||f!==Ls)&&(x+="skew("+u+", "+f+ks),(p!==1||m!==1)&&(x+="scale("+p+", "+m+ks),v.style[Pt]=x||"translate(0, 0)"},Ew=function(t,e){var i=e||this,r=i.xPercent,n=i.yPercent,a=i.x,o=i.y,h=i.rotation,l=i.skewX,c=i.skewY,d=i.scaleX,u=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,g=i.xOffset,y=i.yOffset,v=i.forceCSS,_=parseFloat(a),x=parseFloat(o),b,w,T,E,A;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=br,l*=br,b=Math.cos(h)*d,w=Math.sin(h)*d,T=Math.sin(h-l)*-u,E=Math.cos(h-l)*u,l&&(c*=br,A=Math.tan(l-c),A=Math.sqrt(1+A*A),T*=A,E*=A,c&&(A=Math.tan(c),A=Math.sqrt(1+A*A),b*=A,w*=A)),b=Nt(b),w=Nt(w),T=Nt(T),E=Nt(E)):(b=d,E=u,w=T=0),(_&&!~(a+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(_=as(f,"x",a,"px"),x=as(f,"y",o,"px")),(p||m||g||y)&&(_=Nt(_+p-(p*b+m*T)+g),x=Nt(x+m-(p*w+m*E)+y)),(r||n)&&(A=f.getBBox(),_=Nt(_+r/100*A.width),x=Nt(x+n/100*A.height)),A="matrix("+b+","+w+","+T+","+E+","+_+","+x+")",f.setAttribute("transform",A),v&&(f.style[Pt]=A)},Aw=function(t,e,i,r,n){var a=360,o=jt(n),h=parseFloat(n)*(o&&~n.indexOf("rad")?Os:1),l=h-r,c=r+l+"deg",d,u;return o&&(d=n.split("_")[1],d==="short"&&(l%=a,l!==l%(a/2)&&(l+=l<0?a:-a)),d==="cw"&&l<0?l=(l+a*wm)%a-~~(l/a)*a:d==="ccw"&&l>0&&(l=(l-a*wm)%a-~~(l/a)*a)),t._pt=u=new ue(t._pt,e,i,r,l,hw),u.e=c,u.u="deg",t._props.push(i),u},Um=function(t,e){for(var i in e)t[i]=e[i];return t},Sw=function(t,e,i){var r=Um({},i._gsap),n="perspective,force3D,transformOrigin,svgOrigin",a=i.style,o,h,l,c,d,u,f,p;r.svg?(l=i.getAttribute("transform"),i.setAttribute("transform",""),a[Pt]=e,o=xn(i,1),Fs(i,Pt),i.setAttribute("transform",l)):(l=getComputedStyle(i)[Pt],a[Pt]=e,o=xn(i,1),a[Pt]=l);for(h in Bi)l=r[h],c=o[h],l!==c&&n.indexOf(h)<0&&(f=ie(l),p=ie(c),d=f!==p?as(i,h,l,p):parseFloat(l),u=parseFloat(c),t._pt=new ue(t._pt,o,h,d,u-d,Zl),t._pt.u=p||0,t._props.push(h));Um(o,r)};ce("padding,margin,Width,Radius",function(s,t){var e="Top",i="Right",r="Bottom",n="Left",a=(t<3?[e,i,r,n]:[e+n,e+i,r+i,r+n]).map(function(o){return t<2?s+o:"border"+o+s});ro[t>1?"border"+s:s]=function(o,h,l,c,d){var u,f;if(arguments.length<4)return u=a.map(function(p){return Oi(o,p,l)}),f=u.join(" "),f.split(u[0]).length===5?u[0]:f;u=(c+"").split(" "),f={},a.forEach(function(p,m){return f[p]=u[m]=u[m]||u[(m-1)/2|0]}),o.init(h,f,d)}});var Gm={name:"css",register:Jl,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,r,n){var a=this._props,o=t.style,h=i.vars.startAt,l,c,d,u,f,p,m,g,y,v,_,x,b,w,T,E;jl||Jl(),this.styles=this.styles||Cm(t),E=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(xe[m]&&dm(m,e,i,r,t,n)))){if(f=typeof c,p=ro[m],f==="function"&&(c=c.call(i,r,t,n),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=dn(c)),p)p(this,t,m,c,i)&&(T=1);else if(m.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",is.lastIndex=0,is.test(l)||(g=ie(l),y=ie(c)),y?g!==y&&(l=as(t,m,l,y)+y):g&&(c+=g),this.add(o,"setProperty",l,c,r,n,0,0,m),a.push(m),E.push(m,0,o[m]);else if(f!=="undefined"){if(h&&m in h?(l=typeof h[m]=="function"?h[m].call(i,r,t,n):h[m],jt(l)&&~l.indexOf("random(")&&(l=dn(l)),ie(l+"")||l==="auto"||(l+=_e.units[m]||ie(Oi(t,m))||""),(l+"").charAt(1)==="="&&(l=Oi(t,m))):l=Oi(t,m),u=parseFloat(l),v=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),v&&(c=c.substr(2)),d=parseFloat(c),m in fi&&(m==="autoAlpha"&&(u===1&&Oi(t,"visibility")==="hidden"&&d&&(u=0),E.push("visibility",0,o.visibility),ns(this,o,"visibility",u?"inherit":"hidden",d?"inherit":"hidden",!d)),m!=="scale"&&m!=="transform"&&(m=fi[m],~m.indexOf(",")&&(m=m.split(",")[0]))),_=m in Bi,_){if(this.styles.save(m),x||(b=t._gsap,b.renderTransform&&!e.parseTransform||xn(t,e.parseTransform),w=e.smoothOrigin!==!1&&b.smooth,x=this._pt=new ue(this._pt,o,Pt,0,1,b.renderTransform,b,0,-1),x.dep=1),m==="scale")this._pt=new ue(this._pt,b,"scaleY",b.scaleY,(v?mr(b.scaleY,v+d):d)-b.scaleY||0,Zl),this._pt.u=0,a.push("scaleY",m),m+="X";else if(m==="transformOrigin"){E.push(fe,0,o[fe]),c=bw(c),b.svg?ic(t,c,0,w,0,this):(y=parseFloat(c.split(" ")[2])||0,y!==b.zOrigin&&ns(this,b,"zOrigin",b.zOrigin,y),ns(this,o,m,no(l),no(c)));continue}else if(m==="svgOrigin"){ic(t,c,1,w,0,this);continue}else if(m in Fm){Aw(this,b,m,u,v?mr(u,v+c):c);continue}else if(m==="smoothOrigin"){ns(this,b,"smooth",b.smooth,c);continue}else if(m==="force3D"){b[m]=c;continue}else if(m==="transform"){Sw(this,c,t);continue}}else m in o||(m=wr(m)||m);if(_||(d||d===0)&&(u||u===0)&&!ow.test(c)&&m in o)g=(l+"").substr((u+"").length),d||(d=0),y=ie(c)||(m in _e.units?_e.units[m]:g),g!==y&&(u=as(t,m,l,y)),this._pt=new ue(this._pt,_?b:o,m,u,(v?mr(u,v+d):d)-u,!_&&(y==="px"||m==="zIndex")&&e.autoRound!==!1?cw:Zl),this._pt.u=y||0,g!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=lw);else if(m in o)vw.call(this,t,m,l,v?v+c:c);else if(m in t)this.add(t,m,l||t[m],v?v+c:c,r,n);else if(m!=="parseTransform"){Al(m,c);continue}_||(m in o?E.push(m,0,o[m]):E.push(m,1,l||t[m])),a.push(m)}}T&&ym(this)},render:function(t,e){if(e.tween._time||!ql())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:Oi,aliases:fi,getSetter:function(t,e,i){var r=fi[e];return r&&r.indexOf(",")<0&&(e=r),e in Bi&&e!==fe&&(t._gsap.x||Oi(t,"x"))?i&&Tm===i?e==="scale"?pw:fw:(Tm=i||{})&&(e==="scale"?mw:gw):t.style&&!xl(t.style[e])?uw:~e.indexOf("-")?dw:Wl(t,e)},core:{_removeProperty:Fs,_getMatrix:ec}};de.utils.checkPrefix=wr,de.core.getStyleSaver=Cm,function(s,t,e,i){var r=ce(s+","+t+","+e,function(n){Bi[n]=1});ce(t,function(n){_e.units[n]="deg",Fm[n]=1}),fi[r[13]]=s+","+t,ce(i,function(n){var a=n.split(":");fi[a[1]]=r[a[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),ce("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(s){_e.units[s]="px"}),de.registerPlugin(Gm);var ct=de.registerPlugin(Gm)||de;ct.core.Tween;class rc extends hi{constructor(t){super(),this.radius=0,this.enableTint=!0,this.bgColor="#fff",this.borderWidth=0,this.borderColor="black",this.bgAlpha=1;const{x:e=0,y:i=0,width:r=0,height:n=0,bgColor:a="#fff",alpha:o=1,radius:h=0,borderWidth:l=0,borderColor:c="black",enableTint:d=!0}=t;this.x=e,this.y=i,this.bgAlpha=o,this.radius=h,this.enableTint=d,this.bgColor=a,this.borderWidth=l,this.borderColor=c,this.renderBg(r,n)}updateColor(t){ct.to(this,{tint:t,duration:.25})}renderBg(t,e){this.clear(),this.enableTint?(this.beginFill("#fff",this.bgAlpha),this.tint=this.bgColor):(this.beginFill(this.bgColor,this.bgAlpha),this.borderWidth&&this.lineStyle(this.borderWidth,this.borderColor,1)),this.borderWidth&&this.lineStyle(this.borderWidth,this.borderColor,1),this.radius!==0?typeof this.radius=="number"?this.drawRoundedRect(0,0,t,e,this.radius):(this.moveTo(0+this.radius[0],0),this.lineTo(0+t-this.radius[1],0),this.radius[1]>0?this.arcTo(0+t,0,0+t,0+this.radius[1],this.radius[1]):this.lineTo(0+t,0),this.lineTo(0+t,0+e-this.radius[2]),this.radius[2]>0?this.arcTo(0+t,0+e,0+t-this.radius[2],0+e,this.radius[2]):this.lineTo(0+t,0+e),this.lineTo(0+this.radius[3],0+e),this.radius[3]>0?this.arcTo(0,0+e,0,0+e-this.radius[3],this.radius[3]):this.lineTo(0,0+e),this.lineTo(0,0+this.radius[0]),this.radius[0]>0?this.arcTo(0,0,0+this.radius[0],0,this.radius[0]):this.lineTo(0,0),this.closePath()):this.drawRect(0,0,t,e),this.endFill()}}class bn extends vt{constructor(t,e,i,r){if(super(),r){const n=new hi;n.beginFill(16777215),n.drawRect(0,0,t,e),n.endFill(),this.addChild(n),this.mask=n}i?(this._bgColorFill=new rc({width:t,height:e,bgColor:i}),this.addChild(this._bgColorFill)):(this._fill=new ge,this._fill.width=t,this._fill.height=e,this.addChild(this._fill))}setSize(t,e){this._fill&&(this._fill.width=t,this._fill.height=e),this._bgColorFill&&this._bgColorFill.renderBg(t,e)}}/*!
|
|
1163
|
+
*/var Pm,ns,br,Jl,Os,Rm,tc,yw=function(){return typeof window<"u"},Oi={},Fs=180/Math.PI,Tr=Math.PI/180,wr=Math.atan2,Im=1e8,ec=/([A-Z])/g,xw=/(left|right|width|margin|padding|x)/i,vw=/[\s,\(]\S/,pi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},ic=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},bw=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Tw=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},ww=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},Mm=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Dm=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},Ew=function(t,e,i){return t.style[e]=i},Aw=function(t,e,i){return t.style.setProperty(e,i)},Sw=function(t,e,i){return t._gsap[e]=i},Cw=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},Pw=function(t,e,i,r,n){var a=t._gsap;a.scaleX=a.scaleY=i,a.renderTransform(n,a)},Rw=function(t,e,i,r,n){var a=t._gsap;a[e]=i,a.renderTransform(n,a)},Pt="transform",fe=Pt+"Origin",Iw=function s(t,e){var i=this,r=this.target,n=r.style,a=r._gsap;if(t in Oi&&n){if(this.tfm=this.tfm||{},t!=="transform")t=pi[t]||t,~t.indexOf(",")?t.split(",").forEach(function(o){return i.tfm[o]=Fi(r,o)}):this.tfm[t]=a.x?a[t]:Fi(r,t),t===fe&&(this.tfm.zOrigin=a.zOrigin);else return pi.transform.split(",").forEach(function(o){return s.call(i,o,e)});if(this.props.indexOf(Pt)>=0)return;a.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(fe,e,"")),t=Pt}(n||e)&&this.props.push(t,e,n[t])},Bm=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Mw=function(){var t=this.props,e=this.target,i=e.style,r=e._gsap,n,a;for(n=0;n<t.length;n+=3)t[n+1]?e[t[n]]=t[n+2]:t[n+2]?i[t[n]]=t[n+2]:i.removeProperty(t[n].substr(0,2)==="--"?t[n]:t[n].replace(ec,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)r[a]=this.tfm[a];r.svg&&(r.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),n=tc(),(!n||!n.isStart)&&!i[Pt]&&(Bm(i),r.zOrigin&&i[fe]&&(i[fe]+=" "+r.zOrigin+"px",r.zOrigin=0,r.renderTransform()),r.uncache=1)}},Om=function(t,e){var i={target:t,props:[],revert:Mw,save:Iw};return t._gsap||de.core.getCache(t),e&&e.split(",").forEach(function(r){return i.save(r)}),i},Fm,sc=function(t,e){var i=ns.createElementNS?ns.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):ns.createElement(t);return i&&i.style?i:ns.createElement(t)},mi=function s(t,e,i){var r=getComputedStyle(t);return r[e]||r.getPropertyValue(e.replace(ec,"-$1").toLowerCase())||r.getPropertyValue(e)||!i&&s(t,Er(e)||e,1)||""},Lm="O,Moz,ms,Ms,Webkit".split(","),Er=function(t,e,i){var r=e||Os,n=r.style,a=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);a--&&!(Lm[a]+t in n););return a<0?null:(a===3?"ms":a>=0?Lm[a]:"")+t},rc=function(){yw()&&window.document&&(Pm=window,ns=Pm.document,br=ns.documentElement,Os=sc("div")||{style:{}},sc("div"),Pt=Er(Pt),fe=Pt+"Origin",Os.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Fm=!!Er("perspective"),tc=de.core.reverting,Jl=1)},nc=function s(t){var e=sc("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,r=this.nextSibling,n=this.style.cssText,a;if(br.appendChild(e),e.appendChild(this),this.style.display="block",t)try{a=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=s}catch{}else this._gsapBBox&&(a=this._gsapBBox());return i&&(r?i.insertBefore(this,r):i.appendChild(this)),br.removeChild(e),this.style.cssText=n,a},km=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},Nm=function(t){var e;try{e=t.getBBox()}catch{e=nc.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===nc||(e=nc.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+km(t,["x","cx","x1"])||0,y:+km(t,["y","cy","y1"])||0,width:0,height:0}:e},Um=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Nm(t))},Ls=function(t,e){if(e){var i=t.style,r;e in Oi&&e!==fe&&(e=Pt),i.removeProperty?(r=e.substr(0,2),(r==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(r==="--"?e:e.replace(ec,"-$1").toLowerCase())):i.removeAttribute(e)}},as=function(t,e,i,r,n,a){var o=new ue(t._pt,e,i,0,1,a?Dm:Mm);return t._pt=o,o.b=r,o.e=n,t._props.push(i),o},Gm={deg:1,rad:1,turn:1},Dw={grid:1,flex:1},os=function s(t,e,i,r){var n=parseFloat(i)||0,a=(i+"").trim().substr((n+"").length)||"px",o=Os.style,h=xw.test(e),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),d=100,u=r==="px",f=r==="%",p,m,_,y;if(r===a||!n||Gm[r]||Gm[a])return n;if(a!=="px"&&!u&&(n=s(t,e,i,"px")),y=t.getCTM&&Um(t),(f||a==="%")&&(Oi[e]||~e.indexOf("adius")))return p=y?t.getBBox()[h?"width":"height"]:t[c],Ut(f?n/p*d:n/100*p);if(o[h?"width":"height"]=d+(u?a:r),m=~e.indexOf("adius")||r==="em"&&t.appendChild&&!l?t:t.parentNode,y&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===ns||!m.appendChild)&&(m=ns.body),_=m._gsap,_&&f&&_.width&&h&&_.time===be.time&&!_.uncache)return Ut(n/_.width*d);if(f&&(e==="height"||e==="width")){var v=t.style[e];t.style[e]=d+r,p=t[c],v?t.style[e]=v:Ls(t,e)}else(f||a==="%")&&!Dw[mi(m,"display")]&&(o.position=mi(t,"position")),m===t&&(o.position="static"),m.appendChild(Os),p=Os[c],m.removeChild(Os),o.position="absolute";return h&&f&&(_=Ps(m),_.time=be.time,_.width=m[c]),Ut(u?p*n/d:p&&n?d/p*n:0)},Fi=function(t,e,i,r){var n;return Jl||rc(),e in pi&&e!=="transform"&&(e=pi[e],~e.indexOf(",")&&(e=e.split(",")[0])),Oi[e]&&e!=="transform"?(n=vn(t,r),n=e!=="transformOrigin"?n[e]:n.svg?n.origin:oo(mi(t,fe))+" "+n.zOrigin+"px"):(n=t.style[e],(!n||n==="auto"||r||~(n+"").indexOf("calc("))&&(n=ao[e]&&ao[e](t,e,i)||mi(t,e)||Xp(t,e)||(e==="opacity"?1:0))),i&&!~(n+"").trim().indexOf(" ")?os(t,e,n,i)+i:n},Bw=function(t,e,i,r){if(!i||i==="none"){var n=Er(e,t,1),a=n&&mi(t,n,1);a&&a!==i?(e=n,i=a):e==="borderColor"&&(i=mi(t,"borderTopColor"))}var o=new ue(this._pt,t.style,e,0,1,Em),h=0,l=0,c,d,u,f,p,m,_,y,v,g,x,b;if(o.b=i,o.e=r,i+="",r+="",r==="auto"&&(m=t.style[e],t.style[e]=r,r=mi(t,e)||r,m?t.style[e]=m:Ls(t,e)),c=[i,r],pm(c),i=c[0],r=c[1],u=i.match(mr)||[],b=r.match(mr)||[],b.length){for(;d=mr.exec(r);)_=d[0],v=r.substring(h,d.index),p?p=(p+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(p=1),_!==(m=u[l++]||"")&&(f=parseFloat(m)||0,x=m.substr((f+"").length),_.charAt(1)==="="&&(_=_r(f,_)+x),y=parseFloat(_),g=_.substr((y+"").length),h=mr.lastIndex-g.length,g||(g=g||ge.units[e]||x,h===r.length&&(r+=g,o.e+=g)),x!==g&&(f=os(t,e,m,g)||0),o._pt={_next:o._pt,p:v||l===1?v:",",s:f,c:y-f,m:p&&p<4||e==="zIndex"?Math.round:0});o.c=h<r.length?r.substring(h,r.length):""}else o.r=e==="display"&&r==="none"?Dm:Mm;return kp.test(r)&&(o.e=0),this._pt=o,o},Hm={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Ow=function(t){var e=t.split(" "),i=e[0],r=e[1]||"50%";return(i==="top"||i==="bottom"||r==="left"||r==="right")&&(t=i,i=r,r=t),e[0]=Hm[i]||i,e[1]=Hm[r]||r,e.join(" ")},Fw=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,r=i.style,n=e.u,a=i._gsap,o,h,l;if(n==="all"||n===!0)r.cssText="",h=1;else for(n=n.split(","),l=n.length;--l>-1;)o=n[l],Oi[o]&&(h=1,o=o==="transformOrigin"?fe:Pt),Ls(i,o);h&&(Ls(i,Pt),a&&(a.svg&&i.removeAttribute("transform"),vn(i,1),a.uncache=1,Bm(r)))}},ao={clearProps:function(t,e,i,r,n){if(n.data!=="isFromStart"){var a=t._pt=new ue(t._pt,e,i,0,0,Fw);return a.u=r,a.pr=-10,a.tween=n,t._props.push(i),1}}},xn=[1,0,0,1,0,0],Vm={},Wm=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Xm=function(t){var e=mi(t,Pt);return Wm(e)?xn:e.substr(7).match(Lp).map(Ut)},ac=function(t,e){var i=t._gsap||Ps(t),r=t.style,n=Xm(t),a,o,h,l;return i.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,n=[h.a,h.b,h.c,h.d,h.e,h.f],n.join(",")==="1,0,0,1,0,0"?xn:n):(n===xn&&!t.offsetParent&&t!==br&&!i.svg&&(h=r.display,r.display="block",a=t.parentNode,(!a||!t.offsetParent)&&(l=1,o=t.nextElementSibling,br.appendChild(t)),n=Xm(t),h?r.display=h:Ls(t,"display"),l&&(o?a.insertBefore(t,o):a?a.appendChild(t):br.removeChild(t))),e&&n.length>6?[n[0],n[1],n[4],n[5],n[12],n[13]]:n)},oc=function(t,e,i,r,n,a){var o=t._gsap,h=n||ac(t,!0),l=o.xOrigin||0,c=o.yOrigin||0,d=o.xOffset||0,u=o.yOffset||0,f=h[0],p=h[1],m=h[2],_=h[3],y=h[4],v=h[5],g=e.split(" "),x=parseFloat(g[0])||0,b=parseFloat(g[1])||0,w,T,E,A;i?h!==xn&&(T=f*_-p*m)&&(E=x*(_/T)+b*(-m/T)+(m*v-_*y)/T,A=x*(-p/T)+b*(f/T)-(f*v-p*y)/T,x=E,b=A):(w=Nm(t),x=w.x+(~g[0].indexOf("%")?x/100*w.width:x),b=w.y+(~(g[1]||g[0]).indexOf("%")?b/100*w.height:b)),r||r!==!1&&o.smooth?(y=x-l,v=b-c,o.xOffset=d+(y*f+v*m)-y,o.yOffset=u+(y*p+v*_)-v):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=b,o.smooth=!!r,o.origin=e,o.originIsAbsolute=!!i,t.style[fe]="0px 0px",a&&(as(a,o,"xOrigin",l,x),as(a,o,"yOrigin",c,b),as(a,o,"xOffset",d,o.xOffset),as(a,o,"yOffset",u,o.yOffset)),t.setAttribute("data-svg-origin",x+" "+b)},vn=function(t,e){var i=t._gsap||new ym(t);if("x"in i&&!e&&!i.uncache)return i;var r=t.style,n=i.scaleX<0,a="px",o="deg",h=getComputedStyle(t),l=mi(t,fe)||"0",c,d,u,f,p,m,_,y,v,g,x,b,w,T,E,A,P,L,M,S,C,R,N,F,B,W,I,D,$,Y,U,rt;return c=d=u=m=_=y=v=g=x=0,f=p=1,i.svg=!!(t.getCTM&&Um(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(r[Pt]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Pt]!=="none"?h[Pt]:"")),r.scale=r.rotate=r.translate="none"),T=ac(t,i.svg),i.svg&&(i.uncache?(B=t.getBBox(),l=i.xOrigin-B.x+"px "+(i.yOrigin-B.y)+"px",F=""):F=!e&&t.getAttribute("data-svg-origin"),oc(t,F||l,!!F||i.originIsAbsolute,i.smooth!==!1,T)),b=i.xOrigin||0,w=i.yOrigin||0,T!==xn&&(L=T[0],M=T[1],S=T[2],C=T[3],c=R=T[4],d=N=T[5],T.length===6?(f=Math.sqrt(L*L+M*M),p=Math.sqrt(C*C+S*S),m=L||M?wr(M,L)*Fs:0,v=S||C?wr(S,C)*Fs+m:0,v&&(p*=Math.abs(Math.cos(v*Tr))),i.svg&&(c-=b-(b*L+w*S),d-=w-(b*M+w*C))):(rt=T[6],Y=T[7],I=T[8],D=T[9],$=T[10],U=T[11],c=T[12],d=T[13],u=T[14],E=wr(rt,$),_=E*Fs,E&&(A=Math.cos(-E),P=Math.sin(-E),F=R*A+I*P,B=N*A+D*P,W=rt*A+$*P,I=R*-P+I*A,D=N*-P+D*A,$=rt*-P+$*A,U=Y*-P+U*A,R=F,N=B,rt=W),E=wr(-S,$),y=E*Fs,E&&(A=Math.cos(-E),P=Math.sin(-E),F=L*A-I*P,B=M*A-D*P,W=S*A-$*P,U=C*P+U*A,L=F,M=B,S=W),E=wr(M,L),m=E*Fs,E&&(A=Math.cos(E),P=Math.sin(E),F=L*A+M*P,B=R*A+N*P,M=M*A-L*P,N=N*A-R*P,L=F,R=B),_&&Math.abs(_)+Math.abs(m)>359.9&&(_=m=0,y=180-y),f=Ut(Math.sqrt(L*L+M*M+S*S)),p=Ut(Math.sqrt(N*N+rt*rt)),E=wr(R,N),v=Math.abs(E)>2e-4?E*Fs:0,x=U?1/(U<0?-U:U):0),i.svg&&(F=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Wm(mi(t,Pt)),F&&t.setAttribute("transform",F))),Math.abs(v)>90&&Math.abs(v)<270&&(n?(f*=-1,v+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,v+=v<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+a,i.y=d-((i.yPercent=d&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-d)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+a,i.z=u+a,i.scaleX=Ut(f),i.scaleY=Ut(p),i.rotation=Ut(m)+o,i.rotationX=Ut(_)+o,i.rotationY=Ut(y)+o,i.skewX=v+o,i.skewY=g+o,i.transformPerspective=x+a,(i.zOrigin=parseFloat(l.split(" ")[2])||!e&&i.zOrigin||0)&&(r[fe]=oo(l)),i.xOffset=i.yOffset=0,i.force3D=ge.force3D,i.renderTransform=i.svg?kw:Fm?$m:Lw,i.uncache=0,i},oo=function(t){return(t=t.split(" "))[0]+" "+t[1]},hc=function(t,e,i){var r=ie(e);return Ut(parseFloat(e)+parseFloat(os(t,"x",i+"px",r)))+r},Lw=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,$m(t,e)},ks="0deg",bn="0px",Ns=") ",$m=function(t,e){var i=e||this,r=i.xPercent,n=i.yPercent,a=i.x,o=i.y,h=i.z,l=i.rotation,c=i.rotationY,d=i.rotationX,u=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,_=i.transformPerspective,y=i.force3D,v=i.target,g=i.zOrigin,x="",b=y==="auto"&&t&&t!==1||y===!0;if(g&&(d!==ks||c!==ks)){var w=parseFloat(c)*Tr,T=Math.sin(w),E=Math.cos(w),A;w=parseFloat(d)*Tr,A=Math.cos(w),a=hc(v,a,T*A*-g),o=hc(v,o,-Math.sin(w)*-g),h=hc(v,h,E*A*-g+g)}_!==bn&&(x+="perspective("+_+Ns),(r||n)&&(x+="translate("+r+"%, "+n+"%) "),(b||a!==bn||o!==bn||h!==bn)&&(x+=h!==bn||b?"translate3d("+a+", "+o+", "+h+") ":"translate("+a+", "+o+Ns),l!==ks&&(x+="rotate("+l+Ns),c!==ks&&(x+="rotateY("+c+Ns),d!==ks&&(x+="rotateX("+d+Ns),(u!==ks||f!==ks)&&(x+="skew("+u+", "+f+Ns),(p!==1||m!==1)&&(x+="scale("+p+", "+m+Ns),v.style[Pt]=x||"translate(0, 0)"},kw=function(t,e){var i=e||this,r=i.xPercent,n=i.yPercent,a=i.x,o=i.y,h=i.rotation,l=i.skewX,c=i.skewY,d=i.scaleX,u=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,_=i.xOffset,y=i.yOffset,v=i.forceCSS,g=parseFloat(a),x=parseFloat(o),b,w,T,E,A;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Tr,l*=Tr,b=Math.cos(h)*d,w=Math.sin(h)*d,T=Math.sin(h-l)*-u,E=Math.cos(h-l)*u,l&&(c*=Tr,A=Math.tan(l-c),A=Math.sqrt(1+A*A),T*=A,E*=A,c&&(A=Math.tan(c),A=Math.sqrt(1+A*A),b*=A,w*=A)),b=Ut(b),w=Ut(w),T=Ut(T),E=Ut(E)):(b=d,E=u,w=T=0),(g&&!~(a+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(g=os(f,"x",a,"px"),x=os(f,"y",o,"px")),(p||m||_||y)&&(g=Ut(g+p-(p*b+m*T)+_),x=Ut(x+m-(p*w+m*E)+y)),(r||n)&&(A=f.getBBox(),g=Ut(g+r/100*A.width),x=Ut(x+n/100*A.height)),A="matrix("+b+","+w+","+T+","+E+","+g+","+x+")",f.setAttribute("transform",A),v&&(f.style[Pt]=A)},Nw=function(t,e,i,r,n){var a=360,o=jt(n),h=parseFloat(n)*(o&&~n.indexOf("rad")?Fs:1),l=h-r,c=r+l+"deg",d,u;return o&&(d=n.split("_")[1],d==="short"&&(l%=a,l!==l%(a/2)&&(l+=l<0?a:-a)),d==="cw"&&l<0?l=(l+a*Im)%a-~~(l/a)*a:d==="ccw"&&l>0&&(l=(l-a*Im)%a-~~(l/a)*a)),t._pt=u=new ue(t._pt,e,i,r,l,bw),u.e=c,u.u="deg",t._props.push(i),u},zm=function(t,e){for(var i in e)t[i]=e[i];return t},Uw=function(t,e,i){var r=zm({},i._gsap),n="perspective,force3D,transformOrigin,svgOrigin",a=i.style,o,h,l,c,d,u,f,p;r.svg?(l=i.getAttribute("transform"),i.setAttribute("transform",""),a[Pt]=e,o=vn(i,1),Ls(i,Pt),i.setAttribute("transform",l)):(l=getComputedStyle(i)[Pt],a[Pt]=e,o=vn(i,1),a[Pt]=l);for(h in Oi)l=r[h],c=o[h],l!==c&&n.indexOf(h)<0&&(f=ie(l),p=ie(c),d=f!==p?os(i,h,l,p):parseFloat(l),u=parseFloat(c),t._pt=new ue(t._pt,o,h,d,u-d,ic),t._pt.u=p||0,t._props.push(h));zm(o,r)};ce("padding,margin,Width,Radius",function(s,t){var e="Top",i="Right",r="Bottom",n="Left",a=(t<3?[e,i,r,n]:[e+n,e+i,r+i,r+n]).map(function(o){return t<2?s+o:"border"+o+s});ao[t>1?"border"+s:s]=function(o,h,l,c,d){var u,f;if(arguments.length<4)return u=a.map(function(p){return Fi(o,p,l)}),f=u.join(" "),f.split(u[0]).length===5?u[0]:f;u=(c+"").split(" "),f={},a.forEach(function(p,m){return f[p]=u[m]=u[m]||u[(m-1)/2|0]}),o.init(h,f,d)}});var Ym={name:"css",register:rc,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,r,n){var a=this._props,o=t.style,h=i.vars.startAt,l,c,d,u,f,p,m,_,y,v,g,x,b,w,T,E;Jl||rc(),this.styles=this.styles||Om(t),E=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(xe[m]&&xm(m,e,i,r,t,n)))){if(f=typeof c,p=ao[m],f==="function"&&(c=c.call(i,r,t,n),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=fn(c)),p)p(this,t,m,c,i)&&(T=1);else if(m.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",ss.lastIndex=0,ss.test(l)||(_=ie(l),y=ie(c)),y?_!==y&&(l=os(t,m,l,y)+y):_&&(c+=_),this.add(o,"setProperty",l,c,r,n,0,0,m),a.push(m),E.push(m,0,o[m]);else if(f!=="undefined"){if(h&&m in h?(l=typeof h[m]=="function"?h[m].call(i,r,t,n):h[m],jt(l)&&~l.indexOf("random(")&&(l=fn(l)),ie(l+"")||l==="auto"||(l+=ge.units[m]||ie(Fi(t,m))||""),(l+"").charAt(1)==="="&&(l=Fi(t,m))):l=Fi(t,m),u=parseFloat(l),v=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),v&&(c=c.substr(2)),d=parseFloat(c),m in pi&&(m==="autoAlpha"&&(u===1&&Fi(t,"visibility")==="hidden"&&d&&(u=0),E.push("visibility",0,o.visibility),as(this,o,"visibility",u?"inherit":"hidden",d?"inherit":"hidden",!d)),m!=="scale"&&m!=="transform"&&(m=pi[m],~m.indexOf(",")&&(m=m.split(",")[0]))),g=m in Oi,g){if(this.styles.save(m),x||(b=t._gsap,b.renderTransform&&!e.parseTransform||vn(t,e.parseTransform),w=e.smoothOrigin!==!1&&b.smooth,x=this._pt=new ue(this._pt,o,Pt,0,1,b.renderTransform,b,0,-1),x.dep=1),m==="scale")this._pt=new ue(this._pt,b,"scaleY",b.scaleY,(v?_r(b.scaleY,v+d):d)-b.scaleY||0,ic),this._pt.u=0,a.push("scaleY",m),m+="X";else if(m==="transformOrigin"){E.push(fe,0,o[fe]),c=Ow(c),b.svg?oc(t,c,0,w,0,this):(y=parseFloat(c.split(" ")[2])||0,y!==b.zOrigin&&as(this,b,"zOrigin",b.zOrigin,y),as(this,o,m,oo(l),oo(c)));continue}else if(m==="svgOrigin"){oc(t,c,1,w,0,this);continue}else if(m in Vm){Nw(this,b,m,u,v?_r(u,v+c):c);continue}else if(m==="smoothOrigin"){as(this,b,"smooth",b.smooth,c);continue}else if(m==="force3D"){b[m]=c;continue}else if(m==="transform"){Uw(this,c,t);continue}}else m in o||(m=Er(m)||m);if(g||(d||d===0)&&(u||u===0)&&!vw.test(c)&&m in o)_=(l+"").substr((u+"").length),d||(d=0),y=ie(c)||(m in ge.units?ge.units[m]:_),_!==y&&(u=os(t,m,l,y)),this._pt=new ue(this._pt,g?b:o,m,u,(v?_r(u,v+d):d)-u,!g&&(y==="px"||m==="zIndex")&&e.autoRound!==!1?ww:ic),this._pt.u=y||0,_!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=Tw);else if(m in o)Bw.call(this,t,m,l,v?v+c:c);else if(m in t)this.add(t,m,l||t[m],v?v+c:c,r,n);else if(m!=="parseTransform"){Il(m,c);continue}g||(m in o?E.push(m,0,o[m]):E.push(m,1,l||t[m])),a.push(m)}}T&&Am(this)},render:function(t,e){if(e.tween._time||!tc())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:Fi,aliases:pi,getSetter:function(t,e,i){var r=pi[e];return r&&r.indexOf(",")<0&&(e=r),e in Oi&&e!==fe&&(t._gsap.x||Fi(t,"x"))?i&&Rm===i?e==="scale"?Cw:Sw:(Rm=i||{})&&(e==="scale"?Pw:Rw):t.style&&!El(t.style[e])?Ew:~e.indexOf("-")?Aw:jl(t,e)},core:{_removeProperty:Ls,_getMatrix:ac}};de.utils.checkPrefix=Er,de.core.getStyleSaver=Om,function(s,t,e,i){var r=ce(s+","+t+","+e,function(n){Oi[n]=1});ce(t,function(n){ge.units[n]="deg",Vm[n]=1}),pi[r[13]]=s+","+t,ce(i,function(n){var a=n.split(":");pi[a[1]]=r[a[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),ce("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(s){ge.units[s]="px"}),de.registerPlugin(Ym);var ct=de.registerPlugin(Ym)||de;ct.core.Tween;class lc extends li{constructor(t){super(),this.radius=0,this.enableTint=!0,this.bgColor="#fff",this.borderWidth=0,this.borderColor="black",this.bgAlpha=1;const{x:e=0,y:i=0,width:r=0,height:n=0,bgColor:a="#fff",alpha:o=1,radius:h=0,borderWidth:l=0,borderColor:c="black",enableTint:d=!0}=t;this.x=e,this.y=i,this.bgAlpha=o,this.radius=h,this.enableTint=d,this.bgColor=a,this.borderWidth=l,this.borderColor=c,this.renderBg(r,n)}updateColor(t){ct.to(this,{tint:t,duration:.25})}renderBg(t,e){this.clear(),this.enableTint?(this.beginFill("#fff",this.bgAlpha),this.tint=this.bgColor):(this.beginFill(this.bgColor,this.bgAlpha),this.borderWidth&&this.lineStyle(this.borderWidth,this.borderColor,1)),this.borderWidth&&this.lineStyle(this.borderWidth,this.borderColor,1),this.radius!==0?typeof this.radius=="number"?this.drawRoundedRect(0,0,t,e,this.radius):(this.moveTo(0+this.radius[0],0),this.lineTo(0+t-this.radius[1],0),this.radius[1]>0?this.arcTo(0+t,0,0+t,0+this.radius[1],this.radius[1]):this.lineTo(0+t,0),this.lineTo(0+t,0+e-this.radius[2]),this.radius[2]>0?this.arcTo(0+t,0+e,0+t-this.radius[2],0+e,this.radius[2]):this.lineTo(0+t,0+e),this.lineTo(0+this.radius[3],0+e),this.radius[3]>0?this.arcTo(0,0+e,0,0+e-this.radius[3],this.radius[3]):this.lineTo(0,0+e),this.lineTo(0,0+this.radius[0]),this.radius[0]>0?this.arcTo(0,0,0+this.radius[0],0,this.radius[0]):this.lineTo(0,0),this.closePath()):this.drawRect(0,0,t,e),this.endFill()}}class Tn extends bt{constructor(t,e,i,r){if(super(),r){const n=new li;n.beginFill(16777215),n.drawRect(0,0,t,e),n.endFill(),this.addChild(n),this.mask=n}i?(this._bgColorFill=new lc({width:t,height:e,bgColor:i}),this.addChild(this._bgColorFill)):(this._fill=new _e,this._fill.width=t,this._fill.height=e,this.addChild(this._fill))}setSize(t,e){this._fill&&(this._fill.width=t,this._fill.height=e),this._bgColorFill&&this._bgColorFill.renderBg(t,e)}}/*!
|
|
1164
1164
|
* @pixi/particle-emitter - v5.0.8
|
|
1165
1165
|
* Compiled Mon, 28 Nov 2022 04:01:38 UTC
|
|
1166
1166
|
*
|
|
1167
1167
|
* @pixi/particle-emitter is licensed under the MIT License.
|
|
1168
1168
|
* http://www.opensource.org/licenses/mit-license
|
|
1169
|
-
*/class mi{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:Wm(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let r;const{value:n,time:a}=i[0],o=r=new mi(typeof n=="string"?oo(n):n,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==n)for(let h=1;h<i.length;++h){const{value:l,time:c}=i[h];r.next=new mi(typeof l=="string"?oo(l):l,c),r=r.next}return o.isStepped=!!t.isStepped,o}const e=new mi(typeof t.start=="string"?oo(t.start):t.start,0);return t.end!==t.start&&(e.next=new mi(typeof t.end=="string"?oo(t.end):t.end,1)),e}}let Tn=X.from;const gi=Math.PI/180;function Fi(s,t){if(!s)return;const e=Math.sin(s),i=Math.cos(s),r=t.x*i-t.y*e,n=t.x*e+t.y*i;t.x=r,t.y=n}function ao(s,t,e){return s<<16|t<<8|e}function Hm(s){return Math.sqrt(s.x*s.x+s.y*s.y)}function Cw(s){const t=1/Hm(s);s.x*=t,s.y*=t}function Vm(s,t){s.x*=t,s.y*=t}function oo(s,t){t||(t={}),s.charAt(0)==="#"?s=s.substr(1):s.indexOf("0x")===0&&(s=s.substr(2));let e;return s.length===8&&(e=s.substr(0,2),s=s.substr(2)),t.r=parseInt(s.substr(0,2),16),t.g=parseInt(s.substr(2,2),16),t.b=parseInt(s.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function Wm(s){const t=s.length,e=1/t;return function(i){const r=t*i|0,n=(i-r*e)*t,a=s[r]||s[t-1];return a.s+n*(2*(1-n)*(a.cp-a.s)+n*(a.e-a.s))}}function Pw(s){return s?(s=s.toUpperCase().replace(/ /g,"_"),K[s]||K.NORMAL):K.NORMAL}class nc extends ge{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var yt;(function(s){s[s.Spawn=0]="Spawn",s[s.Normal=2]="Normal",s[s.Late=5]="Late"})(yt||(yt={}));const ac=At.shared,Ns=Symbol("Position particle per emitter position");class ut{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new tt,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new tt,this._prevEmitterPos=new tt,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){ut.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:Wm(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const r=ut.knownBehaviors[i.type];return r?new r(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Ns),e.sort((i,r)=>i===Ns?r.order===yt.Spawn?1:-1:r===Ns?i.order===yt.Spawn?-1:1:i.order-r.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Ns&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Ns&&i.recycleParticle)}getBehavior(t){return ut.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof ut.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new nc(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Fi(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?ac.remove(this.update,this):!this._autoUpdate&&t&&ac.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=ac.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let l=0;l<this.updateBehaviors.length;++l)if(this.updateBehaviors[l].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const r=this.ownerPos.x+this.spawnPos.x,n=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let a,o;if(this._prevPosIsValid&&this._posChanged){const c=1+this._spawnTimer/t;a=(r-e)*c+e,o=(n-i)*c+i}else a=r,o=n;let h=null,l=null;for(let c=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),d=0;d<c;++d){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let u;if(this.minLifetime===this.maxLifetime?u=this.minLifetime:u=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=u)continue;let f;this._poolFirst?(f=this._poolFirst,this._poolFirst=this._poolFirst.next,f.next=null):f=new nc(this),f.init(u),this.addAtBack?this._parent.addChildAt(f,0):this._parent.addChild(f),h?(l.next=f,f.prev=l,l=f):l=h=f,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=l):(this._activeParticlesFirst=h,this._activeParticlesLast=l);for(let c=0;c<this.initBehaviors.length;++c){const d=this.initBehaviors[c];if(d===Ns)for(let u=h,f;u;u=f){f=u.next,this.rotation!==0&&(Fi(this.rotation,u.position),u.rotation+=this.rotation),u.position.x+=a,u.position.y+=o,u.age+=-this._spawnTimer;let p=u.age*u.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),u.agePercent=p}else d.initParticles(h)}for(let c=h,d;c;c=d){d=c.next;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(c,-this._spawnTimer)){this.recycle(c);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=r,this._prevEmitterPos.y=n,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,r=null;for(let n=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<n;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new nc(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(r.next=o,o.prev=r,r=o):r=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=r):(this._activeParticlesFirst=i,this._activeParticlesLast=r);for(let n=0;n<this.initBehaviors.length;++n){const a=this.initBehaviors[n];if(a===Ns)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Fi(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}ut.knownBehaviors={};class oc{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}oc.type="rect",oc.editorConfig=null;class ho{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Fi(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}ho.type="torus",ho.editorConfig=null;class hc{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let r=i[0];for(let n=1;n<i.length;++n){const a=i[n];this.segments.push({p1:r,p2:a,l:0}),r=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const r=t[i];this.segments.push({p1:e,p2:r,l:0}),e=r}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:r}=this.segments[e],n=Math.sqrt((r.x-i.x)*(r.x-i.x)+(r.y-i.y)*(r.y-i.y));this.segments[e].l=n,this.totalLength+=n,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,r;if(this.segments.length===1)i=this.segments[0],r=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],r=o===0?e:e-this.countingLengths[o-1];break}r/=i.l||1;const{p1:n,p2:a}=i;t.x=n.x+r*(a.x-n.x),t.y=n.y+r*(a.y-n.y)}}hc.type="polygonalChain",hc.editorConfig=null;class lc{constructor(t){var e;this.order=yt.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Fi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,r=i.x,n=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=Hm(i);a>this.maxSpeed&&Vm(i,this.maxSpeed/a)}t.x+=(r+i.x)/2*e,t.y+=(n+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}lc.type="moveAcceleration",lc.editorConfig=null;function Rw(s){return this.ease&&(s=this.ease(s)),(this.first.next.value-this.first.value)*s+this.first.value}function Iw(s){this.ease&&(s=this.ease(s));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*s+t.r,r=(e.g-t.g)*s+t.g,n=(e.b-t.b)*s+t.b;return ao(i,r,n)}function Mw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;return s=(s-t.time)/(e.time-t.time),(e.value-t.value)*s+t.value}function Dw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;s=(s-t.time)/(e.time-t.time);const i=t.value,r=e.value,n=(r.r-i.r)*s+i.r,a=(r.g-i.g)*s+i.g,o=(r.b-i.b)*s+i.b;return ao(n,a,o)}function Bw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;return t.value}function Ow(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;const e=t.value;return ao(e.r,e.g,e.b)}class wn{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?Iw:Rw:t.isStepped?this.interpolate=this.isColor?Ow:Bw:this.interpolate=this.isColor?Dw:Mw,this.ease=this.first.ease}}class cc{constructor(t){this.order=yt.Normal,this.list=new wn(!1),this.list.reset(mi.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}cc.type="alpha",cc.editorConfig=null;class uc{constructor(t){this.order=yt.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}uc.type="alphaStatic",uc.editorConfig=null;function Xm(s){const t=[];for(let e=0;e<s.length;++e){let i=s[e];if(typeof i=="string")t.push(Tn(i));else if(i instanceof X)t.push(i);else{let r=i.count||1;for(typeof i.texture=="string"?i=Tn(i.texture):i=i.texture;r>0;--r)t.push(i)}}return t}class dc{constructor(t){this.order=yt.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],r=Xm(i.textures),n=i.framerate<0?-1:i.framerate>0?i.framerate:60,a={textures:r,duration:n>0?r.length/n:0,framerate:n,loop:n>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.anims.length),r=e.config.anim=this.anims[i];e.texture=r.textures[0],e.config.animElapsed=0,r.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=r.textures.length/e.maxLife):(e.config.animDuration=r.duration,e.config.animFramerate=r.framerate),e=e.next}}updateParticle(t,e){const i=t.config,r=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const n=i.animElapsed*i.animFramerate+1e-7|0;t.texture=r.textures[n]||r.textures[r.textures.length-1]||X.EMPTY}}dc.type="animatedRandom",dc.editorConfig=null;class fc{constructor(t){this.order=yt.Normal;const e=t.anim,i=Xm(e.textures),r=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:r>0?i.length/r:0,framerate:r,loop:r>0?!!e.loop:!1}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,e){const i=this.anim,r=t.config;r.animElapsed+=e,r.animElapsed>=r.animDuration&&(i.loop?r.animElapsed=r.animElapsed%r.animDuration:r.animElapsed=r.animDuration-1e-6);const n=r.animElapsed*r.animFramerate+1e-7|0;t.texture=i.textures[n]||i.textures[i.textures.length-1]||X.EMPTY}}fc.type="animatedSingle",fc.editorConfig=null;class pc{constructor(t){this.order=yt.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=Pw(this.value),e=e.next}}pc.type="blendMode",pc.editorConfig=null;class mc{constructor(t){this.order=yt.Spawn,this.spacing=t.spacing*gi,this.start=t.start*gi,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let r;this.spacing?r=this.start+this.spacing*e:r=Math.random()*Math.PI*2,i.rotation=r,this.distance&&(i.position.x=this.distance,Fi(r,i.position)),i=i.next,++e}}}mc.type="spawnBurst",mc.editorConfig=null;class gc{constructor(t){this.order=yt.Normal,this.list=new wn(!0),this.list.reset(mi.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,r=ao(i.r,i.g,i.b);for(;e;)e.tint=r,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}gc.type="color",gc.editorConfig=null;class _c{constructor(t){this.order=yt.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}_c.type="colorStatic",_c.editorConfig=null;class yc{constructor(t){this.order=yt.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?Tn(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}yc.type="textureOrdered",yc.editorConfig=null;const Er=new tt,zm=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],Fw=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(zm).join("|"),"g");function Lw(s){const t=s.match(Fw);for(let e=t.length-1;e>=0;--e)zm.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return s=t.join(""),new Function("x",`return ${s};`)}class xc{constructor(t){var e;if(this.order=yt.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=Lw(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new wn(!1),this.list.reset(mi.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new tt(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,Er.x=t.config.movement,Er.y=this.path(Er.x),Fi(t.config.initRotation,Er),t.position.x=t.config.initPosition.x+Er.x,t.position.y=t.config.initPosition.y+Er.y}}xc.type="movePath",xc.editorConfig=null;class vc{constructor(){this.order=yt.Spawn}initParticles(t){}}vc.type="spawnPoint",vc.editorConfig=null;class bc{constructor(t){this.order=yt.Normal,this.textures=t.textures.map(e=>typeof e=="string"?Tn(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}bc.type="textureRandom",bc.editorConfig=null;class Tc{constructor(t){this.order=yt.Normal,this.minStart=t.minStart*gi,this.maxStart=t.maxStart*gi,this.minSpeed=t.minSpeed*gi,this.maxSpeed=t.maxSpeed*gi,this.accel=t.accel*gi}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}Tc.type="rotation",Tc.editorConfig=null;class wc{constructor(t){this.order=yt.Normal,this.min=t.min*gi,this.max=t.max*gi}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}wc.type="rotationStatic",wc.editorConfig=null;class Ec{constructor(t){this.order=yt.Late+1,this.rotation=(t.rotation||0)*gi}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}Ec.type="noRotation",Ec.editorConfig=null;class Ac{constructor(t){var e;this.order=yt.Normal,this.list=new wn(!1),this.list.reset(mi.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}Ac.type="scale",Ac.editorConfig=null;class Sc{constructor(t){this.order=yt.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}Sc.type="scaleStatic",Sc.editorConfig=null;class $e{constructor(t){this.order=yt.Spawn;const e=$e.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){$e.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}$e.type="spawnShape",$e.editorConfig=null,$e.shapes={},$e.registerShape(hc),$e.registerShape(oc),$e.registerShape(ho),$e.registerShape(ho,"circle");class Cc{constructor(t){this.order=yt.Normal,this.texture=typeof t.texture=="string"?Tn(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}Cc.type="textureSingle",Cc.editorConfig=null;class Pc{constructor(t){var e;this.order=yt.Late,this.list=new wn(!1),this.list.reset(mi.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new tt(this.list.first.value*i,0),Fi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,r=t.config.velocity;Cw(r),Vm(r,i),t.x+=r.x*e,t.y+=r.y*e}}Pc.type="moveSpeed",Pc.editorConfig=null;class Rc{constructor(t){this.order=yt.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Fi(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}Rc.type="moveSpeedStatic",Rc.editorConfig=null,ut.registerBehavior(lc),ut.registerBehavior(cc),ut.registerBehavior(uc),ut.registerBehavior(dc),ut.registerBehavior(fc),ut.registerBehavior(pc),ut.registerBehavior(mc),ut.registerBehavior(gc),ut.registerBehavior(_c),ut.registerBehavior(yc),ut.registerBehavior(xc),ut.registerBehavior(vc),ut.registerBehavior(bc),ut.registerBehavior(Tc),ut.registerBehavior(wc),ut.registerBehavior(Ec),ut.registerBehavior(Ac),ut.registerBehavior(Sc),ut.registerBehavior($e),ut.registerBehavior(Cc),ut.registerBehavior(Pc),ut.registerBehavior(Rc);class Ic extends Ga{constructor(t){const{text:e,fontSize:i=36,fontColor:r=16777215,stroke:n,strokeColor:a,strokeThickness:o,fontFamily:h="MicrosoftYaHei",fontWeight:l="normal",wordWrap:c=!1,wordWrapWidth:d=100,lineHeight:u=1.25,align:f="left",indent:p=0,shadow:m}=t,g=new Ii({fontSize:i,wordWrap:c,wordWrapWidth:d,fontWeight:l,lineHeight:u*i,breakWords:c,fill:r,align:f,fontFamily:h,stroke:n?a:"transparent",strokeThickness:n?o:0,lineJoin:"round"});m&&(g.dropShadow=!0,g.dropShadowColor=m[0],g.dropShadowAngle=m[1]*(Math.PI/180),g.dropShadowBlur=m[2],g.dropShadowDistance=m[3]),super(e,g),this.position.x=p*i}}class kw extends vt{constructor(t){super();const{start:e,control:i,end:r,json:n,duration:a,ease:o="power1.out",showControl:h=!1,loop:l=!1}=t;this._particleContainer=new Fb,this.addChild(this._particleContainer);const c=new ut(this._particleContainer,n),d=this._createBezierPoints([e,...i,r],100,h),u={pathThrough:0};ct.to(u,{duration:a,pathThrough:d.length-1,repeat:l?-1:0,ease:o,onStart:()=>{c.emit=!0},onUpdate:()=>{const p=Math.floor(u.pathThrough),m=d[p];c.updateOwnerPos(m.x,m.y)},onComplete:()=>{ct.to(this,{alpha:0,duration:.5,onComplete:()=>{c.emit=!1,f.destroy(),this.removeFromParent()}})}});const f=new At;f.add(()=>{c.update(1/75)}),f.start()}_createBezierPoints(t,e,i){const r=[];i&&t.forEach((n,a)=>{const o=new Ic({text:a+1,fontSize:16});o.position.set(n.x,n.y),this.addChild(o)});for(let n=0;n<e;n++){const a=this._multiPointBezier(t,n/e);r.push(a)}return r}_multiPointBezier(t,e){const i=t.length;let r=0,n=0;const a=[];for(let o=0;o<i;o++)a[o]=this._binomial(i-1,o);for(let o=0;o<i;o++){const h=t[o],l=a[o],c=Math.pow(e,o),d=Math.pow(1-e,i-1-o);r+=h.x*d*c*l,n+=h.y*d*c*l}return{x:r,y:n}}_binomial(t,e){if(e===0||e===t)return 1;let i=1;for(let r=1;r<=e;r++)i=i*(t-r+1)/r;return i}}var _i=(s=>(s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping",s))(_i||{}),j=(s=>(s[s.setup=0]="setup",s[s.first=1]="first",s[s.replace=2]="replace",s[s.add=3]="add",s))(j||{}),Te=(s=>(s[s.mixIn=0]="mixIn",s[s.mixOut=1]="mixOut",s))(Te||{}),lo=(s=>(s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent",s))(lo||{}),Us=(s=>(s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale",s))(Us||{}),se=(s=>(s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection",s))(se||{});class $m{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const t=this.texture;return t.trim?t.trim.width:t.orig.width}get height(){const t=this.texture;return t.trim?t.trim.height:t.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const t=this.texture;return t.trim?t.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const t=this.texture;return t.trim?t.trim.y:0}get spineOffsetY(){const t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return this.texture.rotate!==0}get degrees(){return(360-this.texture.rotate*45)%360}}class Nw{constructor(){this.array=new Array}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}const Gs=class{constructor(s=0,t=0,e=0,i=0){this.r=s,this.g=t,this.b=e,this.a=i}set(s,t,e,i){return this.r=s,this.g=t,this.b=e,this.a=i,this.clamp()}setFromColor(s){return this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this}setFromString(s){return s=s.charAt(0)=="#"?s.substr(1):s,this.r=parseInt(s.substr(0,2),16)/255,this.g=parseInt(s.substr(2,2),16)/255,this.b=parseInt(s.substr(4,2),16)/255,this.a=s.length!=8?1:parseInt(s.substr(6,2),16)/255,this}add(s,t,e,i){return this.r+=s,this.g+=t,this.b+=e,this.a+=i,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(s,t){s.r=((t&4278190080)>>>24)/255,s.g=((t&16711680)>>>16)/255,s.b=((t&65280)>>>8)/255,s.a=(t&255)/255}static rgb888ToColor(s,t){s.r=((t&16711680)>>>16)/255,s.g=((t&65280)>>>8)/255,s.b=(t&255)/255}static fromString(s){return new Gs().setFromString(s)}};let we=Gs;we.WHITE=new Gs(1,1,1,1),we.RED=new Gs(1,0,0,1),we.GREEN=new Gs(0,1,0,1),we.BLUE=new Gs(0,0,1,1),we.MAGENTA=new Gs(1,0,1,1);const Li=class{static clamp(s,t,e){return s<t?t:s>e?e:s}static cosDeg(s){return Math.cos(s*Li.degRad)}static sinDeg(s){return Math.sin(s*Li.degRad)}static signum(s){return Math.sign(s)}static toInt(s){return s>0?Math.floor(s):Math.ceil(s)}static cbrt(s){const t=Math.pow(Math.abs(s),.3333333333333333);return s<0?-t:t}static randomTriangular(s,t){return Li.randomTriangularWith(s,t,(s+t)*.5)}static randomTriangularWith(s,t,e){const i=Math.random(),r=t-s;return i<=(e-s)/r?s+Math.sqrt(i*r*(e-s)):t-Math.sqrt((1-i)*r*(t-e))}static isPowerOfTwo(s){return s&&(s&s-1)===0}};let k=Li;k.PI=3.1415927,k.PI2=Li.PI*2,k.radiansToDegrees=180/Li.PI,k.radDeg=Li.radiansToDegrees,k.degreesToRadians=Li.PI/180,k.degRad=Li.degreesToRadians;class Uw{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class Gw extends Uw{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}}class Hw extends Gw{applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}const Ar=class{static arrayCopy(s,t,e,i,r){for(let n=t,a=i;n<t+r;n++,a++)e[a]=s[n]}static arrayFill(s,t,e,i){for(let r=t;r<e;r++)s[r]=i}static setArraySize(s,t,e=0){const i=s.length;if(i==t)return s;if(s.length=t,i<t)for(let r=i;r<t;r++)s[r]=e;return s}static ensureArrayCapacity(s,t,e=0){return s.length>=t?s:Ar.setArraySize(s,t,e)}static newArray(s,t){const e=new Array(s);for(let i=0;i<s;i++)e[i]=t;return e}static newFloatArray(s){if(Ar.SUPPORTS_TYPED_ARRAYS)return new Float32Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static newShortArray(s){if(Ar.SUPPORTS_TYPED_ARRAYS)return new Int16Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static toFloatArray(s){return Ar.SUPPORTS_TYPED_ARRAYS?new Float32Array(s):s}static toSinglePrecision(s){return Ar.SUPPORTS_TYPED_ARRAYS?Math.fround(s):s}static webkit602BugfixHelper(s,t){}static contains(s,t,e=!0){for(let i=0;i<s.length;i++)if(s[i]==t)return!0;return!1}static enumValue(s,t){return s[t[0].toUpperCase()+t.slice(1)]}};let Q=Ar;Q.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";class Vw{constructor(t){this.items=new Array,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}}class Ww{constructor(t=0,e=0){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}}const Xw={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0},os=[0,0,0];class zw extends ge{constructor(){super(...arguments),this.region=null,this.attachment=null}}class $w extends Ob{constructor(t,e,i,r,n){super(t,e,i,r,n),this.region=null,this.attachment=null}}const Ym=class extends vt{constructor(s){if(super(),!s)throw new Error("The spineData param is required.");if(typeof s=="string")throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=s,this.createSkeleton(s),this.slotContainers=[],this.tempClipContainers=[];for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t],r=i.getAttachment(),n=this.newContainer();if(this.slotContainers.push(n),this.addChild(n),this.tempClipContainers.push(null),!!r)if(r.type===_i.Region){const a=r.name,o=this.createSprite(i,r,a);i.currentSprite=o,i.currentSpriteName=a,n.addChild(o)}else if(r.type===_i.Mesh){const a=this.createMesh(i,r);i.currentMesh=a,i.currentMeshId=r.id,i.currentMeshName=r.name,n.addChild(a)}else r.type===_i.Clipping&&(this.createGraphics(i,r),n.addChild(i.clippingContainer),n.addChild(i.currentGraphics))}this.tintRgb=new Float32Array([1,1,1]),this.autoUpdate=!0,this.visible=!0}get debug(){return this._debug}set debug(s){var t;s!=this._debug&&((t=this._debug)==null||t.unregisterSpine(this),s==null||s.registerSpine(this),this._debug=s)}get autoUpdate(){return this._autoUpdate}set autoUpdate(s){s!==this._autoUpdate&&(this._autoUpdate=s,this.updateTransform=s?Ym.prototype.autoUpdateTransform:vt.prototype.updateTransform)}get tint(){return Zr(this.tintRgb)}set tint(s){this.tintRgb=Ed(s,this.tintRgb)}get delayLimit(){return(typeof this.localDelayLimit<"u"?this.localDelayLimit:Xw.GLOBAL_DELAY_LIMIT)||Number.MAX_VALUE}update(s){var l;const t=this.delayLimit;if(s>t&&(s=t),this.state.update(s),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const e=this.skeleton.slots,i=this.color;let r=null,n=null;i?(r=i.light,n=i.dark):r=this.tintRgb;for(let c=0,d=e.length;c<d;c++){const u=e[c],f=u.getAttachment(),p=this.slotContainers[c];if(!f){p.visible=!1;continue}let m=null;f.sequence&&f.sequence.apply(u,f);let g=f.region;const y=f.color;switch(f!=null&&f.type){case _i.Region:if(p.transform.setFromMatrix(u.bone.matrix),g=f.region,u.currentMesh&&(u.currentMesh.visible=!1,u.currentMesh=null,u.currentMeshId=void 0,u.currentMeshName=void 0),!g){u.currentSprite&&(u.currentSprite.renderable=!1);break}if(!u.currentSpriteName||u.currentSpriteName!==f.name){const x=f.name;if(u.currentSprite&&(u.currentSprite.visible=!1),u.sprites=u.sprites||{},u.sprites[x]!==void 0)u.sprites[x].visible=!0;else{const b=this.createSprite(u,f,x);p.addChild(b)}u.currentSprite=u.sprites[x],u.currentSpriteName=x}u.currentSprite.renderable=!0,u.hackRegion||this.setSpriteRegion(f,u.currentSprite,g),u.currentSprite.color?m=u.currentSprite.color:(os[0]=r[0]*u.color.r*y.r,os[1]=r[1]*u.color.g*y.g,os[2]=r[2]*u.color.b*y.b,u.currentSprite.tint=Zr(os)),u.currentSprite.blendMode=u.blendMode;break;case _i.Mesh:if(u.currentSprite){u.currentSprite.visible=!1,u.currentSprite=null,u.currentSpriteName=void 0;const x=new ha;x._parentID=-1,x._worldID=p.transform._worldID,p.transform=x}if(!g){u.currentMesh&&(u.currentMesh.renderable=!1);break}const _=f.id;if(u.currentMeshId===void 0||u.currentMeshId!==_){const x=_;if(u.currentMesh&&(u.currentMesh.visible=!1),u.meshes=u.meshes||{},u.meshes[x]!==void 0)u.meshes[x].visible=!0;else{const b=this.createMesh(u,f);p.addChild(b)}u.currentMesh=u.meshes[x],u.currentMeshName=f.name,u.currentMeshId=x}u.currentMesh.renderable=!0,f.computeWorldVerticesOld(u,u.currentMesh.vertices),u.currentMesh.color?m=u.currentMesh.color:(os[0]=r[0]*u.color.r*y.r,os[1]=r[1]*u.color.g*y.g,os[2]=r[2]*u.color.b*y.b,u.currentMesh.tint=Zr(os)),u.currentMesh.blendMode=u.blendMode,u.hackRegion||this.setMeshRegion(f,u.currentMesh,g);break;case _i.Clipping:u.currentGraphics||(this.createGraphics(u,f),p.addChild(u.clippingContainer),p.addChild(u.currentGraphics)),this.updateGraphics(u,f),p.alpha=1,p.visible=!0;continue;default:p.visible=!1;continue}if(p.visible=!0,m){let v=u.color.r*y.r,_=u.color.g*y.g,x=u.color.b*y.b;m.setLight(r[0]*v+n[0]*(1-v),r[1]*_+n[1]*(1-_),r[2]*x+n[2]*(1-x)),u.darkColor?(v=u.darkColor.r,_=u.darkColor.g,x=u.darkColor.b):(v=0,_=0,x=0),m.setDark(r[0]*v+n[0]*(1-v),r[1]*_+n[1]*(1-_),r[2]*x+n[2]*(1-x))}p.alpha=u.color.a}const a=this.skeleton.drawOrder;let o=null,h=null;for(let c=0,d=a.length;c<d;c++){const u=e[a[c].data.index],f=this.slotContainers[a[c].data.index];if(h||f.parent!==null&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),u.currentGraphics&&u.getAttachment())h=u.clippingContainer,o=u.getAttachment(),h.children.length=0,this.children[c]=f,o.endSlot===u.data&&(o.endSlot=null);else if(h){let p=this.tempClipContainers[c];p||(p=this.tempClipContainers[c]=this.newContainer(),p.visible=!1),this.children[c]=p,f.parent=null,h.addChild(f),o.endSlot==u.data&&(h.renderable=!0,h=null,o=null)}else this.children[c]=f}(l=this._debug)==null||l.renderDebug(this)}setSpriteRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,t.rotation=s.rotation*k.degRad,t.position.x=s.x,t.position.y=s.y,t.alpha=s.color.a,e.size?(t.scale.x=e.size.width/e.originalWidth,t.scale.y=-e.size.height/e.originalHeight):(t.scale.x=s.scaleX*s.width/e.originalWidth,t.scale.y=-s.scaleY*s.height/e.originalHeight))}setMeshRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,e.texture.updateUvs(),t.uvBuffer.update(s.regionUVs))}autoUpdateTransform(){{this.lastTime=this.lastTime||Date.now();const s=(Date.now()-this.lastTime)*.001;this.lastTime=Date.now(),this.update(s)}vt.prototype.updateTransform.call(this)}createSprite(s,t,e){let i=t.region;s.hackAttachment===t&&(i=s.hackRegion);const r=i?i.texture:null,n=this.newSprite(r);return n.anchor.set(.5),i&&this.setSpriteRegion(t,n,t.region),s.sprites=s.sprites||{},s.sprites[e]=n,n}createMesh(s,t){let e=t.region;s.hackAttachment===t&&(e=s.hackRegion,s.hackAttachment=null,s.hackRegion=null);const i=this.newMesh(e?e.texture:null,new Float32Array(t.regionUVs.length),t.regionUVs,new Uint16Array(t.triangles),Ne.TRIANGLES);return typeof i._canvasPadding<"u"&&(i._canvasPadding=1.5),i.alpha=t.color.a,i.region=t.region,e&&this.setMeshRegion(t,i,e),s.meshes=s.meshes||{},s.meshes[t.id]=i,i}createGraphics(s,t){const e=this.newGraphics(),i=new Xi([]);return e.clear(),e.beginFill(16777215,1),e.drawPolygon(i),e.renderable=!1,s.currentGraphics=e,s.clippingContainer=this.newContainer(),s.clippingContainer.mask=s.currentGraphics,e}updateGraphics(s,t){const e=s.currentGraphics.geometry,i=e.graphicsData[0].shape.points,r=t.worldVerticesLength;i.length=r,t.computeWorldVertices(s,0,r,i,0,2),e.invalidate()}hackTextureBySlotIndex(s,t=null,e=null){const i=this.skeleton.slots[s];if(!i)return!1;const r=i.getAttachment();let n=r.region;return t?(n=new $m,n.texture=t,n.size=e,i.hackRegion=n,i.hackAttachment=r):(i.hackRegion=null,i.hackAttachment=null),i.currentSprite?this.setSpriteRegion(r,i.currentSprite,n):i.currentMesh&&this.setMeshRegion(r,i.currentMesh,n),!0}hackTextureBySlotName(s,t=null,e=null){const i=this.skeleton.findSlotIndex(s);return i==-1?!1:this.hackTextureBySlotIndex(i,t,e)}hackTextureAttachment(s,t,e,i=null){const r=this.skeleton.findSlotIndex(s),n=this.skeleton.getAttachmentByName(s,t);n.region.texture=e;const a=this.skeleton.slots[r];if(!a)return!1;const o=a.getAttachment();if(t===o.name){let h=n.region;return e?(h=new $m,h.texture=e,h.size=i,a.hackRegion=h,a.hackAttachment=o):(a.hackRegion=null,a.hackAttachment=null),a.currentSprite&&a.currentSprite.region!=h?(this.setSpriteRegion(o,a.currentSprite,h),a.currentSprite.region=h):a.currentMesh&&a.currentMesh.region!=h&&this.setMeshRegion(o,a.currentMesh,h),!0}return!1}newContainer(){return new vt}newSprite(s){return new zw(s)}newGraphics(){return new hi}newMesh(s,t,e,i,r){return new $w(s,t,e,i,r)}transformHack(){return 1}hackAttachmentGroups(s,t,e){if(!s)return;const i=[],r=[];for(let n=0,a=this.skeleton.slots.length;n<a;n++){const o=this.skeleton.slots[n],h=o.currentSpriteName||o.currentMeshName||"",l=o.currentSprite||o.currentMesh;h.endsWith(s)?(l.parentGroup=t,r.push(l)):e&&l&&(l.parentGroup=e,i.push(l))}return[i,r]}destroy(s){this.debug=null;for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t];for(const r in i.meshes)i.meshes[r].destroy(s);i.meshes=null;for(const r in i.sprites)i.sprites[r].destroy(s);i.sprites=null}for(let t=0,e=this.slotContainers.length;t<e;t++)this.slotContainers[t].destroy(s);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,super.destroy(s)}};let Mc=Ym;Mc.clippingPolygon=[],Object.defineProperty(Mc.prototype,"visible",{get(){return this._visible},set(s){s!==this._visible&&(this._visible=s,s&&(this.lastTime=0))}});class jm{constructor(t){if(t==null)throw new Error("name cannot be null.");this.name=t}}const qm=class extends jm{constructor(s){super(s),this.id=(qm.nextID++&65535)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(s,t){this.computeWorldVertices(s,0,this.worldVerticesLength,t,0,2)}computeWorldVertices(s,t,e,i,r,n){e=r+(e>>1)*n;const a=s.bone.skeleton,o=s.deform;let h=this.vertices;const l=this.bones;if(l==null){o.length>0&&(h=o);const f=s.bone.matrix,p=f.tx,m=f.ty,g=f.a,y=f.c,v=f.b,_=f.d;for(let x=t,b=r;b<e;x+=2,b+=n){const w=h[x],T=h[x+1];i[b]=w*g+T*y+p,i[b+1]=w*v+T*_+m}return}let c=0,d=0;for(let f=0;f<t;f+=2){const p=l[c];c+=p+1,d+=p}const u=a.bones;if(o.length==0)for(let f=r,p=d*3;f<e;f+=n){let m=0,g=0,y=l[c++];for(y+=c;c<y;c++,p+=3){const v=u[l[c]].matrix,_=h[p],x=h[p+1],b=h[p+2];m+=(_*v.a+x*v.c+v.tx)*b,g+=(_*v.b+x*v.d+v.ty)*b}i[f]=m,i[f+1]=g}else{const f=o;for(let p=r,m=d*3,g=d<<1;p<e;p+=n){let y=0,v=0,_=l[c++];for(_+=c;c<_;c++,m+=3,g+=2){const x=u[l[c]].matrix,b=h[m]+f[g],w=h[m+1]+f[g+1],T=h[m+2];y+=(b*x.a+w*x.c+x.tx)*T,v+=(b*x.b+w*x.d+x.ty)*T}i[p]=y,i[p+1]=v}}}copyTo(s){this.bones!=null?(s.bones=new Array(this.bones.length),Q.arrayCopy(this.bones,0,s.bones,0,this.bones.length)):s.bones=null,this.vertices!=null?(s.vertices=Q.newFloatArray(this.vertices.length),Q.arrayCopy(this.vertices,0,s.vertices,0,this.vertices.length)):s.vertices=null,s.worldVerticesLength=this.worldVerticesLength,s.deformAttachment=this.deformAttachment}};let Dc=qm;Dc.nextID=0;class co extends Dc{constructor(t){super(t),this.type=_i.Mesh,this.color=new we(1,1,1,1),this.tempColor=new we(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t!=null&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh!=null)return this.newLinkedMesh();const t=new co(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),Q.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),Q.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=new Array(this.edges.length),Q.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new co(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh!=null?this.parentMesh:this),t}}class En extends Dc{constructor(t){super(t),this.type=_i.Path,this.closed=!1,this.constantSpeed=!1,this.color=new we(1,1,1,1)}copy(){const t=new En(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),Q.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class Km{constructor(t,e){if(this.deform=new Array,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new we,this.darkColor=t.darkColor==null?null:new we,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const Kt=class extends jm{constructor(s){super(s),this.type=_i.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new we(1,1,1,1),this.offset=Q.newFloatArray(8),this.uvs=Q.newFloatArray(8),this.tempColor=new we(1,1,1,1)}updateOffset(){const s=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,e=-this.width/2*this.scaleX+this.region.offsetX*s,i=-this.height/2*this.scaleY+this.region.offsetY*t,r=e+this.region.width*s,n=i+this.region.height*t,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=e*o+this.x,c=e*h,d=i*o+this.y,u=i*h,f=r*o+this.x,p=r*h,m=n*o+this.y,g=n*h,y=this.offset;y[Kt.OX1]=l-u,y[Kt.OY1]=d+c,y[Kt.OX2]=l-g,y[Kt.OY2]=m+c,y[Kt.OX3]=f-g,y[Kt.OY3]=m+p,y[Kt.OX4]=f-u,y[Kt.OY4]=d+p}setRegion(s){this.region=s;const t=this.uvs;s.rotate?(t[2]=s.u,t[3]=s.v2,t[4]=s.u,t[5]=s.v,t[6]=s.u2,t[7]=s.v,t[0]=s.u2,t[1]=s.v2):(t[0]=s.u,t[1]=s.v2,t[2]=s.u,t[3]=s.v,t[4]=s.u2,t[5]=s.v,t[6]=s.u2,t[7]=s.v2)}computeWorldVertices(s,t,e,i){const r=this.offset,n=s instanceof Km?s.bone.matrix:s.matrix,a=n.tx,o=n.ty,h=n.a,l=n.c,c=n.b,d=n.d;let u=0,f=0;u=r[Kt.OX1],f=r[Kt.OY1],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=r[Kt.OX2],f=r[Kt.OY2],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=r[Kt.OX3],f=r[Kt.OY3],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=r[Kt.OX4],f=r[Kt.OY4],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o}copy(){const s=new Kt(this.name);return s.region=this.region,s.rendererObject=this.rendererObject,s.path=this.path,s.x=this.x,s.y=this.y,s.scaleX=this.scaleX,s.scaleY=this.scaleY,s.rotation=this.rotation,s.width=this.width,s.height=this.height,Q.arrayCopy(this.uvs,0,s.uvs,0,8),Q.arrayCopy(this.offset,0,s.offset,0,8),s.color.setFromColor(this.color),s}};let et=Kt;et.OX1=0,et.OY1=1,et.OX2=2,et.OY2=3,et.OX3=4,et.OY3=5,et.OX4=6,et.OY4=7,et.X1=0,et.Y1=1,et.C1R=2,et.C1G=3,et.C1B=4,et.C1A=5,et.U1=6,et.V1=7,et.X2=8,et.Y2=9,et.C2R=10,et.C2G=11,et.C2B=12,et.C2A=13,et.U2=14,et.V2=15,et.X3=16,et.Y3=17,et.C3R=18,et.C3G=19,et.C3B=20,et.C3A=21,et.U3=22,et.V3=23,et.X4=24,et.Y4=25,et.C4R=26,et.C4G=27,et.C4B=28,et.C4A=29,et.U4=30,et.V4=31,new Hw(2);class pe{constructor(t,e,i){if(t==null)throw new Error("name cannot be null.");if(e==null)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let r=0;r<e.length;r++)this.timelineIds[e[r].getPropertyId()]=!0;this.duration=i}hasTimeline(t){return this.timelineIds[t]==!0}apply(t,e,i,r,n,a,o,h){if(t==null)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));const l=this.timelines;for(let c=0,d=l.length;c<d;c++)l[c].apply(t,e,i,n,a,o,h)}static binarySearch(t,e,i=1){let r=0,n=t.length/i-2;if(n==0)return i;let a=n>>>1;for(;;){if(t[(a+1)*i]<=e?r=a+1:n=a,r==n)return(r+1)*i;a=r+n>>>1}}static linearSearch(t,e,i){for(let r=0,n=t.length-i;r<=n;r+=i)if(t[r]>e)return r;return-1}}const Ut=class{constructor(s){if(s<=0)throw new Error(`frameCount must be > 0: ${s}`);this.curves=Q.newFloatArray((s-1)*Ut.BEZIER_SIZE)}getFrameCount(){return this.curves.length/Ut.BEZIER_SIZE+1}setLinear(s){this.curves[s*Ut.BEZIER_SIZE]=Ut.LINEAR}setStepped(s){this.curves[s*Ut.BEZIER_SIZE]=Ut.STEPPED}getCurveType(s){const t=s*Ut.BEZIER_SIZE;if(t==this.curves.length)return Ut.LINEAR;const e=this.curves[t];return e==Ut.LINEAR?Ut.LINEAR:e==Ut.STEPPED?Ut.STEPPED:Ut.BEZIER}setCurve(s,t,e,i,r){const n=(-t*2+i)*.03,a=(-e*2+r)*.03,o=((t-i)*3+1)*.006,h=((e-r)*3+1)*.006;let l=n*2+o,c=a*2+h,d=t*.3+n+o*.16666667,u=e*.3+a+h*.16666667,f=s*Ut.BEZIER_SIZE;const p=this.curves;p[f++]=Ut.BEZIER;let m=d,g=u;for(let y=f+Ut.BEZIER_SIZE-1;f<y;f+=2)p[f]=m,p[f+1]=g,d+=l,u+=c,l+=o,c+=h,m+=d,g+=u}getCurvePercent(s,t){t=k.clamp(t,0,1);const e=this.curves;let i=s*Ut.BEZIER_SIZE;const r=e[i];if(r==Ut.LINEAR)return t;if(r==Ut.STEPPED)return 0;i++;let n=0;for(let o=i,h=i+Ut.BEZIER_SIZE-1;i<h;i+=2)if(n=e[i],n>=t){let l,c;return i==o?(l=0,c=0):(l=e[i-2],c=e[i-1]),c+(e[i+1]-c)*(t-l)/(n-l)}const a=e[i-1];return a+(1-a)*(t-n)/(1-n)}};let Oe=Ut;Oe.LINEAR=0,Oe.STEPPED=1,Oe.BEZIER=2,Oe.BEZIER_SIZE=10*2-1;const hs=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(s,t,e){s<<=1,this.frames[s]=t,this.frames[s+hs.ROTATION]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotation=h.data.rotation;return;case j.first:const p=h.data.rotation-h.rotation;h.rotation+=(p-(16384-(16384.499999999996-p/360|0))*360)*r}return}if(e>=o[o.length-hs.ENTRIES]){let p=o[o.length+hs.PREV_ROTATION];switch(n){case j.setup:h.rotation=h.data.rotation+p*r;break;case j.first:case j.replace:p+=h.data.rotation-h.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case j.add:h.rotation+=p*r}return}const l=pe.binarySearch(o,e,hs.ENTRIES),c=o[l+hs.PREV_ROTATION],d=o[l],u=this.getCurvePercent((l>>1)-1,1-(e-d)/(o[l+hs.PREV_TIME]-d));let f=o[l+hs.ROTATION]-c;switch(f=c+(f-(16384-(16384.499999999996-f/360|0))*360)*u,n){case j.setup:h.rotation=h.data.rotation+(f-(16384-(16384.499999999996-f/360|0))*360)*r;break;case j.first:case j.replace:f+=h.data.rotation-h.rotation;case j.add:h.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*r}}};let Fe=hs;Fe.ENTRIES=2,Fe.PREV_TIME=-2,Fe.PREV_ROTATION=-1,Fe.ROTATION=1;const ae=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ae.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(s,t,e,i){s*=ae.ENTRIES,this.frames[s]=t,this.frames[s+ae.X]=e,this.frames[s+ae.Y]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.x=h.data.x,h.y=h.data.y;return;case j.first:h.x+=(h.data.x-h.x)*r,h.y+=(h.data.y-h.y)*r}return}let l=0,c=0;if(e>=o[o.length-ae.ENTRIES])l=o[o.length+ae.PREV_X],c=o[o.length+ae.PREV_Y];else{const d=pe.binarySearch(o,e,ae.ENTRIES);l=o[d+ae.PREV_X],c=o[d+ae.PREV_Y];const u=o[d],f=this.getCurvePercent(d/ae.ENTRIES-1,1-(e-u)/(o[d+ae.PREV_TIME]-u));l+=(o[d+ae.X]-l)*f,c+=(o[d+ae.Y]-c)*f}switch(n){case j.setup:h.x=h.data.x+l*r,h.y=h.data.y+c*r;break;case j.first:case j.replace:h.x+=(h.data.x+l-h.x)*r,h.y+=(h.data.y+c-h.y)*r;break;case j.add:h.x+=l*r,h.y+=c*r}}};let Sr=ae;Sr.ENTRIES=3,Sr.PREV_TIME=-3,Sr.PREV_X=-2,Sr.PREV_Y=-1,Sr.X=1,Sr.Y=2;const Rt=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Rt.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(s,t,e,i,r,n){s*=Rt.ENTRIES,this.frames[s]=t,this.frames[s+Rt.R]=e,this.frames[s+Rt.G]=i,this.frames[s+Rt.B]=r,this.frames[s+Rt.A]=n}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color);return;case j.first:const f=o.color,p=o.data.color;f.add((p.r-f.r)*r,(p.g-f.g)*r,(p.b-f.b)*r,(p.a-f.a)*r)}return}let l=0,c=0,d=0,u=0;if(e>=h[h.length-Rt.ENTRIES]){const f=h.length;l=h[f+Rt.PREV_R],c=h[f+Rt.PREV_G],d=h[f+Rt.PREV_B],u=h[f+Rt.PREV_A]}else{const f=pe.binarySearch(h,e,Rt.ENTRIES);l=h[f+Rt.PREV_R],c=h[f+Rt.PREV_G],d=h[f+Rt.PREV_B],u=h[f+Rt.PREV_A];const p=h[f],m=this.getCurvePercent(f/Rt.ENTRIES-1,1-(e-p)/(h[f+Rt.PREV_TIME]-p));l+=(h[f+Rt.R]-l)*m,c+=(h[f+Rt.G]-c)*m,d+=(h[f+Rt.B]-d)*m,u+=(h[f+Rt.A]-u)*m}if(r==1)o.color.set(l,c,d,u);else{const f=o.color;n==j.setup&&f.setFromColor(o.data.color),f.add((l-f.r)*r,(c-f.g)*r,(d-f.b)*r,(u-f.a)*r)}}};let yi=Rt;yi.ENTRIES=5,yi.PREV_TIME=-5,yi.PREV_R=-4,yi.PREV_G=-3,yi.PREV_B=-2,yi.PREV_A=-1,yi.R=1,yi.G=2,yi.B=3,yi.A=4;const ot=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ot.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(s,t,e,i,r,n,a,o,h){s*=ot.ENTRIES,this.frames[s]=t,this.frames[s+ot.R]=e,this.frames[s+ot.G]=i,this.frames[s+ot.B]=r,this.frames[s+ot.A]=n,this.frames[s+ot.R2]=a,this.frames[s+ot.G2]=o,this.frames[s+ot.B2]=h}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color),o.darkColor.setFromColor(o.data.darkColor);return;case j.first:const g=o.color,y=o.darkColor,v=o.data.color,_=o.data.darkColor;g.add((v.r-g.r)*r,(v.g-g.g)*r,(v.b-g.b)*r,(v.a-g.a)*r),y.add((_.r-y.r)*r,(_.g-y.g)*r,(_.b-y.b)*r,0)}return}let l=0,c=0,d=0,u=0,f=0,p=0,m=0;if(e>=h[h.length-ot.ENTRIES]){const g=h.length;l=h[g+ot.PREV_R],c=h[g+ot.PREV_G],d=h[g+ot.PREV_B],u=h[g+ot.PREV_A],f=h[g+ot.PREV_R2],p=h[g+ot.PREV_G2],m=h[g+ot.PREV_B2]}else{const g=pe.binarySearch(h,e,ot.ENTRIES);l=h[g+ot.PREV_R],c=h[g+ot.PREV_G],d=h[g+ot.PREV_B],u=h[g+ot.PREV_A],f=h[g+ot.PREV_R2],p=h[g+ot.PREV_G2],m=h[g+ot.PREV_B2];const y=h[g],v=this.getCurvePercent(g/ot.ENTRIES-1,1-(e-y)/(h[g+ot.PREV_TIME]-y));l+=(h[g+ot.R]-l)*v,c+=(h[g+ot.G]-c)*v,d+=(h[g+ot.B]-d)*v,u+=(h[g+ot.A]-u)*v,f+=(h[g+ot.R2]-f)*v,p+=(h[g+ot.G2]-p)*v,m+=(h[g+ot.B2]-m)*v}if(r==1)o.color.set(l,c,d,u),o.darkColor.set(f,p,m,1);else{const g=o.color,y=o.darkColor;n==j.setup&&(g.setFromColor(o.data.color),y.setFromColor(o.data.darkColor)),g.add((l-g.r)*r,(c-g.g)*r,(d-g.b)*r,(u-g.a)*r),y.add((f-y.r)*r,(p-y.g)*r,(m-y.b)*r,0)}}};let re=ot;re.ENTRIES=8,re.PREV_TIME=-8,re.PREV_R=-7,re.PREV_G=-6,re.PREV_B=-5,re.PREV_A=-4,re.PREV_R2=-3,re.PREV_G2=-2,re.PREV_B2=-1,re.R=1,re.G=2,re.B=3,re.A=4,re.R2=5,re.G2=6,re.B2=7;class uo{constructor(t){this.frames=Q.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,r,n,a,o){const h=t.slots[this.slotIndex];if(!h.bone.active)return;if(o==Te.mixOut){a==j.setup&&this.setAttachment(t,h,h.data.attachmentName);return}const l=this.frames;if(i<l[0]){(a==j.setup||a==j.first)&&this.setAttachment(t,h,h.data.attachmentName);return}let c=0;i>=l[l.length-1]?c=l.length-1:c=pe.binarySearch(l,i,1)-1;const d=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(d==null?null:t.getAttachment(this.slotIndex,d))}setAttachment(t,e,i){e.setAttachment(i==null?null:t.getAttachment(this.slotIndex,i))}}class Yw{constructor(t){this.frames=Q.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,r,n,a,o){if(r==null)return;const h=this.frames,l=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,r,n,a,o),e=-1;else if(e>=h[l-1])return;if(i<h[0])return;let c=0;if(e<h[0])c=0;else{c=pe.binarySearch(h,e);const d=h[c];for(;c>0&&h[c-1]==d;)c--}for(;c<l&&i>=h[c];c++)r.push(this.events[c])}}class Bc{constructor(t){this.frames=Q.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,r,n,a,o){const h=t.drawOrder,l=t.slots;if(o==Te.mixOut&&a==j.setup){Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}const c=this.frames;if(i<c[0]){(a==j.setup||a==j.first)&&Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let d=0;i>=c[c.length-1]?d=c.length-1:d=pe.binarySearch(c,i)-1;const u=this.drawOrders[d];if(u==null)Q.arrayCopy(l,0,h,0,l.length);else for(let f=0,p=u.length;f<p;f++)h[f]=l[u[f]]}}const ht=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ht.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(s,t,e,i,r,n,a){s*=ht.ENTRIES,this.frames[s]=t,this.frames[s+ht.MIX]=e,this.frames[s+ht.SOFTNESS]=i,this.frames[s+ht.BEND_DIRECTION]=r,this.frames[s+ht.COMPRESS]=n?1:0,this.frames[s+ht.STRETCH]=a?1:0}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch;return;case j.first:h.mix+=(h.data.mix-h.mix)*r,h.softness+=(h.data.softness-h.softness)*r,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(e>=o[o.length-ht.ENTRIES]){n==j.setup?(h.mix=h.data.mix+(o[o.length+ht.PREV_MIX]-h.data.mix)*r,h.softness=h.data.softness+(o[o.length+ht.PREV_SOFTNESS]-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0)):(h.mix+=(o[o.length+ht.PREV_MIX]-h.mix)*r,h.softness+=(o[o.length+ht.PREV_SOFTNESS]-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0));return}const l=pe.binarySearch(o,e,ht.ENTRIES),c=o[l+ht.PREV_MIX],d=o[l+ht.PREV_SOFTNESS],u=o[l],f=this.getCurvePercent(l/ht.ENTRIES-1,1-(e-u)/(o[l+ht.PREV_TIME]-u));n==j.setup?(h.mix=h.data.mix+(c+(o[l+ht.MIX]-c)*f-h.data.mix)*r,h.softness=h.data.softness+(d+(o[l+ht.SOFTNESS]-d)*f-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0)):(h.mix+=(c+(o[l+ht.MIX]-c)*f-h.mix)*r,h.softness+=(d+(o[l+ht.SOFTNESS]-d)*f-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0))}};let Le=ht;Le.ENTRIES=6,Le.PREV_TIME=-6,Le.PREV_MIX=-5,Le.PREV_SOFTNESS=-4,Le.PREV_BEND_DIRECTION=-3,Le.PREV_COMPRESS=-2,Le.PREV_STRETCH=-1,Le.MIX=1,Le.SOFTNESS=2,Le.BEND_DIRECTION=3,Le.COMPRESS=4,Le.STRETCH=5;const It=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*It.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(s,t,e,i,r,n){s*=It.ENTRIES,this.frames[s]=t,this.frames[s+It.ROTATE]=e,this.frames[s+It.TRANSLATE]=i,this.frames[s+It.SCALE]=r,this.frames[s+It.SHEAR]=n}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(e<o[0]){const f=h.data;switch(n){case j.setup:h.rotateMix=f.rotateMix,h.translateMix=f.translateMix,h.scaleMix=f.scaleMix,h.shearMix=f.shearMix;return;case j.first:h.rotateMix+=(f.rotateMix-h.rotateMix)*r,h.translateMix+=(f.translateMix-h.translateMix)*r,h.scaleMix+=(f.scaleMix-h.scaleMix)*r,h.shearMix+=(f.shearMix-h.shearMix)*r}return}let l=0,c=0,d=0,u=0;if(e>=o[o.length-It.ENTRIES]){const f=o.length;l=o[f+It.PREV_ROTATE],c=o[f+It.PREV_TRANSLATE],d=o[f+It.PREV_SCALE],u=o[f+It.PREV_SHEAR]}else{const f=pe.binarySearch(o,e,It.ENTRIES);l=o[f+It.PREV_ROTATE],c=o[f+It.PREV_TRANSLATE],d=o[f+It.PREV_SCALE],u=o[f+It.PREV_SHEAR];const p=o[f],m=this.getCurvePercent(f/It.ENTRIES-1,1-(e-p)/(o[f+It.PREV_TIME]-p));l+=(o[f+It.ROTATE]-l)*m,c+=(o[f+It.TRANSLATE]-c)*m,d+=(o[f+It.SCALE]-d)*m,u+=(o[f+It.SHEAR]-u)*m}if(n==j.setup){const f=h.data;h.rotateMix=f.rotateMix+(l-f.rotateMix)*r,h.translateMix=f.translateMix+(c-f.translateMix)*r,h.scaleMix=f.scaleMix+(d-f.scaleMix)*r,h.shearMix=f.shearMix+(u-f.shearMix)*r}else h.rotateMix+=(l-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r,h.scaleMix+=(d-h.scaleMix)*r,h.shearMix+=(u-h.shearMix)*r}};let xi=It;xi.ENTRIES=5,xi.PREV_TIME=-5,xi.PREV_ROTATE=-4,xi.PREV_TRANSLATE=-3,xi.PREV_SCALE=-2,xi.PREV_SHEAR=-1,xi.ROTATE=1,xi.TRANSLATE=2,xi.SCALE=3,xi.SHEAR=4;const Ye=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Ye.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(s,t,e){s*=Ye.ENTRIES,this.frames[s]=t,this.frames[s+Ye.VALUE]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.position=h.data.position;return;case j.first:h.position+=(h.data.position-h.position)*r}return}let l=0;if(e>=o[o.length-Ye.ENTRIES])l=o[o.length+Ye.PREV_VALUE];else{const c=pe.binarySearch(o,e,Ye.ENTRIES);l=o[c+Ye.PREV_VALUE];const d=o[c],u=this.getCurvePercent(c/Ye.ENTRIES-1,1-(e-d)/(o[c+Ye.PREV_TIME]-d));l+=(o[c+Ye.VALUE]-l)*u}n==j.setup?h.position=h.data.position+(l-h.data.position)*r:h.position+=(l-h.position)*r}};let fo=Ye;fo.ENTRIES=2,fo.PREV_TIME=-2,fo.PREV_VALUE=-1,fo.VALUE=1;const oe=class extends Oe{constructor(s){super(s),this.frames=Q.newFloatArray(s*oe.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(s,t,e,i){s*=oe.ENTRIES,this.frames[s]=t,this.frames[s+oe.ROTATE]=e,this.frames[s+oe.TRANSLATE]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotateMix=h.data.rotateMix,h.translateMix=h.data.translateMix;return;case j.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*r,h.translateMix+=(h.data.translateMix-h.translateMix)*r}return}let l=0,c=0;if(e>=o[o.length-oe.ENTRIES])l=o[o.length+oe.PREV_ROTATE],c=o[o.length+oe.PREV_TRANSLATE];else{const d=pe.binarySearch(o,e,oe.ENTRIES);l=o[d+oe.PREV_ROTATE],c=o[d+oe.PREV_TRANSLATE];const u=o[d],f=this.getCurvePercent(d/oe.ENTRIES-1,1-(e-u)/(o[d+oe.PREV_TIME]-u));l+=(o[d+oe.ROTATE]-l)*f,c+=(o[d+oe.TRANSLATE]-c)*f}n==j.setup?(h.rotateMix=h.data.rotateMix+(l-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(c-h.data.translateMix)*r):(h.rotateMix+=(l-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r)}};let Cr=oe;Cr.ENTRIES=3,Cr.PREV_TIME=-3,Cr.PREV_ROTATE=-2,Cr.PREV_TRANSLATE=-1,Cr.ROTATE=1,Cr.TRANSLATE=2;const Mt=class{constructor(s){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Zm(this),this.propertyIDs=new Nw,this.animationsChanged=!1,this.trackEntryPool=new Vw(()=>new Oc),this.data=s}update(s){s*=this.timeScale;const t=this.tracks;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r==null)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let n=s*r.timeScale;if(r.delay>0){if(r.delay-=n,r.delay>0)continue;n=-r.delay,r.delay=0}let a=r.next;if(a!=null){const o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(o/r.timeScale+s)*a.timeScale,r.trackTime+=n,this.setCurrent(e,a,!0);a.mixingFrom!=null;)a.mixTime+=s,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&r.mixingFrom==null){t[e]=null,this.queue.end(r),this.disposeNext(r);continue}if(r.mixingFrom!=null&&this.updateMixingFrom(r,s)){let o=r.mixingFrom;for(r.mixingFrom=null,o!=null&&(o.mixingTo=null);o!=null;)this.queue.end(o),o=o.mixingFrom}r.trackTime+=n}this.queue.drain()}updateMixingFrom(s,t){const e=s.mixingFrom;if(e==null)return!0;const i=this.updateMixingFrom(e,t);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,s.mixTime>0&&s.mixTime>=s.mixDuration?((e.totalAlpha==0||s.mixDuration==0)&&(s.mixingFrom=e.mixingFrom,e.mixingFrom!=null&&(e.mixingFrom.mixingTo=s),s.interruptAlpha=e.interruptAlpha,this.queue.end(e)),i):(e.trackTime+=t*e.timeScale,s.mixTime+=t,!1)}apply(s){if(s==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,e=this.tracks;let i=!1;for(let a=0,o=e.length;a<o;a++){const h=e[a];if(h==null||h.delay>0)continue;i=!0;const l=a==0?j.first:h.mixBlend;let c=h.alpha;h.mixingFrom!=null?c*=this.applyMixingFrom(h,s,l):h.trackTime>=h.trackEnd&&h.next==null&&(c=0);const d=h.animationLast,u=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(a==0&&c==1||l==j.add)for(let m=0;m<f;m++){const g=p[m];g instanceof uo?this.applyAttachmentTimeline(g,s,u,l,!0):g.apply(s,d,u,t,c,l,Te.mixIn)}else{const m=h.timelineMode,g=h.timelinesRotation.length==0;g&&Q.setArraySize(h.timelinesRotation,f<<1,null);const y=h.timelinesRotation;for(let v=0;v<f;v++){const _=p[v],x=m[v]==Mt.SUBSEQUENT?l:j.setup;_ instanceof Fe?this.applyRotateTimeline(_,s,u,c,x,y,v<<1,g):_ instanceof uo?this.applyAttachmentTimeline(_,s,u,l,!0):_.apply(s,d,u,t,c,x,Te.mixIn)}}this.queueEvents(h,u),t.length=0,h.nextAnimationLast=u,h.nextTrackLast=h.trackTime}const r=this.unkeyedState+Mt.SETUP,n=s.slots;for(let a=0,o=s.slots.length;a<o;a++){const h=n[a];if(h.attachmentState==r){const l=h.data.attachmentName;h.setAttachment(l==null?null:s.getAttachment(h.data.index,l))}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(s,t,e){const i=s.mixingFrom;i.mixingFrom!=null&&this.applyMixingFrom(i,t,e);let r=0;s.mixDuration==0?(r=1,e==j.first&&(e=j.setup)):(r=s.mixTime/s.mixDuration,r>1&&(r=1),e!=j.first&&(e=i.mixBlend));const n=r<i.eventThreshold?this.events:null,a=r<i.attachmentThreshold,o=r<i.drawOrderThreshold,h=i.animationLast,l=i.getAnimationTime(),c=i.animation.timelines.length,d=i.animation.timelines,u=i.alpha*s.interruptAlpha,f=u*(1-r);if(e==j.add)for(let p=0;p<c;p++)d[p].apply(t,h,l,n,f,e,Te.mixOut);else{const p=i.timelineMode,m=i.timelineHoldMix,g=i.timelinesRotation.length==0;g&&Q.setArraySize(i.timelinesRotation,c<<1,null);const y=i.timelinesRotation;i.totalAlpha=0;for(let v=0;v<c;v++){const _=d[v];let x=Te.mixOut,b,w=0;switch(p[v]){case Mt.SUBSEQUENT:if(!o&&_ instanceof Bc)continue;b=e,w=f;break;case Mt.FIRST:b=j.setup,w=f;break;case Mt.HOLD_SUBSEQUENT:b=e,w=u;break;case Mt.HOLD_FIRST:b=j.setup,w=u;break;default:b=j.setup;const T=m[v];w=u*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=w,_ instanceof Fe?this.applyRotateTimeline(_,t,l,w,b,y,v<<1,g):_ instanceof uo?this.applyAttachmentTimeline(_,t,l,b,a):(o&&_ instanceof Bc&&b==j.setup&&(x=Te.mixIn),_.apply(t,h,l,n,w,b,x))}}return s.mixDuration>0&&this.queueEvents(i,l),this.events.length=0,i.nextAnimationLast=l,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(s,t,e,i,r){const n=t.slots[s.slotIndex];if(!n.bone.active)return;const a=s.frames;if(e<a[0])(i==j.setup||i==j.first)&&this.setAttachment(t,n,n.data.attachmentName,r);else{let o;e>=a[a.length-1]?o=a.length-1:o=pe.binarySearch(a,e)-1,this.setAttachment(t,n,s.attachmentNames[o],r)}n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+Mt.SETUP)}setAttachment(s,t,e,i){t.setAttachment(e==null?null:s.getAttachment(t.data.index,e)),i&&(t.attachmentState=this.unkeyedState+Mt.CURRENT)}applyRotateTimeline(s,t,e,i,r,n,a,o){if(o&&(n[a]=0),i==1){s.apply(t,0,e,null,1,r,Te.mixIn);return}const h=s,l=h.frames,c=t.bones[h.boneIndex];if(!c.active)return;let d=0,u=0;if(e<l[0])switch(r){case j.setup:c.rotation=c.data.rotation;default:return;case j.first:d=c.rotation,u=c.data.rotation}else if(d=r==j.setup?c.data.rotation:c.rotation,e>=l[l.length-Fe.ENTRIES])u=c.data.rotation+l[l.length+Fe.PREV_ROTATION];else{const m=pe.binarySearch(l,e,Fe.ENTRIES),g=l[m+Fe.PREV_ROTATION],y=l[m],v=h.getCurvePercent((m>>1)-1,1-(e-y)/(l[m+Fe.PREV_TIME]-y));u=l[m+Fe.ROTATION]-g,u-=(16384-(16384.499999999996-u/360|0))*360,u=g+u*v+c.data.rotation,u-=(16384-(16384.499999999996-u/360|0))*360}let f=0,p=u-d;if(p-=(16384-(16384.499999999996-p/360|0))*360,p==0)f=n[a];else{let m=0,g=0;o?(m=0,g=p):(m=n[a],g=n[a+1]);const y=p>0;let v=m>=0;k.signum(g)!=k.signum(p)&&Math.abs(g)<=90&&(Math.abs(m)>180&&(m+=360*k.signum(m)),v=y),f=p+m-m%360,v!=y&&(f+=360*k.signum(m)),n[a]=f}n[a+1]=p,d+=f*i,c.rotation=d-(16384-(16384.499999999996-d/360|0))*360}queueEvents(s,t){const e=s.animationStart,i=s.animationEnd,r=i-e,n=s.trackLast%r,a=this.events;let o=0;const h=a.length;for(;o<h;o++){const c=a[o];if(c.time<n)break;c.time>i||this.queue.event(s,c)}let l=!1;for(s.loop?l=r==0||n>s.trackTime%r:l=t>=i&&s.animationLast<i,l&&this.queue.complete(s);o<h;o++)a[o].time<e||this.queue.event(s,a[o])}clearTracks(){const s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=s,this.queue.drain()}clearTrack(s){if(s>=this.tracks.length)return;const t=this.tracks[s];if(t==null)return;this.queue.end(t),this.disposeNext(t);let e=t;for(;;){const i=e.mixingFrom;if(i==null)break;this.queue.end(i),e.mixingFrom=null,e.mixingTo=null,e=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(s,t,e){const i=this.expandToIndex(s);this.tracks[s]=t,i!=null&&(e&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom!=null&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(s,t,e){const i=this.data.skeletonData.findAnimation(t);if(i==null)throw new Error(`Animation not found: ${t}`);return this.setAnimationWith(s,i,e)}setAnimationWith(s,t,e){if(t==null)throw new Error("animation cannot be null.");let i=!0,r=this.expandToIndex(s);r!=null&&(r.nextTrackLast==-1?(this.tracks[s]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,i=!1):this.disposeNext(r));const n=this.trackEntry(s,t,e,r);return this.setCurrent(s,n,i),this.queue.drain(),n}addAnimation(s,t,e,i){const r=this.data.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);return this.addAnimationWith(s,r,e,i)}addAnimationWith(s,t,e,i){if(t==null)throw new Error("animation cannot be null.");let r=this.expandToIndex(s);if(r!=null)for(;r.next!=null;)r=r.next;const n=this.trackEntry(s,t,e,r);if(r==null)this.setCurrent(s,n,!0),this.queue.drain();else if(r.next=n,i<=0){const a=r.animationEnd-r.animationStart;a!=0?(r.loop?i+=a*(1+(r.trackTime/a|0)):i+=Math.max(a,r.trackTime),i-=this.data.getMix(r.animation,t)):i=r.trackTime}return n.delay=i,n}setEmptyAnimation(s,t){const e=this.setAnimationWith(s,Mt.emptyAnimation,!1);return e.mixDuration=t,e.trackEnd=t,e}addEmptyAnimation(s,t,e){e<=0&&(e-=t);const i=this.addAnimationWith(s,Mt.emptyAnimation,!1,e);return i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(s){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){const r=this.tracks[e];r!=null&&this.setEmptyAnimation(r.trackIndex,s)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(s){return s<this.tracks.length?this.tracks[s]:(Q.ensureArrayCapacity(this.tracks,s+1,null),this.tracks.length=s+1,null)}trackEntry(s,t,e,i){const r=this.trackEntryPool.obtain();return r.trackIndex=s,r.animation=t,r.loop=e,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=t.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=i==null?0:this.data.getMix(i.animation,t),r.mixBlend=j.replace,r}disposeNext(s){let t=s.next;for(;t!=null;)this.queue.dispose(t),t=t.next;s.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let s=0,t=this.tracks.length;s<t;s++){let e=this.tracks[s];if(e!=null){for(;e.mixingFrom!=null;)e=e.mixingFrom;do(e.mixingFrom==null||e.mixBlend!=j.add)&&this.computeHold(e),e=e.mixingTo;while(e!=null)}}}computeHold(s){const t=s.mixingTo,e=s.animation.timelines,i=s.animation.timelines.length,r=Q.setArraySize(s.timelineMode,i);s.timelineHoldMix.length=0;const n=Q.setArraySize(s.timelineHoldMix,i),a=this.propertyIDs;if(t!=null&&t.holdPrevious){for(let o=0;o<i;o++)r[o]=a.add(e[o].getPropertyId())?Mt.HOLD_FIRST:Mt.HOLD_SUBSEQUENT;return}t:for(let o=0;o<i;o++){const h=e[o],l=h.getPropertyId();if(!a.add(l))r[o]=Mt.SUBSEQUENT;else if(t==null||h instanceof uo||h instanceof Bc||h instanceof Yw||!t.animation.hasTimeline(l))r[o]=Mt.FIRST;else{for(let c=t.mixingTo;c!=null;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(s.mixDuration>0){r[o]=Mt.HOLD_MIX,n[o]=c;continue t}break}r[o]=Mt.HOLD_FIRST}}}getCurrent(s){return s>=this.tracks.length?null:this.tracks[s]}addListener(s){if(s==null)throw new Error("listener cannot be null.");this.listeners.push(s)}removeListener(s){const t=this.listeners.indexOf(s);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(s,t,e){Mt.deprecatedWarning1||(Mt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(s,t,e)}addAnimationByName(s,t,e,i){Mt.deprecatedWarning2||(Mt.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(s,t,e,i)}hasAnimation(s){return this.data.skeletonData.findAnimation(s)!==null}hasAnimationByName(s){return Mt.deprecatedWarning3||(Mt.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(s)}};let ke=Mt;ke.emptyAnimation=new pe("<empty>",[],0),ke.SUBSEQUENT=0,ke.FIRST=1,ke.HOLD_SUBSEQUENT=2,ke.HOLD_FIRST=3,ke.HOLD_MIX=4,ke.SETUP=1,ke.CURRENT=2,ke.deprecatedWarning1=!1,ke.deprecatedWarning2=!1,ke.deprecatedWarning3=!1;const ki=class{constructor(){this.mixBlend=j.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=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){const s=this.animationEnd-this.animationStart;return s==0?this.animationStart:this.trackTime%s+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(s){this.animationLast=s,this.nextAnimationLast=s}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return ki.deprecatedWarning1||(ki.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(s){ki.deprecatedWarning1||(ki.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=s}get endTime(){return ki.deprecatedWarning2||(ki.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(s){ki.deprecatedWarning2||(ki.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=s}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let Oc=ki;Oc.deprecatedWarning1=!1,Oc.deprecatedWarning2=!1;const Fc=class{constructor(s){this.objects=[],this.drainDisabled=!1,this.animState=s}start(s){this.objects.push(Ee.start),this.objects.push(s),this.animState.animationsChanged=!0}interrupt(s){this.objects.push(Ee.interrupt),this.objects.push(s)}end(s){this.objects.push(Ee.end),this.objects.push(s),this.animState.animationsChanged=!0}dispose(s){this.objects.push(Ee.dispose),this.objects.push(s)}complete(s){this.objects.push(Ee.complete),this.objects.push(s)}event(s,t){this.objects.push(Ee.event),this.objects.push(s),this.objects.push(t)}deprecateStuff(){return Fc.deprecatedWarning1||(Fc.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const s=this.objects,t=this.animState.listeners;for(let e=0;e<s.length;e+=2){const i=s[e],r=s[e+1];switch(i){case Ee.start:r.listener!=null&&r.listener.start&&r.listener.start(r);for(let o=0;o<t.length;o++)t[o].start&&t[o].start(r);r.onStart&&this.deprecateStuff()&&r.onStart(r.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(r.trackIndex);break;case Ee.interrupt:r.listener!=null&&r.listener.interrupt&&r.listener.interrupt(r);for(let o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(r);break;case Ee.end:r.listener!=null&&r.listener.end&&r.listener.end(r);for(let o=0;o<t.length;o++)t[o].end&&t[o].end(r);r.onEnd&&this.deprecateStuff()&&r.onEnd(r.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(r.trackIndex);case Ee.dispose:r.listener!=null&&r.listener.dispose&&r.listener.dispose(r);for(let o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(r);this.animState.trackEntryPool.free(r);break;case Ee.complete:r.listener!=null&&r.listener.complete&&r.listener.complete(r);for(let o=0;o<t.length;o++)t[o].complete&&t[o].complete(r);const n=k.toInt(r.loopsCount());r.onComplete&&this.deprecateStuff()&&r.onComplete(r.trackIndex,n),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(r.trackIndex,n);break;case Ee.event:const a=s[e+++2];r.listener!=null&&r.listener.event&&r.listener.event(r,a);for(let o=0;o<t.length;o++)t[o].event&&t[o].event(r,a);r.onEvent&&this.deprecateStuff()&&r.onEvent(r.trackIndex,a),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(r.trackIndex,a);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let Zm=Fc;Zm.deprecatedWarning1=!1;var Ee=(s=>(s[s.start=0]="start",s[s.interrupt=1]="interrupt",s[s.end=2]="end",s[s.dispose=3]="dispose",s[s.complete=4]="complete",s[s.event=5]="event",s))(Ee||{});const Lc=class{constructor(s){if(this.animationToMixTime={},this.defaultMix=0,s==null)throw new Error("skeletonData cannot be null.");this.skeletonData=s}setMix(s,t,e){const i=this.skeletonData.findAnimation(s);if(i==null)throw new Error(`Animation not found: ${s}`);const r=this.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);this.setMixWith(i,r,e)}setMixByName(s,t,e){Lc.deprecatedWarning1||(Lc.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(s,t,e)}setMixWith(s,t,e){if(s==null)throw new Error("from cannot be null.");if(t==null)throw new Error("to cannot be null.");const i=`${s.name}.${t.name}`;this.animationToMixTime[i]=e}getMix(s,t){const e=`${s.name}.${t.name}`,i=this.animationToMixTime[e];return i===void 0?this.defaultMix:i}};let Qm=Lc;Qm.deprecatedWarning1=!1;class Jm{constructor(t,e,i){if(this.matrix=new gt,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,r,n,a,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=r,this.ascaleY=n,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;const h=this.parent,l=this.matrix,c=this.skeleton.scaleX,d=-this.skeleton.scaleY;if(h==null){const g=this.skeleton,y=i+90+o;l.a=k.cosDeg(i+a)*r*c,l.c=k.cosDeg(y)*n*c,l.b=k.sinDeg(i+a)*r*d,l.d=k.sinDeg(y)*n*d,l.tx=t*c+g.x,l.ty=e*d+g.y;return}let u=h.matrix.a,f=h.matrix.c,p=h.matrix.b,m=h.matrix.d;switch(l.tx=u*t+f*e+h.matrix.tx,l.ty=p*t+m*e+h.matrix.ty,this.data.transformMode){case se.Normal:{const g=i+90+o,y=k.cosDeg(i+a)*r,v=k.cosDeg(g)*n,_=k.sinDeg(i+a)*r,x=k.sinDeg(g)*n;l.a=u*y+f*_,l.c=u*v+f*x,l.b=p*y+m*_,l.d=p*v+m*x;return}case se.OnlyTranslation:{const g=i+90+o;l.a=k.cosDeg(i+a)*r,l.c=k.cosDeg(g)*n,l.b=k.sinDeg(i+a)*r,l.d=k.sinDeg(g)*n;break}case se.NoRotationOrReflection:{let g=u*u+p*p,y=0;g>1e-4?(g=Math.abs(u*m-f*p)/g,u/=this.skeleton.scaleX,p/=this.skeleton.scaleY,f=p*g,m=u*g,y=Math.atan2(p,u)*k.radDeg):(u=0,p=0,y=90-Math.atan2(m,f)*k.radDeg);const v=i+a-y,_=i+o-y+90,x=k.cosDeg(v)*r,b=k.cosDeg(_)*n,w=k.sinDeg(v)*r,T=k.sinDeg(_)*n;l.a=u*x-f*w,l.c=u*b-f*T,l.b=p*x+m*w,l.d=p*b+m*T;break}case se.NoScale:case se.NoScaleOrReflection:{const g=k.cosDeg(i),y=k.sinDeg(i);let v=(u*g+f*y)/c,_=(p*g+m*y)/d,x=Math.sqrt(v*v+_*_);x>1e-5&&(x=1/x),v*=x,_*=x,x=Math.sqrt(v*v+_*_),this.data.transformMode==se.NoScale&&u*m-f*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY>0)&&(x=-x);const b=Math.PI/2+Math.atan2(_,v),w=Math.cos(b)*x,T=Math.sin(b)*x,E=k.cosDeg(a)*r,A=k.cosDeg(90+o)*n,P=k.sinDeg(a)*r,L=k.sinDeg(90+o)*n;l.a=v*E+w*P,l.c=v*A+w*L,l.b=_*E+T*P,l.d=_*A+T*L;break}}l.a*=c,l.c*=c,l.b*=d,l.d*=d}setToSetupPose(){const 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}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*k.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*k.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(t==null){this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*k.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*k.radDeg;return}const i=t.matrix,r=1/(i.a*i.d-i.b*i.c),n=e.tx-i.tx,a=e.ty-i.ty;this.ax=n*i.d*r-a*i.c*r,this.ay=a*i.a*r-n*i.b*r;const o=r*i.d,h=r*i.a,l=r*i.c,c=r*i.b,d=o*e.a-l*e.b,u=o*e.c-l*e.d,f=h*e.b-c*e.a,p=h*e.d-c*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){const m=d*p-u*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(d*u+f*p,m)*k.radDeg,this.arotation=Math.atan2(f,d)*k.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,u)*k.radDeg}worldToLocal(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=1/(i*a-r*n),h=t.x-e.tx,l=t.y-e.ty;return t.x=h*a*o-l*r*o,t.y=l*i*o-h*n*o,t}localToWorld(t){const e=this.matrix,i=t.x,r=t.y;return t.x=i*e.a+r*e.c+e.tx,t.y=i*e.b+r*e.d+e.ty,t}worldToLocalRotation(t){const e=k.sinDeg(t),i=k.cosDeg(t),r=this.matrix;return Math.atan2(r.a*e-r.b*i,r.d*i-r.c*e)*k.radDeg}localToWorldRotation(t){const e=k.sinDeg(t),i=k.cosDeg(t),r=this.matrix;return Math.atan2(i*r.b+e*r.d,i*r.a+e*r.c)*k.radDeg}rotateWorld(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=k.cosDeg(t),h=k.sinDeg(t);e.a=o*i-h*n,e.c=o*r-h*a,e.b=h*i+o*n,e.d=h*r+o*a,this.appliedValid=!1}}class jw{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix);break}}apply1(t,e,i,r,n,a,o){t.appliedValid||t.updateAppliedTransform();const h=t.parent.matrix,l=h.a;let c=h.c;const d=h.b;let u=h.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case se.OnlyTranslation:p=e-t.worldX,m=i-t.worldY;break;case se.NoRotationOrReflection:const v=Math.abs(l*u-c*d)/(l*l+d*d),_=l/t.skeleton.scaleX,x=d/t.skeleton.scaleY;c=-x*v*t.skeleton.scaleX,u=_*v*t.skeleton.scaleY,f+=Math.atan2(x,_)*k.radDeg;default:const b=e-h.tx,w=i-h.ty,T=l*u-c*d;p=(b*u-w*c)/T-t.ax,m=(w*l-b*d)/T-t.ay}f+=Math.atan2(m,p)*k.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.data.transformMode){case se.NoScale:case se.NoScaleOrReflection:p=e-t.worldX,m=i-t.worldY}const v=t.data.length*g,_=Math.sqrt(p*p+m*m);if(r&&_<v||n&&_>v&&v>1e-4){const x=(_/v-1)*o+1;g*=x,a&&(y*=x)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,g,y,t.ashearX,t.ashearY)}apply2(t,e,i,r,n,a,o,h){if(h==0){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const l=t.ax,c=t.ay;let d=t.ascaleX,u=d,f=t.ascaleY,p=e.ascaleX;const m=t.matrix;let g=0,y=0,v=0;d<0?(d=-d,g=180,v=-1):(g=0,v=1),f<0&&(f=-f,v=-v),p<0?(p=-p,y=180):y=0;const _=e.ax;let x=0,b=0,w=0,T=m.a,E=m.c,A=m.b,P=m.d;const L=Math.abs(d-f)<=1e-4;L?(x=e.ay,b=T*_+E*x+m.tx,w=A*_+P*x+m.ty):(x=0,b=T*_+m.tx,w=A*_+m.ty);const M=t.parent.matrix;T=M.a,E=M.c,A=M.b,P=M.d;const S=1/(T*P-E*A);let C=b-M.tx,R=w-M.ty;const N=(C*P-R*E)*S-l,F=(R*T-C*A)*S-c,B=Math.sqrt(N*N+F*F);let W=e.data.length*p,I,D;if(B<1e-4){this.apply1(t,i,r,!1,a,!1,h),e.updateWorldTransformWith(_,x,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-M.tx,R=r-M.ty;let z=(C*P-R*E)*S-l,$=(R*T-C*A)*S-c,U=z*z+$*$;if(o!=0){o*=d*(p+1)/2;const lt=Math.sqrt(U),xt=lt-B-W*d+o;if(xt>0){let Dt=Math.min(1,xt/(o*2))-1;Dt=(xt-o*(1-Dt*Dt))/lt,z-=Dt*z,$-=Dt*$,U=z*z+$*$}}t:if(L){W*=d;let lt=(U-B*B-W*W)/(2*B*W);lt<-1?lt=-1:lt>1&&(lt=1,a&&(u*=(Math.sqrt(U)/(B+W)-1)*h+1)),D=Math.acos(lt)*n,T=B+W*lt,E=W*Math.sin(D),I=Math.atan2($*T-z*E,z*T+$*E)}else{T=d*W,E=f*W;const lt=T*T,xt=E*E,Dt=Math.atan2($,z);A=xt*B*B+lt*U-lt*xt;const Lt=-2*xt*B,mt=xt-lt;if(P=Lt*Lt-4*mt*A,P>=0){let Ir=Math.sqrt(P);Lt<0&&(Ir=-Ir),Ir=-(Lt+Ir)/2;const lg=Ir/mt,cg=A/Ir,Mr=Math.abs(lg)<Math.abs(cg)?lg:cg;if(Mr*Mr<=U){R=Math.sqrt(U-Mr*Mr)*n,I=Dt-Math.atan2(R,Mr),D=Math.atan2(R/f,(Mr-B)/d);break t}}let Bt=k.PI,Tt=B-T,me=Tt*Tt,Ae=0,ls=0,Rr=B+T,cs=Rr*Rr,hg=0;A=-T*B/(lt-xt),A>=-1&&A<=1&&(A=Math.acos(A),C=T*Math.cos(A)+B,R=E*Math.sin(A),P=C*C+R*R,P<me&&(Bt=A,me=P,Tt=C,Ae=R),P>cs&&(ls=A,cs=P,Rr=C,hg=R)),U<=(me+cs)/2?(I=Dt-Math.atan2(Ae*n,Tt),D=Bt*n):(I=Dt-Math.atan2(hg*n,Rr),D=ls*n)}const rt=Math.atan2(x,_)*v;let dt=t.arotation;I=(I-rt)*k.radDeg+g-dt,I>180?I-=360:I<-180&&(I+=360),t.updateWorldTransformWith(l,c,dt+I*h,u,t.ascaleY,0,0),dt=e.arotation,D=((D+rt)*k.radDeg-e.ashearX)*v+y-dt,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(_,x,dt+D*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}var Pr=(s=>(s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s))(Pr||{});const Hs=class{constructor(s,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,s==null)throw new Error("data cannot be null.");if(t==null)throw new Error("skeleton cannot be null.");this.data=s,this.bones=new Array;for(let e=0,i=s.bones.length;e<i;e++)this.bones.push(t.findBone(s.bones[e].name));this.target=t.findSlot(s.target.name),this.position=s.position,this.spacing=s.spacing,this.rotateMix=s.rotateMix,this.translateMix=s.translateMix}isActive(){return this.active}apply(){this.update()}update(){const s=this.target.getAttachment();if(!(s instanceof En))return;const t=this.rotateMix,e=this.translateMix,i=e>0,r=t>0;if(!i&&!r)return;const n=this.data,a=n.spacingMode,o=a==Pr.Length,h=n.rotateMode,l=h==Us.Tangent,c=h==Us.ChainScale,d=this.bones.length,u=l?d:d+1,f=this.bones,p=Q.setArraySize(this.spaces,u);let m=null;const g=this.spacing;if(c||o){c&&(m=Q.setArraySize(this.lengths,d));for(let w=0,T=u-1;w<T;){const E=f[w],A=E.data.length;if(A<Hs.epsilon)c&&(m[w]=0),p[++w]=0;else{const P=A*E.matrix.a,L=A*E.matrix.b,M=Math.sqrt(P*P+L*L);c&&(m[w]=M),p[++w]=(o?A+g:g)*M/A}}}else for(let w=1;w<u;w++)p[w]=g;const y=this.computeWorldPositions(s,u,l,n.positionMode==lo.Percent,a==Pr.Percent);let v=y[0],_=y[1],x=n.offsetRotation,b=!1;if(x==0)b=h==Us.Chain;else{b=!1;const w=this.target.bone.matrix;x*=w.a*w.d-w.b*w.c>0?k.degRad:-k.degRad}for(let w=0,T=3;w<d;w++,T+=3){const E=f[w],A=E.matrix;A.tx+=(v-A.tx)*e,A.ty+=(_-A.ty)*e;const P=y[T],L=y[T+1],M=P-v,S=L-_;if(c){const C=m[w];if(C!=0){const R=(Math.sqrt(M*M+S*S)/C-1)*t+1;A.a*=R,A.b*=R}}if(v=P,_=L,r){const C=A.a,R=A.c,N=A.b,F=A.d;let B=0,W=0,I=0;if(l&&(l?B=y[T-1]:p[w+1]==0?B=y[T+2]:B=Math.atan2(S,M)),B-=Math.atan2(N,C),b){W=Math.cos(B),I=Math.sin(B);const D=E.data.length;v+=(D*(W*C-I*N)-M)*t,_+=(D*(I*C+W*N)-S)*t}else B+=x;B>k.PI?B-=k.PI2:B<-k.PI&&(B+=k.PI2),B*=t,W=Math.cos(B),I=Math.sin(B),A.a=W*C-I*N,A.c=W*R-I*F,A.b=I*C+W*N,A.d=I*R+W*F}E.appliedValid=!1}}computeWorldPositions(s,t,e,i,r){const n=this.target;let a=this.position;const o=this.spaces,h=Q.setArraySize(this.positions,t*3+2);let l=null;const c=s.closed;let d=s.worldVerticesLength,u=d/6,f=Hs.NONE;if(!s.constantSpeed){const B=s.lengths;u-=c?1:2;const W=B[u];if(i&&(a*=W),r)for(let I=0;I<t;I++)o[I]*=W;l=Q.setArraySize(this.world,8);for(let I=0,D=0,z=0;I<t;I++,D+=3){const $=o[I];a+=$;let U=a;if(c)U%=W,U<0&&(U+=W),z=0;else if(U<0){f!=Hs.BEFORE&&(f=Hs.BEFORE,s.computeWorldVertices(n,2,4,l,0,2)),this.addBeforePosition(U,l,0,h,D);continue}else if(U>W){f!=Hs.AFTER&&(f=Hs.AFTER,s.computeWorldVertices(n,d-6,4,l,0,2)),this.addAfterPosition(U-W,l,0,h,D);continue}for(;;z++){const rt=B[z];if(!(U>rt)){if(z==0)U/=rt;else{const dt=B[z-1];U=(U-dt)/(rt-dt)}break}}z!=f&&(f=z,c&&z==u?(s.computeWorldVertices(n,d-4,4,l,0,2),s.computeWorldVertices(n,0,4,l,4,2)):s.computeWorldVertices(n,z*6+2,8,l,0,2)),this.addCurvePosition(U,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],h,D,e||I>0&&$==0)}return h}c?(d+=2,l=Q.setArraySize(this.world,d),s.computeWorldVertices(n,2,d-4,l,0,2),s.computeWorldVertices(n,0,2,l,d-4,2),l[d-2]=l[0],l[d-1]=l[1]):(u--,d-=4,l=Q.setArraySize(this.world,d),s.computeWorldVertices(n,2,d,l,0,2));const p=Q.setArraySize(this.curves,u);let m=0,g=l[0],y=l[1],v=0,_=0,x=0,b=0,w=0,T=0,E=0,A=0,P=0,L=0,M=0,S=0,C=0,R=0;for(let B=0,W=2;B<u;B++,W+=6)v=l[W],_=l[W+1],x=l[W+2],b=l[W+3],w=l[W+4],T=l[W+5],E=(g-v*2+x)*.1875,A=(y-_*2+b)*.1875,P=((v-x)*3-g+w)*.09375,L=((_-b)*3-y+T)*.09375,M=E*2+P,S=A*2+L,C=(v-g)*.75+E+P*.16666667,R=(_-y)*.75+A+L*.16666667,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,M+=P,S+=L,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,m+=Math.sqrt(C*C+R*R),C+=M+P,R+=S+L,m+=Math.sqrt(C*C+R*R),p[B]=m,g=w,y=T;if(i&&(a*=m),r)for(let B=0;B<t;B++)o[B]*=m;const N=this.segments;let F=0;for(let B=0,W=0,I=0,D=0;B<t;B++,W+=3){const z=o[B];a+=z;let $=a;if(c)$%=m,$<0&&($+=m),I=0;else if($<0){this.addBeforePosition($,l,0,h,W);continue}else if($>m){this.addAfterPosition($-m,l,d-4,h,W);continue}for(;;I++){const U=p[I];if(!($>U)){if(I==0)$/=U;else{const rt=p[I-1];$=($-rt)/(U-rt)}break}}if(I!=f){f=I;let U=I*6;for(g=l[U],y=l[U+1],v=l[U+2],_=l[U+3],x=l[U+4],b=l[U+5],w=l[U+6],T=l[U+7],E=(g-v*2+x)*.03,A=(y-_*2+b)*.03,P=((v-x)*3-g+w)*.006,L=((_-b)*3-y+T)*.006,M=E*2+P,S=A*2+L,C=(v-g)*.3+E+P*.16666667,R=(_-y)*.3+A+L*.16666667,F=Math.sqrt(C*C+R*R),N[0]=F,U=1;U<8;U++)C+=M,R+=S,M+=P,S+=L,F+=Math.sqrt(C*C+R*R),N[U]=F;C+=M,R+=S,F+=Math.sqrt(C*C+R*R),N[8]=F,C+=M+P,R+=S+L,F+=Math.sqrt(C*C+R*R),N[9]=F,D=0}for($*=F;;D++){const U=N[D];if(!($>U)){if(D==0)$/=U;else{const rt=N[D-1];$=D+($-rt)/(U-rt)}break}}this.addCurvePosition($*.1,g,y,v,_,x,b,w,T,h,W,e||B>0&&z==0)}return h}addBeforePosition(s,t,e,i,r){const n=t[e],a=t[e+1],o=t[e+2]-n,h=t[e+3]-a,l=Math.atan2(h,o);i[r]=n+s*Math.cos(l),i[r+1]=a+s*Math.sin(l),i[r+2]=l}addAfterPosition(s,t,e,i,r){const n=t[e+2],a=t[e+3],o=n-t[e],h=a-t[e+1],l=Math.atan2(h,o);i[r]=n+s*Math.cos(l),i[r+1]=a+s*Math.sin(l),i[r+2]=l}addCurvePosition(s,t,e,i,r,n,a,o,h,l,c,d){(s==0||isNaN(s))&&(s=1e-4);const u=s*s,f=u*s,p=1-s,m=p*p,g=m*p,y=p*s,v=y*3,_=p*v,x=v*s,b=t*g+i*_+n*x+o*f,w=e*g+r*_+a*x+h*f;l[c]=b,l[c+1]=w,d&&(l[c+2]=Math.atan2(w-(e*m+r*y*2+a*u),b-(t*m+i*y*2+n*u)))}};let An=Hs;An.NONE=-1,An.BEFORE=-2,An.AFTER=-3,An.epsilon=1e-5;class qw{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new Ww,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?k.degRad:-k.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,g=p.length;m<g;m++){const y=p[m];let v=!1;const _=y.matrix;if(t!=0){const x=_.a,b=_.c,w=_.b,T=_.d;let E=Math.atan2(l,o)-Math.atan2(w,x)+u;E>k.PI?E-=k.PI2:E<-k.PI&&(E+=k.PI2),E*=t;const A=Math.cos(E),P=Math.sin(E);_.a=A*x-P*w,_.c=A*b-P*T,_.b=P*x+A*w,_.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),_.tx+=(x.x-_.tx)*e,_.ty+=(x.y-_.ty)*e,v=!0}if(i>0){let x=Math.sqrt(_.a*_.a+_.b*_.b),b=Math.sqrt(o*o+l*l);x>1e-5&&(x=(x+(b-x+this.data.offsetScaleX)*i)/x),_.a*=x,_.b*=x,x=Math.sqrt(_.c*_.c+_.d*_.d),b=Math.sqrt(h*h+c*c),x>1e-5&&(x=(x+(b-x+this.data.offsetScaleY)*i)/x),_.c*=x,_.d*=x,v=!0}if(r>0){const x=_.c,b=_.d,w=Math.atan2(b,x);let T=Math.atan2(c,h)-Math.atan2(l,o)-(w-Math.atan2(_.b,_.a));T>k.PI?T-=k.PI2:T<-k.PI&&(T+=k.PI2),T=w+(T+f)*r;const E=Math.sqrt(x*x+b*b);_.c=Math.cos(T)*E,_.d=Math.sin(T)*E,v=!0}v&&(y.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?k.degRad:-k.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,g=p.length;m<g;m++){const y=p[m];let v=!1;const _=y.matrix;if(t!=0){const x=_.a,b=_.c,w=_.b,T=_.d;let E=Math.atan2(l,o)+u;E>k.PI?E-=k.PI2:E<-k.PI&&(E+=k.PI2),E*=t;const A=Math.cos(E),P=Math.sin(E);_.a=A*x-P*w,_.c=A*b-P*T,_.b=P*x+A*w,_.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),_.tx+=x.x*e,_.ty+=x.y*e,v=!0}if(i>0){let x=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleX)*i+1;_.a*=x,_.b*=x,x=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleY)*i+1,_.c*=x,_.d*=x,v=!0}if(r>0){let x=Math.atan2(c,h)-Math.atan2(l,o);x>k.PI?x-=k.PI2:x<-k.PI&&(x+=k.PI2);const b=_.c,w=_.d;x=Math.atan2(w,b)+(x-k.PI/2+f)*r;const T=Math.sqrt(b*b+w*w);_.c=Math.cos(x)*T,_.d=Math.sin(x)*T,v=!0}v&&(y.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;if(t!=0){let g=n.arotation-c+this.data.offsetRotation;g-=(16384-(16384.499999999996-g/360|0))*360,c+=g*t}let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax-d+this.data.offsetX)*e,u+=(n.ay-u+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f=(f+(n.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(n.ascaleY-p+this.data.offsetScaleY)*i)/p));const m=l.ashearY;if(r>0){let g=n.ashearY-m+this.data.offsetShearY;g-=(16384-(16384.499999999996-g/360|0))*360,l.shearY+=g*r}l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;t!=0&&(c+=(n.arotation+this.data.offsetRotation)*t);let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax+this.data.offsetX)*e,u+=(n.ay+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*i+1),p>1e-5&&(p*=(n.ascaleY-1+this.data.offsetScaleY)*i+1));let m=l.ashearY;r>0&&(m+=(n.ashearY+this.data.offsetShearY)*r),l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}}const Sn=class{constructor(s){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,s==null)throw new Error("data cannot be null.");this.data=s,this.bones=new Array;for(let t=0;t<s.bones.length;t++){const e=s.bones[t];let i;if(e.parent==null)i=new Jm(e,this,null);else{const r=this.bones[e.parent.index];i=new Jm(e,this,r),r.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<s.slots.length;t++){const e=s.slots[t],i=this.bones[e.boneData.index],r=new Km(e,i);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let t=0;t<s.ikConstraints.length;t++){const e=s.ikConstraints[t];this.ikConstraints.push(new jw(e,this))}this.transformConstraints=new Array;for(let t=0;t<s.transformConstraints.length;t++){const e=s.transformConstraints[t];this.transformConstraints.push(new qw(e,this))}this.pathConstraints=new Array;for(let t=0;t<s.pathConstraints.length;t++){const e=s.pathConstraints[t];this.pathConstraints.push(new An(e,this))}this.color=new we(1,1,1,1),this.updateCache()}updateCache(){const s=this._updateCache;s.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let l=0,c=t.length;l<c;l++){const d=t[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin!=null){const l=this.skin.bones;for(let c=0,d=this.skin.bones.length;c<d;c++){let u=this.bones[l[c].index];do u.sorted=!1,u.active=!0,u=u.parent;while(u!=null)}}const e=this.ikConstraints,i=this.transformConstraints,r=this.pathConstraints,n=e.length,a=i.length,o=r.length,h=n+a+o;t:for(let l=0;l<h;l++){for(let c=0;c<n;c++){const d=e[c];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let c=0;c<a;c++){const d=i[c];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let c=0;c<o;c++){const d=r[c];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,c=t.length;l<c;l++)this.sortBone(t[l])}sortIkConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target;this.sortBone(t);const e=s.bones,i=e[0];if(this.sortBone(i),e.length>1){const r=e[e.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(s),this.sortReset(i.children),e[e.length-1].sorted=!0}sortPathConstraint(s){if(s.active=s.target.bone.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target,e=t.data.index,i=t.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,e,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,i);for(let o=0,h=this.data.skins.length;o<h;o++)this.sortPathConstraintAttachment(this.data.skins[o],e,i);const r=t.getAttachment();r instanceof En&&this.sortPathConstraintAttachmentWith(r,i);const n=s.bones,a=n.length;for(let o=0;o<a;o++)this.sortBone(n[o]);this._updateCache.push(s);for(let o=0;o<a;o++)this.sortReset(n[o].children);for(let o=0;o<a;o++)n[o].sorted=!0}sortTransformConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;this.sortBone(s.target);const t=s.bones,e=t.length;if(s.data.local)for(let i=0;i<e;i++){const r=t[i];this.sortBone(r.parent),this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}else for(let i=0;i<e;i++)this.sortBone(t[i]);this._updateCache.push(s);for(let i=0;i<e;i++)this.sortReset(t[i].children);for(let i=0;i<e;i++)t[i].sorted=!0}sortPathConstraintAttachment(s,t,e){const i=s.attachments[t];if(i)for(const r in i)this.sortPathConstraintAttachmentWith(i[r],e)}sortPathConstraintAttachmentWith(s,t){if(!(s instanceof En))return;const e=s.bones;if(e==null)this.sortBone(t);else{const i=this.bones;let r=0;for(;r<e.length;){const n=e[r++];for(let a=r+n;r<a;r++){const o=e[r];this.sortBone(i[o])}}}}sortBone(s){if(s.sorted)return;const t=s.parent;t!=null&&this.sortBone(t),s.sorted=!0,this._updateCache.push(s)}sortReset(s){for(let t=0,e=s.length;t<e;t++){const i=s[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){const s=this.updateCacheReset;for(let e=0,i=s.length;e<i;e++){const r=s[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}const t=this._updateCache;for(let e=0,i=t.length;e<i;e++)t[e].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const s=this.bones;for(let r=0,n=s.length;r<n;r++)s[r].setToSetupPose();const t=this.ikConstraints;for(let r=0,n=t.length;r<n;r++){const a=t[r];a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}const e=this.transformConstraints;for(let r=0,n=e.length;r<n;r++){const a=e[r],o=a.data;a.rotateMix=o.rotateMix,a.translateMix=o.translateMix,a.scaleMix=o.scaleMix,a.shearMix=o.shearMix}const i=this.pathConstraints;for(let r=0,n=i.length;r<n;r++){const a=i[r],o=a.data;a.position=o.position,a.spacing=o.spacing,a.rotateMix=o.rotateMix,a.translateMix=o.translateMix}}setSlotsToSetupPose(){const s=this.slots;Q.arrayCopy(s,0,this.drawOrder,0,s.length);for(let t=0,e=s.length;t<e;t++)s[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findBoneIndex(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}findSlot(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findSlotIndex(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}setSkinByName(s){const t=this.data.findSkin(s);if(t==null)throw new Error(`Skin not found: ${s}`);this.setSkin(t)}setSkin(s){if(s!=this.skin){if(s!=null)if(this.skin!=null)s.attachAll(this,this.skin);else{const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e],n=r.data.attachmentName;if(n!=null){const a=s.getAttachment(e,n);a!=null&&r.setAttachment(a)}}}this.skin=s,this.updateCache()}}getAttachmentByName(s,t){return this.getAttachment(this.data.findSlotIndex(s),t)}getAttachment(s,t){if(t==null)throw new Error("attachmentName cannot be null.");if(this.skin!=null){const e=this.skin.getAttachment(s,t);if(e!=null)return e}return this.data.defaultSkin!=null?this.data.defaultSkin.getAttachment(s,t):null}setAttachment(s,t){if(s==null)throw new Error("slotName cannot be null.");const e=this.slots;for(let i=0,r=e.length;i<r;i++){const n=e[i];if(n.data.name==s){let a=null;if(t!=null&&(a=this.getAttachment(i,t),a==null))throw new Error(`Attachment not found: ${t}, for slot: ${s}`);n.setAttachment(a);return}}throw new Error(`Slot not found: ${s}`)}findIkConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findTransformConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findPathConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}getBounds(s,t,e=new Array(2)){if(s==null)throw new Error("offset cannot be null.");if(t==null)throw new Error("size cannot be null.");const i=this.drawOrder;let r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let h=0,l=i.length;h<l;h++){const c=i[h];if(!c.bone.active)continue;let d=0,u=null;const f=c.getAttachment();if(f instanceof et)d=8,u=Q.setArraySize(e,d,0),f.computeWorldVertices(c.bone,u,0,2);else if(f instanceof co){const p=f;d=p.worldVerticesLength,u=Q.setArraySize(e,d,0),p.computeWorldVertices(c,0,d,u,0,2)}if(u!=null)for(let p=0,m=u.length;p<m;p+=2){const g=u[p],y=u[p+1];r=Math.min(r,g),n=Math.min(n,y),a=Math.max(a,g),o=Math.max(o,y)}}s.set(r,n),t.set(a-r,o-n)}update(s){this.time+=s}get flipX(){return this.scaleX==-1}set flipX(s){Sn.deprecatedWarning1||(Sn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=s?1:-1}get flipY(){return this.scaleY==-1}set flipY(s){Sn.deprecatedWarning1||(Sn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=s?1:-1}};let tg=Sn;tg.deprecatedWarning1=!1,se.Normal,se.OnlyTranslation,se.NoRotationOrReflection,se.NoScale,se.NoScaleOrReflection,lo.Fixed,lo.Percent,Pr.Length,Pr.Fixed,Pr.Percent,Us.Tangent,Us.Chain,Us.ChainScale,K.NORMAL,K.ADD,K.MULTIPLY,K.SCREEN;class Kw extends Mc{createSkeleton(t){this.skeleton=new tg(t),this.skeleton.updateWorldTransform(),this.stateData=new Qm(t),this.state=new ke(this.stateData)}}class Zw extends Kw{constructor(t,e){const{followPointList:i,visible:r=!1}=e||{};let n;typeof t=="string"?n=ji.get(t).spineData:n=t.spineData,super(n),this._followDots=[],this._isStart=!1,this.visible=r,this.autoUpdate=!1,i!=null&&i.length&&(i==null||i.forEach(a=>{a.follow.alpha=0,this._followDots.push({point:this.skeleton.findBone(a.boneName),follow:a.follow,onUpdate:a.onUpdate,angleFollow:a.angleFollow||!1,scaleFollow:a.scaleFollow||!0})})),this._loopFn=this._loop.bind(this),At.system.add(this._loopFn)}setAnimation(t="animation",e=!1){return new Promise(i=>{this.visible=!0,this.state.setAnimation(0,t,e).listener={complete:()=>{i()}}})}addAnimation(t="animation",e=!1,i=0){return new Promise(r=>{this.visible=!0,this.state.addAnimation(0,t,e,i).listener={complete:()=>{r()}}})}setSkin(t){this.skeleton.setSkinByName(t)}destroyAll(){At.system.remove(this._loopFn),this.destroy()}_loop(){this.update(At.system.deltaMS/1e3),this._updateFollowPoint()}_updateFollowPoint(){this._followDots.length!==0&&(this._followDots.forEach(t=>{const{worldX:e,worldY:i}=t.point,r=t.point.getWorldRotationX()*(Math.PI/180),n=t.point.getWorldScaleX(),a=t.point.getWorldScaleY();t.onUpdate?t.onUpdate({x:e,y:i,rotate:r,scaleX:n,scaleY:a}):(t.angleFollow&&(t.follow.rotation=r),t.scaleFollow&&t.follow.scale.set(n,a),t.follow.position.set(e+1920/2-t.follow.width/2,i+1080/2-t.follow.height/2))}),this._isStart||(this._isStart=!0,this._followDots.forEach(t=>{ct.to(t.follow,{alpha:1,duration:.25,delay:.15})})))}}const Vs=(s,t,e,i=!1)=>{s.cursor="pointer",s.eventMode="static";const r=n=>{n.button!==2&&e(n)};i?s.once(t,r):s.on(t,r)};class Qw extends vt{constructor(t){super();const{texture:e,hoverTexture:i,tintColor:r}=t;this._texture=e,this._hoverTexture=i,this._tintColor=r;const n=new vt;this.addChild(n),this._btn=new ge(e),n.addChild(this._btn),r&&(this._btn.tint=r),Vs(n,"pointerenter",()=>{this._btn._texture=this._hoverTexture,this._btn.tint="#fff"}),Vs(n,"pointerleave",()=>{this._btn._texture=this._texture,r&&(this._btn.tint=r)})}toggleTexture(t,e){this._texture=t,this._hoverTexture=e,this._btn._texture=e}setDisabled(t){this._btn.tint=t?"#7C7C7C":this._tintColor||"#fff"}}class Jw extends bn{constructor(t){const{sprite:e,onClick:i}=t;super(e.width,e.height),this.addChild(e),e.anchor.set(.5),e.x=e.width/2,e.y=e.height/2,Vs(this,"pointerenter",()=>{ct.to(e,{duration:.25,rotation:180*(Math.PI/180)})}),Vs(this,"pointerleave",()=>{e.alpha=1,ct.to(e,{duration:.25,rotation:0})}),Vs(this,"pointerdown",()=>{e.alpha=.5}),Vs(this,"pointerup",()=>{i()})}}class tE extends vt{constructor(t){super(),this._maskUI=new rc({bgColor:"#000",width:1080,height:1920}),this.addChild(this._maskUI),this._maskUI.alpha=0,this._maskUI.eventMode="static",this._drawerContainer=t,this.addChild(this._drawerContainer),this._drawerContainer.y=this._maskUI.height,ct.to(this._maskUI,{duration:.25,alpha:.5}),ct.to(this._drawerContainer,{duration:.25,ease:"power1.out",y:this._maskUI.height-this._drawerContainer.height})}async close(){ct.to(this._drawerContainer,{duration:.25,y:this._maskUI.height}),await ct.to(this._maskUI,{duration:.25,delay:.125,alpha:0})}}class eE extends vt{constructor(t){super(),this.COLLECT_TIME=5*1e3,this._nowTime=0,this._lastTime=0,this._drawCount=0,this._maxDrawCount=0,this._tempMaxDrawCount=0,this._lastCollectTime=0,this._paramTxts=[];for(let e=0;e<3;e++){const i=new Ic({text:"",fontWeight:"bold",fontSize:36,shadow:["#000",45,3,5],fontColor:"#fff"});this._paramTxts[e]=i,i.x=0,i.y=i.height*e,this.addChild(i),i.alpha=.75}this._renderer=t.renderer,this._drawElements=this._renderer.gl.drawElements,this.init()}init(){this._renderer.gl.drawElements=(...t)=>{this._drawElements.call(this._renderer.gl,...t),this._drawCount++},At.shared.add(()=>{const t=At.system.FPS;this._nowTime=performance.now(),this._nowTime-this._lastTime>=100&&(this._setTxtInfo(0,Math.floor(t).toFixed(0)),this._lastTime=this._nowTime),this._nowTime-this._lastCollectTime<this.COLLECT_TIME?this._tempMaxDrawCount<this._drawCount&&(this._tempMaxDrawCount=this._drawCount):(this._maxDrawCount=this._tempMaxDrawCount,this._tempMaxDrawCount=0,this._lastCollectTime=this._nowTime),this._setTxtInfo(1,this._drawCount),this._setTxtInfo(2,this._maxDrawCount),this._drawCount=0},zi.UTILITY)}_setTxtInfo(t,e){const i=a=>{this._paramTxts[t].style.fill="#fff",a<=30&&(this._paramTxts[t].style.fill="yellow"),a<=20&&(this._paramTxts[t].style.fill="red")},r=a=>{this._paramTxts[t].style.fill="#fff",a>=75&&(this._paramTxts[t].style.fill="yellow"),a>=100&&(this._paramTxts[t].style.fill="red")},n=[()=>(i(e),`Fps:${e}`),()=>(r(e),`Draw Call:${e}`),()=>(r(e),`Max Draw Call:${e}`)];this._paramTxts[t].text=n[t]()}}class iE extends vt{constructor(t){super();const{bgWidth:e,bgHeight:i,barWidth:r,barHeight:n,bgTexture:a,barTexture:o}=t,h=new ge(a);this.addChild(h),this._progressBar=new ge(o),this.addChild(this._progressBar),this._progressBar.x=(e-r)/2,this._progressBar.y=(i-n)/2;const l=new hi;l.beginFill(16777215),l.drawRect(0,0,0,this._progressBar.height),l.endFill(),this._progressBar.addChild(l),this._progressBar.mask=l,this._maskGraphics=l}setProgress(t){const e=Math.max(0,Math.min(1,t));this._maskGraphics.clear(),this._maskGraphics.beginFill(16777215),this._maskGraphics.drawRect(0,0,this._progressBar.width*e,this._progressBar.height),this._maskGraphics.endFill()}}class sE extends bn{constructor(t){const{width:e,height:i,scrollContent:r,bottomMargin:n=50}=t;if(super(e,i),this._startY=0,this._velocity=0,this._startTime=0,this._startPosition=0,this._scrollSpeed=200,this._isDragging=!1,this._scrollContent=r,this._content=new vt,this.addChild(this._content),this._content.addChild(this._scrollContent),n>0){const a=new ge;this._content.addChild(a),a.y=this._content.height+n}this._maskGraphics=new hi,this.addChild(this._maskGraphics),this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,e,i),this._maskGraphics.endFill(),this.mask=this._maskGraphics,this.eventMode="static",this.on("pointerdown",this._onDragStart,this),this.on("pointermove",this._onDragMove,this),this.on("pointerup",this._onDragEnd,this),this.on("pointerupoutside",this._onDragEnd,this),this.on("wheel",this._onWheelScroll,this)}setDimensions(t,e){this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,t,e),this._maskGraphics.endFill(),this.setSize(t,e)}scrollToTop(){this._content.y=0}addContent(t){this._scrollContent.addChild(t)}_onDragStart(t){if(this._content.height<=this._maskGraphics.height)return;const e=t.getLocalPosition(this);this._startY=e.y-this._content.y,this._isDragging=!0,this._velocity=0,this._startTime=Date.now(),this._startPosition=this._content.y,ct.killTweensOf(this._content)}_onDragMove(t){if(this._isDragging){const i=t.data.getLocalPosition(this).y-this._startY;this._content.y=i}}_onDragEnd(){this._isDragging=!1;const e=Date.now()-this._startTime;e<250?(this._velocity=(this._content.y-this._startPosition)/e,this._applyInertia()):this._velocity=0,this._limitScrollRange()}_onWheelScroll(t){if(this._content.height<=this._maskGraphics.height)return;let e=this._content.y-t.deltaY*(this._scrollSpeed/100);e>0?e=0:Math.abs(e)>=this._content.height-this._maskGraphics.height&&(e=-(this._content.height-this._maskGraphics.height)),ct.to(this._content,{duration:.25,ease:"power1.out",y:e})}_applyInertia(){ct.to(this._content,{y:this._content.y+this._velocity*250,duration:.5,ease:"power1.out",onUpdate:this._limitScrollRange.bind(this)})}_limitScrollRange(){if(this._content.y>0)ct.to(this._content,{duration:.75,y:0,ease:"elastic.out"});else if(Math.abs(this._content.y)>=this._content.height-this._maskGraphics.height)if(this._content.height>this._maskGraphics.height){const t=-(this._content.height-this._maskGraphics.height);ct.to(this._content,{duration:.75,y:t,ease:"elastic.out"})}else ct.to(this._content,{duration:.25,y:0})}}class rE extends bn{constructor(t){const{width:e,height:i,content:r,slideCallback:n,scrollCallback:a,pageNum:o,pageHeight:h}=t;super(e,i),this._currentIndex=0,this._scrollHeight=0,this._slideHeight=0,this._startY=0,this._offsetY=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1;const l=new hi;l.beginFill(16777215),l.drawRect(0,0,this.width,this.height),l.endFill(),this.addChild(l),this.mask=l,this._scrollHeight=i,this._slideHeight=h,this._slideArea=r,this._slideCallback=n,this._scrollCallback=a,this._pageNum=o-1,this.addChild(this._slideArea),this._slideArea.x=e/2,this._slideArea.y=this._scrollHeight/2,this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}updatePosition(t,e){this._slideArea.y=t,this._currentIndex=e}slideTo(t,e=!0){var i;t<0?(ct.to(this._slideArea,{y:this._scrollHeight/2,duration:.25,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=0):t>this._pageNum?(ct.to(this._slideArea,{y:-this._pageNum*this._slideHeight+this._scrollHeight/2,duration:.5,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=this._pageNum):(this._currentIndex=t,ct.to(this._slideArea,{y:-this._currentIndex*this._slideHeight+this._scrollHeight/2,duration:e?.25:.01,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}})),(i=this._slideCallback)==null||i.call(this,this._currentIndex)}_onDragStart(t){this._isDragging=!0,this._startY=t.data.global.y,this._offsetY=this._slideArea.y,ct.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){var i;if(!this._isDragging)return;const e=t.pageY-this._startY;this._slideArea.y=this._offsetY+e,(i=this._scrollCallback)==null||i.call(this,this._slideArea.y,this._currentIndex)}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startY-t.pageY,r=Math.abs(i)/e,n=.275,a=this._slideHeight/2,o=Math.round(i/this._slideHeight);(Math.abs(i)>a||r>n)&&(this._currentIndex+=o),this._currentIndex<0?this._currentIndex=0:this._currentIndex>this._pageNum&&(this._currentIndex=this._pageNum),this.slideTo(this._currentIndex)}}const eg=s=>{const t=new hi;return t.beginFill(16777215),t.drawRect(0,0,s.width,s.height),t.endFill(),s.addChild(t),s.mask=t,t};class nE extends bn{constructor(t,e,i,r){super(t,e),this._currentIndex=0,this._slideWidth=0,this._startX=0,this._offsetX=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1,eg(this),this._slideWidth=t,this._slideArea=i,this.slideCallback=r,this._pageNum=Math.floor(i.width/this._slideWidth)-1,this.addChild(i),this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}prev(){this._slideTo(this._currentIndex-1)}next(){this._slideTo(this._currentIndex+1)}_slideTo(t){t<0?(ct.to(this._slideArea,{x:0,duration:.25}),this._currentIndex=0):t>this._pageNum?(ct.to(this._slideArea,{x:-this._pageNum*this._slideWidth,duration:.5}),this._currentIndex=this._pageNum):(this._currentIndex=t,ct.to(this._slideArea,{x:-this._currentIndex*this._slideWidth,duration:.25})),this.slideCallback(this._currentIndex,this._pageNum)}_onDragStart(t){this._isDragging=!0,this._startX=t.global.x,this._offsetX=this._slideArea.x,ct.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){if(!this._isDragging)return;const e=t.pageX-this._startX;this._slideArea.x=this._offsetX+e}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startX-t.pageX,r=Math.abs(i)/e,n=this._slideWidth/2,a=.275;(Math.abs(i)>n||r>a)&&(i>0?this._currentIndex++:this._currentIndex--),this._slideTo(this._currentIndex)}}const Cn=(s,t)=>{let e;if(s==="brightness")e=new nr,e.brightness(t,!1);else if(s==="blur")e=new Of;else if(s==="desaturate")e=new nr,e.desaturate();else if(s==="contrast")e=new nr,e.contrast(t,!1);else throw new Error("未知滤镜名称");return e.resolution=window.devicePixelRatio||1,e};class aE{constructor(t,e){this._currentIndex=0,this._numsLength=0,this._isDown=!1,this._onChange=e,this._numsLength=t,window.addEventListener("pointerup",()=>{this._isDown&&this._up()})}down(t){this._isDown=!0,this._handleChange(t),this._timerId=setTimeout(()=>{this._isDown&&(this._intervalId=setInterval(()=>{this._handleChange(t)},100))},100)}updateIndex(t){this._currentIndex=t}_up(){this._isDown=!1,clearTimeout(this._timerId),clearInterval(this._intervalId)}_handleChange(t){t==="add"?this._currentIndex<this._numsLength-1&&(this._currentIndex++,this._onChange(this._currentIndex)):t==="sub"&&this._currentIndex>0&&(this._currentIndex--,this._onChange(this._currentIndex))}}class oE{constructor(t){this.betAmountListLength=0;const{minBtn:e,maxBtn:i,addBtn:r,subBtn:n,initialBetIndex:a,betAmountListLength:o,onAmountIndex:h}=t;this.minBtn=e,this.maxBtn=i,this.subBtn=n,this.addBtn=r,this.onAmountIndex=h,this.betAmountListLength=o,this.baseNumSteper=new aE(o,l=>{this.onAmountIndex(l),this.minMaxUpdateIndex(l)}),this.minMaxUpdateIndex(a),this.baseNumSteper.updateIndex(a)}min(){this.minMaxUpdateIndex(0),this.onAmountIndex(0)}max(){const t=this.betAmountListLength-1;this.minMaxUpdateIndex(t),this.onAmountIndex(t)}sub(){this.baseNumSteper.down("sub")}add(){this.baseNumSteper.down("add")}minMaxUpdateIndex(t){t===0?this._setGrey("min"):t===this.betAmountListLength-1?this._setGrey("max"):this._setGrey(),this.baseNumSteper.updateIndex(t)}_setGrey(t){this.minBtn.filters=[],this.maxBtn.filters=[],this.subBtn.filters=[],this.addBtn.filters=[],t==="min"?(this.minBtn.filters=[Cn("desaturate")],this.subBtn.filters=[Cn("desaturate")]):t==="max"&&(this.maxBtn.filters=[Cn("desaturate")],this.addBtn.filters=[Cn("desaturate")])}}const ig=(s,t,e)=>{const i=t/s.width*s.scale.x,r=e?e/s.height*s.scale.y:i,n=Math.min(i,r);s.scale.set(n>1?1:n)};class hE extends vt{constructor(t){super();const{data:e,cellWidth:i=130,cellHeight:r=100,fontColor:n="#B4B4B8",fontSize:a=24,lineWidth:o=3,lineColor:h="#B4B4B8"}=t;this._data=e,this._rows=e.length,this._cols=e[0].length,this._cellWidth=i,this._cellHeight=r,this._fontColor=n,this._fontSize=a,this._lineWidth=o,this._lineColor=h,this._drawTable(),this.fillNumbers()}_drawTable(){const t=this._cellWidth*this._cols,e=this._cellHeight*this._rows,i=new hi;i.lineStyle(this._lineWidth,this._lineColor),i.drawRect(0,0,t,e);for(let r=1;r<this._rows;r++)i.moveTo(0,r*this._cellHeight),i.lineTo(t,r*this._cellHeight);for(let r=1;r<this._cols;r++)i.moveTo(r*this._cellWidth,0),i.lineTo(r*this._cellWidth,e);this.addChild(i)}fillNumbers(){for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const i=this._data[t][e];this._createNumberText(i,e,t)}}_createNumberText(t,e,i){const r=new Ga(t.toString(),{_fontSize:this._fontSize,fill:this._fontColor}),n=e*this._cellWidth+this._cellWidth/2,a=i*this._cellHeight+this._cellHeight/2;this.addChild(r),r.anchor.set(.5),r.position.set(n,a),ig(r,this._cellWidth*.9)}}class lE{constructor(){this.effectEnabled=!0,this.musicEnabled=!0,this._isMusicPaused=!1,this._isBackground=!1,this._playingList=[],this._setPlayStatus=t=>{t?!this._isMusicPaused&&this._musicPlayer.play():this._musicPlayer.pause(),this._playingList.forEach(e=>{t?e.audio.play():e.audio.pause()})},this._musicPlayer=new Audio,document.addEventListener("visibilitychange",()=>{this._isBackground=document.hidden,this._setPlayStatus(!document.hidden)})}playEffect(t,e){return new Promise(i=>{const r=new Date().getTime(),n=ji.get(t).url,a=new Audio(n);if(e){const h=a.duration-e;a.currentTime=Math.max(h,0)}a.muted=this._isBackground||!this.effectEnabled,a.addEventListener("ended",()=>{this._playingList=this._playingList.filter(o=>o.id!==r),i()}),a.play().then(()=>{this._playingList.push({id:r,audio:a,url:n})}).catch(()=>{})})}async playMusic(t){this._musicPlayer&&(ct.killTweensOf(this._musicPlayer),await ct.to(this._musicPlayer,{volume:0,duration:1,ease:"linear"}),this._musicPlayer.pause());const e=ji.get(t).url;this._musicPlayer.src=e,this._musicPlayer.loop=!0,this._musicPlayer.volume=0;const i=()=>{this._musicPlayer.play().then(()=>{this._isMusicPaused=!1,ct.killTweensOf(this._musicPlayer),ct.to(this._musicPlayer,{volume:1,duration:1,ease:"linear"})}).catch(()=>{requestAnimationFrame(i.bind(this))})};i()}pauseMusic(){this._isMusicPaused=!0,this._musicPlayer.pause()}resumeMusic(){this._isMusicPaused=!1,this._musicPlayer.play()}stopEffect(t){const e=ji.get(t).url;this._playingList.forEach(i=>{i.url===e&&i.audio.pause()}),this._playingList=this._playingList.filter(i=>i.url!==e)}setEffectEnabled(t){this.effectEnabled=t,this._setEffectMute(!t)}setMusicEnabled(t){this.musicEnabled=t,this._setMusicMute(!t)}_setMusicMute(t){this._musicPlayer.muted=t||!this.musicEnabled}_setEffectMute(t){this._playingList.forEach(e=>{e.audio.muted=t||!this.effectEnabled})}}const cE=s=>{const{texture:t,dotWidth:e,width:i,height:r}=s;let n=[];Array.isArray(e)?n=e:n=[e,e,e,e];const a=new Bb(t,n[0],n[1],n[2],n[3]);return a.width=i,a.height=r,a},uE=(s,t,e)=>{let i=!1;return s.cursor="pointer",s.eventMode="static",s.on(t,r=>{i||r.button!==2&&e(r)}),()=>{i=!0}},dE=(s,t,e=0)=>parseFloat((Math.random()*(t-s)+s).toFixed(e)),fE=(s,t)=>{let e=0;const i=new At,r=n=>{e+=n*i.deltaMS;let a=0;Array.isArray(t)?a=dE(t[0],t[1],2):a=t,e>=a&&(s(),e=0)};return i.add(r),i.start(),()=>{i.remove(r),i.stop()}},pE=(s,t,e)=>{const i=r=>{const n=t.getBounds().contains(r.clientX,r.clientY),a=s.getBounds().contains(r.clientX,r.clientY);!n&&!a&&s.visible&&(e(),window.removeEventListener("pointerdown",i))};return window.addEventListener("pointerdown",i),()=>{window.removeEventListener("pointerdown",i)}},mE=(s=1,t)=>new Promise(e=>{let i=0;const r=new At,n=()=>{i+=r.deltaMS,i>=s&&(t==null||t(),r.destroy(),e())};r.add(n),r.start()});var gE=`attribute vec2 aVertexPosition;
|
|
1169
|
+
*/class _i{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,i?this.ease=typeof i=="function"?i:Km(i):this.ease=null}static createList(t){if("list"in t){const i=t.list;let r;const{value:n,time:a}=i[0],o=r=new _i(typeof n=="string"?lo(n):n,a,t.ease);if(i.length>2||i.length===2&&i[1].value!==n)for(let h=1;h<i.length;++h){const{value:l,time:c}=i[h];r.next=new _i(typeof l=="string"?lo(l):l,c),r=r.next}return o.isStepped=!!t.isStepped,o}const e=new _i(typeof t.start=="string"?lo(t.start):t.start,0);return t.end!==t.start&&(e.next=new _i(typeof t.end=="string"?lo(t.end):t.end,1)),e}}let wn=X.from;const gi=Math.PI/180;function Li(s,t){if(!s)return;const e=Math.sin(s),i=Math.cos(s),r=t.x*i-t.y*e,n=t.x*e+t.y*i;t.x=r,t.y=n}function ho(s,t,e){return s<<16|t<<8|e}function jm(s){return Math.sqrt(s.x*s.x+s.y*s.y)}function Gw(s){const t=1/jm(s);s.x*=t,s.y*=t}function qm(s,t){s.x*=t,s.y*=t}function lo(s,t){t||(t={}),s.charAt(0)==="#"?s=s.substr(1):s.indexOf("0x")===0&&(s=s.substr(2));let e;return s.length===8&&(e=s.substr(0,2),s=s.substr(2)),t.r=parseInt(s.substr(0,2),16),t.g=parseInt(s.substr(2,2),16),t.b=parseInt(s.substr(4,2),16),e&&(t.a=parseInt(e,16)),t}function Km(s){const t=s.length,e=1/t;return function(i){const r=t*i|0,n=(i-r*e)*t,a=s[r]||s[t-1];return a.s+n*(2*(1-n)*(a.cp-a.s)+n*(a.e-a.s))}}function Hw(s){return s?(s=s.toUpperCase().replace(/ /g,"_"),K[s]||K.NORMAL):K.NORMAL}class cc extends _e{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}var xt;(function(s){s[s.Spawn=0]="Spawn",s[s.Normal=2]="Normal",s[s.Late=5]="Late"})(xt||(xt={}));const uc=ft.shared,Us=Symbol("Position particle per emitter position");class ut{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new tt,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new tt,this._prevEmitterPos=new tt,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){ut.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){typeof t=="number"&&t>0?this._frequency=t:this._frequency=1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase=typeof t.ease=="function"?t.ease:Km(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance=typeof t.spawnChance=="number"&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=t.emit===void 0?!0:!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(i=>{const r=ut.knownBehaviors[i.type];return r?new r(i.config):(console.error(`Unknown behavior: ${i.type}`),null)}).filter(i=>!!i);e.push(Us),e.sort((i,r)=>i===Us?r.order===xt.Spawn?1:-1:r===Us?i.order===xt.Spawn?-1:1:i.order-r.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(i=>i!==Us&&i.updateParticle),this.recycleBehaviors=e.filter(i=>i!==Us&&i.recycleParticle)}getBehavior(t){return ut.knownBehaviors[t]&&this.initBehaviors.find(e=>e instanceof ut.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const e=new cc(this);e.next=this._poolFirst,this._poolFirst=e}}recycle(t,e=!1){for(let i=0;i<this.recycleBehaviors.length;++i)this.recycleBehaviors[i].recycleParticle(t,!e);t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t===this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t===this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount}rotate(t){if(this.rotation===t)return;const e=t-this.rotation;this.rotation=t,Li(e,this.spawnPos),this._posChanged=!0}updateSpawnPos(t,e){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=e}updateOwnerPos(t,e){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=e}resetPositionTracking(){this._prevPosIsValid=!1}get emit(){return this._emit}set emit(t){this._emit=!!t,this._emitterLife=this.emitterLifetime}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){this._autoUpdate&&!t?uc.remove(this.update,this):!this._autoUpdate&&t&&uc.add(this.update,this),this._autoUpdate=!!t}playOnceAndDestroy(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t}playOnce(t){this.emit=!0,this._completeCallback=t}update(t){if(this._autoUpdate&&(t=uc.elapsedMS*.001),!this._parent)return;for(let a=this._activeParticlesFirst,o;a;a=o)if(o=a.next,a.age+=t,a.age>a.maxLife||a.age<0)this.recycle(a);else{let h=a.age*a.oneOverLife;this.customEase&&(this.customEase.length===4?h=this.customEase(h,0,1,1):h=this.customEase(h)),a.agePercent=h;for(let l=0;l<this.updateBehaviors.length;++l)if(this.updateBehaviors[l].updateParticle(a,t)){this.recycle(a);break}}let e,i;this._prevPosIsValid&&(e=this._prevEmitterPos.x,i=this._prevEmitterPos.y);const r=this.ownerPos.x+this.spawnPos.x,n=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let a,o;if(this._prevPosIsValid&&this._posChanged){const c=1+this._spawnTimer/t;a=(r-e)*c+e,o=(n-i)*c+i}else a=r,o=n;let h=null,l=null;for(let c=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),d=0;d<c;++d){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let u;if(this.minLifetime===this.maxLifetime?u=this.minLifetime:u=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=u)continue;let f;this._poolFirst?(f=this._poolFirst,this._poolFirst=this._poolFirst.next,f.next=null):f=new cc(this),f.init(u),this.addAtBack?this._parent.addChildAt(f,0):this._parent.addChild(f),h?(l.next=f,f.prev=l,l=f):l=h=f,++this.particleCount}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=l):(this._activeParticlesFirst=h,this._activeParticlesLast=l);for(let c=0;c<this.initBehaviors.length;++c){const d=this.initBehaviors[c];if(d===Us)for(let u=h,f;u;u=f){f=u.next,this.rotation!==0&&(Li(this.rotation,u.position),u.rotation+=this.rotation),u.position.x+=a,u.position.y+=o,u.age+=-this._spawnTimer;let p=u.age*u.oneOverLife;this.customEase&&(this.customEase.length===4?p=this.customEase(p,0,1,1):p=this.customEase(p)),u.agePercent=p}else d.initParticles(h)}for(let c=h,d;c;c=d){d=c.next;for(let u=0;u<this.updateBehaviors.length;++u)if(this.updateBehaviors[u].updateParticle(c,-this._spawnTimer)){this.recycle(c);break}}}this._spawnTimer+=this._frequency}if(this._posChanged&&(this._prevEmitterPos.x=r,this._prevEmitterPos.y=n,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){const a=this._completeCallback;this._completeCallback=null,a()}this._destroyWhenComplete&&this.destroy()}}emitNow(){const t=this.ownerPos.x+this.spawnPos.x,e=this.ownerPos.y+this.spawnPos.y;let i=null,r=null;for(let n=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),a=0;a<n;++a){if(this.spawnChance<1&&Math.random()>=this.spawnChance)continue;let o;this._poolFirst?(o=this._poolFirst,this._poolFirst=this._poolFirst.next,o.next=null):o=new cc(this);let h;this.minLifetime===this.maxLifetime?h=this.minLifetime:h=Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,o.init(h),this.addAtBack?this._parent.addChildAt(o,0):this._parent.addChild(o),i?(r.next=o,o.prev=r,r=o):r=i=o,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=r):(this._activeParticlesFirst=i,this._activeParticlesLast=r);for(let n=0;n<this.initBehaviors.length;++n){const a=this.initBehaviors[n];if(a===Us)for(let o=i,h;o;o=h)h=o.next,this.rotation!==0&&(Li(this.rotation,o.position),o.rotation+=this.rotation),o.position.x+=t,o.position.y+=e;else a.initParticles(i)}}}cleanup(){let t,e;for(t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t,!0);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0}get destroyed(){return!(this._parent&&this.initBehaviors.length)}destroy(){this.autoUpdate=!1,this.cleanup();let t;for(let e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.spawnPos=this.ownerPos=this.customEase=this._completeCallback=null,this.initBehaviors.length=this.updateBehaviors.length=this.recycleBehaviors.length=0}}ut.knownBehaviors={};class dc{constructor(t){this.x=t.x,this.y=t.y,this.w=t.w,this.h=t.h}getRandPos(t){t.x=Math.random()*this.w+this.x,t.y=Math.random()*this.h+this.y}}dc.type="rect",dc.editorConfig=null;class co{constructor(t){this.x=t.x||0,this.y=t.y||0,this.radius=t.radius,this.innerRadius=t.innerRadius||0,this.rotation=!!t.affectRotation}getRandPos(t){this.innerRadius!==this.radius?t.x=Math.random()*(this.radius-this.innerRadius)+this.innerRadius:t.x=this.radius,t.y=0;const e=Math.random()*Math.PI*2;this.rotation&&(t.rotation+=e),Li(e,t.position),t.position.x+=this.x,t.position.y+=this.y}}co.type="torus",co.editorConfig=null;class fc{constructor(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}init(t){if(!t||!t.length)this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});else if(Array.isArray(t[0]))for(let e=0;e<t.length;++e){const i=t[e];let r=i[0];for(let n=1;n<i.length;++n){const a=i[n];this.segments.push({p1:r,p2:a,l:0}),r=a}}else{let e=t[0];for(let i=1;i<t.length;++i){const r=t[i];this.segments.push({p1:e,p2:r,l:0}),e=r}}for(let e=0;e<this.segments.length;++e){const{p1:i,p2:r}=this.segments[e],n=Math.sqrt((r.x-i.x)*(r.x-i.x)+(r.y-i.y)*(r.y-i.y));this.segments[e].l=n,this.totalLength+=n,this.countingLengths.push(this.totalLength)}}getRandPos(t){const e=Math.random()*this.totalLength;let i,r;if(this.segments.length===1)i=this.segments[0],r=e;else for(let o=0;o<this.countingLengths.length;++o)if(e<this.countingLengths[o]){i=this.segments[o],r=o===0?e:e-this.countingLengths[o-1];break}r/=i.l||1;const{p1:n,p2:a}=i;t.x=n.x+r*(a.x-n.x),t.y=n.y+r*(a.y-n.y)}}fc.type="polygonalChain",fc.editorConfig=null;class pc{constructor(t){var e;this.order=xt.Late,this.minStart=t.minStart,this.maxStart=t.maxStart,this.accel=t.accel,this.rotate=!!t.rotate,this.maxSpeed=(e=t.maxSpeed)!==null&&e!==void 0?e:0}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.maxStart-this.minStart)+this.minStart;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity,r=i.x,n=i.y;if(i.x+=this.accel.x*e,i.y+=this.accel.y*e,this.maxSpeed){const a=jm(i);a>this.maxSpeed&&qm(i,this.maxSpeed/a)}t.x+=(r+i.x)/2*e,t.y+=(n+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}pc.type="moveAcceleration",pc.editorConfig=null;function Vw(s){return this.ease&&(s=this.ease(s)),(this.first.next.value-this.first.value)*s+this.first.value}function Ww(s){this.ease&&(s=this.ease(s));const t=this.first.value,e=this.first.next.value,i=(e.r-t.r)*s+t.r,r=(e.g-t.g)*s+t.g,n=(e.b-t.b)*s+t.b;return ho(i,r,n)}function Xw(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;return s=(s-t.time)/(e.time-t.time),(e.value-t.value)*s+t.value}function $w(s){this.ease&&(s=this.ease(s));let t=this.first,e=t.next;for(;s>e.time;)t=e,e=e.next;s=(s-t.time)/(e.time-t.time);const i=t.value,r=e.value,n=(r.r-i.r)*s+i.r,a=(r.g-i.g)*s+i.g,o=(r.b-i.b)*s+i.b;return ho(n,a,o)}function zw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;return t.value}function Yw(s){this.ease&&(s=this.ease(s));let t=this.first;for(;t.next&&s>t.next.time;)t=t.next;const e=t.value;return ho(e.r,e.g,e.b)}class En{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?Ww:Vw:t.isStepped?this.interpolate=this.isColor?Yw:zw:this.interpolate=this.isColor?$w:Xw,this.ease=this.first.ease}}class mc{constructor(t){this.order=xt.Normal,this.list=new En(!1),this.list.reset(_i.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}mc.type="alpha",mc.editorConfig=null;class _c{constructor(t){this.order=xt.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}_c.type="alphaStatic",_c.editorConfig=null;function Zm(s){const t=[];for(let e=0;e<s.length;++e){let i=s[e];if(typeof i=="string")t.push(wn(i));else if(i instanceof X)t.push(i);else{let r=i.count||1;for(typeof i.texture=="string"?i=wn(i.texture):i=i.texture;r>0;--r)t.push(i)}}return t}class gc{constructor(t){this.order=xt.Normal,this.anims=[];for(let e=0;e<t.anims.length;++e){const i=t.anims[e],r=Zm(i.textures),n=i.framerate<0?-1:i.framerate>0?i.framerate:60,a={textures:r,duration:n>0?r.length/n:0,framerate:n,loop:n>0?!!i.loop:!1};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.anims.length),r=e.config.anim=this.anims[i];e.texture=r.textures[0],e.config.animElapsed=0,r.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=r.textures.length/e.maxLife):(e.config.animDuration=r.duration,e.config.animFramerate=r.framerate),e=e.next}}updateParticle(t,e){const i=t.config,r=i.anim;i.animElapsed+=e,i.animElapsed>=i.animDuration&&(i.anim.loop?i.animElapsed=i.animElapsed%i.animDuration:i.animElapsed=i.animDuration-1e-6);const n=i.animElapsed*i.animFramerate+1e-7|0;t.texture=r.textures[n]||r.textures[r.textures.length-1]||X.EMPTY}}gc.type="animatedRandom",gc.editorConfig=null;class yc{constructor(t){this.order=xt.Normal;const e=t.anim,i=Zm(e.textures),r=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:r>0?i.length/r:0,framerate:r,loop:r>0?!!e.loop:!1}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,i.framerate===-1?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,e){const i=this.anim,r=t.config;r.animElapsed+=e,r.animElapsed>=r.animDuration&&(i.loop?r.animElapsed=r.animElapsed%r.animDuration:r.animElapsed=r.animDuration-1e-6);const n=r.animElapsed*r.animFramerate+1e-7|0;t.texture=i.textures[n]||i.textures[i.textures.length-1]||X.EMPTY}}yc.type="animatedSingle",yc.editorConfig=null;class xc{constructor(t){this.order=xt.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=Hw(this.value),e=e.next}}xc.type="blendMode",xc.editorConfig=null;class vc{constructor(t){this.order=xt.Spawn,this.spacing=t.spacing*gi,this.start=t.start*gi,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let r;this.spacing?r=this.start+this.spacing*e:r=Math.random()*Math.PI*2,i.rotation=r,this.distance&&(i.position.x=this.distance,Li(r,i.position)),i=i.next,++e}}}vc.type="spawnBurst",vc.editorConfig=null;class bc{constructor(t){this.order=xt.Normal,this.list=new En(!0),this.list.reset(_i.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,r=ho(i.r,i.g,i.b);for(;e;)e.tint=r,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}bc.type="color",bc.editorConfig=null;class Tc{constructor(t){this.order=xt.Normal;let e=t.color;e.charAt(0)==="#"?e=e.substr(1):e.indexOf("0x")===0&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}Tc.type="colorStatic",Tc.editorConfig=null;class wc{constructor(t){this.order=xt.Normal,this.index=0,this.textures=t.textures.map(e=>typeof e=="string"?wn(e):e)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}wc.type="textureOrdered",wc.editorConfig=null;const Ar=new tt,Qm=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],jw=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(Qm).join("|"),"g");function qw(s){const t=s.match(jw);for(let e=t.length-1;e>=0;--e)Qm.indexOf(t[e])>=0&&(t[e]=`Math.${t[e]}`);return s=t.join(""),new Function("x",`return ${s};`)}class Ec{constructor(t){var e;if(this.order=xt.Late,t.path)if(typeof t.path=="function")this.path=t.path;else try{this.path=qw(t.path)}catch{this.path=null}else this.path=i=>i;this.list=new En(!1),this.list.reset(_i.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new tt(e.x,e.y),e.config.movement=0;const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,Ar.x=t.config.movement,Ar.y=this.path(Ar.x),Li(t.config.initRotation,Ar),t.position.x=t.config.initPosition.x+Ar.x,t.position.y=t.config.initPosition.y+Ar.y}}Ec.type="movePath",Ec.editorConfig=null;class Ac{constructor(){this.order=xt.Spawn}initParticles(t){}}Ac.type="spawnPoint",Ac.editorConfig=null;class Sc{constructor(t){this.order=xt.Normal,this.textures=t.textures.map(e=>typeof e=="string"?wn(e):e)}initParticles(t){let e=t;for(;e;){const i=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[i],e=e.next}}}Sc.type="textureRandom",Sc.editorConfig=null;class Cc{constructor(t){this.order=xt.Normal,this.minStart=t.minStart*gi,this.maxStart=t.maxStart*gi,this.minSpeed=t.minSpeed*gi,this.maxSpeed=t.maxSpeed*gi,this.accel=t.accel*gi}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}Cc.type="rotation",Cc.editorConfig=null;class Pc{constructor(t){this.order=xt.Normal,this.min=t.min*gi,this.max=t.max*gi}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}Pc.type="rotationStatic",Pc.editorConfig=null;class Rc{constructor(t){this.order=xt.Late+1,this.rotation=(t.rotation||0)*gi}initParticles(t){let e=t;for(;e;)e.rotation=this.rotation,e=e.next}}Rc.type="noRotation",Rc.editorConfig=null;class Ic{constructor(t){var e;this.order=xt.Normal,this.list=new En(!1),this.list.reset(_i.createList(t.scale)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=i,e.scale.x=e.scale.y=this.list.first.value*i,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}Ic.type="scale",Ic.editorConfig=null;class Mc{constructor(t){this.order=xt.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=i,e=e.next}}}Mc.type="scaleStatic",Mc.editorConfig=null;class ze{constructor(t){this.order=xt.Spawn;const e=ze.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){ze.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}ze.type="spawnShape",ze.editorConfig=null,ze.shapes={},ze.registerShape(fc),ze.registerShape(dc),ze.registerShape(co),ze.registerShape(co,"circle");class Dc{constructor(t){this.order=xt.Normal,this.texture=typeof t.texture=="string"?wn(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}Dc.type="textureSingle",Dc.editorConfig=null;class Bc{constructor(t){var e;this.order=xt.Late,this.list=new En(!1),this.list.reset(_i.createList(t.speed)),this.minMult=(e=t.minMult)!==null&&e!==void 0?e:1}initParticles(t){let e=t;for(;e;){const i=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=i,e.config.velocity?e.config.velocity.set(this.list.first.value*i,0):e.config.velocity=new tt(this.list.first.value*i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,r=t.config.velocity;Gw(r),qm(r,i),t.x+=r.x*e,t.y+=r.y*e}}Bc.type="moveSpeed",Bc.editorConfig=null;class Oc{constructor(t){this.order=xt.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const i=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(i,0):e.config.velocity=new tt(i,0),Li(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}Oc.type="moveSpeedStatic",Oc.editorConfig=null,ut.registerBehavior(pc),ut.registerBehavior(mc),ut.registerBehavior(_c),ut.registerBehavior(gc),ut.registerBehavior(yc),ut.registerBehavior(xc),ut.registerBehavior(vc),ut.registerBehavior(bc),ut.registerBehavior(Tc),ut.registerBehavior(wc),ut.registerBehavior(Ec),ut.registerBehavior(Ac),ut.registerBehavior(Sc),ut.registerBehavior(Cc),ut.registerBehavior(Pc),ut.registerBehavior(Rc),ut.registerBehavior(Ic),ut.registerBehavior(Mc),ut.registerBehavior(ze),ut.registerBehavior(Dc),ut.registerBehavior(Bc),ut.registerBehavior(Oc);class Fc extends Va{constructor(t){const{text:e,fontSize:i=36,fontColor:r=16777215,stroke:n,strokeColor:a,strokeThickness:o,fontFamily:h="MicrosoftYaHei",fontWeight:l="normal",wordWrap:c=!1,wordWrapWidth:d=100,lineHeight:u=1.25,align:f="left",indent:p=0,shadow:m}=t,_=new Mi({fontSize:i,wordWrap:c,wordWrapWidth:d,fontWeight:l,lineHeight:u*i,breakWords:c,fill:r,align:f,fontFamily:h,stroke:n?a:"transparent",strokeThickness:n?o:0,lineJoin:"round"});m&&(_.dropShadow=!0,_.dropShadowColor=m[0],_.dropShadowAngle=m[1]*(Math.PI/180),_.dropShadowBlur=m[2],_.dropShadowDistance=m[3]),super(e,_),this.position.x=p*i}}class Kw extends bt{constructor(t){super();const{start:e,control:i,end:r,json:n,duration:a,ease:o="power1.out",showControl:h=!1,loop:l=!1}=t;this._particleContainer=new jb,this.addChild(this._particleContainer);const c=new ut(this._particleContainer,n),d=this._createBezierPoints([e,...i,r],100,h),u={pathThrough:0};ct.to(u,{duration:a,pathThrough:d.length-1,repeat:l?-1:0,ease:o,onStart:()=>{c.emit=!0},onUpdate:()=>{const p=Math.floor(u.pathThrough),m=d[p];c.updateOwnerPos(m.x,m.y)},onComplete:()=>{ct.to(this,{alpha:0,duration:.5,onComplete:()=>{c.emit=!1,f.destroy(),this.removeFromParent()}})}});const f=new ft;f.add(()=>{c.update(1/75)}),f.start()}_createBezierPoints(t,e,i){const r=[];i&&t.forEach((n,a)=>{const o=new Fc({text:a+1,fontSize:16});o.position.set(n.x,n.y),this.addChild(o)});for(let n=0;n<e;n++){const a=this._multiPointBezier(t,n/e);r.push(a)}return r}_multiPointBezier(t,e){const i=t.length;let r=0,n=0;const a=[];for(let o=0;o<i;o++)a[o]=this._binomial(i-1,o);for(let o=0;o<i;o++){const h=t[o],l=a[o],c=Math.pow(e,o),d=Math.pow(1-e,i-1-o);r+=h.x*d*c*l,n+=h.y*d*c*l}return{x:r,y:n}}_binomial(t,e){if(e===0||e===t)return 1;let i=1;for(let r=1;r<=e;r++)i=i*(t-r+1)/r;return i}}var yi=(s=>(s[s.Region=0]="Region",s[s.BoundingBox=1]="BoundingBox",s[s.Mesh=2]="Mesh",s[s.LinkedMesh=3]="LinkedMesh",s[s.Path=4]="Path",s[s.Point=5]="Point",s[s.Clipping=6]="Clipping",s))(yi||{}),j=(s=>(s[s.setup=0]="setup",s[s.first=1]="first",s[s.replace=2]="replace",s[s.add=3]="add",s))(j||{}),Te=(s=>(s[s.mixIn=0]="mixIn",s[s.mixOut=1]="mixOut",s))(Te||{}),uo=(s=>(s[s.Fixed=0]="Fixed",s[s.Percent=1]="Percent",s))(uo||{}),Gs=(s=>(s[s.Tangent=0]="Tangent",s[s.Chain=1]="Chain",s[s.ChainScale=2]="ChainScale",s))(Gs||{}),se=(s=>(s[s.Normal=0]="Normal",s[s.OnlyTranslation=1]="OnlyTranslation",s[s.NoRotationOrReflection=2]="NoRotationOrReflection",s[s.NoScale=3]="NoScale",s[s.NoScaleOrReflection=4]="NoScaleOrReflection",s))(se||{});class Jm{constructor(){this.size=null,this.names=null,this.values=null,this.renderObject=null}get width(){const t=this.texture;return t.trim?t.trim.width:t.orig.width}get height(){const t=this.texture;return t.trim?t.trim.height:t.orig.height}get u(){return this.texture._uvs.x0}get v(){return this.texture._uvs.y0}get u2(){return this.texture._uvs.x2}get v2(){return this.texture._uvs.y2}get offsetX(){const t=this.texture;return t.trim?t.trim.x:0}get offsetY(){return this.spineOffsetY}get pixiOffsetY(){const t=this.texture;return t.trim?t.trim.y:0}get spineOffsetY(){const t=this.texture;return this.originalHeight-this.height-(t.trim?t.trim.y:0)}get originalWidth(){return this.texture.orig.width}get originalHeight(){return this.texture.orig.height}get x(){return this.texture.frame.x}get y(){return this.texture.frame.y}get rotate(){return this.texture.rotate!==0}get degrees(){return(360-this.texture.rotate*45)%360}}class Zw{constructor(){this.array=new Array}add(t){const e=this.contains(t);return this.array[t|0]=t|0,!e}contains(t){return this.array[t|0]!=null}remove(t){this.array[t|0]=void 0}clear(){this.array.length=0}}const Hs=class{constructor(s=0,t=0,e=0,i=0){this.r=s,this.g=t,this.b=e,this.a=i}set(s,t,e,i){return this.r=s,this.g=t,this.b=e,this.a=i,this.clamp()}setFromColor(s){return this.r=s.r,this.g=s.g,this.b=s.b,this.a=s.a,this}setFromString(s){return s=s.charAt(0)=="#"?s.substr(1):s,this.r=parseInt(s.substr(0,2),16)/255,this.g=parseInt(s.substr(2,2),16)/255,this.b=parseInt(s.substr(4,2),16)/255,this.a=s.length!=8?1:parseInt(s.substr(6,2),16)/255,this}add(s,t,e,i){return this.r+=s,this.g+=t,this.b+=e,this.a+=i,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(s,t){s.r=((t&4278190080)>>>24)/255,s.g=((t&16711680)>>>16)/255,s.b=((t&65280)>>>8)/255,s.a=(t&255)/255}static rgb888ToColor(s,t){s.r=((t&16711680)>>>16)/255,s.g=((t&65280)>>>8)/255,s.b=(t&255)/255}static fromString(s){return new Hs().setFromString(s)}};let we=Hs;we.WHITE=new Hs(1,1,1,1),we.RED=new Hs(1,0,0,1),we.GREEN=new Hs(0,1,0,1),we.BLUE=new Hs(0,0,1,1),we.MAGENTA=new Hs(1,0,1,1);const ki=class{static clamp(s,t,e){return s<t?t:s>e?e:s}static cosDeg(s){return Math.cos(s*ki.degRad)}static sinDeg(s){return Math.sin(s*ki.degRad)}static signum(s){return Math.sign(s)}static toInt(s){return s>0?Math.floor(s):Math.ceil(s)}static cbrt(s){const t=Math.pow(Math.abs(s),.3333333333333333);return s<0?-t:t}static randomTriangular(s,t){return ki.randomTriangularWith(s,t,(s+t)*.5)}static randomTriangularWith(s,t,e){const i=Math.random(),r=t-s;return i<=(e-s)/r?s+Math.sqrt(i*r*(e-s)):t-Math.sqrt((1-i)*r*(t-e))}static isPowerOfTwo(s){return s&&(s&s-1)===0}};let k=ki;k.PI=3.1415927,k.PI2=ki.PI*2,k.radiansToDegrees=180/ki.PI,k.radDeg=ki.radiansToDegrees,k.degreesToRadians=ki.PI/180,k.degRad=ki.degreesToRadians;class Qw{apply(t,e,i){return t+(e-t)*this.applyInternal(i)}}class Jw extends Qw{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(t*2,this.power)/2:Math.pow((t-1)*2,this.power)/(this.power%2==0?-2:2)+1}}class tE extends Jw{applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}const Sr=class{static arrayCopy(s,t,e,i,r){for(let n=t,a=i;n<t+r;n++,a++)e[a]=s[n]}static arrayFill(s,t,e,i){for(let r=t;r<e;r++)s[r]=i}static setArraySize(s,t,e=0){const i=s.length;if(i==t)return s;if(s.length=t,i<t)for(let r=i;r<t;r++)s[r]=e;return s}static ensureArrayCapacity(s,t,e=0){return s.length>=t?s:Sr.setArraySize(s,t,e)}static newArray(s,t){const e=new Array(s);for(let i=0;i<s;i++)e[i]=t;return e}static newFloatArray(s){if(Sr.SUPPORTS_TYPED_ARRAYS)return new Float32Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static newShortArray(s){if(Sr.SUPPORTS_TYPED_ARRAYS)return new Int16Array(s);const t=new Array(s);for(let e=0;e<t.length;e++)t[e]=0;return t}static toFloatArray(s){return Sr.SUPPORTS_TYPED_ARRAYS?new Float32Array(s):s}static toSinglePrecision(s){return Sr.SUPPORTS_TYPED_ARRAYS?Math.fround(s):s}static webkit602BugfixHelper(s,t){}static contains(s,t,e=!0){for(let i=0;i<s.length;i++)if(s[i]==t)return!0;return!1}static enumValue(s,t){return s[t[0].toUpperCase()+t.slice(1)]}};let Q=Sr;Q.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";class eE{constructor(t){this.items=new Array,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}}class iE{constructor(t=0,e=0){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}}const sE={yDown:!0,FAIL_ON_NON_EXISTING_SKIN:!1,GLOBAL_AUTO_UPDATE:!0,GLOBAL_DELAY_LIMIT:0},hs=[0,0,0];class rE extends _e{constructor(){super(...arguments),this.region=null,this.attachment=null}}class nE extends Yb{constructor(t,e,i,r,n){super(t,e,i,r,n),this.region=null,this.attachment=null}}const t_=class extends bt{constructor(s){if(super(),!s)throw new Error("The spineData param is required.");if(typeof s=="string")throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas("YOUR_RESOURCE_NAME") from now on.');this.spineData=s,this.createSkeleton(s),this.slotContainers=[],this.tempClipContainers=[];for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t],r=i.getAttachment(),n=this.newContainer();if(this.slotContainers.push(n),this.addChild(n),this.tempClipContainers.push(null),!!r)if(r.type===yi.Region){const a=r.name,o=this.createSprite(i,r,a);i.currentSprite=o,i.currentSpriteName=a,n.addChild(o)}else if(r.type===yi.Mesh){const a=this.createMesh(i,r);i.currentMesh=a,i.currentMeshId=r.id,i.currentMeshName=r.name,n.addChild(a)}else r.type===yi.Clipping&&(this.createGraphics(i,r),n.addChild(i.clippingContainer),n.addChild(i.currentGraphics))}this.tintRgb=new Float32Array([1,1,1]),this.autoUpdate=!0,this.visible=!0}get debug(){return this._debug}set debug(s){var t;s!=this._debug&&((t=this._debug)==null||t.unregisterSpine(this),s==null||s.registerSpine(this),this._debug=s)}get autoUpdate(){return this._autoUpdate}set autoUpdate(s){s!==this._autoUpdate&&(this._autoUpdate=s,this.updateTransform=s?t_.prototype.autoUpdateTransform:bt.prototype.updateTransform)}get tint(){return Qr(this.tintRgb)}set tint(s){this.tintRgb=Md(s,this.tintRgb)}get delayLimit(){return(typeof this.localDelayLimit<"u"?this.localDelayLimit:sE.GLOBAL_DELAY_LIMIT)||Number.MAX_VALUE}update(s){var l;const t=this.delayLimit;if(s>t&&(s=t),this.state.update(s),this.state.apply(this.skeleton),!this.skeleton)return;this.skeleton.updateWorldTransform();const e=this.skeleton.slots,i=this.color;let r=null,n=null;i?(r=i.light,n=i.dark):r=this.tintRgb;for(let c=0,d=e.length;c<d;c++){const u=e[c],f=u.getAttachment(),p=this.slotContainers[c];if(!f){p.visible=!1;continue}let m=null;f.sequence&&f.sequence.apply(u,f);let _=f.region;const y=f.color;switch(f!=null&&f.type){case yi.Region:if(p.transform.setFromMatrix(u.bone.matrix),_=f.region,u.currentMesh&&(u.currentMesh.visible=!1,u.currentMesh=null,u.currentMeshId=void 0,u.currentMeshName=void 0),!_){u.currentSprite&&(u.currentSprite.renderable=!1);break}if(!u.currentSpriteName||u.currentSpriteName!==f.name){const x=f.name;if(u.currentSprite&&(u.currentSprite.visible=!1),u.sprites=u.sprites||{},u.sprites[x]!==void 0)u.sprites[x].visible=!0;else{const b=this.createSprite(u,f,x);p.addChild(b)}u.currentSprite=u.sprites[x],u.currentSpriteName=x}u.currentSprite.renderable=!0,u.hackRegion||this.setSpriteRegion(f,u.currentSprite,_),u.currentSprite.color?m=u.currentSprite.color:(hs[0]=r[0]*u.color.r*y.r,hs[1]=r[1]*u.color.g*y.g,hs[2]=r[2]*u.color.b*y.b,u.currentSprite.tint=Qr(hs)),u.currentSprite.blendMode=u.blendMode;break;case yi.Mesh:if(u.currentSprite){u.currentSprite.visible=!1,u.currentSprite=null,u.currentSpriteName=void 0;const x=new ca;x._parentID=-1,x._worldID=p.transform._worldID,p.transform=x}if(!_){u.currentMesh&&(u.currentMesh.renderable=!1);break}const g=f.id;if(u.currentMeshId===void 0||u.currentMeshId!==g){const x=g;if(u.currentMesh&&(u.currentMesh.visible=!1),u.meshes=u.meshes||{},u.meshes[x]!==void 0)u.meshes[x].visible=!0;else{const b=this.createMesh(u,f);p.addChild(b)}u.currentMesh=u.meshes[x],u.currentMeshName=f.name,u.currentMeshId=x}u.currentMesh.renderable=!0,f.computeWorldVerticesOld(u,u.currentMesh.vertices),u.currentMesh.color?m=u.currentMesh.color:(hs[0]=r[0]*u.color.r*y.r,hs[1]=r[1]*u.color.g*y.g,hs[2]=r[2]*u.color.b*y.b,u.currentMesh.tint=Qr(hs)),u.currentMesh.blendMode=u.blendMode,u.hackRegion||this.setMeshRegion(f,u.currentMesh,_);break;case yi.Clipping:u.currentGraphics||(this.createGraphics(u,f),p.addChild(u.clippingContainer),p.addChild(u.currentGraphics)),this.updateGraphics(u,f),p.alpha=1,p.visible=!0;continue;default:p.visible=!1;continue}if(p.visible=!0,m){let v=u.color.r*y.r,g=u.color.g*y.g,x=u.color.b*y.b;m.setLight(r[0]*v+n[0]*(1-v),r[1]*g+n[1]*(1-g),r[2]*x+n[2]*(1-x)),u.darkColor?(v=u.darkColor.r,g=u.darkColor.g,x=u.darkColor.b):(v=0,g=0,x=0),m.setDark(r[0]*v+n[0]*(1-v),r[1]*g+n[1]*(1-g),r[2]*x+n[2]*(1-x))}p.alpha=u.color.a}const a=this.skeleton.drawOrder;let o=null,h=null;for(let c=0,d=a.length;c<d;c++){const u=e[a[c].data.index],f=this.slotContainers[a[c].data.index];if(h||f.parent!==null&&f.parent!==this&&(f.parent.removeChild(f),f.parent=this),u.currentGraphics&&u.getAttachment())h=u.clippingContainer,o=u.getAttachment(),h.children.length=0,this.children[c]=f,o.endSlot===u.data&&(o.endSlot=null);else if(h){let p=this.tempClipContainers[c];p||(p=this.tempClipContainers[c]=this.newContainer(),p.visible=!1),this.children[c]=p,f.parent=null,h.addChild(f),o.endSlot==u.data&&(h.renderable=!0,h=null,o=null)}else this.children[c]=f}(l=this._debug)==null||l.renderDebug(this)}setSpriteRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,t.rotation=s.rotation*k.degRad,t.position.x=s.x,t.position.y=s.y,t.alpha=s.color.a,e.size?(t.scale.x=e.size.width/e.originalWidth,t.scale.y=-e.size.height/e.originalHeight):(t.scale.x=s.scaleX*s.width/e.originalWidth,t.scale.y=-s.scaleY*s.height/e.originalHeight))}setMeshRegion(s,t,e){t.attachment===s&&t.region===e||(t.region=e,t.attachment=s,t.texture=e.texture,e.texture.updateUvs(),t.uvBuffer.update(s.regionUVs))}autoUpdateTransform(){{this.lastTime=this.lastTime||Date.now();const s=(Date.now()-this.lastTime)*.001;this.lastTime=Date.now(),this.update(s)}bt.prototype.updateTransform.call(this)}createSprite(s,t,e){let i=t.region;s.hackAttachment===t&&(i=s.hackRegion);const r=i?i.texture:null,n=this.newSprite(r);return n.anchor.set(.5),i&&this.setSpriteRegion(t,n,t.region),s.sprites=s.sprites||{},s.sprites[e]=n,n}createMesh(s,t){let e=t.region;s.hackAttachment===t&&(e=s.hackRegion,s.hackAttachment=null,s.hackRegion=null);const i=this.newMesh(e?e.texture:null,new Float32Array(t.regionUVs.length),t.regionUVs,new Uint16Array(t.triangles),Ue.TRIANGLES);return typeof i._canvasPadding<"u"&&(i._canvasPadding=1.5),i.alpha=t.color.a,i.region=t.region,e&&this.setMeshRegion(t,i,e),s.meshes=s.meshes||{},s.meshes[t.id]=i,i}createGraphics(s,t){const e=this.newGraphics(),i=new $i([]);return e.clear(),e.beginFill(16777215,1),e.drawPolygon(i),e.renderable=!1,s.currentGraphics=e,s.clippingContainer=this.newContainer(),s.clippingContainer.mask=s.currentGraphics,e}updateGraphics(s,t){const e=s.currentGraphics.geometry,i=e.graphicsData[0].shape.points,r=t.worldVerticesLength;i.length=r,t.computeWorldVertices(s,0,r,i,0,2),e.invalidate()}hackTextureBySlotIndex(s,t=null,e=null){const i=this.skeleton.slots[s];if(!i)return!1;const r=i.getAttachment();let n=r.region;return t?(n=new Jm,n.texture=t,n.size=e,i.hackRegion=n,i.hackAttachment=r):(i.hackRegion=null,i.hackAttachment=null),i.currentSprite?this.setSpriteRegion(r,i.currentSprite,n):i.currentMesh&&this.setMeshRegion(r,i.currentMesh,n),!0}hackTextureBySlotName(s,t=null,e=null){const i=this.skeleton.findSlotIndex(s);return i==-1?!1:this.hackTextureBySlotIndex(i,t,e)}hackTextureAttachment(s,t,e,i=null){const r=this.skeleton.findSlotIndex(s),n=this.skeleton.getAttachmentByName(s,t);n.region.texture=e;const a=this.skeleton.slots[r];if(!a)return!1;const o=a.getAttachment();if(t===o.name){let h=n.region;return e?(h=new Jm,h.texture=e,h.size=i,a.hackRegion=h,a.hackAttachment=o):(a.hackRegion=null,a.hackAttachment=null),a.currentSprite&&a.currentSprite.region!=h?(this.setSpriteRegion(o,a.currentSprite,h),a.currentSprite.region=h):a.currentMesh&&a.currentMesh.region!=h&&this.setMeshRegion(o,a.currentMesh,h),!0}return!1}newContainer(){return new bt}newSprite(s){return new rE(s)}newGraphics(){return new li}newMesh(s,t,e,i,r){return new nE(s,t,e,i,r)}transformHack(){return 1}hackAttachmentGroups(s,t,e){if(!s)return;const i=[],r=[];for(let n=0,a=this.skeleton.slots.length;n<a;n++){const o=this.skeleton.slots[n],h=o.currentSpriteName||o.currentMeshName||"",l=o.currentSprite||o.currentMesh;h.endsWith(s)?(l.parentGroup=t,r.push(l)):e&&l&&(l.parentGroup=e,i.push(l))}return[i,r]}destroy(s){this.debug=null;for(let t=0,e=this.skeleton.slots.length;t<e;t++){const i=this.skeleton.slots[t];for(const r in i.meshes)i.meshes[r].destroy(s);i.meshes=null;for(const r in i.sprites)i.sprites[r].destroy(s);i.sprites=null}for(let t=0,e=this.slotContainers.length;t<e;t++)this.slotContainers[t].destroy(s);this.spineData=null,this.skeleton=null,this.slotContainers=null,this.stateData=null,this.state=null,this.tempClipContainers=null,super.destroy(s)}};let Lc=t_;Lc.clippingPolygon=[],Object.defineProperty(Lc.prototype,"visible",{get(){return this._visible},set(s){s!==this._visible&&(this._visible=s,s&&(this.lastTime=0))}});class e_{constructor(t){if(t==null)throw new Error("name cannot be null.");this.name=t}}const i_=class extends e_{constructor(s){super(s),this.id=(i_.nextID++&65535)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(s,t){this.computeWorldVertices(s,0,this.worldVerticesLength,t,0,2)}computeWorldVertices(s,t,e,i,r,n){e=r+(e>>1)*n;const a=s.bone.skeleton,o=s.deform;let h=this.vertices;const l=this.bones;if(l==null){o.length>0&&(h=o);const f=s.bone.matrix,p=f.tx,m=f.ty,_=f.a,y=f.c,v=f.b,g=f.d;for(let x=t,b=r;b<e;x+=2,b+=n){const w=h[x],T=h[x+1];i[b]=w*_+T*y+p,i[b+1]=w*v+T*g+m}return}let c=0,d=0;for(let f=0;f<t;f+=2){const p=l[c];c+=p+1,d+=p}const u=a.bones;if(o.length==0)for(let f=r,p=d*3;f<e;f+=n){let m=0,_=0,y=l[c++];for(y+=c;c<y;c++,p+=3){const v=u[l[c]].matrix,g=h[p],x=h[p+1],b=h[p+2];m+=(g*v.a+x*v.c+v.tx)*b,_+=(g*v.b+x*v.d+v.ty)*b}i[f]=m,i[f+1]=_}else{const f=o;for(let p=r,m=d*3,_=d<<1;p<e;p+=n){let y=0,v=0,g=l[c++];for(g+=c;c<g;c++,m+=3,_+=2){const x=u[l[c]].matrix,b=h[m]+f[_],w=h[m+1]+f[_+1],T=h[m+2];y+=(b*x.a+w*x.c+x.tx)*T,v+=(b*x.b+w*x.d+x.ty)*T}i[p]=y,i[p+1]=v}}}copyTo(s){this.bones!=null?(s.bones=new Array(this.bones.length),Q.arrayCopy(this.bones,0,s.bones,0,this.bones.length)):s.bones=null,this.vertices!=null?(s.vertices=Q.newFloatArray(this.vertices.length),Q.arrayCopy(this.vertices,0,s.vertices,0,this.vertices.length)):s.vertices=null,s.worldVerticesLength=this.worldVerticesLength,s.deformAttachment=this.deformAttachment}};let kc=i_;kc.nextID=0;class fo extends kc{constructor(t){super(t),this.type=yi.Mesh,this.color=new we(1,1,1,1),this.tempColor=new we(0,0,0,0)}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=t,t!=null&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)}copy(){if(this.parentMesh!=null)return this.newLinkedMesh();const t=new fo(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=new Float32Array(this.regionUVs.length),Q.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=new Array(this.triangles.length),Q.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=new Array(this.edges.length),Q.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}newLinkedMesh(){const t=new fo(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(this.parentMesh!=null?this.parentMesh:this),t}}class An extends kc{constructor(t){super(t),this.type=yi.Path,this.closed=!1,this.constantSpeed=!1,this.color=new we(1,1,1,1)}copy(){const t=new An(this.name);return this.copyTo(t),t.lengths=new Array(this.lengths.length),Q.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t}}class s_{constructor(t,e){if(this.deform=new Array,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("bone cannot be null.");this.data=t,this.bone=e,this.color=new we,this.darkColor=t.darkColor==null?null:new we,this.setToSetupPose(),this.blendMode=this.data.blendMode}getAttachment(){return this.attachment}setAttachment(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)}setAttachmentTime(t){this.attachmentTime=this.bone.skeleton.time-t}getAttachmentTime(){return this.bone.skeleton.time-this.attachmentTime}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))}}const Kt=class extends e_{constructor(s){super(s),this.type=yi.Region,this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new we(1,1,1,1),this.offset=Q.newFloatArray(8),this.uvs=Q.newFloatArray(8),this.tempColor=new we(1,1,1,1)}updateOffset(){const s=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,e=-this.width/2*this.scaleX+this.region.offsetX*s,i=-this.height/2*this.scaleY+this.region.offsetY*t,r=e+this.region.width*s,n=i+this.region.height*t,a=this.rotation*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=e*o+this.x,c=e*h,d=i*o+this.y,u=i*h,f=r*o+this.x,p=r*h,m=n*o+this.y,_=n*h,y=this.offset;y[Kt.OX1]=l-u,y[Kt.OY1]=d+c,y[Kt.OX2]=l-_,y[Kt.OY2]=m+c,y[Kt.OX3]=f-_,y[Kt.OY3]=m+p,y[Kt.OX4]=f-u,y[Kt.OY4]=d+p}setRegion(s){this.region=s;const t=this.uvs;s.rotate?(t[2]=s.u,t[3]=s.v2,t[4]=s.u,t[5]=s.v,t[6]=s.u2,t[7]=s.v,t[0]=s.u2,t[1]=s.v2):(t[0]=s.u,t[1]=s.v2,t[2]=s.u,t[3]=s.v,t[4]=s.u2,t[5]=s.v,t[6]=s.u2,t[7]=s.v2)}computeWorldVertices(s,t,e,i){const r=this.offset,n=s instanceof s_?s.bone.matrix:s.matrix,a=n.tx,o=n.ty,h=n.a,l=n.c,c=n.b,d=n.d;let u=0,f=0;u=r[Kt.OX1],f=r[Kt.OY1],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=r[Kt.OX2],f=r[Kt.OY2],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=r[Kt.OX3],f=r[Kt.OY3],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o,e+=i,u=r[Kt.OX4],f=r[Kt.OY4],t[e]=u*h+f*l+a,t[e+1]=u*c+f*d+o}copy(){const s=new Kt(this.name);return s.region=this.region,s.rendererObject=this.rendererObject,s.path=this.path,s.x=this.x,s.y=this.y,s.scaleX=this.scaleX,s.scaleY=this.scaleY,s.rotation=this.rotation,s.width=this.width,s.height=this.height,Q.arrayCopy(this.uvs,0,s.uvs,0,8),Q.arrayCopy(this.offset,0,s.offset,0,8),s.color.setFromColor(this.color),s}};let et=Kt;et.OX1=0,et.OY1=1,et.OX2=2,et.OY2=3,et.OX3=4,et.OY3=5,et.OX4=6,et.OY4=7,et.X1=0,et.Y1=1,et.C1R=2,et.C1G=3,et.C1B=4,et.C1A=5,et.U1=6,et.V1=7,et.X2=8,et.Y2=9,et.C2R=10,et.C2G=11,et.C2B=12,et.C2A=13,et.U2=14,et.V2=15,et.X3=16,et.Y3=17,et.C3R=18,et.C3G=19,et.C3B=20,et.C3A=21,et.U3=22,et.V3=23,et.X4=24,et.Y4=25,et.C4R=26,et.C4G=27,et.C4B=28,et.C4A=29,et.U4=30,et.V4=31,new tE(2);class pe{constructor(t,e,i){if(t==null)throw new Error("name cannot be null.");if(e==null)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(let r=0;r<e.length;r++)this.timelineIds[e[r].getPropertyId()]=!0;this.duration=i}hasTimeline(t){return this.timelineIds[t]==!0}apply(t,e,i,r,n,a,o,h){if(t==null)throw new Error("skeleton cannot be null.");r&&this.duration!=0&&(i%=this.duration,e>0&&(e%=this.duration));const l=this.timelines;for(let c=0,d=l.length;c<d;c++)l[c].apply(t,e,i,n,a,o,h)}static binarySearch(t,e,i=1){let r=0,n=t.length/i-2;if(n==0)return i;let a=n>>>1;for(;;){if(t[(a+1)*i]<=e?r=a+1:n=a,r==n)return(r+1)*i;a=r+n>>>1}}static linearSearch(t,e,i){for(let r=0,n=t.length-i;r<=n;r+=i)if(t[r]>e)return r;return-1}}const Gt=class{constructor(s){if(s<=0)throw new Error(`frameCount must be > 0: ${s}`);this.curves=Q.newFloatArray((s-1)*Gt.BEZIER_SIZE)}getFrameCount(){return this.curves.length/Gt.BEZIER_SIZE+1}setLinear(s){this.curves[s*Gt.BEZIER_SIZE]=Gt.LINEAR}setStepped(s){this.curves[s*Gt.BEZIER_SIZE]=Gt.STEPPED}getCurveType(s){const t=s*Gt.BEZIER_SIZE;if(t==this.curves.length)return Gt.LINEAR;const e=this.curves[t];return e==Gt.LINEAR?Gt.LINEAR:e==Gt.STEPPED?Gt.STEPPED:Gt.BEZIER}setCurve(s,t,e,i,r){const n=(-t*2+i)*.03,a=(-e*2+r)*.03,o=((t-i)*3+1)*.006,h=((e-r)*3+1)*.006;let l=n*2+o,c=a*2+h,d=t*.3+n+o*.16666667,u=e*.3+a+h*.16666667,f=s*Gt.BEZIER_SIZE;const p=this.curves;p[f++]=Gt.BEZIER;let m=d,_=u;for(let y=f+Gt.BEZIER_SIZE-1;f<y;f+=2)p[f]=m,p[f+1]=_,d+=l,u+=c,l+=o,c+=h,m+=d,_+=u}getCurvePercent(s,t){t=k.clamp(t,0,1);const e=this.curves;let i=s*Gt.BEZIER_SIZE;const r=e[i];if(r==Gt.LINEAR)return t;if(r==Gt.STEPPED)return 0;i++;let n=0;for(let o=i,h=i+Gt.BEZIER_SIZE-1;i<h;i+=2)if(n=e[i],n>=t){let l,c;return i==o?(l=0,c=0):(l=e[i-2],c=e[i-1]),c+(e[i+1]-c)*(t-l)/(n-l)}const a=e[i-1];return a+(1-a)*(t-n)/(1-n)}};let Fe=Gt;Fe.LINEAR=0,Fe.STEPPED=1,Fe.BEZIER=2,Fe.BEZIER_SIZE=10*2-1;const ls=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(s,t,e){s<<=1,this.frames[s]=t,this.frames[s+ls.ROTATION]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotation=h.data.rotation;return;case j.first:const p=h.data.rotation-h.rotation;h.rotation+=(p-(16384-(16384.499999999996-p/360|0))*360)*r}return}if(e>=o[o.length-ls.ENTRIES]){let p=o[o.length+ls.PREV_ROTATION];switch(n){case j.setup:h.rotation=h.data.rotation+p*r;break;case j.first:case j.replace:p+=h.data.rotation-h.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case j.add:h.rotation+=p*r}return}const l=pe.binarySearch(o,e,ls.ENTRIES),c=o[l+ls.PREV_ROTATION],d=o[l],u=this.getCurvePercent((l>>1)-1,1-(e-d)/(o[l+ls.PREV_TIME]-d));let f=o[l+ls.ROTATION]-c;switch(f=c+(f-(16384-(16384.499999999996-f/360|0))*360)*u,n){case j.setup:h.rotation=h.data.rotation+(f-(16384-(16384.499999999996-f/360|0))*360)*r;break;case j.first:case j.replace:f+=h.data.rotation-h.rotation;case j.add:h.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*r}}};let Le=ls;Le.ENTRIES=2,Le.PREV_TIME=-2,Le.PREV_ROTATION=-1,Le.ROTATION=1;const ae=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ae.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(s,t,e,i){s*=ae.ENTRIES,this.frames[s]=t,this.frames[s+ae.X]=e,this.frames[s+ae.Y]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.bones[this.boneIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.x=h.data.x,h.y=h.data.y;return;case j.first:h.x+=(h.data.x-h.x)*r,h.y+=(h.data.y-h.y)*r}return}let l=0,c=0;if(e>=o[o.length-ae.ENTRIES])l=o[o.length+ae.PREV_X],c=o[o.length+ae.PREV_Y];else{const d=pe.binarySearch(o,e,ae.ENTRIES);l=o[d+ae.PREV_X],c=o[d+ae.PREV_Y];const u=o[d],f=this.getCurvePercent(d/ae.ENTRIES-1,1-(e-u)/(o[d+ae.PREV_TIME]-u));l+=(o[d+ae.X]-l)*f,c+=(o[d+ae.Y]-c)*f}switch(n){case j.setup:h.x=h.data.x+l*r,h.y=h.data.y+c*r;break;case j.first:case j.replace:h.x+=(h.data.x+l-h.x)*r,h.y+=(h.data.y+c-h.y)*r;break;case j.add:h.x+=l*r,h.y+=c*r}}};let Cr=ae;Cr.ENTRIES=3,Cr.PREV_TIME=-3,Cr.PREV_X=-2,Cr.PREV_Y=-1,Cr.X=1,Cr.Y=2;const Rt=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Rt.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(s,t,e,i,r,n){s*=Rt.ENTRIES,this.frames[s]=t,this.frames[s+Rt.R]=e,this.frames[s+Rt.G]=i,this.frames[s+Rt.B]=r,this.frames[s+Rt.A]=n}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color);return;case j.first:const f=o.color,p=o.data.color;f.add((p.r-f.r)*r,(p.g-f.g)*r,(p.b-f.b)*r,(p.a-f.a)*r)}return}let l=0,c=0,d=0,u=0;if(e>=h[h.length-Rt.ENTRIES]){const f=h.length;l=h[f+Rt.PREV_R],c=h[f+Rt.PREV_G],d=h[f+Rt.PREV_B],u=h[f+Rt.PREV_A]}else{const f=pe.binarySearch(h,e,Rt.ENTRIES);l=h[f+Rt.PREV_R],c=h[f+Rt.PREV_G],d=h[f+Rt.PREV_B],u=h[f+Rt.PREV_A];const p=h[f],m=this.getCurvePercent(f/Rt.ENTRIES-1,1-(e-p)/(h[f+Rt.PREV_TIME]-p));l+=(h[f+Rt.R]-l)*m,c+=(h[f+Rt.G]-c)*m,d+=(h[f+Rt.B]-d)*m,u+=(h[f+Rt.A]-u)*m}if(r==1)o.color.set(l,c,d,u);else{const f=o.color;n==j.setup&&f.setFromColor(o.data.color),f.add((l-f.r)*r,(c-f.g)*r,(d-f.b)*r,(u-f.a)*r)}}};let xi=Rt;xi.ENTRIES=5,xi.PREV_TIME=-5,xi.PREV_R=-4,xi.PREV_G=-3,xi.PREV_B=-2,xi.PREV_A=-1,xi.R=1,xi.G=2,xi.B=3,xi.A=4;const ot=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ot.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(s,t,e,i,r,n,a,o,h){s*=ot.ENTRIES,this.frames[s]=t,this.frames[s+ot.R]=e,this.frames[s+ot.G]=i,this.frames[s+ot.B]=r,this.frames[s+ot.A]=n,this.frames[s+ot.R2]=a,this.frames[s+ot.G2]=o,this.frames[s+ot.B2]=h}apply(s,t,e,i,r,n,a){const o=s.slots[this.slotIndex];if(!o.bone.active)return;const h=this.frames;if(e<h[0]){switch(n){case j.setup:o.color.setFromColor(o.data.color),o.darkColor.setFromColor(o.data.darkColor);return;case j.first:const _=o.color,y=o.darkColor,v=o.data.color,g=o.data.darkColor;_.add((v.r-_.r)*r,(v.g-_.g)*r,(v.b-_.b)*r,(v.a-_.a)*r),y.add((g.r-y.r)*r,(g.g-y.g)*r,(g.b-y.b)*r,0)}return}let l=0,c=0,d=0,u=0,f=0,p=0,m=0;if(e>=h[h.length-ot.ENTRIES]){const _=h.length;l=h[_+ot.PREV_R],c=h[_+ot.PREV_G],d=h[_+ot.PREV_B],u=h[_+ot.PREV_A],f=h[_+ot.PREV_R2],p=h[_+ot.PREV_G2],m=h[_+ot.PREV_B2]}else{const _=pe.binarySearch(h,e,ot.ENTRIES);l=h[_+ot.PREV_R],c=h[_+ot.PREV_G],d=h[_+ot.PREV_B],u=h[_+ot.PREV_A],f=h[_+ot.PREV_R2],p=h[_+ot.PREV_G2],m=h[_+ot.PREV_B2];const y=h[_],v=this.getCurvePercent(_/ot.ENTRIES-1,1-(e-y)/(h[_+ot.PREV_TIME]-y));l+=(h[_+ot.R]-l)*v,c+=(h[_+ot.G]-c)*v,d+=(h[_+ot.B]-d)*v,u+=(h[_+ot.A]-u)*v,f+=(h[_+ot.R2]-f)*v,p+=(h[_+ot.G2]-p)*v,m+=(h[_+ot.B2]-m)*v}if(r==1)o.color.set(l,c,d,u),o.darkColor.set(f,p,m,1);else{const _=o.color,y=o.darkColor;n==j.setup&&(_.setFromColor(o.data.color),y.setFromColor(o.data.darkColor)),_.add((l-_.r)*r,(c-_.g)*r,(d-_.b)*r,(u-_.a)*r),y.add((f-y.r)*r,(p-y.g)*r,(m-y.b)*r,0)}}};let re=ot;re.ENTRIES=8,re.PREV_TIME=-8,re.PREV_R=-7,re.PREV_G=-6,re.PREV_B=-5,re.PREV_A=-4,re.PREV_R2=-3,re.PREV_G2=-2,re.PREV_B2=-1,re.R=1,re.G=2,re.B=3,re.A=4,re.R2=5,re.G2=6,re.B2=7;class po{constructor(t){this.frames=Q.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i}apply(t,e,i,r,n,a,o){const h=t.slots[this.slotIndex];if(!h.bone.active)return;if(o==Te.mixOut){a==j.setup&&this.setAttachment(t,h,h.data.attachmentName);return}const l=this.frames;if(i<l[0]){(a==j.setup||a==j.first)&&this.setAttachment(t,h,h.data.attachmentName);return}let c=0;i>=l[l.length-1]?c=l.length-1:c=pe.binarySearch(l,i,1)-1;const d=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(d==null?null:t.getAttachment(this.slotIndex,d))}setAttachment(t,e,i){e.setAttachment(i==null?null:t.getAttachment(this.slotIndex,i))}}class aE{constructor(t){this.frames=Q.newFloatArray(t),this.events=new Array(t)}getPropertyId(){return 7<<24}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,i,r,n,a,o){if(r==null)return;const h=this.frames,l=this.frames.length;if(e>i)this.apply(t,e,Number.MAX_VALUE,r,n,a,o),e=-1;else if(e>=h[l-1])return;if(i<h[0])return;let c=0;if(e<h[0])c=0;else{c=pe.binarySearch(h,e);const d=h[c];for(;c>0&&h[c-1]==d;)c--}for(;c<l&&i>=h[c];c++)r.push(this.events[c])}}class Nc{constructor(t){this.frames=Q.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,i){this.frames[t]=e,this.drawOrders[t]=i}apply(t,e,i,r,n,a,o){const h=t.drawOrder,l=t.slots;if(o==Te.mixOut&&a==j.setup){Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}const c=this.frames;if(i<c[0]){(a==j.setup||a==j.first)&&Q.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);return}let d=0;i>=c[c.length-1]?d=c.length-1:d=pe.binarySearch(c,i)-1;const u=this.drawOrders[d];if(u==null)Q.arrayCopy(l,0,h,0,l.length);else for(let f=0,p=u.length;f<p;f++)h[f]=l[u[f]]}}const ht=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*ht.ENTRIES)}getPropertyId(){return(9<<24)+this.ikConstraintIndex}setFrame(s,t,e,i,r,n,a){s*=ht.ENTRIES,this.frames[s]=t,this.frames[s+ht.MIX]=e,this.frames[s+ht.SOFTNESS]=i,this.frames[s+ht.BEND_DIRECTION]=r,this.frames[s+ht.COMPRESS]=n?1:0,this.frames[s+ht.STRETCH]=a?1:0}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.ikConstraints[this.ikConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.mix=h.data.mix,h.softness=h.data.softness,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch;return;case j.first:h.mix+=(h.data.mix-h.mix)*r,h.softness+=(h.data.softness-h.softness)*r,h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch}return}if(e>=o[o.length-ht.ENTRIES]){n==j.setup?(h.mix=h.data.mix+(o[o.length+ht.PREV_MIX]-h.data.mix)*r,h.softness=h.data.softness+(o[o.length+ht.PREV_SOFTNESS]-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0)):(h.mix+=(o[o.length+ht.PREV_MIX]-h.mix)*r,h.softness+=(o[o.length+ht.PREV_SOFTNESS]-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[o.length+ht.PREV_BEND_DIRECTION],h.compress=o[o.length+ht.PREV_COMPRESS]!=0,h.stretch=o[o.length+ht.PREV_STRETCH]!=0));return}const l=pe.binarySearch(o,e,ht.ENTRIES),c=o[l+ht.PREV_MIX],d=o[l+ht.PREV_SOFTNESS],u=o[l],f=this.getCurvePercent(l/ht.ENTRIES-1,1-(e-u)/(o[l+ht.PREV_TIME]-u));n==j.setup?(h.mix=h.data.mix+(c+(o[l+ht.MIX]-c)*f-h.data.mix)*r,h.softness=h.data.softness+(d+(o[l+ht.SOFTNESS]-d)*f-h.data.softness)*r,a==Te.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0)):(h.mix+=(c+(o[l+ht.MIX]-c)*f-h.mix)*r,h.softness+=(d+(o[l+ht.SOFTNESS]-d)*f-h.softness)*r,a==Te.mixIn&&(h.bendDirection=o[l+ht.PREV_BEND_DIRECTION],h.compress=o[l+ht.PREV_COMPRESS]!=0,h.stretch=o[l+ht.PREV_STRETCH]!=0))}};let ke=ht;ke.ENTRIES=6,ke.PREV_TIME=-6,ke.PREV_MIX=-5,ke.PREV_SOFTNESS=-4,ke.PREV_BEND_DIRECTION=-3,ke.PREV_COMPRESS=-2,ke.PREV_STRETCH=-1,ke.MIX=1,ke.SOFTNESS=2,ke.BEND_DIRECTION=3,ke.COMPRESS=4,ke.STRETCH=5;const It=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*It.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(s,t,e,i,r,n){s*=It.ENTRIES,this.frames[s]=t,this.frames[s+It.ROTATE]=e,this.frames[s+It.TRANSLATE]=i,this.frames[s+It.SCALE]=r,this.frames[s+It.SHEAR]=n}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(e<o[0]){const f=h.data;switch(n){case j.setup:h.rotateMix=f.rotateMix,h.translateMix=f.translateMix,h.scaleMix=f.scaleMix,h.shearMix=f.shearMix;return;case j.first:h.rotateMix+=(f.rotateMix-h.rotateMix)*r,h.translateMix+=(f.translateMix-h.translateMix)*r,h.scaleMix+=(f.scaleMix-h.scaleMix)*r,h.shearMix+=(f.shearMix-h.shearMix)*r}return}let l=0,c=0,d=0,u=0;if(e>=o[o.length-It.ENTRIES]){const f=o.length;l=o[f+It.PREV_ROTATE],c=o[f+It.PREV_TRANSLATE],d=o[f+It.PREV_SCALE],u=o[f+It.PREV_SHEAR]}else{const f=pe.binarySearch(o,e,It.ENTRIES);l=o[f+It.PREV_ROTATE],c=o[f+It.PREV_TRANSLATE],d=o[f+It.PREV_SCALE],u=o[f+It.PREV_SHEAR];const p=o[f],m=this.getCurvePercent(f/It.ENTRIES-1,1-(e-p)/(o[f+It.PREV_TIME]-p));l+=(o[f+It.ROTATE]-l)*m,c+=(o[f+It.TRANSLATE]-c)*m,d+=(o[f+It.SCALE]-d)*m,u+=(o[f+It.SHEAR]-u)*m}if(n==j.setup){const f=h.data;h.rotateMix=f.rotateMix+(l-f.rotateMix)*r,h.translateMix=f.translateMix+(c-f.translateMix)*r,h.scaleMix=f.scaleMix+(d-f.scaleMix)*r,h.shearMix=f.shearMix+(u-f.shearMix)*r}else h.rotateMix+=(l-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r,h.scaleMix+=(d-h.scaleMix)*r,h.shearMix+=(u-h.shearMix)*r}};let vi=It;vi.ENTRIES=5,vi.PREV_TIME=-5,vi.PREV_ROTATE=-4,vi.PREV_TRANSLATE=-3,vi.PREV_SCALE=-2,vi.PREV_SHEAR=-1,vi.ROTATE=1,vi.TRANSLATE=2,vi.SCALE=3,vi.SHEAR=4;const Ye=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*Ye.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(s,t,e){s*=Ye.ENTRIES,this.frames[s]=t,this.frames[s+Ye.VALUE]=e}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.position=h.data.position;return;case j.first:h.position+=(h.data.position-h.position)*r}return}let l=0;if(e>=o[o.length-Ye.ENTRIES])l=o[o.length+Ye.PREV_VALUE];else{const c=pe.binarySearch(o,e,Ye.ENTRIES);l=o[c+Ye.PREV_VALUE];const d=o[c],u=this.getCurvePercent(c/Ye.ENTRIES-1,1-(e-d)/(o[c+Ye.PREV_TIME]-d));l+=(o[c+Ye.VALUE]-l)*u}n==j.setup?h.position=h.data.position+(l-h.data.position)*r:h.position+=(l-h.position)*r}};let mo=Ye;mo.ENTRIES=2,mo.PREV_TIME=-2,mo.PREV_VALUE=-1,mo.VALUE=1;const oe=class extends Fe{constructor(s){super(s),this.frames=Q.newFloatArray(s*oe.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(s,t,e,i){s*=oe.ENTRIES,this.frames[s]=t,this.frames[s+oe.ROTATE]=e,this.frames[s+oe.TRANSLATE]=i}apply(s,t,e,i,r,n,a){const o=this.frames,h=s.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(e<o[0]){switch(n){case j.setup:h.rotateMix=h.data.rotateMix,h.translateMix=h.data.translateMix;return;case j.first:h.rotateMix+=(h.data.rotateMix-h.rotateMix)*r,h.translateMix+=(h.data.translateMix-h.translateMix)*r}return}let l=0,c=0;if(e>=o[o.length-oe.ENTRIES])l=o[o.length+oe.PREV_ROTATE],c=o[o.length+oe.PREV_TRANSLATE];else{const d=pe.binarySearch(o,e,oe.ENTRIES);l=o[d+oe.PREV_ROTATE],c=o[d+oe.PREV_TRANSLATE];const u=o[d],f=this.getCurvePercent(d/oe.ENTRIES-1,1-(e-u)/(o[d+oe.PREV_TIME]-u));l+=(o[d+oe.ROTATE]-l)*f,c+=(o[d+oe.TRANSLATE]-c)*f}n==j.setup?(h.rotateMix=h.data.rotateMix+(l-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(c-h.data.translateMix)*r):(h.rotateMix+=(l-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r)}};let Pr=oe;Pr.ENTRIES=3,Pr.PREV_TIME=-3,Pr.PREV_ROTATE=-2,Pr.PREV_TRANSLATE=-1,Pr.ROTATE=1,Pr.TRANSLATE=2;const Mt=class{constructor(s){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r_(this),this.propertyIDs=new Zw,this.animationsChanged=!1,this.trackEntryPool=new eE(()=>new Uc),this.data=s}update(s){s*=this.timeScale;const t=this.tracks;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r==null)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let n=s*r.timeScale;if(r.delay>0){if(r.delay-=n,r.delay>0)continue;n=-r.delay,r.delay=0}let a=r.next;if(a!=null){const o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=r.timeScale==0?0:(o/r.timeScale+s)*a.timeScale,r.trackTime+=n,this.setCurrent(e,a,!0);a.mixingFrom!=null;)a.mixTime+=s,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&r.mixingFrom==null){t[e]=null,this.queue.end(r),this.disposeNext(r);continue}if(r.mixingFrom!=null&&this.updateMixingFrom(r,s)){let o=r.mixingFrom;for(r.mixingFrom=null,o!=null&&(o.mixingTo=null);o!=null;)this.queue.end(o),o=o.mixingFrom}r.trackTime+=n}this.queue.drain()}updateMixingFrom(s,t){const e=s.mixingFrom;if(e==null)return!0;const i=this.updateMixingFrom(e,t);return e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast,s.mixTime>0&&s.mixTime>=s.mixDuration?((e.totalAlpha==0||s.mixDuration==0)&&(s.mixingFrom=e.mixingFrom,e.mixingFrom!=null&&(e.mixingFrom.mixingTo=s),s.interruptAlpha=e.interruptAlpha,this.queue.end(e)),i):(e.trackTime+=t*e.timeScale,s.mixTime+=t,!1)}apply(s){if(s==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const t=this.events,e=this.tracks;let i=!1;for(let a=0,o=e.length;a<o;a++){const h=e[a];if(h==null||h.delay>0)continue;i=!0;const l=a==0?j.first:h.mixBlend;let c=h.alpha;h.mixingFrom!=null?c*=this.applyMixingFrom(h,s,l):h.trackTime>=h.trackEnd&&h.next==null&&(c=0);const d=h.animationLast,u=h.getAnimationTime(),f=h.animation.timelines.length,p=h.animation.timelines;if(a==0&&c==1||l==j.add)for(let m=0;m<f;m++){const _=p[m];_ instanceof po?this.applyAttachmentTimeline(_,s,u,l,!0):_.apply(s,d,u,t,c,l,Te.mixIn)}else{const m=h.timelineMode,_=h.timelinesRotation.length==0;_&&Q.setArraySize(h.timelinesRotation,f<<1,null);const y=h.timelinesRotation;for(let v=0;v<f;v++){const g=p[v],x=m[v]==Mt.SUBSEQUENT?l:j.setup;g instanceof Le?this.applyRotateTimeline(g,s,u,c,x,y,v<<1,_):g instanceof po?this.applyAttachmentTimeline(g,s,u,l,!0):g.apply(s,d,u,t,c,x,Te.mixIn)}}this.queueEvents(h,u),t.length=0,h.nextAnimationLast=u,h.nextTrackLast=h.trackTime}const r=this.unkeyedState+Mt.SETUP,n=s.slots;for(let a=0,o=s.slots.length;a<o;a++){const h=n[a];if(h.attachmentState==r){const l=h.data.attachmentName;h.setAttachment(l==null?null:s.getAttachment(h.data.index,l))}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(s,t,e){const i=s.mixingFrom;i.mixingFrom!=null&&this.applyMixingFrom(i,t,e);let r=0;s.mixDuration==0?(r=1,e==j.first&&(e=j.setup)):(r=s.mixTime/s.mixDuration,r>1&&(r=1),e!=j.first&&(e=i.mixBlend));const n=r<i.eventThreshold?this.events:null,a=r<i.attachmentThreshold,o=r<i.drawOrderThreshold,h=i.animationLast,l=i.getAnimationTime(),c=i.animation.timelines.length,d=i.animation.timelines,u=i.alpha*s.interruptAlpha,f=u*(1-r);if(e==j.add)for(let p=0;p<c;p++)d[p].apply(t,h,l,n,f,e,Te.mixOut);else{const p=i.timelineMode,m=i.timelineHoldMix,_=i.timelinesRotation.length==0;_&&Q.setArraySize(i.timelinesRotation,c<<1,null);const y=i.timelinesRotation;i.totalAlpha=0;for(let v=0;v<c;v++){const g=d[v];let x=Te.mixOut,b,w=0;switch(p[v]){case Mt.SUBSEQUENT:if(!o&&g instanceof Nc)continue;b=e,w=f;break;case Mt.FIRST:b=j.setup,w=f;break;case Mt.HOLD_SUBSEQUENT:b=e,w=u;break;case Mt.HOLD_FIRST:b=j.setup,w=u;break;default:b=j.setup;const T=m[v];w=u*Math.max(0,1-T.mixTime/T.mixDuration);break}i.totalAlpha+=w,g instanceof Le?this.applyRotateTimeline(g,t,l,w,b,y,v<<1,_):g instanceof po?this.applyAttachmentTimeline(g,t,l,b,a):(o&&g instanceof Nc&&b==j.setup&&(x=Te.mixIn),g.apply(t,h,l,n,w,b,x))}}return s.mixDuration>0&&this.queueEvents(i,l),this.events.length=0,i.nextAnimationLast=l,i.nextTrackLast=i.trackTime,r}applyAttachmentTimeline(s,t,e,i,r){const n=t.slots[s.slotIndex];if(!n.bone.active)return;const a=s.frames;if(e<a[0])(i==j.setup||i==j.first)&&this.setAttachment(t,n,n.data.attachmentName,r);else{let o;e>=a[a.length-1]?o=a.length-1:o=pe.binarySearch(a,e)-1,this.setAttachment(t,n,s.attachmentNames[o],r)}n.attachmentState<=this.unkeyedState&&(n.attachmentState=this.unkeyedState+Mt.SETUP)}setAttachment(s,t,e,i){t.setAttachment(e==null?null:s.getAttachment(t.data.index,e)),i&&(t.attachmentState=this.unkeyedState+Mt.CURRENT)}applyRotateTimeline(s,t,e,i,r,n,a,o){if(o&&(n[a]=0),i==1){s.apply(t,0,e,null,1,r,Te.mixIn);return}const h=s,l=h.frames,c=t.bones[h.boneIndex];if(!c.active)return;let d=0,u=0;if(e<l[0])switch(r){case j.setup:c.rotation=c.data.rotation;default:return;case j.first:d=c.rotation,u=c.data.rotation}else if(d=r==j.setup?c.data.rotation:c.rotation,e>=l[l.length-Le.ENTRIES])u=c.data.rotation+l[l.length+Le.PREV_ROTATION];else{const m=pe.binarySearch(l,e,Le.ENTRIES),_=l[m+Le.PREV_ROTATION],y=l[m],v=h.getCurvePercent((m>>1)-1,1-(e-y)/(l[m+Le.PREV_TIME]-y));u=l[m+Le.ROTATION]-_,u-=(16384-(16384.499999999996-u/360|0))*360,u=_+u*v+c.data.rotation,u-=(16384-(16384.499999999996-u/360|0))*360}let f=0,p=u-d;if(p-=(16384-(16384.499999999996-p/360|0))*360,p==0)f=n[a];else{let m=0,_=0;o?(m=0,_=p):(m=n[a],_=n[a+1]);const y=p>0;let v=m>=0;k.signum(_)!=k.signum(p)&&Math.abs(_)<=90&&(Math.abs(m)>180&&(m+=360*k.signum(m)),v=y),f=p+m-m%360,v!=y&&(f+=360*k.signum(m)),n[a]=f}n[a+1]=p,d+=f*i,c.rotation=d-(16384-(16384.499999999996-d/360|0))*360}queueEvents(s,t){const e=s.animationStart,i=s.animationEnd,r=i-e,n=s.trackLast%r,a=this.events;let o=0;const h=a.length;for(;o<h;o++){const c=a[o];if(c.time<n)break;c.time>i||this.queue.event(s,c)}let l=!1;for(s.loop?l=r==0||n>s.trackTime%r:l=t>=i&&s.animationLast<i,l&&this.queue.complete(s);o<h;o++)a[o].time<e||this.queue.event(s,a[o])}clearTracks(){const s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=s,this.queue.drain()}clearTrack(s){if(s>=this.tracks.length)return;const t=this.tracks[s];if(t==null)return;this.queue.end(t),this.disposeNext(t);let e=t;for(;;){const i=e.mixingFrom;if(i==null)break;this.queue.end(i),e.mixingFrom=null,e.mixingTo=null,e=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(s,t,e){const i=this.expandToIndex(s);this.tracks[s]=t,i!=null&&(e&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom!=null&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(s,t,e){const i=this.data.skeletonData.findAnimation(t);if(i==null)throw new Error(`Animation not found: ${t}`);return this.setAnimationWith(s,i,e)}setAnimationWith(s,t,e){if(t==null)throw new Error("animation cannot be null.");let i=!0,r=this.expandToIndex(s);r!=null&&(r.nextTrackLast==-1?(this.tracks[s]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,i=!1):this.disposeNext(r));const n=this.trackEntry(s,t,e,r);return this.setCurrent(s,n,i),this.queue.drain(),n}addAnimation(s,t,e,i){const r=this.data.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);return this.addAnimationWith(s,r,e,i)}addAnimationWith(s,t,e,i){if(t==null)throw new Error("animation cannot be null.");let r=this.expandToIndex(s);if(r!=null)for(;r.next!=null;)r=r.next;const n=this.trackEntry(s,t,e,r);if(r==null)this.setCurrent(s,n,!0),this.queue.drain();else if(r.next=n,i<=0){const a=r.animationEnd-r.animationStart;a!=0?(r.loop?i+=a*(1+(r.trackTime/a|0)):i+=Math.max(a,r.trackTime),i-=this.data.getMix(r.animation,t)):i=r.trackTime}return n.delay=i,n}setEmptyAnimation(s,t){const e=this.setAnimationWith(s,Mt.emptyAnimation,!1);return e.mixDuration=t,e.trackEnd=t,e}addEmptyAnimation(s,t,e){e<=0&&(e-=t);const i=this.addAnimationWith(s,Mt.emptyAnimation,!1,e);return i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(s){const t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,i=this.tracks.length;e<i;e++){const r=this.tracks[e];r!=null&&this.setEmptyAnimation(r.trackIndex,s)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(s){return s<this.tracks.length?this.tracks[s]:(Q.ensureArrayCapacity(this.tracks,s+1,null),this.tracks.length=s+1,null)}trackEntry(s,t,e,i){const r=this.trackEntryPool.obtain();return r.trackIndex=s,r.animation=t,r.loop=e,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=t.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=i==null?0:this.data.getMix(i.animation,t),r.mixBlend=j.replace,r}disposeNext(s){let t=s.next;for(;t!=null;)this.queue.dispose(t),t=t.next;s.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();for(let s=0,t=this.tracks.length;s<t;s++){let e=this.tracks[s];if(e!=null){for(;e.mixingFrom!=null;)e=e.mixingFrom;do(e.mixingFrom==null||e.mixBlend!=j.add)&&this.computeHold(e),e=e.mixingTo;while(e!=null)}}}computeHold(s){const t=s.mixingTo,e=s.animation.timelines,i=s.animation.timelines.length,r=Q.setArraySize(s.timelineMode,i);s.timelineHoldMix.length=0;const n=Q.setArraySize(s.timelineHoldMix,i),a=this.propertyIDs;if(t!=null&&t.holdPrevious){for(let o=0;o<i;o++)r[o]=a.add(e[o].getPropertyId())?Mt.HOLD_FIRST:Mt.HOLD_SUBSEQUENT;return}t:for(let o=0;o<i;o++){const h=e[o],l=h.getPropertyId();if(!a.add(l))r[o]=Mt.SUBSEQUENT;else if(t==null||h instanceof po||h instanceof Nc||h instanceof aE||!t.animation.hasTimeline(l))r[o]=Mt.FIRST;else{for(let c=t.mixingTo;c!=null;c=c.mixingTo)if(!c.animation.hasTimeline(l)){if(s.mixDuration>0){r[o]=Mt.HOLD_MIX,n[o]=c;continue t}break}r[o]=Mt.HOLD_FIRST}}}getCurrent(s){return s>=this.tracks.length?null:this.tracks[s]}addListener(s){if(s==null)throw new Error("listener cannot be null.");this.listeners.push(s)}removeListener(s){const t=this.listeners.indexOf(s);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(s,t,e){Mt.deprecatedWarning1||(Mt.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(s,t,e)}addAnimationByName(s,t,e,i){Mt.deprecatedWarning2||(Mt.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(s,t,e,i)}hasAnimation(s){return this.data.skeletonData.findAnimation(s)!==null}hasAnimationByName(s){return Mt.deprecatedWarning3||(Mt.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(s)}};let Ne=Mt;Ne.emptyAnimation=new pe("<empty>",[],0),Ne.SUBSEQUENT=0,Ne.FIRST=1,Ne.HOLD_SUBSEQUENT=2,Ne.HOLD_FIRST=3,Ne.HOLD_MIX=4,Ne.SETUP=1,Ne.CURRENT=2,Ne.deprecatedWarning1=!1,Ne.deprecatedWarning2=!1,Ne.deprecatedWarning3=!1;const Ni=class{constructor(){this.mixBlend=j.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){this.next=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){const s=this.animationEnd-this.animationStart;return s==0?this.animationStart:this.trackTime%s+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(s){this.animationLast=s,this.nextAnimationLast=s}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return Ni.deprecatedWarning1||(Ni.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(s){Ni.deprecatedWarning1||(Ni.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=s}get endTime(){return Ni.deprecatedWarning2||(Ni.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(s){Ni.deprecatedWarning2||(Ni.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=s}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let Uc=Ni;Uc.deprecatedWarning1=!1,Uc.deprecatedWarning2=!1;const Gc=class{constructor(s){this.objects=[],this.drainDisabled=!1,this.animState=s}start(s){this.objects.push(Ee.start),this.objects.push(s),this.animState.animationsChanged=!0}interrupt(s){this.objects.push(Ee.interrupt),this.objects.push(s)}end(s){this.objects.push(Ee.end),this.objects.push(s),this.animState.animationsChanged=!0}dispose(s){this.objects.push(Ee.dispose),this.objects.push(s)}complete(s){this.objects.push(Ee.complete),this.objects.push(s)}event(s,t){this.objects.push(Ee.event),this.objects.push(s),this.objects.push(t)}deprecateStuff(){return Gc.deprecatedWarning1||(Gc.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const s=this.objects,t=this.animState.listeners;for(let e=0;e<s.length;e+=2){const i=s[e],r=s[e+1];switch(i){case Ee.start:r.listener!=null&&r.listener.start&&r.listener.start(r);for(let o=0;o<t.length;o++)t[o].start&&t[o].start(r);r.onStart&&this.deprecateStuff()&&r.onStart(r.trackIndex),this.animState.onStart&&this.deprecateStuff()&&this.deprecateStuff&&this.animState.onStart(r.trackIndex);break;case Ee.interrupt:r.listener!=null&&r.listener.interrupt&&r.listener.interrupt(r);for(let o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(r);break;case Ee.end:r.listener!=null&&r.listener.end&&r.listener.end(r);for(let o=0;o<t.length;o++)t[o].end&&t[o].end(r);r.onEnd&&this.deprecateStuff()&&r.onEnd(r.trackIndex),this.animState.onEnd&&this.deprecateStuff()&&this.animState.onEnd(r.trackIndex);case Ee.dispose:r.listener!=null&&r.listener.dispose&&r.listener.dispose(r);for(let o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(r);this.animState.trackEntryPool.free(r);break;case Ee.complete:r.listener!=null&&r.listener.complete&&r.listener.complete(r);for(let o=0;o<t.length;o++)t[o].complete&&t[o].complete(r);const n=k.toInt(r.loopsCount());r.onComplete&&this.deprecateStuff()&&r.onComplete(r.trackIndex,n),this.animState.onComplete&&this.deprecateStuff()&&this.animState.onComplete(r.trackIndex,n);break;case Ee.event:const a=s[e+++2];r.listener!=null&&r.listener.event&&r.listener.event(r,a);for(let o=0;o<t.length;o++)t[o].event&&t[o].event(r,a);r.onEvent&&this.deprecateStuff()&&r.onEvent(r.trackIndex,a),this.animState.onEvent&&this.deprecateStuff()&&this.animState.onEvent(r.trackIndex,a);break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}};let r_=Gc;r_.deprecatedWarning1=!1;var Ee=(s=>(s[s.start=0]="start",s[s.interrupt=1]="interrupt",s[s.end=2]="end",s[s.dispose=3]="dispose",s[s.complete=4]="complete",s[s.event=5]="event",s))(Ee||{});const Hc=class{constructor(s){if(this.animationToMixTime={},this.defaultMix=0,s==null)throw new Error("skeletonData cannot be null.");this.skeletonData=s}setMix(s,t,e){const i=this.skeletonData.findAnimation(s);if(i==null)throw new Error(`Animation not found: ${s}`);const r=this.skeletonData.findAnimation(t);if(r==null)throw new Error(`Animation not found: ${t}`);this.setMixWith(i,r,e)}setMixByName(s,t,e){Hc.deprecatedWarning1||(Hc.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(s,t,e)}setMixWith(s,t,e){if(s==null)throw new Error("from cannot be null.");if(t==null)throw new Error("to cannot be null.");const i=`${s.name}.${t.name}`;this.animationToMixTime[i]=e}getMix(s,t){const e=`${s.name}.${t.name}`,i=this.animationToMixTime[e];return i===void 0?this.defaultMix:i}};let n_=Hc;n_.deprecatedWarning1=!1;class a_{constructor(t,e,i){if(this.matrix=new gt,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.sorted=!1,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=i,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(t,e,i,r,n,a,o){this.ax=t,this.ay=e,this.arotation=i,this.ascaleX=r,this.ascaleY=n,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;const h=this.parent,l=this.matrix,c=this.skeleton.scaleX,d=-this.skeleton.scaleY;if(h==null){const _=this.skeleton,y=i+90+o;l.a=k.cosDeg(i+a)*r*c,l.c=k.cosDeg(y)*n*c,l.b=k.sinDeg(i+a)*r*d,l.d=k.sinDeg(y)*n*d,l.tx=t*c+_.x,l.ty=e*d+_.y;return}let u=h.matrix.a,f=h.matrix.c,p=h.matrix.b,m=h.matrix.d;switch(l.tx=u*t+f*e+h.matrix.tx,l.ty=p*t+m*e+h.matrix.ty,this.data.transformMode){case se.Normal:{const _=i+90+o,y=k.cosDeg(i+a)*r,v=k.cosDeg(_)*n,g=k.sinDeg(i+a)*r,x=k.sinDeg(_)*n;l.a=u*y+f*g,l.c=u*v+f*x,l.b=p*y+m*g,l.d=p*v+m*x;return}case se.OnlyTranslation:{const _=i+90+o;l.a=k.cosDeg(i+a)*r,l.c=k.cosDeg(_)*n,l.b=k.sinDeg(i+a)*r,l.d=k.sinDeg(_)*n;break}case se.NoRotationOrReflection:{let _=u*u+p*p,y=0;_>1e-4?(_=Math.abs(u*m-f*p)/_,u/=this.skeleton.scaleX,p/=this.skeleton.scaleY,f=p*_,m=u*_,y=Math.atan2(p,u)*k.radDeg):(u=0,p=0,y=90-Math.atan2(m,f)*k.radDeg);const v=i+a-y,g=i+o-y+90,x=k.cosDeg(v)*r,b=k.cosDeg(g)*n,w=k.sinDeg(v)*r,T=k.sinDeg(g)*n;l.a=u*x-f*w,l.c=u*b-f*T,l.b=p*x+m*w,l.d=p*b+m*T;break}case se.NoScale:case se.NoScaleOrReflection:{const _=k.cosDeg(i),y=k.sinDeg(i);let v=(u*_+f*y)/c,g=(p*_+m*y)/d,x=Math.sqrt(v*v+g*g);x>1e-5&&(x=1/x),v*=x,g*=x,x=Math.sqrt(v*v+g*g),this.data.transformMode==se.NoScale&&u*m-f*p<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY>0)&&(x=-x);const b=Math.PI/2+Math.atan2(g,v),w=Math.cos(b)*x,T=Math.sin(b)*x,E=k.cosDeg(a)*r,A=k.cosDeg(90+o)*n,P=k.sinDeg(a)*r,L=k.sinDeg(90+o)*n;l.a=v*E+w*P,l.c=v*A+w*L,l.b=g*E+T*P,l.d=g*A+T*L;break}}l.a*=c,l.c*=c,l.b*=d,l.d*=d}setToSetupPose(){const 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}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*k.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*k.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(t==null){this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*k.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*k.radDeg;return}const i=t.matrix,r=1/(i.a*i.d-i.b*i.c),n=e.tx-i.tx,a=e.ty-i.ty;this.ax=n*i.d*r-a*i.c*r,this.ay=a*i.a*r-n*i.b*r;const o=r*i.d,h=r*i.a,l=r*i.c,c=r*i.b,d=o*e.a-l*e.b,u=o*e.c-l*e.d,f=h*e.b-c*e.a,p=h*e.d-c*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){const m=d*p-u*f;this.ascaleY=m/this.ascaleX,this.ashearY=Math.atan2(d*u+f*p,m)*k.radDeg,this.arotation=Math.atan2(f,d)*k.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+p*p),this.ashearY=0,this.arotation=90-Math.atan2(p,u)*k.radDeg}worldToLocal(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=1/(i*a-r*n),h=t.x-e.tx,l=t.y-e.ty;return t.x=h*a*o-l*r*o,t.y=l*i*o-h*n*o,t}localToWorld(t){const e=this.matrix,i=t.x,r=t.y;return t.x=i*e.a+r*e.c+e.tx,t.y=i*e.b+r*e.d+e.ty,t}worldToLocalRotation(t){const e=k.sinDeg(t),i=k.cosDeg(t),r=this.matrix;return Math.atan2(r.a*e-r.b*i,r.d*i-r.c*e)*k.radDeg}localToWorldRotation(t){const e=k.sinDeg(t),i=k.cosDeg(t),r=this.matrix;return Math.atan2(i*r.b+e*r.d,i*r.a+e*r.c)*k.radDeg}rotateWorld(t){const e=this.matrix,i=e.a,r=e.c,n=e.b,a=e.d,o=k.cosDeg(t),h=k.sinDeg(t);e.a=o*i-h*n,e.c=o*r-h*a,e.b=h*i+o*n,e.d=h*r+o*a,this.appliedValid=!1}}class oE{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){const t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix);break}}apply1(t,e,i,r,n,a,o){t.appliedValid||t.updateAppliedTransform();const h=t.parent.matrix,l=h.a;let c=h.c;const d=h.b;let u=h.d,f=-t.ashearX-t.arotation,p=0,m=0;switch(t.data.transformMode){case se.OnlyTranslation:p=e-t.worldX,m=i-t.worldY;break;case se.NoRotationOrReflection:const v=Math.abs(l*u-c*d)/(l*l+d*d),g=l/t.skeleton.scaleX,x=d/t.skeleton.scaleY;c=-x*v*t.skeleton.scaleX,u=g*v*t.skeleton.scaleY,f+=Math.atan2(x,g)*k.radDeg;default:const b=e-h.tx,w=i-h.ty,T=l*u-c*d;p=(b*u-w*c)/T-t.ax,m=(w*l-b*d)/T-t.ay}f+=Math.atan2(m,p)*k.radDeg,t.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let _=t.ascaleX,y=t.ascaleY;if(r||n){switch(t.data.transformMode){case se.NoScale:case se.NoScaleOrReflection:p=e-t.worldX,m=i-t.worldY}const v=t.data.length*_,g=Math.sqrt(p*p+m*m);if(r&&g<v||n&&g>v&&v>1e-4){const x=(g/v-1)*o+1;_*=x,a&&(y*=x)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,_,y,t.ashearX,t.ashearY)}apply2(t,e,i,r,n,a,o,h){if(h==0){e.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const l=t.ax,c=t.ay;let d=t.ascaleX,u=d,f=t.ascaleY,p=e.ascaleX;const m=t.matrix;let _=0,y=0,v=0;d<0?(d=-d,_=180,v=-1):(_=0,v=1),f<0&&(f=-f,v=-v),p<0?(p=-p,y=180):y=0;const g=e.ax;let x=0,b=0,w=0,T=m.a,E=m.c,A=m.b,P=m.d;const L=Math.abs(d-f)<=1e-4;L?(x=e.ay,b=T*g+E*x+m.tx,w=A*g+P*x+m.ty):(x=0,b=T*g+m.tx,w=A*g+m.ty);const M=t.parent.matrix;T=M.a,E=M.c,A=M.b,P=M.d;const S=1/(T*P-E*A);let C=b-M.tx,R=w-M.ty;const N=(C*P-R*E)*S-l,F=(R*T-C*A)*S-c,B=Math.sqrt(N*N+F*F);let W=e.data.length*p,I,D;if(B<1e-4){this.apply1(t,i,r,!1,a,!1,h),e.updateWorldTransformWith(g,x,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);return}C=i-M.tx,R=r-M.ty;let $=(C*P-R*E)*S-l,Y=(R*T-C*A)*S-c,U=$*$+Y*Y;if(o!=0){o*=d*(p+1)/2;const lt=Math.sqrt(U),vt=lt-B-W*d+o;if(vt>0){let Dt=Math.min(1,vt/(o*2))-1;Dt=(vt-o*(1-Dt*Dt))/lt,$-=Dt*$,Y-=Dt*Y,U=$*$+Y*Y}}t:if(L){W*=d;let lt=(U-B*B-W*W)/(2*B*W);lt<-1?lt=-1:lt>1&&(lt=1,a&&(u*=(Math.sqrt(U)/(B+W)-1)*h+1)),D=Math.acos(lt)*n,T=B+W*lt,E=W*Math.sin(D),I=Math.atan2(Y*T-$*E,$*T+Y*E)}else{T=d*W,E=f*W;const lt=T*T,vt=E*E,Dt=Math.atan2(Y,$);A=vt*B*B+lt*U-lt*vt;const kt=-2*vt*B,_t=vt-lt;if(P=kt*kt-4*_t*A,P>=0){let Dr=Math.sqrt(P);kt<0&&(Dr=-Dr),Dr=-(kt+Dr)/2;const T_=Dr/_t,w_=A/Dr,Br=Math.abs(T_)<Math.abs(w_)?T_:w_;if(Br*Br<=U){R=Math.sqrt(U-Br*Br)*n,I=Dt-Math.atan2(R,Br),D=Math.atan2(R/f,(Br-B)/d);break t}}let Bt=k.PI,wt=B-T,me=wt*wt,Ae=0,cs=0,Mr=B+T,us=Mr*Mr,b_=0;A=-T*B/(lt-vt),A>=-1&&A<=1&&(A=Math.acos(A),C=T*Math.cos(A)+B,R=E*Math.sin(A),P=C*C+R*R,P<me&&(Bt=A,me=P,wt=C,Ae=R),P>us&&(cs=A,us=P,Mr=C,b_=R)),U<=(me+us)/2?(I=Dt-Math.atan2(Ae*n,wt),D=Bt*n):(I=Dt-Math.atan2(b_*n,Mr),D=cs*n)}const rt=Math.atan2(x,g)*v;let dt=t.arotation;I=(I-rt)*k.radDeg+_-dt,I>180?I-=360:I<-180&&(I+=360),t.updateWorldTransformWith(l,c,dt+I*h,u,t.ascaleY,0,0),dt=e.arotation,D=((D+rt)*k.radDeg-e.ashearX)*v+y-dt,D>180?D-=360:D<-180&&(D+=360),e.updateWorldTransformWith(g,x,dt+D*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}var Rr=(s=>(s[s.Length=0]="Length",s[s.Fixed=1]="Fixed",s[s.Percent=2]="Percent",s))(Rr||{});const Vs=class{constructor(s,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,s==null)throw new Error("data cannot be null.");if(t==null)throw new Error("skeleton cannot be null.");this.data=s,this.bones=new Array;for(let e=0,i=s.bones.length;e<i;e++)this.bones.push(t.findBone(s.bones[e].name));this.target=t.findSlot(s.target.name),this.position=s.position,this.spacing=s.spacing,this.rotateMix=s.rotateMix,this.translateMix=s.translateMix}isActive(){return this.active}apply(){this.update()}update(){const s=this.target.getAttachment();if(!(s instanceof An))return;const t=this.rotateMix,e=this.translateMix,i=e>0,r=t>0;if(!i&&!r)return;const n=this.data,a=n.spacingMode,o=a==Rr.Length,h=n.rotateMode,l=h==Gs.Tangent,c=h==Gs.ChainScale,d=this.bones.length,u=l?d:d+1,f=this.bones,p=Q.setArraySize(this.spaces,u);let m=null;const _=this.spacing;if(c||o){c&&(m=Q.setArraySize(this.lengths,d));for(let w=0,T=u-1;w<T;){const E=f[w],A=E.data.length;if(A<Vs.epsilon)c&&(m[w]=0),p[++w]=0;else{const P=A*E.matrix.a,L=A*E.matrix.b,M=Math.sqrt(P*P+L*L);c&&(m[w]=M),p[++w]=(o?A+_:_)*M/A}}}else for(let w=1;w<u;w++)p[w]=_;const y=this.computeWorldPositions(s,u,l,n.positionMode==uo.Percent,a==Rr.Percent);let v=y[0],g=y[1],x=n.offsetRotation,b=!1;if(x==0)b=h==Gs.Chain;else{b=!1;const w=this.target.bone.matrix;x*=w.a*w.d-w.b*w.c>0?k.degRad:-k.degRad}for(let w=0,T=3;w<d;w++,T+=3){const E=f[w],A=E.matrix;A.tx+=(v-A.tx)*e,A.ty+=(g-A.ty)*e;const P=y[T],L=y[T+1],M=P-v,S=L-g;if(c){const C=m[w];if(C!=0){const R=(Math.sqrt(M*M+S*S)/C-1)*t+1;A.a*=R,A.b*=R}}if(v=P,g=L,r){const C=A.a,R=A.c,N=A.b,F=A.d;let B=0,W=0,I=0;if(l&&(l?B=y[T-1]:p[w+1]==0?B=y[T+2]:B=Math.atan2(S,M)),B-=Math.atan2(N,C),b){W=Math.cos(B),I=Math.sin(B);const D=E.data.length;v+=(D*(W*C-I*N)-M)*t,g+=(D*(I*C+W*N)-S)*t}else B+=x;B>k.PI?B-=k.PI2:B<-k.PI&&(B+=k.PI2),B*=t,W=Math.cos(B),I=Math.sin(B),A.a=W*C-I*N,A.c=W*R-I*F,A.b=I*C+W*N,A.d=I*R+W*F}E.appliedValid=!1}}computeWorldPositions(s,t,e,i,r){const n=this.target;let a=this.position;const o=this.spaces,h=Q.setArraySize(this.positions,t*3+2);let l=null;const c=s.closed;let d=s.worldVerticesLength,u=d/6,f=Vs.NONE;if(!s.constantSpeed){const B=s.lengths;u-=c?1:2;const W=B[u];if(i&&(a*=W),r)for(let I=0;I<t;I++)o[I]*=W;l=Q.setArraySize(this.world,8);for(let I=0,D=0,$=0;I<t;I++,D+=3){const Y=o[I];a+=Y;let U=a;if(c)U%=W,U<0&&(U+=W),$=0;else if(U<0){f!=Vs.BEFORE&&(f=Vs.BEFORE,s.computeWorldVertices(n,2,4,l,0,2)),this.addBeforePosition(U,l,0,h,D);continue}else if(U>W){f!=Vs.AFTER&&(f=Vs.AFTER,s.computeWorldVertices(n,d-6,4,l,0,2)),this.addAfterPosition(U-W,l,0,h,D);continue}for(;;$++){const rt=B[$];if(!(U>rt)){if($==0)U/=rt;else{const dt=B[$-1];U=(U-dt)/(rt-dt)}break}}$!=f&&(f=$,c&&$==u?(s.computeWorldVertices(n,d-4,4,l,0,2),s.computeWorldVertices(n,0,4,l,4,2)):s.computeWorldVertices(n,$*6+2,8,l,0,2)),this.addCurvePosition(U,l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],h,D,e||I>0&&Y==0)}return h}c?(d+=2,l=Q.setArraySize(this.world,d),s.computeWorldVertices(n,2,d-4,l,0,2),s.computeWorldVertices(n,0,2,l,d-4,2),l[d-2]=l[0],l[d-1]=l[1]):(u--,d-=4,l=Q.setArraySize(this.world,d),s.computeWorldVertices(n,2,d,l,0,2));const p=Q.setArraySize(this.curves,u);let m=0,_=l[0],y=l[1],v=0,g=0,x=0,b=0,w=0,T=0,E=0,A=0,P=0,L=0,M=0,S=0,C=0,R=0;for(let B=0,W=2;B<u;B++,W+=6)v=l[W],g=l[W+1],x=l[W+2],b=l[W+3],w=l[W+4],T=l[W+5],E=(_-v*2+x)*.1875,A=(y-g*2+b)*.1875,P=((v-x)*3-_+w)*.09375,L=((g-b)*3-y+T)*.09375,M=E*2+P,S=A*2+L,C=(v-_)*.75+E+P*.16666667,R=(g-y)*.75+A+L*.16666667,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,M+=P,S+=L,m+=Math.sqrt(C*C+R*R),C+=M,R+=S,m+=Math.sqrt(C*C+R*R),C+=M+P,R+=S+L,m+=Math.sqrt(C*C+R*R),p[B]=m,_=w,y=T;if(i&&(a*=m),r)for(let B=0;B<t;B++)o[B]*=m;const N=this.segments;let F=0;for(let B=0,W=0,I=0,D=0;B<t;B++,W+=3){const $=o[B];a+=$;let Y=a;if(c)Y%=m,Y<0&&(Y+=m),I=0;else if(Y<0){this.addBeforePosition(Y,l,0,h,W);continue}else if(Y>m){this.addAfterPosition(Y-m,l,d-4,h,W);continue}for(;;I++){const U=p[I];if(!(Y>U)){if(I==0)Y/=U;else{const rt=p[I-1];Y=(Y-rt)/(U-rt)}break}}if(I!=f){f=I;let U=I*6;for(_=l[U],y=l[U+1],v=l[U+2],g=l[U+3],x=l[U+4],b=l[U+5],w=l[U+6],T=l[U+7],E=(_-v*2+x)*.03,A=(y-g*2+b)*.03,P=((v-x)*3-_+w)*.006,L=((g-b)*3-y+T)*.006,M=E*2+P,S=A*2+L,C=(v-_)*.3+E+P*.16666667,R=(g-y)*.3+A+L*.16666667,F=Math.sqrt(C*C+R*R),N[0]=F,U=1;U<8;U++)C+=M,R+=S,M+=P,S+=L,F+=Math.sqrt(C*C+R*R),N[U]=F;C+=M,R+=S,F+=Math.sqrt(C*C+R*R),N[8]=F,C+=M+P,R+=S+L,F+=Math.sqrt(C*C+R*R),N[9]=F,D=0}for(Y*=F;;D++){const U=N[D];if(!(Y>U)){if(D==0)Y/=U;else{const rt=N[D-1];Y=D+(Y-rt)/(U-rt)}break}}this.addCurvePosition(Y*.1,_,y,v,g,x,b,w,T,h,W,e||B>0&&$==0)}return h}addBeforePosition(s,t,e,i,r){const n=t[e],a=t[e+1],o=t[e+2]-n,h=t[e+3]-a,l=Math.atan2(h,o);i[r]=n+s*Math.cos(l),i[r+1]=a+s*Math.sin(l),i[r+2]=l}addAfterPosition(s,t,e,i,r){const n=t[e+2],a=t[e+3],o=n-t[e],h=a-t[e+1],l=Math.atan2(h,o);i[r]=n+s*Math.cos(l),i[r+1]=a+s*Math.sin(l),i[r+2]=l}addCurvePosition(s,t,e,i,r,n,a,o,h,l,c,d){(s==0||isNaN(s))&&(s=1e-4);const u=s*s,f=u*s,p=1-s,m=p*p,_=m*p,y=p*s,v=y*3,g=p*v,x=v*s,b=t*_+i*g+n*x+o*f,w=e*_+r*g+a*x+h*f;l[c]=b,l[c+1]=w,d&&(l[c+2]=Math.atan2(w-(e*m+r*y*2+a*u),b-(t*m+i*y*2+n*u)))}};let Sn=Vs;Sn.NONE=-1,Sn.BEFORE=-2,Sn.AFTER=-3,Sn.epsilon=1e-5;class hE{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new iE,this.active=!1,t==null)throw new Error("data cannot be null.");if(e==null)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let i=0;i<t.bones.length;i++)this.bones.push(e.findBone(t.bones[i].name));this.target=e.findBone(t.target.name)}isActive(){return this.active}apply(){this.update()}update(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()}applyAbsoluteWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?k.degRad:-k.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,_=p.length;m<_;m++){const y=p[m];let v=!1;const g=y.matrix;if(t!=0){const x=g.a,b=g.c,w=g.b,T=g.d;let E=Math.atan2(l,o)-Math.atan2(w,x)+u;E>k.PI?E-=k.PI2:E<-k.PI&&(E+=k.PI2),E*=t;const A=Math.cos(E),P=Math.sin(E);g.a=A*x-P*w,g.c=A*b-P*T,g.b=P*x+A*w,g.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.tx+=(x.x-g.tx)*e,g.ty+=(x.y-g.ty)*e,v=!0}if(i>0){let x=Math.sqrt(g.a*g.a+g.b*g.b),b=Math.sqrt(o*o+l*l);x>1e-5&&(x=(x+(b-x+this.data.offsetScaleX)*i)/x),g.a*=x,g.b*=x,x=Math.sqrt(g.c*g.c+g.d*g.d),b=Math.sqrt(h*h+c*c),x>1e-5&&(x=(x+(b-x+this.data.offsetScaleY)*i)/x),g.c*=x,g.d*=x,v=!0}if(r>0){const x=g.c,b=g.d,w=Math.atan2(b,x);let T=Math.atan2(c,h)-Math.atan2(l,o)-(w-Math.atan2(g.b,g.a));T>k.PI?T-=k.PI2:T<-k.PI&&(T+=k.PI2),T=w+(T+f)*r;const E=Math.sqrt(x*x+b*b);g.c=Math.cos(T)*E,g.d=Math.sin(T)*E,v=!0}v&&(y.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target,a=n.matrix,o=a.a,h=a.c,l=a.b,c=a.d,d=o*c-h*l>0?k.degRad:-k.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,p=this.bones;for(let m=0,_=p.length;m<_;m++){const y=p[m];let v=!1;const g=y.matrix;if(t!=0){const x=g.a,b=g.c,w=g.b,T=g.d;let E=Math.atan2(l,o)+u;E>k.PI?E-=k.PI2:E<-k.PI&&(E+=k.PI2),E*=t;const A=Math.cos(E),P=Math.sin(E);g.a=A*x-P*w,g.c=A*b-P*T,g.b=P*x+A*w,g.d=P*b+A*T,v=!0}if(e!=0){const x=this.temp;n.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),g.tx+=x.x*e,g.ty+=x.y*e,v=!0}if(i>0){let x=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleX)*i+1;g.a*=x,g.b*=x,x=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleY)*i+1,g.c*=x,g.d*=x,v=!0}if(r>0){let x=Math.atan2(c,h)-Math.atan2(l,o);x>k.PI?x-=k.PI2:x<-k.PI&&(x+=k.PI2);const b=g.c,w=g.d;x=Math.atan2(w,b)+(x-k.PI/2+f)*r;const T=Math.sqrt(b*b+w*w);g.c=Math.cos(x)*T,g.d=Math.sin(x)*T,v=!0}v&&(y.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;if(t!=0){let _=n.arotation-c+this.data.offsetRotation;_-=(16384-(16384.499999999996-_/360|0))*360,c+=_*t}let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax-d+this.data.offsetX)*e,u+=(n.ay-u+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f=(f+(n.ascaleX-f+this.data.offsetScaleX)*i)/f),p>1e-5&&(p=(p+(n.ascaleY-p+this.data.offsetScaleY)*i)/p));const m=l.ashearY;if(r>0){let _=n.ashearY-m+this.data.offsetShearY;_-=(16384-(16384.499999999996-_/360|0))*360,l.shearY+=_*r}l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,i=this.scaleMix,r=this.shearMix,n=this.target;n.appliedValid||n.updateAppliedTransform();const a=this.bones;for(let o=0,h=a.length;o<h;o++){const l=a[o];l.appliedValid||l.updateAppliedTransform();let c=l.arotation;t!=0&&(c+=(n.arotation+this.data.offsetRotation)*t);let d=l.ax,u=l.ay;e!=0&&(d+=(n.ax+this.data.offsetX)*e,u+=(n.ay+this.data.offsetY)*e);let f=l.ascaleX,p=l.ascaleY;i>0&&(f>1e-5&&(f*=(n.ascaleX-1+this.data.offsetScaleX)*i+1),p>1e-5&&(p*=(n.ascaleY-1+this.data.offsetScaleY)*i+1));let m=l.ashearY;r>0&&(m+=(n.ashearY+this.data.offsetShearY)*r),l.updateWorldTransformWith(d,u,c,f,p,l.ashearX,m)}}}const Cn=class{constructor(s){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,s==null)throw new Error("data cannot be null.");this.data=s,this.bones=new Array;for(let t=0;t<s.bones.length;t++){const e=s.bones[t];let i;if(e.parent==null)i=new a_(e,this,null);else{const r=this.bones[e.parent.index];i=new a_(e,this,r),r.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<s.slots.length;t++){const e=s.slots[t],i=this.bones[e.boneData.index],r=new s_(e,i);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let t=0;t<s.ikConstraints.length;t++){const e=s.ikConstraints[t];this.ikConstraints.push(new oE(e,this))}this.transformConstraints=new Array;for(let t=0;t<s.transformConstraints.length;t++){const e=s.transformConstraints[t];this.transformConstraints.push(new hE(e,this))}this.pathConstraints=new Array;for(let t=0;t<s.pathConstraints.length;t++){const e=s.pathConstraints[t];this.pathConstraints.push(new Sn(e,this))}this.color=new we(1,1,1,1),this.updateCache()}updateCache(){const s=this._updateCache;s.length=0,this.updateCacheReset.length=0;const t=this.bones;for(let l=0,c=t.length;l<c;l++){const d=t[l];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin!=null){const l=this.skin.bones;for(let c=0,d=this.skin.bones.length;c<d;c++){let u=this.bones[l[c].index];do u.sorted=!1,u.active=!0,u=u.parent;while(u!=null)}}const e=this.ikConstraints,i=this.transformConstraints,r=this.pathConstraints,n=e.length,a=i.length,o=r.length,h=n+a+o;t:for(let l=0;l<h;l++){for(let c=0;c<n;c++){const d=e[c];if(d.data.order==l){this.sortIkConstraint(d);continue t}}for(let c=0;c<a;c++){const d=i[c];if(d.data.order==l){this.sortTransformConstraint(d);continue t}}for(let c=0;c<o;c++){const d=r[c];if(d.data.order==l){this.sortPathConstraint(d);continue t}}}for(let l=0,c=t.length;l<c;l++)this.sortBone(t[l])}sortIkConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target;this.sortBone(t);const e=s.bones,i=e[0];if(this.sortBone(i),e.length>1){const r=e[e.length-1];this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}this._updateCache.push(s),this.sortReset(i.children),e[e.length-1].sorted=!0}sortPathConstraint(s){if(s.active=s.target.bone.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;const t=s.target,e=t.data.index,i=t.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,e,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,e,i);for(let o=0,h=this.data.skins.length;o<h;o++)this.sortPathConstraintAttachment(this.data.skins[o],e,i);const r=t.getAttachment();r instanceof An&&this.sortPathConstraintAttachmentWith(r,i);const n=s.bones,a=n.length;for(let o=0;o<a;o++)this.sortBone(n[o]);this._updateCache.push(s);for(let o=0;o<a;o++)this.sortReset(n[o].children);for(let o=0;o<a;o++)n[o].sorted=!0}sortTransformConstraint(s){if(s.active=s.target.isActive()&&(!s.data.skinRequired||this.skin!=null&&Q.contains(this.skin.constraints,s.data,!0)),!s.active)return;this.sortBone(s.target);const t=s.bones,e=t.length;if(s.data.local)for(let i=0;i<e;i++){const r=t[i];this.sortBone(r.parent),this._updateCache.indexOf(r)>-1||this.updateCacheReset.push(r)}else for(let i=0;i<e;i++)this.sortBone(t[i]);this._updateCache.push(s);for(let i=0;i<e;i++)this.sortReset(t[i].children);for(let i=0;i<e;i++)t[i].sorted=!0}sortPathConstraintAttachment(s,t,e){const i=s.attachments[t];if(i)for(const r in i)this.sortPathConstraintAttachmentWith(i[r],e)}sortPathConstraintAttachmentWith(s,t){if(!(s instanceof An))return;const e=s.bones;if(e==null)this.sortBone(t);else{const i=this.bones;let r=0;for(;r<e.length;){const n=e[r++];for(let a=r+n;r<a;r++){const o=e[r];this.sortBone(i[o])}}}}sortBone(s){if(s.sorted)return;const t=s.parent;t!=null&&this.sortBone(t),s.sorted=!0,this._updateCache.push(s)}sortReset(s){for(let t=0,e=s.length;t<e;t++){const i=s[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(){const s=this.updateCacheReset;for(let e=0,i=s.length;e<i;e++){const r=s[e];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}const t=this._updateCache;for(let e=0,i=t.length;e<i;e++)t[e].update()}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){const s=this.bones;for(let r=0,n=s.length;r<n;r++)s[r].setToSetupPose();const t=this.ikConstraints;for(let r=0,n=t.length;r<n;r++){const a=t[r];a.mix=a.data.mix,a.softness=a.data.softness,a.bendDirection=a.data.bendDirection,a.compress=a.data.compress,a.stretch=a.data.stretch}const e=this.transformConstraints;for(let r=0,n=e.length;r<n;r++){const a=e[r],o=a.data;a.rotateMix=o.rotateMix,a.translateMix=o.translateMix,a.scaleMix=o.scaleMix,a.shearMix=o.shearMix}const i=this.pathConstraints;for(let r=0,n=i.length;r<n;r++){const a=i[r],o=a.data;a.position=o.position,a.spacing=o.spacing,a.rotateMix=o.rotateMix,a.translateMix=o.translateMix}}setSlotsToSetupPose(){const s=this.slots;Q.arrayCopy(s,0,this.drawOrder,0,s.length);for(let t=0,e=s.length;t<e;t++)s[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findBoneIndex(s){if(s==null)throw new Error("boneName cannot be null.");const t=this.bones;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}findSlot(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findSlotIndex(s){if(s==null)throw new Error("slotName cannot be null.");const t=this.slots;for(let e=0,i=t.length;e<i;e++)if(t[e].data.name==s)return e;return-1}setSkinByName(s){const t=this.data.findSkin(s);if(t==null)throw new Error(`Skin not found: ${s}`);this.setSkin(t)}setSkin(s){if(s!=this.skin){if(s!=null)if(this.skin!=null)s.attachAll(this,this.skin);else{const t=this.slots;for(let e=0,i=t.length;e<i;e++){const r=t[e],n=r.data.attachmentName;if(n!=null){const a=s.getAttachment(e,n);a!=null&&r.setAttachment(a)}}}this.skin=s,this.updateCache()}}getAttachmentByName(s,t){return this.getAttachment(this.data.findSlotIndex(s),t)}getAttachment(s,t){if(t==null)throw new Error("attachmentName cannot be null.");if(this.skin!=null){const e=this.skin.getAttachment(s,t);if(e!=null)return e}return this.data.defaultSkin!=null?this.data.defaultSkin.getAttachment(s,t):null}setAttachment(s,t){if(s==null)throw new Error("slotName cannot be null.");const e=this.slots;for(let i=0,r=e.length;i<r;i++){const n=e[i];if(n.data.name==s){let a=null;if(t!=null&&(a=this.getAttachment(i,t),a==null))throw new Error(`Attachment not found: ${t}, for slot: ${s}`);n.setAttachment(a);return}}throw new Error(`Slot not found: ${s}`)}findIkConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findTransformConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}findPathConstraint(s){if(s==null)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let e=0,i=t.length;e<i;e++){const r=t[e];if(r.data.name==s)return r}return null}getBounds(s,t,e=new Array(2)){if(s==null)throw new Error("offset cannot be null.");if(t==null)throw new Error("size cannot be null.");const i=this.drawOrder;let r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let h=0,l=i.length;h<l;h++){const c=i[h];if(!c.bone.active)continue;let d=0,u=null;const f=c.getAttachment();if(f instanceof et)d=8,u=Q.setArraySize(e,d,0),f.computeWorldVertices(c.bone,u,0,2);else if(f instanceof fo){const p=f;d=p.worldVerticesLength,u=Q.setArraySize(e,d,0),p.computeWorldVertices(c,0,d,u,0,2)}if(u!=null)for(let p=0,m=u.length;p<m;p+=2){const _=u[p],y=u[p+1];r=Math.min(r,_),n=Math.min(n,y),a=Math.max(a,_),o=Math.max(o,y)}}s.set(r,n),t.set(a-r,o-n)}update(s){this.time+=s}get flipX(){return this.scaleX==-1}set flipX(s){Cn.deprecatedWarning1||(Cn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleX=s?1:-1}get flipY(){return this.scaleY==-1}set flipY(s){Cn.deprecatedWarning1||(Cn.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY")),this.scaleY=s?1:-1}};let o_=Cn;o_.deprecatedWarning1=!1,se.Normal,se.OnlyTranslation,se.NoRotationOrReflection,se.NoScale,se.NoScaleOrReflection,uo.Fixed,uo.Percent,Rr.Length,Rr.Fixed,Rr.Percent,Gs.Tangent,Gs.Chain,Gs.ChainScale,K.NORMAL,K.ADD,K.MULTIPLY,K.SCREEN;class lE extends Lc{createSkeleton(t){this.skeleton=new o_(t),this.skeleton.updateWorldTransform(),this.stateData=new n_(t),this.state=new Ne(this.stateData)}}class cE extends lE{constructor(t,e){const{followPointList:i,visible:r=!1}=e||{};let n;typeof t=="string"?n=qi.get(t).spineData:n=t.spineData,super(n),this._followDots=[],this._isStart=!1,this.visible=r,this.autoUpdate=!1,i!=null&&i.length&&(i==null||i.forEach(a=>{a.follow.alpha=0,this._followDots.push({point:this.skeleton.findBone(a.boneName),follow:a.follow,onUpdate:a.onUpdate,angleFollow:a.angleFollow||!1,scaleFollow:a.scaleFollow||!0})})),this._loopFn=this._loop.bind(this),ft.system.add(this._loopFn)}setAnimation(t="animation",e=!1){return new Promise(i=>{this.visible=!0,this.state.setAnimation(0,t,e).listener={complete:()=>{i()}}})}addAnimation(t="animation",e=!1,i=0){return new Promise(r=>{this.visible=!0,this.state.addAnimation(0,t,e,i).listener={complete:()=>{r()}}})}setSkin(t){this.skeleton.setSkinByName(t)}destroyAll(){ft.system.remove(this._loopFn),this.destroy()}_loop(){this.update(ft.system.deltaMS/1e3),this._updateFollowPoint()}_updateFollowPoint(){this._followDots.length!==0&&(this._followDots.forEach(t=>{const{worldX:e,worldY:i}=t.point,r=t.point.getWorldRotationX()*(Math.PI/180),n=t.point.getWorldScaleX(),a=t.point.getWorldScaleY();t.onUpdate?t.onUpdate({x:e,y:i,rotate:r,scaleX:n,scaleY:a}):(t.angleFollow&&(t.follow.rotation=r),t.scaleFollow&&t.follow.scale.set(n,a),t.follow.position.set(e+1920/2-t.follow.width/2,i+1080/2-t.follow.height/2))}),this._isStart||(this._isStart=!0,this._followDots.forEach(t=>{ct.to(t.follow,{alpha:1,duration:.25,delay:.15})})))}}const Ws=(s,t,e,i=!1)=>{s.cursor="pointer",s.eventMode="static";const r=n=>{n.button!==2&&e(n)};i?s.once(t,r):s.on(t,r)};class uE extends bt{constructor(t){super(),this.disabled=!1;const{texture:e,hoverTexture:i,tintColor:r,hoverTintColor:n="#fff",disabledColor:a="#999"}=t;this._texture=e,this._hoverTexture=i,this._tintColor=r,this._disabledColor=a,this._btn=new _e(e),this.addChild(this._btn),this._btn.anchor.set(.5),r&&(this._btn.tint=r),Ws(this._btn,"pointerenter",()=>{this.disabled||(this._btn.tint=n,this._hoverTexture&&(this._btn._texture=this._hoverTexture))}),Ws(this._btn,"pointerleave",()=>{this.disabled||(this._btn._texture=this._texture,r&&(this._btn.tint=r))})}toggleTexture(t,e){this._texture=t,this._hoverTexture=e,this._btn._texture=e}setDisabled(t){this.disabled=t,this._btn.tint=t?this._disabledColor:this._tintColor||"#fff",this._btn.texture=this._texture}}class dE extends Tn{constructor(t){const{sprite:e,onClick:i}=t;super(e.width,e.height),this.addChild(e),e.anchor.set(.5),e.x=e.width/2,e.y=e.height/2,Ws(this,"pointerenter",()=>{ct.to(e,{duration:.25,rotation:180*(Math.PI/180)})}),Ws(this,"pointerleave",()=>{e.alpha=1,ct.to(e,{duration:.25,rotation:0})}),Ws(this,"pointerdown",()=>{e.alpha=.5}),Ws(this,"pointerup",()=>{i()})}}class fE extends bt{constructor(t){super(),this._maskUI=new lc({bgColor:"#000",width:1080,height:1920}),this.addChild(this._maskUI),this._maskUI.alpha=0,this._maskUI.eventMode="static",this._drawerContainer=t,this.addChild(this._drawerContainer),this._drawerContainer.y=this._maskUI.height,ct.to(this._maskUI,{duration:.25,alpha:.5}),ct.to(this._drawerContainer,{duration:.25,ease:"power1.out",y:this._maskUI.height-this._drawerContainer.height})}async close(){ct.to(this._drawerContainer,{duration:.25,y:this._maskUI.height}),await ct.to(this._maskUI,{duration:.25,delay:.125,alpha:0})}}class pE extends bt{constructor(t){super(),this.COLLECT_TIME=5*1e3,this._nowTime=0,this._lastTime=0,this._drawCount=0,this._maxDrawCount=0,this._tempMaxDrawCount=0,this._lastCollectTime=0,this._paramTxts=[];for(let e=0;e<3;e++){const i=new Fc({text:"",fontWeight:"bold",fontSize:36,shadow:["#000",45,3,5],fontColor:"#fff"});this._paramTxts[e]=i,i.x=0,i.y=i.height*e,this.addChild(i),i.alpha=.75}this._renderer=t.renderer,this._drawElements=this._renderer.gl.drawElements,this.init()}init(){this._renderer.gl.drawElements=(...t)=>{this._drawElements.call(this._renderer.gl,...t),this._drawCount++},ft.shared.add(()=>{const t=ft.system.FPS;this._nowTime=performance.now(),this._nowTime-this._lastTime>=100&&(this._setTxtInfo(0,Math.floor(t).toFixed(0)),this._lastTime=this._nowTime),this._nowTime-this._lastCollectTime<this.COLLECT_TIME?this._tempMaxDrawCount<this._drawCount&&(this._tempMaxDrawCount=this._drawCount):(this._maxDrawCount=this._tempMaxDrawCount,this._tempMaxDrawCount=0,this._lastCollectTime=this._nowTime),this._setTxtInfo(1,this._drawCount),this._setTxtInfo(2,this._maxDrawCount),this._drawCount=0},zi.UTILITY)}_setTxtInfo(t,e){const i=a=>{this._paramTxts[t].style.fill="#fff",a<=30&&(this._paramTxts[t].style.fill="yellow"),a<=20&&(this._paramTxts[t].style.fill="red")},r=a=>{this._paramTxts[t].style.fill="#fff",a>=75&&(this._paramTxts[t].style.fill="yellow"),a>=100&&(this._paramTxts[t].style.fill="red")},n=[()=>(i(e),`Fps:${e}`),()=>(r(e),`Draw Call:${e}`),()=>(r(e),`Max Draw Call:${e}`)];this._paramTxts[t].text=n[t]()}}class mE extends bt{constructor(t){super();const{bgWidth:e,bgHeight:i,barWidth:r,barHeight:n,bgTexture:a,barTexture:o}=t,h=new _e(a);this.addChild(h),this._progressBar=new _e(o),this.addChild(this._progressBar),this._progressBar.x=(e-r)/2,this._progressBar.y=(i-n)/2;const l=new li;l.beginFill(16777215),l.drawRect(0,0,0,this._progressBar.height),l.endFill(),this._progressBar.addChild(l),this._progressBar.mask=l,this._maskGraphics=l}setProgress(t){const e=Math.max(0,Math.min(1,t));this._maskGraphics.clear(),this._maskGraphics.beginFill(16777215),this._maskGraphics.drawRect(0,0,this._progressBar.width*e,this._progressBar.height),this._maskGraphics.endFill()}}class _E extends Tn{constructor(t){const{width:e,height:i,scrollContent:r,bottomMargin:n=50}=t;if(super(e,i),this._startY=0,this._velocity=0,this._startTime=0,this._startPosition=0,this._scrollSpeed=200,this._isDragging=!1,this._scrollContent=r,this._content=new bt,this.addChild(this._content),this._content.addChild(this._scrollContent),n>0){const a=new _e;this._content.addChild(a),a.y=this._content.height+n}this._maskGraphics=new li,this.addChild(this._maskGraphics),this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,e,i),this._maskGraphics.endFill(),this.mask=this._maskGraphics,this.eventMode="static",this.on("pointerdown",this._onDragStart,this),this.on("pointermove",this._onDragMove,this),this.on("pointerup",this._onDragEnd,this),this.on("pointerupoutside",this._onDragEnd,this),this.on("wheel",this._onWheelScroll,this)}setDimensions(t,e){this._maskGraphics.clear(),this._maskGraphics.beginFill(0),this._maskGraphics.drawRect(0,0,t,e),this._maskGraphics.endFill(),this.setSize(t,e)}scrollToTop(){this._content.y=0}addContent(t){this._scrollContent.addChild(t)}_onDragStart(t){if(this._content.height<=this._maskGraphics.height)return;const e=t.getLocalPosition(this);this._startY=e.y-this._content.y,this._isDragging=!0,this._velocity=0,this._startTime=Date.now(),this._startPosition=this._content.y,ct.killTweensOf(this._content)}_onDragMove(t){if(this._isDragging){const i=t.data.getLocalPosition(this).y-this._startY;this._content.y=i}}_onDragEnd(){this._isDragging=!1;const e=Date.now()-this._startTime;e<250?(this._velocity=(this._content.y-this._startPosition)/e,this._applyInertia()):this._velocity=0,this._limitScrollRange()}_onWheelScroll(t){if(this._content.height<=this._maskGraphics.height)return;let e=this._content.y-t.deltaY*(this._scrollSpeed/100);e>0?e=0:Math.abs(e)>=this._content.height-this._maskGraphics.height&&(e=-(this._content.height-this._maskGraphics.height)),ct.to(this._content,{duration:.25,ease:"power1.out",y:e})}_applyInertia(){ct.to(this._content,{y:this._content.y+this._velocity*250,duration:.5,ease:"power1.out",onUpdate:this._limitScrollRange.bind(this)})}_limitScrollRange(){if(this._content.y>0)ct.to(this._content,{duration:.75,y:0,ease:"elastic.out"});else if(Math.abs(this._content.y)>=this._content.height-this._maskGraphics.height)if(this._content.height>this._maskGraphics.height){const t=-(this._content.height-this._maskGraphics.height);ct.to(this._content,{duration:.75,y:t,ease:"elastic.out"})}else ct.to(this._content,{duration:.25,y:0})}}class gE extends Tn{constructor(t){const{width:e,height:i,content:r,slideCallback:n,scrollCallback:a,pageNum:o,pageHeight:h}=t;super(e,i),this._currentIndex=0,this._scrollHeight=0,this._slideHeight=0,this._startY=0,this._offsetY=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1;const l=new li;l.beginFill(16777215),l.drawRect(0,0,this.width,this.height),l.endFill(),this.addChild(l),this.mask=l,this._scrollHeight=i,this._slideHeight=h,this._slideArea=r,this._slideCallback=n,this._scrollCallback=a,this._pageNum=o-1,this.addChild(this._slideArea),this._slideArea.x=e/2,this._slideArea.y=this._scrollHeight/2,this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}updatePosition(t,e){this._slideArea.y=t,this._currentIndex=e}slideTo(t,e=!0){var i;t<0?(ct.to(this._slideArea,{y:this._scrollHeight/2,duration:.25,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=0):t>this._pageNum?(ct.to(this._slideArea,{y:-this._pageNum*this._slideHeight+this._scrollHeight/2,duration:.5,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}}),this._currentIndex=this._pageNum):(this._currentIndex=t,ct.to(this._slideArea,{y:-this._currentIndex*this._slideHeight+this._scrollHeight/2,duration:e?.25:.01,onUpdate:()=>{var r;(r=this._scrollCallback)==null||r.call(this,this._slideArea.y,this._currentIndex)}})),(i=this._slideCallback)==null||i.call(this,this._currentIndex)}_onDragStart(t){this._isDragging=!0,this._startY=t.data.global.y,this._offsetY=this._slideArea.y,ct.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){var i;if(!this._isDragging)return;const e=t.pageY-this._startY;this._slideArea.y=this._offsetY+e,(i=this._scrollCallback)==null||i.call(this,this._slideArea.y,this._currentIndex)}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startY-t.pageY,r=Math.abs(i)/e,n=.275,a=this._slideHeight/2,o=Math.round(i/this._slideHeight);(Math.abs(i)>a||r>n)&&(this._currentIndex+=o),this._currentIndex<0?this._currentIndex=0:this._currentIndex>this._pageNum&&(this._currentIndex=this._pageNum),this.slideTo(this._currentIndex)}}const h_=s=>{const t=new li;return t.beginFill(16777215),t.drawRect(0,0,s.width,s.height),t.endFill(),s.addChild(t),s.mask=t,t};class yE extends Tn{constructor(t,e,i,r){super(t,e),this._currentIndex=0,this._slideWidth=0,this._startX=0,this._offsetX=0,this._pageNum=0,this._startTime=new Date().getTime(),this._isDragging=!1,h_(this),this._slideWidth=t,this._slideArea=i,this.slideCallback=r,this._pageNum=Math.floor(i.width/this._slideWidth)-1,this.addChild(i),this.eventMode="static",this.cursor="pointer",this.on("pointerdown",this._onDragStart),window.addEventListener("pointermove",this._onDragMove.bind(this)),window.addEventListener("pointerup",this._onDragEnd.bind(this))}prev(){this._slideTo(this._currentIndex-1)}next(){this._slideTo(this._currentIndex+1)}_slideTo(t){t<0?(ct.to(this._slideArea,{x:0,duration:.25}),this._currentIndex=0):t>this._pageNum?(ct.to(this._slideArea,{x:-this._pageNum*this._slideWidth,duration:.5}),this._currentIndex=this._pageNum):(this._currentIndex=t,ct.to(this._slideArea,{x:-this._currentIndex*this._slideWidth,duration:.25})),this.slideCallback(this._currentIndex,this._pageNum)}_onDragStart(t){this._isDragging=!0,this._startX=t.global.x,this._offsetX=this._slideArea.x,ct.killTweensOf(this._slideArea),this._startTime=new Date().getTime()}_onDragMove(t){if(!this._isDragging)return;const e=t.pageX-this._startX;this._slideArea.x=this._offsetX+e}_onDragEnd(t){if(!this._isDragging)return;this._isDragging=!1;const e=new Date().getTime()-this._startTime,i=this._startX-t.pageX,r=Math.abs(i)/e,n=this._slideWidth/2,a=.275;(Math.abs(i)>n||r>a)&&(i>0?this._currentIndex++:this._currentIndex--),this._slideTo(this._currentIndex)}}class xE{constructor(t,e){this._currentIndex=0,this._numsLength=0,this._isDown=!1,this._onChange=e,this._numsLength=t,window.addEventListener("pointerup",()=>{this._isDown&&this._up()})}down(t){this._isDown=!0,this._handleChange(t),this._timerId=setTimeout(()=>{this._isDown&&(this._intervalId=setInterval(()=>{this._handleChange(t)},100))},100)}updateIndex(t){this._currentIndex=t}_up(){this._isDown=!1,clearTimeout(this._timerId),clearInterval(this._intervalId)}_handleChange(t){t==="add"?this._currentIndex<this._numsLength-1&&(this._currentIndex++,this._onChange(this._currentIndex)):t==="sub"&&this._currentIndex>0&&(this._currentIndex--,this._onChange(this._currentIndex))}}class vE{constructor(t){this._betAmountListLength=0;const{initialBetIndex:e,betAmountListLength:i,onAmountIndex:r,onDisabled:n}=t;this.onAmountIndex=r,this.onDisabled=n,this._betAmountListLength=i,this._baseNumSteper=new xE(i,a=>{this.onAmountIndex(a),this.minMaxUpdateIndex(a)}),this.minMaxUpdateIndex(e),this._baseNumSteper.updateIndex(e)}min(){this.minMaxUpdateIndex(0),this.onAmountIndex(0)}max(){const t=this._betAmountListLength-1;this.minMaxUpdateIndex(t),this.onAmountIndex(t)}sub(){this._baseNumSteper.down("sub")}add(){this._baseNumSteper.down("add")}minMaxUpdateIndex(t){t===0?this.onDisabled("min"):t===this._betAmountListLength-1?this.onDisabled("max"):this.onDisabled(),this._baseNumSteper.updateIndex(t)}}const l_=(s,t,e)=>{const i=t/s.width*s.scale.x,r=e?e/s.height*s.scale.y:i,n=Math.min(i,r);s.scale.set(n>1?1:n)};class bE extends bt{constructor(t){super();const{data:e,cellWidth:i=130,cellHeight:r=100,fontColor:n="#B4B4B8",fontSize:a=24,lineWidth:o=3,lineColor:h="#B4B4B8"}=t;this._data=e,this._rows=e.length,this._cols=e[0].length,this._cellWidth=i,this._cellHeight=r,this._fontColor=n,this._fontSize=a,this._lineWidth=o,this._lineColor=h,this._drawTable(),this.fillNumbers()}_drawTable(){const t=this._cellWidth*this._cols,e=this._cellHeight*this._rows,i=new li;i.lineStyle(this._lineWidth,this._lineColor),i.drawRect(0,0,t,e);for(let r=1;r<this._rows;r++)i.moveTo(0,r*this._cellHeight),i.lineTo(t,r*this._cellHeight);for(let r=1;r<this._cols;r++)i.moveTo(r*this._cellWidth,0),i.lineTo(r*this._cellWidth,e);this.addChild(i)}fillNumbers(){for(let t=0;t<this._rows;t++)for(let e=0;e<this._cols;e++){const i=this._data[t][e];this._createNumberText(i,e,t)}}_createNumberText(t,e,i){const r=new Va(t.toString(),{_fontSize:this._fontSize,fill:this._fontColor}),n=e*this._cellWidth+this._cellWidth/2,a=i*this._cellHeight+this._cellHeight/2;this.addChild(r),r.anchor.set(.5),r.position.set(n,a),l_(r,this._cellWidth*.9)}}let c_;function TE(s){return c_=s,s}function Pn(){return c_}let wE=0;const Vc=class extends Je{constructor(s){super(),this.id=wE++,this.init(s)}set(s,t){if(this[s]===void 0)throw new Error(`Property with name ${s} does not exist.`);switch(s){case"speed":this.speed=t;break;case"volume":this.volume=t;break;case"paused":this.paused=t;break;case"loop":this.loop=t;break;case"muted":this.muted=t;break}return this}get progress(){const{currentTime:s}=this._source;return s/this._duration}get paused(){return this._paused}set paused(s){this._paused=s,this.refreshPaused()}_onPlay(){this._playing=!0}_onPause(){this._playing=!1}init(s){this._playing=!1,this._duration=s.source.duration;const t=this._source=s.source.cloneNode(!1);t.src=s.parent.url,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),s.context.on("refresh",this.refresh,this),s.context.on("refreshPaused",this.refreshPaused,this),this._media=s}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())}stop(){this._internalStop(),this._source&&this.emit("stop")}get speed(){return this._speed}set speed(s){this._speed=s,this.refresh()}get volume(){return this._volume}set volume(s){this._volume=s,this.refresh()}get loop(){return this._loop}set loop(s){this._loop=s,this.refresh()}get muted(){return this._muted}set muted(s){this._muted=s,this.refresh()}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(s){console.warn("HTML Audio does not support filters")}refresh(){const s=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;const e=s.volume*(s.muted?0:1),i=t.volume*(t.muted?0:1),r=this._volume*(this._muted?0:1);this._source.volume=r*e*i,this._source.playbackRate=this._speed*s.speed*t.speed}refreshPaused(){const s=this._media.context,t=this._media.parent,e=this._paused||t.paused||s.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",e))}play(s){const{start:t,end:e,speed:i,loop:r,volume:n,muted:a}=s;e&&console.assert(e>t,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!r,this._muted=a,this.refresh(),this.loop&&e!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=!1),this._start=t,this._end=e||this._duration,this._start=Math.max(0,this._start-Vc.PADDING),this._end=Math.min(this._end+Vc.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t,this._duration),ft.shared.add(this._onUpdate,this))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete()}_onComplete(){ft.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)}destroy(){ft.shared.remove(this._onUpdate,this),this.removeAllListeners();const s=this._source;s&&(s.onended=null,s.onplay=null,s.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)}toString(){return`[HTMLAudioInstance id=${this.id}]`}};let u_=Vc;u_.PADDING=.1;class EE extends Je{init(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)}create(){return new u_(this)}get isPlayable(){return!!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(t){console.warn("HTML Audio does not support filters")}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)}get source(){return this._source}load(t){const e=this._source,i=this.parent;if(e.readyState===4){i.isLoaded=!0;const h=i.autoPlayStart();t&&setTimeout(()=>{t(null,i,h)},0);return}if(!i.url){t(new Error("sound.url or sound.source must be set"));return}e.src=i.url;const r=()=>{o(),i.isLoaded=!0;const h=i.autoPlayStart();t&&t(null,i,h)},n=()=>{o(),t&&t(new Error("Sound loading has been aborted"))},a=()=>{o();const h=`Failed to load audio element (code: ${e.error.code})`;t?t(new Error(h)):console.error(h)},o=()=>{e.removeEventListener("canplaythrough",r),e.removeEventListener("load",r),e.removeEventListener("abort",n),e.removeEventListener("error",a)};e.addEventListener("canplaythrough",r,!1),e.addEventListener("load",r,!1),e.addEventListener("abort",n,!1),e.addEventListener("error",a,!1),e.load()}}class AE{constructor(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time")}play(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null}}const _o=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],SE=["audio/mpeg","audio/ogg"],go={};function CE(s){const t={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...s||{}},e=document.createElement("audio"),i={},r=/^no$/;_o.forEach(n=>{const a=e.canPlayType(`audio/${n}`).replace(r,""),o=t[n]?e.canPlayType(t[n]).replace(r,""):"";i[n]=!!a||!!o}),Object.assign(go,i)}CE();class Wc{static setParamValue(t,e){if(t.setValueAtTime){const i=Pn().context;t.setValueAtTime(e,i.audioContext.currentTime)}else t.value=e;return e}}let PE=0;class RE extends Je{constructor(t){super(),this.id=PE++,this._media=null,this._paused=!1,this._muted=!1,this._elapsed=0,this.init(t)}set(t,e){if(this[t]===void 0)throw new Error(`Property with name ${t} does not exist.`);switch(t){case"speed":this.speed=e;break;case"volume":this.volume=e;break;case"muted":this.muted=e;break;case"loop":this.loop=e;break;case"paused":this.paused=e;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"))}get speed(){return this._speed}set speed(t){this._speed=t,this.refresh(),this._update(!0)}get volume(){return this._volume}set volume(t){this._volume=t,this.refresh()}get muted(){return this._muted}set muted(t){this._muted=t,this.refresh()}get loop(){return this._loop}set loop(t){this._loop=t,this.refresh()}get filters(){return this._filters}set filters(t){var e;this._filters&&((e=this._filters)==null||e.filter(i=>i).forEach(i=>i.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=t!=null&&t.length?t.slice(0):null,this.refresh()}refresh(){if(!this._source)return;const t=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;const i=t.volume*(t.muted?0:1),r=e.volume*(e.muted?0:1),n=this._volume*(this._muted?0:1);Wc.setParamValue(this._gain.gain,n*r*i),Wc.setParamValue(this._source.playbackRate,this._speed*e.speed*t.speed),this.applyFilters()}applyFilters(){var t;if((t=this._filters)!=null&&t.length){this._source.disconnect();let e=this._source;this._filters.forEach(i=>{e.connect(i.destination),e=i}),e.connect(this._gain)}}refreshPaused(){const t=this._media.context,e=this._media.parent,i=this._paused||e.paused||t.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i))}play(t){const{start:e,end:i,speed:r,loop:n,volume:a,muted:o,filters:h}=t;i&&console.assert(i>e,"End time is before start time"),this._paused=!1;const{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=r,this._volume=a,this._loop=!!n,this._muted=o,this._filters=h,this.refresh();const d=this._source.buffer.duration;this._duration=d,this._end=i,this._lastUpdate=this._now(),this._elapsed=e,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=e,this._source.start(0,e)):i?this._source.start(0,e,i-e):this._source.start(0,e),this.emit("start"),this._update(!0),this.enableTicker(!0)}enableTicker(t){ft.shared.remove(this._updateListener,this),t&&ft.shared.add(this._updateListener,this)}get progress(){return this._progress}get paused(){return this._paused}set paused(t){this._paused=t,this.refreshPaused()}destroy(){var t;this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),(t=this._filters)==null||t.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1}toString(){return`[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update()}_update(t=!1){if(this._source){const e=this._now(),i=e-this._lastUpdate;if(i>0||t){const r=this._source.playbackRate.value;this._elapsed+=i*r,this._lastUpdate=e;const n=this._duration;let a;if(this._source.loopStart){const o=this._source.loopEnd-this._source.loopStart;a=(this._source.loopStart+this._elapsed%o)/n}else a=this._elapsed%n/n;this._progress=a,this.emit("progress",this._progress,n)}}}init(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)}_internalStop(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}this._source=null}}_onComplete(){if(this._source){this.enableTicker(!1),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)}}class d_{constructor(t,e){this._output=e,this._input=t}get destination(){return this._input}get filters(){return this._filters}set filters(t){if(this._filters&&(this._filters.forEach(e=>{e&&e.disconnect()}),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();let e=null;t.forEach(i=>{e===null?this._input.connect(i.destination):e.connect(i.destination),e=i}),e.connect(this._output)}}destroy(){this.filters=null,this._input=null,this._output=null}}const f_=class extends d_{constructor(s){const t=s.audioContext,e=t.createBufferSource(),i=t.createGain(),r=t.createAnalyser();e.connect(r),r.connect(i),i.connect(s.destination),super(r,i),this.context=s,this.bufferSource=e,this.gain=i,this.analyser=r}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(f_.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null}cloneBufferSource(){const s=this.bufferSource,t=this.context.audioContext.createBufferSource();t.buffer=s.buffer,Wc.setParamValue(t.playbackRate,s.playbackRate.value),t.loop=s.loop;const e=this.context.audioContext.createGain();return t.connect(e),e.connect(this.destination),{source:t,gain:e}}get bufferSize(){return this.script.bufferSize}};let p_=f_;p_.BUFFER_SIZE=0;class IE{init(t){this.parent=t,this._nodes=new p_(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}this._source=null,this.source=null}create(){return new RE(this)}get context(){return this.parent.context}get isPlayable(){return!!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(t){this._nodes.filters=t}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(t){this._source.buffer=t}get nodes(){return this._nodes}load(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t?t(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set")}async _loadUrl(t){const e=this.parent.url,i=await H.ADAPTER.fetch(e);this._decode(await i.arrayBuffer(),t)}_decode(t,e){const i=(r,n)=>{if(r)e&&e(r);else{this.parent.isLoaded=!0,this.buffer=n;const a=this.parent.autoPlayStart();e&&e(null,this.parent,a)}};t instanceof AudioBuffer?i(null,t):this.parent.context.decode(t,i)}}const Ir=class{static from(s){let t={};typeof s=="string"?t.url=s:s instanceof ArrayBuffer||s instanceof AudioBuffer||s instanceof HTMLAudioElement?t.source=s:Array.isArray(s)?t.url=s:t=s,t={autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1,...t},Object.freeze(t);const e=Pn().useLegacy?new EE:new IE;return new Ir(e,t)}constructor(s,t){this.media=s,this.options=t,this._instances=[],this._sprites={},this.media.init(this);const e=t.complete;this._autoPlayOptions=e?{complete:e}:null,this.isLoaded=!1,this._preloadQueue=null,this.isPlaying=!1,this.autoPlay=t.autoPlay,this.singleInstance=t.singleInstance,this.preload=t.preload||this.autoPlay,this.url=Array.isArray(t.url)?this.preferUrl(t.url):t.url,this.speed=t.speed,this.volume=t.volume,this.loop=t.loop,t.sprites&&this.addSprites(t.sprites),this.preload&&this._preload(t.loaded)}preferUrl(s){const[t]=s.map(e=>({url:e,ext:Ft.extname(e).slice(1)})).filter(({ext:e})=>go[e]).sort((e,i)=>_o.indexOf(e.ext)-_o.indexOf(i.ext));if(!t)throw new Error("No supported file type found");return t.url}get context(){return Pn().context}pause(){return this.isPlaying=!1,this.paused=!0,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=!1,this}get paused(){return this._paused}set paused(s){this._paused=s,this.refreshPaused()}get speed(){return this._speed}set speed(s){this._speed=s,this.refresh()}get filters(){return this.media.filters}set filters(s){this.media.filters=s}addSprites(s,t){if(typeof s=="object"){const i={};for(const r in s)i[r]=this.addSprites(r,s[r]);return i}console.assert(!this._sprites[s],`Alias ${s} is already taken`);const e=new AE(this,t);return this._sprites[s]=e,e}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null}removeSprites(s){if(s){const t=this._sprites[s];t!==void 0&&(t.destroy(),delete this._sprites[s])}else for(const t in this._sprites)this.removeSprites(t);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(let s=this._instances.length-1;s>=0;s--)this._instances[s].stop();return this}play(s,t){let e;if(typeof s=="string"?e={sprite:s,loop:this.loop,complete:t}:typeof s=="function"?(e={},e.complete=s):e=s,e={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1,...e||{}},e.sprite){const r=e.sprite;console.assert(!!this._sprites[r],`Alias ${r} is not available`);const n=this._sprites[r];e.start=n.start+(e.start||0),e.end=n.end,e.speed=n.speed||1,e.loop=n.loop||e.loop,delete e.sprite}if(e.offset&&(e.start=e.offset),!this.isLoaded)return this._preloadQueue?new Promise(r=>{this._preloadQueue.push(()=>{r(this.play(e))})}):(this._preloadQueue=[],this.autoPlay=!0,this._autoPlayOptions=e,new Promise((r,n)=>{this._preload((a,o,h)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,a?n(a):(e.loaded&&e.loaded(a,o,h),r(h))})}));(this.singleInstance||e.singleInstance)&&this._removeInstances();const i=this._createInstance();return this._instances.push(i),this.isPlaying=!0,i.once("end",()=>{e.complete&&e.complete(this),this._onComplete(i)}),i.once("stop",()=>{this._onComplete(i)}),i.play(e),i}refresh(){const s=this._instances.length;for(let t=0;t<s;t++)this._instances[t].refresh()}refreshPaused(){const s=this._instances.length;for(let t=0;t<s;t++)this._instances[t].refreshPaused()}get volume(){return this._volume}set volume(s){this._volume=s,this.refresh()}get muted(){return this._muted}set muted(s){this._muted=s,this.refresh()}get loop(){return this._loop}set loop(s){this._loop=s,this.refresh()}_preload(s){this.media.load(s)}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let s;return this.autoPlay&&(s=this.play(this._autoPlayOptions)),s}_removeInstances(){for(let s=this._instances.length-1;s>=0;s--)this._poolInstance(this._instances[s]);this._instances.length=0}_onComplete(s){if(this._instances){const t=this._instances.indexOf(s);t>-1&&this._instances.splice(t,1),this.isPlaying=this._instances.length>0}this._poolInstance(s)}_createInstance(){if(Ir._pool.length>0){const s=Ir._pool.pop();return s.init(this.media),s}return this.media.create()}_poolInstance(s){s.destroy(),Ir._pool.indexOf(s)<0&&Ir._pool.push(s)}};let yo=Ir;yo._pool=[];class ME extends Je{constructor(){super(...arguments),this.speed=1,this.muted=!1,this.volume=1,this.paused=!1}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(t){console.warn("HTML Audio does not support filters")}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners()}}class Rn extends d_{constructor(){const t=window,e=new Rn.AudioContext,i=e.createDynamicsCompressor(),r=e.createAnalyser();r.connect(i),i.connect(e.destination),super(r,i),this.autoPause=!0,this._ctx=e,this._offlineCtx=new Rn.OfflineAudioContext(1,2,t.OfflineAudioContext?Math.max(8e3,Math.min(96e3,e.sampleRate)):44100),this.compressor=i,this.analyser=r,this.events=new Je,this.volume=1,this.speed=1,this.muted=!1,this.paused=!1,this._locked=e.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,!0),document.addEventListener("touchstart",this._unlock,!0),document.addEventListener("touchend",this._unlock,!0)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur)}onFocus(){if(!this.autoPause)return;const t=this._ctx.state;(t==="suspended"||t==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused())}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=!0,this.refreshPaused()))}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._locked=!1))}playEmptySound(){const t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),t.context.state==="suspended"&&t.context.resume()}static get AudioContext(){const t=window;return t.AudioContext||t.webkitAudioContext||null}static get OfflineAudioContext(){const t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null}destroy(){super.destroy();const t=this._ctx;typeof t.close<"u"&&t.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(t){t&&this._ctx.state==="running"?this._ctx.suspend():!t&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=t}get paused(){return this._paused}refresh(){this.events.emit("refresh")}refreshPaused(){this.events.emit("refreshPaused")}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(t,e){const i=n=>{e(new Error((n==null?void 0:n.message)||"Unable to decode file"))},r=this._offlineCtx.decodeAudioData(t,n=>{e(null,n)},i);r&&r.catch(i)}}class DE{constructor(){this.init()}init(){return this.supported&&(this._webAudioContext=new Rn),this._htmlAudioContext=new ME,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(t){this.useLegacy||(this._context.filters=t)}get supported(){return Rn.AudioContext!==null}add(t,e){if(typeof t=="object"){const n={};for(const a in t){const o=this._getOptions(t[a],e);n[a]=this.add(a,o)}return n}if(console.assert(!this._sounds[t],`Sound with alias ${t} already exists.`),e instanceof yo)return this._sounds[t]=e,e;const i=this._getOptions(e),r=yo.from(i);return this._sounds[t]=r,r}_getOptions(t,e){let i;return typeof t=="string"?i={url:t}:Array.isArray(t)?i={url:t}:t instanceof ArrayBuffer||t instanceof AudioBuffer||t instanceof HTMLAudioElement?i={source:t}:i=t,i={...i,...e||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(t){this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext}get disableAutoPause(){return!this._webAudioContext.autoPause}set disableAutoPause(t){this._webAudioContext.autoPause=!t}remove(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this}get volumeAll(){return this._context.volume}set volumeAll(t){this._context.volume=t,this._context.refresh()}get speedAll(){return this._context.speed}set speedAll(t){this._context.speed=t,this._context.refresh()}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=!0,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=!1,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=!0,this._context.refresh(),this}unmuteAll(){return this._context.muted=!1,this._context.refresh(),this}removeAll(){for(const t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this}stopAll(){for(const t in this._sounds)this._sounds[t].stop();return this}exists(t,e=!1){const i=!!this._sounds[t];return e&&console.assert(i,`No sound matching alias '${t}'.`),i}isPlaying(){for(const t in this._sounds)if(this._sounds[t].isPlaying)return!0;return!1}find(t){return this.exists(t,!0),this._sounds[t]}play(t,e){return this.find(t).play(e)}stop(t){return this.find(t).stop()}pause(t){return this.find(t).pause()}resume(t){return this.find(t).resume()}volume(t,e){const i=this.find(t);return e!==void 0&&(i.volume=e),i.volume}speed(t,e){const i=this.find(t);return e!==void 0&&(i.speed=e),i.speed}duration(t){return this.find(t).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}}const m_=s=>{var e;const t=s.src;return((e=s==null?void 0:s.alias)==null?void 0:e[0])??Ft.basename(t,Ft.extname(t))},BE={extension:G.Asset,detection:{test:async()=>!0,add:async s=>[...s,..._o.filter(t=>go[t])],remove:async s=>s.filter(t=>s.includes(t))},loader:{extension:{type:[G.LoadParser],priority:Re.High},test(s){const t=Ft.extname(s).slice(1);return!!go[t]||SE.some(e=>s.startsWith(`data:${e}`))},async load(s,t){const e=await new Promise((i,r)=>yo.from({...t.data,url:s,preload:!0,loaded(n,a){var o,h;n?r(n):i(a),(h=(o=t.data)==null?void 0:o.loaded)==null||h.call(o,n,a)}}));return Pn().add(m_(t),e),e},async unload(s,t){Pn().remove(m_(t))}}};z.add(BE),TE(new DE);class OE{constructor(){this.effectEnabled=!0,this.musicEnabled=!0,this._isMusicPaused=!1,this._isBackground=!1,this._playingList=[],this._setPlayStatus=t=>{var e,i;t?!this._isMusicPaused&&((e=this._musicPlayer)==null||e.play()):(i=this._musicPlayer)==null||i.pause(),this._playingList.forEach(r=>{t?r.audio.play():r.audio.pause()})},this._musicPlayer=new Audio,document.addEventListener("visibilitychange",()=>{this._isBackground=document.hidden,this._setPlayStatus(!document.hidden)})}playEffect(t,e){return new Promise(i=>{const r=new Date().getTime(),n=qi.get(t).url,a=new Audio(n);a.muted=this._isBackground||!this.effectEnabled,a.addEventListener("ended",()=>{this._playingList=this._playingList.filter(o=>o.id!==r),i()}),a.play().then(()=>{if(e){const h=a.duration-e;a.currentTime=Math.max(h,0)}this._playingList.push({id:r,audio:a,url:n})}).catch(()=>{})})}async playMusic(t){var r;this._musicPlayer&&(ct.killTweensOf(this._musicPlayer),await ct.to(this._musicPlayer,{volume:0,duration:1,ease:"linear"}),(r=this._musicPlayer)==null||r.pause());const e=qi.get(t).url;this._musicPlayer.src=e,this._musicPlayer.loop=!0,this._musicPlayer.volume=0;const i=()=>{this._musicPlayer.play().then(()=>{this._isMusicPaused=!1,ct.killTweensOf(this._musicPlayer),ct.to(this._musicPlayer,{volume:1,duration:1,ease:"linear"})}).catch(()=>{requestAnimationFrame(i.bind(this))})};i()}pauseMusic(){var t;this._isMusicPaused=!0,(t=this._musicPlayer)==null||t.pause()}resumeMusic(){var t;this._isMusicPaused=!1,(t=this._musicPlayer)==null||t.play()}stopEffect(t){const e=qi.get(t).url;this._playingList.forEach(i=>{i.url===e&&i.audio.pause()}),this._playingList=this._playingList.filter(i=>i.url!==e)}setEffectEnabled(t){this.effectEnabled=t,this._setEffectMute(!t)}setMusicEnabled(t){this.musicEnabled=t,this._setMusicMute(!t)}_setMusicMute(t){this._musicPlayer.muted=t||!this.musicEnabled}_setEffectMute(t){this._playingList.forEach(e=>{e.audio.muted=t||!this.effectEnabled})}}const FE=s=>{const{texture:t,dotWidth:e,width:i,height:r}=s;let n=[];Array.isArray(e)?n=e:n=[e,e,e,e];const a=new zb(t,n[0],n[1],n[2],n[3]);return a.width=i,a.height=r,a},LE=(s,t,e)=>{let i=!1;return s.cursor="pointer",s.eventMode="static",s.on(t,r=>{i||r.button!==2&&e(r)}),()=>{i=!0}},kE=(s,t,e=0)=>parseFloat((Math.random()*(t-s)+s).toFixed(e)),NE=(s,t)=>{let e=0;const i=new ft,r=n=>{e+=n*i.deltaMS;let a=0;Array.isArray(t)?a=kE(t[0],t[1],2):a=t,e>=a&&(s(),e=0)};return i.add(r),i.start(),()=>{i.remove(r),i.stop()}},UE=(s,t,e)=>{const i=r=>{const n=t.getBounds().contains(r.clientX,r.clientY),a=s.getBounds().contains(r.clientX,r.clientY);!n&&!a&&s.visible&&(e(),window.removeEventListener("pointerdown",i))};return window.addEventListener("pointerdown",i),()=>{window.removeEventListener("pointerdown",i)}},GE=(s=1,t)=>new Promise(e=>{let i=0;const r=new ft,n=()=>{i+=r.deltaMS,i>=s&&(t==null||t(),r.destroy(),e())};r.add(n),r.start()}),HE=(s,t)=>{let e;if(s==="brightness")e=new ar,e.brightness(t,!1);else if(s==="blur")e=new Hf;else if(s==="desaturate")e=new ar,e.desaturate();else if(s==="contrast")e=new ar,e.contrast(t,!1);else throw new Error("未知滤镜名称");return e.resolution=window.devicePixelRatio||1,e};var VE=`attribute vec2 aVertexPosition;
|
|
1170
1170
|
attribute vec2 aTextureCoord;
|
|
1171
1171
|
|
|
1172
1172
|
uniform mat3 projectionMatrix;
|
|
@@ -1177,7 +1177,7 @@ void main(void)
|
|
|
1177
1177
|
{
|
|
1178
1178
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1179
1179
|
vTextureCoord = aTextureCoord;
|
|
1180
|
-
}`,
|
|
1180
|
+
}`,WE=`
|
|
1181
1181
|
varying vec2 vTextureCoord;
|
|
1182
1182
|
uniform sampler2D uSampler;
|
|
1183
1183
|
|
|
@@ -1203,7 +1203,7 @@ void main(void)
|
|
|
1203
1203
|
color *= 0.25;
|
|
1204
1204
|
|
|
1205
1205
|
gl_FragColor = color;
|
|
1206
|
-
}`,
|
|
1206
|
+
}`,XE=`
|
|
1207
1207
|
varying vec2 vTextureCoord;
|
|
1208
1208
|
uniform sampler2D uSampler;
|
|
1209
1209
|
|
|
@@ -1231,7 +1231,7 @@ void main(void)
|
|
|
1231
1231
|
|
|
1232
1232
|
gl_FragColor = color;
|
|
1233
1233
|
}
|
|
1234
|
-
`;let
|
|
1234
|
+
`;let __=class extends Yt{constructor(t=4,e=3,i=!1){super(VE,i?XE:WE),this._kernels=[],this._blur=4,this._quality=3,this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new tt,this.pixelSize=1,this._clamp=i,Array.isArray(t)?this.kernels=t:(this._blur=t,this.quality=e)}apply(t,e,i,r){const n=this._pixelSize.x/e._frame.width,a=this._pixelSize.y/e._frame.height;let o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*n,this.uniforms.uOffset[1]=o*a,t.applyFilter(this,e,i,r);else{const h=t.getFilterTexture();let l=e,c=h,d;const u=this._quality-1;for(let f=0;f<u;f++)o=this._kernels[f]+.5,this.uniforms.uOffset[0]=o*n,this.uniforms.uOffset[1]=o*a,t.applyFilter(this,l,c,1),d=l,l=c,c=d;o=this._kernels[u]+.5,this.uniforms.uOffset[0]=o*n,this.uniforms.uOffset[1]=o*a,t.applyFilter(this,l,i,r),t.returnFilterTexture(h)}}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((t,e)=>t+e+.5,0))}_generateKernels(){const t=this._blur,e=this._quality,i=[t];if(t>0){let r=t;const n=t/e;for(let a=1;a<e;a++)r-=n,i.push(r)}this._kernels=i,this._updatePadding()}get kernels(){return this._kernels}set kernels(t){Array.isArray(t)&&t.length>0?(this._kernels=t,this._quality=t.length,this._blur=Math.max(...t)):(this._kernels=[0],this._quality=1)}get clamp(){return this._clamp}set pixelSize(t){typeof t=="number"?(this._pixelSize.x=t,this._pixelSize.y=t):Array.isArray(t)?(this._pixelSize.x=t[0],this._pixelSize.y=t[1]):t instanceof tt?(this._pixelSize.x=t.x,this._pixelSize.y=t.y):(this._pixelSize.x=1,this._pixelSize.y=1)}get pixelSize(){return this._pixelSize}get quality(){return this._quality}set quality(t){this._quality=Math.max(1,Math.round(t)),this._generateKernels()}get blur(){return this._blur}set blur(t){this._blur=t,this._generateKernels()}};var $E=`attribute vec2 aVertexPosition;
|
|
1235
1235
|
attribute vec2 aTextureCoord;
|
|
1236
1236
|
|
|
1237
1237
|
uniform mat3 projectionMatrix;
|
|
@@ -1242,7 +1242,7 @@ void main(void)
|
|
|
1242
1242
|
{
|
|
1243
1243
|
gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
|
|
1244
1244
|
vTextureCoord = aTextureCoord;
|
|
1245
|
-
}`,
|
|
1245
|
+
}`,zE=`varying vec2 vTextureCoord;
|
|
1246
1246
|
uniform sampler2D uSampler;
|
|
1247
1247
|
uniform float alpha;
|
|
1248
1248
|
uniform vec3 color;
|
|
@@ -1260,4 +1260,4 @@ void main(void){
|
|
|
1260
1260
|
sample *= alpha;
|
|
1261
1261
|
|
|
1262
1262
|
gl_FragColor = sample;
|
|
1263
|
-
}`,
|
|
1263
|
+
}`,YE=Object.defineProperty,g_=Object.getOwnPropertySymbols,jE=Object.prototype.hasOwnProperty,qE=Object.prototype.propertyIsEnumerable,y_=(s,t,e)=>t in s?YE(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,x_=(s,t)=>{for(var e in t||(t={}))jE.call(t,e)&&y_(s,e,t[e]);if(g_)for(var e of g_(t))qE.call(t,e)&&y_(s,e,t[e]);return s};const Xc=class extends Yt{constructor(s){super(),this.angle=45,this._distance=5,this._resolution=H.FILTER_RESOLUTION;const t=s?x_(x_({},Xc.defaults),s):Xc.defaults,{kernels:e,blur:i,quality:r,pixelSize:n,resolution:a}=t;this._offset=new ai(this._updatePadding,this),this._tintFilter=new Yt($E,zE),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.uniforms.shift=this._offset,this._tintFilter.resolution=a,this._blurFilter=e?new __(e):new __(i,r),this.pixelSize=n,this.resolution=a;const{shadowOnly:o,rotation:h,distance:l,offset:c,alpha:d,color:u}=t;this.shadowOnly=o,h!==void 0&&l!==void 0?(this.rotation=h,this.distance=l):this.offset=c,this.alpha=d,this.color=u}apply(s,t,e,i){const r=s.getFilterTexture();this._tintFilter.apply(s,t,r,1),this._blurFilter.apply(s,r,e,i),this.shadowOnly!==!0&&s.applyFilter(this,t,e,0),s.returnFilterTexture(r)}_updatePadding(){const s=Math.max(Math.abs(this._offset.x),Math.abs(this._offset.y));this.padding=s+this.blur*2}_updateShift(){this._tintFilter.uniforms.shift.set(this.distance*Math.cos(this.angle),this.distance*Math.sin(this.angle))}set offset(s){this._offset.copyFrom(s),this._updatePadding()}get offset(){return this._offset}get resolution(){return this._resolution}set resolution(s){this._resolution=s,this._tintFilter&&(this._tintFilter.resolution=s),this._blurFilter&&(this._blurFilter.resolution=s)}get distance(){return this._distance}set distance(s){it("5.3.0","DropShadowFilter distance is deprecated, use offset"),this._distance=s,this._updatePadding(),this._updateShift()}get rotation(){return this.angle/Bh}set rotation(s){it("5.3.0","DropShadowFilter rotation is deprecated, use offset"),this.angle=s*Bh,this._updateShift()}get alpha(){return this._tintFilter.uniforms.alpha}set alpha(s){this._tintFilter.uniforms.alpha=s}get color(){return Qr(this._tintFilter.uniforms.color)}set color(s){Md(s,this._tintFilter.uniforms.color)}get kernels(){return this._blurFilter.kernels}set kernels(s){this._blurFilter.kernels=s}get blur(){return this._blurFilter.blur}set blur(s){this._blurFilter.blur=s,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(s){this._blurFilter.quality=s}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(s){this._blurFilter.pixelSize=s}};let v_=Xc;v_.defaults={offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:H.FILTER_RESOLUTION};const KE=Object.freeze(Object.defineProperty({__proto__:null,Components:{Base:{LibPixiBitText:AT,LibPixiContainer:Tn,LibPixiParticleMove:Kw,LibPixiRectBgColor:lc,LibPixiSpine:cE,LibPixiText:Fc},Custom:{LibPixiButtonHover:uE,LibPixiCloseBtn:dE,LibPixiDrawer:fE,LibPixiPerforMon:pE,LibPixiProgress:mE,LibPixiScrollContainer:_E,LibPixiScrollNum:gE,LibPixiSlider:yE,LibPixiSubAddMinMax:vE,LibPixiTable:bE}},Utils:{LibPixiAudio:OE,libPixiCreateNineGrid:FE,libPixiEvent:Ws,libPixiEventControlled:LE,libPixiFilter:HE,libPixiIntervalTrigger:NE,libPixiOutsideClick:UE,libPixiOverflowHidden:h_,libPixiPromiseTickerTimeout:GE,libPixiScaleContainer:l_,libPixiShadow:(s,t)=>{const{color:e="#000",alpha:i=.25,blur:r=1,distance:n=0,offset:a={x:0,y:0}}=t||{},o=new v_({color:e,alpha:i,blur:r,distance:n,offset:a});o.resolution=window.devicePixelRatio||1,s.filters=[o]},libPixiTickerTimeout:(s,t=1)=>{let e=0;const i=new ft,r=()=>{if(e+=i.deltaMS,e>=t){s==null||s();try{i.destroy()}catch{}}};return i.add(r),i.start(),()=>{try{i.destroy()}catch{}}}}},Symbol.toStringTag,{value:"Module"}));window.LibPixiJs=KE});
|