diff --git a/dist/kagura.js b/dist/kagura.js index fe175d0..65bf355 100644 --- a/dist/kagura.js +++ b/dist/kagura.js @@ -674,7 +674,7 @@ class extends kagura.obj.Object{ my.url=xhr.responseURL; my._text=new FileReader() my._text.readAsText(my.blobObj) - + my.sounder=new kagura.Sounder(my.blob); } setTimeout(()=>this.loadedOneXhr(load),0) }; @@ -689,6 +689,7 @@ class extends kagura.obj.Object{ my.pixiLoad=value; my.texture=value.texture; my.textures=value.textures + } this.loadedOneXhr("__pixiLoaded__") }); diff --git a/dist/kagura.min.js b/dist/kagura.min.js index c6ed8ef..fd72483 100644 --- a/dist/kagura.min.js +++ b/dist/kagura.min.js @@ -1 +1 @@ -function scaleToWindow(a,h){var f=window.innerWidth/a.offsetWidth,g=window.innerHeight/a.offsetHeight,b=Math.min(f,g),c,d,e;return a.style.transformOrigin="0 0",a.style.transform="scale("+b+")",a.offsetWidth>a.offsetHeight?a.offsetWidth*b-1,b}var PIXI=function(a){"use strict";var ie=setTimeout,ep,hM,hK,ha,hy,dj,eH,da,c_,eK,cY,eL,eR,ff,cT,fg,ag,ba,B,fi,fj,fm,ft,fA,fD,fL,s,b,cK,af,aT,hb,gt,cj,gm,bz,gp,gs,az,gv,ce,gy,gD,gL,gT,gU,gX,gZ,cb,fZ,fY,fW,g_,g$,bW,ad,L,fH,bR,bQ,hh,bN,hi,hj,fs,bG,q,r,bF,by,fp,hm,aA,fh,fe,g,bn,d,fd,fa,aG,e_,P,m,M,N,W,R,bT,eZ,aV,i,bX,aO,bZ,k,ca,u,aD,eT,A,p,ch,o,eQ,aq,cm,co,Z,S,hs,e,bm,cu,z,cw,cx,bc,cz,cA,cB,eN,hw,a_,cF,cG,eF,c,G,eB,cM,hz,n,hA,ew,hD,hE,an,en,cV,hO,J,ek,bi,dD,c$,aF,db,ej,dd,ei,ih,dg,dh,di,eg,br,dV,aC,hX,bv,dL,at,Y,hZ,h_,h$,ib,bl,al,D,K,C,dM,bu,dO,du,dQ,dR,dS,dt,ds,dq,$,aE,dk,hU,d$,ed,hS,bp,df,de,dc,be,cW,em,cU,eo,hN,hH,cS,et,cR,hB,bb,aY,aW,ez,eA,cL,eC,eD,eE,cH,eG,hx,cD,eJ,hu,eh,eM,cC,cr,eP,bA,hr,eS,bw,eU,eV,eW,aX,bU,E,bh,ho,bE,hn,aJ,fk,fl,f,hk,av,bD,bs,y,fu,bk,fw,w,bL,U,H,aZ,hg,hf,fG,bS,fI,fJ,fM,fN,bV,hd,fR,fS,ac,dE,bY,b$,aL,f_,gb,aj,cd,gh,gi,gj,bt,cf,ay,cg,am,dF,gn,gr,ci,ar,gu,cn,aw,gx,ai,cp,cq,gB,X,bf,x,gI,cy,cE,gf,ge,ga,gY,f$,fV,cI,aN,hc,fQ,aU,fE,cN,fv,cP,fo,ah,ao,aI,cQ,aH,eX,bd,eO,cX,F,ey,ex,ev,hC,eu,dl,hF,dn,hI,hJ,dp,hL,dr,dv,dw,hP,dx,hR,dA,hT,d_,hV,dZ,dP,dB,dI,dH,ia,dG,ic,id,dC,ig,gw;function dJ(a){return Boolean(a&&void 0!==a.length)}function hY(){}function l(a){if(!(this instanceof l))throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],el(a,this)}function ef(a,b){for(;3===a._state;)a=a._value;0!==a._state?(a._handled=!0,l._immediateFn(function(){var c=1===a._state?b.onFulfilled:b.onRejected,d;if(null!==c){try{d=c(a._value)}catch(a){return void aB(b.promise,a)}dz(b.promise,d)}else(1===a._state?dz:aB)(b.promise,a._value)})):a._deferreds.push(b)}function dz(a,b){var c,d,e;try{if(b===a)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){if(c=b.then,b instanceof l)return a._state=3,a._value=b,void dy(a);if("function"==typeof c)return void el((d=c,e=b,function(){d.apply(e,arguments)}),a)}a._state=1,a._value=b,dy(a)}catch(b){aB(a,b)}}function aB(a,b){a._state=2,a._value=b,dy(a)}function dy(a){2===a._state&&0===a._deferreds.length&&l._immediateFn(function(){a._handled||l._unhandledRejectionFn(a._value)});for(var b=0,c=a._deferreds.length;b0?1:-1}),Number.isInteger||(Number.isInteger=function(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array),a.ENV=void 0,a.RENDERER_TYPE=void 0,a.BUFFER_BITS=void 0,a.BLEND_MODES=void 0,a.DRAW_MODES=void 0,a.FORMATS=void 0,a.TARGETS=void 0,a.TYPES=void 0,a.SAMPLER_TYPES=void 0,a.SCALE_MODES=void 0,a.WRAP_MODES=void 0,a.MIPMAP_MODES=void 0,a.ALPHA_MODES=void 0,a.CLEAR_MODES=void 0,a.GC_MODES=void 0,a.PRECISION=void 0,a.MASK_TYPES=void 0,a.COLOR_MASK_BITS=void 0,a.MSAA_QUALITY=void 0,a.BUFFER_TYPE=void 0,function(a){a[a.WEBGL_LEGACY=0]="WEBGL_LEGACY",a[a.WEBGL=1]="WEBGL",a[a.WEBGL2=2]="WEBGL2"}(a.ENV||(a.ENV={})),function(a){a[a.UNKNOWN=0]="UNKNOWN",a[a.WEBGL=1]="WEBGL",a[a.CANVAS=2]="CANVAS"}(a.RENDERER_TYPE||(a.RENDERER_TYPE={})),function(a){a[a.COLOR=16384]="COLOR",a[a.DEPTH=256]="DEPTH",a[a.STENCIL=1024]="STENCIL"}(a.BUFFER_BITS||(a.BUFFER_BITS={})),function(a){a[a.NORMAL=0]="NORMAL",a[a.ADD=1]="ADD",a[a.MULTIPLY=2]="MULTIPLY",a[a.SCREEN=3]="SCREEN",a[a.OVERLAY=4]="OVERLAY",a[a.DARKEN=5]="DARKEN",a[a.LIGHTEN=6]="LIGHTEN",a[a.COLOR_DODGE=7]="COLOR_DODGE",a[a.COLOR_BURN=8]="COLOR_BURN",a[a.HARD_LIGHT=9]="HARD_LIGHT",a[a.SOFT_LIGHT=10]="SOFT_LIGHT",a[a.DIFFERENCE=11]="DIFFERENCE",a[a.EXCLUSION=12]="EXCLUSION",a[a.HUE=13]="HUE",a[a.SATURATION=14]="SATURATION",a[a.COLOR=15]="COLOR",a[a.LUMINOSITY=16]="LUMINOSITY",a[a.NORMAL_NPM=17]="NORMAL_NPM",a[a.ADD_NPM=18]="ADD_NPM",a[a.SCREEN_NPM=19]="SCREEN_NPM",a[a.NONE=20]="NONE",a[a.SRC_OVER=0]="SRC_OVER",a[a.SRC_IN=21]="SRC_IN",a[a.SRC_OUT=22]="SRC_OUT",a[a.SRC_ATOP=23]="SRC_ATOP",a[a.DST_OVER=24]="DST_OVER",a[a.DST_IN=25]="DST_IN",a[a.DST_OUT=26]="DST_OUT",a[a.DST_ATOP=27]="DST_ATOP",a[a.ERASE=26]="ERASE",a[a.SUBTRACT=28]="SUBTRACT",a[a.XOR=29]="XOR"}(a.BLEND_MODES||(a.BLEND_MODES={})),function(a){a[a.POINTS=0]="POINTS",a[a.LINES=1]="LINES",a[a.LINE_LOOP=2]="LINE_LOOP",a[a.LINE_STRIP=3]="LINE_STRIP",a[a.TRIANGLES=4]="TRIANGLES",a[a.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",a[a.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(a.DRAW_MODES||(a.DRAW_MODES={})),function(a){a[a.RGBA=6408]="RGBA",a[a.RGB=6407]="RGB",a[a.RG=33319]="RG",a[a.RED=6403]="RED",a[a.RGBA_INTEGER=36249]="RGBA_INTEGER",a[a.RGB_INTEGER=36248]="RGB_INTEGER",a[a.RG_INTEGER=33320]="RG_INTEGER",a[a.RED_INTEGER=36244]="RED_INTEGER",a[a.ALPHA=6406]="ALPHA",a[a.LUMINANCE=6409]="LUMINANCE",a[a.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",a[a.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",a[a.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(a.FORMATS||(a.FORMATS={})),function(a){a[a.TEXTURE_2D=3553]="TEXTURE_2D",a[a.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",a[a.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",a[a.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",a[a.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",a[a.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",a[a.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",a[a.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",a[a.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(a.TARGETS||(a.TARGETS={})),function(a){a[a.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",a[a.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",a[a.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",a[a.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",a[a.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",a[a.UNSIGNED_INT=5125]="UNSIGNED_INT",a[a.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",a[a.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",a[a.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",a[a.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",a[a.BYTE=5120]="BYTE",a[a.SHORT=5122]="SHORT",a[a.INT=5124]="INT",a[a.FLOAT=5126]="FLOAT",a[a.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",a[a.HALF_FLOAT=36193]="HALF_FLOAT"}(a.TYPES||(a.TYPES={})),function(a){a[a.FLOAT=0]="FLOAT",a[a.INT=1]="INT",a[a.UINT=2]="UINT"}(a.SAMPLER_TYPES||(a.SAMPLER_TYPES={})),function(a){a[a.NEAREST=0]="NEAREST",a[a.LINEAR=1]="LINEAR"}(a.SCALE_MODES||(a.SCALE_MODES={})),function(a){a[a.CLAMP=33071]="CLAMP",a[a.REPEAT=10497]="REPEAT",a[a.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(a.WRAP_MODES||(a.WRAP_MODES={})),function(a){a[a.OFF=0]="OFF",a[a.POW2=1]="POW2",a[a.ON=2]="ON",a[a.ON_MANUAL=3]="ON_MANUAL"}(a.MIPMAP_MODES||(a.MIPMAP_MODES={})),function(a){a[a.NPM=0]="NPM",a[a.UNPACK=1]="UNPACK",a[a.PMA=2]="PMA",a[a.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",a[a.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",a[a.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",a[a.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(a.ALPHA_MODES||(a.ALPHA_MODES={})),function(a){a[a.NO=0]="NO",a[a.YES=1]="YES",a[a.AUTO=2]="AUTO",a[a.BLEND=0]="BLEND",a[a.CLEAR=1]="CLEAR",a[a.BLIT=2]="BLIT"}(a.CLEAR_MODES||(a.CLEAR_MODES={})),function(a){a[a.AUTO=0]="AUTO",a[a.MANUAL=1]="MANUAL"}(a.GC_MODES||(a.GC_MODES={})),function(a){a.LOW="lowp",a.MEDIUM="mediump",a.HIGH="highp"}(a.PRECISION||(a.PRECISION={})),function(a){a[a.NONE=0]="NONE",a[a.SCISSOR=1]="SCISSOR",a[a.STENCIL=2]="STENCIL",a[a.SPRITE=3]="SPRITE",a[a.COLOR=4]="COLOR"}(a.MASK_TYPES||(a.MASK_TYPES={})),function(a){a[a.RED=1]="RED",a[a.GREEN=2]="GREEN",a[a.BLUE=4]="BLUE",a[a.ALPHA=8]="ALPHA"}(a.COLOR_MASK_BITS||(a.COLOR_MASK_BITS={})),function(a){a[a.NONE=0]="NONE",a[a.LOW=2]="LOW",a[a.MEDIUM=4]="MEDIUM",a[a.HIGH=8]="HIGH"}(a.MSAA_QUALITY||(a.MSAA_QUALITY={})),function(a){a[a.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",a[a.ARRAY_BUFFER=34962]="ARRAY_BUFFER",a[a.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(a.BUFFER_TYPE||(a.BUFFER_TYPE={})),eK={createCanvas:function(b,c){var a=document.createElement("canvas");return a.width=b,a.height=c,a},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var a;return null!==(a=document.baseURI)&&void 0!==a?a:window.location.href},fetch:function(a,b){return fetch(a,b)}},cY=/iPhone/i,eL=/iPod/i,eR=/iPad/i,ff=/\biOS-universal(?:.+)Mac\b/i,cT=/\bAndroid(?:.+)Mobile\b/i,fg=/Android/i,ag=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ba=/Silk/i,B=/Windows Phone/i,fi=/\bWindows(?:.+)ARM\b/i,fj=/BlackBerry/i,fm=/BB10/i,ft=/Opera Mini/i,fA=/\b(CriOS|Chrome)(?:.+)Mobile/i,fD=/Mobile(?:.+)Firefox\b/i,fL=function(a){return void 0!==a&&"MacIntel"===a.platform&&"number"==typeof a.maxTouchPoints&&a.maxTouchPoints>1&&"undefined"==typeof MSStream},s=function(c){var d={userAgent:"",platform:"",maxTouchPoints:0},e,f,a,b;return c||"undefined"==typeof navigator?"string"==typeof c?d.userAgent=c:c&&c.userAgent&&(d={userAgent:c.userAgent,platform:c.platform,maxTouchPoints:c.maxTouchPoints||0}):d={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0},e=d.userAgent,f=e.split("[FBAN"),void 0!==f[1]&&(e=f[0]),void 0!==(f=e.split("Twitter"))[1]&&(e=f[0]),a=function(a){return function(b){return b.test(a)}}(e),b={apple:{phone:a(cY)&&!a(B),ipod:a(eL),tablet:!a(cY)&&(a(eR)||fL(d))&&!a(B),universal:a(ff),device:(a(cY)||a(eL)||a(eR)||a(ff)||fL(d))&&!a(B)},amazon:{phone:a(ag),tablet:!a(ag)&&a(ba),device:a(ag)||a(ba)},android:{phone:!a(B)&&a(ag)||!a(B)&&a(cT),tablet:!a(B)&&!a(ag)&&!a(cT)&&(a(ba)||a(fg)),device:!a(B)&&(a(ag)||a(ba)||a(cT)||a(fg))||a(/\bokhttp\b/i)},windows:{phone:a(B),tablet:a(fi),device:a(B)||a(fi)},other:{blackberry:a(fj),blackberry10:a(fm),opera:a(ft),firefox:a(fD),chrome:a(fA),device:a(fj)||a(fm)||a(ft)||a(fD)||a(fA)},any:!1,phone:!1,tablet:!1},b.any=b.apple.device||b.android.device||b.windows.device||b.other.device,b.phone=b.apple.phone||b.android.phone||b.windows.phone,b.tablet=b.apple.tablet||b.android.tablet||b.windows.tablet,b}(globalThis.navigator),b={ADAPTER:eK,MIPMAP_TEXTURES:a.MIPMAP_MODES.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:a.MSAA_QUALITY.NONE,SPRITE_MAX_TEXTURES:function(c){var a,b=!0;return(s.tablet||s.phone)&&(s.apple.device&&(a=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(a[1],10)<11&&(b=!1),s.android.device&&(a=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(a[1],10)<7&&(b=!1)),b?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:a.GC_MODES.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:a.WRAP_MODES.CLAMP,SCALE_MODE:a.SCALE_MODES.LINEAR,PRECISION_VERTEX:a.PRECISION.HIGH,PRECISION_FRAGMENT:s.apple.device?a.PRECISION.HIGH:a.PRECISION.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!s.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},cK="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cJ(b,c,a){return b(a={path:c,exports:{},require:function(c,b){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==b&&a.path)}},a.exports),a.exports}af=cJ(function(g){var h=Object.prototype.hasOwnProperty,b="~";function c(){}function f(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function e(a,e,g,h,i){if("function"!=typeof g)throw new TypeError("The listener must be a function");var d=new f(g,h||a,i),c=b?b+e:e;return a._events[c]?a._events[c].fn?a._events[c]=[a._events[c],d]:a._events[c].push(d):(a._events[c]=d,a._eventsCount++),a}function d(a,b){0==--a._eventsCount?a._events=new c:delete a._events[b]}function a(){this._events=new c,this._eventsCount=0}Object.create&&(c.prototype=Object.create(null),(new c).__proto__||(b=!1)),a.prototype.eventNames=function(){var d,a,c=[];if(0===this._eventsCount)return c;for(a in d=this._events)h.call(d,a)&&c.push(b?a.slice(1):a);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(d){var g=b?b+d:d,a=this._events[g],c,e,f;if(!a)return[];if(a.fn)return[a.fn];for(c=0,e=a.length,f=new Array(e);c80*a){d=g=b[0],e=h=b[1];for(k=a;kg&&(g=j),i>h&&(h=i);f=0!==(f=Math.max(g-d,h-e))?32767/f:0}return aM(c,m,a,d,e,f,0),m}function fT(c,e,f,d,g){var a,b;if(g===ck(c,e,f,d)>0)for(a=e;a=e;a-=d)b=gl(a,c[a],c[a+1],b);return b&&aR(b,b.next)&&(au(b),b=b.next),b}function V(c,b){if(!c)return c;b||(b=c);var d,a=c;do if(d=!1,a.steiner||!aR(a,a.next)&&0!==j(a.prev,a,a.next))a=a.next;else{if(au(a),(a=b=a.prev)===a.next)break;d=!0}while(d||a!==b)return b}function aM(a,b,c,e,f,d,h){if(a){!h&&d&&function(b,c,d,e){var a=b;do 0===a.z&&(a.z=cs(a.x,a.y,c,d,e)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==b)a.prevZ.nextZ=null,a.prevZ=null,function(g){var i,b,a,c,d,h,e,f,j=1;do{for(b=g,g=null,d=null,h=0;b;){for(h++,a=b,e=0,i=0;i0||f>0&&a;)0!==e&&(0===f||!a||b.z<=a.z)?(c=b,b=b.nextZ,e--):(c=a,a=a.nextZ,f--),d?d.nextZ=c:g=c,c.prevZ=d,d=c;b=a}d.nextZ=null,j*=2}while(h>1)}(a)}(a,e,f,d);for(var i,g,j=a;a.prev!==a.next;)if(i=a.prev,g=a.next,d?gJ(a,e,f,d):gK(a))b.push(i.i/c|0),b.push(a.i/c|0),b.push(g.i/c|0),au(a),a=g.next,j=g.next;else if((a=g)===j){h?1===h?aM(a=gH(V(a),b,c),b,c,e,f,d,2):2===h&&gG(a,b,c,e,f,d):aM(V(a),b,c,e,f,d,1);break}}}function gK(l){var i=l.prev,k=l,h=l.next,e,f,b,g,d,c,m,n,o,p,a;if(j(i,k,h)>=0)return!1;for(e=i.x,f=k.x,b=h.x,g=i.y,d=k.y,c=h.y,m=ef?e>b?e:b:f>b?f:b,p=g>d?g>c?g:c:d>c?d:c,a=h.next;a!==i;){if(a.x>=m&&a.x<=o&&a.y>=n&&a.y<=p&&ae(e,g,f,d,b,c,a.x,a.y)&&j(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function gJ(p,u,v,r){var i=p.prev,q=p,k=p.next,e,g,d,h,f,c,l,o,n,m,s,t,a,b;if(j(i,q,k)>=0)return!1;for(e=i.x,g=q.x,d=k.x,h=i.y,f=q.y,c=k.y,l=eg?e>d?e:d:g>d?g:d,m=h>f?h>c?h:c:f>c?f:c,s=cs(l,o,u,v,r),t=cs(n,m,u,v,r),a=p.prevZ,b=p.nextZ;a&&a.z>=s&&b&&b.z<=t;){if(a.x>=l&&a.x<=n&&a.y>=o&&a.y<=m&&a!==i&&a!==k&&ae(e,h,g,f,d,c,a.x,a.y)&&j(a.prev,a,a.next)>=0)return!1;if(a=a.prevZ,b.x>=l&&b.x<=n&&b.y>=o&&b.y<=m&&b!==i&&b!==k&&ae(e,h,g,f,d,c,b.x,b.y)&&j(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;a&&a.z>=s;){if(a.x>=l&&a.x<=n&&a.y>=o&&a.y<=m&&a!==i&&a!==k&&ae(e,h,g,f,d,c,a.x,a.y)&&j(a.prev,a,a.next)>=0)return!1;a=a.prevZ}for(;b&&b.z<=t;){if(b.x>=l&&b.x<=n&&b.y>=o&&b.y<=m&&b!==i&&b!==k&&ae(e,h,g,f,d,c,b.x,b.y)&&j(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function gH(d,e,f){var a=d,c,b;do c=a.prev,b=a.next.next,!aR(c,b)&&gk(c,a,a.next,b)&&ax(c,b)&&ax(b,c)&&(e.push(c.i/f|0),e.push(a.i/f|0),e.push(b.i/f|0),au(a),au(a.next),a=d=b),a=a.next;while(a!==d)return V(a)}function gG(g,h,i,d,e,f){var a=g,b,c;do{for(b=a.next.next;b!==a.prev;){if(a.i!==b.i&&gz(a,b))return c=fU(a,b),a=V(a,a.next),c=V(c,c.next),aM(a,h,i,d,e,f,0),void aM(c,h,i,d,e,f,0);b=b.next}a=a.next}while(a!==g)}function gF(a,b){return a.x-b.x}function gE(b,c){var a=function(h,l){var b,a=l,d=h.x,c=h.y,g=-1/0,e,f,m,k,i,j;do{if(c<=a.y&&c>=a.next.y&&a.next.y!==a.y)if(e=a.x+(c-a.y)*(a.next.x-a.x)/(a.next.y-a.y),e<=d&&e>g&&(g=e,b=a.x=a.x&&a.x>=k&&d!==a.x&&ae(cb.x||a.x===b.x&&gC(b,a)))&&(b=a,j=f)),a=a.next;while(a!==m)return b}(b,c),d;return a?(d=fU(a,b),V(d,d.next),V(a,a.next)):c}function gC(a,b){return j(a.prev,a,b.prev)<0&&j(b.next,a,a.next)<0}function cs(a,b,d,e,c){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-d)*c|0)|a<<8))|a<<4))|a<<2))|a<<1))|(b=1431655765&((b=858993459&((b=252645135&((b=16711935&((b=(b-e)*c|0)|b<<8))|b<<4))|b<<2))|b<<1))<<1}function gA(c){var a=c,b=c;do(a.x=(g-a)*(f-b)&&(g-a)*(d-b)>=(c-a)*(h-b)&&(c-a)*(f-b)>=(e-a)*(d-b)}function gz(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function(b,c){var a=b;do{if(a.i!==b.i&&a.next.i!==b.i&&a.i!==c.i&&a.next.i!==c.i&&gk(a,a.next,b,c))return!0;a=a.next}while(a!==b)return!1}(a,b)&&(ax(a,b)&&ax(b,a)&&function(b,e){var a=b,c=!1,f=(b.x+e.x)/2,d=(b.y+e.y)/2;do a.y>d!=a.next.y>d&&a.next.y!==a.y&&f<(a.next.x-a.x)*(d-a.y)/(a.next.y-a.y)+a.x&&(c=!c),a=a.next;while(a!==b)return c}(a,b)&&(j(a.prev,a,b.prev)||j(a,b.prev,b))||aR(a,b)&&j(a.prev,a,a.next)>0&&j(b.prev,b,b.next)>0)}function j(b,a,c){return(a.y-b.y)*(c.x-a.x)-(a.x-b.x)*(c.y-a.y)}function aR(a,b){return a.x===b.x&&a.y===b.y}function gk(a,b,c,d){var e=bx(j(a,b,c)),f=bx(j(a,b,d)),g=bx(j(c,d,a)),h=bx(j(c,d,b));return e!==f&&g!==h||!(0!==e||!bq(a,c,b))||!(0!==f||!bq(a,d,b))||!(0!==g||!bq(c,a,d))||!(0!==h||!bq(c,b,d))}function bq(a,b,c){return b.x<=Math.max(a.x,c.x)&&b.x>=Math.min(a.x,c.x)&&b.y<=Math.max(a.y,c.y)&&b.y>=Math.min(a.y,c.y)}function bx(a){return a>0?1:a<0?-1:0}function ax(a,b){return j(a.prev,a,a.next)<0?j(a,b,a.next)>=0&&j(a,a.prev,b)>=0:j(a,b,a.prev)<0||j(a,a.next,b)<0}function fU(a,b){var d=new cl(a.i,a.x,a.y),c=new cl(b.i,b.x,b.y),e=a.next,f=b.prev;return a.next=b,b.prev=a,d.next=e,e.prev=d,c.next=d,d.prev=c,f.next=c,c.prev=f,c}function gl(c,d,e,b){var a=new cl(c,d,e);return b?(a.next=b.next,a.prev=b,b.next.prev=a,b.next=a):(a.prev=a,a.next=a),a}function au(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function cl(a,b,c){this.i=a,this.x=b,this.y=c,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ck(b,g,d,e){for(var f=0,a=g,c=d-e;a0&&(g+=b[a-1].length,c.holes.push(g))}return c},aT.default=hb,gt=cJ(function(a,b){!function(n){var k=b&&!b.nodeType&&b,q=a&&!a.nodeType&&a,f="object"==typeof cK&&cK,g,j,h,d,x,w,v,y,c,i;f.global!==f&&f.window!==f&&f.self!==f||(n=f),h=2147483647,d=36,x=/^xn--/,w=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,i=String.fromCharCode;function e(a){throw RangeError(y[a])}function r(b,d){for(var a=b.length,c=[];a--;)c[a]=d(b[a]);return c}function s(a,d){var b=a.split("@"),c="";return b.length>1&&(c=b[0]+"@",a=b[1]),c+r((a=a.replace(v,".")).split("."),d).join(".")}function t(d){for(var a,e,c=[],b=0,f=d.length;b=55296&&a<=56319&&b65535&&(b+=i((a-=65536)>>>10&1023|55296),a=56320|1023&a),b+=i(a)}).join("")}function m(a,b){return a+22+75*(a<26)-((0!=b)<<5)}function o(a,e,f){var b=0;for(a=f?c(a/700):a>>1,a+=c(a/e);a>455;b+=d)a=c(a/35);return c(b+36*a/(a+38))}function p(k){var m,g,i,l,r,j,f,p,v,t,b,n=[],w=k.length,a=0,s=128,q=72;for((g=k.lastIndexOf("-"))<0&&(g=0),i=0;i=128&&e("not-basic"),n.push(k.charCodeAt(i));for(l=g>0?g+1:0;l=w&&e("invalid-input"),((p=(b=k.charCodeAt(l++))-48<10?b-22:b-65<26?b-65:b-97<26?b-97:d)>=d||p>c((h-a)/j))&&e("overflow"),a+=p*j,!(p<(v=f<=q?1:f>=q+26?26:f-q));f+=d)j>c(h/(t=d-v))&&e("overflow"),j*=t;q=o(a-r,m=n.length+1,0==r),c(a/m)>h-s&&e("overflow"),s+=c(a/m),a%=m,n.splice(a++,0,s)}return u(n)}function l(s){var b,f,l,v,p,a,j,r,q,u,g,n,w,x,y,k=[];for(n=(s=t(s)).length,b=128,f=0,p=72,a=0;a=b&&gc((h-f)/(w=l+1))&&e("overflow"),f+=(j-b)*w,b=j,a=0;ah&&e("overflow"),g==b){for(r=f,q=d;!(r<(u=q<=p?1:q>=p+26?26:q-p));q+=d)y=r-u,x=d-u,k.push(i(m(u+y%x,0))),r=c(y/x);k.push(i(m(r,0))),p=o(f,w,l==v),f=0,++l}++f,++b}return k.join("")}if(g={version:"1.3.2",ucs2:{decode:t,encode:u},decode:p,encode:l,toASCII:function(a){return s(a,function(a){return w.test(a)?"xn--"+l(a):a})},toUnicode:function(a){return s(a,function(a){return x.test(a)?p(a.slice(4).toLowerCase()):a})}},k&&q)if(a.exports==k)q.exports=g;else for(j in g)g.hasOwnProperty(j)&&(k[j]=g[j]);else n.punycode=g}(cK)}),cj=function(a){return"string"==typeof a},gm=function(a){return"object"==typeof a&&null!==a},bz=function(a){return null===a},gp=function(a){return null==a};function gq(a,b){return Object.prototype.hasOwnProperty.call(a,b)}gs=function(c,n,m,l){var a,o,d,j,i,h,g,b,e,f,k;if(n=n||"&",m=m||"=",a={},"string"!=typeof c||0===c.length)return a;o=/\+/g,c=c.split(n),d=1e3,l&&"number"==typeof l.maxKeys&&(d=l.maxKeys),j=c.length,d>0&&j>d&&(j=d);for(i=0;i=0?(h=f.substr(0,k),g=f.substr(k+1)):(h=f,g=""),b=decodeURIComponent(h),e=decodeURIComponent(g),gq(a,b)?Array.isArray(a[b])?a[b].push(e):a[b]=[a[b],e]:a[b]=e;return a},az=function(a){switch(typeof a){case"string":return a;case"boolean":return a?"true":"false";case"number":return isFinite(a)?a:"";default:return""}},gv=function(a,b,c,d){return b=b||"&",c=c||"=",null===a&&(a=void 0),"object"==typeof a?Object.keys(a).map(function(d){var e=encodeURIComponent(az(d))+c;return Array.isArray(a[d])?a[d].map(function(a){return e+encodeURIComponent(az(a))}).join(b):e+encodeURIComponent(az(a[d]))}).join(b):d?encodeURIComponent(az(d))+c+encodeURIComponent(az(a)):""},ce=cJ(function(b,a){a.decode=a.parse=gs,a.encode=a.stringify=gv}),gy=aS,gD=function(a,b){return aS(a,!1,!0).resolve(b)},gL=function(a){return cj(a)&&(a=aS(a)),!(a instanceof t)?t.prototype.format.call(a):a.format()};function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}gT=/^([a-z0-9.+-]+:)/i,gU=/:[0-9]*$/,gX=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gZ=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]),cb=["'"].concat(gZ),fZ=["%","/","?",";","#"].concat(cb),fY=["/","?","#"],fW=/^[+a-z0-9A-Z_-]{0,63}$/,g_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g$={javascript:!0,"javascript:":!0},bW={javascript:!0,"javascript:":!0},ad={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function aS(a,c,d){if(a&&gm(a)&&a instanceof t)return a;var b=new t;return b.parse(a,c,d),b}t.prototype.parse=function(g,v,F){var C,B,q,a,j,d,p,A,z,n,c,b,f,x,l,s,e,u,i,D,y,m,w,o,E,h,r,t,k,G;if(!cj(g))throw new TypeError("Parameter 'url' must be a string, not "+typeof g);if(C=g.indexOf("?"),B=-1!==C&&C127?u+="x":u+=e[i];if(!u.match(fW)){y=l.slice(0,b),m=l.slice(b+1),w=e.match(g_),w&&(y.push(w[1]),m.unshift(w[2])),m.length&&(a="/"+m.join(".")+a),this.hostname=y.join(".");break}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=gt.toASCII(this.hostname)),o=this.port?":"+this.port:"",E=this.hostname||"",this.host=E+o,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!g$[p])for(b=0,s=cb.length;b0)&&a.host.split("@"))&&(a.auth=f.shift(),a.host=a.hostname=f.shift())),a.search=b.search,a.query=b.query,bz(a.pathname)&&bz(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a;if(!c.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(h=c.slice(-1)[0],x=(a.host||b.host||c.length>1)&&("."===h||".."===h)||""===h,i=0,g=c.length;g>=0;g--)"."===(h=c[g])?c.splice(g,1):".."===h?(c.splice(g,1),i++):i&&(c.splice(g,1),i--);if(!e&&!y)for(;i--;i)c.unshift("..");return!e||""===c[0]||c[0]&&"/"===c[0].charAt(0)||c.unshift(""),x&&"/"!==c.join("/").substr(-1)&&c.push(""),w=""===c[0]||c[0]&&"/"===c[0].charAt(0),n&&(a.hostname=a.host=w?"":c.length?c.shift():"",(f=!!(a.host&&a.host.indexOf("@")>0)&&a.host.split("@"))&&(a.auth=f.shift(),a.host=a.hostname=f.shift())),(e=e||a.host&&c.length)&&!w&&c.unshift(""),c.length?a.pathname=c.join("/"):(a.pathname=null,a.path=null),bz(a.pathname)&&bz(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=b.auth||a.auth,a.slashes=a.slashes||b.slashes,a.href=a.format(),a},t.prototype.parseHost=function(){var a=this.host,b=gU.exec(a);b&&(":"!==(b=b[0])&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)},L={parse:gy,format:gL,resolve:gD};function v(a){if("string"!=typeof a)throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function fO(a){return a.split("?")[0].split("#")[0]}fH={toPosix:function(a){return"\\","/",a.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/")},isUrl:function(a){return/^https?:/.test(this.toPosix(a))},isDataUrl:function(a){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(a)},hasProtocol:function(a){return/^[^/:]+:\//.test(this.toPosix(a))},getProtocol:function(a){var e,b,c,d,f;return v(a),a=this.toPosix(a),e="",b=/^file:\/\/\//.exec(a),c=/^[^/:]+:\/\//.exec(a),d=/^[^/:]+:\//.exec(a),(b||c||d)&&(f=(null==b?void 0:b[0])||(null==c?void 0:c[0])||(null==d?void 0:d[0]),e=f,a=a.slice(f.length)),e},toAbsolute:function(a,c,d){if(this.isDataUrl(a))return a;var e=fO(this.toPosix(null!=c?c:b.ADAPTER.getBaseUrl())),f=fO(this.toPosix(null!=d?d:this.rootname(e)));return v(a),(a=this.toPosix(a)).startsWith("/")?fH.join(f,a.slice(1)):this.isAbsolute(a)?a:this.join(e,a)},normalize:function(a){var b,c,d;return v(a=this.toPosix(a)),0===a.length?".":(b="",c=a.startsWith("/"),this.hasProtocol(a)&&(b=this.rootname(a),a=a.slice(b.length)),d=a.endsWith("/"),(a=function(g,i){for(var e,a="",f=0,d=-1,c=0,b=0,h;b<=g.length;++b){if(b2){if(h=a.lastIndexOf("/"),h!==a.length-1){-1===h?(a="",f=0):f=(a=a.slice(0,h)).length-1-a.lastIndexOf("/"),d=b,c=0;continue}}else if(2===a.length||1===a.length){a="",f=0,d=b,c=0;continue}}else a.length>0?a+="/"+g.slice(d+1,b):a=g.slice(d+1,b),f=b-d-1;d=b,c=0}else 46===e&&-1!==c?++c:c=-1}return a}(a)).length>0&&d&&(a+="/"),c?"/"+a:b+a)},isAbsolute:function(a){return v(a),a=this.toPosix(a),!!this.hasProtocol(a)||a.startsWith("/")},join:function(){for(var f,a,g=arguments,c=[],d=0,e,b,h;d0)&&(void 0===a?a=b:(h=null!==(f=c[e-1])&&void 0!==f?f:"",this.extname(h)?a+="/../"+b:a+="/"+b));return void 0===a?".":this.normalize(a)},dirname:function(a){if(v(a),0===a.length)return".";for(var g=(a=this.toPosix(a)).charCodeAt(0),e=47===g,c=-1,f=!0,d=this.getProtocol(a),h=a,b=(a=a.slice(d.length)).length-1;b>=1;--b)if(47===(g=a.charCodeAt(b))){if(!f){c=b;break}}else f=!1;return-1===c?e?"/":this.isUrl(h)?d+a:d:e&&1===c?"//":d+a.slice(0,c)},rootname:function(a){var b,c;return v(a),b="",(b=(a=this.toPosix(a)).startsWith("/")?"/":this.getProtocol(a),this.isUrl(a))&&(c=a.indexOf("/",b.length),(b=-1!==c?a.slice(0,c):a).endsWith("/")||(b+="/")),b},basename:function(b,d){var a,e,c,f,g,h,i;if(v(b),d&&v(d),b=this.toPosix(b),e=0,c=-1,f=!0,void 0!==d&&d.length>0&&d.length<=b.length){if(d.length===b.length&&d===b)return"";g=d.length-1,h=-1;for(a=b.length-1;a>=0;--a)if(i=b.charCodeAt(a),47===i){if(!f){e=a+1;break}}else-1===h&&(f=!1,h=a+1),g>=0&&(i===d.charCodeAt(g)?-1==--g&&(c=a):(g=-1,c=h));return e===c?c=h:-1===c&&(c=b.length),b.slice(e,c)}for(a=b.length-1;a>=0;--a)if(47===b.charCodeAt(a)){if(!f){e=a+1;break}}else-1===c&&(f=!1,c=a+1);return-1===c?"":b.slice(e,c)},extname:function(e){var a,f,c,g,d,b,h;v(e);for(a=-1,f=0,c=-1,g=!0,d=0,b=(e=this.toPosix(e)).length-1;b>=0;--b)if(h=e.charCodeAt(b),47!==h)-1===c&&(g=!1,c=b+1),46===h?-1===a?a=b:1!==d&&(d=1):-1!==a&&(d=-1);else if(!g){f=b+1;break}return-1===a||-1===c||0===d||1===d&&a===c-1&&a===f+1?"":e.slice(a,c)},parse:function(a){var b,i,k,h,d,e,c,j,f,g;if(v(a),b={root:"",dir:"",base:"",ext:"",name:""},0===a.length)return b;k=(a=this.toPosix(a)).charCodeAt(0),h=this.isAbsolute(a),b.root=this.rootname(a),i=h||this.hasProtocol(a)?1:0;for(d=-1,e=0,c=-1,j=!0,f=a.length-1,g=0;f>=i;--f)if(47!==(k=a.charCodeAt(f)))-1===c&&(j=!1,c=f+1),46===k?-1===d?d=f:1!==g&&(g=1):-1!==d&&(g=-1);else if(!j){e=f+1;break}return-1===d||-1===c||0===g||1===g&&d===c-1&&d===e+1?-1!==c&&(b.base=b.name=0===e&&h?a.slice(1,c):a.slice(e,c)):(0===e&&h?(b.name=a.slice(1,d),b.base=a.slice(1,c)):(b.name=a.slice(e,d),b.base=a.slice(e,c)),b.ext=a.slice(d,c)),b.dir=this.dirname(a),b},sep:"/",delimiter:":"},b.RETINA_PREFIX=/@([0-9\.]+)x/,b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1,bQ=!1;function fC(a){var c,d;bQ||(b.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1?(d=["\n %c %c %c PixiJS 6.5.8 - ✰ "+a+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"],(c=globalThis.console).log.apply(c,d)):globalThis.console&&globalThis.console.log("PixiJS 6.5.8 - "+a+" - http://www.pixijs.com/"),bQ=!0)}function fB(){return void 0===bR&&(bR=function(){var c={stencil:!0,failIfMajorPerformanceCaveat:b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT},d,a,f,e;try{return!!b.ADAPTER.getWebGLRenderingContext()&&(d=b.ADAPTER.createCanvas(),a=d.getContext("webgl",c)||d.getContext("experimental-webgl",c),f=!(!a||!a.getContextAttributes().stencil),a&&(e=a.getExtension("WEBGL_lose_context"),e&&e.loseContext()),a=null,f)}catch(a){return!1}}()),bR}hh={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function T(b,a){return void 0===a&&(a=[]),a[0]=(b>>16&255)/255,a[1]=(b>>8&255)/255,a[2]=(255&b)/255,a}function bP(b){var a=b.toString(16);return"#"+("000000".substring(0,6-a.length)+a)}function bO(a){return"string"==typeof a&&"#"===(a=hh[a.toLowerCase()]||a)[0]&&(a=a.slice(1)),parseInt(a,16)}bN=function(){for(var c=[],d=[],b=0,e;b<32;b++)c[b]=b,d[b]=b;return c[a.BLEND_MODES.NORMAL_NPM]=a.BLEND_MODES.NORMAL,c[a.BLEND_MODES.ADD_NPM]=a.BLEND_MODES.ADD,c[a.BLEND_MODES.SCREEN_NPM]=a.BLEND_MODES.SCREEN,d[a.BLEND_MODES.NORMAL]=a.BLEND_MODES.NORMAL_NPM,d[a.BLEND_MODES.ADD]=a.BLEND_MODES.ADD_NPM,d[a.BLEND_MODES.SCREEN]=a.BLEND_MODES.SCREEN_NPM,e=[],e.push(d),e.push(c),e}();function bM(a,b){return bN[b?1:0][a]}function fz(b,c,a,d){return a=a||new Float32Array(4),d||void 0===d?(a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c):(a[0]=b[0],a[1]=b[1],a[2]=b[2]),a[3]=c,a}function bg(b,a){if(1===a)return(255*a<<24)+b;if(0===a)return 0;var c=b>>16&255,d=b>>8&255,e=255&b;return(255*a<<24)+((c=c*a+.5|0)<<16)+((d=d*a+.5|0)<<8)+(e*a+.5|0)}function bK(c,b,a,d){return(a=a||new Float32Array(4))[0]=(c>>16&255)/255,a[1]=(c>>8&255)/255,a[2]=(255&c)/255,(d||void 0===d)&&(a[0]*=b,a[1]*=b,a[2]*=b),a[3]=b,a}function fy(e,a){var d,b,c;if(void 0===a&&(a=null),d=6*e,(a=a||new Uint16Array(d)).length!==d)throw new Error("Out buffer length is incorrect, got "+a.length+" and expected "+d);for(b=0,c=0;b>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,1+(a|=a>>>16)}function bI(a){return!(a&a-1||!a)}function bH(b){var c=(b>65535?1:0)<<4,a=((b>>>=c)>255?1:0)<<3;return c|=a,c|=a=((b>>>=a)>15?1:0)<<2,(c|=a=((b>>>=a)>3?1:0)<<1)|(b>>>=a)>>1}function _(c,d,a){var b,e=c.length,f;if(!(d>=e||0===a)){f=e-(a=d+a>e?e-d:a);for(b=d;b=this.x&&a=this.y&&b=j||Math.max(a.y,e.y,d.y,c.y)<=i||Math.min(a.y,e.y,d.y,c.y)>=h)&&(!(n=o*(e.y-a.y),g=o*(a.x-e.x),p=n*k+g*i,q=n*j+g*i,r=n*k+g*h,s=n*j+g*h,Math.max(p,q,r,s)<=n*a.x+g*a.y||Math.min(p,q,r,s)>=n*c.x+g*c.y)&&(l=o*(a.y-d.y),m=o*(d.x-a.x),t=l*k+m*i,u=l*j+m*i,v=l*k+m*h,w=l*j+m*h,!(Math.max(t,u,v,w)<=l*a.x+m*a.y||Math.min(t,u,v,w)>=l*c.x+m*c.y)))))):!(y=this.xb.right?b.right:this.right)<=y)&&(x=this.yb.bottom?b.bottom:this.bottom)>x)},b.prototype.pad=function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},b.prototype.fit=function(a){var b=Math.max(this.x,a.x),d=Math.min(this.x+this.width,a.x+a.width),c=Math.max(this.y,a.y),e=Math.min(this.y+this.height,a.y+a.height);return this.x=b,this.width=Math.max(d-b,0),this.y=c,this.height=Math.max(e-c,0),this},b.prototype.ceil=function(a,b){void 0===a&&(a=1),void 0===b&&(b=.001);var c=Math.ceil((this.x+this.width-b)*a)/a,d=Math.ceil((this.y+this.height-b)*a)/a;return this.x=Math.floor((this.x+b)*a)/a,this.y=Math.floor((this.y+b)*a)/a,this.width=c-this.x,this.height=d-this.y,this},b.prototype.enlarge=function(a){var b=Math.min(this.x,a.x),d=Math.max(this.x+this.width,a.x+a.width),c=Math.min(this.y,a.y),e=Math.max(this.y+this.height,a.y+a.height);return this.x=b,this.width=d-b,this.y=c,this.height=e-c,this},b}(),fd=function(){function b(b,c,d){void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=b,this.y=c,this.radius=d,this.type=a.SHAPES.CIRC}return b.prototype.clone=function(){return new b(this.x,this.y,this.radius)},b.prototype.contains=function(c,d){if(this.radius<=0)return!1;var e=this.radius*this.radius,a=this.x-c,b=this.y-d;return(a*=a)+(b*=b)<=e},b.prototype.getBounds=function(){return new d(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},b}(),fa=function(){function b(b,c,d,e){void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===e&&(e=0),this.x=b,this.y=c,this.width=d,this.height=e,this.type=a.SHAPES.ELIP}return b.prototype.clone=function(){return new b(this.x,this.y,this.width,this.height)},b.prototype.contains=function(c,d){if(this.width<=0||this.height<=0)return!1;var a=(c-this.x)/this.width,b=(d-this.y)/this.height;return(a*=a)+(b*=b)<=1},b.prototype.getBounds=function(){return new d(this.x-this.width,this.y-this.height,this.width,this.height)},b}(),aG=function(){function b(){for(var g=arguments,c=[],d=0,b,f,e,h;db!=h>b&&i<(b-e)/(h-e)*(j-f)+f&&(c=!c);return c},b}(),e_=function(){function b(b,c,d,e,f){void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===e&&(e=0),void 0===f&&(f=20),this.x=b,this.y=c,this.width=d,this.height=e,this.radius=f,this.type=a.SHAPES.RREC}return b.prototype.clone=function(){return new b(this.x,this.y,this.width,this.height,this.radius)},b.prototype.contains=function(d,e){var a,b,c,f;if(this.width<=0||this.height<=0)return!1;if(d>=this.x&&d<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(a=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2)),e>=this.y+a&&e<=this.y+this.height-a||d>=this.x+a&&d<=this.x+this.width-a)return!0;if(b=d-(this.x+a),c=e-(this.y+a),f=a*a,b*b+c*c<=f)return!0;if((b=d-(this.x+this.width-a))*b+c*c<=f)return!0;if(b*b+(c=e-(this.y+this.height-a))*c<=f)return!0;if((b=d-(this.x+a))*b+c*c<=f)return!0}return!1},b}(),P=function(){function a(c,d,a,b){void 0===a&&(a=0),void 0===b&&(b=0),this._x=a,this._y=b,this.cb=c,this.scope=d}return a.prototype.clone=function(b,c){return void 0===b&&(b=this.cb),void 0===c&&(c=this.scope),new a(b,c,this._x,this._y)},a.prototype.set=function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this._x===a&&this._y===b||(this._x=a,this._y=b,this.cb.call(this.scope)),this},a.prototype.copyFrom=function(a){return this._x===a.x&&this._y===a.y||(this._x=a.x,this._y=a.y,this.cb.call(this.scope)),this},a.prototype.copyTo=function(a){return a.set(this._x,this._y),a},a.prototype.equals=function(a){return a.x===this._x&&a.y===this._y},Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(a){this._x!==a&&(this._x=a,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"y",{get:function(){return this._y},set:function(a){this._y!==a&&(this._y=a,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),a}(),m=function(){function a(a,b,c,d,e,f){void 0===a&&(a=1),void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=1),void 0===e&&(e=0),void 0===f&&(f=0),this.array=null,this.a=a,this.b=b,this.c=c,this.d=d,this.tx=e,this.ty=f}return a.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},a.prototype.set=function(a,b,c,d,e,f){return this.a=a,this.b=b,this.c=c,this.d=d,this.tx=e,this.ty=f,this},a.prototype.toArray=function(b,c){this.array||(this.array=new Float32Array(9));var a=c||this.array;return b?(a[0]=this.a,a[1]=this.b,a[2]=0,a[3]=this.c,a[4]=this.d,a[5]=0,a[6]=this.tx,a[7]=this.ty,a[8]=1):(a[0]=this.a,a[1]=this.c,a[2]=this.tx,a[3]=this.b,a[4]=this.d,a[5]=this.ty,a[6]=0,a[7]=0,a[8]=1),a},a.prototype.apply=function(b,a){a=a||new g;var c=b.x,d=b.y;return a.x=this.a*c+this.c*d+this.tx,a.y=this.b*c+this.d*d+this.ty,a},a.prototype.applyInverse=function(c,b){b=b||new g;var a=1/(this.a*this.d+this.c*-this.b),d=c.x,e=c.y;return b.x=this.d*a*d+-this.c*a*e+(this.ty*this.c-this.tx*this.d)*a,b.y=this.a*a*e+-this.b*a*d+(-this.ty*this.a+this.tx*this.b)*a,b},a.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},a.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},a.prototype.rotate=function(c){var a=Math.cos(c),b=Math.sin(c),d=this.a,e=this.c,f=this.tx;return this.a=d*a-this.b*b,this.b=d*b+this.b*a,this.c=e*a-this.d*b,this.d=e*b+this.d*a,this.tx=f*a-this.ty*b,this.ty=f*b+this.ty*a,this},a.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},a.prototype.setTransform=function(h,i,c,d,e,f,a,b,g){return this.a=Math.cos(a+g)*e,this.b=Math.sin(a+g)*e,this.c=-Math.sin(a-b)*f,this.d=Math.cos(a-b)*f,this.tx=h-(c*this.a+d*this.c),this.ty=i-(c*this.b+d*this.d),this},a.prototype.prepend=function(a){var b=this.tx,c,d;return(1!==a.a||0!==a.b||0!==a.c||1!==a.d)&&(c=this.a,d=this.c,this.a=c*a.a+this.b*a.c,this.b=c*a.b+this.b*a.d,this.c=d*a.a+this.d*a.c,this.d=d*a.b+this.d*a.d),this.tx=b*a.a+this.ty*a.c+a.tx,this.ty=b*a.b+this.ty*a.d+a.ty,this},a.prototype.decompose=function(a){var b=this.a,c=this.b,d=this.c,e=this.d,f=a.pivot,h=-Math.atan2(-d,e),g=Math.atan2(c,b),i=Math.abs(h+g);return i<1e-5||Math.abs(aA-i)<1e-5?(a.rotation=g,a.skew.x=a.skew.y=0):(a.rotation=0,a.skew.x=h,a.skew.y=g),a.scale.x=Math.sqrt(b*b+c*c),a.scale.y=Math.sqrt(d*d+e*e),a.position.x=this.tx+(f.x*b+f.y*d),a.position.y=this.ty+(f.x*c+f.y*e),a},a.prototype.invert=function(){var b=this.a,c=this.b,d=this.c,e=this.d,f=this.tx,a=b*e-c*d;return this.a=e/a,this.b=-c/a,this.c=-d/a,this.d=b/a,this.tx=(d*this.ty-e*f)/a,this.ty=-(b*this.ty-c*f)/a,this},a.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},a.prototype.clone=function(){var b=new a;return b.a=this.a,b.b=this.b,b.c=this.c,b.d=this.d,b.tx=this.tx,b.ty=this.ty,b},a.prototype.copyTo=function(a){return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,a},a.prototype.copyFrom=function(a){return this.a=a.a,this.b=a.b,this.c=a.c,this.d=a.d,this.tx=a.tx,this.ty=a.ty,this},Object.defineProperty(a,"IDENTITY",{get:function(){return new a},enumerable:!1,configurable:!0}),Object.defineProperty(a,"TEMP_MATRIX",{get:function(){return new a},enumerable:!1,configurable:!0}),a}(),M=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],N=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],W=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],R=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],bT=[],eZ=[],aV=Math.sign,!function(){for(var a=0,d,b,f,g,h,i,c,e;a<16;a++){d=[],bT.push(d);for(b=0;b<16;b++)for(f=aV(M[a]*M[b]+W[a]*N[b]),g=aV(N[a]*M[b]+R[a]*N[b]),h=aV(M[a]*W[b]+W[a]*R[b]),i=aV(N[a]*W[b]+R[a]*R[b]),c=0;c<16;c++)if(M[c]===f&&N[c]===g&&W[c]===h&&R[c]===i){d.push(c);break}}for(a=0;a<16;a++)e=new m,e.set(M[a],N[a],W[a],R[a],0,0),eZ.push(e)}(),i={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:function(a){return M[a]},uY:function(a){return N[a]},vX:function(a){return W[a]},vY:function(a){return R[a]},inv:function(a){return 8&a?15&a:7&-a},add:function(a,b){return bT[a][b]},sub:function(a,b){return bT[a][i.inv(b)]},rotate180:function(a){return 4^a},isVertical:function(a){return 2==(3&a)},byDirection:function(a,b){return 2*Math.abs(a)<=Math.abs(b)?b>=0?i.S:i.N:2*Math.abs(b)<=Math.abs(a)?a>0?i.E:i.W:b>0?a>0?i.SE:i.SW:a>0?i.NE:i.NW},matrixAppendRotationInv:function(d,e,a,b){void 0===a&&(a=0),void 0===b&&(b=0);var c=eZ[i.inv(e)];c.tx=a,c.ty=b,d.append(c)}},bX=function(){function a(){this.worldTransform=new m,this.localTransform=new m,this.position=new P(this.onChange,this,0,0),this.scale=new P(this.onChange,this,1,1),this.pivot=new P(this.onChange,this,0,0),this.skew=new P(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}return a.prototype.onChange=function(){this._localID++},a.prototype.updateSkew=function(){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++},a.prototype.updateLocalTransform=function(){var a=this.localTransform;this._localID!==this._currentLocalID&&(a.a=this._cx*this.scale.x,a.b=this._sx*this.scale.x,a.c=this._cy*this.scale.y,a.d=this._sy*this.scale.y,a.tx=this.position.x-(this.pivot.x*a.a+this.pivot.y*a.c),a.ty=this.position.y-(this.pivot.x*a.b+this.pivot.y*a.d),this._currentLocalID=this._localID,this._parentID=-1)},a.prototype.updateTransform=function(d){var a=this.localTransform,b,c;this._localID!==this._currentLocalID&&(a.a=this._cx*this.scale.x,a.b=this._sx*this.scale.x,a.c=this._cy*this.scale.y,a.d=this._sy*this.scale.y,a.tx=this.position.x-(this.pivot.x*a.a+this.pivot.y*a.c),a.ty=this.position.y-(this.pivot.x*a.b+this.pivot.y*a.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==d._worldID&&(b=d.worldTransform,c=this.worldTransform,c.a=a.a*b.a+a.b*b.c,c.b=a.a*b.b+a.b*b.d,c.c=a.c*b.a+a.d*b.c,c.d=a.c*b.b+a.d*b.d,c.tx=a.tx*b.a+a.ty*b.c+b.tx,c.ty=a.tx*b.b+a.ty*b.d+b.ty,this._parentID=d._worldID,this._worldID++)},a.prototype.setFromMatrix=function(a){a.decompose(this),this._localID++},Object.defineProperty(a.prototype,"rotation",{get:function(){return this._rotation},set:function(a){this._rotation!==a&&(this._rotation=a,this.updateSkew())},enumerable:!1,configurable:!0}),a.IDENTITY=new a,a}(),b.SORTABLE_CHILDREN=!1,aO=function(){function a(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return a.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},a.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},a.prototype.getRectangle=function(a){return this.minX>this.maxX||this.minY>this.maxY?d.EMPTY:((a=a||new d(0,0,1,1)).x=this.minX,a.y=this.minY,a.width=this.maxX-this.minX,a.height=this.maxY-this.minY,a)},a.prototype.addPoint=function(a){this.minX=Math.min(this.minX,a.x),this.maxX=Math.max(this.maxX,a.x),this.minY=Math.min(this.minY,a.y),this.maxY=Math.max(this.maxY,a.y)},a.prototype.addPointMatrix=function(a,b){var i=a.a,j=a.b,e=a.c,f=a.d,g=a.tx,h=a.ty,c=i*b.x+e*b.y+g,d=j*b.x+f*b.y+h;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,d),this.maxY=Math.max(this.maxY,d)},a.prototype.addQuad=function(g){var c=this.minX,d=this.minY,e=this.maxX,f=this.maxY,b=g[0],a=g[1];c=be?b:e,f=a>f?a:f,c=(b=g[2])e?b:e,f=a>f?a:f,c=(b=g[4])e?b:e,f=a>f?a:f,c=(b=g[6])e?b:e,f=a>f?a:f,this.minX=c,this.minY=d,this.maxX=e,this.maxY=f},a.prototype.addFrame=function(a,b,c,d,e){this.addFrameMatrix(a.worldTransform,b,c,d,e)},a.prototype.addFrameMatrix=function(g,p,o,n,m){var l=g.a,i=g.b,h=g.c,q=g.d,j=g.tx,k=g.ty,f=this.minX,e=this.minY,d=this.maxX,c=this.maxY,b=l*p+h*o+j,a=i*p+q*o+k;f=bd?b:d,c=a>c?a:c,f=(b=l*n+h*o+j)d?b:d,c=a>c?a:c,f=(b=l*p+h*m+j)d?b:d,c=a>c?a:c,f=(b=l*n+h*m+j)d?b:d,c=a>c?a:c,this.minX=f,this.minY=e,this.maxX=d,this.maxY=c},a.prototype.addVertexData=function(h,i,j){for(var d=this.minX,e=this.minY,f=this.maxX,a=this.maxY,b=i,c,g;bf?c:f,a=g>a?g:a;this.minX=d,this.minY=e,this.maxX=f,this.maxY=a},a.prototype.addVertices=function(a,b,c,d){this.addVerticesMatrix(a.worldTransform,b,c,d)},a.prototype.addVerticesMatrix=function(a,r,u,t,c,g){var q,p,o,n,s,m,h,f,e,d,b,k,j,i,l;void 0===c&&(c=0),void 0===g&&(g=c);for(q=a.a,p=a.b,o=a.c,n=a.d,s=a.tx,m=a.ty,h=this.minX,f=this.minY,e=this.maxX,d=this.maxY,b=u;bd?a.maxX:d,this.maxY=a.maxY>e?a.maxY:e},a.prototype.addBoundsMask=function(a,b){var c=a.minX>b.minX?a.minX:b.minX,d=a.minY>b.minY?a.minY:b.minY,e=a.maxXi?e:i,this.maxY=f>j?f:j)},a.prototype.addBoundsMatrix=function(a,b){this.addFrameMatrix(b,a.minX,a.minY,a.maxX,a.maxY)},a.prototype.addBoundsArea=function(b,a){var c=b.minX>a.x?b.minX:a.x,d=b.minY>a.y?b.minY:a.y,e=b.maxXi?e:i,this.maxY=f>j?f:j)},a.prototype.pad=function(a,b){void 0===a&&(a=0),void 0===b&&(b=a),this.isEmpty()||(this.minX-=a,this.maxX+=a,this.minY-=b,this.maxY+=b)},a.prototype.addFramePad=function(a,b,c,d,e,f){a-=e,b-=f,c+=e,d+=f,this.minX=this.minXc?this.maxX:c,this.minY=this.minYd?this.maxY:d},a}(),bZ=function(a,b){return bZ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},bZ(a,b)};function b_(b,a){function c(){this.constructor=b}bZ(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}k=function(b){function a(){var a=b.call(this)||this;return a.tempDisplayObjectParent=null,a.transform=new bX,a.alpha=1,a.visible=!0,a.renderable=!0,a.cullable=!1,a.cullArea=null,a.parent=null,a.worldAlpha=1,a._lastSortedIndex=0,a._zIndex=0,a.filterArea=null,a.filters=null,a._enabledFilters=null,a._bounds=new aO,a._localBounds=null,a._boundsID=0,a._boundsRect=null,a._localBoundsRect=null,a._mask=null,a._maskRefCount=0,a._destroyed=!1,a.isSprite=!1,a.isMask=!1,a}return b_(a,b),a.mixin=function(c){for(var d=Object.keys(c),b=0,e;b1)for(d=0;dthis.children.length)throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length);return a.parent&&a.parent.removeChild(a),a.parent=this,this.sortDirty=!0,a.transform._parentID=-1,this.children.splice(b,0,a),this._boundsID++,this.onChildrenChange(b),a.emit("added",this),this.emit("childAdded",a,this,b),a},c.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);this.children[c]=b,this.children[d]=a,this.onChildrenChange(c=this.children.length)throw new Error("The index "+a+" supplied is out of bounds "+this.children.length);var c=this.getChildIndex(b);_(this.children,c,1),this.children.splice(a,0,b),this.onChildrenChange(a)},c.prototype.getChildAt=function(a){if(a<0||a>=this.children.length)throw new Error("getChildAt: Index ("+a+") does not exist.");return this.children[a]},c.prototype.removeChild=function(){for(var f=arguments,a=[],c=0,e,b,d;c1)for(e=0;e0&&c<=e){b=this.children.splice(f,c);for(a=0;a1&&this.children.sort(hq),this.sortDirty=!1},c.prototype.updateTransform=function(){var a,c,b;this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(a=0,c=this.children.length;a0&&d.height>0){if(this.cullArea?(b=this.cullArea,g=this.worldTransform):this._render!==c.prototype._render&&(b=this.getBounds(!0)),b&&d.intersects(b,g))this._render(f);else if(this.cullArea)return;for(e=0,i=this.children.length;e8)throw new Error("max arguments reached");c=this,e=c.name,b=c.items,this._aliasCount++;for(a=0,d=b.length;a0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},a.prototype.add=function(a){return a[this._name]&&(this.ensureNonAliasedItems(),this.remove(a),this.items.push(a)),this},a.prototype.remove=function(b){var a=this.items.indexOf(b);return-1!==a&&(this.ensureNonAliasedItems(),this.items.splice(a,1)),this},a.prototype.contains=function(a){return-1!==this.items.indexOf(a)},a.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},a.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(a.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),a}(),Object.defineProperties(p.prototype,{dispatch:{value:p.prototype.emit},run:{value:p.prototype.emit}}),a.UPDATE_PRIORITY=void 0,b.TARGET_FPMS=.06,function(a){a[a.INTERACTION=50]="INTERACTION",a[a.HIGH=25]="HIGH",a[a.NORMAL=0]="NORMAL",a[a.LOW=-25]="LOW",a[a.UTILITY=-50]="UTILITY"}(a.UPDATE_PRIORITY||(a.UPDATE_PRIORITY={})),ch=function(){function a(d,a,b,c){void 0===a&&(a=null),void 0===b&&(b=0),void 0===c&&(c=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=d,this.context=a,this.priority=b,this.once=c}return a.prototype.match=function(b,a){return void 0===a&&(a=null),this.fn===b&&this.context===a},a.prototype.emit=function(a){this.fn&&(this.context?this.fn.call(this.context,a):this.fn(a));var b=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),b},a.prototype.connect=function(a){this.previous=a,a.next&&(a.next.previous=this),this.next=a.next,a.next=this},a.prototype.destroy=function(a){void 0===a&&(a=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var b=this.next;return this.next=a?null:b,this.previous=null,b},a}(),o=function(){function c(){var a=this;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 ch(null,null,1/0),this.deltaMS=1/b.TARGET_FPMS,this.elapsedMS=1/b.TARGET_FPMS,this._tick=function(b){a._requestId=null,a.started&&(a.update(b),a.started&&null===a._requestId&&a._head.next&&(a._requestId=requestAnimationFrame(a._tick)))}}return c.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},c.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},c.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},c.prototype.add=function(c,d,b){return void 0===b&&(b=a.UPDATE_PRIORITY.NORMAL),this._addListener(new ch(c,d,b))},c.prototype.addOnce=function(c,d,b){return void 0===b&&(b=a.UPDATE_PRIORITY.NORMAL),this._addListener(new ch(c,d,b,!0))},c.prototype._addListener=function(b){var a=this._head.next,c=this._head;if(a){for(;a;){if(b.priority>a.priority){b.connect(c);break}c=a,a=a.next}b.previous||b.connect(c)}else b.connect(c);return this._startIfPossible(),this},c.prototype.remove=function(b,c){for(var a=this._head.next;a;)a=a.match(b,c)?a.destroy():a.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(c.prototype,"count",{get:function(){if(!this._head)return 0;for(var a=0,b=this._head;b=b.next;)a++;return a},enumerable:!1,configurable:!0}),c.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},c.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},c.prototype.destroy=function(){if(!this._protected){this.stop();for(var a=this._head.next;a;)a=a.destroy(!0);this._head.destroy(),this._head=null}},c.prototype.update=function(a){var c,e,f,d;if(void 0===a&&(a=performance.now()),a>this.lastTime){if((c=this.elapsedMS=a-this.lastTime)>this._maxElapsedMS&&(c=this._maxElapsedMS),c*=this.speed,this._minElapsedMS){if(e=a-this._lastFrame|0,e=0;--b)if(c=aq[b],c.test&&c.test(a,d))return new c(a,f);throw new Error("Unrecognized source type to auto-detect Resource")}cm=function(a,b){return cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cm(a,b)};function h(b,a){function c(){this.constructor=b}cm(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}co=function(){return co=Object.assign||function(d){for(var a,e=arguments,b=1,f=arguments.length,c;b0&&g>0,c.textureCacheIds=[],c.destroyed=!1,c.resource=null,c._batchEnabled=0,c._batchLocation=0,c.parentTextureArray=null,c.setResource(f),c}return h(c,d),Object.defineProperty(c.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"mipmap",{get:function(){return this._mipmap},set:function(a){this._mipmap!==a&&(this._mipmap=a,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(a){this._scaleMode!==a&&(this._scaleMode=a,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(a){this._wrapMode!==a&&(this._wrapMode=a,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),c.prototype.setStyle=function(a,b){var c;return void 0!==a&&a!==this.scaleMode&&(this.scaleMode=a,c=!0),void 0!==b&&b!==this.mipmap&&(this.mipmap=b,c=!0),c&&this.dirtyStyleId++,this},c.prototype.setSize=function(b,c,a){return a=a||this.resolution,this.setRealSize(b*a,c*a,a)},c.prototype.setRealSize=function(a,b,c){return this.resolution=c||this.resolution,this.width=Math.round(a)/this.resolution,this.height=Math.round(b)/this.resolution,this._refreshPOT(),this.update(),this},c.prototype._refreshPOT=function(){this.isPowerOfTwo=bI(this.realWidth)&&bI(this.realHeight)},c.prototype.setResolution=function(a){var b=this.resolution;return b===a||(this.resolution=a,this.valid&&(this.width=Math.round(this.width*b)/a,this.height=Math.round(this.height*b)/a,this.emit("update",this)),this._refreshPOT()),this},c.prototype.setResource=function(a){if(this.resource===a)return this;if(this.resource)throw new Error("Resource can be set only once");return a.bind(this),this.resource=a,this},c.prototype.update=function(){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))},c.prototype.onError=function(a){this.emit("error",this,a)},c.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete r[this.cacheId],delete q[this.cacheId],this.cacheId=null),this.dispose(),c.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},c.prototype.dispose=function(){this.emit("dispose",this)},c.prototype.castToBaseTexture=function(){return this},c.from=function(d,f,g){var h,a,i,e;if(void 0===g&&(g=b.STRICT_TEXTURE_CACHE),h="string"==typeof d,a=null,h?a=d:(d._pixiId||(i=f&&f.pixiIdPrefix||"pixiid",d._pixiId=i+"_"+I()),a=d._pixiId),e=r[a],h&&g&&!e)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return e||((e=new c(d,f)).cacheId=a,c.addToCache(e,a)),e},c.fromBuffer=function(b,d,e,f){b=b||new Float32Array(d*e*4);var g=new S(b,{width:d,height:e}),h=b instanceof Float32Array?a.TYPES.FLOAT:a.TYPES.UNSIGNED_BYTE;return new c(g,Object.assign({},hs,f||{width:d,height:e,type:h}))},c.addToCache=function(b,a){a&&(-1===b.textureCacheIds.indexOf(a)&&b.textureCacheIds.push(a),r[a]&&console.warn("BaseTexture added to the cache with an id ["+a+"] that already had an entry"),r[a]=b)},c.removeFromCache=function(a){var b,d,c;if("string"==typeof a){if(b=r[a],b)return d=b.textureCacheIds.indexOf(a),d>-1&&b.textureCacheIds.splice(d,1),delete r[a],b}else if(a&&a.textureCacheIds){for(c=0;c0){if(!b.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(b.resource,c)}else b.target=a.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+c,b.parentTextureArray=this.baseTexture,this.items[c]=b;return b.valid&&!this.valid&&this.resize(b.realWidth,b.realHeight),this.items[c]=b,this},b.prototype.upload=function(g,d,e){for(var f=this.itemDirtyIds,a=0,c;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,a}(z),cA=function(b){function a(d,e){var c=this,f,n,g,h,l,i,j,k,m;if(e=e||{},!(d instanceof HTMLVideoElement)){f=document.createElement("video"),f.setAttribute("preload","auto"),f.setAttribute("webkit-playsinline",""),f.setAttribute("playsinline",""),"string"==typeof d&&(d=[d]),n=d[0].src||d[0],z.crossOrigin(f,n,e.crossorigin);for(g=0;g2},a.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(o.shared.add(this.update,this),this._isConnectedToTicker=!0)},a.prototype._onPlayStop=function(){this._isConnectedToTicker&&(o.shared.remove(this.update,this),this._isConnectedToTicker=!1)},a.prototype._onCanPlay=function(){var a=this.source,b;a.removeEventListener("canplay",this._onCanPlay),a.removeEventListener("canplaythrough",this._onCanPlay),b=this.valid,this.resize(a.videoWidth,a.videoHeight),!b&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&a.play()},a.prototype.dispose=function(){this._isConnectedToTicker&&(o.shared.remove(this.update,this),this._isConnectedToTicker=!1);var a=this.source;a&&(a.removeEventListener("error",this._onError,!0),a.pause(),a.src="",a.load()),b.prototype.dispose.call(this)},Object.defineProperty(a.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(a){a!==this._autoUpdate&&(this._autoUpdate=a,!this._autoUpdate&&this._isConnectedToTicker?(o.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(o.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(a){a!==this._updateFPS&&(this._updateFPS=a)},enumerable:!1,configurable:!0}),a.test=function(b,c){return globalThis.HTMLVideoElement&&b instanceof HTMLVideoElement||a.TYPES.indexOf(c)>-1},a.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],a.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},a}(z),cB=function(b){function a(a){return b.call(this,a)||this}return h(a,b),a.test=function(a){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&a instanceof ImageBitmap},a}(z),aq.push(bc,cB,cw,cA,cz,S,cx,cu),eN={__proto__:null,Resource:Z,BaseImageResource:z,INSTALLED:aq,autoDetectResource:bB,AbstractMultiResource:bm,ArrayResource:cu,BufferResource:S,CanvasResource:cw,CubeResource:cx,ImageResource:bc,SVGResource:cz,VideoResource:cA,ImageBitmapResource:cB},hw=function(b){function c(){return null!==b&&b.apply(this,arguments)||this}return h(c,b),c.prototype.upload=function(g,b,c){var d=g.gl,e,f;return d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.alphaMode===a.ALPHA_MODES.UNPACK),e=b.realWidth,f=b.realHeight,c.width===e&&c.height===f?d.texSubImage2D(b.target,0,0,0,e,f,b.format,c.type,this.data):(c.width=e,c.height=f,d.texImage2D(b.target,0,c.internalFormat,e,f,0,b.format,c.type,this.data)),!0},c}(S),a_=function(){function b(b,c){this.width=Math.round(b||100),this.height=Math.round(c||100),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 p("disposeFramebuffer"),this.multisample=a.MSAA_QUALITY.NONE}return Object.defineProperty(b.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),b.prototype.addColorTexture=function(b,c){return void 0===b&&(b=0),this.colorTextures[b]=c||new e(null,{scaleMode:a.SCALE_MODES.NEAREST,resolution:1,mipmap:a.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},b.prototype.addDepthTexture=function(b){return this.depthTexture=b||new e(new hw(null,{width:this.width,height:this.height}),{scaleMode:a.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:a.MIPMAP_MODES.OFF,format:a.FORMATS.DEPTH_COMPONENT,type:a.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},b.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},b.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},b.prototype.resize=function(a,b){var d,e,c;if(a=Math.round(a),b=Math.round(b),a!==this.width||b!==this.height){this.width=a,this.height=b,this.dirtyId++,this.dirtySize++;for(d=0;d-1&&b.textureCacheIds.splice(d,1),delete q[a],b}else if(a&&a.textureCacheIds){for(c=0;cthis.baseTexture.width,g=e+c>this.baseTexture.height,f||g)throw h=f&&g?"and":"or",i="X: "+d+" + "+b+" = "+(d+b)+" > "+this.baseTexture.width,j="Y: "+e+" + "+c+" = "+(e+c)+" > "+this.baseTexture.height,new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+i+" "+h+" "+j);this.valid=b&&c&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=a),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"rotate",{get:function(){return this._rotate},set:function(a){this._rotate=a,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),a.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(a,"EMPTY",{get:function(){return a._EMPTY||(a._EMPTY=new a(new e),aP(a._EMPTY),aP(a._EMPTY.baseTexture)),a._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(a,"WHITE",{get:function(){if(!a._WHITE){var c=b.ADAPTER.createCanvas(16,16),d=c.getContext("2d");c.width=16,c.height=16,d.fillStyle="white",d.fillRect(0,0,16,16),a._WHITE=new a(e.from(c)),aP(a._WHITE),aP(a._WHITE.baseTexture)}return a._WHITE},enumerable:!1,configurable:!0}),a}(af),G=function(b){function a(c,d){var a=b.call(this,c,d)||this;return a.valid=!0,a.filterFrame=null,a.filterPoolKey=null,a.updateUvs(),a}return h(a,b),Object.defineProperty(a.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(a){this.framebuffer.multisample=a},enumerable:!1,configurable:!0}),a.prototype.resize=function(e,f,b){void 0===b&&(b=!0);var a=this.baseTexture.resolution,c=Math.round(e*a)/a,d=Math.round(f*a)/a;this.valid=c>0&&d>0,this._frame.width=this.orig.width=c,this._frame.height=this.orig.height=d,b&&this.baseTexture.resize(c,d),this.updateUvs()},a.prototype.setResolution=function(b){var a=this.baseTexture;a.resolution!==b&&(a.setResolution(b),this.resize(a.width,a.height,!1))},a.create=function(b){for(var e=arguments,c=[],d=1;d1?-b:-1:(c=((65535&(d=aK(d)))<<16|65535&(e=aK(e)))>>>0,b>1&&(c+=4294967296*b)),this.texturePool[c]||(this.texturePool[c]=[]),g=this.texturePool[c].pop(),g||(g=this.createTexture(d,e,b)),g.filterPoolKey=c,g.setResolution(f),g},b.prototype.getFilterTexture=function(b,d,e){var c=this.getOptimalTexture(b.width,b.height,d||b.resolution,e||a.MSAA_QUALITY.NONE);return c.filterFrame=b.filterFrame,c},b.prototype.returnTexture=function(a){var b=a.filterPoolKey;a.filterFrame=null,this.texturePool[b].push(a)},b.prototype.returnFilterTexture=function(a){this.returnTexture(a)},b.prototype.clear=function(c){var d,a,b;if(c=!1!==c)for(d in this.texturePool)if(a=this.texturePool[d],a)for(b=0;b0&&a.height>0,this.texturePool)if(Number(b)<0){if(c=this.texturePool[b],c)for(d=0;d1){for(g=0;g1&&((h=this.getOptimalFilterTexture(c.width,c.height,b.resolution)).filterFrame=c.filterFrame),i[g].apply(this,c,h,a.CLEAR_MODES.CLEAR,b),n=c,c=h,h=n;i[g].apply(this,c,m.renderTexture,a.CLEAR_MODES.BLEND,b),g>1&&b.multisample>1&&this.returnFilterTexture(b.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}b.clear(),this.statePool.push(b)},b.prototype.bindAndClear=function(b,d){var e,f,g,c,h;void 0===d&&(d=a.CLEAR_MODES.CLEAR),e=this.renderer,f=e.renderTexture,g=e.state,(b===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,b&&b.filterFrame)?(c=this.tempRect,c.x=0,c.y=0,c.width=b.filterFrame.width,c.height=b.filterFrame.height,f.bind(b,b.filterFrame,c)):b!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?f.bind(b):this.renderer.renderTexture.bind(b,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame),h=1&g.stateId||this.forceClear,(d===a.CLEAR_MODES.CLEAR||d===a.CLEAR_MODES.BLIT&&h)&&this.renderer.framebuffer.clear(0,0,0,0)},b.prototype.applyFilter=function(b,d,e,f){var c=this.renderer;c.state.set(b.state),this.bindAndClear(e,f),b.uniforms.uSampler=d,b.uniforms.filterGlobals=this.globalUniforms,c.shader.bind(b),b.legacy=!!b.program.attributeData.aTextureCoord,b.legacy?(this.quadUv.map(d._frame,d.filterFrame),c.geometry.bind(this.quadUv),c.geometry.draw(a.DRAW_MODES.TRIANGLES)):(c.geometry.bind(this.quad),c.geometry.draw(a.DRAW_MODES.TRIANGLE_STRIP))},b.prototype.calculateSpriteMatrix=function(h,b){var c=this.activeState,d=c.sourceFrame,e=c.destinationFrame,f=b._texture.orig,a=h.set(e.width,0,0,e.height,d.x,d.y),g=b.worldTransform.copyTo(m.TEMP_MATRIX);return g.invert(),a.prepend(g),a.scale(1/f.width,1/f.height),a.translate(b.anchor.x,b.anchor.y),a},b.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},b.prototype.getOptimalFilterTexture=function(d,e,b,c){return void 0===b&&(b=1),void 0===c&&(c=a.MSAA_QUALITY.NONE),this.texturePool.getOptimalTexture(d,e,b,c)},b.prototype.getFilterTexture=function(b,c,f){var e,d;return"number"==typeof b&&(e=b,b=c,c=e),b=b||this.activeState.renderTexture,d=this.texturePool.getOptimalTexture(b.width,b.height,c||b.resolution,f||a.MSAA_QUALITY.NONE),d.filterFrame=b.filterFrame,d},b.prototype.returnFilterTexture=function(a){this.texturePool.returnTexture(a)},b.prototype.emptyPool=function(){this.texturePool.clear(!0)},b.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},b.prototype.transformAABB=function(f,a){var b=bi[0],c=bi[1],d=bi[2],e=bi[3],g,h,i,j;b.set(a.left,a.top),c.set(a.left,a.bottom),d.set(a.right,a.top),e.set(a.right,a.bottom),f.apply(b,b),f.apply(c,c),f.apply(d,d),f.apply(e,e),g=Math.min(b.x,c.x,d.x,e.x),h=Math.min(b.y,c.y,d.y,e.y),i=Math.max(b.x,c.x,d.x,e.x),j=Math.max(b.y,c.y,d.y,e.y),a.x=g,a.y=h,a.width=i-g,a.height=j-h},b.prototype.roundFrame=function(c,e,b,d,a){if(!(c.width<=0||c.height<=0||b.width<=0||b.height<=0)){if(a){var f=a.a,g=a.b,h=a.c,i=a.d;if((Math.abs(g)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(f)>1e-4||Math.abs(i)>1e-4))return}(a=a?dD.copyFrom(a):dD.identity()).translate(-b.x,-b.y).scale(d.width/b.width,d.height/b.height).translate(d.x,d.y),this.transformAABB(a,c),c.ceil(e),this.transformAABB(a.invert(),c)}},b}(),aF=function(){function a(a){this.renderer=a}return a.prototype.flush=function(){},a.prototype.destroy=function(){this.renderer=null},a.prototype.start=function(){},a.prototype.stop=function(){this.flush()},a.prototype.render=function(a){},a}(),db=function(){function a(a){this.renderer=a,this.emptyRenderer=new aF(a),this.currentRenderer=this.emptyRenderer}return a.prototype.setObjectRenderer=function(a){this.currentRenderer!==a&&(this.currentRenderer.stop(),this.currentRenderer=a,this.currentRenderer.start())},a.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},a.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},a.prototype.copyBoundTextures=function(b,c){for(var d=this.renderer.texture.boundTextures,a=c-1;a>=0;--a)b[a]=d[a]||null,b[a]&&(b[a]._batchLocation=a)},a.prototype.boundArray=function(e,g,k,h){for(var l=e.elements,i=e.ids,j=e.count,a=0,b=0,c,d,f;b=0&&d=a.ENV.WEBGL2&&(c=d.getContext("webgl2",e)),c)this.webGLVersion=2;else if(this.webGLVersion=1,!(c=d.getContext("webgl",e)||d.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=c,this.getExtensions(),this.gl},c.prototype.getExtensions=function(){var a=this.gl,b={anisotropicFiltering:a.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:a.getExtension("OES_texture_float_linear"),s3tc:a.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:a.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:a.getExtension("WEBGL_compressed_texture_etc"),etc1:a.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:a.getExtension("WEBGL_compressed_texture_atc"),astc:a.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,b,{drawBuffers:a.getExtension("WEBGL_draw_buffers"),depthTexture:a.getExtension("WEBGL_depth_texture"),loseContext:a.getExtension("WEBGL_lose_context"),vertexArrayObject:a.getExtension("OES_vertex_array_object")||a.getExtension("MOZ_OES_vertex_array_object")||a.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:a.getExtension("OES_element_index_uint"),floatTexture:a.getExtension("OES_texture_float"),floatTextureLinear:a.getExtension("OES_texture_float_linear"),textureHalfFloat:a.getExtension("OES_texture_half_float"),textureHalfFloatLinear:a.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,b,{colorBufferFloat:a.getExtension("EXT_color_buffer_float")})},c.prototype.handleContextLost=function(a){a.preventDefault()},c.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},c.prototype.destroy=function(){var a=this.renderer.view;this.renderer=null,a.removeEventListener("webglcontextlost",this.handleContextLost),a.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},c.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},c.prototype.validateContext=function(a){var b=a.getContextAttributes(),c="WebGL2RenderingContext"in globalThis&&a instanceof globalThis.WebGL2RenderingContext,d;c&&(this.webGLVersion=2),b&&!b.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly"),d=c||!!a.getExtension("OES_element_index_uint"),this.supports.uint32Indices=d,d||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},c}(),ei=function(b){this.framebuffer=b,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=a.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ih=new d,dg=function(){function c(a){this.renderer=a,this.managedFramebuffers=[],this.unknownFramebuffer=new a_(10,10),this.msaaSamples=null}return c.prototype.contextChange=function(){var c=this.gl=this.renderer.gl,e,f;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new d,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion?(e=this.renderer.context.extensions.drawBuffers,f=this.renderer.context.extensions.depthTexture,b.PREFER_ENV===a.ENV.WEBGL_LEGACY&&(e=null,f=null),e?c.drawBuffers=function(a){return e.drawBuffersWEBGL(a)}:(this.hasMRT=!1,c.drawBuffers=function(){}),f||(this.writeDepthTexture=!1)):this.msaaSamples=c.getInternalformatParameter(c.RENDERBUFFER,c.RGBA8,c.SAMPLES)},c.prototype.bind=function(a,b,d){var e,c,g,i,f,h,j;if(void 0===d&&(d=0),e=this.gl,a){c=a.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(a),this.current!==a&&(this.current=a,e.bindFramebuffer(e.FRAMEBUFFER,c.framebuffer)),c.mipLevel!==d&&(a.dirtyId++,a.dirtyFormat++,c.mipLevel=d),c.dirtyId!==a.dirtyId&&(c.dirtyId=a.dirtyId,c.dirtyFormat!==a.dirtyFormat?(c.dirtyFormat=a.dirtyFormat,c.dirtySize=a.dirtySize,this.updateFramebuffer(a,d)):c.dirtySize!==a.dirtySize&&(c.dirtySize=a.dirtySize,this.resizeFramebuffer(a)));for(g=0;g>d,h=b.height>>d,j=f/b.width,this.setViewport(b.x*j,b.y*j,f,h)):(f=a.width>>d,h=a.height>>d,this.setViewport(0,0,f,h))}else this.current&&(this.current=null,e.bindFramebuffer(e.FRAMEBUFFER,null)),b?this.setViewport(b.x,b.y,b.width,b.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},c.prototype.setViewport=function(b,c,d,e){var a=this.viewport;b=Math.round(b),c=Math.round(c),d=Math.round(d),e=Math.round(e),a.width===d&&a.height===e&&a.x===b&&a.y===c||(a.x=b,a.y=c,a.width=d,a.height=e,this.gl.viewport(b,c,d,e))},Object.defineProperty(c.prototype,"size",{get:function(){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}},enumerable:!1,configurable:!0}),c.prototype.clear=function(d,e,f,g,b){void 0===b&&(b=a.BUFFER_BITS.COLOR|a.BUFFER_BITS.DEPTH);var c=this.gl;c.clearColor(d,e,f,g),c.clear(b)},c.prototype.initFramebuffer=function(a){var c=this.gl,b=new ei(c.createFramebuffer());return b.multisample=this.detectSamples(a.multisample),a.glFramebuffers[this.CONTEXT_UID]=b,this.managedFramebuffers.push(a),a.disposeRunner.add(this),b},c.prototype.resizeFramebuffer=function(b){var a=this.gl,c=b.glFramebuffers[this.CONTEXT_UID],f,d,e,g,h;c.msaaBuffer&&(a.bindRenderbuffer(a.RENDERBUFFER,c.msaaBuffer),a.renderbufferStorageMultisample(a.RENDERBUFFER,c.multisample,a.RGBA8,b.width,b.height)),c.stencil&&(a.bindRenderbuffer(a.RENDERBUFFER,c.stencil),c.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,c.multisample,a.DEPTH24_STENCIL8,b.width,b.height):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,b.width,b.height)),f=b.colorTextures,d=f.length,a.drawBuffers||(d=Math.min(d,1));for(e=0;e1&&this.canMultisampleFramebuffer(c)?(b.msaaBuffer=b.msaaBuffer||a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,b.msaaBuffer),a.renderbufferStorageMultisample(a.RENDERBUFFER,b.multisample,a.RGBA8,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,b.msaaBuffer)):b.msaaBuffer&&(a.deleteRenderbuffer(b.msaaBuffer),b.msaaBuffer=null,b.blitFramebuffer&&(b.blitFramebuffer.dispose(),b.blitFramebuffer=null));for(f=[],d=0;d1&&a.drawBuffers(f),c.depthTexture&&this.writeDepthTexture&&(k=c.depthTexture,this.renderer.texture.bind(k,0),a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,k._glTextures[this.CONTEXT_UID].texture,i)),!c.stencil&&!c.depth||c.depthTexture&&this.writeDepthTexture?b.stencil&&(a.deleteRenderbuffer(b.stencil),b.stencil=null):(b.stencil=b.stencil||a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,b.stencil),b.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,b.multisample,a.DEPTH24_STENCIL8,c.width,c.height):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,b.stencil))},c.prototype.canMultisampleFramebuffer=function(a){return 1!==this.renderer.context.webGLVersion&&a.colorTextures.length<=1&&!a.depthTexture},c.prototype.detectSamples=function(e){var c=this.msaaSamples,b=a.MSAA_QUALITY.NONE,d;if(e<=1||null===c)return b;for(d=0;d=0&&this.managedFramebuffers.splice(d,1),b.disposeRunner.remove(this),e||(c.deleteFramebuffer(a.framebuffer),a.msaaBuffer&&c.deleteRenderbuffer(a.msaaBuffer),a.stencil&&c.deleteRenderbuffer(a.stencil)),a.blitFramebuffer&&a.blitFramebuffer.dispose())},c.prototype.disposeAll=function(c){var b=this.managedFramebuffers,a;this.managedFramebuffers=[];for(a=0;a=a.ENV.WEBGL2&&(c=d.getContext("webgl2",{})),c||((c=d.getContext("webgl",{})||d.getContext("experimental-webgl",{}))?c.getExtension("WEBGL_draw_buffers"):c=null),aC=c}return aC}function dT(b,c,d){if("precision"!==b.substring(0,9)){var e=c;return c===a.PRECISION.HIGH&&d!==a.PRECISION.HIGH&&(e=a.PRECISION.MEDIUM),"precision "+e+" float;\n"+b}return d!==a.PRECISION.HIGH&&"precision highp"===b.substring(0,15)?b.replace("precision highp","precision mediump"):b}hX={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 dN(a){return hX[a]}bv=null,dL={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 dK(d,e){var b,a,c;if(!bv){b=Object.keys(dL),bv={};for(a=0;a0&&(b+="\nelse "),a0?this.maskStack[this.maskStack.length-1]._colorMask:15;a!==c&&this.renderer.gl.colorMask(0!=(1&a),0!=(2&a),0!=(4&a),0!=(8&a))},b.prototype.destroy=function(){this.renderer=null},b}(),dQ=function(){function a(a){this.renderer=a,this.maskStack=[],this.glConst=0}return a.prototype.getStackLength=function(){return this.maskStack.length},a.prototype.setMaskStack=function(c){var a=this.renderer.gl,d=this.getStackLength(),b;this.maskStack=c,b=this.getStackLength(),b!==d&&(0===b?a.disable(this.glConst):(a.enable(this.glConst),this._useCurrent()))},a.prototype._useCurrent=function(){},a.prototype.destroy=function(){this.renderer=null,this.maskStack=null},a}(),dR=new m,dS=[],dt=function(c){function a(d){var a=c.call(this,d)||this;return a.glConst=b.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,a}return h(a,c),a.prototype.getStackLength=function(){var a=this.maskStack[this.maskStack.length-1];return a?a._scissorCounter:0},a.prototype.calcScissorRect=function(a){var c,g,h,e,b,f;a._scissorRectLocal||(g=a._scissorRect,h=a.maskObject,e=this.renderer,b=e.renderTexture,f=h.getBounds(!0,null!==(c=dS.pop())&&void 0!==c?c:new d),this.roundFrameToPixels(f,b.current?b.current.resolution:e.resolution,b.sourceFrame,b.destinationFrame,e.projection.transform),g&&f.fit(g),a._scissorRectLocal=f)},a.isMatrixRotated=function(a){if(!a)return!1;var b=a.a,c=a.b,d=a.c,e=a.d;return(Math.abs(c)>1e-4||Math.abs(d)>1e-4)&&(Math.abs(b)>1e-4||Math.abs(e)>1e-4)},a.prototype.testScissor=function(b){var c=b.maskObject,d;return!(!c.isFastRect||!c.isFastRect())&&(!a.isMatrixRotated(c.worldTransform)&&(!a.isMatrixRotated(this.renderer.projection.transform)&&(this.calcScissorRect(b),d=b._scissorRectLocal,d.width>0&&d.height>0)))},a.prototype.roundFrameToPixels=function(b,e,f,c,d){a.isMatrixRotated(d)||((d=d?dR.copyFrom(d):dR.identity()).translate(-f.x,-f.y).scale(c.width/f.width,c.height/f.height).translate(c.x,c.y),this.renderer.filter.transformAABB(d,b),b.fit(c),b.x=Math.round(b.x*e),b.y=Math.round(b.y*e),b.width=Math.round(b.width*e),b.height=Math.round(b.height*e))},a.prototype.push=function(a){a._scissorRectLocal||this.calcScissorRect(a);var b=this.renderer.gl;a._scissorRect||b.enable(b.SCISSOR_TEST),a._scissorCounter++,a._scissorRect=a._scissorRectLocal,this._useCurrent()},a.prototype.pop=function(a){var b=this.renderer.gl;a&&dS.push(a._scissorRectLocal),this.getStackLength()>0?this._useCurrent():b.disable(b.SCISSOR_TEST)},a.prototype._useCurrent=function(){var b,a=this.maskStack[this.maskStack.length-1]._scissorRect;b=this.renderer.renderTexture.current?a.y:this.renderer.height-a.height-a.y,this.renderer.gl.scissor(a.x,b,a.width,a.height)},a}(dQ),ds=function(c){function a(d){var a=c.call(this,d)||this;return a.glConst=b.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,a}return h(a,c),a.prototype.getStackLength=function(){var a=this.maskStack[this.maskStack.length-1];return a?a._stencilCounter:0},a.prototype.push=function(c){var d=c.maskObject,a=this.renderer.gl,e=c._stencilCounter,b;0===e&&(this.renderer.framebuffer.forceStencil(),a.clearStencil(0),a.clear(a.STENCIL_BUFFER_BIT),a.enable(a.STENCIL_TEST)),c._stencilCounter++,b=c._colorMask,0!==b&&(c._colorMask=0,a.colorMask(!1,!1,!1,!1)),a.stencilFunc(a.EQUAL,e,4294967295),a.stencilOp(a.KEEP,a.KEEP,a.INCR),d.renderable=!0,d.render(this.renderer),this.renderer.batch.flush(),d.renderable=!1,0!==b&&(c._colorMask=b,a.colorMask(0!=(1&b),0!=(2&b),0!=(4&b),0!=(8&b))),this._useCurrent()},a.prototype.pop=function(d){var a=this.renderer.gl,c,b;0===this.getStackLength()?a.disable(a.STENCIL_TEST):(c=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,b=c?c._colorMask:15,0!==b&&(c._colorMask=0,a.colorMask(!1,!1,!1,!1)),a.stencilOp(a.KEEP,a.KEEP,a.DECR),d.renderable=!0,d.render(this.renderer),this.renderer.batch.flush(),d.renderable=!1,0!==b&&(c._colorMask=b,a.colorMask(0!=(1&b),0!=(2&b),0!=(4&b),0!=(8&b))),this._useCurrent())},a.prototype._useCurrent=function(){var a=this.renderer.gl;a.stencilFunc(a.EQUAL,this.getStackLength(),4294967295),a.stencilOp(a.KEEP,a.KEEP,a.KEEP)},a}(dQ),dq=function(){function a(a){this.renderer=a,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new m,this.transform=null}return a.prototype.update=function(b,c,d,e){this.destinationFrame=b||this.destinationFrame||this.defaultFrame,this.sourceFrame=c||this.sourceFrame||b,this.calculateProjection(this.destinationFrame,this.sourceFrame,d,e),this.transform&&this.projectionMatrix.append(this.transform);var a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)},a.prototype.calculateProjection=function(e,b,f,d){var a=this.projectionMatrix,c=d?-1:1;a.identity(),a.a=1/b.width*2,a.d=c*(1/b.height*2),a.tx=-1-b.x*a.a,a.ty=-c-b.y*a.d},a.prototype.setTransform=function(a){},a.prototype.destroy=function(){this.renderer=null},a}(),$=new d,aE=new d,dk=function(){function a(a){this.renderer=a,this.clearColor=a._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new d,this.destinationFrame=new d,this.viewportFrame=new d}return a.prototype.bind=function(a,c,b){var g,h,e,f,d;void 0===a&&(a=null),f=this.renderer,this.current=a,a?(e=(g=a.baseTexture).resolution,c||($.width=a.frame.width,$.height=a.frame.height,c=$),b||(aE.x=a.frame.x,aE.y=a.frame.y,aE.width=c.width,aE.height=c.height,b=aE),h=g.framebuffer):(e=f.resolution,c||($.width=f.screen.width,$.height=f.screen.height,c=$),b||((b=$).width=c.width,b.height=c.height)),d=this.viewportFrame,d.x=b.x*e,d.y=b.y*e,d.width=b.width*e,d.height=b.height*e,a||(d.y=f.view.height-(d.y+d.height)),d.ceil(),this.renderer.framebuffer.bind(h,d),this.renderer.projection.update(b,c,e,!h),a?this.renderer.mask.setMaskStack(g.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(c),this.destinationFrame.copyFrom(b)},a.prototype.clear=function(a,j){var h,i,g,b,f,c,d,e;a=this.current?a||this.current.baseTexture.clearColor:a||this.clearColor,h=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,g=h.width!==i.width||h.height!==i.height,g&&(b=this.viewportFrame,f=b.x,c=b.y,d=b.width,e=b.height,f=Math.round(f),c=Math.round(c),d=Math.round(d),e=Math.round(e),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(f,c,d,e)),this.renderer.framebuffer.clear(a[0],a[1],a[2],a[3],j),g&&this.renderer.scissor.pop()},a.prototype.resize=function(){this.bind(null)},a.prototype.reset=function(){this.bind(null)},a.prototype.destroy=function(){this.renderer=null},a}();function hW(c,d,a,e,b){a.buffer.update(b)}hU={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},d$={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function ea(h){for(var e=h.map(function(a){return{data:a,offset:0,dataLen:0,dirty:0}}),a=0,c=0,b=0,f=0,d,g;f1&&(a=Math.max(a,16)*d.data.size),d.dataLen=a,c%a!=0&&c<16)&&(g=c%a%16,c+=g,b+=g),c+a>16?(b=16*Math.ceil(b/16),d.offset=b,b+=a,c=a):(d.offset=b,c+=a,b+=a);return{uboElements:e,size:b=16*Math.ceil(b/16)}}function eb(d,b){var a=[],c;for(c in d)b[c]&&a.push(b[c]);return a.sort(function(a,b){return a.index-b.index}),a}function ec(m,r){var f,k,o,b,e,a,j,c,l,d,h,n,g,i,p,q;if(!m.autoManage)return{size:0,syncFunc:hW};for(f=ea(eb(m.uniforms,r)),k=f.uboElements,o=f.size,b=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],e=0;e1?(n=dN(a.data.type),g=Math.max(d$[a.data.type]/16,1),i=n/g,p=(4-i%4)%4,b.push("\n cv = ud."+c+".value;\n v = uv."+c+";\n offset = "+a.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+a.data.size*g+"; i++)\n {\n for(var j = 0; j < "+i+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+p+";\n }\n\n ")):(q=hU[a.data.type],b.push("\n cv = ud."+c+".value;\n v = uv."+c+";\n offset = "+a.offset/4+";\n "+q+";\n ")))}return b.push("\n renderer.buffer.update(buffer);\n "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",b.join("\n"))}}ed=function(){function a(a,b){this.program=a,this.uniformData=b,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return a.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},a}();function ee(a,d){var f=dY(a,a.VERTEX_SHADER,d.vertexSrc),g=dY(a,a.FRAGMENT_SHADER,d.fragmentSrc),b=a.createProgram(),e,c,h,i;if(a.attachShader(b,f),a.attachShader(b,g),a.linkProgram(b),a.getProgramParameter(b,a.LINK_STATUS)||function(a,b,c,d){a.getProgramParameter(b,a.LINK_STATUS)||(a.getShaderParameter(c,a.COMPILE_STATUS)||dX(a,c),a.getShaderParameter(d,a.COMPILE_STATUS)||dX(a,d),console.error("PixiJS Error: Could not initialize shader."),""!==a.getProgramInfoLog(b)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",a.getProgramInfoLog(b)))}(a,b,f,g),d.attributeData=function(c,a){for(var e={},g=a.getProgramParameter(c,a.ACTIVE_ATTRIBUTES),d=0,b,f,h;db?1:-1});for(c=0;c>=1,b++;this.stateId=a.data}for(b=0;bthis.checkCountMax&&(this.checkCount=0,this.run())))},c.prototype.run=function(){for(var d=this.renderer.texture,b=d.managedTextures,e=!1,a=0,c,f;athis.maxIdle&&(d.destroyTexture(c,!0),b[a]=null,e=!0);if(e){f=0;for(a=0;a=0;c--)this.unload(a.children[c])},c.prototype.destroy=function(){this.renderer=null},c}(),be=function(b){this.texture=b,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=a.TYPES.UNSIGNED_BYTE,this.internalFormat=a.FORMATS.RGBA,this.samplerType=0},cW=function(){function b(a){this.renderer=a,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new e,this.hasIntegerTextures=!1}return b.prototype.contextChange=function(){var b=this.gl=this.renderer.gl,d,c,e;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(b){var c,d,e,f,l,i,j,h,k,u,t,y,n,p,q,r,s,m,g,v,w,x,o;return"WebGL2RenderingContext"in globalThis&&b instanceof globalThis.WebGL2RenderingContext?((c={})[a.TYPES.UNSIGNED_BYTE]=((d={})[a.FORMATS.RGBA]=b.RGBA8,d[a.FORMATS.RGB]=b.RGB8,d[a.FORMATS.RG]=b.RG8,d[a.FORMATS.RED]=b.R8,d[a.FORMATS.RGBA_INTEGER]=b.RGBA8UI,d[a.FORMATS.RGB_INTEGER]=b.RGB8UI,d[a.FORMATS.RG_INTEGER]=b.RG8UI,d[a.FORMATS.RED_INTEGER]=b.R8UI,d[a.FORMATS.ALPHA]=b.ALPHA,d[a.FORMATS.LUMINANCE]=b.LUMINANCE,d[a.FORMATS.LUMINANCE_ALPHA]=b.LUMINANCE_ALPHA,d),c[a.TYPES.BYTE]=((e={})[a.FORMATS.RGBA]=b.RGBA8_SNORM,e[a.FORMATS.RGB]=b.RGB8_SNORM,e[a.FORMATS.RG]=b.RG8_SNORM,e[a.FORMATS.RED]=b.R8_SNORM,e[a.FORMATS.RGBA_INTEGER]=b.RGBA8I,e[a.FORMATS.RGB_INTEGER]=b.RGB8I,e[a.FORMATS.RG_INTEGER]=b.RG8I,e[a.FORMATS.RED_INTEGER]=b.R8I,e),c[a.TYPES.UNSIGNED_SHORT]=((f={})[a.FORMATS.RGBA_INTEGER]=b.RGBA16UI,f[a.FORMATS.RGB_INTEGER]=b.RGB16UI,f[a.FORMATS.RG_INTEGER]=b.RG16UI,f[a.FORMATS.RED_INTEGER]=b.R16UI,f[a.FORMATS.DEPTH_COMPONENT]=b.DEPTH_COMPONENT16,f),c[a.TYPES.SHORT]=((l={})[a.FORMATS.RGBA_INTEGER]=b.RGBA16I,l[a.FORMATS.RGB_INTEGER]=b.RGB16I,l[a.FORMATS.RG_INTEGER]=b.RG16I,l[a.FORMATS.RED_INTEGER]=b.R16I,l),c[a.TYPES.UNSIGNED_INT]=((i={})[a.FORMATS.RGBA_INTEGER]=b.RGBA32UI,i[a.FORMATS.RGB_INTEGER]=b.RGB32UI,i[a.FORMATS.RG_INTEGER]=b.RG32UI,i[a.FORMATS.RED_INTEGER]=b.R32UI,i[a.FORMATS.DEPTH_COMPONENT]=b.DEPTH_COMPONENT24,i),c[a.TYPES.INT]=((j={})[a.FORMATS.RGBA_INTEGER]=b.RGBA32I,j[a.FORMATS.RGB_INTEGER]=b.RGB32I,j[a.FORMATS.RG_INTEGER]=b.RG32I,j[a.FORMATS.RED_INTEGER]=b.R32I,j),c[a.TYPES.FLOAT]=((h={})[a.FORMATS.RGBA]=b.RGBA32F,h[a.FORMATS.RGB]=b.RGB32F,h[a.FORMATS.RG]=b.RG32F,h[a.FORMATS.RED]=b.R32F,h[a.FORMATS.DEPTH_COMPONENT]=b.DEPTH_COMPONENT32F,h),c[a.TYPES.HALF_FLOAT]=((k={})[a.FORMATS.RGBA]=b.RGBA16F,k[a.FORMATS.RGB]=b.RGB16F,k[a.FORMATS.RG]=b.RG16F,k[a.FORMATS.RED]=b.R16F,k),c[a.TYPES.UNSIGNED_SHORT_5_6_5]=((u={})[a.FORMATS.RGB]=b.RGB565,u),c[a.TYPES.UNSIGNED_SHORT_4_4_4_4]=((t={})[a.FORMATS.RGBA]=b.RGBA4,t),c[a.TYPES.UNSIGNED_SHORT_5_5_5_1]=((y={})[a.FORMATS.RGBA]=b.RGB5_A1,y),c[a.TYPES.UNSIGNED_INT_2_10_10_10_REV]=((n={})[a.FORMATS.RGBA]=b.RGB10_A2,n[a.FORMATS.RGBA_INTEGER]=b.RGB10_A2UI,n),c[a.TYPES.UNSIGNED_INT_10F_11F_11F_REV]=((p={})[a.FORMATS.RGB]=b.R11F_G11F_B10F,p),c[a.TYPES.UNSIGNED_INT_5_9_9_9_REV]=((q={})[a.FORMATS.RGB]=b.RGB9_E5,q),c[a.TYPES.UNSIGNED_INT_24_8]=((r={})[a.FORMATS.DEPTH_STENCIL]=b.DEPTH24_STENCIL8,r),c[a.TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]=((s={})[a.FORMATS.DEPTH_STENCIL]=b.DEPTH32F_STENCIL8,s),o=c):((m={})[a.TYPES.UNSIGNED_BYTE]=((g={})[a.FORMATS.RGBA]=b.RGBA,g[a.FORMATS.RGB]=b.RGB,g[a.FORMATS.ALPHA]=b.ALPHA,g[a.FORMATS.LUMINANCE]=b.LUMINANCE,g[a.FORMATS.LUMINANCE_ALPHA]=b.LUMINANCE_ALPHA,g),m[a.TYPES.UNSIGNED_SHORT_5_6_5]=((v={})[a.FORMATS.RGB]=b.RGB,v),m[a.TYPES.UNSIGNED_SHORT_4_4_4_4]=((w={})[a.FORMATS.RGBA]=b.RGBA,w),m[a.TYPES.UNSIGNED_SHORT_5_5_5_1]=((x={})[a.FORMATS.RGBA]=b.RGBA,x),o=m),o}(b),d=b.getParameter(b.MAX_TEXTURE_IMAGE_UNITS),this.boundTextures.length=d;for(c=0;c=0;--d)b=e[d],b&&b._glTextures[g].samplerType!==a.SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(b)},b.prototype.initTexture=function(a){var b=new be(this.gl.createTexture());return b.dirtyId=-1,a._glTextures[this.CONTEXT_UID]=b,this.managedTextures.push(a),a.on("dispose",this.destroyTexture,this),b},b.prototype.initTextureType=function(b,c){var d,e;c.internalFormat=null!==(e=null===(d=this.internalFormats[b.type])||void 0===d?void 0:d[b.format])&&void 0!==e?e:b.format,2===this.webGLVersion&&b.type===a.TYPES.HALF_FLOAT?c.type=this.gl.HALF_FLOAT:c.type=b.type},b.prototype.updateTexture=function(c){var b=c._glTextures[this.CONTEXT_UID],f,d,e,g;b&&(f=this.renderer,(this.initTextureType(c,b),c.resource&&c.resource.upload(f,c,b))?b.samplerType!==a.SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0):(d=c.realWidth,e=c.realHeight,g=f.gl,(b.width!==d||b.height!==e||b.dirtyId<0)&&(b.width=d,b.height=e,g.texImage2D(c.target,0,b.internalFormat,d,e,0,c.format,b.type,null))),c.dirtyStyleId!==b.dirtyStyleId&&this.updateTextureStyle(c),b.dirtyId=c.dirtyId)},b.prototype.destroyTexture=function(a,c){var d=this.gl,b;(a=a.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(a),d.deleteTexture(a._glTextures[this.CONTEXT_UID].texture),a.off("dispose",this.destroyTexture,this),delete a._glTextures[this.CONTEXT_UID],!c)&&(b=this.managedTextures.indexOf(a),-1!==b&&_(this.managedTextures,b,1))},b.prototype.updateTextureStyle=function(b){var c=b._glTextures[this.CONTEXT_UID];c&&(b.mipmap!==a.MIPMAP_MODES.POW2&&2===this.webGLVersion||b.isPowerOfTwo?c.mipmap=b.mipmap>=1:c.mipmap=!1,2===this.webGLVersion||b.isPowerOfTwo?c.wrapMode=b.wrapMode:c.wrapMode=a.WRAP_MODES.CLAMP,b.resource&&b.resource.style(this.renderer,b,c)||this.setStyle(b,c),c.dirtyStyleId=b.dirtyStyleId)},b.prototype.setStyle=function(c,d){var b=this.gl,e,f;d.mipmap&&c.mipmap!==a.MIPMAP_MODES.ON_MANUAL&&b.generateMipmap(c.target),b.texParameteri(c.target,b.TEXTURE_WRAP_S,d.wrapMode),b.texParameteri(c.target,b.TEXTURE_WRAP_T,d.wrapMode),d.mipmap?(b.texParameteri(c.target,b.TEXTURE_MIN_FILTER,c.scaleMode===a.SCALE_MODES.LINEAR?b.LINEAR_MIPMAP_LINEAR:b.NEAREST_MIPMAP_NEAREST),e=this.renderer.context.extensions.anisotropicFiltering,e&&c.anisotropicLevel>0&&c.scaleMode===a.SCALE_MODES.LINEAR&&(f=Math.min(c.anisotropicLevel,b.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),b.texParameterf(c.target,e.TEXTURE_MAX_ANISOTROPY_EXT,f))):b.texParameteri(c.target,b.TEXTURE_MIN_FILTER,c.scaleMode===a.SCALE_MODES.LINEAR?b.LINEAR:b.NEAREST),b.texParameteri(c.target,b.TEXTURE_MAG_FILTER,c.scaleMode===a.SCALE_MODES.LINEAR?b.LINEAR:b.NEAREST)},b.prototype.destroy=function(){this.renderer=null},b}(),em={__proto__:null,FilterSystem:c$,BatchSystem:db,ContextSystem:dd,FramebufferSystem:dg,GeometrySystem:di,MaskSystem:du,ScissorSystem:dt,StencilSystem:ds,ProjectionSystem:dq,RenderTextureSystem:dk,ShaderSystem:df,StateSystem:de,TextureGCSystem:dc,TextureSystem:cW},cU=new m,eo=function(e){function c(g,f){void 0===g&&(g=a.RENDERER_TYPE.UNKNOWN);var c=e.call(this)||this;return f=Object.assign({},b.RENDER_OPTIONS,f),c.options=f,c.type=g,c.screen=new d(0,0,f.width,f.height),c.view=f.view||b.ADAPTER.createCanvas(),c.resolution=f.resolution||b.RESOLUTION,c.useContextAlpha=f.useContextAlpha,c.autoDensity=!!f.autoDensity,c.preserveDrawingBuffer=f.preserveDrawingBuffer,c.clearBeforeRender=f.clearBeforeRender,c._backgroundColor=0,c._backgroundColorRgba=[0,0,0,1],c._backgroundColorString="#000000",c.backgroundColor=f.backgroundColor||c._backgroundColor,c.backgroundAlpha=f.backgroundAlpha,void 0!==f.transparent&&(c.useContextAlpha=f.transparent,c.backgroundAlpha=f.transparent?0:1),c._lastObjectRendered=null,c.plugins={},c}return h(c,e),c.prototype.initPlugins=function(a){for(var b in a)this.plugins[b]=new a[b](this)},Object.defineProperty(c.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),c.prototype.resize=function(c,d){this.view.width=Math.round(c*this.resolution),this.view.height=Math.round(d*this.resolution);var a=this.view.width/this.resolution,b=this.view.height/this.resolution;this.screen.width=a,this.screen.height=b,this.autoDensity&&(this.view.style.width=a+"px",this.view.style.height=b+"px"),this.emit("resize",a,b)},c.prototype.generateTexture=function(c,b,g,a){var e,f,d;return void 0===b&&(b={}),"number"==typeof b&&(b={scaleMode:b,resolution:g,region:a}),e=b.region,f=function(b,e){var d={},a,c;for(a in b)Object.prototype.hasOwnProperty.call(b,a)&&e.indexOf(a)<0&&(d[a]=b[a]);if(null!=b&&"function"==typeof Object.getOwnPropertySymbols){c=0;for(a=Object.getOwnPropertySymbols(b);c=a.data.byteLength?b.bufferSubData(a.type,0,a.data):(e=a.static?b.STATIC_DRAW:b.DYNAMIC_DRAW,c.byteLength=a.data.byteLength,b.bufferData(a.type,a.data,e)))},a.prototype.dispose=function(a,c){if(this.managedBuffers[a.id]){delete this.managedBuffers[a.id];var b=a._glBuffers[this.CONTEXT_UID],d=this.gl;a.disposeRunner.remove(this),b&&(c||d.deleteBuffer(b.buffer),delete a._glBuffers[this.CONTEXT_UID])}},a.prototype.disposeAll=function(c){for(var b=Object.keys(this.managedBuffers),a=0;a=a.MSAA_QUALITY.HIGH?this.multisample=a.MSAA_QUALITY.HIGH:c>=a.MSAA_QUALITY.MEDIUM?this.multisample=a.MSAA_QUALITY.MEDIUM:c>=a.MSAA_QUALITY.LOW?this.multisample=a.MSAA_QUALITY.LOW:this.multisample=a.MSAA_QUALITY.NONE},b.prototype.addSystem=function(c,a){var b=new c(this),d;if(this[a])throw new Error('Whoops! The name "'+a+'" is already in use');for(d in this[a]=b,this.runners)this.runners[d].add(b);return this},b.prototype.render=function(c,a){var b,d,e,f,g;a&&(a instanceof G?(b=a,d=arguments[2],e=arguments[3],f=arguments[4]):(b=a.renderTexture,d=a.clear,e=a.transform,f=a.skipUpdateTransform)),this.renderingToScreen=!b,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=e,!this.context.isLost&&(b||(this._lastObjectRendered=c),!f&&(g=c.enableTempParent(),c.updateTransform(),c.disableTempParent(g)),this.renderTexture.bind(b),this.batch.currentRenderer.start(),(void 0!==d?d:this.clearBeforeRender)&&this.renderTexture.clear(),c.render(this),this.batch.currentRenderer.flush(),b&&b.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender"))},b.prototype.generateTexture=function(b,a,d,e){void 0===a&&(a={});var f=c.prototype.generateTexture.call(this,b,a,d,e);return this.framebuffer.blit(),f},b.prototype.resize=function(a,b){c.prototype.resize.call(this,a,b),this.runners.resize.emit(this.screen.height,this.screen.width)},b.prototype.reset=function(){return this.runners.reset.emit(),this},b.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},b.prototype.destroy=function(a){for(var b in this.runners.destroy.emit(),this.runners)this.runners[b].destroy();c.prototype.destroy.call(this,a),this.gl=null},Object.defineProperty(b.prototype,"extract",{get:function(){return this.plugins.extract},enumerable:!1,configurable:!0}),b.registerPlugin=function(b,c){A.add({name:b,type:a.ExtensionType.RendererPlugin,ref:c})},b.__plugins={},b}(eo);function es(a){return cS.create(a)}A.handleByMap(a.ExtensionType.RendererPlugin,cS.__plugins),et="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",cR="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",hB=function(){function a(a){this.renderer=a}return a.prototype.destroy=function(){this.renderer=null},a}(),bb=function(){this.texArray=null,this.blend=0,this.type=a.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null},aY=function(){function a(){this.elements=[],this.ids=[],this.count=0}return a.prototype.clear=function(){for(var a=0;athis.size&&this.flush(),this._vertexCount+=a.vertexData.length/2,this._indexCount+=a.indices.length,this._bufferedTextures[this._bufferSize]=a._texture.baseTexture,this._bufferedElements[this._bufferSize++]=a)},c.prototype.buildTexturesAndDrawCalls=function(){var k=this._bufferedTextures,g=this.MAX_TEXTURES,m=c._textureArrayPool,i=this.renderer.batch,f=this._tempBoundTextures,n=this.renderer.textureGC.count,d=++e._globalBatch,l=0,b=m[0],j=0,a,h;i.copyBoundTextures(f,g);for(a=0;a=g&&(i.boundArray(b,f,d,g),this.buildDrawCalls(b,j,a),j=a,b=m[++l],++d),h._batchEnabled=d,h.touched=n,b.elements[b.count++]=h);for(b.count>0&&(i.boundArray(b,f,d,g),this.buildDrawCalls(b,j,this._bufferSize),++l,++d),a=0;a0&&(a+="\nelse "),b title : "+a.title+"
tabIndex: "+a.tabIndex},b.prototype.capHitArea=function(a){a.x<0&&(a.width+=a.x,a.x=0),a.y<0&&(a.height+=a.y,a.y=0);var b=this.renderer,c=b.width,d=b.height;a.x+a.width>c&&(a.width=c-a.x),a.y+a.height>d&&(a.height=d-a.y)},b.prototype.addChild=function(b){var a=this.pool.pop();a||((a=document.createElement("button")).style.width="100px",a.style.height="100px",a.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",a.style.position="absolute",a.style.zIndex=2..toString(),a.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?a.setAttribute("aria-live","off"):a.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?a.setAttribute("aria-relevant","additions"):a.setAttribute("aria-relevant","text"),a.addEventListener("click",this._onClick.bind(this)),a.addEventListener("focus",this._onFocus.bind(this)),a.addEventListener("focusout",this._onFocusOut.bind(this))),a.style.pointerEvents=b.accessiblePointerEvents,a.type=b.accessibleType,b.accessibleTitle&&null!==b.accessibleTitle?a.title=b.accessibleTitle:b.accessibleHint&&null!==b.accessibleHint||(a.title="displayObject "+b.tabIndex),b.accessibleHint&&null!==b.accessibleHint&&a.setAttribute("aria-label",b.accessibleHint),this.debug&&this.updateDebugHTML(a),b._accessibleActive=!0,b._accessibleDiv=a,a.displayObject=b,this.children.push(b),this.div.appendChild(b._accessibleDiv),b._accessibleDiv.tabIndex=b.tabIndex},b.prototype._onClick=function(d){var a=this.renderer.plugins.interaction,b=d.target.displayObject,c=a.eventData;a.dispatchEvent(b,"click",c),a.dispatchEvent(b,"pointertap",c),a.dispatchEvent(b,"tap",c)},b.prototype._onFocus=function(a){a.target.getAttribute("aria-live")||a.target.setAttribute("aria-live","assertive");var b=this.renderer.plugins.interaction,c=a.target.displayObject,d=b.eventData;b.dispatchEvent(c,"mouseover",d)},b.prototype._onFocusOut=function(a){a.target.getAttribute("aria-live")||a.target.setAttribute("aria-live","polite");var b=this.renderer.plugins.interaction,c=a.target.displayObject,d=b.eventData;b.dispatchEvent(c,"mouseout",d)},b.prototype._onKeyDown=function(a){9===a.keyCode&&this.activate()},b.prototype._onMouseMove=function(a){0===a.movementX&&0===a.movementY||this.deactivate()},b.prototype.destroy=function(){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},b.extension={name:"accessibility",type:[a.ExtensionType.RendererPlugin,a.ExtensionType.CanvasRendererPlugin]},b}(),cC=function(){function a(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(a.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),a.prototype.getLocalPosition=function(a,b,c){return a.worldTransform.applyInverse(c||this.global,b)},a.prototype.copyEvent=function(a){"isPrimary"in a&&a.isPrimary&&(this.isPrimary=!0),this.button="button"in a&&a.button;var b="buttons"in a&&a.buttons;this.buttons=Number.isInteger(b)?b:"which"in a&&a.which,this.width="width"in a&&a.width,this.height="height"in a&&a.height,this.tiltX="tiltX"in a&&a.tiltX,this.tiltY="tiltY"in a&&a.tiltY,this.pointerType="pointerType"in a&&a.pointerType,this.pressure="pressure"in a&&a.pressure,this.rotationAngle="rotationAngle"in a&&a.rotationAngle,this.twist="twist"in a&&a.twist||0,this.tangentialPressure="tangentialPressure"in a&&a.tangentialPressure||0},a.prototype.reset=function(){this.isPrimary=!1},a}(),cr=function(a,b){return cr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cr(a,b)},eP=function(){function a(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return a.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},a.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},a}(),bA=function(){function a(b){this._pointerId=b,this._flags=a.FLAGS.NONE}return a.prototype._doSet=function(a,b){this._flags=b?this._flags|a:this._flags&~a},Object.defineProperty(a.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"flags",{get:function(){return this._flags},set:function(a){this._flags=a},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"none",{get:function(){return this._flags===a.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"over",{get:function(){return 0!=(this._flags&a.FLAGS.OVER)},set:function(b){this._doSet(a.FLAGS.OVER,b)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"rightDown",{get:function(){return 0!=(this._flags&a.FLAGS.RIGHT_DOWN)},set:function(b){this._doSet(a.FLAGS.RIGHT_DOWN,b)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"leftDown",{get:function(){return 0!=(this._flags&a.FLAGS.LEFT_DOWN)},set:function(b){this._doSet(a.FLAGS.LEFT_DOWN,b)},enumerable:!1,configurable:!0}),a.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),a}(),hr=function(){function a(){this._tempPoint=new g}return a.prototype.recursiveFindHit=function(c,a,h,b,e){var f,g,d,i,l,j,m,k,n,o;if(!a||!a.visible)return!1;if(g=c.data.global,d=!1,i=e=a.interactive||e,l=!0,a.hitArea?(b&&(a.worldTransform.applyInverse(g,this._tempPoint),a.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?d=!0:(b=!1,l=!1)),i=!1):a._mask&&b&&(j=a._mask.isMaskData?a._mask.maskObject:a._mask,j&&!(null===(f=j.containsPoint)||void 0===f?void 0:f.call(j,g))&&(b=!1)),l&&a.interactiveChildren&&a.children)for(m=a.children,k=m.length-1;k>=0;k--)if(n=m[k],o=this.recursiveFindHit(c,n,h,b,i),o){if(!n.parent)continue;i=!1,o&&(c.target&&(b=!1),d=!0)}return e&&(b&&!c.target&&!a.hitArea&&a.containsPoint&&a.containsPoint(g)&&(d=!0),a.interactive&&(d&&!c.target&&(c.target=a),h&&h(c,a,!!d))),d},a.prototype.findHit=function(a,b,c,d){this.recursiveFindHit(a,b,c,d,!1)},a}(),eS={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(a){a?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0},k.mixin(eS),bw={target:null,data:{global:null}},eU=function(c){function b(d,b){var a=c.call(this)||this;return b=b||{},a.renderer=d,a.autoPreventDefault=void 0===b.autoPreventDefault||b.autoPreventDefault,a.interactionFrequency=b.interactionFrequency||10,a.mouse=new cC,a.mouse.identifier=1,a.mouse.global.set(-999999),a.activeInteractionData={},a.activeInteractionData[1]=a.mouse,a.interactionDataPool=[],a.eventData=new eP,a.interactionDOMElement=null,a.moveWhenInside=!1,a.eventsAdded=!1,a.tickerAdded=!1,a.mouseOverRenderer=!("PointerEvent"in globalThis),a.supportsTouchEvents="ontouchstart"in globalThis,a.supportsPointerEvents=!!globalThis.PointerEvent,a.onPointerUp=a.onPointerUp.bind(a),a.processPointerUp=a.processPointerUp.bind(a),a.onPointerCancel=a.onPointerCancel.bind(a),a.processPointerCancel=a.processPointerCancel.bind(a),a.onPointerDown=a.onPointerDown.bind(a),a.processPointerDown=a.processPointerDown.bind(a),a.onPointerMove=a.onPointerMove.bind(a),a.processPointerMove=a.processPointerMove.bind(a),a.onPointerOut=a.onPointerOut.bind(a),a.processPointerOverOut=a.processPointerOverOut.bind(a),a.onPointerOver=a.onPointerOver.bind(a),a.cursorStyles={default:"inherit",pointer:"pointer"},a.currentCursorMode=null,a.cursor=null,a.resolution=1,a.delayedEvents=[],a.search=new hr,a._tempDisplayObject=new ca,a._eventListenerOptions={capture:!0,passive:!1},a._useSystemTicker=void 0===b.useSystemTicker||b.useSystemTicker,a.setTargetElement(a.renderer.view,a.renderer.resolution),a}return function(b,a){function c(){this.constructor=b}cr(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(b,c),Object.defineProperty(b.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(a){this._useSystemTicker=a,a?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),b.prototype.hitTest=function(b,a){return bw.target=null,bw.data.global=b,a||(a=this.lastObjectRendered),this.processInteractive(bw,a,null,!0),bw.target},b.prototype.setTargetElement=function(b,a){void 0===a&&(a=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=b,this.resolution=a,this.addEvents(),this.addTickerListener()},b.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(o.system.add(this.tickerUpdate,this,a.UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)},b.prototype.removeTickerListener=function(){this.tickerAdded&&(o.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},b.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var a=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(a.msContentZooming="none",a.msTouchAction="none"):this.supportsPointerEvents&&(a.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},b.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var a=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(a.msContentZooming="",a.msTouchAction=""):this.supportsPointerEvents&&(a.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},b.prototype.tickerUpdate=function(a){this._deltaTime+=a,this._deltaTime0&&(h=b.composedPath()[0]);for(d=h!==this.interactionDOMElement?"outside":"",f=0;f0||b.responseType===a.XHR_RESPONSE_TYPE.BUFFER)?d=200:1223===d&&(d=204),2==(d/100|0)){if(this.xhrType===a.XHR_RESPONSE_TYPE.TEXT)this.data=c,this.type=a.TYPE.TEXT;else if(this.xhrType===a.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(c),this.type=a.TYPE.JSON}catch(a){return void this.abort("Error trying to parse loaded json: "+a)}else if(this.xhrType===a.XHR_RESPONSE_TYPE.DOCUMENT)try{globalThis.DOMParser?(f=new DOMParser,this.data=f.parseFromString(c,"text/xml")):(e=document.createElement("div"),e.innerHTML=c,this.data=e),this.type=a.TYPE.XML}catch(a){return void this.abort("Error trying to parse loaded xml: "+a)}else this.data=b.response||c;this.complete()}else this.abort("["+b.status+"] "+b.statusText+": "+b.responseURL)},a.prototype._determineCrossOrigin=function(c,a){if(0===c.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";a=a||globalThis.location,bh||(bh=document.createElement("a")),bh.href=c;var b=e$(bh.href,{strictMode:!0}),d=!b.port&&""===a.port||b.port===a.port,e=b.protocol?b.protocol+":":"";return b.host===a.hostname&&d&&e===a.protocol?"":"anonymous"},a.prototype._determineXhrType=function(){return a._xhrTypeMap[this.extension]||a.XHR_RESPONSE_TYPE.TEXT},a.prototype._determineLoadType=function(){return a._loadTypeMap[this.extension]||a.LOAD_TYPE.XHR},a.prototype._getExtension=function(a){var b,c,d,e,f;return void 0===a&&(a=this.url),b="",this.isDataUrl?(c=a.indexOf("/"),b=a.substring(c+1,a.indexOf(";",c))):(d=a.indexOf("?"),e=a.indexOf("#"),f=Math.min(d>-1?d:a.length,e>-1?e:a.length),b=(a=a.substring(0,f)).substring(a.lastIndexOf(".")+1)),b.toLowerCase()},a.prototype._getMimeFromXhrType=function(b){switch(b){case a.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case a.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case a.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case a.XHR_RESPONSE_TYPE.JSON:return"application/json";case a.XHR_RESPONSE_TYPE.DEFAULT:case a.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},a}(),function(a){var c,b,d,e;(c=a.STATUS_FLAGS||(a.STATUS_FLAGS={}))[c.NONE=0]="NONE",c[c.DATA_URL=1]="DATA_URL",c[c.COMPLETE=2]="COMPLETE",c[c.LOADING=4]="LOADING",(b=a.TYPE||(a.TYPE={}))[b.UNKNOWN=0]="UNKNOWN",b[b.JSON=1]="JSON",b[b.XML=2]="XML",b[b.IMAGE=3]="IMAGE",b[b.AUDIO=4]="AUDIO",b[b.VIDEO=5]="VIDEO",b[b.TEXT=6]="TEXT",(d=a.LOAD_TYPE||(a.LOAD_TYPE={}))[d.XHR=1]="XHR",d[d.IMAGE=2]="IMAGE",d[d.AUDIO=3]="AUDIO",d[d.VIDEO=4]="VIDEO",(e=a.XHR_RESPONSE_TYPE||(a.XHR_RESPONSE_TYPE={})).DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text",a._loadTypeMap={gif:a.LOAD_TYPE.IMAGE,png:a.LOAD_TYPE.IMAGE,bmp:a.LOAD_TYPE.IMAGE,jpg:a.LOAD_TYPE.IMAGE,jpeg:a.LOAD_TYPE.IMAGE,tif:a.LOAD_TYPE.IMAGE,tiff:a.LOAD_TYPE.IMAGE,webp:a.LOAD_TYPE.IMAGE,tga:a.LOAD_TYPE.IMAGE,avif:a.LOAD_TYPE.IMAGE,svg:a.LOAD_TYPE.IMAGE,"svg+xml":a.LOAD_TYPE.IMAGE,mp3:a.LOAD_TYPE.AUDIO,ogg:a.LOAD_TYPE.AUDIO,wav:a.LOAD_TYPE.AUDIO,mp4:a.LOAD_TYPE.VIDEO,webm:a.LOAD_TYPE.VIDEO},a._xhrTypeMap={xhtml:a.XHR_RESPONSE_TYPE.DOCUMENT,html:a.XHR_RESPONSE_TYPE.DOCUMENT,htm:a.XHR_RESPONSE_TYPE.DOCUMENT,xml:a.XHR_RESPONSE_TYPE.DOCUMENT,tmx:a.XHR_RESPONSE_TYPE.DOCUMENT,svg:a.XHR_RESPONSE_TYPE.DOCUMENT,tsx:a.XHR_RESPONSE_TYPE.DOCUMENT,gif:a.XHR_RESPONSE_TYPE.BLOB,png:a.XHR_RESPONSE_TYPE.BLOB,bmp:a.XHR_RESPONSE_TYPE.BLOB,jpg:a.XHR_RESPONSE_TYPE.BLOB,jpeg:a.XHR_RESPONSE_TYPE.BLOB,tif:a.XHR_RESPONSE_TYPE.BLOB,tiff:a.XHR_RESPONSE_TYPE.BLOB,webp:a.XHR_RESPONSE_TYPE.BLOB,tga:a.XHR_RESPONSE_TYPE.BLOB,avif:a.XHR_RESPONSE_TYPE.BLOB,json:a.XHR_RESPONSE_TYPE.JSON,text:a.XHR_RESPONSE_TYPE.TEXT,txt:a.XHR_RESPONSE_TYPE.TEXT,ttf:a.XHR_RESPONSE_TYPE.BUFFER,otf:a.XHR_RESPONSE_TYPE.BUFFER},a.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(a.LoaderResource||(a.LoaderResource={})),ho=function(a,b){this.data=a,this.callback=b},bE=function(){function a(c,b){var a=this;if(void 0===b&&(b=1),this.workers=0,this.saturated=Q,this.unsaturated=Q,this.empty=Q,this.drain=Q,this.error=Q,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(c,e,b){if(b&&"function"!=typeof b)throw new Error("task callback must be a function");if(a.started=!0,null==c&&a.idle())setTimeout(function(){return a.drain()},1);else{var d=new ho(c,"function"==typeof b?b:Q);e?a._tasks.unshift(d):a._tasks.push(d),setTimeout(a.process,1)}},this.process=function(){for(;!a.paused&&a.workers>2,b[1]=(3&a[0])<<4|a[1]>>4,b[2]=(15&a[1])<<2|a[2]>>6,b[3]=63&a[2],e-(d.length-1)){case 2:b[3]=64,b[2]=64;break;case 1:b[3]=64}for(c=0;c0&&a[a.length-1])||6!==d[0]&&2!==d[0])){b=0;continue}if(3===d[0]&&(!a||d[1]>a[0]&&d[1]=33776&&a<=33779)return"s3tc";if(a>=37488&&a<=37497)return"etc";if(a>=35840&&a<=35843)return"pvrtc";if(a>=36196)return"etc1";if(a>=35986&&a<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},a._createLevelBuffers=function(m,l,c,d,e,o,n){for(var j=new Array(c),k=m.byteOffset,a=o,f=n,i=a+d-1&~(d-1),h=f+e-1&~(e-1),g=i*h*av[l],b=0;b1?a:i,levelHeight:c>1?f:h,levelBuffer:new Uint8Array(m.buffer,k,g)},k+=g,g=(i=(a=a>>1||1)+d-1&~(d-1))*(h=(f=f>>1||1)+e-1&~(e-1))*av[l];return j},a}(fu),fw=function(){function c(){}return c.use=function(b,f){var d=b.data,h,e,i,g,m,k,l,j,n,o,p;if(b.type===a.LoaderResource.TYPE.JSON&&d&&d.cacheID&&d.textures){for(h=d.textures,e=void 0,i=void 0,g=0,m=h.length;g>>=1,l>>>=1;s=148;for(c=0;cf-c){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(a=0;a1||0!==c?l:z,levelHeight:g>1||0!==c?p:A,levelBuffer:new Uint8Array(F,w,m)},w+=m;e=(e+=D+4)%4!=0?e+4-e%4:e,m=(z=(l=l>>1||1)+4-1&-4)*(A=(p=p>>1||1)+4-1&-4)*q}return 0!==c?{uncompressed:k.map(function(b){var d=b[0].levelBuffer,e=!1;return c===a.TYPES.FLOAT?d=new Float32Array(b[0].levelBuffer.buffer,b[0].levelBuffer.byteOffset,b[0].levelBuffer.byteLength/4):c===a.TYPES.UNSIGNED_INT?(e=!0,d=new Uint32Array(b[0].levelBuffer.buffer,b[0].levelBuffer.byteOffset,b[0].levelBuffer.byteLength/4)):c===a.TYPES.INT&&(e=!0,d=new Int32Array(b[0].levelBuffer.buffer,b[0].levelBuffer.byteOffset,b[0].levelBuffer.byteLength/4)),{resource:new S(d,{width:b[0].levelWidth,height:b[0].levelHeight}),type:c,format:e?he(r):r}}),kvData:v}:{compressed:k.map(function(a){return new bk(null,{format:y,width:j,height:f,levels:g,levelBuffers:a})}),kvData:v}}function he(b){switch(b){case a.FORMATS.RGBA:return a.FORMATS.RGBA_INTEGER;case a.FORMATS.RGB:return a.FORMATS.RGB_INTEGER;case a.FORMATS.RG:return a.FORMATS.RG_INTEGER;case a.FORMATS.RED:return a.FORMATS.RED_INTEGER;default:return b}}a.LoaderResource.setExtensionXhrType("dds",a.LoaderResource.XHR_RESPONSE_TYPE.BUFFER),fM=function(){function b(){}return b.use=function(a,b){if("dds"===a.extension&&a.data)try{Object.assign(a,fx(a.name||a.url,fF(a.data),a.metadata))}catch(a){return void b(a)}b()},b.extension=a.ExtensionType.Loader,b}(),a.LoaderResource.setExtensionXhrType("ktx",a.LoaderResource.XHR_RESPONSE_TYPE.BUFFER),fN=function(){function b(){}return b.use=function(b,l){var d,h,j,k,g,f,m,i;if("ktx"===b.extension&&b.data)try{if(d=b.name||b.url,h=fK(0,b.data,this.loadKeyValueData),j=h.compressed,k=h.uncompressed,g=h.kvData,j){if(f=fx(d,j,b.metadata),g&&f.textures)for(m in f.textures)f.textures[m].baseTexture.ktxKeyValueData=g;Object.assign(b,f)}else k&&(i={},k.forEach(function(f,j){var b=new c(new e(f.resource,{mipmap:a.MIPMAP_MODES.OFF,alphaMode:a.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),h=d+"-"+(j+1);g&&(b.baseTexture.ktxKeyValueData=g),e.addToCache(b.baseTexture,h),c.addToCache(b,h),0===j&&(i[d]=b,e.addToCache(b.baseTexture,d),c.addToCache(b,d)),i[h]=b}),Object.assign(b,{textures:i}))}catch(a){return void l(a)}l()},b.extension=a.ExtensionType.Loader,b.loadKeyValueData=!1,b}(),bV=function(a,b){return bV=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},bV(a,b)};function fP(b,a){function c(){this.constructor=b}bV(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}hd=function(c){function b(e,g,d,f){void 0===e&&(e=1500),void 0===d&&(d=16384),void 0===f&&(f=!1);var b=c.call(this)||this;return d>16384&&(d=16384),b._properties=[!1,!0,!1,!1,!1],b._maxSize=e,b._batchSize=d,b._buffers=null,b._bufferUpdateIDs=[],b._updateID=0,b.interactiveChildren=!1,b.blendMode=a.BLEND_MODES.NORMAL,b.autoResize=f,b.roundPixels=!0,b.baseTexture=null,b.setProperties(g),b._tint=0,b.tintRgb=new Float32Array(4),b.tint=16777215,b}return fP(b,c),b.prototype.setProperties=function(a){a&&(this._properties[0]="vertices"in a||"scale"in a?!!a.vertices||!!a.scale:this._properties[0],this._properties[1]="position"in a?!!a.position:this._properties[1],this._properties[2]="rotation"in a?!!a.rotation:this._properties[2],this._properties[3]="uvs"in a?!!a.uvs:this._properties[3],this._properties[4]="tint"in a||"alpha"in a?!!a.tint||!!a.alpha:this._properties[4])},b.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(b.prototype,"tint",{get:function(){return this._tint},set:function(a){this._tint=a,T(a,this.tintRgb)},enumerable:!1,configurable:!0}),b.prototype.render=function(a){var b=this;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",function(){return b.onChildrenChange(0)})),a.batch.setObjectRenderer(a.plugins.particle),a.plugins.particle.render(this))},b.prototype.onChildrenChange=function(b){for(var a=Math.floor(b/this._batchSize);this._bufferUpdateIDs.lengthp&&!a.autoResize&&(d=p),e=a._buffers,e||(e=a._buffers=this.generateBuffers(a)),o=h[0]._texture.baseTexture,l=o.alphaMode>0,this.state.blendMode=bM(a.blendMode,l),g.state.set(this.state),k=g.gl,n=a.worldTransform.copyTo(this.tempMatrix),n.prepend(g.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=n.toArray(!0),this.shader.uniforms.uColor=fz(a.tintRgb,a.worldAlpha,this.shader.uniforms.uColor,l),this.shader.uniforms.uSampler=o,this.renderer.shader.bind(this.shader);for(m=!1,b=0,i=0;bj&&(c=j),i>=e.length&&e.push(this._generateOneMoreBuffer(a)),f=e[i],f.uploadDynamic(h,b,c),q=a._bufferUpdateIDs[i]||0,(m=m||f._updateID0,g=b.alpha,e=g<1&&k?bg(b._tintRGB,g):b._tintRGB+(255*g<<24),c[a]=e,c[a+d]=e,c[a+2*d]=e,c[a+3*d]=e,a+=4*d},b.prototype.destroy=function(){c.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},b.extension={name:"particle",type:a.ExtensionType.RendererPlugin},b}(aF),a.LINE_JOIN=void 0,a.LINE_CAP=void 0,function(a){a.MITER="miter",a.BEVEL="bevel",a.ROUND="round"}(a.LINE_JOIN||(a.LINE_JOIN={})),function(a){a.BUTT="butt",a.ROUND="round",a.SQUARE="square"}(a.LINE_CAP||(a.LINE_CAP={})),ac={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(b,c){if(void 0===c&&(c=20),!this.adaptive||!b||isNaN(b))return c;var a=Math.ceil(b/this.maxLength);return athis.maxSegments&&(a=this.maxSegments),a}},dE=function(){function a(){this.color=16777215,this.alpha=1,this.texture=c.WHITE,this.matrix=null,this.visible=!1,this.reset()}return a.prototype.clone=function(){var b=new a;return b.color=this.color,b.alpha=this.alpha,b.texture=this.texture,b.matrix=this.matrix,b.visible=this.visible,b},a.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=c.WHITE,this.matrix=null,this.visible=!1},a.prototype.destroy=function(){this.texture=null,this.matrix=null},a}(),bY=function(a,b){return bY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},bY(a,b)};function bC(b,a){function c(){this.constructor=b}bY(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function fX(a,d){var e,f,c,g,b,i,h,j,k,l,m,n,o,p;if(void 0===d&&(d=!1),c=a.length,!(c<6)){for(g=0,b=0,i=a[c-2],h=a[c-1];b0||d&&g<=0){l=c/2;for(b=l+l%2;b=6){fX(b,!1);for(g=[],a=0;a=0&&i>=0&&c>=0&&e>=0){if(t=Math.ceil(2.3*Math.sqrt(n+i)),w=8*t+(c?4:0)+(e?4:0),b.length=w,0!==w){if(0===t)return b.length=8,b[0]=b[6]=f+c,b[1]=b[3]=d+e,b[2]=b[4]=f-c,void(b[5]=b[7]=d-e);m=0,s=4*t+(c?2:0)+2,u=s,h=w,l=f+(p=c+n),g=f-p,k=d+(q=e),(b[m++]=l,b[m++]=k,b[--s]=k,b[--s]=g,e)&&(j=d-q,b[u++]=g,b[u++]=j,b[--h]=j,b[--h]=l);for(A=1;Ah&&(h+=2*Math.PI),j=g,s=h-g,t=Math.abs(s),e=Math.sqrt(m*m+l*l),i=1+(15*t*Math.sqrt(e)/Math.PI>>0),o=s/i,j+=o,n){a.push(c,b),a.push(k,p);for(f=1,d=j;f=0&&(p.join===a.LINE_JOIN.ROUND?q+=aa(b,c,b-h*e,c-i*e,b-l*e,c-k*e,d,!1)+4:q+=2,d.push(b-l*f,c-k*f),d.push(b+l*e,c+k*e))):(Q=(-h+o)*(-i+c)-(-h+b)*(-i+n),S=(-l+y)*(-k+c)-(-l+b)*(-k+x),H=(D*S-B*Q)/J,G=(A*Q-C*S)/J,L=(H-b)*(H-b)+(G-c)*(G-c),t=b+(H-b)*e,w=c+(G-c)*e,v=b-(H-b)*f,u=c-(G-c)*f,T=F?e:f,L<=Math.min(D*D+C*C,B*B+A*A)+T*T*O?p.join===a.LINE_JOIN.BEVEL||L/O>Y?(F?(d.push(t,w),d.push(b+h*f,c+i*f),d.push(t,w),d.push(b+l*f,c+k*f)):(d.push(b-h*e,c-i*e),d.push(v,u),d.push(b-l*e,c-k*e),d.push(v,u)),q+=2):p.join===a.LINE_JOIN.ROUND?F?(d.push(t,w),d.push(b+h*f,c+i*f),q+=aa(b,c,b+h*f,c+i*f,b+l*f,c+k*f,d,!0)+4,d.push(t,w),d.push(b+l*f,c+k*f)):(d.push(b-h*e,c-i*e),d.push(v,u),q+=aa(b,c,b-h*e,c-i*e,b-l*e,c-k*e,d,!1)+4,d.push(b-l*e,c-k*e),d.push(v,u)):(d.push(t,w),d.push(v,u)):(d.push(b-h*e,c-i*e),d.push(b+h*f,c+i*f),p.join===a.LINE_JOIN.ROUND?q+=F?aa(b,c,b+h*f,c+i*f,b+l*f,c+k*f,d,!0)+2:aa(b,c,b-h*e,c-i*e,b-l*e,c-k*e,d,!1)+2:p.join===a.LINE_JOIN.MITER&&L/O<=Y&&(F?(d.push(v,u),d.push(v,u)):(d.push(t,w),d.push(t,w)),q+=2),d.push(b-l*e,c-k*e),d.push(b+l*f,c+k*f),q+=2));o=j[2*(E-2)],n=j[2*(E-2)+1],b=j[2*(E-1)],h=-(n-(c=j[2*(E-1)+1])),i=o-b,h/=s=Math.sqrt(h*h+i*i),i/=s,h*=r,i*=r,d.push(b-h*e,c-i*e),d.push(b+h*f,c+i*f),P||(p.cap===a.LINE_CAP.ROUND?q+=aa(b-h*(e-f)*.5,c-i*(e-f)*.5,b-h*e,c-i*e,b+h*f,c+i*f,d,!1)+2:p.cap===a.LINE_CAP.SQUARE&&(q+=gc(b,c,h,i,e,f,!1,d))),ab=M.indices,_=ac.epsilon*ac.epsilon;for(m=W;md*c})},a.arc=function(u,t,r,q,c,h,o,s,n){for(var e=o-h,k=ac._segmentsCount(Math.abs(e)*c,40*Math.ceil(Math.abs(e)/aA)),a=e/(2*k),m=2*a,j=Math.cos(a),i=Math.sin(a),d=k-1,p=d%1/d,b=0,g,f,l;b<=d;++b)g=a+h+m*(b+p*b),f=Math.cos(g),l=-Math.sin(g),n.push((j*f+i*l)*c+r,(j*-l+i*f)*c+q)},a}(),gh=function(){function a(){}return a.curveLength=function(p,m,u,t,s,r,q,v){for(var i=0,a=0,d=0,o=0,b=0,g=0,n=0,h=0,j=0,f=0,e=0,k=p,l=m,c=1;c<=10;++c)f=k-(h=(n=(g=(b=1-(a=c/10))*b)*b)*p+3*g*a*u+3*b*(d=a*a)*s+(o=d*a)*q),e=l-(j=n*m+3*g*a*t+3*b*d*r+o*v),k=h,l=j,i+=Math.sqrt(f*f+e*e);return i},a.curveTo=function(r,q,p,o,n,m,b){var i=b[b.length-2],k=b[b.length-1],l,d,h,g,f,j,e,c;b.length-=2,l=ac._segmentsCount(a.curveLength(i,k,r,q,p,o,n,m)),d=0,h=0,g=0,f=0,j=0,b.push(i,k);for(e=1,c=0;e<=l;++e)g=(h=(d=1-(c=e/l))*d)*d,j=(f=c*c)*c,b.push(g*i+3*h*c*r+3*d*f*p+j*n,g*k+3*h*c*q+3*d*f*o+j*m)},a}(),gi=function(){function a(){}return a.curveLength=function(j,o,n,m,r,q){var g=j-2*n+r,h=o-2*m+q,i=2*n-2*j,d=2*m-2*o,c=4*(g*g+h*h),a=4*(g*i+h*d),f=i*i+d*d,e=2*Math.sqrt(c+a+f),b=Math.sqrt(c),k=2*c*b,l=2*Math.sqrt(f),p=a/b;return(k*e+b*a*(e-l)+(4*f*c-a*a)*Math.log((2*b+p+e)/(p+l)))/(4*k)},a.curveTo=function(d,e,l,m,c){for(var j=c[c.length-2],h=c[c.length-1],k=ac._segmentsCount(a.curveLength(j,h,d,e,l,m)),f=0,g=0,i=1,b;i<=k;++i)b=i/k,f=j+(d-j)*b,g=h+(e-h)*b,c.push(f+(d+(l-d)*b-f)*b,g+(e+(m-e)*b-g)*b)},a}(),gj=function(){function a(){this.reset()}return a.prototype.begin=function(a,b,c){this.reset(),this.style=a,this.start=b,this.attribStart=c},a.prototype.end=function(a,b){this.attribSize=b-this.attribStart,this.size=a-this.start},a.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},a}(),bt=((aj={})[a.SHAPES.POLY]=b$,aj[a.SHAPES.CIRC]=aL,aj[a.SHAPES.ELIP]=aL,aj[a.SHAPES.RECT]=f_,aj[a.SHAPES.RREC]=gb,aj),cf=[],ay=[],cg=function(){function a(d,a,b,c){void 0===a&&(a=null),void 0===b&&(b=null),void 0===c&&(c=null),this.points=[],this.holes=[],this.shape=d,this.lineStyle=b,this.fillStyle=a,this.matrix=c,this.type=d.type}return a.prototype.clone=function(){return new a(this.shape,this.fillStyle,this.lineStyle,this.matrix)},a.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},a}(),am=new g,dF=function(c){function b(){var a=c.call(this)||this;return a.closePointEps=1e-4,a.boundsPadding=0,a.uvsFloat32=null,a.indicesUint16=null,a.batchable=!1,a.points=[],a.colors=[],a.uvs=[],a.indices=[],a.textureIds=[],a.graphicsData=[],a.drawCalls=[],a.batchDirty=-1,a.batches=[],a.dirty=0,a.cacheDirty=-1,a.clearDirty=0,a.shapeIndex=0,a._bounds=new aO,a.boundsDirty=-1,a}return bC(b,c),Object.defineProperty(b.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),b.prototype.invalidate=function(){var a,b;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(a=0;a0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},b.prototype.drawShape=function(d,a,b,c){void 0===a&&(a=null),void 0===b&&(b=null),void 0===c&&(c=null);var e=new cg(d,a,b,c);return this.graphicsData.push(e),this.dirty++,this},b.prototype.drawHole=function(d,a){if(void 0===a&&(a=null),!this.graphicsData.length)return null;var b=new cg(d,null,null,a),c=this.graphicsData[this.graphicsData.length-1];return b.lineStyle=c.lineStyle,c.holes.push(b),this.dirty++,this},b.prototype.destroy=function(){c.prototype.destroy.call(this);for(var a=0;a0&&(g=(c=this.batches[this.batches.length-1]).style);for(h=this.shapeIndex;h65535,this.indicesUint16&&this.indices.length===this.indicesUint16.length&&i===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=i?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()):this.batchable=!0}}else this.batchable=!0},b.prototype._compareStyles=function(a,b){return!(!a||!b)&&a.texture.baseTexture===b.texture.baseTexture&&a.color+a.alpha===b.color+b.alpha&&!!a.native==!!b.native},b.prototype.validateBatching=function(){var a,e,b,c,d;if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(a=0,e=this.graphicsData.length;a131070)return!1;for(var c=this.batches,a=0;a0&&((b=ay.pop())||((b=new bb).texArray=new aY),this.drawCalls.push(b)),b.start=m,b.size=0,b.texArray.count=0,b.type=l),c.touched=1,c._batchEnabled=i,c._batchLocation=h,c.wrapMode=a.WRAP_MODES.REPEAT,b.texArray.elements[b.texArray.count++]=c,h++)),b.size+=f.size,m+=f.size,n=c._batchLocation,this.addColors(p,g.color,g.alpha,f.attribSize,f.attribStart),this.addTextureIds(o,n,f.attribSize,f.attribStart);e._globalBatch=i,this.packAttributes()},b.prototype.packAttributes=function(){for(var d=this.points,f=this.uvs,i=this.colors,g=this.textureIds,e=new ArrayBuffer(3*d.length*4),c=new Float32Array(e),h=new Uint32Array(e),b=0,a=0;a>16)+(65280&c)+((255&c)<<16),g),d.length=Math.max(d.length,b+e);for(a=0;a0&&b.alpha>0;return d?(b.matrix&&(b.matrix=b.matrix.clone(),b.matrix.invert()),Object.assign(this._lineStyle,{visible:d},b)):this._lineStyle.reset(),this},b.prototype.startPoly=function(){if(this.currentPath){var b=this.currentPath.points,a=this.currentPath.points.length;a>2&&(this.drawShape(this.currentPath),this.currentPath=new aG,this.currentPath.closeStroke=!1,this.currentPath.points.push(b[a-2],b[a-1]))}else this.currentPath=new aG,this.currentPath.closeStroke=!1},b.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},b.prototype.moveTo=function(a,b){return this.startPoly(),this.currentPath.points[0]=a,this.currentPath.points[1]=b,this},b.prototype.lineTo=function(b,c){this.currentPath||this.moveTo(0,0);var a=this.currentPath.points,d=a[a.length-2],e=a[a.length-1];return d===b&&e===c||a.push(b,c),this},b.prototype._initCurve=function(a,b){void 0===a&&(a=0),void 0===b&&(b=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[a,b]):this.moveTo(a,b)},b.prototype.quadraticCurveTo=function(b,c,d,e){this._initCurve();var a=this.currentPath.points;return 0===a.length&&this.moveTo(0,0),gi.curveTo(b,c,d,e,a),this},b.prototype.bezierCurveTo=function(a,b,c,d,e,f){return this._initCurve(),gh.curveTo(a,b,c,d,e,f,this.currentPath.points),this},b.prototype.arcTo=function(b,g,m,l,k){var f,a,h,i,e,d,c,j;return this._initCurve(b,g),f=this.currentPath.points,a=cd.curveTo(b,g,m,l,k,f),a&&(h=a.cx,i=a.cy,e=a.radius,d=a.startAngle,c=a.endAngle,j=a.anticlockwise,this.arc(h,i,e,d,c,j)),this},b.prototype.arc=function(i,j,g,b,c,f){var d,e,h,a,k,l;return void 0===f&&(f=!1),b===c?this:(!f&&c<=b?c+=aA:f&&b<=c&&(b+=aA),0==c-b)?this:(d=i+Math.cos(b)*g,e=j+Math.sin(b)*g,h=this._geometry.closePointEps,a=this.currentPath?this.currentPath.points:null,a?(k=Math.abs(a[a.length-2]-d),l=Math.abs(a[a.length-1]-e),k0;return b?(a.matrix&&(a.matrix=a.matrix.clone(),a.matrix.invert()),Object.assign(this._fillStyle,{visible:b},a)):this._fillStyle.reset(),this},b.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},b.prototype.drawRect=function(a,b,c,e){return this.drawShape(new d(a,b,c,e))},b.prototype.drawRoundedRect=function(a,b,c,d,e){return this.drawShape(new e_(a,b,c,d,e))},b.prototype.drawCircle=function(a,b,c){return this.drawShape(new fd(a,b,c))},b.prototype.drawEllipse=function(a,b,c,d){return this.drawShape(new fa(a,b,c,d))},b.prototype.drawPolygon=function(){for(var c,g=arguments,a=[],b=0,e,d,f;b>16&255)/255*c,b.tint[1]=(f>>8&255)/255*c,b.tint[2]=(255&f)/255*c,b.tint[3]=c,a.shader.bind(d),a.geometry.bind(e,d),a.state.set(this.state);for(g=0,i=h.length;g>16)+(65280&d)+((255&d)<<16)}},b.prototype.calculateVertices=function(){var g=this.transform._worldID,a,m,l,k,j,i,n,c,f,e,b,d,h;if(this._transformID!==g){this._transformID=g;for(a=this.transform.worldTransform,m=a.a,l=a.b,k=a.c,j=a.d,i=a.tx,n=a.ty,c=this._geometry.points,f=this.vertexData,e=0,b=0;b=d&&aw.x=a&&aw.y>16)+(65280&a)+((255&a)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(a){this._texture!==a&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=a||c.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,a&&(a.baseTexture.valid?this._onTextureUpdate():a.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(u),a.TEXT_GRADIENT=void 0,cp=function(a,b){return cp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cp(a,b)},!function(a){a[a.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",a[a.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(a.TEXT_GRADIENT||(a.TEXT_GRADIENT={})),cq={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:a.TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},gB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],X=function(){function a(a){this.styleID=0,this.reset(),cv(this,a,a)}return a.prototype.clone=function(){var b={};return cv(b,this,cq),new a(b)},a.prototype.reset=function(){cv(this,cq,cq)},Object.defineProperty(a.prototype,"align",{get:function(){return this._align},set:function(a){this._align!==a&&(this._align=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"breakWords",{get:function(){return this._breakWords},set:function(a){this._breakWords!==a&&(this._breakWords=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(a){this._dropShadow!==a&&(this._dropShadow=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(a){this._dropShadowAlpha!==a&&(this._dropShadowAlpha=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(a){this._dropShadowAngle!==a&&(this._dropShadowAngle=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(a){this._dropShadowBlur!==a&&(this._dropShadowBlur=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(b){var a=ct(b);this._dropShadowColor!==a&&(this._dropShadowColor=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(a){this._dropShadowDistance!==a&&(this._dropShadowDistance=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fill",{get:function(){return this._fill},set:function(b){var a=ct(b);this._fill!==a&&(this._fill=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(a){this._fillGradientType!==a&&(this._fillGradientType=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(a){(function(a,c){if(!Array.isArray(a)||!Array.isArray(c))return!1;if(a.length!==c.length)return!1;for(var b=0;b=0;c--)b=a[c].trim(),!/([\"\'])[^\'\"]+\1/.test(b)&&gB.indexOf(b)<0&&(b='"'+b+'"'),a[c]=b;return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+d+" "+a.join(",")},a}();function gg(a){return"number"==typeof a?bP(a):("string"==typeof a&&0===a.indexOf("0x")&&(a=a.replace("0x","#")),a)}function ct(a){if(Array.isArray(a)){for(var b=0;bo)if(""!==b&&(f+=a.addLine(b),b="",d=0),a.canBreakWords(c,k.breakWords))for(i=a.wordWrapSplit(c),e=0;eo&&(f+=a.addLine(b),h=!1,b="",d=0),b+=g,d+=w}else b.length>0&&(f+=a.addLine(b),b="",d=0),x=j===p.length-1,f+=a.addLine(c,!x),h=!1,b="",d=0;else q+d>o&&(h=!1,f+=a.addLine(b),b="",d=0),(b.length>0||!a.isBreakingSpace(c)||h)&&(b+=c,d+=q)}return f+a.addLine(b,!1)},a.addLine=function(b,c){return void 0===c&&(c=!0),b=a.trimRight(b),c?b+"\n":b},a.getFromCache=function(a,d,c,e){var b=c[a],f;return"number"!=typeof b&&(f=a.length*d,b=e.measureText(a).width+f,c[a]=b),b},a.collapseSpaces=function(a){return"normal"===a||"pre-line"===a},a.collapseNewlines=function(a){return"normal"===a},a.trimRight=function(b){var c,d;if("string"!=typeof b)return"";for(c=b.length-1;c>=0;c--){if(d=b[c],!a.isBreakingSpace(d))break;b=b.slice(0,-1)}return b},a.isNewline=function(b){return"string"==typeof b&&a._newlines.indexOf(b.charCodeAt(0))>=0},a.isBreakingSpace=function(b,c){return"string"==typeof b&&a._breakingSpaces.indexOf(b.charCodeAt(0))>=0},a.tokenize=function(d){var c=[],b="",e,f,g;if("string"!=typeof d)return c;for(e=0;ec;--d){for(f=0;f0&&r>k&&(p=(k+r)/2),n=k+q,t=l.lineHeight*(b+1),u=n,b+10},a}();function gM(a,d){var e=!1,b,f;if(a&&a._textures&&a._textures.length)for(b=0;b=0;a--)this.add(b.children[a]);return this},c.prototype.destroy=function(){this.ticking&&o.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},c}();function gd(b,a){return a instanceof e&&(a._glTextures[b.CONTEXT_UID]||b.texture.bind(a),!0)}function gV(d,b){var a,e,c,f;if(!(b instanceof ar))return!1;a=b.geometry,b.finishPoly(),a.updateBatches();for(e=a.batches,c=0;c=c&&aN.x=d&&aN.y1?D.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",a):D.from(fQ,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",a)},b.prototype.render=function(b){var h=this.renderer,k=this.quad,c=k.vertices,q,n,f,e,r,g,i,j,d,o,p,l,m;c[0]=c[6]=b._width*-b.anchor.x,c[1]=c[3]=b._height*-b.anchor.y,c[2]=c[4]=b._width*(1-b.anchor.x),c[5]=c[7]=b._height*(1-b.anchor.y),q=b.uvRespectAnchor?b.anchor.x:0,n=b.uvRespectAnchor?b.anchor.y:0,(c=k.uvs)[0]=c[6]=-q,c[1]=c[3]=-n,c[2]=c[4]=1-q,c[5]=c[7]=1-n,k.invalidate(),f=b._texture,e=f.baseTexture,r=e.alphaMode>0,g=b.tileTransform.localTransform,i=b.uvMatrix,j=e.isPowerOfTwo&&f.frame.width===e.width&&f.frame.height===e.height,j&&(e._glTextures[h.CONTEXT_UID]?j=e.wrapMode!==a.WRAP_MODES.CLAMP:e.wrapMode===a.WRAP_MODES.CLAMP&&(e.wrapMode=a.WRAP_MODES.REPEAT)),d=j?this.simpleShader:this.shader,o=f.width,p=f.height,l=b._width,m=b._height,aU.set(g.a*o/l,g.b*o/m,g.c*p/l,g.d*p/m,g.tx/l,g.ty/m),aU.invert(),j?aU.prepend(i.mapCoord):(d.uniforms.uMapCoord=i.mapCoord.toArray(!0),d.uniforms.uClampFrame=i.uClampFrame,d.uniforms.uClampOffset=i.uClampOffset),d.uniforms.uTransform=aU.toArray(!0),d.uniforms.uColor=bK(b.tint,b.worldAlpha,d.uniforms.uColor,r),d.uniforms.translationMatrix=b.transform.worldTransform.toArray(!0),d.uniforms.uSampler=f,h.shader.bind(d),h.geometry.bind(k),this.state.blendMode=bM(b.blendMode,r),h.state.set(this.state),h.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},b.extension={name:"tilingSprite",type:a.ExtensionType.RendererPlugin},b}(aF),cN=function(a,b){return cN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cN(a,b)};function cO(b,a){function c(){this.constructor=b}cN(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}fv=function(){function a(a,b){this.uvBuffer=a,this.uvMatrix=b,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return a.prototype.update=function(b){if(b||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var a=this.uvBuffer.data;this.data&&this.data.length===a.length||(this.data=new Float32Array(a.length)),this.uvMatrix.multiplyUvs(a,this.data),this._updateID++}},a}(),cP=new g,fo=new aG,ah=function(d){function c(f,g,h,e){void 0===e&&(e=a.DRAW_MODES.TRIANGLES);var c=d.call(this)||this;return c.geometry=f,c.shader=g,c.state=h||K.for2d(),c.drawMode=e,c.start=0,c.size=0,c.uvs=null,c.indices=null,c.vertexData=new Float32Array(1),c.vertexDirty=-1,c._transformID=-1,c._roundPixels=b.ROUND_PIXELS,c.batchUvs=null,c}return cO(c,d),Object.defineProperty(c.prototype,"geometry",{get:function(){return this._geometry},set:function(a){this._geometry!==a&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=a,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"material",{get:function(){return this.shader},set:function(a){this.shader=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(a){this.state.blendMode=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(a){this._roundPixels!==a&&(this._transformID=-1),this._roundPixels=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(a){this.shader.tint=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(a){this.shader.texture=a},enumerable:!1,configurable:!0}),c.prototype._render=function(b){var d=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===a.DRAW_MODES.TRIANGLES&&d.length<2*c.BATCHABLE_SIZE?this._renderToBatch(b):this._renderDefault(b)},c.prototype._renderDefault=function(b){var a=this.shader;a.alpha=this.worldAlpha,a.update&&a.update(),b.batch.flush(),a.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),b.shader.bind(a),b.state.set(this.state),b.geometry.bind(this.geometry,a),b.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},c.prototype._renderToBatch=function(b){var d=this.geometry,a=this.shader,c;a.uvMatrix&&(a.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=d.indexBuffer.data,this._tintRGB=a._tintRGB,this._texture=a.texture,c=this.material.pluginName,b.batch.setObjectRenderer(b.plugins[c]),b.plugins[c].render(this)},c.prototype.calculateVertices=function(){var i=this.geometry.buffers[0],e=i.data,f=i._updateID,c,o,n,m,p,l,k,d,a,h,g,j;if(f!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(c=this.transform.worldTransform,o=c.a,n=c.b,m=c.c,p=c.d,l=c.tx,k=c.ty,d=this.vertexData,a=0;a>16)+(65280&a)+((255&a)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),a.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var a=this.texture.baseTexture;bK(this._tint,this._alpha,this.uniforms.uColor,a.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},a}(D),aI=function(c){function b(d,e,f){var b=c.call(this)||this,g=new n(d),h=new n(e,!0),i=new n(f,!0,!0);return b.addAttribute("aVertexPosition",g,2,!1,a.TYPES.FLOAT).addAttribute("aTextureCoord",h,2,!1,a.TYPES.FLOAT).addIndex(i),b._updateId=-1,b}return cO(b,c),Object.defineProperty(b.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),b}(an),cQ=function(a,b){return cQ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cQ(a,b)},aH=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},eX=function(){function a(){}return a.test=function(a){return"string"==typeof a&&0===a.indexOf("info face=")},a.parse=function(n){var c=n.match(/^[a-z]+\s+.+$/gm),b={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]},e,l,g,h,j,i,k,d,f,m,a;for(e in c){l=c[e].match(/^[a-z]+/gm)[0],g=c[e].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(j in g)i=g[j].split("="),k=i[0],d=i[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f,h[k]=m;b[l].push(h)}return a=new aH,b.info.forEach(function(b){return a.info.push({face:b.face,size:parseInt(b.size,10)})}),b.common.forEach(function(b){return a.common.push({lineHeight:parseInt(b.lineHeight,10)})}),b.page.forEach(function(b){return a.page.push({id:parseInt(b.id,10),file:b.file})}),b.char.forEach(function(b){return a.char.push({id:parseInt(b.id,10),page:parseInt(b.page,10),x:parseInt(b.x,10),y:parseInt(b.y,10),width:parseInt(b.width,10),height:parseInt(b.height,10),xoffset:parseInt(b.xoffset,10),yoffset:parseInt(b.yoffset,10),xadvance:parseInt(b.xadvance,10)})}),b.kerning.forEach(function(b){return a.kerning.push({first:parseInt(b.first,10),second:parseInt(b.second,10),amount:parseInt(b.amount,10)})}),b.distanceField.forEach(function(b){return a.distanceField.push({distanceRange:parseInt(b.distanceRange,10),fieldType:b.fieldType})}),a},a}(),bd=function(){function a(){}return a.test=function(a){return a instanceof XMLDocument&&a.getElementsByTagName("page").length&&null!==a.getElementsByTagName("info")[0].getAttribute("face")},a.parse=function(d){for(var c=new aH,h=d.getElementsByTagName("info"),j=d.getElementsByTagName("common"),f=d.getElementsByTagName("page"),i=d.getElementsByTagName("char"),e=d.getElementsByTagName("kerning"),g=d.getElementsByTagName("distanceField"),a=0,b;a")>-1){var b=(new globalThis.DOMParser).parseFromString(a,"text/xml");return bd.test(b)}return!1},a.parse=function(a){var b=(new globalThis.DOMParser).parseFromString(a,"text/xml");return bd.parse(b)},a}(),cX=[eX,bd,eO];function cZ(b){for(var a=0;a=s-r*i){if(0===h)throw new Error("[BitmapFont] textureHeight "+s+"px is too small (fontFamily: '"+a.fontFamily+"', fontSize: "+a.fontSize+"px, char: '"+A+"')");--d,j=null,l=null,t=null,h=0,g=0,p=0}else if(p=Math.max(r+o.fontProperties.descent,p),v*i+g>=J){if(0===g)throw new Error("[BitmapFont] textureWidth "+u+"px is too small (fontFamily: '"+a.fontFamily+"', fontSize: "+a.fontSize+"px, char: '"+A+"')");--d,h+=p*i,h=Math.ceil(h),g=0,p=0}else hv(j,l,o,g,h,i,a),I=bo(o.text),k.char.push({id:I,page:q.length-1,x:g/i,y:h/i,width:v,height:r,xoffset:0,yoffset:0,xadvance:Math.ceil(C-(a.dropShadow?a.dropShadowDistance:0)-(a.stroke?a.strokeThickness:0))}),g+=(v+2*H)*i,g=Math.ceil(g);d=0;for(E=n.length;d0&&i.x>aa&&(_(k,1+t-++ab,1+b-t),b=t,t=-1,w.push(B),z.push(k.length>0?k[k.length-1].prevSpaces:0),j=Math.max(j,B),M++,i.x=0,i.y+=m.lineHeight,x=null,H=0))):(w.push(s),z.push(-1),j=Math.max(j,s),++M,++ab,i.x=0,i.y+=m.lineHeight,x=null,H=0);W=G[G.length-1],"\r"!==W&&"\n"!==W&&(/(?:\s)/.test(W)&&(s=B),w.push(s),j=Math.max(j,s),z.push(-1)),ae=[];for(b=0;b<=M;b++)D=0,"right"===this._align?D=j-w[b]:"center"===this._align?D=(j-w[b])/2:"justify"===this._align&&(D=z[b]<0?0:(j-w[b])/z[b]),ae.push(D);ad=k.length,q={},v=[],I=this._activePagesMeshData;for(Q.push.apply(Q,I),b=0;b 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),T=a.BLEND_MODES.NORMAL_NPM),X=new ah(aj,N),X.blendMode=T,d={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:X,vertices:null,uvs:null,indices:null}),d.index=0,d.indexCount=0,d.vertexCount=0,d.uvsCount=0,d.total=0,O=this._textureCache,O[u]=O[u]||new c(A.baseTexture),d.mesh.texture=O[u],d.mesh.tint=this._tint,v.push(d),q[u]=d),q[u].total++;for(b=0;b6*y)||d.vertices.length<2*ah.BATCHABLE_SIZE)d.vertices=new Float32Array(8*y),d.uvs=new Float32Array(8*y),d.indices=new Uint16Array(6*y);else for(ai=d.total,Z=d.vertices,S=4*ai*2;S=h&&(c=b-a-1),d+=g=g.replace("%value%",e[c].toString()),d+="\n";return(f=f.replace("%blur%",d)).replace("%size%",b.toString())}(c);return(a=d.call(this,i,j)||this).horizontal=h,a.resolution=g,a._quality=0,a.quality=f,a.blur=e,a}return eq(c,d),c.prototype.apply=function(b,d,c,j){var g,h,f,e,i,k;if(c?this.horizontal?this.uniforms.strength=1/c.width*(c.width/d.width):this.uniforms.strength=1/c.height*(c.height/d.height):this.horizontal?this.uniforms.strength=1/b.renderer.width*(b.renderer.width/d.width):this.uniforms.strength=1/b.renderer.height*(b.renderer.height/d.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)b.applyFilter(this,d,c,j);else{g=b.getFilterTexture(),h=b.renderer,f=d,e=g,this.state.blend=!1,b.applyFilter(this,f,e,a.CLEAR_MODES.CLEAR);for(i=1;i 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",c)||this).alpha=1,a}return function(b,a){function c(){this.constructor=b}dr(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(a,b),a.prototype._loadMatrix=function(c,b){void 0===b&&(b=!1);var a=c;b&&(this._multiply(a,this.uniforms.m,c),a=this._colorMatrix(a)),this.uniforms.m=a},a.prototype._multiply=function(c,a,b){return c[0]=a[0]*b[0]+a[1]*b[5]+a[2]*b[10]+a[3]*b[15],c[1]=a[0]*b[1]+a[1]*b[6]+a[2]*b[11]+a[3]*b[16],c[2]=a[0]*b[2]+a[1]*b[7]+a[2]*b[12]+a[3]*b[17],c[3]=a[0]*b[3]+a[1]*b[8]+a[2]*b[13]+a[3]*b[18],c[4]=a[0]*b[4]+a[1]*b[9]+a[2]*b[14]+a[3]*b[19]+a[4],c[5]=a[5]*b[0]+a[6]*b[5]+a[7]*b[10]+a[8]*b[15],c[6]=a[5]*b[1]+a[6]*b[6]+a[7]*b[11]+a[8]*b[16],c[7]=a[5]*b[2]+a[6]*b[7]+a[7]*b[12]+a[8]*b[17],c[8]=a[5]*b[3]+a[6]*b[8]+a[7]*b[13]+a[8]*b[18],c[9]=a[5]*b[4]+a[6]*b[9]+a[7]*b[14]+a[8]*b[19]+a[9],c[10]=a[10]*b[0]+a[11]*b[5]+a[12]*b[10]+a[13]*b[15],c[11]=a[10]*b[1]+a[11]*b[6]+a[12]*b[11]+a[13]*b[16],c[12]=a[10]*b[2]+a[11]*b[7]+a[12]*b[12]+a[13]*b[17],c[13]=a[10]*b[3]+a[11]*b[8]+a[12]*b[13]+a[13]*b[18],c[14]=a[10]*b[4]+a[11]*b[9]+a[12]*b[14]+a[13]*b[19]+a[14],c[15]=a[15]*b[0]+a[16]*b[5]+a[17]*b[10]+a[18]*b[15],c[16]=a[15]*b[1]+a[16]*b[6]+a[17]*b[11]+a[18]*b[16],c[17]=a[15]*b[2]+a[16]*b[7]+a[17]*b[12]+a[18]*b[17],c[18]=a[15]*b[3]+a[16]*b[8]+a[17]*b[13]+a[18]*b[18],c[19]=a[15]*b[4]+a[16]*b[9]+a[17]*b[14]+a[18]*b[19]+a[19],c},a.prototype._colorMatrix=function(b){var a=new Float32Array(b);return a[4]/=255,a[9]/=255,a[14]/=255,a[19]/=255,a},a.prototype.brightness=function(a,b){var c=[a,0,0,0,0,0,a,0,0,0,0,0,a,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.tint=function(a,b){var c=[(a>>16&255)/255,0,0,0,0,0,(a>>8&255)/255,0,0,0,0,0,(255&a)/255,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.greyscale=function(a,b){var c=[a,a,a,0,0,a,a,a,0,0,a,a,a,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.blackAndWhite=function(a){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],a)},a.prototype.hue=function(e,f){e=(e||0)/180*Math.PI;var a=Math.cos(e),c=Math.sin(e),b=1/3,d=(0,Math.sqrt)(b),g=[a+(1-a)*b,b*(1-a)-d*c,b*(1-a)+d*c,0,0,b*(1-a)+d*c,a+b*(1-a),b*(1-a)-d*c,0,0,b*(1-a)-d*c,b*(1-a)+d*c,a+b*(1-a),0,0,0,0,0,1,0];this._loadMatrix(g,f)},a.prototype.contrast=function(c,d){var a=(c||0)+1,b=-.5*(a-1),e=[a,0,0,0,b,0,a,0,0,b,0,0,a,0,b,0,0,0,1,0];this._loadMatrix(e,d)},a.prototype.saturate=function(c,d){void 0===c&&(c=0);var b=2*c/3+1,a=-.5*(b-1),e=[b,a,a,0,0,a,b,a,0,0,a,a,b,0,0,0,0,0,1,0];this._loadMatrix(e,d)},a.prototype.desaturate=function(){this.saturate(-1)},a.prototype.negative=function(a){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],a)},a.prototype.sepia=function(a){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],a)},a.prototype.technicolor=function(a){this._loadMatrix([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],a)},a.prototype.polaroid=function(a){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],a)},a.prototype.toBGR=function(a){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],a)},a.prototype.kodachrome=function(a){this._loadMatrix([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],a)},a.prototype.browni=function(a){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],a)},a.prototype.vintage=function(a){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],a)},a.prototype.colorTone=function(c,d,a,b,k){var f=((a=a||16770432)>>16&255)/255,g=(a>>8&255)/255,h=(255&a)/255,i=((b=b||3375104)>>16&255)/255,j=(b>>8&255)/255,e=(255&b)/255,l=[.3,.59,.11,0,0,f,g,h,c=c||.2,0,i,j,e,d=d||.15,0,f-i,g-j,h-e,0,0];this._loadMatrix(l,k)},a.prototype.night=function(a,b){var c=[-2*(a=a||.1),-a,0,0,0,-a,0,a,0,0,0,a,2*a,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.predator=function(a,b){var c=[11.224130630493164*a,-4.794486999511719*a,-2.8746118545532227*a,0*a,.40342438220977783*a,-3.6330697536468506*a,9.193157196044922*a,-2.951810836791992*a,0*a,-1.316135048866272*a,-3.2184197902679443*a,-4.2375030517578125*a,7.476448059082031*a,0*a,.8044459223747253*a,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.lsd=function(a){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],a)},a.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(a.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(a){this.uniforms.m=a},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(a){this.uniforms.uAlpha=a},enumerable:!1,configurable:!0}),a}(C),dv.prototype.grayscale=dv.prototype.greyscale,dw=function(a,b){return dw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dw(a,b)},hP=function(b){function a(d,a){var c=this,e=new m;return d.renderable=!1,(c=b.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:d._texture,filterMatrix:e,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=d,c.maskMatrix=e,null==a&&(a=20),c.scale=new g(a,a),c}return function(b,a){function c(){this.constructor=b}dw(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(a,b),a.prototype.apply=function(d,e,f,g){this.uniforms.filterMatrix=d.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var a=this.maskSprite.worldTransform,c=Math.sqrt(a.a*a.a+a.b*a.b),b=Math.sqrt(a.c*a.c+a.d*a.d);0!==c&&0!==b&&(this.uniforms.rotation[0]=a.a/c,this.uniforms.rotation[1]=a.b/c,this.uniforms.rotation[2]=a.c/b,this.uniforms.rotation[3]=a.d/b),d.applyFilter(this,e,f,g)},Object.defineProperty(a.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(a){this.uniforms.mapSampler=a},enumerable:!1,configurable:!0}),a}(C),dx=function(a,b){return dx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dx(a,b)},hR=function(a){function b(){return a.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(b,a){function c(){this.constructor=b}dx(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(b,a),b}(C),dA=function(a,b){return dA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dA(a,b)},hT=function(b){function a(a,c){void 0===a&&(a=.5),void 0===c&&(c=Math.random());var d=b.call(this,cR,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return d.noise=a,d.seed=c,d}return function(b,a){function c(){this.constructor=b}dA(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(a,b),Object.defineProperty(a.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(a){this.uniforms.uNoise=a},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(a){this.uniforms.uSeed=a},enumerable:!1,configurable:!0}),a}(C),d_=new m,k.prototype._cacheAsBitmap=!1,k.prototype._cacheData=null,k.prototype._cacheAsBitmapResolution=null,k.prototype._cacheAsBitmapMultisample=a.MSAA_QUALITY.NONE,hV=function(){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(k.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(a){a!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=a,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(a){a!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=a,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(b){var a;this._cacheAsBitmap!==b&&(this._cacheAsBitmap=b,b?(this._cacheData||(this._cacheData=new hV),(a=this._cacheData).originalRender=this.render,a.originalRenderCanvas=this.renderCanvas,a.originalUpdateTransform=this.updateTransform,a.originalCalculateBounds=this.calculateBounds,a.originalGetLocalBounds=this.getLocalBounds,a.originalDestroy=this.destroy,a.originalContainsPoint=this.containsPoint,a.originalMask=this._mask,a.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((a=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=a.originalRender,this.renderCanvas=a.originalRenderCanvas,this.calculateBounds=a.originalCalculateBounds,this.getLocalBounds=a.originalGetLocalBounds,this.destroy=a.originalDestroy,this.updateTransform=a.originalUpdateTransform,this.containsPoint=a.originalContainsPoint,this._mask=a.originalMask,this.filterArea=a.originalFilterArea))}}}),k.prototype._renderCached=function(a){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(a),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(a))},k.prototype._initCachedDisplayObject=function(a){var i,j,d,n,k,p,l,m,g,h,o,f;(!this._cacheData||!this._cacheData.sprite)&&(j=this.alpha,this.alpha=1,a.batch.flush(),d=this.getLocalBounds(null,!0).clone(),this.filters&&this.filters.length&&(n=this.filters[0].padding,d.pad(n)),d.ceil(b.RESOLUTION),k=a.renderTexture.current,p=a.renderTexture.sourceFrame.clone(),l=a.renderTexture.destinationFrame.clone(),m=a.projection.transform,g=G.create({width:d.width,height:d.height,resolution:this.cacheAsBitmapResolution||a.resolution,multisample:null!==(i=this.cacheAsBitmapMultisample)&&void 0!==i?i:a.multisample}),h="cacheAsBitmap_"+I(),this._cacheData.textureCacheId=h,e.addToCache(g.baseTexture,h),c.addToCache(g,h),o=this.transform.localTransform.copyTo(d_).invert().translate(-d.x,-d.y),this.render=this._cacheData.originalRender,a.render(this,{renderTexture:g,clear:!0,transform:o,skipUpdateTransform:!1}),a.framebuffer.blit(),a.projection.transform=m,a.renderTexture.bind(k,p,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=j,f=new ai(g),f.transform.worldTransform=this.transform.worldTransform,f.anchor.x=-d.x/d.width,f.anchor.y=-d.y/d.height,f.alpha=j,f._bounds=this._bounds,this._cacheData.sprite=f,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=f.containsPoint.bind(f))},k.prototype._renderCachedCanvas=function(a){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(a),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(a))},k.prototype._initCachedDisplayObjectCanvas=function(f){var a,j,k,l,h,i,g,d;(!this._cacheData||!this._cacheData.sprite)&&(a=this.getLocalBounds(null,!0),j=this.alpha,this.alpha=1,k=f.context,l=f._projTransform,a.ceil(b.RESOLUTION),h=G.create({width:a.width,height:a.height}),i="cacheAsBitmap_"+I(),this._cacheData.textureCacheId=i,e.addToCache(h.baseTexture,i),c.addToCache(h,i),g=d_,this.transform.localTransform.copyTo(g),g.invert(),g.tx-=a.x,g.ty-=a.y,this.renderCanvas=this._cacheData.originalRenderCanvas,f.render(this,{renderTexture:h,clear:!0,transform:g,skipUpdateTransform:!1}),f.context=k,f._projTransform=l,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=j,d=new ai(h),d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-a.x/a.width,d.anchor.y=-a.y/a.height,d.alpha=j,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=f._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=d.containsPoint.bind(d))},k.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},k.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},k.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,e.removeFromCache(this._cacheData.textureCacheId),c.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},k.prototype._cacheAsBitmapDestroy=function(a){this.cacheAsBitmap=!1,this.destroy(a)},k.prototype.name=null,u.prototype.getChildByName=function(c,f){for(var a=0,b=this.children.length,d,e;a0?(m=h.x-c[b].x,n=h.y-c[b].y,o=Math.sqrt(m*m+n*n),h=c[b],g+=o/p):g=b/(j-1),d[a]=g,d[a+1]=0,d[a+2]=g,d[a+3]=1;f=0;for(b=0;b0?this.textureScale*this._width/2:this._width/2,a/=j,b/=j,a*=k,b*=k,f[g]=e.x+a,f[g+1]=e.y+b,f[g+2]=e.x-a,f[g+3]=e.y-b,h=e;this.buffers[0].update()}},a.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},a}(aI),ia=function(b){function c(d,f,c){void 0===c&&(c=0);var e=this,g=new dH(d.height,f,c),h=new ao(d);return c>0&&(d.baseTexture.wrapMode=a.WRAP_MODES.REPEAT),(e=b.call(this,g,h)||this).autoUpdate=!0,e}return ak(c,b),c.prototype._render=function(c){var a=this.geometry;(this.autoUpdate||a._width!==this.shader.texture.height)&&(a._width=this.shader.texture.height,a.update()),b.prototype._render.call(this,c)},c}(ah),dG=function(b){function a(a,e,f){var d=this,g=new dI(a.width,a.height,e,f),h=new ao(c.WHITE);return(d=b.call(this,g,h)||this).texture=a,d.autoResize=!0,d}return ak(a,b),a.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var a=this.geometry,b=this.shader.texture,c=b.width,d=b.height;!this.autoResize||a.width===c&&a.height===d||(a.width=this.shader.texture.width,a.height=this.shader.texture.height,a.build())},Object.defineProperty(a.prototype,"texture",{get:function(){return this.shader.texture},set:function(a){this.shader.texture!==a&&(this.shader.texture=a,this._textureID=-1,a.baseTexture.valid?this.textureUpdated():a.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),a.prototype._render=function(a){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),b.prototype._render.call(this,a)},a.prototype.destroy=function(a){this.shader.texture.off("update",this.textureUpdated,this),b.prototype.destroy.call(this,a)},a}(ah),ic=function(b){function a(a,j,g,h,i){var d,e,f;return void 0===a&&(a=c.EMPTY),d=this,e=new aI(j,g,h),e.getBuffer("aVertexPosition").static=!1,f=new ao(a),(d=b.call(this,e,f,null,i)||this).autoUpdate=!0,d}return ak(a,b),Object.defineProperty(a.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(a){this.geometry.getBuffer("aVertexPosition").data=a},enumerable:!1,configurable:!0}),a.prototype._render=function(a){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),b.prototype._render.call(this,a)},a}(ah),id=function(b){function a(d,e,f,g,h){void 0===e&&(e=10),void 0===f&&(f=10),void 0===g&&(g=10),void 0===h&&(h=10);var a=b.call(this,c.WHITE,4,4)||this;return a._origWidth=d.orig.width,a._origHeight=d.orig.height,a._width=a._origWidth,a._height=a._origHeight,a._leftWidth=e,a._rightWidth=g,a._topHeight=f,a._bottomHeight=h,a.texture=d,a}return ak(a,b),a.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(a.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(a){this.geometry.getBuffer("aVertexPosition").data=a},enumerable:!1,configurable:!0}),a.prototype.updateHorizontalVertices=function(){var a=this.vertices,b=this._getMinScale();a[9]=a[11]=a[13]=a[15]=this._topHeight*b,a[17]=a[19]=a[21]=a[23]=this._height-this._bottomHeight*b,a[25]=a[27]=a[29]=a[31]=this._height},a.prototype.updateVerticalVertices=function(){var a=this.vertices,b=this._getMinScale();a[2]=a[10]=a[18]=a[26]=this._leftWidth*b,a[4]=a[12]=a[20]=a[28]=this._width-this._rightWidth*b,a[6]=a[14]=a[22]=a[30]=this._width},a.prototype._getMinScale=function(){var a=this._leftWidth+this._rightWidth,c=this._width>a?1:this._width/a,b=this._topHeight+this._bottomHeight,d=this._height>b?1:this._height/b;return Math.min(c,d)},Object.defineProperty(a.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(a){this._leftWidth=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(a){this._rightWidth=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"topHeight",{get:function(){return this._topHeight},set:function(a){this._topHeight=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(a){this._bottomHeight=a,this._refresh()},enumerable:!1,configurable:!0}),a.prototype._refresh=function(){var b=this.texture,a=this.geometry.buffers[1].data,c,d;this._origWidth=b.orig.width,this._origHeight=b.orig.height,c=1/this._origWidth,d=1/this._origHeight,a[0]=a[8]=a[16]=a[24]=0,a[1]=a[3]=a[5]=a[7]=0,a[6]=a[14]=a[22]=a[30]=1,a[25]=a[27]=a[29]=a[31]=1,a[2]=a[10]=a[18]=a[26]=c*this._leftWidth,a[4]=a[12]=a[20]=a[28]=1-c*this._rightWidth,a[9]=a[11]=a[13]=a[15]=d*this._topHeight,a[17]=a[19]=a[21]=a[23]=1-d*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},a}(dG),dC=function(a,b){return dC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dC(a,b)},ig=function(d){function b(b,e){void 0===e&&(e=!0);var a=d.call(this,b[0]instanceof c?b[0]:b[0].texture)||this;return a._textures=null,a._durations=null,a._autoUpdate=e,a._isConnectedToTicker=!1,a.animationSpeed=1,a.loop=!0,a.updateAnchor=!1,a.onComplete=null,a.onFrameChange=null,a.onLoop=null,a._currentTime=0,a._playing=!1,a._previousFrame=null,a.textures=b,a}return function(b,a){function c(){this.constructor=b}dC(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(b,d),b.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(o.shared.remove(this.update,this),this._isConnectedToTicker=!1))},b.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(o.shared.add(this.update,this,a.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},b.prototype.gotoAndStop=function(a){this.stop();var b=this.currentFrame;this._currentTime=a,b!==this.currentFrame&&this.updateTexture()},b.prototype.gotoAndPlay=function(a){var b=this.currentFrame;this._currentTime=a,b!==this.currentFrame&&this.updateTexture(),this.play()},b.prototype.update=function(e){var c,b,a,d;if(this._playing){if(c=this.animationSpeed*e,b=this.currentFrame,null!==this._durations){a=this._currentTime%1*this._durations[this.currentFrame];for(a+=c/60*1e3;a<0;)this._currentTime--,a+=this._durations[this.currentFrame];d=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);a>=this._durations[this.currentFrame];)a-=this._durations[this.currentFrame]*d,this._currentTime+=d;this._currentTime+=a/this._durations[this.currentFrame]}else this._currentTime+=c;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):b!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrameb)&&this.onLoop(),this.updateTexture())}},b.prototype.updateTexture=function(){var a=this.currentFrame;this._previousFrame!==a&&(this._previousFrame=a,this._texture=this._textures[a],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},b.prototype.destroy=function(a){this.stop(),d.prototype.destroy.call(this,a),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},b.fromFrames=function(d){for(var e=[],a=0;a=2*Math.PI?this.drawCircle(c,d,f).beginHole().drawCircle(c,d,e).endHole():(this.finishPoly(),this.arc(c,d,e,b,a,!0).arc(c,d,f,a,b,!1).finishPoly(),this)}},drawChamferRect:{value:function(d,e,h,i,j){if(j<=0)return this.drawRect(d,e,h,i);for(var a=Math.min(j,Math.min(h,i)/2),f=d+h,g=e+i,b=[d+a,e,f-a,e,f,e+a,f,g-a,f-a,g,d+a,g,d,g-a,d,e+a],c=b.length-1;c>=2;c-=2)b[c]===b[c-2]&&b[c-1]===b[c-3]&&b.splice(c-1,2);return this.drawPolygon(b)}},drawFilletRect:{value:function(b,c,g,i,k){if(0===k)return this.drawRect(b,c,g,i);var j=Math.min(g,i)/2,h=Math.min(j,Math.max(-j,k)),f=b+g,e=c+i,d=h<0?-h:0,a=Math.abs(h);return this.moveTo(b,c+a).arcTo(b+d,c+d,b+a,c,a).lineTo(f-a,c).arcTo(f-d,c+d,f,c+a,a).lineTo(f,e-a).arcTo(f-d,e-d,b+g-a,e,a).lineTo(b+a,e).arcTo(b+d,e-d,b,e-a,a).closePath()}},drawRegularPolygon:{value:function(i,j,h,b,d){var g,f,c,a,e;void 0===d&&(d=0),b=Math.max(0|b,3);for(g=-1*Math.PI/2+d,f=2*Math.PI/b,c=[],a=0;a{if(typeof b!="object")return a;for(let c of Object.keys(b))a[c]=b[c];return a},kagura=function(){const a={Kagura:class{constructor(b){b=objSafe({element:null,fps:30,width:null,height:null,StartScene:a.Scene,backgroundColor:"#000",autoFpsControl:!0,autoViewSize:!1},b),this.options=b;const c={view:b.element,width:b.width,height:b.height,backgroundColor:b.backgroundColor};this.app=new PIXI.Application(c),this.app.renderer.resize(b.width,b.height),this.view=this.app.view,this.grid=new a.Grid(32,this.view.width,this.view.height);let d=b.StartScene;this.scene=this.newClass(d),b.autoViewSize&&(scaleToWindow(this.app.view),window.addEventListener("resize",()=>{scaleToWindow(this.app.view)})),this.keyboard=new a.Keyboard(document),this.touchs=new a.Touches(this.view),b.autoFpsControl&&(this.fpsHistory=[]),this.backgroundColor=b.backgroundColor,this.backFlameTime=new Date}roop(){let b=(new Date).getTime()-this.backFlameTime.getTime();if(this.backFlameTime=new Date,this.sceneFlame++,this.grid.w=this.app.view.width,this.grid.h=this.app.view.height,this.scene.update({sceneFlame:this.sceneFlame,sceneTime:((new Date).getTime()-this.sceneStartTime.getTime())/1e3,fps:1e3/b,deltaTime:b,deltaFlame:b/(1e3/this.options.fps),keyboard:this.keyboard,pointers:this.touchs.get}),this.scene.nextScene!==!1){let a=this.app;this.app.stage.children=[],this.scene=this.newClass(this.scene.nextScene,this.scene.passValue)}this.app.renderer.backgroundColor=this.scene.backgroundColor;let a;if(this.options.autoFpsControl){this.fpsHistory.push(1e3/b),this.fpsHistory.length===10&&this.fpsHistory.shift();let c=this.fpsHistory.reduce((a,b)=>a+b)/this.fpsHistory.length;a=this.options.fps,a*=a/c}else a=this.options.fps;setTimeout(this.roop.bind(this),1e3/a)}newClass(a,b={}){return this.sceneFlame=0,this.sceneStartTime=new Date,a.prototype.app=this.app,a.prototype.width=this.app.renderer.width,a.prototype.height=this.app.renderer.height,a.prototype.backgroundColor=this.options.backgroundColor,a.prototype.grid=this.grid,new a({catches:b})}mainroop(){requestAnimationFrame(this.roop.bind(this))}fullscreen(){a.FullScreen(document)}},Scene:class{constructor(a){this.nextScene=!1,this.stage=this.app.stage,this.renderer=this.app.renderer}exit(a,b){this.passValue=b,this.nextScene=a}update(a){}addChild(...a){return this.app.stage.addChild(...a)}},obj:{shape:{isNewTest:""}},Boxer:class{constructor(a){for(let b of Object.keys(a))this[b]=a[b]}},fullscreen:function(a){a||(a=document.documentElement);function b(a,b){return b in a}b(a,"webkitRequestFullscreen")?a.webkitRequestFullscreen():b(a,"requestFullscreen")?a.requestFullscreen():b(a,"mozRequestFullScreen")&&a.mozRequestFullScreen()},pixi:PIXI,api:{}};return a.exitFullscreen=Document.exitFullscreen,a.Grid=class{constructor(a,b,c){this.n=a,this._w=b,this._h=c,this.ud(),this.x=function(a){return this.vw*a+this.w/2},this.y=function(a){return this.vh*a+this.h/2}}xy(a,b){return{x:this.vw*a+this._w/2,y:this.vh*b+this._h/2}}ud(){this.vw=this._w/(2*this.n),this.vh=this._h/(2*this.n),this.c={x:this._w/2,y:this._h/2}}set w(a){this._w=a,this.ud()}set h(a){this._h=a,this.ud()}get w(){return this._w}get h(){return this._h}},a.browser=function(a){return a=a.toLowerCase(),a.indexOf('msie')!=-1||a.indexOf('trident')!=-1?'ie':a.indexOf('edge')!=-1?'edge':a.indexOf('chrome')!=-1?'chrome':a.indexOf('safari')!=-1?'safari':a.indexOf('firefox')!=-1?'firefox':a.indexOf('opera')!=-1?'opera':''}(window.navigator.userAgent),a.Sounder=class{constructor(a){this.url=a}make(a=!0){return new class{constructor(a,b=!0){this.elem=document.createElement("audio"),this.elem.src=a,b&&this.elem.addEventListener("ended",()=>{this.kill()})}play(){this.elem.play()}pause(){this.elem.pause()}get time(){return this.elem.currentTime}set time(a){this.elem.currentTime=a}get max(){return this.elem.max}set max(a){this.elem.max=a}get volume(){return this.elem.volume}set volume(a){this.elem.volume=a}get ended(){return this.elem.ended}get speed(){return this.elem.playbackRate}set speed(a){this.elem.playbackRate=a}kill(){this.elem.remove(),delete this.elem}}(this.url,a)}},a.obj.Object=class{constructor(a){this.obj=a;for(let a of Object.getOwnPropertyNames(this.obj)){let b=Object.getOwnPropertyDescriptor(this.obj,a);Object.defineProperty(this,a,{get:function(){return this.obj[a]},set:function(b){this.obj[a]=b}})}this.__proto__=this.obj.__proto__,Object.assign(this.__proto__,{addChildTo:function(a){return a.addChild(this.obj),this}})}},a.obj.Text=class extends a.obj.Object{constructor(b){b=objSafe({text:"",x:0,y:0,fill:16777215,align:"left",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",stroke:"black",strokeThickness:0,anchor:{x:0,y:0},options:{}},b),b.options=objSafe({fill:b.fill,align:b.align,fontFamily:b.fontFamily,fontSize:b.fontSize,fontVariant:b.fontVariant,fontWeight:b.fontWeight,stroke:b.stroke,strokeThickness:b.strokeThickness},b.options),super(new a.pixi.Text(b.text,b.options)),this.obj.x=b.x,this.obj.y=b.y}},a.obj.Group=class extends PIXI.Container{constructor(a){a=objSafe({x:0,y:0,rotation:0,alpha:1},a),super(),this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.alpha=a.alpha}addChildTo(a){return a.addChild(this),this}each(b){let a=[];return this.children.forEach((c,d)=>{const e=b.call(c,c,d);e===!0&&a.push(d)}),a.reverse().forEach(a=>this.children.splice(a,1)),this}},a.obj.shape.GraphicsProto=class extends a.obj.Object{constructor(a){super(new PIXI.Graphics),a=objSafe({x:0,y:0,rotation:0,alpha:1,scale:{x:1,y:1}},a),this.obj.x=a.x,this.obj.y=a.y,this.obj.rotation=a.rotation,this.obj.alpha=a.alpha,this.obj.scale=a.scale}},a.obj.shape.GraphicsFill=class extends a.obj.shape.GraphicsProto{constructor(a,b){a=objSafe({fill:16777215},a),super(a),this.draw=b,this.options=a,this.obj.beginFill(a.fill),this.draw(this.obj,this.options),this.obj.pivot.x=0,this.obj.pivot.y=0}set fill(a){this.obj.clear(),this.obj.beginFill(a),this.draw(this.obj,this.options)}},a.obj.shape.Circle=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({radius:10},a),super(a,(a,b)=>{a.drawCircle(0,0,b.radius).endFill()})}get radius(){return this.obj.radius}set radius(a){this.obj.radius=a}},a.obj.shape.Ellipse=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({width:10,height:10},a),super(a,(b,a)=>{b.drawEllipse(0,0,a.width,a.height).endFill()})}},a.obj.shape.Path=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({paths:[[100,0],[70,70],[0,100],[-70,70],[-100,0],[-70,-70],[0,-100],[70,-70]]},a),super(a,(b,c)=>{let a=[];for(let b of c.paths)if(b.length===2&&Array.isArray(b))a.push(b[0],b[1]);else{console.error("Paths's arguments type is array, and children array's length is 2.");return}b.drawPolygon(a).endFill()})}},a.obj.shape.Rect=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({width:100,height:100,fillet:0},a),super(a,(b,a)=>{b.drawFilletRect(0,0,a.width,a.height,a.fillet).endFill()})}},a.obj.shape.Polygon=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({radius:10,sides:1,corner:1},a),super(a,(b,a)=>{b.drawRoundedPolygon(0,0,a.radius,a.sides,a.corner,0).endFill()})}},a.obj.shape.Star=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({points:5,radius:10,innerRadius:20},a),super(a,(b,a)=>{b.drawStar(0,0,a.points,a.radius,a.innerRadius,0).endFill()})}},a.obj.shape.Torus=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({points:5,radius:10,innerRadius:0,outerRadius:Math.PI*2},a),super(a,(b,a)=>{b.drawTorus(0,0,a.innerRadius,a.outerRadius,a.startArc,a.endArc).endFill()})}},a.obj.shape.Line=class extends a.obj.shape.GraphicsProto{constructor(a){a=objSafe({color:16777215,paths:[[0,0],[10,10]],size:1},a),super(a),this.options=a,Object.defineProperty(this,"color",{set:function(a){this.options.color=a,this.draw()}}),this.draw=()=>{const a=this.options;this.clear(),this.lineStyle(a.size,a.color);let b=0;for(let c of a.paths)if(b++,c.length===2&&Array.isArray(c))b===1&&this.moveTo(...c),this.lineTo(...c);else{console.error("Paths's arguments type is array, and children array's length is 2.");return}},this.draw()}},a.Loader=class{constructor(b,c){if(!b){console.error("Loads arguments is undefined.");return}this.assets={},c||(c=function(){}),this.loaded=c,this.loader=new a.pixi.Loader,this.loadedXhr={__pixiLoaded__:!1},Object.keys(b).forEach(a=>{this.loadedXhr[a]=!1});for(const c of Object.keys(b)){const d=b[c];this.loader.add(c,d),this.assets[c]={get text(){return this._text.result},get json(){try{return JSON.parse(this.text)}catch{return void 0}}};let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(a.readyState==4&&a.status==200){const b=this.assets[c];b.blobObj=a.response,b.blob=window.URL.createObjectURL(a.response),b.image=new Image(b.blob),b.sound=new Audio(b.blob),b.url=a.responseURL,b._text=new FileReader,b._text.readAsText(b.blobObj)}setTimeout(()=>this.loadedOneXhr(c),0)},a.responseType="blob",a.open('GET',d,!0),a.send()}this.loader.load(()=>{for(const c of Object.keys(this.loader.resources)){const a=this.loader.resources[c],b=this.assets[c];b.pixiLoad=a,b.texture=a.texture,b.textures=a.textures}this.loadedOneXhr("__pixiLoaded__")})}get(a){return this.assets[a]}loadedOneXhr(a){this.loadedXhr[a]=!0,Object.values(this.loadedXhr).reduce((a,b)=>a&&b)&&this.loaded(this.assets,this)}},a.obj.Sprite=class extends a.pixi.Sprite{constructor(a){super(),a=objSafe({texture:void 0,alpha:1,x:0,y:0,width:this.width,height:this.height},a),this.texture=a.texture,this.alpha=a.alpha,this.x=a.x,this.y=a.y}addChildTo(a){return a.addChild(this),this}},a.Keyboard=class{constructor(a=document){this.keys=[],this.elem=a,this.keycodes={0:{id:0,key:["",""],code:""},1:{id:1,key:["unidentified",""],code:""},2:{id:2,key:["",""],code:""},3:{id:3,key:["cancel",""],code:"pause"},4:{id:4,key:["",""],code:""},5:{id:5,key:["",""],code:""},6:{id:6,key:["",""],code:""},7:{id:7,key:["",""],code:""},8:{id:8,key:["backspace",""],code:"backspace"},9:{id:9,key:["tab",""],code:"tab"},10:{id:10,key:["",""],code:""},11:{id:11,key:["",""],code:""},12:{id:12,key:["clear",""],code:"numlock"},13:{id:13,key:["enter",""],code:"enter"},14:{id:14,key:["",""],code:""},15:{id:15,key:["",""],code:""},16:{id:16,key:["shift",""],code:"shiftleft"},17:{id:17,key:["control",""],code:"controlleft"},18:{id:18,key:["alt",""],code:"altleft"},19:{id:19,key:["pause",""],code:"pause"},20:{id:20,key:["capslock",""],code:"capslock"},21:{id:21,key:["unidentified",""],code:"lang1"},22:{id:22,key:["",""],code:""},23:{id:23,key:["",""],code:""},24:{id:24,key:["",""],code:""},25:{id:25,key:["unidentified",""],code:"lang2"},26:{id:26,key:["",""],code:""},27:{id:27,key:["escape",""],code:"escape"},28:{id:28,key:["",""],code:""},29:{id:29,key:["",""],code:""},30:{id:30,key:["",""],code:""},31:{id:31,key:["",""],code:""},32:{id:32,key:[" ",""],code:"space"},33:{id:33,key:["pageup",""],code:"numpad9"},34:{id:34,key:["pagedown",""],code:"numpad3"},35:{id:35,key:["end",""],code:"numpad1"},36:{id:36,key:["home",""],code:"numpad7"},37:{id:37,key:["arrowleft",""],code:"arrowleft"},38:{id:38,key:["arrowup",""],code:"arrowup"},39:{id:39,key:["arrowright",""],code:"arrowright"},40:{id:40,key:["arrowdown",""],code:"arrowdown"},41:{id:41,key:["",""],code:""},42:{id:42,key:["",""],code:""},43:{id:43,key:["",""],code:""},44:{id:44,key:["f13",""],code:"f13"},45:{id:45,key:["insert",""],code:"numpad0"},46:{id:46,key:["delete",""],code:"numpaddecimal"},47:{id:47,key:["",""],code:""},48:{id:48,key:["0",""],code:"digit0"},49:{id:49,key:["1",""],code:"digit1"},50:{id:50,key:["2",""],code:"digit2"},51:{id:51,key:["3",""],code:"digit3"},52:{id:52,key:["4",""],code:"digit4"},53:{id:53,key:["5",""],code:"digit5"},54:{id:54,key:["6",""],code:"digit6"},55:{id:55,key:["7",""],code:"digit7"},56:{id:56,key:["8",""],code:"digit8"},57:{id:57,key:["9",""],code:"digit9"},58:{id:58,key:[":",""],code:"period"},59:{id:59,key:[";",""],code:"semicolon"},60:{id:60,key:["<",""],code:"backquote"},61:{id:61,key:["=",""],code:"equal"},62:{id:62,key:["",""],code:""},63:{id:63,key:["\u03b2",""],code:"minus"},64:{id:64,key:["",""],code:""},65:{id:65,key:["a",""],code:"keya"},66:{id:66,key:["b",""],code:"keyb"},67:{id:67,key:["c",""],code:"keyc"},68:{id:68,key:["d",""],code:"keyd"},69:{id:69,key:["e",""],code:"keye"},70:{id:70,key:["f",""],code:"keyf"},71:{id:71,key:["g",""],code:"keyg"},72:{id:72,key:["h",""],code:"keyh"},73:{id:73,key:["i",""],code:"keyi"},74:{id:74,key:["j",""],code:"keyj"},75:{id:75,key:["k",""],code:"keyk"},76:{id:76,key:["l",""],code:"keyl"},77:{id:77,key:["m",""],code:"keym"},78:{id:78,key:["n",""],code:"keyn"},79:{id:79,key:["o",""],code:"keyo"},80:{id:80,key:["p",""],code:"keyp"},81:{id:81,key:["q",""],code:"keyq"},82:{id:82,key:["r",""],code:"keyr"},83:{id:83,key:["s",""],code:"keys"},84:{id:84,key:["t",""],code:"keyt"},85:{id:85,key:["u",""],code:"keyu"},86:{id:86,key:["v",""],code:"keyv"},87:{id:87,key:["w",""],code:"keyw"},88:{id:88,key:["x",""],code:"keyx"},89:{id:89,key:["y",""],code:"keyy"},90:{id:90,key:["z",""],code:"keyz"},91:{id:91,key:["meta",""],code:"metaleft"},92:{id:92,key:["meta",""],code:"metaright"},93:{id:93,key:["contextmenu",""],code:"contextmenu"},94:{id:94,key:["",""],code:""},95:{id:95,key:["",""],code:""},96:{id:96,key:["0",""],code:"numpad0"},97:{id:97,key:["1",""],code:"numpad1"},98:{id:98,key:["2",""],code:"numpad2"},99:{id:99,key:["3",""],code:"numpad3"},100:{id:100,key:["4",""],code:"numpad4"},101:{id:101,key:["5",""],code:"numpad5"},102:{id:102,key:["6",""],code:"numpad6"},103:{id:103,key:["7",""],code:"numpad7"},104:{id:104,key:["8",""],code:"numpad8"},105:{id:105,key:["9",""],code:"numpad9"},106:{id:106,key:["*",""],code:"numpadmultiply"},107:{id:107,key:["+",""],code:"numpadadd"},108:{id:108,key:[",",""],code:"numpaddecimal"},109:{id:109,key:["-",""],code:"numpadsubtract"},110:{id:110,key:[".",""],code:"numpaddecimal"},111:{id:111,key:["/",""],code:"numpaddivide"},112:{id:112,key:["f1",""],code:"f1"},113:{id:113,key:["f2",""],code:"f2"},114:{id:114,key:["f3",""],code:"f3"},115:{id:115,key:["f4",""],code:"f4"},116:{id:116,key:["f5",""],code:"f5"},117:{id:117,key:["f6",""],code:"f6"},118:{id:118,key:["f7",""],code:"f7"},119:{id:119,key:["f8",""],code:"f8"},120:{id:120,key:["f9",""],code:"f9"},121:{id:121,key:["f10",""],code:"f10"},122:{id:122,key:["f11",""],code:"f11"},123:{id:123,key:["f12",""],code:"f12"},124:{id:124,key:["f13",""],code:"f13"},125:{id:125,key:["f14",""],code:"f14"},126:{id:126,key:["f15",""],code:"f15"},127:{id:127,key:["f16",""],code:"f16"},128:{id:128,key:["f17",""],code:"f17"},129:{id:129,key:["f18",""],code:"f18"},130:{id:130,key:["f19",""],code:"f19"},131:{id:131,key:["f20",""],code:"f20"},132:{id:132,key:["f21",""],code:"f21"},133:{id:133,key:["f22",""],code:"f22"},134:{id:134,key:["f23",""],code:"f23"},135:{id:135,key:["f24",""],code:"f24"},136:{id:136,key:["f25",""],code:"f25"},137:{id:137,key:["f26",""],code:"f26"},138:{id:138,key:["f27",""],code:"f27"},139:{id:139,key:["f28",""],code:"f28"},140:{id:140,key:["f29",""],code:"f29"},141:{id:141,key:["f30",""],code:"f30"},142:{id:142,key:["f31",""],code:"f31"},143:{id:143,key:["f32",""],code:"f32"},144:{id:144,key:["numlock",""],code:"numlock"},145:{id:145,key:["scrolllock",""],code:"scrolllock"},146:{id:146,key:["",""],code:""},147:{id:147,key:["",""],code:""},148:{id:148,key:["",""],code:""},149:{id:149,key:["",""],code:""},150:{id:150,key:["",""],code:""},151:{id:151,key:["",""],code:""},152:{id:152,key:["",""],code:""},153:{id:153,key:["",""],code:""},154:{id:154,key:["",""],code:""},155:{id:155,key:["",""],code:""},156:{id:156,key:["",""],code:""},157:{id:157,key:["",""],code:""},158:{id:158,key:["",""],code:""},159:{id:159,key:["",""],code:""},160:{id:160,key:["[",""],code:"blacketleft"},161:{id:161,key:["dead",""],code:"blacketright"},162:{id:162,key:["",""],code:""},163:{id:163,key:["\\",""],code:"backquote"},164:{id:164,key:["$",""],code:"backslash"},165:{id:165,key:["^\u00f9",""],code:"quote"},166:{id:166,key:["",""],code:""},167:{id:167,key:["",""],code:""},168:{id:168,key:["",""],code:""},169:{id:169,key:[")",""],code:"minus"},170:{id:170,key:["*",""],code:"backslash"},171:{id:171,key:["+",""],code:"bracketright"},172:{id:172,key:["",""],code:""},173:{id:173,key:["-",""],code:"minus"},174:{id:174,key:["audiovolumedown",""],code:""},175:{id:175,key:["audiovolumeup",""],code:""},176:{id:176,key:["mediatracknext",""],code:"mediatracknext"},177:{id:177,key:["mediatrackprevious",""],code:"mediatrackprevious"},178:{id:178,key:["",""],code:""},179:{id:179,key:["mediaplaypause",""],code:""},180:{id:180,key:["launchmail",""],code:""},181:{id:181,key:["audiovolumemute",""],code:"volumemute"},182:{id:182,key:["audiovolumedown",""],code:"volumedown"},183:{id:183,key:["audiovolumeup",""],code:"volumeup"},184:{id:184,key:["",""],code:""},185:{id:185,key:["",""],code:""},186:{id:186,key:[";",""],code:"semicolon"},187:{id:187,key:["+",""],code:"equal"},188:{id:188,key:[",",""],code:"comma"},189:{id:189,key:["-",""],code:"minus"},190:{id:190,key:[".",""],code:"period"},191:{id:191,key:["/","?"],code:"slash"},192:{id:192,key:["`",""],code:"backquote"},193:{id:193,key:["/",""],code:"intlro"},194:{id:194,key:[".",""],code:"numpadcomma"},195:{id:195,key:["",""],code:""},196:{id:196,key:["",""],code:""},197:{id:197,key:["",""],code:""},198:{id:198,key:["",""],code:""},199:{id:199,key:["",""],code:""},200:{id:200,key:["",""],code:""},201:{id:201,key:["",""],code:""},202:{id:202,key:["",""],code:""},203:{id:203,key:["",""],code:""},204:{id:204,key:["",""],code:""},205:{id:205,key:["",""],code:""},206:{id:206,key:["",""],code:""},207:{id:207,key:["",""],code:""},208:{id:208,key:["",""],code:""},209:{id:209,key:["",""],code:""},210:{id:210,key:["",""],code:""},211:{id:211,key:["",""],code:""},212:{id:212,key:["",""],code:""},213:{id:213,key:["",""],code:""},214:{id:214,key:["",""],code:""},215:{id:215,key:["",""],code:""},216:{id:216,key:["",""],code:""},217:{id:217,key:["",""],code:""},218:{id:218,key:["",""],code:""},219:{id:219,key:["[",""],code:"blacketleft"},220:{id:220,key:["\\",""],code:"backslash"},221:{id:221,key:["]",""],code:"bracketright"},222:{id:222,key:["'",""],code:"quote"},223:{id:223,key:["`",""],code:"backquote"},224:{id:224,key:["meta",""],code:"osleft"},225:{id:225,key:["altgraph",""],code:"altright"},226:{id:226,key:["\\",""],code:"intlbackslash"},227:{id:227,key:["",""],code:""},228:{id:228,key:["",""],code:""},229:{id:229,key:["",""],code:""},230:{id:230,key:["",""],code:""},231:{id:231,key:["",""],code:""},232:{id:232,key:["",""],code:""},233:{id:233,key:["",""],code:""},234:{id:234,key:["",""],code:""},235:{id:235,key:["",""],code:""},236:{id:236,key:["",""],code:""},237:{id:237,key:["",""],code:""},238:{id:238,key:["",""],code:""},239:{id:239,key:["",""],code:""},240:{id:240,key:["",""],code:""},241:{id:241,key:["",""],code:""},242:{id:242,key:["",""],code:""},243:{id:243,key:["",""],code:""},244:{id:244,key:["",""],code:""},245:{id:245,key:["",""],code:""},246:{id:246,key:["",""],code:""},247:{id:247,key:["",""],code:""},248:{id:248,key:["",""],code:""},249:{id:249,key:["",""],code:""},250:{id:250,key:["",""],code:""},251:{id:251,key:["",""],code:""},252:{id:252,key:["",""],code:""},253:{id:253,key:["",""],code:""},254:{id:254,key:["",""],code:""},255:{id:255,key:["unidentified",""],code:"wakeup"}},a.addEventListener("keydown",a=>{this.addkey(a.keyCode)}),a.addEventListener("keyup",b=>{const a=this.keys.indexOf(b.keyCode);a!==-1&&this.keys.splice(a,1)})}addkey(a){this.keys.includes(a)||this.keys.push(a)}delkey(b){const a=this.keys.indexOf(b);a!==-1&&this.keys.splice(a,1)}metaKey(a){a.shiftKey===!0?this.addkey("shift"):this.delkey("shift")}get allKeys(){let a=[];for(let c of this.keys){const b=this.keycodes[c];a.push(b.code),a.push(b.id),a=a.concat(b.key)}return a}isDown(a){return this.allKeys.includes(a)}},a.Touches=class{constructor(a=document){this.mouse={x:0,y:0,down:!1},this.touches={},this.lastPointer={x:0,y:0},a.addEventListener('mousemove',a=>{this.mouse.x=a.clientX,this.mouse.y=a.clientY}),a.addEventListener("mousedown",a=>{this.mouse.x=a.clientX,this.mouse.y=a.clientY,this.mouse.down=!0}),a.addEventListener("mouseup",a=>{this.mouse.x=a.clientX,this.mouse.y=a.clientY,this.mouse.down=!1}),a.addEventListener("touchstart",a=>{for(let c=0;c{for(let b=0;b{for(let c=0;c1&&a.preventDefault()}),a.addEventListener("touchcancel",a=>{for(let b=0;ba.offsetHeight?a.offsetWidth*b-1,b}var PIXI=function(a){"use strict";var ie=setTimeout,ep,hM,hK,ha,hy,dj,eH,da,c_,eK,cY,eL,eR,ff,cT,fg,ag,ba,B,fi,fj,fm,ft,fA,fD,fL,s,b,cK,af,aT,hb,gt,cj,gm,bz,gp,gs,az,gv,ce,gy,gD,gL,gT,gU,gX,gZ,cb,fZ,fY,fW,g_,g$,bW,ad,L,fH,bR,bQ,hh,bN,hi,hj,fs,bG,q,r,bF,by,fp,hm,aA,fh,fe,g,bn,d,fd,fa,aG,e_,P,m,M,N,W,R,bT,eZ,aV,i,bX,aO,bZ,k,ca,u,aD,eT,A,p,ch,o,eQ,aq,cm,co,Z,S,hs,e,bm,cu,z,cw,cx,bc,cz,cA,cB,eN,hw,a_,cF,cG,eF,c,G,eB,cM,hz,n,hA,ew,hD,hE,an,en,cV,hO,J,ek,bi,dD,c$,aF,db,ej,dd,ei,ih,dg,dh,di,eg,br,dV,aC,hX,bv,dL,at,Y,hZ,h_,h$,ib,bl,al,D,K,C,dM,bu,dO,du,dQ,dR,dS,dt,ds,dq,$,aE,dk,hU,d$,ed,hS,bp,df,de,dc,be,cW,em,cU,eo,hN,hH,cS,et,cR,hB,bb,aY,aW,ez,eA,cL,eC,eD,eE,cH,eG,hx,cD,eJ,hu,eh,eM,cC,cr,eP,bA,hr,eS,bw,eU,eV,eW,aX,bU,E,bh,ho,bE,hn,aJ,fk,fl,f,hk,av,bD,bs,y,fu,bk,fw,w,bL,U,H,aZ,hg,hf,fG,bS,fI,fJ,fM,fN,bV,hd,fR,fS,ac,dE,bY,b$,aL,f_,gb,aj,cd,gh,gi,gj,bt,cf,ay,cg,am,dF,gn,gr,ci,ar,gu,cn,aw,gx,ai,cp,cq,gB,X,bf,x,gI,cy,cE,gf,ge,ga,gY,f$,fV,cI,aN,hc,fQ,aU,fE,cN,fv,cP,fo,ah,ao,aI,cQ,aH,eX,bd,eO,cX,F,ey,ex,ev,hC,eu,dl,hF,dn,hI,hJ,dp,hL,dr,dv,dw,hP,dx,hR,dA,hT,d_,hV,dZ,dP,dB,dI,dH,ia,dG,ic,id,dC,ig,gw;function dJ(a){return Boolean(a&&void 0!==a.length)}function hY(){}function l(a){if(!(this instanceof l))throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],el(a,this)}function ef(a,b){for(;3===a._state;)a=a._value;0!==a._state?(a._handled=!0,l._immediateFn(function(){var c=1===a._state?b.onFulfilled:b.onRejected,d;if(null!==c){try{d=c(a._value)}catch(a){return void aB(b.promise,a)}dz(b.promise,d)}else(1===a._state?dz:aB)(b.promise,a._value)})):a._deferreds.push(b)}function dz(a,b){var c,d,e;try{if(b===a)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){if(c=b.then,b instanceof l)return a._state=3,a._value=b,void dy(a);if("function"==typeof c)return void el((d=c,e=b,function(){d.apply(e,arguments)}),a)}a._state=1,a._value=b,dy(a)}catch(b){aB(a,b)}}function aB(a,b){a._state=2,a._value=b,dy(a)}function dy(a){2===a._state&&0===a._deferreds.length&&l._immediateFn(function(){a._handled||l._unhandledRejectionFn(a._value)});for(var b=0,c=a._deferreds.length;b0?1:-1}),Number.isInteger||(Number.isInteger=function(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array),a.ENV=void 0,a.RENDERER_TYPE=void 0,a.BUFFER_BITS=void 0,a.BLEND_MODES=void 0,a.DRAW_MODES=void 0,a.FORMATS=void 0,a.TARGETS=void 0,a.TYPES=void 0,a.SAMPLER_TYPES=void 0,a.SCALE_MODES=void 0,a.WRAP_MODES=void 0,a.MIPMAP_MODES=void 0,a.ALPHA_MODES=void 0,a.CLEAR_MODES=void 0,a.GC_MODES=void 0,a.PRECISION=void 0,a.MASK_TYPES=void 0,a.COLOR_MASK_BITS=void 0,a.MSAA_QUALITY=void 0,a.BUFFER_TYPE=void 0,function(a){a[a.WEBGL_LEGACY=0]="WEBGL_LEGACY",a[a.WEBGL=1]="WEBGL",a[a.WEBGL2=2]="WEBGL2"}(a.ENV||(a.ENV={})),function(a){a[a.UNKNOWN=0]="UNKNOWN",a[a.WEBGL=1]="WEBGL",a[a.CANVAS=2]="CANVAS"}(a.RENDERER_TYPE||(a.RENDERER_TYPE={})),function(a){a[a.COLOR=16384]="COLOR",a[a.DEPTH=256]="DEPTH",a[a.STENCIL=1024]="STENCIL"}(a.BUFFER_BITS||(a.BUFFER_BITS={})),function(a){a[a.NORMAL=0]="NORMAL",a[a.ADD=1]="ADD",a[a.MULTIPLY=2]="MULTIPLY",a[a.SCREEN=3]="SCREEN",a[a.OVERLAY=4]="OVERLAY",a[a.DARKEN=5]="DARKEN",a[a.LIGHTEN=6]="LIGHTEN",a[a.COLOR_DODGE=7]="COLOR_DODGE",a[a.COLOR_BURN=8]="COLOR_BURN",a[a.HARD_LIGHT=9]="HARD_LIGHT",a[a.SOFT_LIGHT=10]="SOFT_LIGHT",a[a.DIFFERENCE=11]="DIFFERENCE",a[a.EXCLUSION=12]="EXCLUSION",a[a.HUE=13]="HUE",a[a.SATURATION=14]="SATURATION",a[a.COLOR=15]="COLOR",a[a.LUMINOSITY=16]="LUMINOSITY",a[a.NORMAL_NPM=17]="NORMAL_NPM",a[a.ADD_NPM=18]="ADD_NPM",a[a.SCREEN_NPM=19]="SCREEN_NPM",a[a.NONE=20]="NONE",a[a.SRC_OVER=0]="SRC_OVER",a[a.SRC_IN=21]="SRC_IN",a[a.SRC_OUT=22]="SRC_OUT",a[a.SRC_ATOP=23]="SRC_ATOP",a[a.DST_OVER=24]="DST_OVER",a[a.DST_IN=25]="DST_IN",a[a.DST_OUT=26]="DST_OUT",a[a.DST_ATOP=27]="DST_ATOP",a[a.ERASE=26]="ERASE",a[a.SUBTRACT=28]="SUBTRACT",a[a.XOR=29]="XOR"}(a.BLEND_MODES||(a.BLEND_MODES={})),function(a){a[a.POINTS=0]="POINTS",a[a.LINES=1]="LINES",a[a.LINE_LOOP=2]="LINE_LOOP",a[a.LINE_STRIP=3]="LINE_STRIP",a[a.TRIANGLES=4]="TRIANGLES",a[a.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",a[a.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(a.DRAW_MODES||(a.DRAW_MODES={})),function(a){a[a.RGBA=6408]="RGBA",a[a.RGB=6407]="RGB",a[a.RG=33319]="RG",a[a.RED=6403]="RED",a[a.RGBA_INTEGER=36249]="RGBA_INTEGER",a[a.RGB_INTEGER=36248]="RGB_INTEGER",a[a.RG_INTEGER=33320]="RG_INTEGER",a[a.RED_INTEGER=36244]="RED_INTEGER",a[a.ALPHA=6406]="ALPHA",a[a.LUMINANCE=6409]="LUMINANCE",a[a.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",a[a.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",a[a.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(a.FORMATS||(a.FORMATS={})),function(a){a[a.TEXTURE_2D=3553]="TEXTURE_2D",a[a.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",a[a.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",a[a.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",a[a.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",a[a.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",a[a.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",a[a.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",a[a.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(a.TARGETS||(a.TARGETS={})),function(a){a[a.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",a[a.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",a[a.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",a[a.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",a[a.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",a[a.UNSIGNED_INT=5125]="UNSIGNED_INT",a[a.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",a[a.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",a[a.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",a[a.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",a[a.BYTE=5120]="BYTE",a[a.SHORT=5122]="SHORT",a[a.INT=5124]="INT",a[a.FLOAT=5126]="FLOAT",a[a.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",a[a.HALF_FLOAT=36193]="HALF_FLOAT"}(a.TYPES||(a.TYPES={})),function(a){a[a.FLOAT=0]="FLOAT",a[a.INT=1]="INT",a[a.UINT=2]="UINT"}(a.SAMPLER_TYPES||(a.SAMPLER_TYPES={})),function(a){a[a.NEAREST=0]="NEAREST",a[a.LINEAR=1]="LINEAR"}(a.SCALE_MODES||(a.SCALE_MODES={})),function(a){a[a.CLAMP=33071]="CLAMP",a[a.REPEAT=10497]="REPEAT",a[a.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(a.WRAP_MODES||(a.WRAP_MODES={})),function(a){a[a.OFF=0]="OFF",a[a.POW2=1]="POW2",a[a.ON=2]="ON",a[a.ON_MANUAL=3]="ON_MANUAL"}(a.MIPMAP_MODES||(a.MIPMAP_MODES={})),function(a){a[a.NPM=0]="NPM",a[a.UNPACK=1]="UNPACK",a[a.PMA=2]="PMA",a[a.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",a[a.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",a[a.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",a[a.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(a.ALPHA_MODES||(a.ALPHA_MODES={})),function(a){a[a.NO=0]="NO",a[a.YES=1]="YES",a[a.AUTO=2]="AUTO",a[a.BLEND=0]="BLEND",a[a.CLEAR=1]="CLEAR",a[a.BLIT=2]="BLIT"}(a.CLEAR_MODES||(a.CLEAR_MODES={})),function(a){a[a.AUTO=0]="AUTO",a[a.MANUAL=1]="MANUAL"}(a.GC_MODES||(a.GC_MODES={})),function(a){a.LOW="lowp",a.MEDIUM="mediump",a.HIGH="highp"}(a.PRECISION||(a.PRECISION={})),function(a){a[a.NONE=0]="NONE",a[a.SCISSOR=1]="SCISSOR",a[a.STENCIL=2]="STENCIL",a[a.SPRITE=3]="SPRITE",a[a.COLOR=4]="COLOR"}(a.MASK_TYPES||(a.MASK_TYPES={})),function(a){a[a.RED=1]="RED",a[a.GREEN=2]="GREEN",a[a.BLUE=4]="BLUE",a[a.ALPHA=8]="ALPHA"}(a.COLOR_MASK_BITS||(a.COLOR_MASK_BITS={})),function(a){a[a.NONE=0]="NONE",a[a.LOW=2]="LOW",a[a.MEDIUM=4]="MEDIUM",a[a.HIGH=8]="HIGH"}(a.MSAA_QUALITY||(a.MSAA_QUALITY={})),function(a){a[a.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",a[a.ARRAY_BUFFER=34962]="ARRAY_BUFFER",a[a.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(a.BUFFER_TYPE||(a.BUFFER_TYPE={})),eK={createCanvas:function(b,c){var a=document.createElement("canvas");return a.width=b,a.height=c,a},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var a;return null!==(a=document.baseURI)&&void 0!==a?a:window.location.href},fetch:function(a,b){return fetch(a,b)}},cY=/iPhone/i,eL=/iPod/i,eR=/iPad/i,ff=/\biOS-universal(?:.+)Mac\b/i,cT=/\bAndroid(?:.+)Mobile\b/i,fg=/Android/i,ag=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ba=/Silk/i,B=/Windows Phone/i,fi=/\bWindows(?:.+)ARM\b/i,fj=/BlackBerry/i,fm=/BB10/i,ft=/Opera Mini/i,fA=/\b(CriOS|Chrome)(?:.+)Mobile/i,fD=/Mobile(?:.+)Firefox\b/i,fL=function(a){return void 0!==a&&"MacIntel"===a.platform&&"number"==typeof a.maxTouchPoints&&a.maxTouchPoints>1&&"undefined"==typeof MSStream},s=function(c){var d={userAgent:"",platform:"",maxTouchPoints:0},e,f,a,b;return c||"undefined"==typeof navigator?"string"==typeof c?d.userAgent=c:c&&c.userAgent&&(d={userAgent:c.userAgent,platform:c.platform,maxTouchPoints:c.maxTouchPoints||0}):d={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0},e=d.userAgent,f=e.split("[FBAN"),void 0!==f[1]&&(e=f[0]),void 0!==(f=e.split("Twitter"))[1]&&(e=f[0]),a=function(a){return function(b){return b.test(a)}}(e),b={apple:{phone:a(cY)&&!a(B),ipod:a(eL),tablet:!a(cY)&&(a(eR)||fL(d))&&!a(B),universal:a(ff),device:(a(cY)||a(eL)||a(eR)||a(ff)||fL(d))&&!a(B)},amazon:{phone:a(ag),tablet:!a(ag)&&a(ba),device:a(ag)||a(ba)},android:{phone:!a(B)&&a(ag)||!a(B)&&a(cT),tablet:!a(B)&&!a(ag)&&!a(cT)&&(a(ba)||a(fg)),device:!a(B)&&(a(ag)||a(ba)||a(cT)||a(fg))||a(/\bokhttp\b/i)},windows:{phone:a(B),tablet:a(fi),device:a(B)||a(fi)},other:{blackberry:a(fj),blackberry10:a(fm),opera:a(ft),firefox:a(fD),chrome:a(fA),device:a(fj)||a(fm)||a(ft)||a(fD)||a(fA)},any:!1,phone:!1,tablet:!1},b.any=b.apple.device||b.android.device||b.windows.device||b.other.device,b.phone=b.apple.phone||b.android.phone||b.windows.phone,b.tablet=b.apple.tablet||b.android.tablet||b.windows.tablet,b}(globalThis.navigator),b={ADAPTER:eK,MIPMAP_TEXTURES:a.MIPMAP_MODES.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:a.MSAA_QUALITY.NONE,SPRITE_MAX_TEXTURES:function(c){var a,b=!0;return(s.tablet||s.phone)&&(s.apple.device&&(a=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(a[1],10)<11&&(b=!1),s.android.device&&(a=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(a[1],10)<7&&(b=!1)),b?32:4}(),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:a.GC_MODES.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:a.WRAP_MODES.CLAMP,SCALE_MODE:a.SCALE_MODES.LINEAR,PRECISION_VERTEX:a.PRECISION.HIGH,PRECISION_FRAGMENT:s.apple.device?a.PRECISION.HIGH:a.PRECISION.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!s.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},cK="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cJ(b,c,a){return b(a={path:c,exports:{},require:function(c,b){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==b&&a.path)}},a.exports),a.exports}af=cJ(function(g){var h=Object.prototype.hasOwnProperty,b="~";function c(){}function f(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function e(a,e,g,h,i){if("function"!=typeof g)throw new TypeError("The listener must be a function");var d=new f(g,h||a,i),c=b?b+e:e;return a._events[c]?a._events[c].fn?a._events[c]=[a._events[c],d]:a._events[c].push(d):(a._events[c]=d,a._eventsCount++),a}function d(a,b){0==--a._eventsCount?a._events=new c:delete a._events[b]}function a(){this._events=new c,this._eventsCount=0}Object.create&&(c.prototype=Object.create(null),(new c).__proto__||(b=!1)),a.prototype.eventNames=function(){var d,a,c=[];if(0===this._eventsCount)return c;for(a in d=this._events)h.call(d,a)&&c.push(b?a.slice(1):a);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},a.prototype.listeners=function(d){var g=b?b+d:d,a=this._events[g],c,e,f;if(!a)return[];if(a.fn)return[a.fn];for(c=0,e=a.length,f=new Array(e);c80*a){d=g=b[0],e=h=b[1];for(k=a;kg&&(g=j),i>h&&(h=i);f=0!==(f=Math.max(g-d,h-e))?32767/f:0}return aM(c,m,a,d,e,f,0),m}function fT(c,e,f,d,g){var a,b;if(g===ck(c,e,f,d)>0)for(a=e;a=e;a-=d)b=gl(a,c[a],c[a+1],b);return b&&aR(b,b.next)&&(au(b),b=b.next),b}function V(c,b){if(!c)return c;b||(b=c);var d,a=c;do if(d=!1,a.steiner||!aR(a,a.next)&&0!==j(a.prev,a,a.next))a=a.next;else{if(au(a),(a=b=a.prev)===a.next)break;d=!0}while(d||a!==b)return b}function aM(a,b,c,e,f,d,h){if(a){!h&&d&&function(b,c,d,e){var a=b;do 0===a.z&&(a.z=cs(a.x,a.y,c,d,e)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==b)a.prevZ.nextZ=null,a.prevZ=null,function(g){var i,b,a,c,d,h,e,f,j=1;do{for(b=g,g=null,d=null,h=0;b;){for(h++,a=b,e=0,i=0;i0||f>0&&a;)0!==e&&(0===f||!a||b.z<=a.z)?(c=b,b=b.nextZ,e--):(c=a,a=a.nextZ,f--),d?d.nextZ=c:g=c,c.prevZ=d,d=c;b=a}d.nextZ=null,j*=2}while(h>1)}(a)}(a,e,f,d);for(var i,g,j=a;a.prev!==a.next;)if(i=a.prev,g=a.next,d?gJ(a,e,f,d):gK(a))b.push(i.i/c|0),b.push(a.i/c|0),b.push(g.i/c|0),au(a),a=g.next,j=g.next;else if((a=g)===j){h?1===h?aM(a=gH(V(a),b,c),b,c,e,f,d,2):2===h&&gG(a,b,c,e,f,d):aM(V(a),b,c,e,f,d,1);break}}}function gK(l){var i=l.prev,k=l,h=l.next,e,f,b,g,d,c,m,n,o,p,a;if(j(i,k,h)>=0)return!1;for(e=i.x,f=k.x,b=h.x,g=i.y,d=k.y,c=h.y,m=ef?e>b?e:b:f>b?f:b,p=g>d?g>c?g:c:d>c?d:c,a=h.next;a!==i;){if(a.x>=m&&a.x<=o&&a.y>=n&&a.y<=p&&ae(e,g,f,d,b,c,a.x,a.y)&&j(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function gJ(p,u,v,r){var i=p.prev,q=p,k=p.next,e,g,d,h,f,c,l,o,n,m,s,t,a,b;if(j(i,q,k)>=0)return!1;for(e=i.x,g=q.x,d=k.x,h=i.y,f=q.y,c=k.y,l=eg?e>d?e:d:g>d?g:d,m=h>f?h>c?h:c:f>c?f:c,s=cs(l,o,u,v,r),t=cs(n,m,u,v,r),a=p.prevZ,b=p.nextZ;a&&a.z>=s&&b&&b.z<=t;){if(a.x>=l&&a.x<=n&&a.y>=o&&a.y<=m&&a!==i&&a!==k&&ae(e,h,g,f,d,c,a.x,a.y)&&j(a.prev,a,a.next)>=0)return!1;if(a=a.prevZ,b.x>=l&&b.x<=n&&b.y>=o&&b.y<=m&&b!==i&&b!==k&&ae(e,h,g,f,d,c,b.x,b.y)&&j(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;a&&a.z>=s;){if(a.x>=l&&a.x<=n&&a.y>=o&&a.y<=m&&a!==i&&a!==k&&ae(e,h,g,f,d,c,a.x,a.y)&&j(a.prev,a,a.next)>=0)return!1;a=a.prevZ}for(;b&&b.z<=t;){if(b.x>=l&&b.x<=n&&b.y>=o&&b.y<=m&&b!==i&&b!==k&&ae(e,h,g,f,d,c,b.x,b.y)&&j(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function gH(d,e,f){var a=d,c,b;do c=a.prev,b=a.next.next,!aR(c,b)&&gk(c,a,a.next,b)&&ax(c,b)&&ax(b,c)&&(e.push(c.i/f|0),e.push(a.i/f|0),e.push(b.i/f|0),au(a),au(a.next),a=d=b),a=a.next;while(a!==d)return V(a)}function gG(g,h,i,d,e,f){var a=g,b,c;do{for(b=a.next.next;b!==a.prev;){if(a.i!==b.i&&gz(a,b))return c=fU(a,b),a=V(a,a.next),c=V(c,c.next),aM(a,h,i,d,e,f,0),void aM(c,h,i,d,e,f,0);b=b.next}a=a.next}while(a!==g)}function gF(a,b){return a.x-b.x}function gE(b,c){var a=function(h,l){var b,a=l,d=h.x,c=h.y,g=-1/0,e,f,m,k,i,j;do{if(c<=a.y&&c>=a.next.y&&a.next.y!==a.y)if(e=a.x+(c-a.y)*(a.next.x-a.x)/(a.next.y-a.y),e<=d&&e>g&&(g=e,b=a.x=a.x&&a.x>=k&&d!==a.x&&ae(cb.x||a.x===b.x&&gC(b,a)))&&(b=a,j=f)),a=a.next;while(a!==m)return b}(b,c),d;return a?(d=fU(a,b),V(d,d.next),V(a,a.next)):c}function gC(a,b){return j(a.prev,a,b.prev)<0&&j(b.next,a,a.next)<0}function cs(a,b,d,e,c){return(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-d)*c|0)|a<<8))|a<<4))|a<<2))|a<<1))|(b=1431655765&((b=858993459&((b=252645135&((b=16711935&((b=(b-e)*c|0)|b<<8))|b<<4))|b<<2))|b<<1))<<1}function gA(c){var a=c,b=c;do(a.x=(g-a)*(f-b)&&(g-a)*(d-b)>=(c-a)*(h-b)&&(c-a)*(f-b)>=(e-a)*(d-b)}function gz(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function(b,c){var a=b;do{if(a.i!==b.i&&a.next.i!==b.i&&a.i!==c.i&&a.next.i!==c.i&&gk(a,a.next,b,c))return!0;a=a.next}while(a!==b)return!1}(a,b)&&(ax(a,b)&&ax(b,a)&&function(b,e){var a=b,c=!1,f=(b.x+e.x)/2,d=(b.y+e.y)/2;do a.y>d!=a.next.y>d&&a.next.y!==a.y&&f<(a.next.x-a.x)*(d-a.y)/(a.next.y-a.y)+a.x&&(c=!c),a=a.next;while(a!==b)return c}(a,b)&&(j(a.prev,a,b.prev)||j(a,b.prev,b))||aR(a,b)&&j(a.prev,a,a.next)>0&&j(b.prev,b,b.next)>0)}function j(b,a,c){return(a.y-b.y)*(c.x-a.x)-(a.x-b.x)*(c.y-a.y)}function aR(a,b){return a.x===b.x&&a.y===b.y}function gk(a,b,c,d){var e=bx(j(a,b,c)),f=bx(j(a,b,d)),g=bx(j(c,d,a)),h=bx(j(c,d,b));return e!==f&&g!==h||!(0!==e||!bq(a,c,b))||!(0!==f||!bq(a,d,b))||!(0!==g||!bq(c,a,d))||!(0!==h||!bq(c,b,d))}function bq(a,b,c){return b.x<=Math.max(a.x,c.x)&&b.x>=Math.min(a.x,c.x)&&b.y<=Math.max(a.y,c.y)&&b.y>=Math.min(a.y,c.y)}function bx(a){return a>0?1:a<0?-1:0}function ax(a,b){return j(a.prev,a,a.next)<0?j(a,b,a.next)>=0&&j(a,a.prev,b)>=0:j(a,b,a.prev)<0||j(a,a.next,b)<0}function fU(a,b){var d=new cl(a.i,a.x,a.y),c=new cl(b.i,b.x,b.y),e=a.next,f=b.prev;return a.next=b,b.prev=a,d.next=e,e.prev=d,c.next=d,d.prev=c,f.next=c,c.prev=f,c}function gl(c,d,e,b){var a=new cl(c,d,e);return b?(a.next=b.next,a.prev=b,b.next.prev=a,b.next=a):(a.prev=a,a.next=a),a}function au(a){a.next.prev=a.prev,a.prev.next=a.next,a.prevZ&&(a.prevZ.nextZ=a.nextZ),a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function cl(a,b,c){this.i=a,this.x=b,this.y=c,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ck(b,g,d,e){for(var f=0,a=g,c=d-e;a0&&(g+=b[a-1].length,c.holes.push(g))}return c},aT.default=hb,gt=cJ(function(a,b){!function(n){var k=b&&!b.nodeType&&b,q=a&&!a.nodeType&&a,f="object"==typeof cK&&cK,g,j,h,d,x,w,v,y,c,i;f.global!==f&&f.window!==f&&f.self!==f||(n=f),h=2147483647,d=36,x=/^xn--/,w=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,i=String.fromCharCode;function e(a){throw RangeError(y[a])}function r(b,d){for(var a=b.length,c=[];a--;)c[a]=d(b[a]);return c}function s(a,d){var b=a.split("@"),c="";return b.length>1&&(c=b[0]+"@",a=b[1]),c+r((a=a.replace(v,".")).split("."),d).join(".")}function t(d){for(var a,e,c=[],b=0,f=d.length;b=55296&&a<=56319&&b65535&&(b+=i((a-=65536)>>>10&1023|55296),a=56320|1023&a),b+=i(a)}).join("")}function m(a,b){return a+22+75*(a<26)-((0!=b)<<5)}function o(a,e,f){var b=0;for(a=f?c(a/700):a>>1,a+=c(a/e);a>455;b+=d)a=c(a/35);return c(b+36*a/(a+38))}function p(k){var m,g,i,l,r,j,f,p,v,t,b,n=[],w=k.length,a=0,s=128,q=72;for((g=k.lastIndexOf("-"))<0&&(g=0),i=0;i=128&&e("not-basic"),n.push(k.charCodeAt(i));for(l=g>0?g+1:0;l=w&&e("invalid-input"),((p=(b=k.charCodeAt(l++))-48<10?b-22:b-65<26?b-65:b-97<26?b-97:d)>=d||p>c((h-a)/j))&&e("overflow"),a+=p*j,!(p<(v=f<=q?1:f>=q+26?26:f-q));f+=d)j>c(h/(t=d-v))&&e("overflow"),j*=t;q=o(a-r,m=n.length+1,0==r),c(a/m)>h-s&&e("overflow"),s+=c(a/m),a%=m,n.splice(a++,0,s)}return u(n)}function l(s){var b,f,l,v,p,a,j,r,q,u,g,n,w,x,y,k=[];for(n=(s=t(s)).length,b=128,f=0,p=72,a=0;a=b&&gc((h-f)/(w=l+1))&&e("overflow"),f+=(j-b)*w,b=j,a=0;ah&&e("overflow"),g==b){for(r=f,q=d;!(r<(u=q<=p?1:q>=p+26?26:q-p));q+=d)y=r-u,x=d-u,k.push(i(m(u+y%x,0))),r=c(y/x);k.push(i(m(r,0))),p=o(f,w,l==v),f=0,++l}++f,++b}return k.join("")}if(g={version:"1.3.2",ucs2:{decode:t,encode:u},decode:p,encode:l,toASCII:function(a){return s(a,function(a){return w.test(a)?"xn--"+l(a):a})},toUnicode:function(a){return s(a,function(a){return x.test(a)?p(a.slice(4).toLowerCase()):a})}},k&&q)if(a.exports==k)q.exports=g;else for(j in g)g.hasOwnProperty(j)&&(k[j]=g[j]);else n.punycode=g}(cK)}),cj=function(a){return"string"==typeof a},gm=function(a){return"object"==typeof a&&null!==a},bz=function(a){return null===a},gp=function(a){return null==a};function gq(a,b){return Object.prototype.hasOwnProperty.call(a,b)}gs=function(c,n,m,l){var a,o,d,j,i,h,g,b,e,f,k;if(n=n||"&",m=m||"=",a={},"string"!=typeof c||0===c.length)return a;o=/\+/g,c=c.split(n),d=1e3,l&&"number"==typeof l.maxKeys&&(d=l.maxKeys),j=c.length,d>0&&j>d&&(j=d);for(i=0;i=0?(h=f.substr(0,k),g=f.substr(k+1)):(h=f,g=""),b=decodeURIComponent(h),e=decodeURIComponent(g),gq(a,b)?Array.isArray(a[b])?a[b].push(e):a[b]=[a[b],e]:a[b]=e;return a},az=function(a){switch(typeof a){case"string":return a;case"boolean":return a?"true":"false";case"number":return isFinite(a)?a:"";default:return""}},gv=function(a,b,c,d){return b=b||"&",c=c||"=",null===a&&(a=void 0),"object"==typeof a?Object.keys(a).map(function(d){var e=encodeURIComponent(az(d))+c;return Array.isArray(a[d])?a[d].map(function(a){return e+encodeURIComponent(az(a))}).join(b):e+encodeURIComponent(az(a[d]))}).join(b):d?encodeURIComponent(az(d))+c+encodeURIComponent(az(a)):""},ce=cJ(function(b,a){a.decode=a.parse=gs,a.encode=a.stringify=gv}),gy=aS,gD=function(a,b){return aS(a,!1,!0).resolve(b)},gL=function(a){return cj(a)&&(a=aS(a)),!(a instanceof t)?t.prototype.format.call(a):a.format()};function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}gT=/^([a-z0-9.+-]+:)/i,gU=/:[0-9]*$/,gX=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gZ=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]),cb=["'"].concat(gZ),fZ=["%","/","?",";","#"].concat(cb),fY=["/","?","#"],fW=/^[+a-z0-9A-Z_-]{0,63}$/,g_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g$={javascript:!0,"javascript:":!0},bW={javascript:!0,"javascript:":!0},ad={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function aS(a,c,d){if(a&&gm(a)&&a instanceof t)return a;var b=new t;return b.parse(a,c,d),b}t.prototype.parse=function(g,v,F){var C,B,q,a,j,d,p,A,z,n,c,b,f,x,l,s,e,u,i,D,y,m,w,o,E,h,r,t,k,G;if(!cj(g))throw new TypeError("Parameter 'url' must be a string, not "+typeof g);if(C=g.indexOf("?"),B=-1!==C&&C127?u+="x":u+=e[i];if(!u.match(fW)){y=l.slice(0,b),m=l.slice(b+1),w=e.match(g_),w&&(y.push(w[1]),m.unshift(w[2])),m.length&&(a="/"+m.join(".")+a),this.hostname=y.join(".");break}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=gt.toASCII(this.hostname)),o=this.port?":"+this.port:"",E=this.hostname||"",this.host=E+o,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!g$[p])for(b=0,s=cb.length;b0)&&a.host.split("@"))&&(a.auth=f.shift(),a.host=a.hostname=f.shift())),a.search=b.search,a.query=b.query,bz(a.pathname)&&bz(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a;if(!c.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(h=c.slice(-1)[0],x=(a.host||b.host||c.length>1)&&("."===h||".."===h)||""===h,i=0,g=c.length;g>=0;g--)"."===(h=c[g])?c.splice(g,1):".."===h?(c.splice(g,1),i++):i&&(c.splice(g,1),i--);if(!e&&!y)for(;i--;i)c.unshift("..");return!e||""===c[0]||c[0]&&"/"===c[0].charAt(0)||c.unshift(""),x&&"/"!==c.join("/").substr(-1)&&c.push(""),w=""===c[0]||c[0]&&"/"===c[0].charAt(0),n&&(a.hostname=a.host=w?"":c.length?c.shift():"",(f=!!(a.host&&a.host.indexOf("@")>0)&&a.host.split("@"))&&(a.auth=f.shift(),a.host=a.hostname=f.shift())),(e=e||a.host&&c.length)&&!w&&c.unshift(""),c.length?a.pathname=c.join("/"):(a.pathname=null,a.path=null),bz(a.pathname)&&bz(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=b.auth||a.auth,a.slashes=a.slashes||b.slashes,a.href=a.format(),a},t.prototype.parseHost=function(){var a=this.host,b=gU.exec(a);b&&(":"!==(b=b[0])&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)},L={parse:gy,format:gL,resolve:gD};function v(a){if("string"!=typeof a)throw new TypeError("Path must be a string. Received "+JSON.stringify(a))}function fO(a){return a.split("?")[0].split("#")[0]}fH={toPosix:function(a){return"\\","/",a.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/")},isUrl:function(a){return/^https?:/.test(this.toPosix(a))},isDataUrl:function(a){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(a)},hasProtocol:function(a){return/^[^/:]+:\//.test(this.toPosix(a))},getProtocol:function(a){var e,b,c,d,f;return v(a),a=this.toPosix(a),e="",b=/^file:\/\/\//.exec(a),c=/^[^/:]+:\/\//.exec(a),d=/^[^/:]+:\//.exec(a),(b||c||d)&&(f=(null==b?void 0:b[0])||(null==c?void 0:c[0])||(null==d?void 0:d[0]),e=f,a=a.slice(f.length)),e},toAbsolute:function(a,c,d){if(this.isDataUrl(a))return a;var e=fO(this.toPosix(null!=c?c:b.ADAPTER.getBaseUrl())),f=fO(this.toPosix(null!=d?d:this.rootname(e)));return v(a),(a=this.toPosix(a)).startsWith("/")?fH.join(f,a.slice(1)):this.isAbsolute(a)?a:this.join(e,a)},normalize:function(a){var b,c,d;return v(a=this.toPosix(a)),0===a.length?".":(b="",c=a.startsWith("/"),this.hasProtocol(a)&&(b=this.rootname(a),a=a.slice(b.length)),d=a.endsWith("/"),(a=function(g,i){for(var e,a="",f=0,d=-1,c=0,b=0,h;b<=g.length;++b){if(b2){if(h=a.lastIndexOf("/"),h!==a.length-1){-1===h?(a="",f=0):f=(a=a.slice(0,h)).length-1-a.lastIndexOf("/"),d=b,c=0;continue}}else if(2===a.length||1===a.length){a="",f=0,d=b,c=0;continue}}else a.length>0?a+="/"+g.slice(d+1,b):a=g.slice(d+1,b),f=b-d-1;d=b,c=0}else 46===e&&-1!==c?++c:c=-1}return a}(a)).length>0&&d&&(a+="/"),c?"/"+a:b+a)},isAbsolute:function(a){return v(a),a=this.toPosix(a),!!this.hasProtocol(a)||a.startsWith("/")},join:function(){for(var f,a,g=arguments,c=[],d=0,e,b,h;d0)&&(void 0===a?a=b:(h=null!==(f=c[e-1])&&void 0!==f?f:"",this.extname(h)?a+="/../"+b:a+="/"+b));return void 0===a?".":this.normalize(a)},dirname:function(a){if(v(a),0===a.length)return".";for(var g=(a=this.toPosix(a)).charCodeAt(0),e=47===g,c=-1,f=!0,d=this.getProtocol(a),h=a,b=(a=a.slice(d.length)).length-1;b>=1;--b)if(47===(g=a.charCodeAt(b))){if(!f){c=b;break}}else f=!1;return-1===c?e?"/":this.isUrl(h)?d+a:d:e&&1===c?"//":d+a.slice(0,c)},rootname:function(a){var b,c;return v(a),b="",(b=(a=this.toPosix(a)).startsWith("/")?"/":this.getProtocol(a),this.isUrl(a))&&(c=a.indexOf("/",b.length),(b=-1!==c?a.slice(0,c):a).endsWith("/")||(b+="/")),b},basename:function(b,d){var a,e,c,f,g,h,i;if(v(b),d&&v(d),b=this.toPosix(b),e=0,c=-1,f=!0,void 0!==d&&d.length>0&&d.length<=b.length){if(d.length===b.length&&d===b)return"";g=d.length-1,h=-1;for(a=b.length-1;a>=0;--a)if(i=b.charCodeAt(a),47===i){if(!f){e=a+1;break}}else-1===h&&(f=!1,h=a+1),g>=0&&(i===d.charCodeAt(g)?-1==--g&&(c=a):(g=-1,c=h));return e===c?c=h:-1===c&&(c=b.length),b.slice(e,c)}for(a=b.length-1;a>=0;--a)if(47===b.charCodeAt(a)){if(!f){e=a+1;break}}else-1===c&&(f=!1,c=a+1);return-1===c?"":b.slice(e,c)},extname:function(e){var a,f,c,g,d,b,h;v(e);for(a=-1,f=0,c=-1,g=!0,d=0,b=(e=this.toPosix(e)).length-1;b>=0;--b)if(h=e.charCodeAt(b),47!==h)-1===c&&(g=!1,c=b+1),46===h?-1===a?a=b:1!==d&&(d=1):-1!==a&&(d=-1);else if(!g){f=b+1;break}return-1===a||-1===c||0===d||1===d&&a===c-1&&a===f+1?"":e.slice(a,c)},parse:function(a){var b,i,k,h,d,e,c,j,f,g;if(v(a),b={root:"",dir:"",base:"",ext:"",name:""},0===a.length)return b;k=(a=this.toPosix(a)).charCodeAt(0),h=this.isAbsolute(a),b.root=this.rootname(a),i=h||this.hasProtocol(a)?1:0;for(d=-1,e=0,c=-1,j=!0,f=a.length-1,g=0;f>=i;--f)if(47!==(k=a.charCodeAt(f)))-1===c&&(j=!1,c=f+1),46===k?-1===d?d=f:1!==g&&(g=1):-1!==d&&(g=-1);else if(!j){e=f+1;break}return-1===d||-1===c||0===g||1===g&&d===c-1&&d===e+1?-1!==c&&(b.base=b.name=0===e&&h?a.slice(1,c):a.slice(e,c)):(0===e&&h?(b.name=a.slice(1,d),b.base=a.slice(1,c)):(b.name=a.slice(e,d),b.base=a.slice(e,c)),b.ext=a.slice(d,c)),b.dir=this.dirname(a),b},sep:"/",delimiter:":"},b.RETINA_PREFIX=/@([0-9\.]+)x/,b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1,bQ=!1;function fC(a){var c,d;bQ||(b.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1?(d=["\n %c %c %c PixiJS 6.5.8 - ✰ "+a+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"],(c=globalThis.console).log.apply(c,d)):globalThis.console&&globalThis.console.log("PixiJS 6.5.8 - "+a+" - http://www.pixijs.com/"),bQ=!0)}function fB(){return void 0===bR&&(bR=function(){var c={stencil:!0,failIfMajorPerformanceCaveat:b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT},d,a,f,e;try{return!!b.ADAPTER.getWebGLRenderingContext()&&(d=b.ADAPTER.createCanvas(),a=d.getContext("webgl",c)||d.getContext("experimental-webgl",c),f=!(!a||!a.getContextAttributes().stencil),a&&(e=a.getExtension("WEBGL_lose_context"),e&&e.loseContext()),a=null,f)}catch(a){return!1}}()),bR}hh={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function T(b,a){return void 0===a&&(a=[]),a[0]=(b>>16&255)/255,a[1]=(b>>8&255)/255,a[2]=(255&b)/255,a}function bP(b){var a=b.toString(16);return"#"+("000000".substring(0,6-a.length)+a)}function bO(a){return"string"==typeof a&&"#"===(a=hh[a.toLowerCase()]||a)[0]&&(a=a.slice(1)),parseInt(a,16)}bN=function(){for(var c=[],d=[],b=0,e;b<32;b++)c[b]=b,d[b]=b;return c[a.BLEND_MODES.NORMAL_NPM]=a.BLEND_MODES.NORMAL,c[a.BLEND_MODES.ADD_NPM]=a.BLEND_MODES.ADD,c[a.BLEND_MODES.SCREEN_NPM]=a.BLEND_MODES.SCREEN,d[a.BLEND_MODES.NORMAL]=a.BLEND_MODES.NORMAL_NPM,d[a.BLEND_MODES.ADD]=a.BLEND_MODES.ADD_NPM,d[a.BLEND_MODES.SCREEN]=a.BLEND_MODES.SCREEN_NPM,e=[],e.push(d),e.push(c),e}();function bM(a,b){return bN[b?1:0][a]}function fz(b,c,a,d){return a=a||new Float32Array(4),d||void 0===d?(a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c):(a[0]=b[0],a[1]=b[1],a[2]=b[2]),a[3]=c,a}function bg(b,a){if(1===a)return(255*a<<24)+b;if(0===a)return 0;var c=b>>16&255,d=b>>8&255,e=255&b;return(255*a<<24)+((c=c*a+.5|0)<<16)+((d=d*a+.5|0)<<8)+(e*a+.5|0)}function bK(c,b,a,d){return(a=a||new Float32Array(4))[0]=(c>>16&255)/255,a[1]=(c>>8&255)/255,a[2]=(255&c)/255,(d||void 0===d)&&(a[0]*=b,a[1]*=b,a[2]*=b),a[3]=b,a}function fy(e,a){var d,b,c;if(void 0===a&&(a=null),d=6*e,(a=a||new Uint16Array(d)).length!==d)throw new Error("Out buffer length is incorrect, got "+a.length+" and expected "+d);for(b=0,c=0;b>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,1+(a|=a>>>16)}function bI(a){return!(a&a-1||!a)}function bH(b){var c=(b>65535?1:0)<<4,a=((b>>>=c)>255?1:0)<<3;return c|=a,c|=a=((b>>>=a)>15?1:0)<<2,(c|=a=((b>>>=a)>3?1:0)<<1)|(b>>>=a)>>1}function _(c,d,a){var b,e=c.length,f;if(!(d>=e||0===a)){f=e-(a=d+a>e?e-d:a);for(b=d;b=this.x&&a=this.y&&b=j||Math.max(a.y,e.y,d.y,c.y)<=i||Math.min(a.y,e.y,d.y,c.y)>=h)&&(!(n=o*(e.y-a.y),g=o*(a.x-e.x),p=n*k+g*i,q=n*j+g*i,r=n*k+g*h,s=n*j+g*h,Math.max(p,q,r,s)<=n*a.x+g*a.y||Math.min(p,q,r,s)>=n*c.x+g*c.y)&&(l=o*(a.y-d.y),m=o*(d.x-a.x),t=l*k+m*i,u=l*j+m*i,v=l*k+m*h,w=l*j+m*h,!(Math.max(t,u,v,w)<=l*a.x+m*a.y||Math.min(t,u,v,w)>=l*c.x+m*c.y)))))):!(y=this.xb.right?b.right:this.right)<=y)&&(x=this.yb.bottom?b.bottom:this.bottom)>x)},b.prototype.pad=function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},b.prototype.fit=function(a){var b=Math.max(this.x,a.x),d=Math.min(this.x+this.width,a.x+a.width),c=Math.max(this.y,a.y),e=Math.min(this.y+this.height,a.y+a.height);return this.x=b,this.width=Math.max(d-b,0),this.y=c,this.height=Math.max(e-c,0),this},b.prototype.ceil=function(a,b){void 0===a&&(a=1),void 0===b&&(b=.001);var c=Math.ceil((this.x+this.width-b)*a)/a,d=Math.ceil((this.y+this.height-b)*a)/a;return this.x=Math.floor((this.x+b)*a)/a,this.y=Math.floor((this.y+b)*a)/a,this.width=c-this.x,this.height=d-this.y,this},b.prototype.enlarge=function(a){var b=Math.min(this.x,a.x),d=Math.max(this.x+this.width,a.x+a.width),c=Math.min(this.y,a.y),e=Math.max(this.y+this.height,a.y+a.height);return this.x=b,this.width=d-b,this.y=c,this.height=e-c,this},b}(),fd=function(){function b(b,c,d){void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=b,this.y=c,this.radius=d,this.type=a.SHAPES.CIRC}return b.prototype.clone=function(){return new b(this.x,this.y,this.radius)},b.prototype.contains=function(c,d){if(this.radius<=0)return!1;var e=this.radius*this.radius,a=this.x-c,b=this.y-d;return(a*=a)+(b*=b)<=e},b.prototype.getBounds=function(){return new d(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},b}(),fa=function(){function b(b,c,d,e){void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===e&&(e=0),this.x=b,this.y=c,this.width=d,this.height=e,this.type=a.SHAPES.ELIP}return b.prototype.clone=function(){return new b(this.x,this.y,this.width,this.height)},b.prototype.contains=function(c,d){if(this.width<=0||this.height<=0)return!1;var a=(c-this.x)/this.width,b=(d-this.y)/this.height;return(a*=a)+(b*=b)<=1},b.prototype.getBounds=function(){return new d(this.x-this.width,this.y-this.height,this.width,this.height)},b}(),aG=function(){function b(){for(var g=arguments,c=[],d=0,b,f,e,h;db!=h>b&&i<(b-e)/(h-e)*(j-f)+f&&(c=!c);return c},b}(),e_=function(){function b(b,c,d,e,f){void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===e&&(e=0),void 0===f&&(f=20),this.x=b,this.y=c,this.width=d,this.height=e,this.radius=f,this.type=a.SHAPES.RREC}return b.prototype.clone=function(){return new b(this.x,this.y,this.width,this.height,this.radius)},b.prototype.contains=function(d,e){var a,b,c,f;if(this.width<=0||this.height<=0)return!1;if(d>=this.x&&d<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(a=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2)),e>=this.y+a&&e<=this.y+this.height-a||d>=this.x+a&&d<=this.x+this.width-a)return!0;if(b=d-(this.x+a),c=e-(this.y+a),f=a*a,b*b+c*c<=f)return!0;if((b=d-(this.x+this.width-a))*b+c*c<=f)return!0;if(b*b+(c=e-(this.y+this.height-a))*c<=f)return!0;if((b=d-(this.x+a))*b+c*c<=f)return!0}return!1},b}(),P=function(){function a(c,d,a,b){void 0===a&&(a=0),void 0===b&&(b=0),this._x=a,this._y=b,this.cb=c,this.scope=d}return a.prototype.clone=function(b,c){return void 0===b&&(b=this.cb),void 0===c&&(c=this.scope),new a(b,c,this._x,this._y)},a.prototype.set=function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this._x===a&&this._y===b||(this._x=a,this._y=b,this.cb.call(this.scope)),this},a.prototype.copyFrom=function(a){return this._x===a.x&&this._y===a.y||(this._x=a.x,this._y=a.y,this.cb.call(this.scope)),this},a.prototype.copyTo=function(a){return a.set(this._x,this._y),a},a.prototype.equals=function(a){return a.x===this._x&&a.y===this._y},Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(a){this._x!==a&&(this._x=a,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"y",{get:function(){return this._y},set:function(a){this._y!==a&&(this._y=a,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),a}(),m=function(){function a(a,b,c,d,e,f){void 0===a&&(a=1),void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=1),void 0===e&&(e=0),void 0===f&&(f=0),this.array=null,this.a=a,this.b=b,this.c=c,this.d=d,this.tx=e,this.ty=f}return a.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},a.prototype.set=function(a,b,c,d,e,f){return this.a=a,this.b=b,this.c=c,this.d=d,this.tx=e,this.ty=f,this},a.prototype.toArray=function(b,c){this.array||(this.array=new Float32Array(9));var a=c||this.array;return b?(a[0]=this.a,a[1]=this.b,a[2]=0,a[3]=this.c,a[4]=this.d,a[5]=0,a[6]=this.tx,a[7]=this.ty,a[8]=1):(a[0]=this.a,a[1]=this.c,a[2]=this.tx,a[3]=this.b,a[4]=this.d,a[5]=this.ty,a[6]=0,a[7]=0,a[8]=1),a},a.prototype.apply=function(b,a){a=a||new g;var c=b.x,d=b.y;return a.x=this.a*c+this.c*d+this.tx,a.y=this.b*c+this.d*d+this.ty,a},a.prototype.applyInverse=function(c,b){b=b||new g;var a=1/(this.a*this.d+this.c*-this.b),d=c.x,e=c.y;return b.x=this.d*a*d+-this.c*a*e+(this.ty*this.c-this.tx*this.d)*a,b.y=this.a*a*e+-this.b*a*d+(-this.ty*this.a+this.tx*this.b)*a,b},a.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},a.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},a.prototype.rotate=function(c){var a=Math.cos(c),b=Math.sin(c),d=this.a,e=this.c,f=this.tx;return this.a=d*a-this.b*b,this.b=d*b+this.b*a,this.c=e*a-this.d*b,this.d=e*b+this.d*a,this.tx=f*a-this.ty*b,this.ty=f*b+this.ty*a,this},a.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},a.prototype.setTransform=function(h,i,c,d,e,f,a,b,g){return this.a=Math.cos(a+g)*e,this.b=Math.sin(a+g)*e,this.c=-Math.sin(a-b)*f,this.d=Math.cos(a-b)*f,this.tx=h-(c*this.a+d*this.c),this.ty=i-(c*this.b+d*this.d),this},a.prototype.prepend=function(a){var b=this.tx,c,d;return(1!==a.a||0!==a.b||0!==a.c||1!==a.d)&&(c=this.a,d=this.c,this.a=c*a.a+this.b*a.c,this.b=c*a.b+this.b*a.d,this.c=d*a.a+this.d*a.c,this.d=d*a.b+this.d*a.d),this.tx=b*a.a+this.ty*a.c+a.tx,this.ty=b*a.b+this.ty*a.d+a.ty,this},a.prototype.decompose=function(a){var b=this.a,c=this.b,d=this.c,e=this.d,f=a.pivot,h=-Math.atan2(-d,e),g=Math.atan2(c,b),i=Math.abs(h+g);return i<1e-5||Math.abs(aA-i)<1e-5?(a.rotation=g,a.skew.x=a.skew.y=0):(a.rotation=0,a.skew.x=h,a.skew.y=g),a.scale.x=Math.sqrt(b*b+c*c),a.scale.y=Math.sqrt(d*d+e*e),a.position.x=this.tx+(f.x*b+f.y*d),a.position.y=this.ty+(f.x*c+f.y*e),a},a.prototype.invert=function(){var b=this.a,c=this.b,d=this.c,e=this.d,f=this.tx,a=b*e-c*d;return this.a=e/a,this.b=-c/a,this.c=-d/a,this.d=b/a,this.tx=(d*this.ty-e*f)/a,this.ty=-(b*this.ty-c*f)/a,this},a.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},a.prototype.clone=function(){var b=new a;return b.a=this.a,b.b=this.b,b.c=this.c,b.d=this.d,b.tx=this.tx,b.ty=this.ty,b},a.prototype.copyTo=function(a){return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,a},a.prototype.copyFrom=function(a){return this.a=a.a,this.b=a.b,this.c=a.c,this.d=a.d,this.tx=a.tx,this.ty=a.ty,this},Object.defineProperty(a,"IDENTITY",{get:function(){return new a},enumerable:!1,configurable:!0}),Object.defineProperty(a,"TEMP_MATRIX",{get:function(){return new a},enumerable:!1,configurable:!0}),a}(),M=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],N=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],W=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],R=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],bT=[],eZ=[],aV=Math.sign,!function(){for(var a=0,d,b,f,g,h,i,c,e;a<16;a++){d=[],bT.push(d);for(b=0;b<16;b++)for(f=aV(M[a]*M[b]+W[a]*N[b]),g=aV(N[a]*M[b]+R[a]*N[b]),h=aV(M[a]*W[b]+W[a]*R[b]),i=aV(N[a]*W[b]+R[a]*R[b]),c=0;c<16;c++)if(M[c]===f&&N[c]===g&&W[c]===h&&R[c]===i){d.push(c);break}}for(a=0;a<16;a++)e=new m,e.set(M[a],N[a],W[a],R[a],0,0),eZ.push(e)}(),i={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:function(a){return M[a]},uY:function(a){return N[a]},vX:function(a){return W[a]},vY:function(a){return R[a]},inv:function(a){return 8&a?15&a:7&-a},add:function(a,b){return bT[a][b]},sub:function(a,b){return bT[a][i.inv(b)]},rotate180:function(a){return 4^a},isVertical:function(a){return 2==(3&a)},byDirection:function(a,b){return 2*Math.abs(a)<=Math.abs(b)?b>=0?i.S:i.N:2*Math.abs(b)<=Math.abs(a)?a>0?i.E:i.W:b>0?a>0?i.SE:i.SW:a>0?i.NE:i.NW},matrixAppendRotationInv:function(d,e,a,b){void 0===a&&(a=0),void 0===b&&(b=0);var c=eZ[i.inv(e)];c.tx=a,c.ty=b,d.append(c)}},bX=function(){function a(){this.worldTransform=new m,this.localTransform=new m,this.position=new P(this.onChange,this,0,0),this.scale=new P(this.onChange,this,1,1),this.pivot=new P(this.onChange,this,0,0),this.skew=new P(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}return a.prototype.onChange=function(){this._localID++},a.prototype.updateSkew=function(){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++},a.prototype.updateLocalTransform=function(){var a=this.localTransform;this._localID!==this._currentLocalID&&(a.a=this._cx*this.scale.x,a.b=this._sx*this.scale.x,a.c=this._cy*this.scale.y,a.d=this._sy*this.scale.y,a.tx=this.position.x-(this.pivot.x*a.a+this.pivot.y*a.c),a.ty=this.position.y-(this.pivot.x*a.b+this.pivot.y*a.d),this._currentLocalID=this._localID,this._parentID=-1)},a.prototype.updateTransform=function(d){var a=this.localTransform,b,c;this._localID!==this._currentLocalID&&(a.a=this._cx*this.scale.x,a.b=this._sx*this.scale.x,a.c=this._cy*this.scale.y,a.d=this._sy*this.scale.y,a.tx=this.position.x-(this.pivot.x*a.a+this.pivot.y*a.c),a.ty=this.position.y-(this.pivot.x*a.b+this.pivot.y*a.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==d._worldID&&(b=d.worldTransform,c=this.worldTransform,c.a=a.a*b.a+a.b*b.c,c.b=a.a*b.b+a.b*b.d,c.c=a.c*b.a+a.d*b.c,c.d=a.c*b.b+a.d*b.d,c.tx=a.tx*b.a+a.ty*b.c+b.tx,c.ty=a.tx*b.b+a.ty*b.d+b.ty,this._parentID=d._worldID,this._worldID++)},a.prototype.setFromMatrix=function(a){a.decompose(this),this._localID++},Object.defineProperty(a.prototype,"rotation",{get:function(){return this._rotation},set:function(a){this._rotation!==a&&(this._rotation=a,this.updateSkew())},enumerable:!1,configurable:!0}),a.IDENTITY=new a,a}(),b.SORTABLE_CHILDREN=!1,aO=function(){function a(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return a.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},a.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},a.prototype.getRectangle=function(a){return this.minX>this.maxX||this.minY>this.maxY?d.EMPTY:((a=a||new d(0,0,1,1)).x=this.minX,a.y=this.minY,a.width=this.maxX-this.minX,a.height=this.maxY-this.minY,a)},a.prototype.addPoint=function(a){this.minX=Math.min(this.minX,a.x),this.maxX=Math.max(this.maxX,a.x),this.minY=Math.min(this.minY,a.y),this.maxY=Math.max(this.maxY,a.y)},a.prototype.addPointMatrix=function(a,b){var i=a.a,j=a.b,e=a.c,f=a.d,g=a.tx,h=a.ty,c=i*b.x+e*b.y+g,d=j*b.x+f*b.y+h;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,d),this.maxY=Math.max(this.maxY,d)},a.prototype.addQuad=function(g){var c=this.minX,d=this.minY,e=this.maxX,f=this.maxY,b=g[0],a=g[1];c=be?b:e,f=a>f?a:f,c=(b=g[2])e?b:e,f=a>f?a:f,c=(b=g[4])e?b:e,f=a>f?a:f,c=(b=g[6])e?b:e,f=a>f?a:f,this.minX=c,this.minY=d,this.maxX=e,this.maxY=f},a.prototype.addFrame=function(a,b,c,d,e){this.addFrameMatrix(a.worldTransform,b,c,d,e)},a.prototype.addFrameMatrix=function(g,p,o,n,m){var l=g.a,i=g.b,h=g.c,q=g.d,j=g.tx,k=g.ty,f=this.minX,e=this.minY,d=this.maxX,c=this.maxY,b=l*p+h*o+j,a=i*p+q*o+k;f=bd?b:d,c=a>c?a:c,f=(b=l*n+h*o+j)d?b:d,c=a>c?a:c,f=(b=l*p+h*m+j)d?b:d,c=a>c?a:c,f=(b=l*n+h*m+j)d?b:d,c=a>c?a:c,this.minX=f,this.minY=e,this.maxX=d,this.maxY=c},a.prototype.addVertexData=function(h,i,j){for(var d=this.minX,e=this.minY,f=this.maxX,a=this.maxY,b=i,c,g;bf?c:f,a=g>a?g:a;this.minX=d,this.minY=e,this.maxX=f,this.maxY=a},a.prototype.addVertices=function(a,b,c,d){this.addVerticesMatrix(a.worldTransform,b,c,d)},a.prototype.addVerticesMatrix=function(a,r,u,t,c,g){var q,p,o,n,s,m,h,f,e,d,b,k,j,i,l;void 0===c&&(c=0),void 0===g&&(g=c);for(q=a.a,p=a.b,o=a.c,n=a.d,s=a.tx,m=a.ty,h=this.minX,f=this.minY,e=this.maxX,d=this.maxY,b=u;bd?a.maxX:d,this.maxY=a.maxY>e?a.maxY:e},a.prototype.addBoundsMask=function(a,b){var c=a.minX>b.minX?a.minX:b.minX,d=a.minY>b.minY?a.minY:b.minY,e=a.maxXi?e:i,this.maxY=f>j?f:j)},a.prototype.addBoundsMatrix=function(a,b){this.addFrameMatrix(b,a.minX,a.minY,a.maxX,a.maxY)},a.prototype.addBoundsArea=function(b,a){var c=b.minX>a.x?b.minX:a.x,d=b.minY>a.y?b.minY:a.y,e=b.maxXi?e:i,this.maxY=f>j?f:j)},a.prototype.pad=function(a,b){void 0===a&&(a=0),void 0===b&&(b=a),this.isEmpty()||(this.minX-=a,this.maxX+=a,this.minY-=b,this.maxY+=b)},a.prototype.addFramePad=function(a,b,c,d,e,f){a-=e,b-=f,c+=e,d+=f,this.minX=this.minXc?this.maxX:c,this.minY=this.minYd?this.maxY:d},a}(),bZ=function(a,b){return bZ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},bZ(a,b)};function b_(b,a){function c(){this.constructor=b}bZ(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}k=function(b){function a(){var a=b.call(this)||this;return a.tempDisplayObjectParent=null,a.transform=new bX,a.alpha=1,a.visible=!0,a.renderable=!0,a.cullable=!1,a.cullArea=null,a.parent=null,a.worldAlpha=1,a._lastSortedIndex=0,a._zIndex=0,a.filterArea=null,a.filters=null,a._enabledFilters=null,a._bounds=new aO,a._localBounds=null,a._boundsID=0,a._boundsRect=null,a._localBoundsRect=null,a._mask=null,a._maskRefCount=0,a._destroyed=!1,a.isSprite=!1,a.isMask=!1,a}return b_(a,b),a.mixin=function(c){for(var d=Object.keys(c),b=0,e;b1)for(d=0;dthis.children.length)throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length);return a.parent&&a.parent.removeChild(a),a.parent=this,this.sortDirty=!0,a.transform._parentID=-1,this.children.splice(b,0,a),this._boundsID++,this.onChildrenChange(b),a.emit("added",this),this.emit("childAdded",a,this,b),a},c.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);this.children[c]=b,this.children[d]=a,this.onChildrenChange(c=this.children.length)throw new Error("The index "+a+" supplied is out of bounds "+this.children.length);var c=this.getChildIndex(b);_(this.children,c,1),this.children.splice(a,0,b),this.onChildrenChange(a)},c.prototype.getChildAt=function(a){if(a<0||a>=this.children.length)throw new Error("getChildAt: Index ("+a+") does not exist.");return this.children[a]},c.prototype.removeChild=function(){for(var f=arguments,a=[],c=0,e,b,d;c1)for(e=0;e0&&c<=e){b=this.children.splice(f,c);for(a=0;a1&&this.children.sort(hq),this.sortDirty=!1},c.prototype.updateTransform=function(){var a,c,b;this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(a=0,c=this.children.length;a0&&d.height>0){if(this.cullArea?(b=this.cullArea,g=this.worldTransform):this._render!==c.prototype._render&&(b=this.getBounds(!0)),b&&d.intersects(b,g))this._render(f);else if(this.cullArea)return;for(e=0,i=this.children.length;e8)throw new Error("max arguments reached");c=this,e=c.name,b=c.items,this._aliasCount++;for(a=0,d=b.length;a0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},a.prototype.add=function(a){return a[this._name]&&(this.ensureNonAliasedItems(),this.remove(a),this.items.push(a)),this},a.prototype.remove=function(b){var a=this.items.indexOf(b);return-1!==a&&(this.ensureNonAliasedItems(),this.items.splice(a,1)),this},a.prototype.contains=function(a){return-1!==this.items.indexOf(a)},a.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},a.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(a.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),a}(),Object.defineProperties(p.prototype,{dispatch:{value:p.prototype.emit},run:{value:p.prototype.emit}}),a.UPDATE_PRIORITY=void 0,b.TARGET_FPMS=.06,function(a){a[a.INTERACTION=50]="INTERACTION",a[a.HIGH=25]="HIGH",a[a.NORMAL=0]="NORMAL",a[a.LOW=-25]="LOW",a[a.UTILITY=-50]="UTILITY"}(a.UPDATE_PRIORITY||(a.UPDATE_PRIORITY={})),ch=function(){function a(d,a,b,c){void 0===a&&(a=null),void 0===b&&(b=0),void 0===c&&(c=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=d,this.context=a,this.priority=b,this.once=c}return a.prototype.match=function(b,a){return void 0===a&&(a=null),this.fn===b&&this.context===a},a.prototype.emit=function(a){this.fn&&(this.context?this.fn.call(this.context,a):this.fn(a));var b=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),b},a.prototype.connect=function(a){this.previous=a,a.next&&(a.next.previous=this),this.next=a.next,a.next=this},a.prototype.destroy=function(a){void 0===a&&(a=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var b=this.next;return this.next=a?null:b,this.previous=null,b},a}(),o=function(){function c(){var a=this;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 ch(null,null,1/0),this.deltaMS=1/b.TARGET_FPMS,this.elapsedMS=1/b.TARGET_FPMS,this._tick=function(b){a._requestId=null,a.started&&(a.update(b),a.started&&null===a._requestId&&a._head.next&&(a._requestId=requestAnimationFrame(a._tick)))}}return c.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},c.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},c.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},c.prototype.add=function(c,d,b){return void 0===b&&(b=a.UPDATE_PRIORITY.NORMAL),this._addListener(new ch(c,d,b))},c.prototype.addOnce=function(c,d,b){return void 0===b&&(b=a.UPDATE_PRIORITY.NORMAL),this._addListener(new ch(c,d,b,!0))},c.prototype._addListener=function(b){var a=this._head.next,c=this._head;if(a){for(;a;){if(b.priority>a.priority){b.connect(c);break}c=a,a=a.next}b.previous||b.connect(c)}else b.connect(c);return this._startIfPossible(),this},c.prototype.remove=function(b,c){for(var a=this._head.next;a;)a=a.match(b,c)?a.destroy():a.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(c.prototype,"count",{get:function(){if(!this._head)return 0;for(var a=0,b=this._head;b=b.next;)a++;return a},enumerable:!1,configurable:!0}),c.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},c.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},c.prototype.destroy=function(){if(!this._protected){this.stop();for(var a=this._head.next;a;)a=a.destroy(!0);this._head.destroy(),this._head=null}},c.prototype.update=function(a){var c,e,f,d;if(void 0===a&&(a=performance.now()),a>this.lastTime){if((c=this.elapsedMS=a-this.lastTime)>this._maxElapsedMS&&(c=this._maxElapsedMS),c*=this.speed,this._minElapsedMS){if(e=a-this._lastFrame|0,e=0;--b)if(c=aq[b],c.test&&c.test(a,d))return new c(a,f);throw new Error("Unrecognized source type to auto-detect Resource")}cm=function(a,b){return cm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cm(a,b)};function h(b,a){function c(){this.constructor=b}cm(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}co=function(){return co=Object.assign||function(d){for(var a,e=arguments,b=1,f=arguments.length,c;b0&&g>0,c.textureCacheIds=[],c.destroyed=!1,c.resource=null,c._batchEnabled=0,c._batchLocation=0,c.parentTextureArray=null,c.setResource(f),c}return h(c,d),Object.defineProperty(c.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"mipmap",{get:function(){return this._mipmap},set:function(a){this._mipmap!==a&&(this._mipmap=a,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(a){this._scaleMode!==a&&(this._scaleMode=a,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(a){this._wrapMode!==a&&(this._wrapMode=a,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),c.prototype.setStyle=function(a,b){var c;return void 0!==a&&a!==this.scaleMode&&(this.scaleMode=a,c=!0),void 0!==b&&b!==this.mipmap&&(this.mipmap=b,c=!0),c&&this.dirtyStyleId++,this},c.prototype.setSize=function(b,c,a){return a=a||this.resolution,this.setRealSize(b*a,c*a,a)},c.prototype.setRealSize=function(a,b,c){return this.resolution=c||this.resolution,this.width=Math.round(a)/this.resolution,this.height=Math.round(b)/this.resolution,this._refreshPOT(),this.update(),this},c.prototype._refreshPOT=function(){this.isPowerOfTwo=bI(this.realWidth)&&bI(this.realHeight)},c.prototype.setResolution=function(a){var b=this.resolution;return b===a||(this.resolution=a,this.valid&&(this.width=Math.round(this.width*b)/a,this.height=Math.round(this.height*b)/a,this.emit("update",this)),this._refreshPOT()),this},c.prototype.setResource=function(a){if(this.resource===a)return this;if(this.resource)throw new Error("Resource can be set only once");return a.bind(this),this.resource=a,this},c.prototype.update=function(){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))},c.prototype.onError=function(a){this.emit("error",this,a)},c.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete r[this.cacheId],delete q[this.cacheId],this.cacheId=null),this.dispose(),c.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},c.prototype.dispose=function(){this.emit("dispose",this)},c.prototype.castToBaseTexture=function(){return this},c.from=function(d,f,g){var h,a,i,e;if(void 0===g&&(g=b.STRICT_TEXTURE_CACHE),h="string"==typeof d,a=null,h?a=d:(d._pixiId||(i=f&&f.pixiIdPrefix||"pixiid",d._pixiId=i+"_"+I()),a=d._pixiId),e=r[a],h&&g&&!e)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return e||((e=new c(d,f)).cacheId=a,c.addToCache(e,a)),e},c.fromBuffer=function(b,d,e,f){b=b||new Float32Array(d*e*4);var g=new S(b,{width:d,height:e}),h=b instanceof Float32Array?a.TYPES.FLOAT:a.TYPES.UNSIGNED_BYTE;return new c(g,Object.assign({},hs,f||{width:d,height:e,type:h}))},c.addToCache=function(b,a){a&&(-1===b.textureCacheIds.indexOf(a)&&b.textureCacheIds.push(a),r[a]&&console.warn("BaseTexture added to the cache with an id ["+a+"] that already had an entry"),r[a]=b)},c.removeFromCache=function(a){var b,d,c;if("string"==typeof a){if(b=r[a],b)return d=b.textureCacheIds.indexOf(a),d>-1&&b.textureCacheIds.splice(d,1),delete r[a],b}else if(a&&a.textureCacheIds){for(c=0;c0){if(!b.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(b.resource,c)}else b.target=a.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+c,b.parentTextureArray=this.baseTexture,this.items[c]=b;return b.valid&&!this.valid&&this.resize(b.realWidth,b.realHeight),this.items[c]=b,this},b.prototype.upload=function(g,d,e){for(var f=this.itemDirtyIds,a=0,c;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,a}(z),cA=function(b){function a(d,e){var c=this,f,n,g,h,l,i,j,k,m;if(e=e||{},!(d instanceof HTMLVideoElement)){f=document.createElement("video"),f.setAttribute("preload","auto"),f.setAttribute("webkit-playsinline",""),f.setAttribute("playsinline",""),"string"==typeof d&&(d=[d]),n=d[0].src||d[0],z.crossOrigin(f,n,e.crossorigin);for(g=0;g2},a.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(o.shared.add(this.update,this),this._isConnectedToTicker=!0)},a.prototype._onPlayStop=function(){this._isConnectedToTicker&&(o.shared.remove(this.update,this),this._isConnectedToTicker=!1)},a.prototype._onCanPlay=function(){var a=this.source,b;a.removeEventListener("canplay",this._onCanPlay),a.removeEventListener("canplaythrough",this._onCanPlay),b=this.valid,this.resize(a.videoWidth,a.videoHeight),!b&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&a.play()},a.prototype.dispose=function(){this._isConnectedToTicker&&(o.shared.remove(this.update,this),this._isConnectedToTicker=!1);var a=this.source;a&&(a.removeEventListener("error",this._onError,!0),a.pause(),a.src="",a.load()),b.prototype.dispose.call(this)},Object.defineProperty(a.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(a){a!==this._autoUpdate&&(this._autoUpdate=a,!this._autoUpdate&&this._isConnectedToTicker?(o.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(o.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(a){a!==this._updateFPS&&(this._updateFPS=a)},enumerable:!1,configurable:!0}),a.test=function(b,c){return globalThis.HTMLVideoElement&&b instanceof HTMLVideoElement||a.TYPES.indexOf(c)>-1},a.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],a.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},a}(z),cB=function(b){function a(a){return b.call(this,a)||this}return h(a,b),a.test=function(a){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&a instanceof ImageBitmap},a}(z),aq.push(bc,cB,cw,cA,cz,S,cx,cu),eN={__proto__:null,Resource:Z,BaseImageResource:z,INSTALLED:aq,autoDetectResource:bB,AbstractMultiResource:bm,ArrayResource:cu,BufferResource:S,CanvasResource:cw,CubeResource:cx,ImageResource:bc,SVGResource:cz,VideoResource:cA,ImageBitmapResource:cB},hw=function(b){function c(){return null!==b&&b.apply(this,arguments)||this}return h(c,b),c.prototype.upload=function(g,b,c){var d=g.gl,e,f;return d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.alphaMode===a.ALPHA_MODES.UNPACK),e=b.realWidth,f=b.realHeight,c.width===e&&c.height===f?d.texSubImage2D(b.target,0,0,0,e,f,b.format,c.type,this.data):(c.width=e,c.height=f,d.texImage2D(b.target,0,c.internalFormat,e,f,0,b.format,c.type,this.data)),!0},c}(S),a_=function(){function b(b,c){this.width=Math.round(b||100),this.height=Math.round(c||100),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 p("disposeFramebuffer"),this.multisample=a.MSAA_QUALITY.NONE}return Object.defineProperty(b.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),b.prototype.addColorTexture=function(b,c){return void 0===b&&(b=0),this.colorTextures[b]=c||new e(null,{scaleMode:a.SCALE_MODES.NEAREST,resolution:1,mipmap:a.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},b.prototype.addDepthTexture=function(b){return this.depthTexture=b||new e(new hw(null,{width:this.width,height:this.height}),{scaleMode:a.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:a.MIPMAP_MODES.OFF,format:a.FORMATS.DEPTH_COMPONENT,type:a.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},b.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},b.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},b.prototype.resize=function(a,b){var d,e,c;if(a=Math.round(a),b=Math.round(b),a!==this.width||b!==this.height){this.width=a,this.height=b,this.dirtyId++,this.dirtySize++;for(d=0;d-1&&b.textureCacheIds.splice(d,1),delete q[a],b}else if(a&&a.textureCacheIds){for(c=0;cthis.baseTexture.width,g=e+c>this.baseTexture.height,f||g)throw h=f&&g?"and":"or",i="X: "+d+" + "+b+" = "+(d+b)+" > "+this.baseTexture.width,j="Y: "+e+" + "+c+" = "+(e+c)+" > "+this.baseTexture.height,new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+i+" "+h+" "+j);this.valid=b&&c&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=a),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"rotate",{get:function(){return this._rotate},set:function(a){this._rotate=a,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),a.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(a,"EMPTY",{get:function(){return a._EMPTY||(a._EMPTY=new a(new e),aP(a._EMPTY),aP(a._EMPTY.baseTexture)),a._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(a,"WHITE",{get:function(){if(!a._WHITE){var c=b.ADAPTER.createCanvas(16,16),d=c.getContext("2d");c.width=16,c.height=16,d.fillStyle="white",d.fillRect(0,0,16,16),a._WHITE=new a(e.from(c)),aP(a._WHITE),aP(a._WHITE.baseTexture)}return a._WHITE},enumerable:!1,configurable:!0}),a}(af),G=function(b){function a(c,d){var a=b.call(this,c,d)||this;return a.valid=!0,a.filterFrame=null,a.filterPoolKey=null,a.updateUvs(),a}return h(a,b),Object.defineProperty(a.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(a){this.framebuffer.multisample=a},enumerable:!1,configurable:!0}),a.prototype.resize=function(e,f,b){void 0===b&&(b=!0);var a=this.baseTexture.resolution,c=Math.round(e*a)/a,d=Math.round(f*a)/a;this.valid=c>0&&d>0,this._frame.width=this.orig.width=c,this._frame.height=this.orig.height=d,b&&this.baseTexture.resize(c,d),this.updateUvs()},a.prototype.setResolution=function(b){var a=this.baseTexture;a.resolution!==b&&(a.setResolution(b),this.resize(a.width,a.height,!1))},a.create=function(b){for(var e=arguments,c=[],d=1;d1?-b:-1:(c=((65535&(d=aK(d)))<<16|65535&(e=aK(e)))>>>0,b>1&&(c+=4294967296*b)),this.texturePool[c]||(this.texturePool[c]=[]),g=this.texturePool[c].pop(),g||(g=this.createTexture(d,e,b)),g.filterPoolKey=c,g.setResolution(f),g},b.prototype.getFilterTexture=function(b,d,e){var c=this.getOptimalTexture(b.width,b.height,d||b.resolution,e||a.MSAA_QUALITY.NONE);return c.filterFrame=b.filterFrame,c},b.prototype.returnTexture=function(a){var b=a.filterPoolKey;a.filterFrame=null,this.texturePool[b].push(a)},b.prototype.returnFilterTexture=function(a){this.returnTexture(a)},b.prototype.clear=function(c){var d,a,b;if(c=!1!==c)for(d in this.texturePool)if(a=this.texturePool[d],a)for(b=0;b0&&a.height>0,this.texturePool)if(Number(b)<0){if(c=this.texturePool[b],c)for(d=0;d1){for(g=0;g1&&((h=this.getOptimalFilterTexture(c.width,c.height,b.resolution)).filterFrame=c.filterFrame),i[g].apply(this,c,h,a.CLEAR_MODES.CLEAR,b),n=c,c=h,h=n;i[g].apply(this,c,m.renderTexture,a.CLEAR_MODES.BLEND,b),g>1&&b.multisample>1&&this.returnFilterTexture(b.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}b.clear(),this.statePool.push(b)},b.prototype.bindAndClear=function(b,d){var e,f,g,c,h;void 0===d&&(d=a.CLEAR_MODES.CLEAR),e=this.renderer,f=e.renderTexture,g=e.state,(b===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,b&&b.filterFrame)?(c=this.tempRect,c.x=0,c.y=0,c.width=b.filterFrame.width,c.height=b.filterFrame.height,f.bind(b,b.filterFrame,c)):b!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?f.bind(b):this.renderer.renderTexture.bind(b,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame),h=1&g.stateId||this.forceClear,(d===a.CLEAR_MODES.CLEAR||d===a.CLEAR_MODES.BLIT&&h)&&this.renderer.framebuffer.clear(0,0,0,0)},b.prototype.applyFilter=function(b,d,e,f){var c=this.renderer;c.state.set(b.state),this.bindAndClear(e,f),b.uniforms.uSampler=d,b.uniforms.filterGlobals=this.globalUniforms,c.shader.bind(b),b.legacy=!!b.program.attributeData.aTextureCoord,b.legacy?(this.quadUv.map(d._frame,d.filterFrame),c.geometry.bind(this.quadUv),c.geometry.draw(a.DRAW_MODES.TRIANGLES)):(c.geometry.bind(this.quad),c.geometry.draw(a.DRAW_MODES.TRIANGLE_STRIP))},b.prototype.calculateSpriteMatrix=function(h,b){var c=this.activeState,d=c.sourceFrame,e=c.destinationFrame,f=b._texture.orig,a=h.set(e.width,0,0,e.height,d.x,d.y),g=b.worldTransform.copyTo(m.TEMP_MATRIX);return g.invert(),a.prepend(g),a.scale(1/f.width,1/f.height),a.translate(b.anchor.x,b.anchor.y),a},b.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},b.prototype.getOptimalFilterTexture=function(d,e,b,c){return void 0===b&&(b=1),void 0===c&&(c=a.MSAA_QUALITY.NONE),this.texturePool.getOptimalTexture(d,e,b,c)},b.prototype.getFilterTexture=function(b,c,f){var e,d;return"number"==typeof b&&(e=b,b=c,c=e),b=b||this.activeState.renderTexture,d=this.texturePool.getOptimalTexture(b.width,b.height,c||b.resolution,f||a.MSAA_QUALITY.NONE),d.filterFrame=b.filterFrame,d},b.prototype.returnFilterTexture=function(a){this.texturePool.returnTexture(a)},b.prototype.emptyPool=function(){this.texturePool.clear(!0)},b.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},b.prototype.transformAABB=function(f,a){var b=bi[0],c=bi[1],d=bi[2],e=bi[3],g,h,i,j;b.set(a.left,a.top),c.set(a.left,a.bottom),d.set(a.right,a.top),e.set(a.right,a.bottom),f.apply(b,b),f.apply(c,c),f.apply(d,d),f.apply(e,e),g=Math.min(b.x,c.x,d.x,e.x),h=Math.min(b.y,c.y,d.y,e.y),i=Math.max(b.x,c.x,d.x,e.x),j=Math.max(b.y,c.y,d.y,e.y),a.x=g,a.y=h,a.width=i-g,a.height=j-h},b.prototype.roundFrame=function(c,e,b,d,a){if(!(c.width<=0||c.height<=0||b.width<=0||b.height<=0)){if(a){var f=a.a,g=a.b,h=a.c,i=a.d;if((Math.abs(g)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(f)>1e-4||Math.abs(i)>1e-4))return}(a=a?dD.copyFrom(a):dD.identity()).translate(-b.x,-b.y).scale(d.width/b.width,d.height/b.height).translate(d.x,d.y),this.transformAABB(a,c),c.ceil(e),this.transformAABB(a.invert(),c)}},b}(),aF=function(){function a(a){this.renderer=a}return a.prototype.flush=function(){},a.prototype.destroy=function(){this.renderer=null},a.prototype.start=function(){},a.prototype.stop=function(){this.flush()},a.prototype.render=function(a){},a}(),db=function(){function a(a){this.renderer=a,this.emptyRenderer=new aF(a),this.currentRenderer=this.emptyRenderer}return a.prototype.setObjectRenderer=function(a){this.currentRenderer!==a&&(this.currentRenderer.stop(),this.currentRenderer=a,this.currentRenderer.start())},a.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},a.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},a.prototype.copyBoundTextures=function(b,c){for(var d=this.renderer.texture.boundTextures,a=c-1;a>=0;--a)b[a]=d[a]||null,b[a]&&(b[a]._batchLocation=a)},a.prototype.boundArray=function(e,g,k,h){for(var l=e.elements,i=e.ids,j=e.count,a=0,b=0,c,d,f;b=0&&d=a.ENV.WEBGL2&&(c=d.getContext("webgl2",e)),c)this.webGLVersion=2;else if(this.webGLVersion=1,!(c=d.getContext("webgl",e)||d.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=c,this.getExtensions(),this.gl},c.prototype.getExtensions=function(){var a=this.gl,b={anisotropicFiltering:a.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:a.getExtension("OES_texture_float_linear"),s3tc:a.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:a.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:a.getExtension("WEBGL_compressed_texture_etc"),etc1:a.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:a.getExtension("WEBGL_compressed_texture_atc"),astc:a.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,b,{drawBuffers:a.getExtension("WEBGL_draw_buffers"),depthTexture:a.getExtension("WEBGL_depth_texture"),loseContext:a.getExtension("WEBGL_lose_context"),vertexArrayObject:a.getExtension("OES_vertex_array_object")||a.getExtension("MOZ_OES_vertex_array_object")||a.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:a.getExtension("OES_element_index_uint"),floatTexture:a.getExtension("OES_texture_float"),floatTextureLinear:a.getExtension("OES_texture_float_linear"),textureHalfFloat:a.getExtension("OES_texture_half_float"),textureHalfFloatLinear:a.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,b,{colorBufferFloat:a.getExtension("EXT_color_buffer_float")})},c.prototype.handleContextLost=function(a){a.preventDefault()},c.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},c.prototype.destroy=function(){var a=this.renderer.view;this.renderer=null,a.removeEventListener("webglcontextlost",this.handleContextLost),a.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},c.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},c.prototype.validateContext=function(a){var b=a.getContextAttributes(),c="WebGL2RenderingContext"in globalThis&&a instanceof globalThis.WebGL2RenderingContext,d;c&&(this.webGLVersion=2),b&&!b.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly"),d=c||!!a.getExtension("OES_element_index_uint"),this.supports.uint32Indices=d,d||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},c}(),ei=function(b){this.framebuffer=b,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=a.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},ih=new d,dg=function(){function c(a){this.renderer=a,this.managedFramebuffers=[],this.unknownFramebuffer=new a_(10,10),this.msaaSamples=null}return c.prototype.contextChange=function(){var c=this.gl=this.renderer.gl,e,f;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new d,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion?(e=this.renderer.context.extensions.drawBuffers,f=this.renderer.context.extensions.depthTexture,b.PREFER_ENV===a.ENV.WEBGL_LEGACY&&(e=null,f=null),e?c.drawBuffers=function(a){return e.drawBuffersWEBGL(a)}:(this.hasMRT=!1,c.drawBuffers=function(){}),f||(this.writeDepthTexture=!1)):this.msaaSamples=c.getInternalformatParameter(c.RENDERBUFFER,c.RGBA8,c.SAMPLES)},c.prototype.bind=function(a,b,d){var e,c,g,i,f,h,j;if(void 0===d&&(d=0),e=this.gl,a){c=a.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(a),this.current!==a&&(this.current=a,e.bindFramebuffer(e.FRAMEBUFFER,c.framebuffer)),c.mipLevel!==d&&(a.dirtyId++,a.dirtyFormat++,c.mipLevel=d),c.dirtyId!==a.dirtyId&&(c.dirtyId=a.dirtyId,c.dirtyFormat!==a.dirtyFormat?(c.dirtyFormat=a.dirtyFormat,c.dirtySize=a.dirtySize,this.updateFramebuffer(a,d)):c.dirtySize!==a.dirtySize&&(c.dirtySize=a.dirtySize,this.resizeFramebuffer(a)));for(g=0;g>d,h=b.height>>d,j=f/b.width,this.setViewport(b.x*j,b.y*j,f,h)):(f=a.width>>d,h=a.height>>d,this.setViewport(0,0,f,h))}else this.current&&(this.current=null,e.bindFramebuffer(e.FRAMEBUFFER,null)),b?this.setViewport(b.x,b.y,b.width,b.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},c.prototype.setViewport=function(b,c,d,e){var a=this.viewport;b=Math.round(b),c=Math.round(c),d=Math.round(d),e=Math.round(e),a.width===d&&a.height===e&&a.x===b&&a.y===c||(a.x=b,a.y=c,a.width=d,a.height=e,this.gl.viewport(b,c,d,e))},Object.defineProperty(c.prototype,"size",{get:function(){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}},enumerable:!1,configurable:!0}),c.prototype.clear=function(d,e,f,g,b){void 0===b&&(b=a.BUFFER_BITS.COLOR|a.BUFFER_BITS.DEPTH);var c=this.gl;c.clearColor(d,e,f,g),c.clear(b)},c.prototype.initFramebuffer=function(a){var c=this.gl,b=new ei(c.createFramebuffer());return b.multisample=this.detectSamples(a.multisample),a.glFramebuffers[this.CONTEXT_UID]=b,this.managedFramebuffers.push(a),a.disposeRunner.add(this),b},c.prototype.resizeFramebuffer=function(b){var a=this.gl,c=b.glFramebuffers[this.CONTEXT_UID],f,d,e,g,h;c.msaaBuffer&&(a.bindRenderbuffer(a.RENDERBUFFER,c.msaaBuffer),a.renderbufferStorageMultisample(a.RENDERBUFFER,c.multisample,a.RGBA8,b.width,b.height)),c.stencil&&(a.bindRenderbuffer(a.RENDERBUFFER,c.stencil),c.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,c.multisample,a.DEPTH24_STENCIL8,b.width,b.height):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,b.width,b.height)),f=b.colorTextures,d=f.length,a.drawBuffers||(d=Math.min(d,1));for(e=0;e1&&this.canMultisampleFramebuffer(c)?(b.msaaBuffer=b.msaaBuffer||a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,b.msaaBuffer),a.renderbufferStorageMultisample(a.RENDERBUFFER,b.multisample,a.RGBA8,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.RENDERBUFFER,b.msaaBuffer)):b.msaaBuffer&&(a.deleteRenderbuffer(b.msaaBuffer),b.msaaBuffer=null,b.blitFramebuffer&&(b.blitFramebuffer.dispose(),b.blitFramebuffer=null));for(f=[],d=0;d1&&a.drawBuffers(f),c.depthTexture&&this.writeDepthTexture&&(k=c.depthTexture,this.renderer.texture.bind(k,0),a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,k._glTextures[this.CONTEXT_UID].texture,i)),!c.stencil&&!c.depth||c.depthTexture&&this.writeDepthTexture?b.stencil&&(a.deleteRenderbuffer(b.stencil),b.stencil=null):(b.stencil=b.stencil||a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,b.stencil),b.msaaBuffer?a.renderbufferStorageMultisample(a.RENDERBUFFER,b.multisample,a.DEPTH24_STENCIL8,c.width,c.height):a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,b.stencil))},c.prototype.canMultisampleFramebuffer=function(a){return 1!==this.renderer.context.webGLVersion&&a.colorTextures.length<=1&&!a.depthTexture},c.prototype.detectSamples=function(e){var c=this.msaaSamples,b=a.MSAA_QUALITY.NONE,d;if(e<=1||null===c)return b;for(d=0;d=0&&this.managedFramebuffers.splice(d,1),b.disposeRunner.remove(this),e||(c.deleteFramebuffer(a.framebuffer),a.msaaBuffer&&c.deleteRenderbuffer(a.msaaBuffer),a.stencil&&c.deleteRenderbuffer(a.stencil)),a.blitFramebuffer&&a.blitFramebuffer.dispose())},c.prototype.disposeAll=function(c){var b=this.managedFramebuffers,a;this.managedFramebuffers=[];for(a=0;a=a.ENV.WEBGL2&&(c=d.getContext("webgl2",{})),c||((c=d.getContext("webgl",{})||d.getContext("experimental-webgl",{}))?c.getExtension("WEBGL_draw_buffers"):c=null),aC=c}return aC}function dT(b,c,d){if("precision"!==b.substring(0,9)){var e=c;return c===a.PRECISION.HIGH&&d!==a.PRECISION.HIGH&&(e=a.PRECISION.MEDIUM),"precision "+e+" float;\n"+b}return d!==a.PRECISION.HIGH&&"precision highp"===b.substring(0,15)?b.replace("precision highp","precision mediump"):b}hX={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 dN(a){return hX[a]}bv=null,dL={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 dK(d,e){var b,a,c;if(!bv){b=Object.keys(dL),bv={};for(a=0;a0&&(b+="\nelse "),a0?this.maskStack[this.maskStack.length-1]._colorMask:15;a!==c&&this.renderer.gl.colorMask(0!=(1&a),0!=(2&a),0!=(4&a),0!=(8&a))},b.prototype.destroy=function(){this.renderer=null},b}(),dQ=function(){function a(a){this.renderer=a,this.maskStack=[],this.glConst=0}return a.prototype.getStackLength=function(){return this.maskStack.length},a.prototype.setMaskStack=function(c){var a=this.renderer.gl,d=this.getStackLength(),b;this.maskStack=c,b=this.getStackLength(),b!==d&&(0===b?a.disable(this.glConst):(a.enable(this.glConst),this._useCurrent()))},a.prototype._useCurrent=function(){},a.prototype.destroy=function(){this.renderer=null,this.maskStack=null},a}(),dR=new m,dS=[],dt=function(c){function a(d){var a=c.call(this,d)||this;return a.glConst=b.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,a}return h(a,c),a.prototype.getStackLength=function(){var a=this.maskStack[this.maskStack.length-1];return a?a._scissorCounter:0},a.prototype.calcScissorRect=function(a){var c,g,h,e,b,f;a._scissorRectLocal||(g=a._scissorRect,h=a.maskObject,e=this.renderer,b=e.renderTexture,f=h.getBounds(!0,null!==(c=dS.pop())&&void 0!==c?c:new d),this.roundFrameToPixels(f,b.current?b.current.resolution:e.resolution,b.sourceFrame,b.destinationFrame,e.projection.transform),g&&f.fit(g),a._scissorRectLocal=f)},a.isMatrixRotated=function(a){if(!a)return!1;var b=a.a,c=a.b,d=a.c,e=a.d;return(Math.abs(c)>1e-4||Math.abs(d)>1e-4)&&(Math.abs(b)>1e-4||Math.abs(e)>1e-4)},a.prototype.testScissor=function(b){var c=b.maskObject,d;return!(!c.isFastRect||!c.isFastRect())&&(!a.isMatrixRotated(c.worldTransform)&&(!a.isMatrixRotated(this.renderer.projection.transform)&&(this.calcScissorRect(b),d=b._scissorRectLocal,d.width>0&&d.height>0)))},a.prototype.roundFrameToPixels=function(b,e,f,c,d){a.isMatrixRotated(d)||((d=d?dR.copyFrom(d):dR.identity()).translate(-f.x,-f.y).scale(c.width/f.width,c.height/f.height).translate(c.x,c.y),this.renderer.filter.transformAABB(d,b),b.fit(c),b.x=Math.round(b.x*e),b.y=Math.round(b.y*e),b.width=Math.round(b.width*e),b.height=Math.round(b.height*e))},a.prototype.push=function(a){a._scissorRectLocal||this.calcScissorRect(a);var b=this.renderer.gl;a._scissorRect||b.enable(b.SCISSOR_TEST),a._scissorCounter++,a._scissorRect=a._scissorRectLocal,this._useCurrent()},a.prototype.pop=function(a){var b=this.renderer.gl;a&&dS.push(a._scissorRectLocal),this.getStackLength()>0?this._useCurrent():b.disable(b.SCISSOR_TEST)},a.prototype._useCurrent=function(){var b,a=this.maskStack[this.maskStack.length-1]._scissorRect;b=this.renderer.renderTexture.current?a.y:this.renderer.height-a.height-a.y,this.renderer.gl.scissor(a.x,b,a.width,a.height)},a}(dQ),ds=function(c){function a(d){var a=c.call(this,d)||this;return a.glConst=b.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,a}return h(a,c),a.prototype.getStackLength=function(){var a=this.maskStack[this.maskStack.length-1];return a?a._stencilCounter:0},a.prototype.push=function(c){var d=c.maskObject,a=this.renderer.gl,e=c._stencilCounter,b;0===e&&(this.renderer.framebuffer.forceStencil(),a.clearStencil(0),a.clear(a.STENCIL_BUFFER_BIT),a.enable(a.STENCIL_TEST)),c._stencilCounter++,b=c._colorMask,0!==b&&(c._colorMask=0,a.colorMask(!1,!1,!1,!1)),a.stencilFunc(a.EQUAL,e,4294967295),a.stencilOp(a.KEEP,a.KEEP,a.INCR),d.renderable=!0,d.render(this.renderer),this.renderer.batch.flush(),d.renderable=!1,0!==b&&(c._colorMask=b,a.colorMask(0!=(1&b),0!=(2&b),0!=(4&b),0!=(8&b))),this._useCurrent()},a.prototype.pop=function(d){var a=this.renderer.gl,c,b;0===this.getStackLength()?a.disable(a.STENCIL_TEST):(c=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,b=c?c._colorMask:15,0!==b&&(c._colorMask=0,a.colorMask(!1,!1,!1,!1)),a.stencilOp(a.KEEP,a.KEEP,a.DECR),d.renderable=!0,d.render(this.renderer),this.renderer.batch.flush(),d.renderable=!1,0!==b&&(c._colorMask=b,a.colorMask(0!=(1&b),0!=(2&b),0!=(4&b),0!=(8&b))),this._useCurrent())},a.prototype._useCurrent=function(){var a=this.renderer.gl;a.stencilFunc(a.EQUAL,this.getStackLength(),4294967295),a.stencilOp(a.KEEP,a.KEEP,a.KEEP)},a}(dQ),dq=function(){function a(a){this.renderer=a,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new m,this.transform=null}return a.prototype.update=function(b,c,d,e){this.destinationFrame=b||this.destinationFrame||this.defaultFrame,this.sourceFrame=c||this.sourceFrame||b,this.calculateProjection(this.destinationFrame,this.sourceFrame,d,e),this.transform&&this.projectionMatrix.append(this.transform);var a=this.renderer;a.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,a.globalUniforms.update(),a.shader.shader&&a.shader.syncUniformGroup(a.shader.shader.uniforms.globals)},a.prototype.calculateProjection=function(e,b,f,d){var a=this.projectionMatrix,c=d?-1:1;a.identity(),a.a=1/b.width*2,a.d=c*(1/b.height*2),a.tx=-1-b.x*a.a,a.ty=-c-b.y*a.d},a.prototype.setTransform=function(a){},a.prototype.destroy=function(){this.renderer=null},a}(),$=new d,aE=new d,dk=function(){function a(a){this.renderer=a,this.clearColor=a._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new d,this.destinationFrame=new d,this.viewportFrame=new d}return a.prototype.bind=function(a,c,b){var g,h,e,f,d;void 0===a&&(a=null),f=this.renderer,this.current=a,a?(e=(g=a.baseTexture).resolution,c||($.width=a.frame.width,$.height=a.frame.height,c=$),b||(aE.x=a.frame.x,aE.y=a.frame.y,aE.width=c.width,aE.height=c.height,b=aE),h=g.framebuffer):(e=f.resolution,c||($.width=f.screen.width,$.height=f.screen.height,c=$),b||((b=$).width=c.width,b.height=c.height)),d=this.viewportFrame,d.x=b.x*e,d.y=b.y*e,d.width=b.width*e,d.height=b.height*e,a||(d.y=f.view.height-(d.y+d.height)),d.ceil(),this.renderer.framebuffer.bind(h,d),this.renderer.projection.update(b,c,e,!h),a?this.renderer.mask.setMaskStack(g.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(c),this.destinationFrame.copyFrom(b)},a.prototype.clear=function(a,j){var h,i,g,b,f,c,d,e;a=this.current?a||this.current.baseTexture.clearColor:a||this.clearColor,h=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,g=h.width!==i.width||h.height!==i.height,g&&(b=this.viewportFrame,f=b.x,c=b.y,d=b.width,e=b.height,f=Math.round(f),c=Math.round(c),d=Math.round(d),e=Math.round(e),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(f,c,d,e)),this.renderer.framebuffer.clear(a[0],a[1],a[2],a[3],j),g&&this.renderer.scissor.pop()},a.prototype.resize=function(){this.bind(null)},a.prototype.reset=function(){this.bind(null)},a.prototype.destroy=function(){this.renderer=null},a}();function hW(c,d,a,e,b){a.buffer.update(b)}hU={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},d$={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function ea(h){for(var e=h.map(function(a){return{data:a,offset:0,dataLen:0,dirty:0}}),a=0,c=0,b=0,f=0,d,g;f1&&(a=Math.max(a,16)*d.data.size),d.dataLen=a,c%a!=0&&c<16)&&(g=c%a%16,c+=g,b+=g),c+a>16?(b=16*Math.ceil(b/16),d.offset=b,b+=a,c=a):(d.offset=b,c+=a,b+=a);return{uboElements:e,size:b=16*Math.ceil(b/16)}}function eb(d,b){var a=[],c;for(c in d)b[c]&&a.push(b[c]);return a.sort(function(a,b){return a.index-b.index}),a}function ec(m,r){var f,k,o,b,e,a,j,c,l,d,h,n,g,i,p,q;if(!m.autoManage)return{size:0,syncFunc:hW};for(f=ea(eb(m.uniforms,r)),k=f.uboElements,o=f.size,b=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "],e=0;e1?(n=dN(a.data.type),g=Math.max(d$[a.data.type]/16,1),i=n/g,p=(4-i%4)%4,b.push("\n cv = ud."+c+".value;\n v = uv."+c+";\n offset = "+a.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+a.data.size*g+"; i++)\n {\n for(var j = 0; j < "+i+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+p+";\n }\n\n ")):(q=hU[a.data.type],b.push("\n cv = ud."+c+".value;\n v = uv."+c+";\n offset = "+a.offset/4+";\n "+q+";\n ")))}return b.push("\n renderer.buffer.update(buffer);\n "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",b.join("\n"))}}ed=function(){function a(a,b){this.program=a,this.uniformData=b,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return a.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},a}();function ee(a,d){var f=dY(a,a.VERTEX_SHADER,d.vertexSrc),g=dY(a,a.FRAGMENT_SHADER,d.fragmentSrc),b=a.createProgram(),e,c,h,i;if(a.attachShader(b,f),a.attachShader(b,g),a.linkProgram(b),a.getProgramParameter(b,a.LINK_STATUS)||function(a,b,c,d){a.getProgramParameter(b,a.LINK_STATUS)||(a.getShaderParameter(c,a.COMPILE_STATUS)||dX(a,c),a.getShaderParameter(d,a.COMPILE_STATUS)||dX(a,d),console.error("PixiJS Error: Could not initialize shader."),""!==a.getProgramInfoLog(b)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",a.getProgramInfoLog(b)))}(a,b,f,g),d.attributeData=function(c,a){for(var e={},g=a.getProgramParameter(c,a.ACTIVE_ATTRIBUTES),d=0,b,f,h;db?1:-1});for(c=0;c>=1,b++;this.stateId=a.data}for(b=0;bthis.checkCountMax&&(this.checkCount=0,this.run())))},c.prototype.run=function(){for(var d=this.renderer.texture,b=d.managedTextures,e=!1,a=0,c,f;athis.maxIdle&&(d.destroyTexture(c,!0),b[a]=null,e=!0);if(e){f=0;for(a=0;a=0;c--)this.unload(a.children[c])},c.prototype.destroy=function(){this.renderer=null},c}(),be=function(b){this.texture=b,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=a.TYPES.UNSIGNED_BYTE,this.internalFormat=a.FORMATS.RGBA,this.samplerType=0},cW=function(){function b(a){this.renderer=a,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new e,this.hasIntegerTextures=!1}return b.prototype.contextChange=function(){var b=this.gl=this.renderer.gl,d,c,e;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(b){var c,d,e,f,l,i,j,h,k,u,t,y,n,p,q,r,s,m,g,v,w,x,o;return"WebGL2RenderingContext"in globalThis&&b instanceof globalThis.WebGL2RenderingContext?((c={})[a.TYPES.UNSIGNED_BYTE]=((d={})[a.FORMATS.RGBA]=b.RGBA8,d[a.FORMATS.RGB]=b.RGB8,d[a.FORMATS.RG]=b.RG8,d[a.FORMATS.RED]=b.R8,d[a.FORMATS.RGBA_INTEGER]=b.RGBA8UI,d[a.FORMATS.RGB_INTEGER]=b.RGB8UI,d[a.FORMATS.RG_INTEGER]=b.RG8UI,d[a.FORMATS.RED_INTEGER]=b.R8UI,d[a.FORMATS.ALPHA]=b.ALPHA,d[a.FORMATS.LUMINANCE]=b.LUMINANCE,d[a.FORMATS.LUMINANCE_ALPHA]=b.LUMINANCE_ALPHA,d),c[a.TYPES.BYTE]=((e={})[a.FORMATS.RGBA]=b.RGBA8_SNORM,e[a.FORMATS.RGB]=b.RGB8_SNORM,e[a.FORMATS.RG]=b.RG8_SNORM,e[a.FORMATS.RED]=b.R8_SNORM,e[a.FORMATS.RGBA_INTEGER]=b.RGBA8I,e[a.FORMATS.RGB_INTEGER]=b.RGB8I,e[a.FORMATS.RG_INTEGER]=b.RG8I,e[a.FORMATS.RED_INTEGER]=b.R8I,e),c[a.TYPES.UNSIGNED_SHORT]=((f={})[a.FORMATS.RGBA_INTEGER]=b.RGBA16UI,f[a.FORMATS.RGB_INTEGER]=b.RGB16UI,f[a.FORMATS.RG_INTEGER]=b.RG16UI,f[a.FORMATS.RED_INTEGER]=b.R16UI,f[a.FORMATS.DEPTH_COMPONENT]=b.DEPTH_COMPONENT16,f),c[a.TYPES.SHORT]=((l={})[a.FORMATS.RGBA_INTEGER]=b.RGBA16I,l[a.FORMATS.RGB_INTEGER]=b.RGB16I,l[a.FORMATS.RG_INTEGER]=b.RG16I,l[a.FORMATS.RED_INTEGER]=b.R16I,l),c[a.TYPES.UNSIGNED_INT]=((i={})[a.FORMATS.RGBA_INTEGER]=b.RGBA32UI,i[a.FORMATS.RGB_INTEGER]=b.RGB32UI,i[a.FORMATS.RG_INTEGER]=b.RG32UI,i[a.FORMATS.RED_INTEGER]=b.R32UI,i[a.FORMATS.DEPTH_COMPONENT]=b.DEPTH_COMPONENT24,i),c[a.TYPES.INT]=((j={})[a.FORMATS.RGBA_INTEGER]=b.RGBA32I,j[a.FORMATS.RGB_INTEGER]=b.RGB32I,j[a.FORMATS.RG_INTEGER]=b.RG32I,j[a.FORMATS.RED_INTEGER]=b.R32I,j),c[a.TYPES.FLOAT]=((h={})[a.FORMATS.RGBA]=b.RGBA32F,h[a.FORMATS.RGB]=b.RGB32F,h[a.FORMATS.RG]=b.RG32F,h[a.FORMATS.RED]=b.R32F,h[a.FORMATS.DEPTH_COMPONENT]=b.DEPTH_COMPONENT32F,h),c[a.TYPES.HALF_FLOAT]=((k={})[a.FORMATS.RGBA]=b.RGBA16F,k[a.FORMATS.RGB]=b.RGB16F,k[a.FORMATS.RG]=b.RG16F,k[a.FORMATS.RED]=b.R16F,k),c[a.TYPES.UNSIGNED_SHORT_5_6_5]=((u={})[a.FORMATS.RGB]=b.RGB565,u),c[a.TYPES.UNSIGNED_SHORT_4_4_4_4]=((t={})[a.FORMATS.RGBA]=b.RGBA4,t),c[a.TYPES.UNSIGNED_SHORT_5_5_5_1]=((y={})[a.FORMATS.RGBA]=b.RGB5_A1,y),c[a.TYPES.UNSIGNED_INT_2_10_10_10_REV]=((n={})[a.FORMATS.RGBA]=b.RGB10_A2,n[a.FORMATS.RGBA_INTEGER]=b.RGB10_A2UI,n),c[a.TYPES.UNSIGNED_INT_10F_11F_11F_REV]=((p={})[a.FORMATS.RGB]=b.R11F_G11F_B10F,p),c[a.TYPES.UNSIGNED_INT_5_9_9_9_REV]=((q={})[a.FORMATS.RGB]=b.RGB9_E5,q),c[a.TYPES.UNSIGNED_INT_24_8]=((r={})[a.FORMATS.DEPTH_STENCIL]=b.DEPTH24_STENCIL8,r),c[a.TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]=((s={})[a.FORMATS.DEPTH_STENCIL]=b.DEPTH32F_STENCIL8,s),o=c):((m={})[a.TYPES.UNSIGNED_BYTE]=((g={})[a.FORMATS.RGBA]=b.RGBA,g[a.FORMATS.RGB]=b.RGB,g[a.FORMATS.ALPHA]=b.ALPHA,g[a.FORMATS.LUMINANCE]=b.LUMINANCE,g[a.FORMATS.LUMINANCE_ALPHA]=b.LUMINANCE_ALPHA,g),m[a.TYPES.UNSIGNED_SHORT_5_6_5]=((v={})[a.FORMATS.RGB]=b.RGB,v),m[a.TYPES.UNSIGNED_SHORT_4_4_4_4]=((w={})[a.FORMATS.RGBA]=b.RGBA,w),m[a.TYPES.UNSIGNED_SHORT_5_5_5_1]=((x={})[a.FORMATS.RGBA]=b.RGBA,x),o=m),o}(b),d=b.getParameter(b.MAX_TEXTURE_IMAGE_UNITS),this.boundTextures.length=d;for(c=0;c=0;--d)b=e[d],b&&b._glTextures[g].samplerType!==a.SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(b)},b.prototype.initTexture=function(a){var b=new be(this.gl.createTexture());return b.dirtyId=-1,a._glTextures[this.CONTEXT_UID]=b,this.managedTextures.push(a),a.on("dispose",this.destroyTexture,this),b},b.prototype.initTextureType=function(b,c){var d,e;c.internalFormat=null!==(e=null===(d=this.internalFormats[b.type])||void 0===d?void 0:d[b.format])&&void 0!==e?e:b.format,2===this.webGLVersion&&b.type===a.TYPES.HALF_FLOAT?c.type=this.gl.HALF_FLOAT:c.type=b.type},b.prototype.updateTexture=function(c){var b=c._glTextures[this.CONTEXT_UID],f,d,e,g;b&&(f=this.renderer,(this.initTextureType(c,b),c.resource&&c.resource.upload(f,c,b))?b.samplerType!==a.SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0):(d=c.realWidth,e=c.realHeight,g=f.gl,(b.width!==d||b.height!==e||b.dirtyId<0)&&(b.width=d,b.height=e,g.texImage2D(c.target,0,b.internalFormat,d,e,0,c.format,b.type,null))),c.dirtyStyleId!==b.dirtyStyleId&&this.updateTextureStyle(c),b.dirtyId=c.dirtyId)},b.prototype.destroyTexture=function(a,c){var d=this.gl,b;(a=a.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(a),d.deleteTexture(a._glTextures[this.CONTEXT_UID].texture),a.off("dispose",this.destroyTexture,this),delete a._glTextures[this.CONTEXT_UID],!c)&&(b=this.managedTextures.indexOf(a),-1!==b&&_(this.managedTextures,b,1))},b.prototype.updateTextureStyle=function(b){var c=b._glTextures[this.CONTEXT_UID];c&&(b.mipmap!==a.MIPMAP_MODES.POW2&&2===this.webGLVersion||b.isPowerOfTwo?c.mipmap=b.mipmap>=1:c.mipmap=!1,2===this.webGLVersion||b.isPowerOfTwo?c.wrapMode=b.wrapMode:c.wrapMode=a.WRAP_MODES.CLAMP,b.resource&&b.resource.style(this.renderer,b,c)||this.setStyle(b,c),c.dirtyStyleId=b.dirtyStyleId)},b.prototype.setStyle=function(c,d){var b=this.gl,e,f;d.mipmap&&c.mipmap!==a.MIPMAP_MODES.ON_MANUAL&&b.generateMipmap(c.target),b.texParameteri(c.target,b.TEXTURE_WRAP_S,d.wrapMode),b.texParameteri(c.target,b.TEXTURE_WRAP_T,d.wrapMode),d.mipmap?(b.texParameteri(c.target,b.TEXTURE_MIN_FILTER,c.scaleMode===a.SCALE_MODES.LINEAR?b.LINEAR_MIPMAP_LINEAR:b.NEAREST_MIPMAP_NEAREST),e=this.renderer.context.extensions.anisotropicFiltering,e&&c.anisotropicLevel>0&&c.scaleMode===a.SCALE_MODES.LINEAR&&(f=Math.min(c.anisotropicLevel,b.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),b.texParameterf(c.target,e.TEXTURE_MAX_ANISOTROPY_EXT,f))):b.texParameteri(c.target,b.TEXTURE_MIN_FILTER,c.scaleMode===a.SCALE_MODES.LINEAR?b.LINEAR:b.NEAREST),b.texParameteri(c.target,b.TEXTURE_MAG_FILTER,c.scaleMode===a.SCALE_MODES.LINEAR?b.LINEAR:b.NEAREST)},b.prototype.destroy=function(){this.renderer=null},b}(),em={__proto__:null,FilterSystem:c$,BatchSystem:db,ContextSystem:dd,FramebufferSystem:dg,GeometrySystem:di,MaskSystem:du,ScissorSystem:dt,StencilSystem:ds,ProjectionSystem:dq,RenderTextureSystem:dk,ShaderSystem:df,StateSystem:de,TextureGCSystem:dc,TextureSystem:cW},cU=new m,eo=function(e){function c(g,f){void 0===g&&(g=a.RENDERER_TYPE.UNKNOWN);var c=e.call(this)||this;return f=Object.assign({},b.RENDER_OPTIONS,f),c.options=f,c.type=g,c.screen=new d(0,0,f.width,f.height),c.view=f.view||b.ADAPTER.createCanvas(),c.resolution=f.resolution||b.RESOLUTION,c.useContextAlpha=f.useContextAlpha,c.autoDensity=!!f.autoDensity,c.preserveDrawingBuffer=f.preserveDrawingBuffer,c.clearBeforeRender=f.clearBeforeRender,c._backgroundColor=0,c._backgroundColorRgba=[0,0,0,1],c._backgroundColorString="#000000",c.backgroundColor=f.backgroundColor||c._backgroundColor,c.backgroundAlpha=f.backgroundAlpha,void 0!==f.transparent&&(c.useContextAlpha=f.transparent,c.backgroundAlpha=f.transparent?0:1),c._lastObjectRendered=null,c.plugins={},c}return h(c,e),c.prototype.initPlugins=function(a){for(var b in a)this.plugins[b]=new a[b](this)},Object.defineProperty(c.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),c.prototype.resize=function(c,d){this.view.width=Math.round(c*this.resolution),this.view.height=Math.round(d*this.resolution);var a=this.view.width/this.resolution,b=this.view.height/this.resolution;this.screen.width=a,this.screen.height=b,this.autoDensity&&(this.view.style.width=a+"px",this.view.style.height=b+"px"),this.emit("resize",a,b)},c.prototype.generateTexture=function(c,b,g,a){var e,f,d;return void 0===b&&(b={}),"number"==typeof b&&(b={scaleMode:b,resolution:g,region:a}),e=b.region,f=function(b,e){var d={},a,c;for(a in b)Object.prototype.hasOwnProperty.call(b,a)&&e.indexOf(a)<0&&(d[a]=b[a]);if(null!=b&&"function"==typeof Object.getOwnPropertySymbols){c=0;for(a=Object.getOwnPropertySymbols(b);c=a.data.byteLength?b.bufferSubData(a.type,0,a.data):(e=a.static?b.STATIC_DRAW:b.DYNAMIC_DRAW,c.byteLength=a.data.byteLength,b.bufferData(a.type,a.data,e)))},a.prototype.dispose=function(a,c){if(this.managedBuffers[a.id]){delete this.managedBuffers[a.id];var b=a._glBuffers[this.CONTEXT_UID],d=this.gl;a.disposeRunner.remove(this),b&&(c||d.deleteBuffer(b.buffer),delete a._glBuffers[this.CONTEXT_UID])}},a.prototype.disposeAll=function(c){for(var b=Object.keys(this.managedBuffers),a=0;a=a.MSAA_QUALITY.HIGH?this.multisample=a.MSAA_QUALITY.HIGH:c>=a.MSAA_QUALITY.MEDIUM?this.multisample=a.MSAA_QUALITY.MEDIUM:c>=a.MSAA_QUALITY.LOW?this.multisample=a.MSAA_QUALITY.LOW:this.multisample=a.MSAA_QUALITY.NONE},b.prototype.addSystem=function(c,a){var b=new c(this),d;if(this[a])throw new Error('Whoops! The name "'+a+'" is already in use');for(d in this[a]=b,this.runners)this.runners[d].add(b);return this},b.prototype.render=function(c,a){var b,d,e,f,g;a&&(a instanceof G?(b=a,d=arguments[2],e=arguments[3],f=arguments[4]):(b=a.renderTexture,d=a.clear,e=a.transform,f=a.skipUpdateTransform)),this.renderingToScreen=!b,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=e,!this.context.isLost&&(b||(this._lastObjectRendered=c),!f&&(g=c.enableTempParent(),c.updateTransform(),c.disableTempParent(g)),this.renderTexture.bind(b),this.batch.currentRenderer.start(),(void 0!==d?d:this.clearBeforeRender)&&this.renderTexture.clear(),c.render(this),this.batch.currentRenderer.flush(),b&&b.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender"))},b.prototype.generateTexture=function(b,a,d,e){void 0===a&&(a={});var f=c.prototype.generateTexture.call(this,b,a,d,e);return this.framebuffer.blit(),f},b.prototype.resize=function(a,b){c.prototype.resize.call(this,a,b),this.runners.resize.emit(this.screen.height,this.screen.width)},b.prototype.reset=function(){return this.runners.reset.emit(),this},b.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},b.prototype.destroy=function(a){for(var b in this.runners.destroy.emit(),this.runners)this.runners[b].destroy();c.prototype.destroy.call(this,a),this.gl=null},Object.defineProperty(b.prototype,"extract",{get:function(){return this.plugins.extract},enumerable:!1,configurable:!0}),b.registerPlugin=function(b,c){A.add({name:b,type:a.ExtensionType.RendererPlugin,ref:c})},b.__plugins={},b}(eo);function es(a){return cS.create(a)}A.handleByMap(a.ExtensionType.RendererPlugin,cS.__plugins),et="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",cR="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",hB=function(){function a(a){this.renderer=a}return a.prototype.destroy=function(){this.renderer=null},a}(),bb=function(){this.texArray=null,this.blend=0,this.type=a.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null},aY=function(){function a(){this.elements=[],this.ids=[],this.count=0}return a.prototype.clear=function(){for(var a=0;athis.size&&this.flush(),this._vertexCount+=a.vertexData.length/2,this._indexCount+=a.indices.length,this._bufferedTextures[this._bufferSize]=a._texture.baseTexture,this._bufferedElements[this._bufferSize++]=a)},c.prototype.buildTexturesAndDrawCalls=function(){var k=this._bufferedTextures,g=this.MAX_TEXTURES,m=c._textureArrayPool,i=this.renderer.batch,f=this._tempBoundTextures,n=this.renderer.textureGC.count,d=++e._globalBatch,l=0,b=m[0],j=0,a,h;i.copyBoundTextures(f,g);for(a=0;a=g&&(i.boundArray(b,f,d,g),this.buildDrawCalls(b,j,a),j=a,b=m[++l],++d),h._batchEnabled=d,h.touched=n,b.elements[b.count++]=h);for(b.count>0&&(i.boundArray(b,f,d,g),this.buildDrawCalls(b,j,this._bufferSize),++l,++d),a=0;a0&&(a+="\nelse "),b title : "+a.title+"
tabIndex: "+a.tabIndex},b.prototype.capHitArea=function(a){a.x<0&&(a.width+=a.x,a.x=0),a.y<0&&(a.height+=a.y,a.y=0);var b=this.renderer,c=b.width,d=b.height;a.x+a.width>c&&(a.width=c-a.x),a.y+a.height>d&&(a.height=d-a.y)},b.prototype.addChild=function(b){var a=this.pool.pop();a||((a=document.createElement("button")).style.width="100px",a.style.height="100px",a.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",a.style.position="absolute",a.style.zIndex=2..toString(),a.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?a.setAttribute("aria-live","off"):a.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?a.setAttribute("aria-relevant","additions"):a.setAttribute("aria-relevant","text"),a.addEventListener("click",this._onClick.bind(this)),a.addEventListener("focus",this._onFocus.bind(this)),a.addEventListener("focusout",this._onFocusOut.bind(this))),a.style.pointerEvents=b.accessiblePointerEvents,a.type=b.accessibleType,b.accessibleTitle&&null!==b.accessibleTitle?a.title=b.accessibleTitle:b.accessibleHint&&null!==b.accessibleHint||(a.title="displayObject "+b.tabIndex),b.accessibleHint&&null!==b.accessibleHint&&a.setAttribute("aria-label",b.accessibleHint),this.debug&&this.updateDebugHTML(a),b._accessibleActive=!0,b._accessibleDiv=a,a.displayObject=b,this.children.push(b),this.div.appendChild(b._accessibleDiv),b._accessibleDiv.tabIndex=b.tabIndex},b.prototype._onClick=function(d){var a=this.renderer.plugins.interaction,b=d.target.displayObject,c=a.eventData;a.dispatchEvent(b,"click",c),a.dispatchEvent(b,"pointertap",c),a.dispatchEvent(b,"tap",c)},b.prototype._onFocus=function(a){a.target.getAttribute("aria-live")||a.target.setAttribute("aria-live","assertive");var b=this.renderer.plugins.interaction,c=a.target.displayObject,d=b.eventData;b.dispatchEvent(c,"mouseover",d)},b.prototype._onFocusOut=function(a){a.target.getAttribute("aria-live")||a.target.setAttribute("aria-live","polite");var b=this.renderer.plugins.interaction,c=a.target.displayObject,d=b.eventData;b.dispatchEvent(c,"mouseout",d)},b.prototype._onKeyDown=function(a){9===a.keyCode&&this.activate()},b.prototype._onMouseMove=function(a){0===a.movementX&&0===a.movementY||this.deactivate()},b.prototype.destroy=function(){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},b.extension={name:"accessibility",type:[a.ExtensionType.RendererPlugin,a.ExtensionType.CanvasRendererPlugin]},b}(),cC=function(){function a(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(a.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),a.prototype.getLocalPosition=function(a,b,c){return a.worldTransform.applyInverse(c||this.global,b)},a.prototype.copyEvent=function(a){"isPrimary"in a&&a.isPrimary&&(this.isPrimary=!0),this.button="button"in a&&a.button;var b="buttons"in a&&a.buttons;this.buttons=Number.isInteger(b)?b:"which"in a&&a.which,this.width="width"in a&&a.width,this.height="height"in a&&a.height,this.tiltX="tiltX"in a&&a.tiltX,this.tiltY="tiltY"in a&&a.tiltY,this.pointerType="pointerType"in a&&a.pointerType,this.pressure="pressure"in a&&a.pressure,this.rotationAngle="rotationAngle"in a&&a.rotationAngle,this.twist="twist"in a&&a.twist||0,this.tangentialPressure="tangentialPressure"in a&&a.tangentialPressure||0},a.prototype.reset=function(){this.isPrimary=!1},a}(),cr=function(a,b){return cr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cr(a,b)},eP=function(){function a(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return a.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},a.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},a}(),bA=function(){function a(b){this._pointerId=b,this._flags=a.FLAGS.NONE}return a.prototype._doSet=function(a,b){this._flags=b?this._flags|a:this._flags&~a},Object.defineProperty(a.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"flags",{get:function(){return this._flags},set:function(a){this._flags=a},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"none",{get:function(){return this._flags===a.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"over",{get:function(){return 0!=(this._flags&a.FLAGS.OVER)},set:function(b){this._doSet(a.FLAGS.OVER,b)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"rightDown",{get:function(){return 0!=(this._flags&a.FLAGS.RIGHT_DOWN)},set:function(b){this._doSet(a.FLAGS.RIGHT_DOWN,b)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"leftDown",{get:function(){return 0!=(this._flags&a.FLAGS.LEFT_DOWN)},set:function(b){this._doSet(a.FLAGS.LEFT_DOWN,b)},enumerable:!1,configurable:!0}),a.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),a}(),hr=function(){function a(){this._tempPoint=new g}return a.prototype.recursiveFindHit=function(c,a,h,b,e){var f,g,d,i,l,j,m,k,n,o;if(!a||!a.visible)return!1;if(g=c.data.global,d=!1,i=e=a.interactive||e,l=!0,a.hitArea?(b&&(a.worldTransform.applyInverse(g,this._tempPoint),a.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?d=!0:(b=!1,l=!1)),i=!1):a._mask&&b&&(j=a._mask.isMaskData?a._mask.maskObject:a._mask,j&&!(null===(f=j.containsPoint)||void 0===f?void 0:f.call(j,g))&&(b=!1)),l&&a.interactiveChildren&&a.children)for(m=a.children,k=m.length-1;k>=0;k--)if(n=m[k],o=this.recursiveFindHit(c,n,h,b,i),o){if(!n.parent)continue;i=!1,o&&(c.target&&(b=!1),d=!0)}return e&&(b&&!c.target&&!a.hitArea&&a.containsPoint&&a.containsPoint(g)&&(d=!0),a.interactive&&(d&&!c.target&&(c.target=a),h&&h(c,a,!!d))),d},a.prototype.findHit=function(a,b,c,d){this.recursiveFindHit(a,b,c,d,!1)},a}(),eS={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(a){a?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0},k.mixin(eS),bw={target:null,data:{global:null}},eU=function(c){function b(d,b){var a=c.call(this)||this;return b=b||{},a.renderer=d,a.autoPreventDefault=void 0===b.autoPreventDefault||b.autoPreventDefault,a.interactionFrequency=b.interactionFrequency||10,a.mouse=new cC,a.mouse.identifier=1,a.mouse.global.set(-999999),a.activeInteractionData={},a.activeInteractionData[1]=a.mouse,a.interactionDataPool=[],a.eventData=new eP,a.interactionDOMElement=null,a.moveWhenInside=!1,a.eventsAdded=!1,a.tickerAdded=!1,a.mouseOverRenderer=!("PointerEvent"in globalThis),a.supportsTouchEvents="ontouchstart"in globalThis,a.supportsPointerEvents=!!globalThis.PointerEvent,a.onPointerUp=a.onPointerUp.bind(a),a.processPointerUp=a.processPointerUp.bind(a),a.onPointerCancel=a.onPointerCancel.bind(a),a.processPointerCancel=a.processPointerCancel.bind(a),a.onPointerDown=a.onPointerDown.bind(a),a.processPointerDown=a.processPointerDown.bind(a),a.onPointerMove=a.onPointerMove.bind(a),a.processPointerMove=a.processPointerMove.bind(a),a.onPointerOut=a.onPointerOut.bind(a),a.processPointerOverOut=a.processPointerOverOut.bind(a),a.onPointerOver=a.onPointerOver.bind(a),a.cursorStyles={default:"inherit",pointer:"pointer"},a.currentCursorMode=null,a.cursor=null,a.resolution=1,a.delayedEvents=[],a.search=new hr,a._tempDisplayObject=new ca,a._eventListenerOptions={capture:!0,passive:!1},a._useSystemTicker=void 0===b.useSystemTicker||b.useSystemTicker,a.setTargetElement(a.renderer.view,a.renderer.resolution),a}return function(b,a){function c(){this.constructor=b}cr(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(b,c),Object.defineProperty(b.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(a){this._useSystemTicker=a,a?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),b.prototype.hitTest=function(b,a){return bw.target=null,bw.data.global=b,a||(a=this.lastObjectRendered),this.processInteractive(bw,a,null,!0),bw.target},b.prototype.setTargetElement=function(b,a){void 0===a&&(a=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=b,this.resolution=a,this.addEvents(),this.addTickerListener()},b.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(o.system.add(this.tickerUpdate,this,a.UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)},b.prototype.removeTickerListener=function(){this.tickerAdded&&(o.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},b.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var a=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(a.msContentZooming="none",a.msTouchAction="none"):this.supportsPointerEvents&&(a.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},b.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var a=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(a.msContentZooming="",a.msTouchAction=""):this.supportsPointerEvents&&(a.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},b.prototype.tickerUpdate=function(a){this._deltaTime+=a,this._deltaTime0&&(h=b.composedPath()[0]);for(d=h!==this.interactionDOMElement?"outside":"",f=0;f0||b.responseType===a.XHR_RESPONSE_TYPE.BUFFER)?d=200:1223===d&&(d=204),2==(d/100|0)){if(this.xhrType===a.XHR_RESPONSE_TYPE.TEXT)this.data=c,this.type=a.TYPE.TEXT;else if(this.xhrType===a.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(c),this.type=a.TYPE.JSON}catch(a){return void this.abort("Error trying to parse loaded json: "+a)}else if(this.xhrType===a.XHR_RESPONSE_TYPE.DOCUMENT)try{globalThis.DOMParser?(f=new DOMParser,this.data=f.parseFromString(c,"text/xml")):(e=document.createElement("div"),e.innerHTML=c,this.data=e),this.type=a.TYPE.XML}catch(a){return void this.abort("Error trying to parse loaded xml: "+a)}else this.data=b.response||c;this.complete()}else this.abort("["+b.status+"] "+b.statusText+": "+b.responseURL)},a.prototype._determineCrossOrigin=function(c,a){if(0===c.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";a=a||globalThis.location,bh||(bh=document.createElement("a")),bh.href=c;var b=e$(bh.href,{strictMode:!0}),d=!b.port&&""===a.port||b.port===a.port,e=b.protocol?b.protocol+":":"";return b.host===a.hostname&&d&&e===a.protocol?"":"anonymous"},a.prototype._determineXhrType=function(){return a._xhrTypeMap[this.extension]||a.XHR_RESPONSE_TYPE.TEXT},a.prototype._determineLoadType=function(){return a._loadTypeMap[this.extension]||a.LOAD_TYPE.XHR},a.prototype._getExtension=function(a){var b,c,d,e,f;return void 0===a&&(a=this.url),b="",this.isDataUrl?(c=a.indexOf("/"),b=a.substring(c+1,a.indexOf(";",c))):(d=a.indexOf("?"),e=a.indexOf("#"),f=Math.min(d>-1?d:a.length,e>-1?e:a.length),b=(a=a.substring(0,f)).substring(a.lastIndexOf(".")+1)),b.toLowerCase()},a.prototype._getMimeFromXhrType=function(b){switch(b){case a.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case a.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case a.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case a.XHR_RESPONSE_TYPE.JSON:return"application/json";case a.XHR_RESPONSE_TYPE.DEFAULT:case a.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},a}(),function(a){var c,b,d,e;(c=a.STATUS_FLAGS||(a.STATUS_FLAGS={}))[c.NONE=0]="NONE",c[c.DATA_URL=1]="DATA_URL",c[c.COMPLETE=2]="COMPLETE",c[c.LOADING=4]="LOADING",(b=a.TYPE||(a.TYPE={}))[b.UNKNOWN=0]="UNKNOWN",b[b.JSON=1]="JSON",b[b.XML=2]="XML",b[b.IMAGE=3]="IMAGE",b[b.AUDIO=4]="AUDIO",b[b.VIDEO=5]="VIDEO",b[b.TEXT=6]="TEXT",(d=a.LOAD_TYPE||(a.LOAD_TYPE={}))[d.XHR=1]="XHR",d[d.IMAGE=2]="IMAGE",d[d.AUDIO=3]="AUDIO",d[d.VIDEO=4]="VIDEO",(e=a.XHR_RESPONSE_TYPE||(a.XHR_RESPONSE_TYPE={})).DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text",a._loadTypeMap={gif:a.LOAD_TYPE.IMAGE,png:a.LOAD_TYPE.IMAGE,bmp:a.LOAD_TYPE.IMAGE,jpg:a.LOAD_TYPE.IMAGE,jpeg:a.LOAD_TYPE.IMAGE,tif:a.LOAD_TYPE.IMAGE,tiff:a.LOAD_TYPE.IMAGE,webp:a.LOAD_TYPE.IMAGE,tga:a.LOAD_TYPE.IMAGE,avif:a.LOAD_TYPE.IMAGE,svg:a.LOAD_TYPE.IMAGE,"svg+xml":a.LOAD_TYPE.IMAGE,mp3:a.LOAD_TYPE.AUDIO,ogg:a.LOAD_TYPE.AUDIO,wav:a.LOAD_TYPE.AUDIO,mp4:a.LOAD_TYPE.VIDEO,webm:a.LOAD_TYPE.VIDEO},a._xhrTypeMap={xhtml:a.XHR_RESPONSE_TYPE.DOCUMENT,html:a.XHR_RESPONSE_TYPE.DOCUMENT,htm:a.XHR_RESPONSE_TYPE.DOCUMENT,xml:a.XHR_RESPONSE_TYPE.DOCUMENT,tmx:a.XHR_RESPONSE_TYPE.DOCUMENT,svg:a.XHR_RESPONSE_TYPE.DOCUMENT,tsx:a.XHR_RESPONSE_TYPE.DOCUMENT,gif:a.XHR_RESPONSE_TYPE.BLOB,png:a.XHR_RESPONSE_TYPE.BLOB,bmp:a.XHR_RESPONSE_TYPE.BLOB,jpg:a.XHR_RESPONSE_TYPE.BLOB,jpeg:a.XHR_RESPONSE_TYPE.BLOB,tif:a.XHR_RESPONSE_TYPE.BLOB,tiff:a.XHR_RESPONSE_TYPE.BLOB,webp:a.XHR_RESPONSE_TYPE.BLOB,tga:a.XHR_RESPONSE_TYPE.BLOB,avif:a.XHR_RESPONSE_TYPE.BLOB,json:a.XHR_RESPONSE_TYPE.JSON,text:a.XHR_RESPONSE_TYPE.TEXT,txt:a.XHR_RESPONSE_TYPE.TEXT,ttf:a.XHR_RESPONSE_TYPE.BUFFER,otf:a.XHR_RESPONSE_TYPE.BUFFER},a.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(a.LoaderResource||(a.LoaderResource={})),ho=function(a,b){this.data=a,this.callback=b},bE=function(){function a(c,b){var a=this;if(void 0===b&&(b=1),this.workers=0,this.saturated=Q,this.unsaturated=Q,this.empty=Q,this.drain=Q,this.error=Q,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(c,e,b){if(b&&"function"!=typeof b)throw new Error("task callback must be a function");if(a.started=!0,null==c&&a.idle())setTimeout(function(){return a.drain()},1);else{var d=new ho(c,"function"==typeof b?b:Q);e?a._tasks.unshift(d):a._tasks.push(d),setTimeout(a.process,1)}},this.process=function(){for(;!a.paused&&a.workers>2,b[1]=(3&a[0])<<4|a[1]>>4,b[2]=(15&a[1])<<2|a[2]>>6,b[3]=63&a[2],e-(d.length-1)){case 2:b[3]=64,b[2]=64;break;case 1:b[3]=64}for(c=0;c0&&a[a.length-1])||6!==d[0]&&2!==d[0])){b=0;continue}if(3===d[0]&&(!a||d[1]>a[0]&&d[1]=33776&&a<=33779)return"s3tc";if(a>=37488&&a<=37497)return"etc";if(a>=35840&&a<=35843)return"pvrtc";if(a>=36196)return"etc1";if(a>=35986&&a<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},a._createLevelBuffers=function(m,l,c,d,e,o,n){for(var j=new Array(c),k=m.byteOffset,a=o,f=n,i=a+d-1&~(d-1),h=f+e-1&~(e-1),g=i*h*av[l],b=0;b1?a:i,levelHeight:c>1?f:h,levelBuffer:new Uint8Array(m.buffer,k,g)},k+=g,g=(i=(a=a>>1||1)+d-1&~(d-1))*(h=(f=f>>1||1)+e-1&~(e-1))*av[l];return j},a}(fu),fw=function(){function c(){}return c.use=function(b,f){var d=b.data,h,e,i,g,m,k,l,j,n,o,p;if(b.type===a.LoaderResource.TYPE.JSON&&d&&d.cacheID&&d.textures){for(h=d.textures,e=void 0,i=void 0,g=0,m=h.length;g>>=1,l>>>=1;s=148;for(c=0;cf-c){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(a=0;a1||0!==c?l:z,levelHeight:g>1||0!==c?p:A,levelBuffer:new Uint8Array(F,w,m)},w+=m;e=(e+=D+4)%4!=0?e+4-e%4:e,m=(z=(l=l>>1||1)+4-1&-4)*(A=(p=p>>1||1)+4-1&-4)*q}return 0!==c?{uncompressed:k.map(function(b){var d=b[0].levelBuffer,e=!1;return c===a.TYPES.FLOAT?d=new Float32Array(b[0].levelBuffer.buffer,b[0].levelBuffer.byteOffset,b[0].levelBuffer.byteLength/4):c===a.TYPES.UNSIGNED_INT?(e=!0,d=new Uint32Array(b[0].levelBuffer.buffer,b[0].levelBuffer.byteOffset,b[0].levelBuffer.byteLength/4)):c===a.TYPES.INT&&(e=!0,d=new Int32Array(b[0].levelBuffer.buffer,b[0].levelBuffer.byteOffset,b[0].levelBuffer.byteLength/4)),{resource:new S(d,{width:b[0].levelWidth,height:b[0].levelHeight}),type:c,format:e?he(r):r}}),kvData:v}:{compressed:k.map(function(a){return new bk(null,{format:y,width:j,height:f,levels:g,levelBuffers:a})}),kvData:v}}function he(b){switch(b){case a.FORMATS.RGBA:return a.FORMATS.RGBA_INTEGER;case a.FORMATS.RGB:return a.FORMATS.RGB_INTEGER;case a.FORMATS.RG:return a.FORMATS.RG_INTEGER;case a.FORMATS.RED:return a.FORMATS.RED_INTEGER;default:return b}}a.LoaderResource.setExtensionXhrType("dds",a.LoaderResource.XHR_RESPONSE_TYPE.BUFFER),fM=function(){function b(){}return b.use=function(a,b){if("dds"===a.extension&&a.data)try{Object.assign(a,fx(a.name||a.url,fF(a.data),a.metadata))}catch(a){return void b(a)}b()},b.extension=a.ExtensionType.Loader,b}(),a.LoaderResource.setExtensionXhrType("ktx",a.LoaderResource.XHR_RESPONSE_TYPE.BUFFER),fN=function(){function b(){}return b.use=function(b,l){var d,h,j,k,g,f,m,i;if("ktx"===b.extension&&b.data)try{if(d=b.name||b.url,h=fK(0,b.data,this.loadKeyValueData),j=h.compressed,k=h.uncompressed,g=h.kvData,j){if(f=fx(d,j,b.metadata),g&&f.textures)for(m in f.textures)f.textures[m].baseTexture.ktxKeyValueData=g;Object.assign(b,f)}else k&&(i={},k.forEach(function(f,j){var b=new c(new e(f.resource,{mipmap:a.MIPMAP_MODES.OFF,alphaMode:a.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),h=d+"-"+(j+1);g&&(b.baseTexture.ktxKeyValueData=g),e.addToCache(b.baseTexture,h),c.addToCache(b,h),0===j&&(i[d]=b,e.addToCache(b.baseTexture,d),c.addToCache(b,d)),i[h]=b}),Object.assign(b,{textures:i}))}catch(a){return void l(a)}l()},b.extension=a.ExtensionType.Loader,b.loadKeyValueData=!1,b}(),bV=function(a,b){return bV=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},bV(a,b)};function fP(b,a){function c(){this.constructor=b}bV(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}hd=function(c){function b(e,g,d,f){void 0===e&&(e=1500),void 0===d&&(d=16384),void 0===f&&(f=!1);var b=c.call(this)||this;return d>16384&&(d=16384),b._properties=[!1,!0,!1,!1,!1],b._maxSize=e,b._batchSize=d,b._buffers=null,b._bufferUpdateIDs=[],b._updateID=0,b.interactiveChildren=!1,b.blendMode=a.BLEND_MODES.NORMAL,b.autoResize=f,b.roundPixels=!0,b.baseTexture=null,b.setProperties(g),b._tint=0,b.tintRgb=new Float32Array(4),b.tint=16777215,b}return fP(b,c),b.prototype.setProperties=function(a){a&&(this._properties[0]="vertices"in a||"scale"in a?!!a.vertices||!!a.scale:this._properties[0],this._properties[1]="position"in a?!!a.position:this._properties[1],this._properties[2]="rotation"in a?!!a.rotation:this._properties[2],this._properties[3]="uvs"in a?!!a.uvs:this._properties[3],this._properties[4]="tint"in a||"alpha"in a?!!a.tint||!!a.alpha:this._properties[4])},b.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(b.prototype,"tint",{get:function(){return this._tint},set:function(a){this._tint=a,T(a,this.tintRgb)},enumerable:!1,configurable:!0}),b.prototype.render=function(a){var b=this;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",function(){return b.onChildrenChange(0)})),a.batch.setObjectRenderer(a.plugins.particle),a.plugins.particle.render(this))},b.prototype.onChildrenChange=function(b){for(var a=Math.floor(b/this._batchSize);this._bufferUpdateIDs.lengthp&&!a.autoResize&&(d=p),e=a._buffers,e||(e=a._buffers=this.generateBuffers(a)),o=h[0]._texture.baseTexture,l=o.alphaMode>0,this.state.blendMode=bM(a.blendMode,l),g.state.set(this.state),k=g.gl,n=a.worldTransform.copyTo(this.tempMatrix),n.prepend(g.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=n.toArray(!0),this.shader.uniforms.uColor=fz(a.tintRgb,a.worldAlpha,this.shader.uniforms.uColor,l),this.shader.uniforms.uSampler=o,this.renderer.shader.bind(this.shader);for(m=!1,b=0,i=0;bj&&(c=j),i>=e.length&&e.push(this._generateOneMoreBuffer(a)),f=e[i],f.uploadDynamic(h,b,c),q=a._bufferUpdateIDs[i]||0,(m=m||f._updateID0,g=b.alpha,e=g<1&&k?bg(b._tintRGB,g):b._tintRGB+(255*g<<24),c[a]=e,c[a+d]=e,c[a+2*d]=e,c[a+3*d]=e,a+=4*d},b.prototype.destroy=function(){c.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},b.extension={name:"particle",type:a.ExtensionType.RendererPlugin},b}(aF),a.LINE_JOIN=void 0,a.LINE_CAP=void 0,function(a){a.MITER="miter",a.BEVEL="bevel",a.ROUND="round"}(a.LINE_JOIN||(a.LINE_JOIN={})),function(a){a.BUTT="butt",a.ROUND="round",a.SQUARE="square"}(a.LINE_CAP||(a.LINE_CAP={})),ac={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(b,c){if(void 0===c&&(c=20),!this.adaptive||!b||isNaN(b))return c;var a=Math.ceil(b/this.maxLength);return athis.maxSegments&&(a=this.maxSegments),a}},dE=function(){function a(){this.color=16777215,this.alpha=1,this.texture=c.WHITE,this.matrix=null,this.visible=!1,this.reset()}return a.prototype.clone=function(){var b=new a;return b.color=this.color,b.alpha=this.alpha,b.texture=this.texture,b.matrix=this.matrix,b.visible=this.visible,b},a.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=c.WHITE,this.matrix=null,this.visible=!1},a.prototype.destroy=function(){this.texture=null,this.matrix=null},a}(),bY=function(a,b){return bY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},bY(a,b)};function bC(b,a){function c(){this.constructor=b}bY(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function fX(a,d){var e,f,c,g,b,i,h,j,k,l,m,n,o,p;if(void 0===d&&(d=!1),c=a.length,!(c<6)){for(g=0,b=0,i=a[c-2],h=a[c-1];b0||d&&g<=0){l=c/2;for(b=l+l%2;b=6){fX(b,!1);for(g=[],a=0;a=0&&i>=0&&c>=0&&e>=0){if(t=Math.ceil(2.3*Math.sqrt(n+i)),w=8*t+(c?4:0)+(e?4:0),b.length=w,0!==w){if(0===t)return b.length=8,b[0]=b[6]=f+c,b[1]=b[3]=d+e,b[2]=b[4]=f-c,void(b[5]=b[7]=d-e);m=0,s=4*t+(c?2:0)+2,u=s,h=w,l=f+(p=c+n),g=f-p,k=d+(q=e),(b[m++]=l,b[m++]=k,b[--s]=k,b[--s]=g,e)&&(j=d-q,b[u++]=g,b[u++]=j,b[--h]=j,b[--h]=l);for(A=1;Ah&&(h+=2*Math.PI),j=g,s=h-g,t=Math.abs(s),e=Math.sqrt(m*m+l*l),i=1+(15*t*Math.sqrt(e)/Math.PI>>0),o=s/i,j+=o,n){a.push(c,b),a.push(k,p);for(f=1,d=j;f=0&&(p.join===a.LINE_JOIN.ROUND?q+=aa(b,c,b-h*e,c-i*e,b-l*e,c-k*e,d,!1)+4:q+=2,d.push(b-l*f,c-k*f),d.push(b+l*e,c+k*e))):(Q=(-h+o)*(-i+c)-(-h+b)*(-i+n),S=(-l+y)*(-k+c)-(-l+b)*(-k+x),H=(D*S-B*Q)/J,G=(A*Q-C*S)/J,L=(H-b)*(H-b)+(G-c)*(G-c),t=b+(H-b)*e,w=c+(G-c)*e,v=b-(H-b)*f,u=c-(G-c)*f,T=F?e:f,L<=Math.min(D*D+C*C,B*B+A*A)+T*T*O?p.join===a.LINE_JOIN.BEVEL||L/O>Y?(F?(d.push(t,w),d.push(b+h*f,c+i*f),d.push(t,w),d.push(b+l*f,c+k*f)):(d.push(b-h*e,c-i*e),d.push(v,u),d.push(b-l*e,c-k*e),d.push(v,u)),q+=2):p.join===a.LINE_JOIN.ROUND?F?(d.push(t,w),d.push(b+h*f,c+i*f),q+=aa(b,c,b+h*f,c+i*f,b+l*f,c+k*f,d,!0)+4,d.push(t,w),d.push(b+l*f,c+k*f)):(d.push(b-h*e,c-i*e),d.push(v,u),q+=aa(b,c,b-h*e,c-i*e,b-l*e,c-k*e,d,!1)+4,d.push(b-l*e,c-k*e),d.push(v,u)):(d.push(t,w),d.push(v,u)):(d.push(b-h*e,c-i*e),d.push(b+h*f,c+i*f),p.join===a.LINE_JOIN.ROUND?q+=F?aa(b,c,b+h*f,c+i*f,b+l*f,c+k*f,d,!0)+2:aa(b,c,b-h*e,c-i*e,b-l*e,c-k*e,d,!1)+2:p.join===a.LINE_JOIN.MITER&&L/O<=Y&&(F?(d.push(v,u),d.push(v,u)):(d.push(t,w),d.push(t,w)),q+=2),d.push(b-l*e,c-k*e),d.push(b+l*f,c+k*f),q+=2));o=j[2*(E-2)],n=j[2*(E-2)+1],b=j[2*(E-1)],h=-(n-(c=j[2*(E-1)+1])),i=o-b,h/=s=Math.sqrt(h*h+i*i),i/=s,h*=r,i*=r,d.push(b-h*e,c-i*e),d.push(b+h*f,c+i*f),P||(p.cap===a.LINE_CAP.ROUND?q+=aa(b-h*(e-f)*.5,c-i*(e-f)*.5,b-h*e,c-i*e,b+h*f,c+i*f,d,!1)+2:p.cap===a.LINE_CAP.SQUARE&&(q+=gc(b,c,h,i,e,f,!1,d))),ab=M.indices,_=ac.epsilon*ac.epsilon;for(m=W;md*c})},a.arc=function(u,t,r,q,c,h,o,s,n){for(var e=o-h,k=ac._segmentsCount(Math.abs(e)*c,40*Math.ceil(Math.abs(e)/aA)),a=e/(2*k),m=2*a,j=Math.cos(a),i=Math.sin(a),d=k-1,p=d%1/d,b=0,g,f,l;b<=d;++b)g=a+h+m*(b+p*b),f=Math.cos(g),l=-Math.sin(g),n.push((j*f+i*l)*c+r,(j*-l+i*f)*c+q)},a}(),gh=function(){function a(){}return a.curveLength=function(p,m,u,t,s,r,q,v){for(var i=0,a=0,d=0,o=0,b=0,g=0,n=0,h=0,j=0,f=0,e=0,k=p,l=m,c=1;c<=10;++c)f=k-(h=(n=(g=(b=1-(a=c/10))*b)*b)*p+3*g*a*u+3*b*(d=a*a)*s+(o=d*a)*q),e=l-(j=n*m+3*g*a*t+3*b*d*r+o*v),k=h,l=j,i+=Math.sqrt(f*f+e*e);return i},a.curveTo=function(r,q,p,o,n,m,b){var i=b[b.length-2],k=b[b.length-1],l,d,h,g,f,j,e,c;b.length-=2,l=ac._segmentsCount(a.curveLength(i,k,r,q,p,o,n,m)),d=0,h=0,g=0,f=0,j=0,b.push(i,k);for(e=1,c=0;e<=l;++e)g=(h=(d=1-(c=e/l))*d)*d,j=(f=c*c)*c,b.push(g*i+3*h*c*r+3*d*f*p+j*n,g*k+3*h*c*q+3*d*f*o+j*m)},a}(),gi=function(){function a(){}return a.curveLength=function(j,o,n,m,r,q){var g=j-2*n+r,h=o-2*m+q,i=2*n-2*j,d=2*m-2*o,c=4*(g*g+h*h),a=4*(g*i+h*d),f=i*i+d*d,e=2*Math.sqrt(c+a+f),b=Math.sqrt(c),k=2*c*b,l=2*Math.sqrt(f),p=a/b;return(k*e+b*a*(e-l)+(4*f*c-a*a)*Math.log((2*b+p+e)/(p+l)))/(4*k)},a.curveTo=function(d,e,l,m,c){for(var j=c[c.length-2],h=c[c.length-1],k=ac._segmentsCount(a.curveLength(j,h,d,e,l,m)),f=0,g=0,i=1,b;i<=k;++i)b=i/k,f=j+(d-j)*b,g=h+(e-h)*b,c.push(f+(d+(l-d)*b-f)*b,g+(e+(m-e)*b-g)*b)},a}(),gj=function(){function a(){this.reset()}return a.prototype.begin=function(a,b,c){this.reset(),this.style=a,this.start=b,this.attribStart=c},a.prototype.end=function(a,b){this.attribSize=b-this.attribStart,this.size=a-this.start},a.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},a}(),bt=((aj={})[a.SHAPES.POLY]=b$,aj[a.SHAPES.CIRC]=aL,aj[a.SHAPES.ELIP]=aL,aj[a.SHAPES.RECT]=f_,aj[a.SHAPES.RREC]=gb,aj),cf=[],ay=[],cg=function(){function a(d,a,b,c){void 0===a&&(a=null),void 0===b&&(b=null),void 0===c&&(c=null),this.points=[],this.holes=[],this.shape=d,this.lineStyle=b,this.fillStyle=a,this.matrix=c,this.type=d.type}return a.prototype.clone=function(){return new a(this.shape,this.fillStyle,this.lineStyle,this.matrix)},a.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},a}(),am=new g,dF=function(c){function b(){var a=c.call(this)||this;return a.closePointEps=1e-4,a.boundsPadding=0,a.uvsFloat32=null,a.indicesUint16=null,a.batchable=!1,a.points=[],a.colors=[],a.uvs=[],a.indices=[],a.textureIds=[],a.graphicsData=[],a.drawCalls=[],a.batchDirty=-1,a.batches=[],a.dirty=0,a.cacheDirty=-1,a.clearDirty=0,a.shapeIndex=0,a._bounds=new aO,a.boundsDirty=-1,a}return bC(b,c),Object.defineProperty(b.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),b.prototype.invalidate=function(){var a,b;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(a=0;a0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},b.prototype.drawShape=function(d,a,b,c){void 0===a&&(a=null),void 0===b&&(b=null),void 0===c&&(c=null);var e=new cg(d,a,b,c);return this.graphicsData.push(e),this.dirty++,this},b.prototype.drawHole=function(d,a){if(void 0===a&&(a=null),!this.graphicsData.length)return null;var b=new cg(d,null,null,a),c=this.graphicsData[this.graphicsData.length-1];return b.lineStyle=c.lineStyle,c.holes.push(b),this.dirty++,this},b.prototype.destroy=function(){c.prototype.destroy.call(this);for(var a=0;a0&&(g=(c=this.batches[this.batches.length-1]).style);for(h=this.shapeIndex;h65535,this.indicesUint16&&this.indices.length===this.indicesUint16.length&&i===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=i?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()):this.batchable=!0}}else this.batchable=!0},b.prototype._compareStyles=function(a,b){return!(!a||!b)&&a.texture.baseTexture===b.texture.baseTexture&&a.color+a.alpha===b.color+b.alpha&&!!a.native==!!b.native},b.prototype.validateBatching=function(){var a,e,b,c,d;if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(a=0,e=this.graphicsData.length;a131070)return!1;for(var c=this.batches,a=0;a0&&((b=ay.pop())||((b=new bb).texArray=new aY),this.drawCalls.push(b)),b.start=m,b.size=0,b.texArray.count=0,b.type=l),c.touched=1,c._batchEnabled=i,c._batchLocation=h,c.wrapMode=a.WRAP_MODES.REPEAT,b.texArray.elements[b.texArray.count++]=c,h++)),b.size+=f.size,m+=f.size,n=c._batchLocation,this.addColors(p,g.color,g.alpha,f.attribSize,f.attribStart),this.addTextureIds(o,n,f.attribSize,f.attribStart);e._globalBatch=i,this.packAttributes()},b.prototype.packAttributes=function(){for(var d=this.points,f=this.uvs,i=this.colors,g=this.textureIds,e=new ArrayBuffer(3*d.length*4),c=new Float32Array(e),h=new Uint32Array(e),b=0,a=0;a>16)+(65280&c)+((255&c)<<16),g),d.length=Math.max(d.length,b+e);for(a=0;a0&&b.alpha>0;return d?(b.matrix&&(b.matrix=b.matrix.clone(),b.matrix.invert()),Object.assign(this._lineStyle,{visible:d},b)):this._lineStyle.reset(),this},b.prototype.startPoly=function(){if(this.currentPath){var b=this.currentPath.points,a=this.currentPath.points.length;a>2&&(this.drawShape(this.currentPath),this.currentPath=new aG,this.currentPath.closeStroke=!1,this.currentPath.points.push(b[a-2],b[a-1]))}else this.currentPath=new aG,this.currentPath.closeStroke=!1},b.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},b.prototype.moveTo=function(a,b){return this.startPoly(),this.currentPath.points[0]=a,this.currentPath.points[1]=b,this},b.prototype.lineTo=function(b,c){this.currentPath||this.moveTo(0,0);var a=this.currentPath.points,d=a[a.length-2],e=a[a.length-1];return d===b&&e===c||a.push(b,c),this},b.prototype._initCurve=function(a,b){void 0===a&&(a=0),void 0===b&&(b=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[a,b]):this.moveTo(a,b)},b.prototype.quadraticCurveTo=function(b,c,d,e){this._initCurve();var a=this.currentPath.points;return 0===a.length&&this.moveTo(0,0),gi.curveTo(b,c,d,e,a),this},b.prototype.bezierCurveTo=function(a,b,c,d,e,f){return this._initCurve(),gh.curveTo(a,b,c,d,e,f,this.currentPath.points),this},b.prototype.arcTo=function(b,g,m,l,k){var f,a,h,i,e,d,c,j;return this._initCurve(b,g),f=this.currentPath.points,a=cd.curveTo(b,g,m,l,k,f),a&&(h=a.cx,i=a.cy,e=a.radius,d=a.startAngle,c=a.endAngle,j=a.anticlockwise,this.arc(h,i,e,d,c,j)),this},b.prototype.arc=function(i,j,g,b,c,f){var d,e,h,a,k,l;return void 0===f&&(f=!1),b===c?this:(!f&&c<=b?c+=aA:f&&b<=c&&(b+=aA),0==c-b)?this:(d=i+Math.cos(b)*g,e=j+Math.sin(b)*g,h=this._geometry.closePointEps,a=this.currentPath?this.currentPath.points:null,a?(k=Math.abs(a[a.length-2]-d),l=Math.abs(a[a.length-1]-e),k0;return b?(a.matrix&&(a.matrix=a.matrix.clone(),a.matrix.invert()),Object.assign(this._fillStyle,{visible:b},a)):this._fillStyle.reset(),this},b.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},b.prototype.drawRect=function(a,b,c,e){return this.drawShape(new d(a,b,c,e))},b.prototype.drawRoundedRect=function(a,b,c,d,e){return this.drawShape(new e_(a,b,c,d,e))},b.prototype.drawCircle=function(a,b,c){return this.drawShape(new fd(a,b,c))},b.prototype.drawEllipse=function(a,b,c,d){return this.drawShape(new fa(a,b,c,d))},b.prototype.drawPolygon=function(){for(var c,g=arguments,a=[],b=0,e,d,f;b>16&255)/255*c,b.tint[1]=(f>>8&255)/255*c,b.tint[2]=(255&f)/255*c,b.tint[3]=c,a.shader.bind(d),a.geometry.bind(e,d),a.state.set(this.state);for(g=0,i=h.length;g>16)+(65280&d)+((255&d)<<16)}},b.prototype.calculateVertices=function(){var g=this.transform._worldID,a,m,l,k,j,i,n,c,f,e,b,d,h;if(this._transformID!==g){this._transformID=g;for(a=this.transform.worldTransform,m=a.a,l=a.b,k=a.c,j=a.d,i=a.tx,n=a.ty,c=this._geometry.points,f=this.vertexData,e=0,b=0;b=d&&aw.x=a&&aw.y>16)+(65280&a)+((255&a)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(a){this._texture!==a&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=a||c.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,a&&(a.baseTexture.valid?this._onTextureUpdate():a.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(u),a.TEXT_GRADIENT=void 0,cp=function(a,b){return cp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cp(a,b)},!function(a){a[a.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",a[a.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(a.TEXT_GRADIENT||(a.TEXT_GRADIENT={})),cq={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:a.TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},gB=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],X=function(){function a(a){this.styleID=0,this.reset(),cv(this,a,a)}return a.prototype.clone=function(){var b={};return cv(b,this,cq),new a(b)},a.prototype.reset=function(){cv(this,cq,cq)},Object.defineProperty(a.prototype,"align",{get:function(){return this._align},set:function(a){this._align!==a&&(this._align=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"breakWords",{get:function(){return this._breakWords},set:function(a){this._breakWords!==a&&(this._breakWords=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(a){this._dropShadow!==a&&(this._dropShadow=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(a){this._dropShadowAlpha!==a&&(this._dropShadowAlpha=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(a){this._dropShadowAngle!==a&&(this._dropShadowAngle=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(a){this._dropShadowBlur!==a&&(this._dropShadowBlur=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(b){var a=ct(b);this._dropShadowColor!==a&&(this._dropShadowColor=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(a){this._dropShadowDistance!==a&&(this._dropShadowDistance=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fill",{get:function(){return this._fill},set:function(b){var a=ct(b);this._fill!==a&&(this._fill=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(a){this._fillGradientType!==a&&(this._fillGradientType=a,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(a){(function(a,c){if(!Array.isArray(a)||!Array.isArray(c))return!1;if(a.length!==c.length)return!1;for(var b=0;b=0;c--)b=a[c].trim(),!/([\"\'])[^\'\"]+\1/.test(b)&&gB.indexOf(b)<0&&(b='"'+b+'"'),a[c]=b;return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+d+" "+a.join(",")},a}();function gg(a){return"number"==typeof a?bP(a):("string"==typeof a&&0===a.indexOf("0x")&&(a=a.replace("0x","#")),a)}function ct(a){if(Array.isArray(a)){for(var b=0;bo)if(""!==b&&(f+=a.addLine(b),b="",d=0),a.canBreakWords(c,k.breakWords))for(i=a.wordWrapSplit(c),e=0;eo&&(f+=a.addLine(b),h=!1,b="",d=0),b+=g,d+=w}else b.length>0&&(f+=a.addLine(b),b="",d=0),x=j===p.length-1,f+=a.addLine(c,!x),h=!1,b="",d=0;else q+d>o&&(h=!1,f+=a.addLine(b),b="",d=0),(b.length>0||!a.isBreakingSpace(c)||h)&&(b+=c,d+=q)}return f+a.addLine(b,!1)},a.addLine=function(b,c){return void 0===c&&(c=!0),b=a.trimRight(b),c?b+"\n":b},a.getFromCache=function(a,d,c,e){var b=c[a],f;return"number"!=typeof b&&(f=a.length*d,b=e.measureText(a).width+f,c[a]=b),b},a.collapseSpaces=function(a){return"normal"===a||"pre-line"===a},a.collapseNewlines=function(a){return"normal"===a},a.trimRight=function(b){var c,d;if("string"!=typeof b)return"";for(c=b.length-1;c>=0;c--){if(d=b[c],!a.isBreakingSpace(d))break;b=b.slice(0,-1)}return b},a.isNewline=function(b){return"string"==typeof b&&a._newlines.indexOf(b.charCodeAt(0))>=0},a.isBreakingSpace=function(b,c){return"string"==typeof b&&a._breakingSpaces.indexOf(b.charCodeAt(0))>=0},a.tokenize=function(d){var c=[],b="",e,f,g;if("string"!=typeof d)return c;for(e=0;ec;--d){for(f=0;f0&&r>k&&(p=(k+r)/2),n=k+q,t=l.lineHeight*(b+1),u=n,b+10},a}();function gM(a,d){var e=!1,b,f;if(a&&a._textures&&a._textures.length)for(b=0;b=0;a--)this.add(b.children[a]);return this},c.prototype.destroy=function(){this.ticking&&o.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},c}();function gd(b,a){return a instanceof e&&(a._glTextures[b.CONTEXT_UID]||b.texture.bind(a),!0)}function gV(d,b){var a,e,c,f;if(!(b instanceof ar))return!1;a=b.geometry,b.finishPoly(),a.updateBatches();for(e=a.batches,c=0;c=c&&aN.x=d&&aN.y1?D.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",a):D.from(fQ,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",a)},b.prototype.render=function(b){var h=this.renderer,k=this.quad,c=k.vertices,q,n,f,e,r,g,i,j,d,o,p,l,m;c[0]=c[6]=b._width*-b.anchor.x,c[1]=c[3]=b._height*-b.anchor.y,c[2]=c[4]=b._width*(1-b.anchor.x),c[5]=c[7]=b._height*(1-b.anchor.y),q=b.uvRespectAnchor?b.anchor.x:0,n=b.uvRespectAnchor?b.anchor.y:0,(c=k.uvs)[0]=c[6]=-q,c[1]=c[3]=-n,c[2]=c[4]=1-q,c[5]=c[7]=1-n,k.invalidate(),f=b._texture,e=f.baseTexture,r=e.alphaMode>0,g=b.tileTransform.localTransform,i=b.uvMatrix,j=e.isPowerOfTwo&&f.frame.width===e.width&&f.frame.height===e.height,j&&(e._glTextures[h.CONTEXT_UID]?j=e.wrapMode!==a.WRAP_MODES.CLAMP:e.wrapMode===a.WRAP_MODES.CLAMP&&(e.wrapMode=a.WRAP_MODES.REPEAT)),d=j?this.simpleShader:this.shader,o=f.width,p=f.height,l=b._width,m=b._height,aU.set(g.a*o/l,g.b*o/m,g.c*p/l,g.d*p/m,g.tx/l,g.ty/m),aU.invert(),j?aU.prepend(i.mapCoord):(d.uniforms.uMapCoord=i.mapCoord.toArray(!0),d.uniforms.uClampFrame=i.uClampFrame,d.uniforms.uClampOffset=i.uClampOffset),d.uniforms.uTransform=aU.toArray(!0),d.uniforms.uColor=bK(b.tint,b.worldAlpha,d.uniforms.uColor,r),d.uniforms.translationMatrix=b.transform.worldTransform.toArray(!0),d.uniforms.uSampler=f,h.shader.bind(d),h.geometry.bind(k),this.state.blendMode=bM(b.blendMode,r),h.state.set(this.state),h.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},b.extension={name:"tilingSprite",type:a.ExtensionType.RendererPlugin},b}(aF),cN=function(a,b){return cN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cN(a,b)};function cO(b,a){function c(){this.constructor=b}cN(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}fv=function(){function a(a,b){this.uvBuffer=a,this.uvMatrix=b,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return a.prototype.update=function(b){if(b||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var a=this.uvBuffer.data;this.data&&this.data.length===a.length||(this.data=new Float32Array(a.length)),this.uvMatrix.multiplyUvs(a,this.data),this._updateID++}},a}(),cP=new g,fo=new aG,ah=function(d){function c(f,g,h,e){void 0===e&&(e=a.DRAW_MODES.TRIANGLES);var c=d.call(this)||this;return c.geometry=f,c.shader=g,c.state=h||K.for2d(),c.drawMode=e,c.start=0,c.size=0,c.uvs=null,c.indices=null,c.vertexData=new Float32Array(1),c.vertexDirty=-1,c._transformID=-1,c._roundPixels=b.ROUND_PIXELS,c.batchUvs=null,c}return cO(c,d),Object.defineProperty(c.prototype,"geometry",{get:function(){return this._geometry},set:function(a){this._geometry!==a&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=a,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"material",{get:function(){return this.shader},set:function(a){this.shader=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(a){this.state.blendMode=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(a){this._roundPixels!==a&&(this._transformID=-1),this._roundPixels=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(a){this.shader.tint=a},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(a){this.shader.texture=a},enumerable:!1,configurable:!0}),c.prototype._render=function(b){var d=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===a.DRAW_MODES.TRIANGLES&&d.length<2*c.BATCHABLE_SIZE?this._renderToBatch(b):this._renderDefault(b)},c.prototype._renderDefault=function(b){var a=this.shader;a.alpha=this.worldAlpha,a.update&&a.update(),b.batch.flush(),a.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),b.shader.bind(a),b.state.set(this.state),b.geometry.bind(this.geometry,a),b.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},c.prototype._renderToBatch=function(b){var d=this.geometry,a=this.shader,c;a.uvMatrix&&(a.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=d.indexBuffer.data,this._tintRGB=a._tintRGB,this._texture=a.texture,c=this.material.pluginName,b.batch.setObjectRenderer(b.plugins[c]),b.plugins[c].render(this)},c.prototype.calculateVertices=function(){var i=this.geometry.buffers[0],e=i.data,f=i._updateID,c,o,n,m,p,l,k,d,a,h,g,j;if(f!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(c=this.transform.worldTransform,o=c.a,n=c.b,m=c.c,p=c.d,l=c.tx,k=c.ty,d=this.vertexData,a=0;a>16)+(65280&a)+((255&a)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),a.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var a=this.texture.baseTexture;bK(this._tint,this._alpha,this.uniforms.uColor,a.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},a}(D),aI=function(c){function b(d,e,f){var b=c.call(this)||this,g=new n(d),h=new n(e,!0),i=new n(f,!0,!0);return b.addAttribute("aVertexPosition",g,2,!1,a.TYPES.FLOAT).addAttribute("aTextureCoord",h,2,!1,a.TYPES.FLOAT).addIndex(i),b._updateId=-1,b}return cO(b,c),Object.defineProperty(b.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),b}(an),cQ=function(a,b){return cQ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},cQ(a,b)},aH=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},eX=function(){function a(){}return a.test=function(a){return"string"==typeof a&&0===a.indexOf("info face=")},a.parse=function(n){var c=n.match(/^[a-z]+\s+.+$/gm),b={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]},e,l,g,h,j,i,k,d,f,m,a;for(e in c){l=c[e].match(/^[a-z]+/gm)[0],g=c[e].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(j in g)i=g[j].split("="),k=i[0],d=i[1].replace(/"/gm,""),f=parseFloat(d),m=isNaN(f)?d:f,h[k]=m;b[l].push(h)}return a=new aH,b.info.forEach(function(b){return a.info.push({face:b.face,size:parseInt(b.size,10)})}),b.common.forEach(function(b){return a.common.push({lineHeight:parseInt(b.lineHeight,10)})}),b.page.forEach(function(b){return a.page.push({id:parseInt(b.id,10),file:b.file})}),b.char.forEach(function(b){return a.char.push({id:parseInt(b.id,10),page:parseInt(b.page,10),x:parseInt(b.x,10),y:parseInt(b.y,10),width:parseInt(b.width,10),height:parseInt(b.height,10),xoffset:parseInt(b.xoffset,10),yoffset:parseInt(b.yoffset,10),xadvance:parseInt(b.xadvance,10)})}),b.kerning.forEach(function(b){return a.kerning.push({first:parseInt(b.first,10),second:parseInt(b.second,10),amount:parseInt(b.amount,10)})}),b.distanceField.forEach(function(b){return a.distanceField.push({distanceRange:parseInt(b.distanceRange,10),fieldType:b.fieldType})}),a},a}(),bd=function(){function a(){}return a.test=function(a){return a instanceof XMLDocument&&a.getElementsByTagName("page").length&&null!==a.getElementsByTagName("info")[0].getAttribute("face")},a.parse=function(d){for(var c=new aH,h=d.getElementsByTagName("info"),j=d.getElementsByTagName("common"),f=d.getElementsByTagName("page"),i=d.getElementsByTagName("char"),e=d.getElementsByTagName("kerning"),g=d.getElementsByTagName("distanceField"),a=0,b;a")>-1){var b=(new globalThis.DOMParser).parseFromString(a,"text/xml");return bd.test(b)}return!1},a.parse=function(a){var b=(new globalThis.DOMParser).parseFromString(a,"text/xml");return bd.parse(b)},a}(),cX=[eX,bd,eO];function cZ(b){for(var a=0;a=s-r*i){if(0===h)throw new Error("[BitmapFont] textureHeight "+s+"px is too small (fontFamily: '"+a.fontFamily+"', fontSize: "+a.fontSize+"px, char: '"+A+"')");--d,j=null,l=null,t=null,h=0,g=0,p=0}else if(p=Math.max(r+o.fontProperties.descent,p),v*i+g>=J){if(0===g)throw new Error("[BitmapFont] textureWidth "+u+"px is too small (fontFamily: '"+a.fontFamily+"', fontSize: "+a.fontSize+"px, char: '"+A+"')");--d,h+=p*i,h=Math.ceil(h),g=0,p=0}else hv(j,l,o,g,h,i,a),I=bo(o.text),k.char.push({id:I,page:q.length-1,x:g/i,y:h/i,width:v,height:r,xoffset:0,yoffset:0,xadvance:Math.ceil(C-(a.dropShadow?a.dropShadowDistance:0)-(a.stroke?a.strokeThickness:0))}),g+=(v+2*H)*i,g=Math.ceil(g);d=0;for(E=n.length;d0&&i.x>aa&&(_(k,1+t-++ab,1+b-t),b=t,t=-1,w.push(B),z.push(k.length>0?k[k.length-1].prevSpaces:0),j=Math.max(j,B),M++,i.x=0,i.y+=m.lineHeight,x=null,H=0))):(w.push(s),z.push(-1),j=Math.max(j,s),++M,++ab,i.x=0,i.y+=m.lineHeight,x=null,H=0);W=G[G.length-1],"\r"!==W&&"\n"!==W&&(/(?:\s)/.test(W)&&(s=B),w.push(s),j=Math.max(j,s),z.push(-1)),ae=[];for(b=0;b<=M;b++)D=0,"right"===this._align?D=j-w[b]:"center"===this._align?D=(j-w[b])/2:"justify"===this._align&&(D=z[b]<0?0:(j-w[b])/z[b]),ae.push(D);ad=k.length,q={},v=[],I=this._activePagesMeshData;for(Q.push.apply(Q,I),b=0;b 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),T=a.BLEND_MODES.NORMAL_NPM),X=new ah(aj,N),X.blendMode=T,d={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:X,vertices:null,uvs:null,indices:null}),d.index=0,d.indexCount=0,d.vertexCount=0,d.uvsCount=0,d.total=0,O=this._textureCache,O[u]=O[u]||new c(A.baseTexture),d.mesh.texture=O[u],d.mesh.tint=this._tint,v.push(d),q[u]=d),q[u].total++;for(b=0;b6*y)||d.vertices.length<2*ah.BATCHABLE_SIZE)d.vertices=new Float32Array(8*y),d.uvs=new Float32Array(8*y),d.indices=new Uint16Array(6*y);else for(ai=d.total,Z=d.vertices,S=4*ai*2;S=h&&(c=b-a-1),d+=g=g.replace("%value%",e[c].toString()),d+="\n";return(f=f.replace("%blur%",d)).replace("%size%",b.toString())}(c);return(a=d.call(this,i,j)||this).horizontal=h,a.resolution=g,a._quality=0,a.quality=f,a.blur=e,a}return eq(c,d),c.prototype.apply=function(b,d,c,j){var g,h,f,e,i,k;if(c?this.horizontal?this.uniforms.strength=1/c.width*(c.width/d.width):this.uniforms.strength=1/c.height*(c.height/d.height):this.horizontal?this.uniforms.strength=1/b.renderer.width*(b.renderer.width/d.width):this.uniforms.strength=1/b.renderer.height*(b.renderer.height/d.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)b.applyFilter(this,d,c,j);else{g=b.getFilterTexture(),h=b.renderer,f=d,e=g,this.state.blend=!1,b.applyFilter(this,f,e,a.CLEAR_MODES.CLEAR);for(i=1;i 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",c)||this).alpha=1,a}return function(b,a){function c(){this.constructor=b}dr(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(a,b),a.prototype._loadMatrix=function(c,b){void 0===b&&(b=!1);var a=c;b&&(this._multiply(a,this.uniforms.m,c),a=this._colorMatrix(a)),this.uniforms.m=a},a.prototype._multiply=function(c,a,b){return c[0]=a[0]*b[0]+a[1]*b[5]+a[2]*b[10]+a[3]*b[15],c[1]=a[0]*b[1]+a[1]*b[6]+a[2]*b[11]+a[3]*b[16],c[2]=a[0]*b[2]+a[1]*b[7]+a[2]*b[12]+a[3]*b[17],c[3]=a[0]*b[3]+a[1]*b[8]+a[2]*b[13]+a[3]*b[18],c[4]=a[0]*b[4]+a[1]*b[9]+a[2]*b[14]+a[3]*b[19]+a[4],c[5]=a[5]*b[0]+a[6]*b[5]+a[7]*b[10]+a[8]*b[15],c[6]=a[5]*b[1]+a[6]*b[6]+a[7]*b[11]+a[8]*b[16],c[7]=a[5]*b[2]+a[6]*b[7]+a[7]*b[12]+a[8]*b[17],c[8]=a[5]*b[3]+a[6]*b[8]+a[7]*b[13]+a[8]*b[18],c[9]=a[5]*b[4]+a[6]*b[9]+a[7]*b[14]+a[8]*b[19]+a[9],c[10]=a[10]*b[0]+a[11]*b[5]+a[12]*b[10]+a[13]*b[15],c[11]=a[10]*b[1]+a[11]*b[6]+a[12]*b[11]+a[13]*b[16],c[12]=a[10]*b[2]+a[11]*b[7]+a[12]*b[12]+a[13]*b[17],c[13]=a[10]*b[3]+a[11]*b[8]+a[12]*b[13]+a[13]*b[18],c[14]=a[10]*b[4]+a[11]*b[9]+a[12]*b[14]+a[13]*b[19]+a[14],c[15]=a[15]*b[0]+a[16]*b[5]+a[17]*b[10]+a[18]*b[15],c[16]=a[15]*b[1]+a[16]*b[6]+a[17]*b[11]+a[18]*b[16],c[17]=a[15]*b[2]+a[16]*b[7]+a[17]*b[12]+a[18]*b[17],c[18]=a[15]*b[3]+a[16]*b[8]+a[17]*b[13]+a[18]*b[18],c[19]=a[15]*b[4]+a[16]*b[9]+a[17]*b[14]+a[18]*b[19]+a[19],c},a.prototype._colorMatrix=function(b){var a=new Float32Array(b);return a[4]/=255,a[9]/=255,a[14]/=255,a[19]/=255,a},a.prototype.brightness=function(a,b){var c=[a,0,0,0,0,0,a,0,0,0,0,0,a,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.tint=function(a,b){var c=[(a>>16&255)/255,0,0,0,0,0,(a>>8&255)/255,0,0,0,0,0,(255&a)/255,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.greyscale=function(a,b){var c=[a,a,a,0,0,a,a,a,0,0,a,a,a,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.blackAndWhite=function(a){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],a)},a.prototype.hue=function(e,f){e=(e||0)/180*Math.PI;var a=Math.cos(e),c=Math.sin(e),b=1/3,d=(0,Math.sqrt)(b),g=[a+(1-a)*b,b*(1-a)-d*c,b*(1-a)+d*c,0,0,b*(1-a)+d*c,a+b*(1-a),b*(1-a)-d*c,0,0,b*(1-a)-d*c,b*(1-a)+d*c,a+b*(1-a),0,0,0,0,0,1,0];this._loadMatrix(g,f)},a.prototype.contrast=function(c,d){var a=(c||0)+1,b=-.5*(a-1),e=[a,0,0,0,b,0,a,0,0,b,0,0,a,0,b,0,0,0,1,0];this._loadMatrix(e,d)},a.prototype.saturate=function(c,d){void 0===c&&(c=0);var b=2*c/3+1,a=-.5*(b-1),e=[b,a,a,0,0,a,b,a,0,0,a,a,b,0,0,0,0,0,1,0];this._loadMatrix(e,d)},a.prototype.desaturate=function(){this.saturate(-1)},a.prototype.negative=function(a){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],a)},a.prototype.sepia=function(a){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],a)},a.prototype.technicolor=function(a){this._loadMatrix([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],a)},a.prototype.polaroid=function(a){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],a)},a.prototype.toBGR=function(a){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],a)},a.prototype.kodachrome=function(a){this._loadMatrix([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],a)},a.prototype.browni=function(a){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],a)},a.prototype.vintage=function(a){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],a)},a.prototype.colorTone=function(c,d,a,b,k){var f=((a=a||16770432)>>16&255)/255,g=(a>>8&255)/255,h=(255&a)/255,i=((b=b||3375104)>>16&255)/255,j=(b>>8&255)/255,e=(255&b)/255,l=[.3,.59,.11,0,0,f,g,h,c=c||.2,0,i,j,e,d=d||.15,0,f-i,g-j,h-e,0,0];this._loadMatrix(l,k)},a.prototype.night=function(a,b){var c=[-2*(a=a||.1),-a,0,0,0,-a,0,a,0,0,0,a,2*a,0,0,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.predator=function(a,b){var c=[11.224130630493164*a,-4.794486999511719*a,-2.8746118545532227*a,0*a,.40342438220977783*a,-3.6330697536468506*a,9.193157196044922*a,-2.951810836791992*a,0*a,-1.316135048866272*a,-3.2184197902679443*a,-4.2375030517578125*a,7.476448059082031*a,0*a,.8044459223747253*a,0,0,0,1,0];this._loadMatrix(c,b)},a.prototype.lsd=function(a){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],a)},a.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(a.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(a){this.uniforms.m=a},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(a){this.uniforms.uAlpha=a},enumerable:!1,configurable:!0}),a}(C),dv.prototype.grayscale=dv.prototype.greyscale,dw=function(a,b){return dw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dw(a,b)},hP=function(b){function a(d,a){var c=this,e=new m;return d.renderable=!1,(c=b.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:d._texture,filterMatrix:e,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=d,c.maskMatrix=e,null==a&&(a=20),c.scale=new g(a,a),c}return function(b,a){function c(){this.constructor=b}dw(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(a,b),a.prototype.apply=function(d,e,f,g){this.uniforms.filterMatrix=d.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var a=this.maskSprite.worldTransform,c=Math.sqrt(a.a*a.a+a.b*a.b),b=Math.sqrt(a.c*a.c+a.d*a.d);0!==c&&0!==b&&(this.uniforms.rotation[0]=a.a/c,this.uniforms.rotation[1]=a.b/c,this.uniforms.rotation[2]=a.c/b,this.uniforms.rotation[3]=a.d/b),d.applyFilter(this,e,f,g)},Object.defineProperty(a.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(a){this.uniforms.mapSampler=a},enumerable:!1,configurable:!0}),a}(C),dx=function(a,b){return dx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dx(a,b)},hR=function(a){function b(){return a.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(b,a){function c(){this.constructor=b}dx(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(b,a),b}(C),dA=function(a,b){return dA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dA(a,b)},hT=function(b){function a(a,c){void 0===a&&(a=.5),void 0===c&&(c=Math.random());var d=b.call(this,cR,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return d.noise=a,d.seed=c,d}return function(b,a){function c(){this.constructor=b}dA(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(a,b),Object.defineProperty(a.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(a){this.uniforms.uNoise=a},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(a){this.uniforms.uSeed=a},enumerable:!1,configurable:!0}),a}(C),d_=new m,k.prototype._cacheAsBitmap=!1,k.prototype._cacheData=null,k.prototype._cacheAsBitmapResolution=null,k.prototype._cacheAsBitmapMultisample=a.MSAA_QUALITY.NONE,hV=function(){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(k.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(a){a!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=a,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(a){a!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=a,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(b){var a;this._cacheAsBitmap!==b&&(this._cacheAsBitmap=b,b?(this._cacheData||(this._cacheData=new hV),(a=this._cacheData).originalRender=this.render,a.originalRenderCanvas=this.renderCanvas,a.originalUpdateTransform=this.updateTransform,a.originalCalculateBounds=this.calculateBounds,a.originalGetLocalBounds=this.getLocalBounds,a.originalDestroy=this.destroy,a.originalContainsPoint=this.containsPoint,a.originalMask=this._mask,a.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((a=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=a.originalRender,this.renderCanvas=a.originalRenderCanvas,this.calculateBounds=a.originalCalculateBounds,this.getLocalBounds=a.originalGetLocalBounds,this.destroy=a.originalDestroy,this.updateTransform=a.originalUpdateTransform,this.containsPoint=a.originalContainsPoint,this._mask=a.originalMask,this.filterArea=a.originalFilterArea))}}}),k.prototype._renderCached=function(a){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(a),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(a))},k.prototype._initCachedDisplayObject=function(a){var i,j,d,n,k,p,l,m,g,h,o,f;(!this._cacheData||!this._cacheData.sprite)&&(j=this.alpha,this.alpha=1,a.batch.flush(),d=this.getLocalBounds(null,!0).clone(),this.filters&&this.filters.length&&(n=this.filters[0].padding,d.pad(n)),d.ceil(b.RESOLUTION),k=a.renderTexture.current,p=a.renderTexture.sourceFrame.clone(),l=a.renderTexture.destinationFrame.clone(),m=a.projection.transform,g=G.create({width:d.width,height:d.height,resolution:this.cacheAsBitmapResolution||a.resolution,multisample:null!==(i=this.cacheAsBitmapMultisample)&&void 0!==i?i:a.multisample}),h="cacheAsBitmap_"+I(),this._cacheData.textureCacheId=h,e.addToCache(g.baseTexture,h),c.addToCache(g,h),o=this.transform.localTransform.copyTo(d_).invert().translate(-d.x,-d.y),this.render=this._cacheData.originalRender,a.render(this,{renderTexture:g,clear:!0,transform:o,skipUpdateTransform:!1}),a.framebuffer.blit(),a.projection.transform=m,a.renderTexture.bind(k,p,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=j,f=new ai(g),f.transform.worldTransform=this.transform.worldTransform,f.anchor.x=-d.x/d.width,f.anchor.y=-d.y/d.height,f.alpha=j,f._bounds=this._bounds,this._cacheData.sprite=f,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=f.containsPoint.bind(f))},k.prototype._renderCachedCanvas=function(a){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(a),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(a))},k.prototype._initCachedDisplayObjectCanvas=function(f){var a,j,k,l,h,i,g,d;(!this._cacheData||!this._cacheData.sprite)&&(a=this.getLocalBounds(null,!0),j=this.alpha,this.alpha=1,k=f.context,l=f._projTransform,a.ceil(b.RESOLUTION),h=G.create({width:a.width,height:a.height}),i="cacheAsBitmap_"+I(),this._cacheData.textureCacheId=i,e.addToCache(h.baseTexture,i),c.addToCache(h,i),g=d_,this.transform.localTransform.copyTo(g),g.invert(),g.tx-=a.x,g.ty-=a.y,this.renderCanvas=this._cacheData.originalRenderCanvas,f.render(this,{renderTexture:h,clear:!0,transform:g,skipUpdateTransform:!1}),f.context=k,f._projTransform=l,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=j,d=new ai(h),d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-a.x/a.width,d.anchor.y=-a.y/a.height,d.alpha=j,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=f._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=d.containsPoint.bind(d))},k.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},k.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},k.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,e.removeFromCache(this._cacheData.textureCacheId),c.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},k.prototype._cacheAsBitmapDestroy=function(a){this.cacheAsBitmap=!1,this.destroy(a)},k.prototype.name=null,u.prototype.getChildByName=function(c,f){for(var a=0,b=this.children.length,d,e;a0?(m=h.x-c[b].x,n=h.y-c[b].y,o=Math.sqrt(m*m+n*n),h=c[b],g+=o/p):g=b/(j-1),d[a]=g,d[a+1]=0,d[a+2]=g,d[a+3]=1;f=0;for(b=0;b0?this.textureScale*this._width/2:this._width/2,a/=j,b/=j,a*=k,b*=k,f[g]=e.x+a,f[g+1]=e.y+b,f[g+2]=e.x-a,f[g+3]=e.y-b,h=e;this.buffers[0].update()}},a.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},a}(aI),ia=function(b){function c(d,f,c){void 0===c&&(c=0);var e=this,g=new dH(d.height,f,c),h=new ao(d);return c>0&&(d.baseTexture.wrapMode=a.WRAP_MODES.REPEAT),(e=b.call(this,g,h)||this).autoUpdate=!0,e}return ak(c,b),c.prototype._render=function(c){var a=this.geometry;(this.autoUpdate||a._width!==this.shader.texture.height)&&(a._width=this.shader.texture.height,a.update()),b.prototype._render.call(this,c)},c}(ah),dG=function(b){function a(a,e,f){var d=this,g=new dI(a.width,a.height,e,f),h=new ao(c.WHITE);return(d=b.call(this,g,h)||this).texture=a,d.autoResize=!0,d}return ak(a,b),a.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var a=this.geometry,b=this.shader.texture,c=b.width,d=b.height;!this.autoResize||a.width===c&&a.height===d||(a.width=this.shader.texture.width,a.height=this.shader.texture.height,a.build())},Object.defineProperty(a.prototype,"texture",{get:function(){return this.shader.texture},set:function(a){this.shader.texture!==a&&(this.shader.texture=a,this._textureID=-1,a.baseTexture.valid?this.textureUpdated():a.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),a.prototype._render=function(a){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),b.prototype._render.call(this,a)},a.prototype.destroy=function(a){this.shader.texture.off("update",this.textureUpdated,this),b.prototype.destroy.call(this,a)},a}(ah),ic=function(b){function a(a,j,g,h,i){var d,e,f;return void 0===a&&(a=c.EMPTY),d=this,e=new aI(j,g,h),e.getBuffer("aVertexPosition").static=!1,f=new ao(a),(d=b.call(this,e,f,null,i)||this).autoUpdate=!0,d}return ak(a,b),Object.defineProperty(a.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(a){this.geometry.getBuffer("aVertexPosition").data=a},enumerable:!1,configurable:!0}),a.prototype._render=function(a){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),b.prototype._render.call(this,a)},a}(ah),id=function(b){function a(d,e,f,g,h){void 0===e&&(e=10),void 0===f&&(f=10),void 0===g&&(g=10),void 0===h&&(h=10);var a=b.call(this,c.WHITE,4,4)||this;return a._origWidth=d.orig.width,a._origHeight=d.orig.height,a._width=a._origWidth,a._height=a._origHeight,a._leftWidth=e,a._rightWidth=g,a._topHeight=f,a._bottomHeight=h,a.texture=d,a}return ak(a,b),a.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(a.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(a){this.geometry.getBuffer("aVertexPosition").data=a},enumerable:!1,configurable:!0}),a.prototype.updateHorizontalVertices=function(){var a=this.vertices,b=this._getMinScale();a[9]=a[11]=a[13]=a[15]=this._topHeight*b,a[17]=a[19]=a[21]=a[23]=this._height-this._bottomHeight*b,a[25]=a[27]=a[29]=a[31]=this._height},a.prototype.updateVerticalVertices=function(){var a=this.vertices,b=this._getMinScale();a[2]=a[10]=a[18]=a[26]=this._leftWidth*b,a[4]=a[12]=a[20]=a[28]=this._width-this._rightWidth*b,a[6]=a[14]=a[22]=a[30]=this._width},a.prototype._getMinScale=function(){var a=this._leftWidth+this._rightWidth,c=this._width>a?1:this._width/a,b=this._topHeight+this._bottomHeight,d=this._height>b?1:this._height/b;return Math.min(c,d)},Object.defineProperty(a.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(a){this._leftWidth=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(a){this._rightWidth=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"topHeight",{get:function(){return this._topHeight},set:function(a){this._topHeight=a,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(a){this._bottomHeight=a,this._refresh()},enumerable:!1,configurable:!0}),a.prototype._refresh=function(){var b=this.texture,a=this.geometry.buffers[1].data,c,d;this._origWidth=b.orig.width,this._origHeight=b.orig.height,c=1/this._origWidth,d=1/this._origHeight,a[0]=a[8]=a[16]=a[24]=0,a[1]=a[3]=a[5]=a[7]=0,a[6]=a[14]=a[22]=a[30]=1,a[25]=a[27]=a[29]=a[31]=1,a[2]=a[10]=a[18]=a[26]=c*this._leftWidth,a[4]=a[12]=a[20]=a[28]=1-c*this._rightWidth,a[9]=a[11]=a[13]=a[15]=d*this._topHeight,a[17]=a[19]=a[21]=a[23]=1-d*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},a}(dG),dC=function(a,b){return dC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(c,a){for(var b in a)a.hasOwnProperty(b)&&(c[b]=a[b])},dC(a,b)},ig=function(d){function b(b,e){void 0===e&&(e=!0);var a=d.call(this,b[0]instanceof c?b[0]:b[0].texture)||this;return a._textures=null,a._durations=null,a._autoUpdate=e,a._isConnectedToTicker=!1,a.animationSpeed=1,a.loop=!0,a.updateAnchor=!1,a.onComplete=null,a.onFrameChange=null,a.onLoop=null,a._currentTime=0,a._playing=!1,a._previousFrame=null,a.textures=b,a}return function(b,a){function c(){this.constructor=b}dC(b,a),b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}(b,d),b.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(o.shared.remove(this.update,this),this._isConnectedToTicker=!1))},b.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(o.shared.add(this.update,this,a.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},b.prototype.gotoAndStop=function(a){this.stop();var b=this.currentFrame;this._currentTime=a,b!==this.currentFrame&&this.updateTexture()},b.prototype.gotoAndPlay=function(a){var b=this.currentFrame;this._currentTime=a,b!==this.currentFrame&&this.updateTexture(),this.play()},b.prototype.update=function(e){var c,b,a,d;if(this._playing){if(c=this.animationSpeed*e,b=this.currentFrame,null!==this._durations){a=this._currentTime%1*this._durations[this.currentFrame];for(a+=c/60*1e3;a<0;)this._currentTime--,a+=this._durations[this.currentFrame];d=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);a>=this._durations[this.currentFrame];)a-=this._durations[this.currentFrame]*d,this._currentTime+=d;this._currentTime+=a/this._durations[this.currentFrame]}else this._currentTime+=c;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):b!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrameb)&&this.onLoop(),this.updateTexture())}},b.prototype.updateTexture=function(){var a=this.currentFrame;this._previousFrame!==a&&(this._previousFrame=a,this._texture=this._textures[a],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},b.prototype.destroy=function(a){this.stop(),d.prototype.destroy.call(this,a),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},b.fromFrames=function(d){for(var e=[],a=0;a=2*Math.PI?this.drawCircle(c,d,f).beginHole().drawCircle(c,d,e).endHole():(this.finishPoly(),this.arc(c,d,e,b,a,!0).arc(c,d,f,a,b,!1).finishPoly(),this)}},drawChamferRect:{value:function(d,e,h,i,j){if(j<=0)return this.drawRect(d,e,h,i);for(var a=Math.min(j,Math.min(h,i)/2),f=d+h,g=e+i,b=[d+a,e,f-a,e,f,e+a,f,g-a,f-a,g,d+a,g,d,g-a,d,e+a],c=b.length-1;c>=2;c-=2)b[c]===b[c-2]&&b[c-1]===b[c-3]&&b.splice(c-1,2);return this.drawPolygon(b)}},drawFilletRect:{value:function(b,c,g,i,k){if(0===k)return this.drawRect(b,c,g,i);var j=Math.min(g,i)/2,h=Math.min(j,Math.max(-j,k)),f=b+g,e=c+i,d=h<0?-h:0,a=Math.abs(h);return this.moveTo(b,c+a).arcTo(b+d,c+d,b+a,c,a).lineTo(f-a,c).arcTo(f-d,c+d,f,c+a,a).lineTo(f,e-a).arcTo(f-d,e-d,b+g-a,e,a).lineTo(b+a,e).arcTo(b+d,e-d,b,e-a,a).closePath()}},drawRegularPolygon:{value:function(i,j,h,b,d){var g,f,c,a,e;void 0===d&&(d=0),b=Math.max(0|b,3);for(g=-1*Math.PI/2+d,f=2*Math.PI/b,c=[],a=0;a{if(typeof b!="object")return a;for(let c of Object.keys(b))a[c]=b[c];return a},kagura=function(){const a={Kagura:class{constructor(b){b=objSafe({element:null,fps:30,width:null,height:null,StartScene:a.Scene,backgroundColor:"#000",autoFpsControl:!0,autoViewSize:!1},b),this.options=b;const c={view:b.element,width:b.width,height:b.height,backgroundColor:b.backgroundColor};this.app=new PIXI.Application(c),this.app.renderer.resize(b.width,b.height),this.view=this.app.view,this.grid=new a.Grid(32,this.view.width,this.view.height);let d=b.StartScene;this.scene=this.newClass(d),b.autoViewSize&&(scaleToWindow(this.app.view),window.addEventListener("resize",()=>{scaleToWindow(this.app.view)})),this.keyboard=new a.Keyboard(document),this.touchs=new a.Touches(this.view),b.autoFpsControl&&(this.fpsHistory=[]),this.backgroundColor=b.backgroundColor,this.backFlameTime=new Date}roop(){let b=(new Date).getTime()-this.backFlameTime.getTime();if(this.backFlameTime=new Date,this.sceneFlame++,this.grid.w=this.app.view.width,this.grid.h=this.app.view.height,this.scene.update({sceneFlame:this.sceneFlame,sceneTime:((new Date).getTime()-this.sceneStartTime.getTime())/1e3,fps:1e3/b,deltaTime:b,deltaFlame:b/(1e3/this.options.fps),keyboard:this.keyboard,pointers:this.touchs.get}),this.scene.nextScene!==!1){let a=this.app;this.app.stage.children=[],this.scene=this.newClass(this.scene.nextScene,this.scene.passValue)}this.app.renderer.backgroundColor=this.scene.backgroundColor;let a;if(this.options.autoFpsControl){this.fpsHistory.push(1e3/b),this.fpsHistory.length===10&&this.fpsHistory.shift();let c=this.fpsHistory.reduce((a,b)=>a+b)/this.fpsHistory.length;a=this.options.fps,a*=a/c}else a=this.options.fps;setTimeout(this.roop.bind(this),1e3/a)}newClass(a,b={}){return this.sceneFlame=0,this.sceneStartTime=new Date,a.prototype.app=this.app,a.prototype.width=this.app.renderer.width,a.prototype.height=this.app.renderer.height,a.prototype.backgroundColor=this.options.backgroundColor,a.prototype.grid=this.grid,new a({catches:b})}mainroop(){requestAnimationFrame(this.roop.bind(this))}fullscreen(){a.FullScreen(document)}},Scene:class{constructor(a){this.nextScene=!1,this.stage=this.app.stage,this.renderer=this.app.renderer}exit(a,b){this.passValue=b,this.nextScene=a}update(a){}addChild(...a){return this.app.stage.addChild(...a)}},obj:{shape:{isNewTest:""}},Boxer:class{constructor(a){for(let b of Object.keys(a))this[b]=a[b]}},fullscreen:function(a){a||(a=document.documentElement);function b(a,b){return b in a}b(a,"webkitRequestFullscreen")?a.webkitRequestFullscreen():b(a,"requestFullscreen")?a.requestFullscreen():b(a,"mozRequestFullScreen")&&a.mozRequestFullScreen()},pixi:PIXI,api:{}};return a.exitFullscreen=Document.exitFullscreen,a.Grid=class{constructor(a,b,c){this.n=a,this._w=b,this._h=c,this.ud(),this.x=function(a){return this.vw*a+this.w/2},this.y=function(a){return this.vh*a+this.h/2}}xy(a,b){return{x:this.vw*a+this._w/2,y:this.vh*b+this._h/2}}ud(){this.vw=this._w/(2*this.n),this.vh=this._h/(2*this.n),this.c={x:this._w/2,y:this._h/2}}set w(a){this._w=a,this.ud()}set h(a){this._h=a,this.ud()}get w(){return this._w}get h(){return this._h}},a.browser=function(a){return a=a.toLowerCase(),a.indexOf('msie')!=-1||a.indexOf('trident')!=-1?'ie':a.indexOf('edge')!=-1?'edge':a.indexOf('chrome')!=-1?'chrome':a.indexOf('safari')!=-1?'safari':a.indexOf('firefox')!=-1?'firefox':a.indexOf('opera')!=-1?'opera':''}(window.navigator.userAgent),a.Sounder=class{constructor(a){this.url=a}make(a=!0){return new class{constructor(a,b=!0){this.elem=document.createElement("audio"),this.elem.src=a,b&&this.elem.addEventListener("ended",()=>{this.kill()})}play(){this.elem.play()}pause(){this.elem.pause()}get time(){return this.elem.currentTime}set time(a){this.elem.currentTime=a}get max(){return this.elem.max}set max(a){this.elem.max=a}get volume(){return this.elem.volume}set volume(a){this.elem.volume=a}get ended(){return this.elem.ended}get speed(){return this.elem.playbackRate}set speed(a){this.elem.playbackRate=a}kill(){this.elem.remove(),delete this.elem}}(this.url,a)}},a.obj.Object=class{constructor(a){this.obj=a;for(let a of Object.getOwnPropertyNames(this.obj)){let b=Object.getOwnPropertyDescriptor(this.obj,a);Object.defineProperty(this,a,{get:function(){return this.obj[a]},set:function(b){this.obj[a]=b}})}this.__proto__=this.obj.__proto__,Object.assign(this.__proto__,{addChildTo:function(a){return a.addChild(this.obj),this}})}},a.obj.Text=class extends a.obj.Object{constructor(b){b=objSafe({text:"",x:0,y:0,fill:16777215,align:"left",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",stroke:"black",strokeThickness:0,anchor:{x:0,y:0},options:{}},b),b.options=objSafe({fill:b.fill,align:b.align,fontFamily:b.fontFamily,fontSize:b.fontSize,fontVariant:b.fontVariant,fontWeight:b.fontWeight,stroke:b.stroke,strokeThickness:b.strokeThickness},b.options),super(new a.pixi.Text(b.text,b.options)),this.obj.x=b.x,this.obj.y=b.y}},a.obj.Group=class extends PIXI.Container{constructor(a){a=objSafe({x:0,y:0,rotation:0,alpha:1},a),super(),this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.alpha=a.alpha}addChildTo(a){return a.addChild(this),this}each(b){let a=[];return this.children.forEach((c,d)=>{const e=b.call(c,c,d);e===!0&&a.push(d)}),a.reverse().forEach(a=>this.children.splice(a,1)),this}},a.obj.shape.GraphicsProto=class extends a.obj.Object{constructor(a){super(new PIXI.Graphics),a=objSafe({x:0,y:0,rotation:0,alpha:1,scale:{x:1,y:1}},a),this.obj.x=a.x,this.obj.y=a.y,this.obj.rotation=a.rotation,this.obj.alpha=a.alpha,this.obj.scale=a.scale}},a.obj.shape.GraphicsFill=class extends a.obj.shape.GraphicsProto{constructor(a,b){a=objSafe({fill:16777215},a),super(a),this.draw=b,this.options=a,this.obj.beginFill(a.fill),this.draw(this.obj,this.options),this.obj.pivot.x=0,this.obj.pivot.y=0}set fill(a){this.obj.clear(),this.obj.beginFill(a),this.draw(this.obj,this.options)}},a.obj.shape.Circle=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({radius:10},a),super(a,(a,b)=>{a.drawCircle(0,0,b.radius).endFill()})}get radius(){return this.obj.radius}set radius(a){this.obj.radius=a}},a.obj.shape.Ellipse=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({width:10,height:10},a),super(a,(b,a)=>{b.drawEllipse(0,0,a.width,a.height).endFill()})}},a.obj.shape.Path=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({paths:[[100,0],[70,70],[0,100],[-70,70],[-100,0],[-70,-70],[0,-100],[70,-70]]},a),super(a,(b,c)=>{let a=[];for(let b of c.paths)if(b.length===2&&Array.isArray(b))a.push(b[0],b[1]);else{console.error("Paths's arguments type is array, and children array's length is 2.");return}b.drawPolygon(a).endFill()})}},a.obj.shape.Rect=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({width:100,height:100,fillet:0},a),super(a,(b,a)=>{b.drawFilletRect(0,0,a.width,a.height,a.fillet).endFill()})}},a.obj.shape.Polygon=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({radius:10,sides:1,corner:1},a),super(a,(b,a)=>{b.drawRoundedPolygon(0,0,a.radius,a.sides,a.corner,0).endFill()})}},a.obj.shape.Star=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({points:5,radius:10,innerRadius:20},a),super(a,(b,a)=>{b.drawStar(0,0,a.points,a.radius,a.innerRadius,0).endFill()})}},a.obj.shape.Torus=class extends a.obj.shape.GraphicsFill{constructor(a){a=objSafe({points:5,radius:10,innerRadius:0,outerRadius:Math.PI*2},a),super(a,(b,a)=>{b.drawTorus(0,0,a.innerRadius,a.outerRadius,a.startArc,a.endArc).endFill()})}},a.obj.shape.Line=class extends a.obj.shape.GraphicsProto{constructor(a){a=objSafe({color:16777215,paths:[[0,0],[10,10]],size:1},a),super(a),this.options=a,Object.defineProperty(this,"color",{set:function(a){this.options.color=a,this.draw()}}),this.draw=()=>{const a=this.options;this.clear(),this.lineStyle(a.size,a.color);let b=0;for(let c of a.paths)if(b++,c.length===2&&Array.isArray(c))b===1&&this.moveTo(...c),this.lineTo(...c);else{console.error("Paths's arguments type is array, and children array's length is 2.");return}},this.draw()}},a.Loader=class{constructor(b,c){if(!b){console.error("Loads arguments is undefined.");return}this.assets={},c||(c=function(){}),this.loaded=c,this.loader=new a.pixi.Loader,this.loadedXhr={__pixiLoaded__:!1},Object.keys(b).forEach(a=>{this.loadedXhr[a]=!1});for(const d of Object.keys(b)){const e=b[d];this.loader.add(d,e),this.assets[d]={get text(){return this._text.result},get json(){try{return JSON.parse(this.text)}catch{return void 0}}};let c=new XMLHttpRequest;c.onreadystatechange=()=>{if(c.readyState==4&&c.status==200){const b=this.assets[d];b.blobObj=c.response,b.blob=window.URL.createObjectURL(c.response),b.image=new Image(b.blob),b.sound=new Audio(b.blob),b.url=c.responseURL,b._text=new FileReader,b._text.readAsText(b.blobObj),b.sounder=new a.Sounder(b.blob)}setTimeout(()=>this.loadedOneXhr(d),0)},c.responseType="blob",c.open('GET',e,!0),c.send()}this.loader.load(()=>{for(const c of Object.keys(this.loader.resources)){const a=this.loader.resources[c],b=this.assets[c];b.pixiLoad=a,b.texture=a.texture,b.textures=a.textures}this.loadedOneXhr("__pixiLoaded__")})}get(a){return this.assets[a]}loadedOneXhr(a){this.loadedXhr[a]=!0,Object.values(this.loadedXhr).reduce((a,b)=>a&&b)&&this.loaded(this.assets,this)}},a.obj.Sprite=class extends a.pixi.Sprite{constructor(a){super(),a=objSafe({texture:void 0,alpha:1,x:0,y:0,width:this.width,height:this.height},a),this.texture=a.texture,this.alpha=a.alpha,this.x=a.x,this.y=a.y}addChildTo(a){return a.addChild(this),this}},a.Keyboard=class{constructor(a=document){this.keys=[],this.elem=a,this.keycodes={0:{id:0,key:["",""],code:""},1:{id:1,key:["unidentified",""],code:""},2:{id:2,key:["",""],code:""},3:{id:3,key:["cancel",""],code:"pause"},4:{id:4,key:["",""],code:""},5:{id:5,key:["",""],code:""},6:{id:6,key:["",""],code:""},7:{id:7,key:["",""],code:""},8:{id:8,key:["backspace",""],code:"backspace"},9:{id:9,key:["tab",""],code:"tab"},10:{id:10,key:["",""],code:""},11:{id:11,key:["",""],code:""},12:{id:12,key:["clear",""],code:"numlock"},13:{id:13,key:["enter",""],code:"enter"},14:{id:14,key:["",""],code:""},15:{id:15,key:["",""],code:""},16:{id:16,key:["shift",""],code:"shiftleft"},17:{id:17,key:["control",""],code:"controlleft"},18:{id:18,key:["alt",""],code:"altleft"},19:{id:19,key:["pause",""],code:"pause"},20:{id:20,key:["capslock",""],code:"capslock"},21:{id:21,key:["unidentified",""],code:"lang1"},22:{id:22,key:["",""],code:""},23:{id:23,key:["",""],code:""},24:{id:24,key:["",""],code:""},25:{id:25,key:["unidentified",""],code:"lang2"},26:{id:26,key:["",""],code:""},27:{id:27,key:["escape",""],code:"escape"},28:{id:28,key:["",""],code:""},29:{id:29,key:["",""],code:""},30:{id:30,key:["",""],code:""},31:{id:31,key:["",""],code:""},32:{id:32,key:[" ",""],code:"space"},33:{id:33,key:["pageup",""],code:"numpad9"},34:{id:34,key:["pagedown",""],code:"numpad3"},35:{id:35,key:["end",""],code:"numpad1"},36:{id:36,key:["home",""],code:"numpad7"},37:{id:37,key:["arrowleft",""],code:"arrowleft"},38:{id:38,key:["arrowup",""],code:"arrowup"},39:{id:39,key:["arrowright",""],code:"arrowright"},40:{id:40,key:["arrowdown",""],code:"arrowdown"},41:{id:41,key:["",""],code:""},42:{id:42,key:["",""],code:""},43:{id:43,key:["",""],code:""},44:{id:44,key:["f13",""],code:"f13"},45:{id:45,key:["insert",""],code:"numpad0"},46:{id:46,key:["delete",""],code:"numpaddecimal"},47:{id:47,key:["",""],code:""},48:{id:48,key:["0",""],code:"digit0"},49:{id:49,key:["1",""],code:"digit1"},50:{id:50,key:["2",""],code:"digit2"},51:{id:51,key:["3",""],code:"digit3"},52:{id:52,key:["4",""],code:"digit4"},53:{id:53,key:["5",""],code:"digit5"},54:{id:54,key:["6",""],code:"digit6"},55:{id:55,key:["7",""],code:"digit7"},56:{id:56,key:["8",""],code:"digit8"},57:{id:57,key:["9",""],code:"digit9"},58:{id:58,key:[":",""],code:"period"},59:{id:59,key:[";",""],code:"semicolon"},60:{id:60,key:["<",""],code:"backquote"},61:{id:61,key:["=",""],code:"equal"},62:{id:62,key:["",""],code:""},63:{id:63,key:["\u03b2",""],code:"minus"},64:{id:64,key:["",""],code:""},65:{id:65,key:["a",""],code:"keya"},66:{id:66,key:["b",""],code:"keyb"},67:{id:67,key:["c",""],code:"keyc"},68:{id:68,key:["d",""],code:"keyd"},69:{id:69,key:["e",""],code:"keye"},70:{id:70,key:["f",""],code:"keyf"},71:{id:71,key:["g",""],code:"keyg"},72:{id:72,key:["h",""],code:"keyh"},73:{id:73,key:["i",""],code:"keyi"},74:{id:74,key:["j",""],code:"keyj"},75:{id:75,key:["k",""],code:"keyk"},76:{id:76,key:["l",""],code:"keyl"},77:{id:77,key:["m",""],code:"keym"},78:{id:78,key:["n",""],code:"keyn"},79:{id:79,key:["o",""],code:"keyo"},80:{id:80,key:["p",""],code:"keyp"},81:{id:81,key:["q",""],code:"keyq"},82:{id:82,key:["r",""],code:"keyr"},83:{id:83,key:["s",""],code:"keys"},84:{id:84,key:["t",""],code:"keyt"},85:{id:85,key:["u",""],code:"keyu"},86:{id:86,key:["v",""],code:"keyv"},87:{id:87,key:["w",""],code:"keyw"},88:{id:88,key:["x",""],code:"keyx"},89:{id:89,key:["y",""],code:"keyy"},90:{id:90,key:["z",""],code:"keyz"},91:{id:91,key:["meta",""],code:"metaleft"},92:{id:92,key:["meta",""],code:"metaright"},93:{id:93,key:["contextmenu",""],code:"contextmenu"},94:{id:94,key:["",""],code:""},95:{id:95,key:["",""],code:""},96:{id:96,key:["0",""],code:"numpad0"},97:{id:97,key:["1",""],code:"numpad1"},98:{id:98,key:["2",""],code:"numpad2"},99:{id:99,key:["3",""],code:"numpad3"},100:{id:100,key:["4",""],code:"numpad4"},101:{id:101,key:["5",""],code:"numpad5"},102:{id:102,key:["6",""],code:"numpad6"},103:{id:103,key:["7",""],code:"numpad7"},104:{id:104,key:["8",""],code:"numpad8"},105:{id:105,key:["9",""],code:"numpad9"},106:{id:106,key:["*",""],code:"numpadmultiply"},107:{id:107,key:["+",""],code:"numpadadd"},108:{id:108,key:[",",""],code:"numpaddecimal"},109:{id:109,key:["-",""],code:"numpadsubtract"},110:{id:110,key:[".",""],code:"numpaddecimal"},111:{id:111,key:["/",""],code:"numpaddivide"},112:{id:112,key:["f1",""],code:"f1"},113:{id:113,key:["f2",""],code:"f2"},114:{id:114,key:["f3",""],code:"f3"},115:{id:115,key:["f4",""],code:"f4"},116:{id:116,key:["f5",""],code:"f5"},117:{id:117,key:["f6",""],code:"f6"},118:{id:118,key:["f7",""],code:"f7"},119:{id:119,key:["f8",""],code:"f8"},120:{id:120,key:["f9",""],code:"f9"},121:{id:121,key:["f10",""],code:"f10"},122:{id:122,key:["f11",""],code:"f11"},123:{id:123,key:["f12",""],code:"f12"},124:{id:124,key:["f13",""],code:"f13"},125:{id:125,key:["f14",""],code:"f14"},126:{id:126,key:["f15",""],code:"f15"},127:{id:127,key:["f16",""],code:"f16"},128:{id:128,key:["f17",""],code:"f17"},129:{id:129,key:["f18",""],code:"f18"},130:{id:130,key:["f19",""],code:"f19"},131:{id:131,key:["f20",""],code:"f20"},132:{id:132,key:["f21",""],code:"f21"},133:{id:133,key:["f22",""],code:"f22"},134:{id:134,key:["f23",""],code:"f23"},135:{id:135,key:["f24",""],code:"f24"},136:{id:136,key:["f25",""],code:"f25"},137:{id:137,key:["f26",""],code:"f26"},138:{id:138,key:["f27",""],code:"f27"},139:{id:139,key:["f28",""],code:"f28"},140:{id:140,key:["f29",""],code:"f29"},141:{id:141,key:["f30",""],code:"f30"},142:{id:142,key:["f31",""],code:"f31"},143:{id:143,key:["f32",""],code:"f32"},144:{id:144,key:["numlock",""],code:"numlock"},145:{id:145,key:["scrolllock",""],code:"scrolllock"},146:{id:146,key:["",""],code:""},147:{id:147,key:["",""],code:""},148:{id:148,key:["",""],code:""},149:{id:149,key:["",""],code:""},150:{id:150,key:["",""],code:""},151:{id:151,key:["",""],code:""},152:{id:152,key:["",""],code:""},153:{id:153,key:["",""],code:""},154:{id:154,key:["",""],code:""},155:{id:155,key:["",""],code:""},156:{id:156,key:["",""],code:""},157:{id:157,key:["",""],code:""},158:{id:158,key:["",""],code:""},159:{id:159,key:["",""],code:""},160:{id:160,key:["[",""],code:"blacketleft"},161:{id:161,key:["dead",""],code:"blacketright"},162:{id:162,key:["",""],code:""},163:{id:163,key:["\\",""],code:"backquote"},164:{id:164,key:["$",""],code:"backslash"},165:{id:165,key:["^\u00f9",""],code:"quote"},166:{id:166,key:["",""],code:""},167:{id:167,key:["",""],code:""},168:{id:168,key:["",""],code:""},169:{id:169,key:[")",""],code:"minus"},170:{id:170,key:["*",""],code:"backslash"},171:{id:171,key:["+",""],code:"bracketright"},172:{id:172,key:["",""],code:""},173:{id:173,key:["-",""],code:"minus"},174:{id:174,key:["audiovolumedown",""],code:""},175:{id:175,key:["audiovolumeup",""],code:""},176:{id:176,key:["mediatracknext",""],code:"mediatracknext"},177:{id:177,key:["mediatrackprevious",""],code:"mediatrackprevious"},178:{id:178,key:["",""],code:""},179:{id:179,key:["mediaplaypause",""],code:""},180:{id:180,key:["launchmail",""],code:""},181:{id:181,key:["audiovolumemute",""],code:"volumemute"},182:{id:182,key:["audiovolumedown",""],code:"volumedown"},183:{id:183,key:["audiovolumeup",""],code:"volumeup"},184:{id:184,key:["",""],code:""},185:{id:185,key:["",""],code:""},186:{id:186,key:[";",""],code:"semicolon"},187:{id:187,key:["+",""],code:"equal"},188:{id:188,key:[",",""],code:"comma"},189:{id:189,key:["-",""],code:"minus"},190:{id:190,key:[".",""],code:"period"},191:{id:191,key:["/","?"],code:"slash"},192:{id:192,key:["`",""],code:"backquote"},193:{id:193,key:["/",""],code:"intlro"},194:{id:194,key:[".",""],code:"numpadcomma"},195:{id:195,key:["",""],code:""},196:{id:196,key:["",""],code:""},197:{id:197,key:["",""],code:""},198:{id:198,key:["",""],code:""},199:{id:199,key:["",""],code:""},200:{id:200,key:["",""],code:""},201:{id:201,key:["",""],code:""},202:{id:202,key:["",""],code:""},203:{id:203,key:["",""],code:""},204:{id:204,key:["",""],code:""},205:{id:205,key:["",""],code:""},206:{id:206,key:["",""],code:""},207:{id:207,key:["",""],code:""},208:{id:208,key:["",""],code:""},209:{id:209,key:["",""],code:""},210:{id:210,key:["",""],code:""},211:{id:211,key:["",""],code:""},212:{id:212,key:["",""],code:""},213:{id:213,key:["",""],code:""},214:{id:214,key:["",""],code:""},215:{id:215,key:["",""],code:""},216:{id:216,key:["",""],code:""},217:{id:217,key:["",""],code:""},218:{id:218,key:["",""],code:""},219:{id:219,key:["[",""],code:"blacketleft"},220:{id:220,key:["\\",""],code:"backslash"},221:{id:221,key:["]",""],code:"bracketright"},222:{id:222,key:["'",""],code:"quote"},223:{id:223,key:["`",""],code:"backquote"},224:{id:224,key:["meta",""],code:"osleft"},225:{id:225,key:["altgraph",""],code:"altright"},226:{id:226,key:["\\",""],code:"intlbackslash"},227:{id:227,key:["",""],code:""},228:{id:228,key:["",""],code:""},229:{id:229,key:["",""],code:""},230:{id:230,key:["",""],code:""},231:{id:231,key:["",""],code:""},232:{id:232,key:["",""],code:""},233:{id:233,key:["",""],code:""},234:{id:234,key:["",""],code:""},235:{id:235,key:["",""],code:""},236:{id:236,key:["",""],code:""},237:{id:237,key:["",""],code:""},238:{id:238,key:["",""],code:""},239:{id:239,key:["",""],code:""},240:{id:240,key:["",""],code:""},241:{id:241,key:["",""],code:""},242:{id:242,key:["",""],code:""},243:{id:243,key:["",""],code:""},244:{id:244,key:["",""],code:""},245:{id:245,key:["",""],code:""},246:{id:246,key:["",""],code:""},247:{id:247,key:["",""],code:""},248:{id:248,key:["",""],code:""},249:{id:249,key:["",""],code:""},250:{id:250,key:["",""],code:""},251:{id:251,key:["",""],code:""},252:{id:252,key:["",""],code:""},253:{id:253,key:["",""],code:""},254:{id:254,key:["",""],code:""},255:{id:255,key:["unidentified",""],code:"wakeup"}},a.addEventListener("keydown",a=>{this.addkey(a.keyCode)}),a.addEventListener("keyup",b=>{const a=this.keys.indexOf(b.keyCode);a!==-1&&this.keys.splice(a,1)})}addkey(a){this.keys.includes(a)||this.keys.push(a)}delkey(b){const a=this.keys.indexOf(b);a!==-1&&this.keys.splice(a,1)}metaKey(a){a.shiftKey===!0?this.addkey("shift"):this.delkey("shift")}get allKeys(){let a=[];for(let c of this.keys){const b=this.keycodes[c];a.push(b.code),a.push(b.id),a=a.concat(b.key)}return a}isDown(a){return this.allKeys.includes(a)}},a.Touches=class{constructor(a=document){this.mouse={x:0,y:0,down:!1},this.touches={},this.lastPointer={x:0,y:0},a.addEventListener('mousemove',a=>{this.mouse.x=a.clientX,this.mouse.y=a.clientY}),a.addEventListener("mousedown",a=>{this.mouse.x=a.clientX,this.mouse.y=a.clientY,this.mouse.down=!0}),a.addEventListener("mouseup",a=>{this.mouse.x=a.clientX,this.mouse.y=a.clientY,this.mouse.down=!1}),a.addEventListener("touchstart",a=>{for(let c=0;c{for(let b=0;b{for(let c=0;c1&&a.preventDefault()}),a.addEventListener("touchcancel",a=>{for(let b=0;bthis.loadedOneXhr(load),0) }; @@ -53,6 +53,7 @@ class{ my.pixiLoad=value; my.texture=value.texture; my.textures=value.textures + } this.loadedOneXhr("__pixiLoaded__") });