All Downloads are FREE. Search and download functionalities are using the official Maven repository.

view.lib.pixi6.js Maven / Gradle / Ivy

/*!
 * pixi.js-legacy - v6.5.3
 * Compiled Fri, 09 Sep 2022 13:49:32 UTC
 *
 * pixi.js-legacy is licensed under the MIT License.
 * http://www.opensource.org/licenses/mit-license
 */
var PIXI=function(t){"use strict";var e=setTimeout;function r(t){return Boolean(t&&void 0!==t.length)}function i(){}function n(t){if(!(this instanceof n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function o(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,n._immediateFn((function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){var i;try{i=r(t._value)}catch(t){return void a(e.promise,t)}s(e.promise,i)}else(1===t._state?s:a)(e.promise,t._value)}))):t._deferreds.push(e)}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof n)return t._state=3,t._value=e,void h(t);if("function"==typeof r)return void l((i=r,o=e,function(){i.apply(o,arguments)}),t)}t._state=1,t._value=e,h(t)}catch(e){a(t,e)}var i,o}function a(t,e){t._state=2,t._value=e,h(t)}function h(t){2===t._state&&0===t._deferreds.length&&n._immediateFn((function(){t._handled||n._unhandledRejectionFn(t._value)}));for(var e=0,r=t._deferreds.length;e0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),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),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(_||(_={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(v||(v={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(m||(m={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(E||(E={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(g||(g={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(T||(T={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(y||(y={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(b||(b={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(R||(R={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(x||(x={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(A||(A={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(S||(S={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(O||(O={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(I||(I={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(M||(M={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(P||(P={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR"}(D||(D={})),function(t){t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA"}(N||(N={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(C||(C={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(w||(w={}));var k={createCanvas:function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var t;return null!==(t=document.baseURI)&&void 0!==t?t:window.location.href},fetch:function(t,e){return fetch(t,e)}},H=/iPhone/i,Y=/iPod/i,j=/iPad/i,V=/\biOS-universal(?:.+)Mac\b/i,W=/\bAndroid(?:.+)Mobile\b/i,z=/Android/i,q=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,K=/Silk/i,Z=/Windows Phone/i,Q=/\bWindows(?:.+)ARM\b/i,J=/BlackBerry/i,$=/BB10/i,tt=/Opera Mini/i,et=/\b(CriOS|Chrome)(?:.+)Mobile/i,rt=/Mobile(?:.+)Firefox\b/i,it=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream},nt=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var n=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(H)&&!n(Z),ipod:n(Y),tablet:!n(H)&&(n(j)||it(e))&&!n(Z),universal:n(V),device:(n(H)||n(Y)||n(j)||n(V)||it(e))&&!n(Z)},amazon:{phone:n(q),tablet:!n(q)&&n(K),device:n(q)||n(K)},android:{phone:!n(Z)&&n(q)||!n(Z)&&n(W),tablet:!n(Z)&&!n(q)&&!n(W)&&(n(K)||n(z)),device:!n(Z)&&(n(q)||n(K)||n(W)||n(z))||n(/\bokhttp\b/i)},windows:{phone:n(Z),tablet:n(Q),device:n(Z)||n(Q)},other:{blackberry:n(J),blackberry10:n($),opera:n(tt),firefox:n(rt),chrome:n(et),device:n(J)||n($)||n(tt)||n(rt)||n(et)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(globalThis.navigator),ot={ADAPTER:k,MIPMAP_TEXTURES:S.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:C.NONE,SPRITE_MAX_TEXTURES:function(t){var e,r=!0;(nt.tablet||nt.phone)&&(nt.apple.device&&(e=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(e[1],10)<11&&(r=!1),nt.android.device&&(e=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(e[1],10)<7&&(r=!1));return r?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:M.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:A.CLAMP,SCALE_MODE:x.LINEAR,PRECISION_VERTEX:P.HIGH,PRECISION_FRAGMENT:nt.apple.device?P.HIGH:P.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!nt.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function at(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var ht=at((function(t){var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n80*r){i=o=t[0],n=s=t[1];for(var p=r;po&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?32767/u:0}return pt(d,f,r,i,n,u,0),f}function dt(t,e,r,i,n){var o,s;if(n===Ft(t,e,r,i)>0)for(o=e;o=e;o-=i)s=Ct(o,t[o],t[o+1],s);return s&&Ot(s,s.next)&&(wt(s),s=s.next),s}function ft(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!Ot(i,i.next)&&0!==St(i.prev,i,i.next))i=i.next;else{if(wt(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function pt(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=bt(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?vt(t,i,n,o):_t(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(h.i/r|0),wt(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?pt(t=mt(ft(t),e,r),e,r,i,n,o,2):2===s&&Et(t,e,r,i,n,o):pt(ft(t),e,r,i,n,o,1);break}}}function _t(t){var e=t.prev,r=t,i=t.next;if(St(e,r,i)>=0)return!1;for(var n=e.x,o=r.x,s=i.x,a=e.y,h=r.y,u=i.y,l=no?n>s?n:s:o>s?o:s,f=a>h?a>u?a:u:h>u?h:u,p=i.next;p!==e;){if(p.x>=l&&p.x<=d&&p.y>=c&&p.y<=f&&xt(n,a,o,h,s,u,p.x,p.y)&&St(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function vt(t,e,r,i){var n=t.prev,o=t,s=t.next;if(St(n,o,s)>=0)return!1;for(var a=n.x,h=o.x,u=s.x,l=n.y,c=o.y,d=s.y,f=ah?a>u?a:u:h>u?h:u,v=l>c?l>d?l:d:c>d?c:d,m=bt(f,p,e,r,i),E=bt(_,v,e,r,i),g=t.prevZ,T=t.nextZ;g&&g.z>=m&&T&&T.z<=E;){if(g.x>=f&&g.x<=_&&g.y>=p&&g.y<=v&&g!==n&&g!==s&&xt(a,l,h,c,u,d,g.x,g.y)&&St(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,T.x>=f&&T.x<=_&&T.y>=p&&T.y<=v&&T!==n&&T!==s&&xt(a,l,h,c,u,d,T.x,T.y)&&St(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;g&&g.z>=m;){if(g.x>=f&&g.x<=_&&g.y>=p&&g.y<=v&&g!==n&&g!==s&&xt(a,l,h,c,u,d,g.x,g.y)&&St(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;T&&T.z<=E;){if(T.x>=f&&T.x<=_&&T.y>=p&&T.y<=v&&T!==n&&T!==s&&xt(a,l,h,c,u,d,T.x,T.y)&&St(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function mt(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!Ot(n,o)&&It(n,i,i.next,o)&&Dt(n,o)&&Dt(o,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(o.i/r|0),wt(i),wt(i.next),i=t=o),i=i.next}while(i!==t);return ft(i)}function Et(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&At(s,a)){var h=Nt(s,a);return s=ft(s,s.next),h=ft(h,h.next),pt(s,e,r,i,n,o,0),void pt(h,e,r,i,n,o,0)}a=a.next}s=s.next}while(s!==t)}function gt(t,e){return t.x-e.x}function Tt(t,e){var r=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s&&(s=a,r=i.x=i.x&&i.x>=l&&n!==i.x&&xt(or.x||i.x===r.x&&yt(r,i)))&&(r=i,d=h)),i=i.next}while(i!==u);return r}(t,e);if(!r)return e;var i=Nt(r,t);return ft(i,i.next),ft(r,r.next)}function yt(t,e){return St(t.prev,t,e.prev)<0&&St(e.next,t,t.next)<0}function bt(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Rt(t){var e=t,r=t;do{(e.x=(t-s)*(o-a)&&(t-s)*(i-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function At(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&It(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Dt(t,e)&&Dt(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(St(t.prev,t,e.prev)||St(t,e.prev,e))||Ot(t,e)&&St(t.prev,t,t.next)>0&&St(e.prev,e,e.next)>0)}function St(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ot(t,e){return t.x===e.x&&t.y===e.y}function It(t,e,r,i){var n=Pt(St(t,e,r)),o=Pt(St(t,e,i)),s=Pt(St(r,i,t)),a=Pt(St(r,i,e));return n!==o&&s!==a||(!(0!==n||!Mt(t,r,e))||(!(0!==o||!Mt(t,i,e))||(!(0!==s||!Mt(r,t,i))||!(0!==a||!Mt(r,e,i)))))}function Mt(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Pt(t){return t>0?1:t<0?-1:0}function Dt(t,e){return St(t.prev,t,t.next)<0?St(t,e,t.next)>=0&&St(t,t.prev,e)>=0:St(t,e,t.prev)<0||St(t,t.next,e)<0}function Nt(t,e){var r=new Lt(t.i,t.x,t.y),i=new Lt(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function Ct(t,e,r,i){var n=new Lt(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function wt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Lt(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ft(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},ut.default=lt;var Ut=at((function(t,e){!function(r){var i=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,o="object"==typeof st&&st;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var s,a,h=2147483647,u=36,l=/^xn--/,c=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,_=String.fromCharCode;function v(t){throw RangeError(f[t])}function m(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function E(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+m((t=t.replace(d,".")).split("."),e).join(".")}function g(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=_((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=_(t)})).join("")}function y(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function b(t,e,r){var i=0;for(t=r?p(t/700):t>>1,t+=p(t/e);t>455;i+=u)t=p(t/35);return p(i+36*t/(t+38))}function R(t){var e,r,i,n,o,s,a,l,c,d,f,_=[],m=t.length,E=0,g=128,y=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&v("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=m&&v("invalid-input"),((l=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:u)>=u||l>p((h-E)/s))&&v("overflow"),E+=l*s,!(l<(c=a<=y?1:a>=y+26?26:a-y));a+=u)s>p(h/(d=u-c))&&v("overflow"),s*=d;y=b(E-o,e=_.length+1,0==o),p(E/e)>h-g&&v("overflow"),g+=p(E/e),E%=e,_.splice(E++,0,g)}return T(_)}function x(t){var e,r,i,n,o,s,a,l,c,d,f,m,E,T,R,x=[];for(m=(t=g(t)).length,e=128,r=0,o=72,s=0;s=e&&fp((h-r)/(E=i+1))&&v("overflow"),r+=(a-e)*E,e=a,s=0;sh&&v("overflow"),f==e){for(l=r,c=u;!(l<(d=c<=o?1:c>=o+26?26:c-o));c+=u)R=l-d,T=u-d,x.push(_(y(d+R%T,0))),l=p(R/T);x.push(_(y(l,0))),o=b(r,E,i==n),r=0,++i}++r,++e}return x.join("")}if(s={version:"1.3.2",ucs2:{decode:g,encode:T},decode:R,encode:x,toASCII:function(t){return E(t,(function(t){return c.test(t)?"xn--"+x(t):t}))},toUnicode:function(t){return E(t,(function(t){return l.test(t)?R(t.slice(4).toLowerCase()):t}))}},i&&n)if(t.exports==i)n.exports=s;else for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);else r.punycode=s}(st)})),Bt=function(t){return"string"==typeof t},Gt=function(t){return"object"==typeof t&&null!==t},Xt=function(t){return null===t},kt=function(t){return null==t};function Ht(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Yt=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=f.substr(0,p),l=f.substr(p+1)):(u=f,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),Ht(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},jt=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Vt=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(jt(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(jt(t))})).join(e):n+encodeURIComponent(jt(t[i]))})).join(e):i?encodeURIComponent(jt(i))+r+encodeURIComponent(jt(t)):""},Wt=at((function(t,e){e.decode=e.parse=Yt,e.encode=e.stringify=Vt})),zt=ue,qt=function(t,e){return ue(t,!1,!0).resolve(e)},Kt=function(t){Bt(t)&&(t=ue(t));if(!(t instanceof Zt))return Zt.prototype.format.call(t);return t.format()};function Zt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Qt=/^([a-z0-9.+-]+:)/i,Jt=/:[0-9]*$/,$t=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,te=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),ee=["'"].concat(te),re=["%","/","?",";","#"].concat(ee),ie=["/","?","#"],ne=/^[+a-z0-9A-Z_-]{0,63}$/,oe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,se={javascript:!0,"javascript:":!0},ae={javascript:!0,"javascript:":!0},he={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ue(t,e,r){if(t&&Gt(t)&&t instanceof Zt)return t;var i=new Zt;return i.parse(t,e,r),i}Zt.prototype.parse=function(t,e,r){if(!Bt(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?T+="x":T+=g[y];if(!T.match(ne)){var R=m.slice(0,p),x=m.slice(p+1),A=g.match(oe);A&&(R.push(A[1]),x.unshift(A[2])),x.length&&(s="/"+x.join(".")+s),this.hostname=R.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=Ut.toASCII(this.hostname));var S=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+S,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!se[u])for(p=0,E=ee.length;p0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift());return r.search=t.search,r.query=t.query,Xt(r.pathname)&&Xt(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var y=g.slice(-1)[0],b=(r.host||t.host||g.length>1)&&("."===y||".."===y)||""===y,R=0,x=g.length;x>=0;x--)"."===(y=g[x])?g.splice(x,1):".."===y?(g.splice(x,1),R++):R&&(g.splice(x,1),R--);if(!m&&!E)for(;R--;R)g.unshift("..");!m||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),b&&"/"!==g.join("/").substr(-1)&&g.push("");var A,S=""===g[0]||g[0]&&"/"===g[0].charAt(0);T&&(r.hostname=r.host=S?"":g.length?g.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift()));return(m=m||r.host&&g.length)&&!S&&g.unshift(""),g.length?r.pathname=g.join("/"):(r.pathname=null,r.path=null),Xt(r.pathname)&&Xt(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Zt.prototype.parseHost=function(){var t=this.host,e=Jt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};t.ENV=void 0,t.RENDERER_TYPE=void 0,t.BUFFER_BITS=void 0,t.BLEND_MODES=void 0,t.DRAW_MODES=void 0,t.FORMATS=void 0,t.TARGETS=void 0,t.TYPES=void 0,t.SAMPLER_TYPES=void 0,t.SCALE_MODES=void 0,t.WRAP_MODES=void 0,t.MIPMAP_MODES=void 0,t.ALPHA_MODES=void 0,t.CLEAR_MODES=void 0,t.GC_MODES=void 0,t.PRECISION=void 0,t.MASK_TYPES=void 0,t.COLOR_MASK_BITS=void 0,t.MSAA_QUALITY=void 0,t.BUFFER_TYPE=void 0,function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(t.ENV||(t.ENV={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(t.RENDERER_TYPE||(t.RENDERER_TYPE={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(t.BUFFER_BITS||(t.BUFFER_BITS={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(t.BLEND_MODES||(t.BLEND_MODES={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(t.DRAW_MODES||(t.DRAW_MODES={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(t.FORMATS||(t.FORMATS={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(t.TARGETS||(t.TARGETS={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(t.TYPES||(t.TYPES={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(t.SAMPLER_TYPES||(t.SAMPLER_TYPES={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(t.SCALE_MODES||(t.SCALE_MODES={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(t.WRAP_MODES||(t.WRAP_MODES={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(t.MIPMAP_MODES||(t.MIPMAP_MODES={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(t.ALPHA_MODES||(t.ALPHA_MODES={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(t.CLEAR_MODES||(t.CLEAR_MODES={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(t.GC_MODES||(t.GC_MODES={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(t.PRECISION||(t.PRECISION={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR"}(t.MASK_TYPES||(t.MASK_TYPES={})),function(t){t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA"}(t.COLOR_MASK_BITS||(t.COLOR_MASK_BITS={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(t.MSAA_QUALITY||(t.MSAA_QUALITY={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(t.BUFFER_TYPE||(t.BUFFER_TYPE={}));var le={parse:zt,format:Kt,resolve:qt};function ce(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function de(t){return t.split("?")[0].split("#")[0]}var fe={toPosix:function(t){return"\\","/",t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/")},isUrl:function(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:function(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},hasProtocol:function(t){return/^[^/:]+:\//.test(this.toPosix(t))},getProtocol:function(t){ce(t),t=this.toPosix(t);var e="",r=/^file:\/\/\//.exec(t),i=/^[^/:]+:\/\//.exec(t),n=/^[^/:]+:\//.exec(t);if(r||i||n){var o=(null==r?void 0:r[0])||(null==i?void 0:i[0])||(null==n?void 0:n[0]);e=o,t=t.slice(o.length)}return e},toAbsolute:function(t,e,r){if(this.isDataUrl(t))return t;var i=de(this.toPosix(null!=e?e:ot.ADAPTER.getBaseUrl())),n=de(this.toPosix(null!=r?r:this.rootname(i)));return ce(t),(t=this.toPosix(t)).startsWith("/")?fe.join(n,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize:function(t){if(ce(t=this.toPosix(t)),0===t.length)return".";var e="",r=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));var i=t.endsWith("/");return(t=function(t,e){for(var r,i="",n=0,o=-1,s=0,a=0;a<=t.length;++a){if(a2){var h=i.lastIndexOf("/");if(h!==i.length-1){-1===h?(i="",n=0):n=(i=i.slice(0,h)).length-1-i.lastIndexOf("/"),o=a,s=0;continue}}else if(2===i.length||1===i.length){i="",n=0,o=a,s=0;continue}}else i.length>0?i+="/"+t.slice(o+1,a):i=t.slice(o+1,a),n=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return i}(t)).length>0&&i&&(t+="/"),r?"/"+t:e+t},isAbsolute:function(t){return ce(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join:function(){for(var t,e,r=arguments,i=[],n=0;n0)if(void 0===e)e=s;else{var a=null!==(t=i[o-1])&&void 0!==t?t:"";this.extname(a)?e+="/../"+s:e+="/"+s}}return void 0===e?".":this.normalize(e)},dirname:function(t){if(ce(t),0===t.length)return".";for(var e=(t=this.toPosix(t)).charCodeAt(0),r=47===e,i=-1,n=!0,o=this.getProtocol(t),s=t,a=(t=t.slice(o.length)).length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!n){i=a;break}}else n=!1;return-1===i?r?"/":this.isUrl(s)?o+t:o:r&&1===i?"//":o+t.slice(0,i)},rootname:function(t){ce(t);var e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){var r=t.indexOf("/",e.length);(e=-1!==r?t.slice(0,r):t).endsWith("/")||(e+="/")}return e},basename:function(t,e){ce(t),e&&ce(e),t=this.toPosix(t);var r,i=0,n=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){var h=t.charCodeAt(r);if(47===h){if(!o){i=r+1;break}}else-1===a&&(o=!1,a=r+1),s>=0&&(h===e.charCodeAt(s)?-1==--s&&(n=r):(s=-1,n=a))}return i===n?n=a:-1===n&&(n=t.length),t.slice(i,n)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!o){i=r+1;break}}else-1===n&&(o=!1,n=r+1);return-1===n?"":t.slice(i,n)},extname:function(t){ce(t);for(var e=-1,r=0,i=-1,n=!0,o=0,s=(t=this.toPosix(t)).length-1;s>=0;--s){var a=t.charCodeAt(s);if(47!==a)-1===i&&(n=!1,i=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1);else if(!n){r=s+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===r+1?"":t.slice(e,i)},parse:function(t){ce(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,i=(t=this.toPosix(t)).charCodeAt(0),n=this.isAbsolute(t);e.root=this.rootname(t),r=n||this.hasProtocol(t)?1:0;for(var o=-1,s=0,a=-1,h=!0,u=t.length-1,l=0;u>=r;--u)if(47!==(i=t.charCodeAt(u)))-1===a&&(h=!1,a=u+1),46===i?-1===o?o=u:1!==l&&(l=1):-1!==o&&(l=-1);else if(!h){s=u+1;break}return-1===o||-1===a||0===l||1===l&&o===a-1&&o===s+1?-1!==a&&(e.base=e.name=0===s&&n?t.slice(1,a):t.slice(s,a)):(0===s&&n?(e.name=t.slice(1,o),e.base=t.slice(1,a)):(e.name=t.slice(s,o),e.base=t.slice(s,a)),e.ext=t.slice(o,a)),e.dir=this.dirname(t),e},sep:"/",delimiter:":"};ot.RETINA_PREFIX=/@([0-9\.]+)x/,ot.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var pe,_e=!1;function ve(t){var e;if(!_e){if(ot.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS 6.5.3 - ✰ "+t+" ✰  %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;"];(e=globalThis.console).log.apply(e,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.5.3 - "+t+" - http://www.pixijs.com/");_e=!0}}function me(){return void 0===pe&&(pe=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:ot.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!ot.ADAPTER.getWebGLRenderingContext())return!1;var e=ot.ADAPTER.createCanvas(),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),pe}var Ee={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 ge(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Te(t){var e=t.toString(16);return"#"+("000000".substring(0,6-e.length)+e)}function ye(t){return"string"==typeof t&&"#"===(t=Ee[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}function be(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var Re=function(){for(var e=[],r=[],i=0;i<32;i++)e[i]=i,r[i]=i;e[t.BLEND_MODES.NORMAL_NPM]=t.BLEND_MODES.NORMAL,e[t.BLEND_MODES.ADD_NPM]=t.BLEND_MODES.ADD,e[t.BLEND_MODES.SCREEN_NPM]=t.BLEND_MODES.SCREEN,r[t.BLEND_MODES.NORMAL]=t.BLEND_MODES.NORMAL_NPM,r[t.BLEND_MODES.ADD]=t.BLEND_MODES.ADD_NPM,r[t.BLEND_MODES.SCREEN]=t.BLEND_MODES.SCREEN_NPM;var n=[];return n.push(r),n.push(e),n}();function xe(t,e){return Re[e?1:0][t]}function Ae(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function Se(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n*e+.5|0)}function Oe(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function Ie(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function Ne(t){return!(t&t-1||!t)}function Ce(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function we(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i=this.x&&t=this.y&&et.right?t.right:this.right)<=r)return!1;var i=this.yt.bottom?t.bottom:this.bottom)>i}var n=this.left,o=this.right,s=this.top,a=this.bottom;if(o<=n||a<=s)return!1;var h=$e[0].set(t.left,t.top),u=$e[1].set(t.left,t.bottom),l=$e[2].set(t.right,t.top),c=$e[3].set(t.right,t.bottom);if(l.x<=h.x||u.y<=h.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d)return!1;if(e.apply(h,h),e.apply(u,u),e.apply(l,l),e.apply(c,c),Math.max(h.x,u.x,l.x,c.x)<=n||Math.min(h.x,u.x,l.x,c.x)>=o||Math.max(h.y,u.y,l.y,c.y)<=s||Math.min(h.y,u.y,l.y,c.y)>=a)return!1;var f=d*(u.y-h.y),p=d*(h.x-u.x),_=f*n+p*s,v=f*o+p*s,m=f*n+p*a,E=f*o+p*a;if(Math.max(_,v,m,E)<=f*h.x+p*h.y||Math.min(_,v,m,E)>=f*c.x+p*c.y)return!1;var g=d*(h.y-l.y),T=d*(l.x-h.x),y=g*n+T*s,b=g*o+T*s,R=g*n+T*a,x=g*o+T*a;return!(Math.max(y,b,R,x)<=g*h.x+T*h.y||Math.min(y,b,R,x)>=g*c.x+T*c.y)},e.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},e.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0),this},e.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this},e.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=n-i,this},e}(),er=function(){function e(e,r,i){void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=e,this.y=r,this.radius=i,this.type=t.SHAPES.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=r},e.prototype.getBounds=function(){return new tr(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},e}(),rr=function(){function e(e,r,i,n){void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=e,this.y=r,this.width=i,this.height=n,this.type=t.SHAPES.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return(r*=r)+(i*=i)<=1},e.prototype.getBounds=function(){return new tr(this.x-this.width,this.y-this.height,this.width,this.height)},e}(),ir=function(){function e(){for(var e=arguments,r=[],i=0;ie!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r},e}(),nr=function(){function e(e,r,i,n,o){void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=20),this.x=e,this.y=r,this.width=i,this.height=n,this.radius=o,this.type=t.SHAPES.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;var i=t-(this.x+r),n=e-(this.y+r),o=r*r;if(i*i+n*n<=o)return!0;if((i=t-(this.x+this.width-r))*i+n*n<=o)return!0;if(i*i+(n=e-(this.y+this.height-r))*n<=o)return!0;if((i=t-(this.x+r))*i+n*n<=o)return!0}return!1},e}(),or=function(){function t(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=t,this.scope=e}return t.prototype.clone=function(e,r){return void 0===e&&(e=this.cb),void 0===r&&(r=this.scope),new t(e,r,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),sr=function(){function t(t,e,r,i,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},t.prototype.apply=function(t,e){e=e||new Je;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new Je;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},t.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.a=Math.cos(s+h)*n,this.b=Math.sin(s+h)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=t.pivot,s=-Math.atan2(-i,n),a=Math.atan2(r,e),h=Math.abs(s+a);return h<1e-5||Math.abs(Ke-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*n),t},t.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),ar=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],hr=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ur=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],lr=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],cr=[],dr=[],fr=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];cr.push(e);for(var r=0;r<16;r++)for(var i=fr(ar[t]*ar[r]+ur[t]*hr[r]),n=fr(hr[t]*ar[r]+lr[t]*hr[r]),o=fr(ar[t]*ur[r]+ur[t]*lr[r]),s=fr(hr[t]*ur[r]+lr[t]*lr[r]),a=0;a<16;a++)if(ar[a]===i&&hr[a]===n&&ur[a]===o&&lr[a]===s){e.push(a);break}}for(t=0;t<16;t++){var h=new sr;h.set(ar[t],hr[t],ur[t],lr[t],0,0),dr.push(h)}}();var pr={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(t){return ar[t]},uY:function(t){return hr[t]},vX:function(t){return ur[t]},vY:function(t){return lr[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return cr[t][e]},sub:function(t,e){return cr[t][pr.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?pr.S:pr.N:2*Math.abs(e)<=Math.abs(t)?t>0?pr.E:pr.W:e>0?t>0?pr.SE:pr.SW:t>0?pr.NE:pr.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=dr[pr.inv(e)];n.tx=r,n.ty=i,t.append(n)}},_r=function(){function t(){this.worldTransform=new sr,this.localTransform=new sr,this.position=new or(this.onChange,this,0,0),this.scale=new or(this.onChange,this,1,1),this.pivot=new or(this.onChange,this,0,0),this.skew=new or(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 t.prototype.onChange=function(){this._localID++},t.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++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();ot.SORTABLE_CHILDREN=!1;var vr=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?tr.EMPTY:((t=t||new tr(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,e){var r=t.a,i=t.b,n=t.c,o=t.d,s=t.tx,a=t.ty,h=r*e.x+n*e.y+s,u=i*e.x+o*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,u),this.maxY=Math.max(this.maxY,u)},t.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},t.prototype.addFrame=function(t,e,r,i,n){this.addFrameMatrix(t.worldTransform,e,r,i,n)},t.prototype.addFrameMatrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,_=o*e+a*r+u,v=s*e+h*r+l;c=_f?_:f,p=v>p?v:p,c=(_=o*i+a*r+u)f?_:f,p=v>p?v:p,c=(_=o*e+a*n+u)f?_:f,p=v>p?v:p,c=(_=o*i+a*n+u)f?_:f,p=v>p?v:p,this.minX=c,this.minY=d,this.maxX=f,this.maxY=p},t.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;ao?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},t.prototype.addVertices=function(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)},t.prototype.addVerticesMatrix=function(t,e,r,i,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,d=this.minX,f=this.minY,p=this.maxX,_=this.maxY,v=r;vi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},t.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXh?n:h,this.maxY=o>u?o:u}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXh?n:h,this.maxY=o>u?o:u}},t.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},t.prototype.addFramePad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minX=this.minXr?this.maxX:r,this.minY=this.minYi?this.maxY:i},t}(),mr=function(t,e){return mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},mr(t,e)};function Er(t,e){function r(){this.constructor=t}mr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var gr,Tr,yr,br,Rr,xr,Ar,Sr,Or,Ir,Mr,Pr,Dr,Nr,Cr,wr,Lr,Fr,Ur,Br,Gr=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new _r,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new vr,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return Er(e,t),e.mixin=function(t){for(var r=Object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);we(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r1)for(var i=0;i0&&n<=e){r=this.children.splice(i,n);for(var o=0;o1&&this.children.sort(kr),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t0&&r.height>0){var i,n;if(this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==e.prototype._render&&(i=this.getBounds(!0)),i&&r.intersects(i,n))this._render(t);else if(this.cullArea)return;for(var o=0,s=this.children.length;o8)throw new Error("max arguments reached");var h=this,u=h.name,l=h.items;this._aliasCount++;for(var c=0,d=l.length;c0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(Wr.prototype,{dispatch:{value:Wr.prototype.emit},run:{value:Wr.prototype.emit}}),t.UPDATE_PRIORITY=void 0,ot.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(t.UPDATE_PRIORITY||(t.UPDATE_PRIORITY={}));var zr=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),qr=function(){function e(){var t=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 zr(null,null,1/0),this.deltaMS=1/ot.TARGET_FPMS,this.elapsedMS=1/ot.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return e.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},e.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},e.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},e.prototype.add=function(e,r,i){return void 0===i&&(i=t.UPDATE_PRIORITY.NORMAL),this._addListener(new zr(e,r,i))},e.prototype.addOnce=function(e,r,i){return void 0===i&&(i=t.UPDATE_PRIORITY.NORMAL),this._addListener(new zr(e,r,i,!0))},e.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r=0;--n){var o=Zr[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Jr=function(t,e){return Jr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Jr(t,e)};function $r(t,e){function r(){this.constructor=t}Jr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var ti=function(){return ti=Object.assign||function(t){for(var e,r=arguments,i=1,n=arguments.length;i0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(r),n}return $r(r,e),Object.defineProperty(r.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),r.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},r.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},r.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},r.prototype._refreshPOT=function(){this.isPowerOfTwo=Ne(this.realWidth)&&Ne(this.realHeight)},r.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},r.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},r.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))},r.prototype.onError=function(t){this.emit("error",this,t)},r.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete ke[this.cacheId],delete Xe[this.cacheId],this.cacheId=null),this.dispose(),r.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},r.prototype.dispose=function(){this.emit("dispose",this)},r.prototype.castToBaseTexture=function(){return this},r.from=function(t,e,i){void 0===i&&(i=ot.STRICT_TEXTURE_CACHE);var n="string"==typeof t,o=null;if(n)o=t;else{if(!t._pixiId){var s=e&&e.pixiIdPrefix||"pixiid";t._pixiId=s+"_"+Ue()}o=t._pixiId}var a=ke[o];if(n&&i&&!a)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return a||((a=new r(t,e)).cacheId=o,r.addToCache(a,o)),a},r.fromBuffer=function(e,i,n,o){e=e||new Float32Array(i*n*4);var s=new ri(e,{width:i,height:n}),a=e instanceof Float32Array?t.TYPES.FLOAT:t.TYPES.UNSIGNED_BYTE;return new r(s,Object.assign(ii,o||{width:i,height:n,type:a}))},r.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),ke[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),ke[e]=t)},r.removeFromCache=function(t){if("string"==typeof t){var e=ke[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete ke[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i0){if(!e.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(e.resource,r)}else e.target=t.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+r,e.parentTextureArray=this.baseTexture,this.items[r]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[r]=e,this},r.prototype.upload=function(t,e,i){for(var n=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(ai),di=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof r&&(r=[r]);var s=r[0].src||r[0];ai.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(qr.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(qr.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(qr.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(qr.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(qr.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,r){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(ai),fi=function(t){function e(e){return t.call(this,e)||this}return $r(e,t),e.test=function(t){return!!globalThis.createImageBitmap&&"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap},e}(ai);Zr.push(li,fi,hi,di,ci,ri,ui,si);var pi={__proto__:null,Resource:ei,BaseImageResource:ai,INSTALLED:Zr,autoDetectResource:Qr,AbstractMultiResource:oi,ArrayResource:si,BufferResource:ri,CanvasResource:hi,CubeResource:ui,ImageResource:li,SVGResource:ci,VideoResource:di,ImageBitmapResource:fi},_i=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return $r(r,e),r.prototype.upload=function(e,r,i){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===t.ALPHA_MODES.UNPACK);var o=r.realWidth,s=r.realHeight;return i.width===o&&i.height===s?n.texSubImage2D(r.target,0,0,0,o,s,r.format,i.type,this.data):(i.width=o,i.height=s,n.texImage2D(r.target,0,i.internalFormat,o,s,0,r.format,i.type,this.data)),!0},r}(ri),vi=function(){function e(e,r){this.width=Math.round(e||100),this.height=Math.round(r||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 Wr("disposeFramebuffer"),this.multisample=t.MSAA_QUALITY.NONE}return Object.defineProperty(e.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,r){return void 0===e&&(e=0),this.colorTextures[e]=r||new ni(null,{scaleMode:t.SCALE_MODES.NEAREST,resolution:1,mipmap:t.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new ni(new _i(null,{width:this.width,height:this.height}),{scaleMode:t.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:t.MIPMAP_MODES.OFF,format:t.FORMATS.DEPTH_COMPONENT,type:t.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&e.textureCacheIds.splice(r,1),delete Xe[t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new ni),Ti(e._EMPTY),Ti(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=ot.ADAPTER.createCanvas(16,16),r=t.getContext("2d");t.width=16,t.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),e._WHITE=new e(ni.from(t)),Ti(e._WHITE),Ti(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(ht),bi=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return $r(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(t*i)/i,o=Math.round(e*i)/i;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(n,o),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){for(var r=arguments,i=[],n=1;n1?-n:-1:(o=((65535&(e=De(e)))<<16|65535&(r=De(r)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);var s=this.texturePool[o].pop();return s||(s=this.createTexture(e,r,n)),s.filterPoolKey=o,s.setResolution(i),s},e.prototype.getFilterTexture=function(e,r,i){var n=this.getOptimalTexture(e.width,e.height,r||e.resolution,i||t.MSAA_QUALITY.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},e.prototype.returnFilterTexture=function(t){this.returnTexture(t)},e.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var i=0;i1){for(var u=0;u1&&((c=this.getOptimalFilterTexture(l.width,l.height,r.resolution)).filterFrame=l.filterFrame),i[d].apply(this,l,c,t.CLEAR_MODES.CLEAR,r);var f=l;l=c,c=f}i[d].apply(this,l,u.renderTexture,t.CLEAR_MODES.BLEND,r),d>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}r.clear(),this.statePool.push(r)},e.prototype.bindAndClear=function(e,r){void 0===r&&(r=t.CLEAR_MODES.CLEAR);var i=this.renderer,n=i.renderTexture,o=i.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var s=this.tempRect;s.x=0,s.y=0,s.width=e.filterFrame.width,s.height=e.filterFrame.height,n.bind(e,e.filterFrame,s)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=1&o.stateId||this.forceClear;(r===t.CLEAR_MODES.CLEAR||r===t.CLEAR_MODES.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,r,i,n){var o=this.renderer;o.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,o.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(t.DRAW_MODES.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(t.DRAW_MODES.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(sr.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,r,i,n){return void 0===i&&(i=1),void 0===n&&(n=t.MSAA_QUALITY.NONE),this.texturePool.getOptimalTexture(e,r,i,n)},e.prototype.getFilterTexture=function(e,r,i){if("number"==typeof e){var n=e;e=r,r=n}e=e||this.activeState.renderTexture;var o=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,i||t.MSAA_QUALITY.NONE);return o.filterFrame=e.filterFrame,o},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(t,e){var r=Ui[0],i=Ui[1],n=Ui[2],o=Ui[3];r.set(e.left,e.top),i.set(e.left,e.bottom),n.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(n,n),t.apply(o,o);var s=Math.min(r.x,i.x,n.x,o.x),a=Math.min(r.y,i.y,n.y,o.y),h=Math.max(r.x,i.x,n.x,o.x),u=Math.max(r.y,i.y,n.y,o.y);e.x=s,e.y=a,e.width=h-s,e.height=u-a},e.prototype.roundFrame=function(t,e,r,i,n){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(n){var o=n.a,s=n.b,a=n.c,h=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(h)>1e-4))return}(n=n?Bi.copyFrom(n):Bi.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}},e}(),Xi=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),ki=function(){function t(t){this.renderer=t,this.emptyRenderer=new Xi(t),this.currentRenderer=this.emptyRenderer}return t.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},t.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},t.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},t.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h=0&&l=t.ENV.WEBGL2&&(i=e.getContext("webgl2",r)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(),ji=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=t.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},Vi=new tr,Wi=function(){function e(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new vi(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new tr,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var r=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;ot.PREFER_ENV===t.ENV.WEBGL_LEGACY&&(r=null,i=null),r?e.drawBuffers=function(t){return r.drawBuffersWEBGL(t)}:(this.hasMRT=!1,e.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(t,e,r){void 0===r&&(r=0);var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=r),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>r,h=e.height>>r,u=a/e.width;this.setViewport(e.x*u,e.y*u,a,h)}else a=t.width>>r,h=t.height>>r,this.setViewport(0,0,a,h)}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,r,i){var n=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(e.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}),e.prototype.clear=function(e,r,i,n,o){void 0===o&&(o=t.BUFFER_BITS.COLOR|t.BUFFER_BITS.DEPTH);var s=this.gl;s.clearColor(e,r,i,n),s.clear(o)},e.prototype.initFramebuffer=function(t){var e=this.gl,r=new ji(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},e.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,n=i.length;e.drawBuffers||(n=Math.min(n,1));for(var o=0;o1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var s=[],a=0;a1&&r.drawBuffers(s),t.depthTexture&&this.writeDepthTexture){var l=t.depthTexture;this.renderer.texture.bind(l,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture?i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},e.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},e.prototype.detectSamples=function(e){var r=this.msaaSamples,i=t.MSAA_QUALITY.NONE;if(e<=1||null===r)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=t.ENV.WEBGL2&&(r=e.getContext("webgl2",{})),r||((r=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?r.getExtension("WEBGL_draw_buffers"):r=null),rn=r}return rn}function on(e,r,i){if("precision"!==e.substring(0,9)){var n=r;return r===t.PRECISION.HIGH&&i!==t.PRECISION.HIGH&&(n=t.PRECISION.MEDIUM),"precision "+n+" float;\n"+e}return i!==t.PRECISION.HIGH&&"precision highp"===e.substring(0,15)?e.replace("precision highp","precision mediump"):e}var sn={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 an(t){return sn[t]}var hn=null,un={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 ln(t,e){if(!hn){var r=Object.keys(un);hn={};for(var i=0;i0&&(e+="\nelse "),r0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))},e.prototype.destroy=function(){this.renderer=null},e}(),In=function(){function t(t){this.renderer=t,this.maskStack=[],this.glConst=0}return t.prototype.getStackLength=function(){return this.maskStack.length},t.prototype.setMaskStack=function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},t.prototype._useCurrent=function(){},t.prototype.destroy=function(){this.renderer=null,this.maskStack=null},t}(),Mn=new sr,Pn=[],Dn=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=ot.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,r}return $r(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var e;if(!t._scissorRectLocal){var r=t._scissorRect,i=t.maskObject,n=this.renderer,o=n.renderTexture,s=i.getBounds(!0,null!==(e=Pn.pop())&&void 0!==e?e:new tr);this.roundFrameToPixels(s,o.current?o.current.resolution:n.resolution,o.sourceFrame,o.destinationFrame,n.projection.transform),r&&s.fit(r),t._scissorRectLocal=s}},e.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,r=t.b,i=t.c,n=t.d;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)},e.prototype.testScissor=function(t){var r=t.maskObject;if(!r.isFastRect||!r.isFastRect())return!1;if(e.isMatrixRotated(r.worldTransform))return!1;if(e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var i=t._scissorRectLocal;return i.width>0&&i.height>0},e.prototype.roundFrameToPixels=function(t,r,i,n,o){e.isMatrixRotated(o)||((o=o?Mn.copyFrom(o):Mn.identity()).translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(o,t),t.fit(n),t.x=Math.round(t.x*r),t.y=Math.round(t.y*r),t.width=Math.round(t.width*r),t.height=Math.round(t.height*r))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;t&&Pn.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},e}(In),Nn=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=ot.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,r}return $r(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++;var n=t._colorMask;0!==n&&(t._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilFunc(r.EQUAL,i,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==n&&(t._colorMask=n,r.colorMask(0!=(1&n),0!=(2&n),0!=(4&n),0!=(8&n))),this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{var r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=r?r._colorMask:15;0!==i&&(r._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==i&&(r._colorMask=i,e.colorMask(0!=(1&i),0!=(2&i),0!=(4&i),0!=(8&i))),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(In),Cn=function(){function t(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new sr,this.transform=null}return t.prototype.update=function(t,e,r,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},t.prototype.calculateProjection=function(t,e,r,i){var n=this.projectionMatrix,o=i?-1:1;n.identity(),n.a=1/e.width*2,n.d=o*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-o-e.y*n.d},t.prototype.setTransform=function(t){},t.prototype.destroy=function(){this.renderer=null},t}(),wn=new tr,Ln=new tr,Fn=function(){function t(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new tr,this.destinationFrame=new tr,this.viewportFrame=new tr}return t.prototype.bind=function(t,e,r){void 0===t&&(t=null);var i,n,o,s=this.renderer;this.current=t,t?(o=(i=t.baseTexture).resolution,e||(wn.width=t.frame.width,wn.height=t.frame.height,e=wn),r||(Ln.x=t.frame.x,Ln.y=t.frame.y,Ln.width=e.width,Ln.height=e.height,r=Ln),n=i.framebuffer):(o=s.resolution,e||(wn.width=s.screen.width,wn.height=s.screen.height,e=wn),r||((r=wn).width=e.width,r.height=e.height));var a=this.viewportFrame;a.x=r.x*o,a.y=r.y*o,a.width=r.width*o,a.height=r.height*o,t||(a.y=s.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(r,e,o,!n),t?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)},t.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor;var r=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,n=r.width!==i.width||r.height!==i.height;if(n){var o=this.viewportFrame,s=o.x,a=o.y,h=o.width,u=o.height;s=Math.round(s),a=Math.round(a),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,a,h,u)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),n&&this.renderer.scissor.pop()},t.prototype.resize=function(){this.bind(null)},t.prototype.reset=function(){this.bind(null)},t.prototype.destroy=function(){this.renderer=null},t}();function Un(t,e,r,i,n){r.buffer.update(n)}var Bn={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    "},Gn={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 Xn(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),r=0,i=0,n=0,o=0;o1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,i%r!=0&&i<16){var a=i%r%16;i+=a,n+=a}i+r>16?(n=16*Math.ceil(n/16),s.offset=n,n+=r,i=r):(s.offset=n,i+=r,n+=r)}return{uboElements:e,size:n=16*Math.ceil(n/16)}}function kn(t,e){var r=[];for(var i in t)e[i]&&r.push(e[i]);return r.sort((function(t,e){return t.index-e.index})),r}function Hn(t,e){if(!t.autoManage)return{size:0,syncFunc:Un};for(var r=Xn(kn(t.uniforms,e)),i=r.uboElements,n=r.size,o=["\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    "],s=0;s1){var f=an(a.data.type),p=Math.max(Gn[a.data.type]/16,1),_=f/p,v=(4-_%4)%4;o.push("\n                cv = ud."+u+".value;\n                v = uv."+u+";\n                offset = "+a.offset/4+";\n\n                t = 0;\n\n                for(var i=0; i < "+a.data.size*p+"; i++)\n                {\n                    for(var j = 0; j < "+_+"; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += "+v+";\n                }\n\n                ")}else{var m=Bn[a.data.type];o.push("\n                cv = ud."+u+".value;\n                v = uv."+u+";\n                offset = "+a.offset/4+";\n                "+m+";\n                ")}}return o.push("\n       renderer.buffer.update(buffer);\n    "),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join("\n"))}}var Yn=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},t}();function jn(t,e){var r=Zi(t,t.VERTEX_SHADER,e.vertexSrc),i=Zi(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();if(t.attachShader(n,r),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Qi(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Qi(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,r,i),e.attributeData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;ne?1:-1}));for(var s=0;s>=1,r++;this.stateId=t.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(t.children[i])},e.prototype.destroy=function(){this.renderer=null},e}(),Zn=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=t.TYPES.UNSIGNED_BYTE,this.internalFormat=t.FORMATS.RGBA,this.samplerType=0},Qn=function(){function e(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new ni,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(e){var r,i,n,o,s,a,h,u,l,c,d,f,p,_,v,m,E,g,T,y,b,R,x;return"WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((r={})[t.TYPES.UNSIGNED_BYTE]=((i={})[t.FORMATS.RGBA]=e.RGBA8,i[t.FORMATS.RGB]=e.RGB8,i[t.FORMATS.RG]=e.RG8,i[t.FORMATS.RED]=e.R8,i[t.FORMATS.RGBA_INTEGER]=e.RGBA8UI,i[t.FORMATS.RGB_INTEGER]=e.RGB8UI,i[t.FORMATS.RG_INTEGER]=e.RG8UI,i[t.FORMATS.RED_INTEGER]=e.R8UI,i[t.FORMATS.ALPHA]=e.ALPHA,i[t.FORMATS.LUMINANCE]=e.LUMINANCE,i[t.FORMATS.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,i),r[t.TYPES.BYTE]=((n={})[t.FORMATS.RGBA]=e.RGBA8_SNORM,n[t.FORMATS.RGB]=e.RGB8_SNORM,n[t.FORMATS.RG]=e.RG8_SNORM,n[t.FORMATS.RED]=e.R8_SNORM,n[t.FORMATS.RGBA_INTEGER]=e.RGBA8I,n[t.FORMATS.RGB_INTEGER]=e.RGB8I,n[t.FORMATS.RG_INTEGER]=e.RG8I,n[t.FORMATS.RED_INTEGER]=e.R8I,n),r[t.TYPES.UNSIGNED_SHORT]=((o={})[t.FORMATS.RGBA_INTEGER]=e.RGBA16UI,o[t.FORMATS.RGB_INTEGER]=e.RGB16UI,o[t.FORMATS.RG_INTEGER]=e.RG16UI,o[t.FORMATS.RED_INTEGER]=e.R16UI,o[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,o),r[t.TYPES.SHORT]=((s={})[t.FORMATS.RGBA_INTEGER]=e.RGBA16I,s[t.FORMATS.RGB_INTEGER]=e.RGB16I,s[t.FORMATS.RG_INTEGER]=e.RG16I,s[t.FORMATS.RED_INTEGER]=e.R16I,s),r[t.TYPES.UNSIGNED_INT]=((a={})[t.FORMATS.RGBA_INTEGER]=e.RGBA32UI,a[t.FORMATS.RGB_INTEGER]=e.RGB32UI,a[t.FORMATS.RG_INTEGER]=e.RG32UI,a[t.FORMATS.RED_INTEGER]=e.R32UI,a[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,a),r[t.TYPES.INT]=((h={})[t.FORMATS.RGBA_INTEGER]=e.RGBA32I,h[t.FORMATS.RGB_INTEGER]=e.RGB32I,h[t.FORMATS.RG_INTEGER]=e.RG32I,h[t.FORMATS.RED_INTEGER]=e.R32I,h),r[t.TYPES.FLOAT]=((u={})[t.FORMATS.RGBA]=e.RGBA32F,u[t.FORMATS.RGB]=e.RGB32F,u[t.FORMATS.RG]=e.RG32F,u[t.FORMATS.RED]=e.R32F,u[t.FORMATS.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,u),r[t.TYPES.HALF_FLOAT]=((l={})[t.FORMATS.RGBA]=e.RGBA16F,l[t.FORMATS.RGB]=e.RGB16F,l[t.FORMATS.RG]=e.RG16F,l[t.FORMATS.RED]=e.R16F,l),r[t.TYPES.UNSIGNED_SHORT_5_6_5]=((c={})[t.FORMATS.RGB]=e.RGB565,c),r[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=((d={})[t.FORMATS.RGBA]=e.RGBA4,d),r[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=((f={})[t.FORMATS.RGBA]=e.RGB5_A1,f),r[t.TYPES.UNSIGNED_INT_2_10_10_10_REV]=((p={})[t.FORMATS.RGBA]=e.RGB10_A2,p[t.FORMATS.RGBA_INTEGER]=e.RGB10_A2UI,p),r[t.TYPES.UNSIGNED_INT_10F_11F_11F_REV]=((_={})[t.FORMATS.RGB]=e.R11F_G11F_B10F,_),r[t.TYPES.UNSIGNED_INT_5_9_9_9_REV]=((v={})[t.FORMATS.RGB]=e.RGB9_E5,v),r[t.TYPES.UNSIGNED_INT_24_8]=((m={})[t.FORMATS.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,m),r[t.TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]=((E={})[t.FORMATS.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,E),x=r):((g={})[t.TYPES.UNSIGNED_BYTE]=((T={})[t.FORMATS.RGBA]=e.RGBA,T[t.FORMATS.RGB]=e.RGB,T[t.FORMATS.ALPHA]=e.ALPHA,T[t.FORMATS.LUMINANCE]=e.LUMINANCE,T[t.FORMATS.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,T),g[t.TYPES.UNSIGNED_SHORT_5_6_5]=((y={})[t.FORMATS.RGB]=e.RGB,y),g[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=((b={})[t.FORMATS.RGBA]=e.RGBA,b),g[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=((R={})[t.FORMATS.RGBA]=e.RGBA,R),x=g),x}(e);var r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(var i=0;i=0;--s){var a=i[s];a&&a._glTextures[o].samplerType!==t.SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(a)}},e.prototype.initTexture=function(t){var e=new Zn(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(e,r){var i,n;r.internalFormat=null!==(n=null===(i=this.internalFormats[e.type])||void 0===i?void 0:i[e.format])&&void 0!==n?n:e.format,2===this.webGLVersion&&e.type===t.TYPES.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type},e.prototype.updateTexture=function(e){var r=e._glTextures[this.CONTEXT_UID];if(r){var i=this.renderer;if(this.initTextureType(e,r),e.resource&&e.resource.upload(i,e,r))r.samplerType!==t.SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,o=e.realHeight,s=i.gl;(r.width!==n||r.height!==o||r.dirtyId<0)&&(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&we(this.managedTextures,i,1)}},e.prototype.updateTextureStyle=function(e){var r=e._glTextures[this.CONTEXT_UID];r&&(e.mipmap!==t.MIPMAP_MODES.POW2&&2===this.webGLVersion||e.isPowerOfTwo?r.mipmap=e.mipmap>=1:r.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?r.wrapMode=e.wrapMode:r.wrapMode=t.WRAP_MODES.CLAMP,e.resource&&e.resource.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,r){var i=this.gl;if(r.mipmap&&e.mipmap!==t.MIPMAP_MODES.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,r.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===t.SCALE_MODES.LINEAR){var o=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===t.SCALE_MODES.LINEAR?i.LINEAR:i.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),Jn={__proto__:null,FilterSystem:Gi,BatchSystem:ki,ContextSystem:Yi,FramebufferSystem:Wi,GeometrySystem:qi,MaskSystem:On,ScissorSystem:Dn,StencilSystem:Nn,ProjectionSystem:Cn,RenderTextureSystem:Fn,ShaderSystem:zn,StateSystem:qn,TextureGCSystem:Kn,TextureSystem:Qn},$n=new sr,to=function(e){function r(r,i){void 0===r&&(r=t.RENDERER_TYPE.UNKNOWN);var n=e.call(this)||this;return i=Object.assign({},ot.RENDER_OPTIONS,i),n.options=i,n.type=r,n.screen=new tr(0,0,i.width,i.height),n.view=i.view||ot.ADAPTER.createCanvas(),n.resolution=i.resolution||ot.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&(n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return $r(r,e),r.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(r.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),r.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*this.resolution);var r=this.view.width/this.resolution,i=this.view.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.view.style.width=r+"px",this.view.style.height=i+"px"),this.emit("resize",r,i)},r.prototype.generateTexture=function(t,e,r,i){void 0===e&&(e={}),"number"==typeof e&&(e={scaleMode:e,resolution:r,region:i});var n=e.region,o=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},t.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},t.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r=t.MSAA_QUALITY.HIGH?this.multisample=t.MSAA_QUALITY.HIGH:e>=t.MSAA_QUALITY.MEDIUM?this.multisample=t.MSAA_QUALITY.MEDIUM:e>=t.MSAA_QUALITY.LOW?this.multisample=t.MSAA_QUALITY.LOW:this.multisample=t.MSAA_QUALITY.NONE},r.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},r.prototype.render=function(t,e){var r,i,n,o;if(e&&(e instanceof bi?(r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},r.prototype.generateTexture=function(t,r,i,n){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,i,n);return this.framebuffer.blit(),o},r.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},r.prototype.reset=function(){return this.runners.reset.emit(),this},r.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},r.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(r.prototype,"extract",{get:function(){return this.plugins.extract},enumerable:!1,configurable:!0}),r.registerPlugin=function(e,r){Vr.add({name:e,type:t.ExtensionType.RendererPlugin,ref:r})},r.__plugins={},r}(to);function no(t){return io.create(t)}Vr.handleByMap(t.ExtensionType.RendererPlugin,io.__plugins);var oo="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}",so="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",ao=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),ho=function(){this.texArray=null,this.blend=0,this.type=t.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null},uo=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},r.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,i=r._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++ni._globalBatch,h=0,u=i[0],l=0;n.copyBoundTextures(o,e);for(var c=0;c=e&&(n.boundArray(u,o,a,e),this.buildDrawCalls(u,l,c),l=c,u=i[++h],++a),d._batchEnabled=a,d.touched=s,u.elements[u.count++]=d)}for(u.count>0&&(n.boundArray(u,o,a,e),this.buildDrawCalls(u,l,this._bufferSize),++h,++a),c=0;c0&&(e+="\nelse "),r title : "+t.title+"
tabIndex: "+t.tabIndex},e.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,r=e.width,i=e.height;t.x+t.width>r&&(t.width=r-t.x),t.y+t.height>i&&(t.height=i-t.y)},e.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},e.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"click",i),e.dispatchEvent(r,"pointertap",i),e.dispatchEvent(r,"tap",i)},e.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseover",i)},e.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseout",i)},e.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},e.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},e.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},e.extension={name:"accessibility",type:[t.ExtensionType.RendererPlugin,t.ExtensionType.CanvasRendererPlugin]},e}(),So=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Je,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(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),Oo=function(t,e){return Oo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Oo(t,e)},Io=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),Mo=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),Po=function(){function t(){this._tempPoint=new Je}return t.prototype.recursiveFindHit=function(t,e,r,i,n){var o;if(!e||!e.visible)return!1;var s=t.data.global,a=!1,h=n=e.interactive||n,u=!0;if(e.hitArea)i&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(i=!1,u=!1)),h=!1;else if(e._mask&&i){var l=e._mask.isMaskData?e._mask.maskObject:e._mask;l&&!(null===(o=l.containsPoint)||void 0===o?void 0:o.call(l,s))&&(i=!1)}if(u&&e.interactiveChildren&&e.children)for(var c=e.children,d=c.length-1;d>=0;d--){var f=c[d],p=this.recursiveFindHit(t,f,r,i,h);if(p){if(!f.parent)continue;h=!1,p&&(t.target&&(i=!1),a=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),r&&r(t,e,!!a))),a},t.prototype.findHit=function(t,e,r,i){this.recursiveFindHit(t,e,r,i,!1)},t}(),Do={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?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};Gr.mixin(Do);var No={target:null,data:{global:null}},Co=function(e){function r(t,r){var i=e.call(this)||this;return r=r||{},i.renderer=t,i.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,i.interactionFrequency=r.interactionFrequency||10,i.mouse=new So,i.mouse.identifier=1,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[1]=i.mouse,i.interactionDataPool=[],i.eventData=new Io,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in globalThis),i.supportsTouchEvents="ontouchstart"in globalThis,i.supportsPointerEvents=!!globalThis.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new Po,i._tempDisplayObject=new Xr,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return function(t,e){function r(){this.constructor=t}Oo(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),Object.defineProperty(r.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),r.prototype.hitTest=function(t,e){return No.target=null,No.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(No,e,null,!0),No.target},r.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},r.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(qr.system.add(this.tickerUpdate,this,t.UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)},r.prototype.removeTickerListener=function(){this.tickerAdded&&(qr.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},r.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.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}},r.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.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}},r.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime0&&(o=t.composedPath()[0]);for(var s=o!==this.interactionDOMElement?"outside":"",a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2==(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,"text/xml")}else{var o=document.createElement("div");o.innerHTML=r,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,ko||(ko=document.createElement("a")),ko.href=t;var r=Xo(ko.href,{strictMode:!0}),i=!r.port&&""===e.port||r.port===e.port,n=r.protocol?r.protocol+":":"";return r.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),n=t.indexOf("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},t}(),function(t){var e,r,i,n;(e=t.STATUS_FLAGS||(t.STATUS_FLAGS={}))[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING",(r=t.TYPE||(t.TYPE={}))[r.UNKNOWN=0]="UNKNOWN",r[r.JSON=1]="JSON",r[r.XML=2]="XML",r[r.IMAGE=3]="IMAGE",r[r.AUDIO=4]="AUDIO",r[r.VIDEO=5]="VIDEO",r[r.TEXT=6]="TEXT",(i=t.LOAD_TYPE||(t.LOAD_TYPE={}))[i.XHR=1]="XHR",i[i.IMAGE=2]="IMAGE",i[i.AUDIO=3]="AUDIO",i[i.VIDEO=4]="VIDEO",(n=t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})).DEFAULT="text",n.BUFFER="arraybuffer",n.BLOB="blob",n.DOCUMENT="document",n.JSON="json",n.TEXT="text",t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(t.LoaderResource||(t.LoaderResource={}));var zo=function(t,e){this.data=t,this.callback=e},qo=function(){function t(t,e){var r=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=Vo,this.unsaturated=Vo,this.empty=Vo,this.drain=Vo,this.error=Vo,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,i){if(i&&"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout((function(){return r.drain()}),1);else{var n=new zo(t,"function"==typeof i?i:Vo);e?r._tasks.unshift(n):r._tasks.push(n),setTimeout(r.process,1)}},this.process=function(){for(;!r.paused&&r.workers>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(o=0;o0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,e,r,i,n,o,s){for(var a=new Array(r),h=t.byteOffset,u=o,l=s,c=u+i-1&~(i-1),d=l+n-1&~(n-1),f=c*d*rs[e],p=0;p1?u:c,levelHeight:r>1?l:d,levelBuffer:new Uint8Array(t.buffer,h,f)},h+=f,f=(c=(u=u>>1||1)+i-1&~(i-1))*(d=(l=l>>1||1)+n-1&~(n-1))*rs[e];return a},e}(as),us=function(){function e(){}return e.use=function(r,i){var n=r.data;if(r.type===t.LoaderResource.TYPE.JSON&&n&&n.cacheID&&n.textures){for(var o=n.textures,s=void 0,a=void 0,h=0,u=o.length;h>>=1,y>>>=1;var R=148;for(b=0;b<_;b++)m.push(new Uint8Array(t,R,g)),R+=g}return m.map((function(t){return new hs(t,{format:v,width:n,height:i,levels:o})}))}if(64&a)throw new Error("DDSParser does not support uncompressed texture data.");if(512&a)throw new Error("DDSParser does not supported YUV uncompressed texture data.");if(131072&a)throw new Error("DDSParser does not support single-channel (lumninance) texture data!");if(2&a)throw new Error("DDSParser does not support single-channel (alpha) texture data!");throw new Error("DDSParser failed to load a texture file due to an unknown reason!")}var gs=[171,75,84,88,32,49,49,187,13,10,26,10],Ts=((fs={})[t.TYPES.UNSIGNED_BYTE]=1,fs[t.TYPES.UNSIGNED_SHORT]=2,fs[t.TYPES.INT]=4,fs[t.TYPES.UNSIGNED_INT]=4,fs[t.TYPES.FLOAT]=4,fs[t.TYPES.HALF_FLOAT]=8,fs),ys=((ps={})[t.FORMATS.RGBA]=4,ps[t.FORMATS.RGB]=3,ps[t.FORMATS.RG]=2,ps[t.FORMATS.RED]=1,ps[t.FORMATS.LUMINANCE]=1,ps[t.FORMATS.LUMINANCE_ALPHA]=2,ps[t.FORMATS.ALPHA]=1,ps),bs=((_s={})[t.TYPES.UNSIGNED_SHORT_4_4_4_4]=2,_s[t.TYPES.UNSIGNED_SHORT_5_5_5_1]=2,_s[t.TYPES.UNSIGNED_SHORT_5_6_5]=2,_s);function Rs(e,r,i){void 0===i&&(i=!1);var n=new DataView(r);if(!function(t,e){for(var r=0;re-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var h=0;h1||0!==s?R:A,levelHeight:p>1||0!==s?x:S,levelBuffer:new Uint8Array(r,P,b)},P+=b}O=(O+=M+4)%4!=0?O+4-O%4:O,b=(A=(R=R>>1||1)+4-1&-4)*(S=(x=x>>1||1)+4-1&-4)*v}return 0!==s?{uncompressed:g.map((function(e){var r=e[0].levelBuffer,i=!1;return s===t.TYPES.FLOAT?r=new Float32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4):s===t.TYPES.UNSIGNED_INT?(i=!0,r=new Uint32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)):s===t.TYPES.INT&&(i=!0,r=new Int32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)),{resource:new ri(r,{width:e[0].levelWidth,height:e[0].levelHeight}),type:s,format:i?xs(a):a}})),kvData:y}:{compressed:g.map((function(t){return new hs(null,{format:h,width:u,height:l,levels:p,levelBuffers:t})})),kvData:y}}function xs(e){switch(e){case t.FORMATS.RGBA:return t.FORMATS.RGBA_INTEGER;case t.FORMATS.RGB:return t.FORMATS.RGB_INTEGER;case t.FORMATS.RG:return t.FORMATS.RG_INTEGER;case t.FORMATS.RED:return t.FORMATS.RED_INTEGER;default:return e}}t.LoaderResource.setExtensionXhrType("dds",t.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);var As=function(){function e(){}return e.use=function(t,e){if("dds"===t.extension&&t.data)try{Object.assign(t,ls(t.name||t.url,Es(t.data),t.metadata))}catch(t){return void e(t)}e()},e.extension=t.ExtensionType.Loader,e}();t.LoaderResource.setExtensionXhrType("ktx",t.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);var Ss=function(){function e(){}return e.use=function(e,r){if("ktx"===e.extension&&e.data)try{var i=e.name||e.url,n=Rs(0,e.data,this.loadKeyValueData),o=n.compressed,s=n.uncompressed,a=n.kvData;if(o){var h=ls(i,o,e.metadata);if(a&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=a;Object.assign(e,h)}else if(s){var l={};s.forEach((function(e,r){var n=new yi(new ni(e.resource,{mipmap:t.MIPMAP_MODES.OFF,alphaMode:t.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:e.type,format:e.format})),o=i+"-"+(r+1);a&&(n.baseTexture.ktxKeyValueData=a),ni.addToCache(n.baseTexture,o),yi.addToCache(n,o),0===r&&(l[i]=n,ni.addToCache(n.baseTexture,i),yi.addToCache(n,i)),l[o]=n})),Object.assign(e,{textures:l})}}catch(t){return void r(t)}r()},e.extension=t.ExtensionType.Loader,e.loadKeyValueData=!1,e}(),Os=function(t,e){return Os=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Os(t,e)};function Is(t,e){function r(){this.constructor=t}Os(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var Ms=function(e){function r(r,i,n,o){void 0===r&&(r=1500),void 0===n&&(n=16384),void 0===o&&(o=!1);var s=e.call(this)||this;return n>16384&&(n=16384),s._properties=[!1,!0,!1,!1,!1],s._maxSize=r,s._batchSize=n,s._buffers=null,s._bufferUpdateIDs=[],s._updateID=0,s.interactiveChildren=!1,s.blendMode=t.BLEND_MODES.NORMAL,s.autoResize=o,s.roundPixels=!0,s.baseTexture=null,s.setProperties(i),s._tint=0,s.tintRgb=new Float32Array(4),s.tint=16777215,s}return Is(r,e),r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(r.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,ge(t,this.tintRgb)},enumerable:!1,configurable:!0}),r.prototype.render=function(t){var e=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 e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture,h=a.alphaMode>0;this.state.blendMode=xe(t.blendMode,h),n.state.set(this.state);var u=n.gl,l=t.worldTransform.copyTo(this.tempMatrix);l.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=l.toArray(!0),this.shader.uniforms.uColor=Ae(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var c=!1,d=0,f=0;di&&(p=i),f>=s.length&&s.push(this._generateOneMoreBuffer(t));var _=s[f];_.uploadDynamic(e,d,p);var v=t._bufferUpdateIDs[f]||0;(c=c||_._updateID0,u=a.alpha,l=u<1&&h?Se(a._tintRGB,u):a._tintRGB+(255*u<<24);i[o]=l,i[o+n]=l,i[o+2*n]=l,i[o+3*n]=l,o+=4*n}},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r.extension={name:"particle",type:t.ExtensionType.RendererPlugin},r}(Xi);t.LINE_JOIN=void 0,t.LINE_CAP=void 0,function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(t.LINE_JOIN||(t.LINE_JOIN={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(t.LINE_CAP||(t.LINE_CAP={}));var Ns={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var r=Math.ceil(t/this.maxLength);return rthis.maxSegments&&(r=this.maxSegments),r}},Cs=function(){function t(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=yi.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),ws=function(t,e){return ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},ws(t,e)};function Ls(t,e){function r(){this.constructor=t}ws(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function Fs(t,e){var r,i;void 0===e&&(e=!1);var n=t.length;if(!(n<6)){for(var o=0,s=0,a=t[n-2],h=t[n-1];s0||e&&o<=0){var c=n/2;for(s=c+c%2;s=6){Fs(r,!1);for(var s=[],a=0;a=0&&a>=0&&n>=0&&o>=0){var p=Math.ceil(2.3*Math.sqrt(s+a)),_=8*p+(n?4:0)+(o?4:0);if(h.length=_,0!==_){if(0===p)return h.length=8,h[0]=h[6]=r+n,h[1]=h[3]=i+o,h[2]=h[4]=r-n,void(h[5]=h[7]=i-o);var v,m,E=0,g=4*p+(n?2:0)+2,T=g,y=_,b=r+(v=n+s),R=r-v,x=i+(m=o);if(h[E++]=b,h[E++]=x,h[--g]=x,h[--g]=R,o){var A=i-m;h[T++]=R,h[T++]=A,h[--y]=A,h[--y]=b}for(var S=1;Sc&&(c+=2*Math.PI);var d=l,f=c-l,p=Math.abs(f),_=Math.sqrt(h*h+u*u),v=1+(15*p*Math.sqrt(_)/Math.PI>>0),m=f/v;if(d+=m,a){s.push(t,e),s.push(r,i);for(var E=1,g=d;Eg?(X?(f.push(W,z),f.push(b+S*C,R+O*C),f.push(W,z),f.push(b+I*C,R+M*C)):(f.push(b-S*N,R-O*N),f.push(q,K),f.push(b-I*N,R-M*N),f.push(q,K)),_+=2):s.join===t.LINE_JOIN.ROUND?X?(f.push(W,z),f.push(b+S*C,R+O*C),_+=js(b,R,b+S*C,R+O*C,b+I*C,R+M*C,f,!0)+4,f.push(W,z),f.push(b+I*C,R+M*C)):(f.push(b-S*N,R-O*N),f.push(q,K),_+=js(b,R,b-S*N,R-O*N,b-I*N,R-M*N,f,!1)+4,f.push(b-I*N,R-M*N),f.push(q,K)):(f.push(W,z),f.push(q,K)):(f.push(b-S*N,R-O*N),f.push(b+S*C,R+O*C),s.join===t.LINE_JOIN.ROUND?_+=X?js(b,R,b+S*C,R+O*C,b+I*C,R+M*C,f,!0)+2:js(b,R,b-S*N,R-O*N,b-I*N,R-M*N,f,!1)+2:s.join===t.LINE_JOIN.MITER&&V/E<=g&&(X?(f.push(q,K),f.push(q,K)):(f.push(W,z),f.push(W,z)),_+=2),f.push(b-I*N,R-M*N),f.push(b+I*C,R+M*C),_+=2)}}T=n[2*(p-2)],y=n[2*(p-2)+1],b=n[2*(p-1)],S=-(y-(R=n[2*(p-1)+1])),O=T-b,S/=P=Math.sqrt(S*S+O*O),O/=P,S*=m,O*=m,f.push(b-S*N,R-O*N),f.push(b+S*C,R+O*C),u||(s.cap===t.LINE_CAP.ROUND?_+=js(b-S*(N-C)*.5,R-O*(N-C)*.5,b-S*N,R-O*N,b+S*C,R+O*C,f,!1)+2:s.cap===t.LINE_CAP.SQUARE&&(_+=Ys(b,R,S,O,N,C,!1,f)));var Q=r.indices,J=Ns.epsilon*Ns.epsilon;for(w=v;w<_+v-2;++w)T=f[2*w],y=f[2*w+1],b=f[2*(w+1)],R=f[2*(w+1)+1],x=f[2*(w+2)],A=f[2*(w+2)+1],Math.abs(T*(R-A)+b*(A-y)+x*(y-R))l*a}},t.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=Ns._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/Ke)),c=u/(2*l),d=2*c,f=Math.cos(c),p=Math.sin(c),_=l-1,v=_%1/_,m=0;m<=_;++m){var E=c+o+d*(m+v*m),g=Math.cos(E),T=-Math.sin(E);h.push((f*g+p*T)*n+r,(f*-T+p*g)*n+i)}},t}(),qs=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o,s,a){for(var h=0,u=0,l=0,c=0,d=0,f=0,p=0,_=0,v=0,m=0,E=0,g=t,T=e,y=1;y<=10;++y)m=g-(_=(p=(f=(d=1-(u=y/10))*d)*d)*t+3*f*u*r+3*d*(l=u*u)*n+(c=l*u)*s),E=T-(v=p*e+3*f*u*i+3*d*l*o+c*a),g=_,T=v,h+=Math.sqrt(m*m+E*E);return h},t.curveTo=function(e,r,i,n,o,s,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=Ns._segmentsCount(t.curveLength(h,u,e,r,i,n,o,s)),c=0,d=0,f=0,p=0,_=0;a.push(h,u);for(var v=1,m=0;v<=l;++v)f=(d=(c=1-(m=v/l))*c)*c,_=(p=m*m)*m,a.push(f*h+3*d*m*e+3*c*p*i+_*o,f*u+3*d*m*r+3*c*p*n+_*s)},t}(),Ks=function(){function t(){}return t.curveLength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,h=2*r-2*t,u=2*i-2*e,l=4*(s*s+a*a),c=4*(s*h+a*u),d=h*h+u*u,f=2*Math.sqrt(l+c+d),p=Math.sqrt(l),_=2*l*p,v=2*Math.sqrt(d),m=c/p;return(_*f+p*c*(f-v)+(4*d*l-c*c)*Math.log((2*p+m+f)/(m+v)))/(4*_)},t.curveTo=function(e,r,i,n,o){for(var s=o[o.length-2],a=o[o.length-1],h=Ns._segmentsCount(t.curveLength(s,a,e,r,i,n)),u=0,l=0,c=1;c<=h;++c){var d=c/h;u=s+(e-s)*d,l=a+(r-a)*d,o.push(u+(e+(i-e)*d-u)*d,l+(r+(n-r)*d-l)*d)}},t}(),Zs=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),Qs=((Ws={})[t.SHAPES.POLY]=Us,Ws[t.SHAPES.CIRC]=Bs,Ws[t.SHAPES.ELIP]=Bs,Ws[t.SHAPES.RECT]=Gs,Ws[t.SHAPES.RREC]=Hs,Ws),Js=[],$s=[],ta=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.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},t}(),ea=new Je,ra=function(e){function r(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new vr,t.boundsDirty=-1,t}return Ls(r,e),Object.defineProperty(r.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),r.prototype.invalidate=function(){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(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},r.prototype.drawShape=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null);var n=new ta(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this},r.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var r=new ta(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this},r.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(n=(i=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&m===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=m?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},r.prototype._compareStyles=function(t,e){return!(!t||!e)&&t.texture.baseTexture===e.texture.baseTexture&&t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native},r.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,e=0;e0&&((o=$s.pop())||((o=new ho).texArray=new uo),this.drawCalls.push(o)),o.start=c,o.size=0,o.texArray.count=0,o.type=l),p.touched=1,p._batchEnabled=e,p._batchLocation=s,p.wrapMode=t.WRAP_MODES.REPEAT,o.texArray.elements[o.texArray.count++]=p,s++)),o.size+=d.size,c+=d.size,h=p._batchLocation,this.addColors(i,f.color,f.alpha,d.attribSize,d.attribStart),this.addTextureIds(n,h,d.attribSize,d.attribStart)}ni._globalBatch=e,this.packAttributes()},r.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(3*t.length*4),o=new Float32Array(n),s=new Uint32Array(n),a=0,h=0;h>16)+(65280&e)+((255&e)<<16),r);t.length=Math.max(t.length,n+i);for(var s=0;s0&&e.alpha>0;return r?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:r},e)):this._lineStyle.reset(),this},r.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new ir,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new ir,this.currentPath.closeStroke=!1},r.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},r.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},r.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},r.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},r.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Ks.curveTo(t,e,r,i,n),this},r.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),qs.curveTo(t,e,r,i,n,o,this.currentPath.points),this},r.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=zs.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},r.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=Ke:o&&i<=n&&(i+=Ke),0==n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-s),c=Math.abs(u[u.length-1]-a);l0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},r.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},r.prototype.drawRect=function(t,e,r,i){return this.drawShape(new tr(t,e,r,i))},r.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new nr(t,e,r,i,n))},r.prototype.drawCircle=function(t,e,r){return this.drawShape(new er(t,e,r))},r.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new rr(t,e,r,i))},r.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],i=0;i>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,h=s.length;a>16)+(65280&n)+((255&n)<<16)}}},r.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c=i&&ua.x=n&&ua.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||yi.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),r}(Hr);t.TEXT_GRADIENT=void 0;var da=function(t,e){return da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},da(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(t.TEXT_GRADIENT||(t.TEXT_GRADIENT={}));var fa={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:t.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},pa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],_a=function(){function t(t){this.styleID=0,this.reset(),Ea(this,t,t)}return t.prototype.clone=function(){var e={};return Ea(e,this,fa),new t(e)},t.prototype.reset=function(){Ea(this,fa,fa)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=ma(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=ma(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&pa.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function va(t){return"number"==typeof t?Te(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function ma(t){if(Array.isArray(t)){for(var e=0;ep)if(""!==s&&(a+=t.addLine(s),s="",o=0),t.canBreakWords(m,r.breakWords))for(var y=t.wordWrapSplit(m),b=0;bp&&(a+=t.addLine(s),f=!1,s="",o=0),s+=R,o+=O}else{s.length>0&&(a+=t.addLine(s),s="",o=0);var I=v===_.length-1;a+=t.addLine(m,!I),f=!1,s="",o=0}else T+o>p&&(f=!1,a+=t.addLine(s),s="",o=0),(s.length>0||!t.isBreakingSpace(m)||f)&&(s+=m,o+=T)}return a+t.addLine(s,!1)},t.addLine=function(e,r){return void 0===r&&(r=!0),e=t.trimRight(e),r?e+"\n":e},t.getFromCache=function(t,e,r,i){var n=r[t];if("number"!=typeof n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var r=e.length-1;r>=0;r--){var i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,r){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var r=[],i="";if("string"!=typeof e)return r;for(var n=0;na;--d){for(_=0;_0&&_>v&&(m=(v+_)/2);var E=v+p,g=i.lineHeight*(f+1),T=E;f+10},t}();function xa(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;e--)this.add(t.children[e]);return this},e.prototype.destroy=function(){this.ticking&&qr.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},e}();function Na(t,e){return e instanceof ni&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function Ca(t,e){if(!(e instanceof sa))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var i=r.batches,n=0;n=i&&ka.x=n&&ka.y1?yn.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",e):yn.from(Ya,"#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",e)},r.prototype.render=function(e){var r=this.renderer,i=this.quad,n=i.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);var o=e.uvRespectAnchor?e.anchor.x:0,s=e.uvRespectAnchor?e.anchor.y:0;(n=i.uvs)[0]=n[6]=-o,n[1]=n[3]=-s,n[2]=n[4]=1-o,n[5]=n[7]=1-s,i.invalidate();var a=e._texture,h=a.baseTexture,u=h.alphaMode>0,l=e.tileTransform.localTransform,c=e.uvMatrix,d=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;d&&(h._glTextures[r.CONTEXT_UID]?d=h.wrapMode!==t.WRAP_MODES.CLAMP:h.wrapMode===t.WRAP_MODES.CLAMP&&(h.wrapMode=t.WRAP_MODES.REPEAT));var f=d?this.simpleShader:this.shader,p=a.width,_=a.height,v=e._width,m=e._height;ja.set(l.a*p/v,l.b*p/m,l.c*_/v,l.d*_/m,l.tx/v,l.ty/m),ja.invert(),d?ja.prepend(c.mapCoord):(f.uniforms.uMapCoord=c.mapCoord.toArray(!0),f.uniforms.uClampFrame=c.uClampFrame,f.uniforms.uClampOffset=c.uClampOffset),f.uniforms.uTransform=ja.toArray(!0),f.uniforms.uColor=Oe(e.tint,e.worldAlpha,f.uniforms.uColor,u),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,r.shader.bind(f),r.geometry.bind(i),this.state.blendMode=xe(e.blendMode,u),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},r.extension={name:"tilingSprite",type:t.ExtensionType.RendererPlugin},r}(Xi),Wa=function(t,e){return Wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Wa(t,e)};function za(t,e){function r(){this.constructor=t}Wa(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var qa=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),Ka=new Je,Za=new ir,Qa=function(e){function r(r,i,n,o){void 0===o&&(o=t.DRAW_MODES.TRIANGLES);var s=e.call(this)||this;return s.geometry=r,s.shader=i,s.state=n||bn.for2d(),s.drawMode=o,s.start=0,s.size=0,s.uvs=null,s.indices=null,s.vertexData=new Float32Array(1),s.vertexDirty=-1,s._transformID=-1,s._roundPixels=ot.ROUND_PIXELS,s.batchUvs=null,s}return za(r,e),Object.defineProperty(r.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),r.prototype._render=function(e){var i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===t.DRAW_MODES.TRIANGLES&&i.length<2*r.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)},r.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},r.prototype._renderToBatch=function(t){var e=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;var i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)},r.prototype.calculateVertices=function(){var t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var i=this.transform.worldTransform,n=i.a,o=i.b,s=i.c,a=i.d,h=i.tx,u=i.ty,l=this.vertexData,c=0;c>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Oe(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(yn),$a=function(e){function r(r,i,n){var o=e.call(this)||this,s=new Si(r),a=new Si(i,!0),h=new Si(n,!0,!0);return o.addAttribute("aVertexPosition",s,2,!1,t.TYPES.FLOAT).addAttribute("aTextureCoord",a,2,!1,t.TYPES.FLOAT).addIndex(h),o._updateId=-1,o}return za(r,e),Object.defineProperty(r.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),r}(Di),th=function(t,e){return th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},th(t,e)},eh=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},rh=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],o=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var a in o){var h=o[a].split("="),u=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),d=isNaN(c)?l:c;s[u]=d}r[n].push(s)}var f=new eh;return r.info.forEach((function(t){return f.info.push({face:t.face,size:parseInt(t.size,10)})})),r.common.forEach((function(t){return f.common.push({lineHeight:parseInt(t.lineHeight,10)})})),r.page.forEach((function(t){return f.page.push({id:parseInt(t.id,10),file:t.file})})),r.char.forEach((function(t){return f.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),r.kerning.forEach((function(t){return f.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),r.distanceField.forEach((function(t){return f.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})})),f},t}(),ih=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new eh,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField"),h=0;h")>-1){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return ih.test(e)}return!1},t.parse=function(t){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return ih.parse(e)},t}(),oh=[rh,ih,nh];function sh(t){for(var e=0;e=u-x*a){if(0===E)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+c.fontSize+"px fonts");--y,p=null,_=null,v=null,E=0,m=0,g=0}else if(g=Math.max(x+b.fontProperties.descent,g),A*a+m>=d)--y,E+=g*a,E=Math.ceil(E),m=0,g=0;else{ah(p,_,b,m,E,a,c);var S=uh(b.text);f.char.push({id:S,page:T.length-1,x:m/a,y:E/a,width:A,height:x,xoffset:0,yoffset:0,xadvance:Math.ceil(R-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))}),m+=(A+2*s)*a,m=Math.ceil(m)}}y=0;for(var O=l.length;y0&&n.x>u&&(we(o,1+_-++m,1+T-_),T=_,_=-1,s.push(v),a.push(o.length>0?o[o.length-1].prevSpaces:0),f=Math.max(f,v),p++,n.x=0,n.y+=r.lineHeight,c=null,g=0)}}else s.push(d),a.push(-1),f=Math.max(f,d),++p,++m,n.x=0,n.y+=r.lineHeight,c=null,g=0}var x=h[h.length-1];"\r"!==x&&"\n"!==x&&(/(?:\s)/.test(x)&&(d=v),s.push(d),f=Math.max(f,d),a.push(-1));var A=[];for(T=0;T<=p;T++){var S=0;"right"===this._align?S=f-s[T]:"center"===this._align?S=(f-s[T])/2:"justify"===this._align&&(S=a[T]<0?0:(f-s[T])/a[T]),A.push(S)}var O=o.length,I={},M=[],P=this._activePagesMeshData;for(T=0;T6*U)||Z.vertices.length<2*Qa.BATCHABLE_SIZE)Z.vertices=new Float32Array(8*U),Z.uvs=new Float32Array(8*U),Z.indices=new Uint16Array(6*U);else for(var B=Z.total,G=Z.vertices,X=4*B*2;X=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e].toString()),o+="\n"}return(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o);return(s=t.call(this,a,h)||this).horizontal=e,s.resolution=n,s._quality=0,s.quality=i,s.blur=r,s}return gh(e,t),e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,Ch.CLEAR);for(var h=1;h 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",r)||this).alpha=1,e}return function(t,e){function r(){this.constructor=t}jh(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.tint=function(t,e){var r=[(t>>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){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],t)},e.prototype.polaroid=function(t){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],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){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],t)},e.prototype.browni=function(t){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],t)},e.prototype.vintage=function(t){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],t)},e.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.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(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(Rn);Vh.prototype.grayscale=Vh.prototype.greyscale;var Wh,zh,qh,Kh,Zh,Qh,Jh,$h,tu,eu,ru,iu,nu,ou,su,au,hu,uu,lu,cu,du=function(t,e){return du=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},du(t,e)},fu=function(t){function e(e,r){var i=this,n=new sr;return e.renderable=!1,(i=t.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\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( 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:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,i.maskMatrix=n,null==r&&(r=20),i.scale=new Je(r,r),i}return function(t,e){function r(){this.constructor=t}du(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(Rn),pu=function(t,e){return pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},pu(t,e)},_u=function(t){function e(){return t.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(t,e){function r(){this.constructor=t}pu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Rn),vu=function(t,e){return vu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},vu(t,e)},mu=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random());var i=t.call(this,so,"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 i.noise=e,i.seed=r,i}return function(t,e){function r(){this.constructor=t}vu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(Rn);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(Wh||(Wh={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(zh||(zh={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(qh||(qh={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(Kh||(Kh={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Zh||(Zh={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(Qh||(Qh={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(Jh||(Jh={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}($h||($h={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(tu||(tu={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(eu||(eu={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(ru||(ru={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(iu||(iu={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(nu||(nu={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(ou||(ou={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(su||(su={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(au||(au={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR"}(hu||(hu={})),function(t){t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA"}(uu||(uu={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(lu||(lu={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(cu||(cu={}));var Eu=new sr;Gr.prototype._cacheAsBitmap=!1,Gr.prototype._cacheData=null,Gr.prototype._cacheAsBitmapResolution=null,Gr.prototype._cacheAsBitmapMultisample=lu.NONE;var gu=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(Gr.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new gu),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),Gr.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Gr.prototype._initCachedDisplayObject=function(t){var e;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var n=this.filters[0].padding;i.pad(n)}i.ceil(ot.RESOLUTION);var o=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),h=t.projection.transform,u=bi.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),l="cacheAsBitmap_"+Ue();this._cacheData.textureCacheId=l,ni.addToCache(u.baseTexture,l),yi.addToCache(u,l);var c=this.transform.localTransform.copyTo(Eu).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:u,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=h,t.renderTexture.bind(o,s,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new ca(u);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-i.x/i.width,d.anchor.y=-i.y/i.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Gr.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Gr.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var i=t.context,n=t._projTransform;e.ceil(ot.RESOLUTION);var o=bi.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+Ue();this._cacheData.textureCacheId=s,ni.addToCache(o.baseTexture,s),yi.addToCache(o,s);var a=Eu;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:a,skipUpdateTransform:!1}),t.context=i,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var h=new ca(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=r,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},Gr.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Gr.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Gr.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,ni.removeFromCache(this._cacheData.textureCacheId),yi.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Gr.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Gr.prototype.name=null,Hr.prototype.getChildByName=function(t,e){for(var r=0,i=this.children.length;r0){var d=a.x-t[l].x,f=a.y-t[l].y,p=Math.sqrt(d*d+f*f);a=t[l],s+=p/h}else s=l/(u-1);n[c]=s,n[c+1]=0,n[c+2]=s,n[c+3]=1}var _=0;for(l=0;l0?this.textureScale*this._width/2:this._width/2;i/=l,n/=l,i*=c,n*=c,o[u]=h.x+i,o[u+1]=h.y+n,o[u+2]=h.x-i,o[u+3]=h.y-n,r=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}($a),Su=function(e){function r(r,i,n){void 0===n&&(n=0);var o=this,s=new Au(r.height,i,n),a=new Ja(r);return n>0&&(r.baseTexture.wrapMode=t.WRAP_MODES.REPEAT),(o=e.call(this,s,a)||this).autoUpdate=!0,o}return Ru(r,e),r.prototype._render=function(t){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),e.prototype._render.call(this,t)},r}(Qa),Ou=function(t){function e(e,r,i){var n=this,o=new xu(e.width,e.height,r,i),s=new Ja(yi.WHITE);return(n=t.call(this,o,s)||this).texture=e,n.autoResize=!0,n}return Ru(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,r=e.width,i=e.height;!this.autoResize||t.width===r&&t.height===i||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(Qa),Iu=function(t){function e(e,r,i,n,o){void 0===e&&(e=yi.EMPTY);var s=this,a=new $a(r,i,n);a.getBuffer("aVertexPosition").static=!1;var h=new Ja(e);return(s=t.call(this,a,h,null,o)||this).autoUpdate=!0,s}return Ru(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(Qa),Mu=function(t){function e(e,r,i,n,o){void 0===r&&(r=10),void 0===i&&(i=10),void 0===n&&(n=10),void 0===o&&(o=10);var s=t.call(this,yi.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=n,s._topHeight=i,s._bottomHeight=o,s.texture=e,s}return Ru(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,r=this._topHeight+this._bottomHeight,i=this._height>r?1:this._height/r;return Math.min(e,i)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(Ou),Pu=function(t,e){return Pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Pu(t,e)},Du=function(e){function r(t,r){void 0===r&&(r=!0);var i=e.call(this,t[0]instanceof yi?t[0]:t[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=r,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=t,i}return function(t,e){function r(){this.constructor=t}Pu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),r.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(qr.shared.remove(this.update,this),this._isConnectedToTicker=!1))},r.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(qr.shared.add(this.update,this,t.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},r.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},r.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},r.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;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()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer)&&this.onLoop(),this.updateTexture())}},r.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],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))},r.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},r.fromFrames=function(t){for(var e=[],i=0;i0){var n=e.context;n.beginPath();for(var o=0;o0){for(l=0,d=h[0],f=h[1],p=2;p+2=0;p-=2)r.lineTo(h[p],h[p+1]);u[_].shape.closeStroke&&r.closePath()}}h[0]===h[h.length-2]&&h[1]===h[h.length-1]&&r.closePath()}else if(a.type===t.SHAPES.RECT)r.rect(a.x,a.y,a.width,a.height),r.closePath();else if(a.type===t.SHAPES.CIRC)r.arc(a.x,a.y,a.radius,0,2*Math.PI),r.closePath();else if(a.type===t.SHAPES.ELIP){var v=2*a.width,m=2*a.height,E=a.x-v/2,g=a.y-m/2,T=.5522848,y=v/2*T,b=m/2*T,R=E+v,x=g+m,A=E+v/2,S=g+m/2;r.moveTo(E,S),r.bezierCurveTo(E,S-b,A-y,g,A,g),r.bezierCurveTo(A+y,g,R,S-b,R,S),r.bezierCurveTo(R,S+b,A+y,x,A,x),r.bezierCurveTo(A-y,x,E,S+b,E,S),r.closePath()}else if(a.type===t.SHAPES.RREC){var O=a.x,I=a.y,M=a.width,P=a.height,D=a.radius,N=Math.min(M,P)/2;D=D>N?N:D,r.moveTo(O,I+D),r.lineTo(O,I+P-D),r.quadraticCurveTo(O,I+P,O+D,I+P),r.lineTo(O+M-D,I+P),r.quadraticCurveTo(O+M,I+P,O+M,I+P-D),r.lineTo(O+M,I+D),r.quadraticCurveTo(O+M,I,O+M-D,I),r.lineTo(O+D,I),r.quadraticCurveTo(O,I,O,I+D),r.closePath()}}},e.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},e.prototype.destroy=function(){},e}();function Lu(t){var e=ot.ADAPTER.createCanvas(6,1),r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}function Fu(){if("undefined"==typeof document)return!1;var t=Lu("#ff00ff"),e=Lu("#ffff00"),r=ot.ADAPTER.createCanvas(6,1).getContext("2d");r.globalCompositeOperation="multiply",r.drawImage(t,0,0),r.drawImage(e,2,0);var i=r.getImageData(2,0,1,1);if(!i)return!1;var n=i.data;return 255===n[0]&&0===n[1]&&0===n[2]}var Uu=new sr,Bu=function(e){function r(i){var n,o=e.call(this,t.RENDERER_TYPE.CANVAS,i)||this;if(o.refresh=!0,o.maskManager=new wu(o),o.smoothProperty="imageSmoothingEnabled",o.blendModes=(void 0===n&&(n=[]),Fu()?(n[t.BLEND_MODES.NORMAL]="source-over",n[t.BLEND_MODES.ADD]="lighter",n[t.BLEND_MODES.MULTIPLY]="multiply",n[t.BLEND_MODES.SCREEN]="screen",n[t.BLEND_MODES.OVERLAY]="overlay",n[t.BLEND_MODES.DARKEN]="darken",n[t.BLEND_MODES.LIGHTEN]="lighten",n[t.BLEND_MODES.COLOR_DODGE]="color-dodge",n[t.BLEND_MODES.COLOR_BURN]="color-burn",n[t.BLEND_MODES.HARD_LIGHT]="hard-light",n[t.BLEND_MODES.SOFT_LIGHT]="soft-light",n[t.BLEND_MODES.DIFFERENCE]="difference",n[t.BLEND_MODES.EXCLUSION]="exclusion",n[t.BLEND_MODES.HUE]="hue",n[t.BLEND_MODES.SATURATION]="saturation",n[t.BLEND_MODES.COLOR]="color",n[t.BLEND_MODES.LUMINOSITY]="luminosity"):(n[t.BLEND_MODES.NORMAL]="source-over",n[t.BLEND_MODES.ADD]="lighter",n[t.BLEND_MODES.MULTIPLY]="source-over",n[t.BLEND_MODES.SCREEN]="source-over",n[t.BLEND_MODES.OVERLAY]="source-over",n[t.BLEND_MODES.DARKEN]="source-over",n[t.BLEND_MODES.LIGHTEN]="source-over",n[t.BLEND_MODES.COLOR_DODGE]="source-over",n[t.BLEND_MODES.COLOR_BURN]="source-over",n[t.BLEND_MODES.HARD_LIGHT]="source-over",n[t.BLEND_MODES.SOFT_LIGHT]="source-over",n[t.BLEND_MODES.DIFFERENCE]="source-over",n[t.BLEND_MODES.EXCLUSION]="source-over",n[t.BLEND_MODES.HUE]="source-over",n[t.BLEND_MODES.SATURATION]="source-over",n[t.BLEND_MODES.COLOR]="source-over",n[t.BLEND_MODES.LUMINOSITY]="source-over"),n[t.BLEND_MODES.NORMAL_NPM]=n[t.BLEND_MODES.NORMAL],n[t.BLEND_MODES.ADD_NPM]=n[t.BLEND_MODES.ADD],n[t.BLEND_MODES.SCREEN_NPM]=n[t.BLEND_MODES.SCREEN],n[t.BLEND_MODES.SRC_IN]="source-in",n[t.BLEND_MODES.SRC_OUT]="source-out",n[t.BLEND_MODES.SRC_ATOP]="source-atop",n[t.BLEND_MODES.DST_OVER]="destination-over",n[t.BLEND_MODES.DST_IN]="destination-in",n[t.BLEND_MODES.DST_OUT]="destination-out",n[t.BLEND_MODES.DST_ATOP]="destination-atop",n[t.BLEND_MODES.XOR]="xor",n[t.BLEND_MODES.SUBTRACT]="source-over",n),o.renderingToScreen=!1,o._activeBlendMode=null,o._projTransform=null,o._outerBlend=!1,o.rootContext=o.view.getContext("2d",{alpha:o.useContextAlpha}),o.context=o.rootContext,!o.rootContext.imageSmoothingEnabled){var s=o.rootContext;s.webkitImageSmoothingEnabled?o.smoothProperty="webkitImageSmoothingEnabled":s.mozImageSmoothingEnabled?o.smoothProperty="mozImageSmoothingEnabled":s.oImageSmoothingEnabled?o.smoothProperty="oImageSmoothingEnabled":s.msImageSmoothingEnabled&&(o.smoothProperty="msImageSmoothingEnabled")}return o.initPlugins(r.__plugins),ve("Canvas"),o.resize(o.options.width,o.options.height),o}return function(t,e){function r(){this.constructor=t}Cu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),r.prototype.addSystem=function(){return this},r.prototype.render=function(e,r){if(this.view){var i,n,o,s;r&&(r instanceof bi||r instanceof mi?(i=r,n=arguments[2],o=arguments[3],s=arguments[4]):(i=r.renderTexture,n=r.clear,o=r.transform,s=r.skipUpdateTransform)),this.renderingToScreen=!i,this.emit("prerender");var a=this.resolution;i?((i=i.castToBaseTexture())._canvasRenderTarget||(i._canvasRenderTarget=new He(i.width,i.height,i.resolution),i.resource=new hi(i._canvasRenderTarget.canvas),i.valid=!0),this.context=i._canvasRenderTarget.context,this.resolution=i._canvasRenderTarget.resolution):this.context=this.rootContext;var h=this.context;if(this._projTransform=o||null,i||(this._lastObjectRendered=e),!s){var u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}if(h.save(),h.setTransform(1,0,0,1,0,0),h.globalAlpha=1,this._activeBlendMode=t.BLEND_MODES.NORMAL,this._outerBlend=!1,h.globalCompositeOperation=this.blendModes[t.BLEND_MODES.NORMAL],void 0!==n?n:this.clearBeforeRender)if(this.renderingToScreen)h.clearRect(0,0,this.width,this.height),this.backgroundAlpha>0&&(h.globalAlpha=this.useContextAlpha?this.backgroundAlpha:1,h.fillStyle=this._backgroundColorString,h.fillRect(0,0,this.width,this.height),h.globalAlpha=1);else{(i=i)._canvasRenderTarget.clear();var l=i.clearColor;l[3]>0&&(h.globalAlpha=this.useContextAlpha?l[3]:1,h.fillStyle=Te(be(l)),h.fillRect(0,0,i.realWidth,i.realHeight),h.globalAlpha=1)}var c=this.context;this.context=h,e.renderCanvas(this),this.context=c,h.restore(),this.resolution=a,this._projTransform=null,this.emit("postrender")}},r.prototype.setContextTransform=function(t,e,r){var i=t,n=this._projTransform,o=this.resolution;r=r||o,n&&((i=Uu).copyFrom(t),i.prepend(n)),e?this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o|0,i.ty*o|0):this.context.setTransform(i.a*r,i.b*r,i.c*r,i.d*r,i.tx*o,i.ty*o)},r.prototype.clear=function(t,e){void 0===t&&(t=this._backgroundColorString),void 0===e&&(e=this.backgroundAlpha);var r=this.context;r.clearRect(0,0,this.width,this.height),t&&(r.globalAlpha=this.useContextAlpha?e:1,r.fillStyle=t,r.fillRect(0,0,this.width,this.height),r.globalAlpha=1)},r.prototype.setBlendMode=function(e,r){var i=e===t.BLEND_MODES.SRC_IN||e===t.BLEND_MODES.SRC_OUT||e===t.BLEND_MODES.DST_IN||e===t.BLEND_MODES.DST_ATOP;!r&&i&&(e=t.BLEND_MODES.NORMAL),this._activeBlendMode!==e&&(this._activeBlendMode=e,this._outerBlend=i,this.context.globalCompositeOperation=this.blendModes[e])},r.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},r.prototype.resize=function(r,i){e.prototype.resize.call(this,r,i),this.smoothProperty&&(this.rootContext[this.smoothProperty]=ot.SCALE_MODE===t.SCALE_MODES.LINEAR)},r.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},r.registerPlugin=function(e,r){Vr.add({name:e,type:t.ExtensionType.CanvasRendererPlugin,ref:r})},r.__plugins={},r}(to);Vr.handleByMap(t.ExtensionType.CanvasRendererPlugin,Bu.__plugins);var Gu={canvas:null,getTintedCanvas:function(t,e){var r=t.texture,i="#"+("00000"+(0|(e=Gu.roundColor(e))).toString(16)).slice(-6);r.tintCache=r.tintCache||{};var n,o=r.tintCache[i];if(o){if(o.tintId===r._updateID)return r.tintCache[i];n=r.tintCache[i]}else n=ot.ADAPTER.createCanvas();if(Gu.tintMethod(r,e,n),n.tintId=r._updateID,Gu.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n;return n},getTintedPattern:function(t,e){var r="#"+("00000"+(0|(e=Gu.roundColor(e))).toString(16)).slice(-6);t.patternCache=t.patternCache||{};var i=t.patternCache[r];return i&&i.tintId===t._updateID||(Gu.canvas||(Gu.canvas=ot.ADAPTER.createCanvas()),Gu.tintMethod(t,e,Gu.canvas),(i=Gu.canvas.getContext("2d").createPattern(Gu.canvas,"repeat")).tintId=t._updateID,t.patternCache[r]=i),i},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply";var s=t.baseTexture.getDrawableSource();i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(s,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).slice(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.getDrawableSource(),n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=ge(e),a=s[0],h=s[1],u=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,d=0;d0){var S=t.worldTransform,O=S.a,I=S.b,M=S.c,P=S.d,D=(g+T+y)/3,N=(b+R+x)/3,C=g-D,w=b-N,L=O*C+M*w,F=I*C+P*w,U=Math.sqrt(L*L+F*F),B=1+A/U;g=D+C*B,b=N+w*B,L=O*(C=T-D)+M*(w=R-N),F=I*C+P*w,T=D+C*(B=1+A/(U=Math.sqrt(L*L+F*F))),R=N+w*B,L=O*(C=y-D)+M*(w=x-N),F=I*C+P*w,y=D+C*(B=1+A/(U=Math.sqrt(L*L+F*F))),x=N+w*B}n.save(),n.beginPath(),n.moveTo(g,b),n.lineTo(T,R),n.lineTo(y,x),n.closePath(),n.clip();var G=f*m+v*_+p*E-m*_-v*p-f*E,X=g*m+v*y+T*E-m*y-v*T-g*E,k=f*T+g*_+p*y-T*_-g*p-f*y,H=f*m*y+v*T*_+g*p*E-g*m*_-v*p*y-f*T*E,Y=b*m+v*x+R*E-m*x-v*R-b*E,j=f*R+b*_+p*x-R*_-b*p-f*x,V=f*m*x+v*R*_+b*p*E-b*m*_-v*p*x-f*R*E;n.transform(X/G,Y/G,k/G,j/G,H/G,V/G),n.drawImage(d,0,0,l*u.resolution,c*u.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},e.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.geometry.getBuffer("aVertexPosition").data,i=r.length/2;e.beginPath();for(var n=1;n0},t}(),Vu=function(){function e(t){this._svgMatrix=null,this._tempMatrix=new sr,this.renderer=t}return e.prototype._calcCanvasStyle=function(t,e){var r;return t.texture&&t.texture.baseTexture!==yi.WHITE.baseTexture?t.texture.valid?(r=Gu.getTintedPattern(t.texture,e),this.setPatternTransform(r,t.matrix||sr.IDENTITY)):r="#808080":r="#"+("00000"+(0|e).toString(16)).slice(-6),r},e.prototype.render=function(e){var r=this.renderer,i=r.context,n=e.worldAlpha,o=e.transform.worldTransform;r.setContextTransform(o),r.setBlendMode(e.blendMode);for(var s,a,h=e.geometry.graphicsData,u=(e.tint>>16&255)/255,l=(e.tint>>8&255)/255,c=(255&e.tint)/255,d=0;d>16&255)/255*u*255<<16)+((m>>8&255)/255*l*255<<8)+(255&m)/255*c*255;s=this._calcCanvasStyle(_,g)}if(v.visible){var T=((E>>16&255)/255*u*255<<16)+((E>>8&255)/255*l*255<<8)+(255&E)/255*c*255;a=this._calcCanvasStyle(v,T)}if(i.lineWidth=v.width,i.lineCap=v.cap,i.lineJoin=v.join,i.miterLimit=v.miterLimit,f.type===t.SHAPES.POLY){i.beginPath();var y=(P=p).points,b=f.holes,R=void 0,x=void 0,A=void 0,S=void 0,O=void 0;i.moveTo(y[0],y[1]);for(var I=2;I0){for(O=[],R=0,A=y[0],S=y[1],I=2;I+2=0;I-=2)i.lineTo(y[I],y[I+1]);b[M].shape.closeStroke&&i.closePath(),O[M]=x*R<0}}_.visible&&(i.globalAlpha=_.alpha*n,i.fillStyle=s,i.fill()),v.visible&&this.paintPolygonStroke(P,v,a,b,O,n,i)}else if(f.type===t.SHAPES.RECT){var P=p;if(_.visible&&(i.globalAlpha=_.alpha*n,i.fillStyle=s,i.fillRect(P.x,P.y,P.width,P.height)),v.visible){var D=v.width*(.5-(1-v.alignment)),N=P.width+2*D,C=P.height+2*D;i.globalAlpha=v.alpha*n,i.strokeStyle=a,i.strokeRect(P.x-D,P.y-D,N,C)}}else if(f.type===t.SHAPES.CIRC)P=p,i.beginPath(),i.arc(P.x,P.y,P.radius,0,2*Math.PI),i.closePath(),_.visible&&(i.globalAlpha=_.alpha*n,i.fillStyle=s,i.fill()),v.visible&&(.5!==v.alignment&&(D=v.width*(.5-(1-v.alignment)),i.beginPath(),i.arc(P.x,P.y,P.radius+D,0,2*Math.PI),i.closePath()),i.globalAlpha=v.alpha*n,i.strokeStyle=a,i.stroke());else if(f.type===t.SHAPES.ELIP){if(P=p,(V=1===v.alignment)||this.paintEllipse(P,_,v,s,n,i),v.visible){if(.5!==v.alignment){var w=.5522848,L=(D=v.width*(.5-(1-v.alignment)),2*(P.width+D)),F=2*(P.height+D),U=P.x-L/2,B=P.y-F/2,G=L/2*w,X=F/2*w,k=U+L,H=B+F,Y=U+L/2,j=B+F/2;i.beginPath(),i.moveTo(U,j),i.bezierCurveTo(U,j-X,Y-G,B,Y,B),i.bezierCurveTo(Y+G,B,k,j-X,k,j),i.bezierCurveTo(k,j+X,Y+G,H,Y,H),i.bezierCurveTo(Y-G,H,U,j+X,U,j),i.closePath()}i.globalAlpha=v.alpha*n,i.strokeStyle=a,i.stroke()}V&&this.paintEllipse(P,_,v,s,n,i)}else if(f.type===t.SHAPES.RREC){var V;if(P=p,(V=1===v.alignment)||this.paintRoundedRectangle(P,_,v,s,n,i),v.visible){if(.5!==v.alignment){N=P.width,C=P.height,D=v.width*(.5-(1-v.alignment));var W=P.x-D,z=P.y-D,q=P.width+2*D,K=P.height+2*D,Z=D*(v.alignment>=1?Math.min(q/N,K/C):Math.min(N/q,C/K)),Q=P.radius+Z,J=Math.min(q,K)/2;Q=Q>J?J:Q,i.beginPath(),i.moveTo(W,z+Q),i.lineTo(W,z+K-Q),i.quadraticCurveTo(W,z+K,W+Q,z+K),i.lineTo(W+q-Q,z+K),i.quadraticCurveTo(W+q,z+K,W+q,z+K-Q),i.lineTo(W+q,z+Q),i.quadraticCurveTo(W+q,z,W+q-Q,z),i.lineTo(W+Q,z),i.quadraticCurveTo(W,z,W,z+Q),i.closePath()}i.globalAlpha=v.alpha*n,i.strokeStyle=a,i.stroke()}V&&this.paintRoundedRectangle(P,_,v,s,n,i)}}},e.prototype.paintPolygonStroke=function(t,e,r,i,n,o,s){if(.5!==e.alignment){var a=e.width*(.5-(1-e.alignment)),h=ju.offsetPolygon(t.points,a),u=void 0;s.beginPath(),s.moveTo(h[0],h[1]);for(var l=2;l=0;l-=2)s.lineTo(h[l],h[l+1]);i[c].shape.closeStroke&&s.closePath()}}s.globalAlpha=e.alpha*o,s.strokeStyle=r,s.stroke()},e.prototype.paintEllipse=function(t,e,r,i,n,o){var s=2*t.width,a=2*t.height,h=t.x-s/2,u=t.y-a/2,l=.5522848,c=s/2*l,d=a/2*l,f=h+s,p=u+a,_=h+s/2,v=u+a/2;0===r.alignment&&o.save(),o.beginPath(),o.moveTo(h,v),o.bezierCurveTo(h,v-d,_-c,u,_,u),o.bezierCurveTo(_+c,u,f,v-d,f,v),o.bezierCurveTo(f,v+d,_+c,p,_,p),o.bezierCurveTo(_-c,p,h,v+d,h,v),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*n,o.fillStyle=i,o.fill()),0===r.alignment&&o.restore()},e.prototype.paintRoundedRectangle=function(t,e,r,i,n,o){var s=t.x,a=t.y,h=t.width,u=t.height,l=t.radius,c=Math.min(h,u)/2;l=l>c?c:l,0===r.alignment&&o.save(),o.beginPath(),o.moveTo(s,a+l),o.lineTo(s,a+u-l),o.quadraticCurveTo(s,a+u,s+l,a+u),o.lineTo(s+h-l,a+u),o.quadraticCurveTo(s+h,a+u,s+h,a+u-l),o.lineTo(s+h,a+l),o.quadraticCurveTo(s+h,a,s+h-l,a),o.lineTo(s+l,a),o.quadraticCurveTo(s,a,s,a+l),o.closePath(),0===r.alignment&&o.clip(),e.visible&&(o.globalAlpha=e.alpha*n,o.fillStyle=i,o.fill()),0===r.alignment&&o.restore()},e.prototype.setPatternTransform=function(t,e){if(!1!==this._svgMatrix){if(!this._svgMatrix){var r=document.createElementNS("http://www.w3.org/2000/svg","svg");if(r&&r.createSVGMatrix&&(this._svgMatrix=r.createSVGMatrix()),!this._svgMatrix||!t.setTransform)return void(this._svgMatrix=!1)}this._svgMatrix.a=e.a,this._svgMatrix.b=e.b,this._svgMatrix.c=e.c,this._svgMatrix.d=e.d,this._svgMatrix.e=e.tx,this._svgMatrix.f=e.ty,t.setTransform(this._svgMatrix.inverse())}},e.prototype.destroy=function(){this.renderer=null,this._svgMatrix=null,this._tempMatrix=null},e.extension={name:"graphics",type:t.ExtensionType.CanvasRendererPlugin},e}(),Wu=new sr;sa.prototype.generateCanvasTexture=function(t,e){void 0===e&&(e=1);var r=this.getLocalBounds(),i=bi.create({width:r.width,height:r.height,scaleMode:t,resolution:e});Yu||(Yu=new Bu),this.transform.updateLocalTransform(),this.transform.localTransform.copyTo(Wu),Wu.invert(),Wu.tx-=r.x,Wu.ty-=r.y,Yu.render(this,{renderTexture:i,clear:!0,transform:Wu});var n=yi.from(i.baseTexture._canvasRenderTarget.canvas,{scaleMode:t});return n.baseTexture.setResolution(e),n},sa.prototype.cachedGraphicsData=[],sa.prototype._renderCanvas=function(t){!0!==this.isMask&&(this.finishPoly(),t.plugins.graphics.render(this))};var zu=new sr,qu=function(){function e(t){this.renderer=t}return e.prototype.render=function(e){var r=e._texture,i=this.renderer,n=i.context;if(r.valid){var o=r._frame.width,s=r._frame.height,a=r._frame.width,h=r._frame.height;r.trim&&(a=r.trim.width,h=r.trim.height);var u=e.transform.worldTransform,l=0,c=0,d=r.baseTexture.getDrawableSource();if(!(r.orig.width<=0||r.orig.height<=0)&&r.valid&&d){i.setBlendMode(e.blendMode,!0),i.context.globalAlpha=e.worldAlpha;var f=r.baseTexture.scaleMode===t.SCALE_MODES.LINEAR;i.smoothProperty&&i.context[i.smoothProperty]!==f&&(n[i.smoothProperty]=f),r.trim?(l=r.trim.width/2+r.trim.x-e.anchor.x*r.orig.width,c=r.trim.height/2+r.trim.y-e.anchor.y*r.orig.height):(l=(.5-e.anchor.x)*r.orig.width,c=(.5-e.anchor.y)*r.orig.height),r.rotate&&(u.copyTo(zu),u=zu,pr.matrixAppendRotationInv(u,r.rotate,l,c),l=0,c=0),l-=a/2,c-=h/2,i.setContextTransform(u,e.roundPixels,1),e.roundPixels&&(l|=0,c|=0);var p=r.baseTexture.resolution,_=i._outerBlend;_&&(n.save(),n.beginPath(),n.rect(l*i.resolution,c*i.resolution,a*i.resolution,h*i.resolution),n.clip()),16777215!==e.tint?(e._cachedTint===e.tint&&e._tintedCanvas.tintId===e._texture._updateID||(e._cachedTint=e.tint,e._tintedCanvas=Gu.getTintedCanvas(e,e.tint)),n.drawImage(e._tintedCanvas,0,0,Math.floor(o*p),Math.floor(s*p),Math.floor(l*i.resolution),Math.floor(c*i.resolution),Math.floor(a*i.resolution),Math.floor(h*i.resolution))):n.drawImage(d,r._frame.x*p,r._frame.y*p,Math.floor(o*p),Math.floor(s*p),Math.floor(l*i.resolution),Math.floor(c*i.resolution),Math.floor(a*i.resolution),Math.floor(h*i.resolution)),_&&n.restore(),i.setBlendMode(t.BLEND_MODES.NORMAL)}}},e.prototype.destroy=function(){this.renderer=null},e.extension={name:"sprite",type:t.ExtensionType.CanvasRendererPlugin},e}();ca.prototype._tintedCanvas=null,ca.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)};var Ku=new tr,Zu=function(){function e(t){this.renderer=t}return e.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},e.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},e.prototype.canvas=function(t,e){var r,i,n,o=this.renderer;t&&(n=t instanceof bi?t:o.generateTexture(t)),n?(r=n.baseTexture._canvasRenderTarget.context,i=n.baseTexture._canvasRenderTarget.resolution,e=null!=e?e:n.frame):(r=o.rootContext,i=o.resolution,e||((e=Ku).width=o.width,e.height=o.height));var s=Math.round(e.x*i),a=Math.round(e.y*i),h=Math.round(e.width*i),u=Math.round(e.height*i),l=new He(h,u,1),c=r.getImageData(s,a,h,u);return l.context.putImageData(c,0,0),l.canvas},e.prototype.pixels=function(t,e){var r,i,n,o=this.renderer;t&&(n=t instanceof bi?t:o.generateTexture(t)),n?(r=n.baseTexture._canvasRenderTarget.context,i=n.baseTexture._canvasRenderTarget.resolution,e=null!=e?e:n.frame):(r=o.rootContext,i=o.resolution,e||((e=Ku).width=o.width,e.height=o.height));var s=Math.round(e.x*i),a=Math.round(e.y*i),h=Math.round(e.width*i),u=Math.round(e.height*i);return r.getImageData(s,a,h,u).data},e.prototype.destroy=function(){this.renderer=null},e.extension={name:"extract",type:t.ExtensionType.CanvasRendererPlugin},e}(),Qu=function(t,e){return Qu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},Qu(t,e)};function Ju(t,e){var r=t;if(e instanceof ni){var i=e.source,n=0===i.width?r.canvas.width:Math.min(r.canvas.width,i.width),o=0===i.height?r.canvas.height:Math.min(r.canvas.height,i.height);return r.ctx.drawImage(i,0,0,n,o,0,0,r.canvas.width,r.canvas.height),!0}return!1}var $u=function(e){function r(t){var r=e.call(this,t)||this;return r.uploadHookHelper=r,r.canvas=ot.ADAPTER.createCanvas(16,16),r.ctx=r.canvas.getContext("2d"),r.registerUploadHook(Ju),r}return function(t,e){function r(){this.constructor=t}Qu(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(r,e),r.prototype.destroy=function(){e.prototype.destroy.call(this),this.ctx=null,this.canvas=null},r.extension={name:"prepare",type:t.ExtensionType.CanvasRendererPlugin},r}(Da),tl=new sr,el=new sr,rl=[new Je,new Je,new Je,new Je];return Ha.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.valid){var r=t.context,i=this.worldTransform,n=e.baseTexture,o=n.getDrawableSource(),s=n.resolution;if(this._textureID!==this._texture._updateID||this._cachedTint!==this.tint){this._textureID=this._texture._updateID;var a=new He(e._frame.width,e._frame.height,s);16777215!==this.tint?(this._tintedCanvas=Gu.getTintedCanvas(this,this.tint),a.context.drawImage(this._tintedCanvas,0,0)):a.context.drawImage(o,-e._frame.x*s,-e._frame.y*s),this._cachedTint=this.tint,this._canvasPattern=a.context.createPattern(a.canvas,"repeat")}r.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),this.tileTransform.updateLocalTransform();var h=this.tileTransform.localTransform,u=this._width,l=this._height;tl.identity(),el.copyFrom(h),this.uvRespectAnchor||el.translate(-this.anchor.x*u,-this.anchor.y*l),el.scale(this.tileScale.x/s,this.tileScale.y/s),tl.prepend(el),tl.prepend(i),t.setContextTransform(tl),r.fillStyle=this._canvasPattern;var c=this.anchor.x*-u,d=this.anchor.y*-l;rl[0].set(c,d),rl[1].set(c+u,d),rl[2].set(c+u,d+l),rl[3].set(c,d+l);for(var f=0;f<4;f++)el.applyInverse(rl[f],rl[f]);for(r.beginPath(),r.moveTo(rl[0].x,rl[0].y),f=1;f<4;f++)r.lineTo(rl[f].x,rl[f].y);r.closePath(),r.fill()}},Ms.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var h=0;h




© 2015 - 2025 Weber Informatics LLC | Privacy Policy