Teoxoy

PIXI v5 with fix

May 24th, 2019
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*!
  2.  * pixi.js - v5.0.3
  3.  * Compiled Sat, 25 May 2019 01:54:04 UTC
  4.  *
  5.  * pixi.js is licensed under the MIT License.
  6.  * http://www.opensource.org/licenses/mit-license
  7.  */
  8. var PIXI=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t,e){return t(e={exports:{}},e.exports),e.exports}var n=i(function(t,r){!function(t){var e=t.Promise,i=e&&"resolve"in e&&"reject"in e&&"all"in e&&"race"in e&&function(){var t;return new e(function(e){t=e}),"function"==typeof t}();r?(r.Promise=i?e:E,r.Polyfill=E):i||(t.Promise=E);var n="pending",o="sealed",s="fulfilled",a="rejected",h=function(){};function u(t){return"[object Array]"===Object.prototype.toString.call(t)}var l,c="undefined"!=typeof setImmediate?setImmediate:setTimeout,d=[];function p(){for(var t=0;t<d.length;t++)d[t][0](d[t][1]);d=[],l=!1}function f(t,e){d.push([t,e]),l||(l=!0,c(p,0))}function v(t){var e=t.owner,r=e.state_,i=e.data_,n=t[r],o=t.then;if("function"==typeof n){r=s;try{i=n(i)}catch(t){_(o,t)}}g(o,i)||(r===s&&m(o,i),r===a&&_(o,i))}function g(t,e){var r;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"==typeof e)){var i=e.then;if("function"==typeof i)return i.call(e,function(i){r||(r=!0,e!==i?m(t,i):y(t,i))},function(e){r||(r=!0,_(t,e))}),!0}}catch(e){return r||_(t,e),!0}return!1}function m(t,e){t!==e&&g(t,e)||y(t,e)}function y(t,e){t.state_===n&&(t.state_=o,t.data_=e,f(b,t))}function _(t,e){t.state_===n&&(t.state_=o,t.data_=e,f(T,t))}function x(t){var e=t.then_;t.then_=void 0;for(var r=0;r<e.length;r++)v(e[r])}function b(t){t.state_=s,x(t)}function T(t){t.state_=a,x(t)}function E(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof E==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],function(t,e){function r(t){_(e,t)}try{t(function(t){m(e,t)},r)}catch(t){r(t)}}(t,this)}E.prototype={constructor:E,state_:n,then_:null,data_:void 0,then:function(t,e){var r={owner:this,then:new this.constructor(h),fulfilled:t,rejected:e};return this.state_===s||this.state_===a?f(v,r):this.then_.push(r),r.then},catch:function(t){return this.then(null,t)}},E.all=function(t){if(!u(t))throw new TypeError("You must pass an array to Promise.all().");return new this(function(e,r){var i=[],n=0;function o(t){return n++,function(r){i[t]=r,--n||e(i)}}for(var s,a=0;a<t.length;a++)(s=t[a])&&"function"==typeof s.then?s.then(o(a),r):i[a]=s;n||e(i)})},E.race=function(t){if(!u(t))throw new TypeError("You must pass an array to Promise.race().");return new this(function(e,r){for(var i,n=0;n<t.length;n++)(i=t[n])&&"function"==typeof i.then?i.then(e,r):e(i)})},E.resolve=function(t){return t&&"object"==typeof t&&t.constructor===this?t:new this(function(e){e(t)})},E.reject=function(t){return new this(function(e,r){r(t)})}}("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:e)}),o=(n.Promise,n.Polyfill),s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var u=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,i,n=arguments,o=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u<arguments.length;u++){for(var l in r=Object(n[u]))a.call(r,l)&&(o[l]=r[l]);if(s){i=s(r);for(var c=0;c<i.length;c++)h.call(r,i[c])&&(o[i[c]]=r[i[c]])}}return o};window.Promise||(window.Promise=o),Object.assign||(Object.assign=u);var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!l.performance||!l.performance.now){var c=Date.now();l.performance||(l.performance={}),l.performance.now=function(){return Date.now()-c}}for(var d=Date.now(),p=["ms","moz","webkit","o"],f=0;f<p.length&&!l.requestAnimationFrame;++f){var v=p[f];l.requestAnimationFrame=l[v+"RequestAnimationFrame"],l.cancelAnimationFrame=l[v+"CancelAnimationFrame"]||l[v+"CancelRequestAnimationFrame"]}l.requestAnimationFrame||(l.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),r=16+d-e;return r<0&&(r=0),d=e,setTimeout(function(){d=Date.now(),t(performance.now())},r)}),l.cancelAnimationFrame||(l.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);var g=i(function(t){!function(e){var r=/iPhone/i,i=/iPod/i,n=/iPad/i,o=/\bAndroid(?:.+)Mobile\b/i,s=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,h=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,u=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,d=/BB10/i,p=/Opera Mini/i,f=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}function m(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),m=e.split("[FBAN");void 0!==m[1]&&(e=m[0]),void 0!==(m=e.split("Twitter"))[1]&&(e=m[0]);var y={apple:{phone:g(r,e)&&!g(u,e),ipod:g(i,e),tablet:!g(r,e)&&g(n,e)&&!g(u,e),device:(g(r,e)||g(i,e)||g(n,e))&&!g(u,e)},amazon:{phone:g(a,e),tablet:!g(a,e)&&g(h,e),device:g(a,e)||g(h,e)},android:{phone:!g(u,e)&&g(a,e)||!g(u,e)&&g(o,e),tablet:!g(u,e)&&!g(a,e)&&!g(o,e)&&(g(h,e)||g(s,e)),device:!g(u,e)&&(g(a,e)||g(h,e)||g(o,e)||g(s,e))||g(/\bokhttp\b/i,e)},windows:{phone:g(u,e),tablet:g(l,e),device:g(u,e)||g(l,e)},other:{blackberry:g(c,e),blackberry10:g(d,e),opera:g(p,e),firefox:g(v,e),chrome:g(f,e),device:g(c,e)||g(d,e)||g(p,e)||g(v,e)||g(f,e)}};return y.any=y.apple.device||y.android.device||y.windows.device||y.other.device,y.phone=y.apple.phone||y.android.phone||y.windows.phone,y.tablet=y.apple.tablet||y.android.tablet||y.windows.tablet,y}t.exports&&"undefined"==typeof window?t.exports=m:t.exports&&"undefined"!=typeof window?(t.exports=m(),t.exports.isMobile=m):e.isMobile=m()}(e)});g.isMobile;var m={MIPMAP_TEXTURES:1,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(g.tablet||g.phone){if(e=!1,g.apple.device){var r=navigator.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)>=11&&(e=!0)}if(g.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);i&&parseInt(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:g.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!g.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},y=i(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);n<o;n++)s[n]=i[n].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,n,o,s){var a=arguments,h=r?r+t:t;if(!this._events[h])return!1;var u,l,c=this._events[h],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,n),!0;case 5:return c.fn.call(c.context,e,i,n,o),!0;case 6:return c.fn.call(c.context,e,i,n,o,s),!0}for(l=1,u=new Array(d-1);l<d;l++)u[l-1]=a[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,n);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=a[p];c[l].fn.apply(c[l].context,u)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,i,n){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||s(this,o);else{for(var h=0,u=[],l=a.length;h<l;h++)(a[h].fn!==e||n&&!a[h].once||i&&a[h].context!==i)&&u.push(a[h]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a}),_=b,x=b;function b(t,e,r){r=r||2;var i,n,o,s,a,h,u,l=e&&e.length,c=l?e[0]*r:t.length,d=T(t,0,c,r,!0),p=[];if(!d||d.next===d.prev)return p;if(l&&(d=function(t,e,r,i){var n,o,s,a,h,u=[];for(n=0,o=e.length;n<o;n++)s=e[n]*i,a=n<o-1?e[n+1]*i:t.length,(h=T(t,s,a,i,!1))===h.next&&(h.steiner=!0),u.push(D(h));for(u.sort(O),n=0;n<u.length;n++)C(u[n],r),r=E(r,r.next);return r}(t,e,d,r)),t.length>80*r){i=o=t[0],n=s=t[1];for(var f=r;f<c;f+=r)(a=t[f])<i&&(i=a),(h=t[f+1])<n&&(n=h),a>o&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?1/u:0}return w(d,p,r,i,n,u),p}function T(t,e,r,i,n){var o,s;if(n===H(t,e,r,i)>0)for(o=e;o<r;o+=i)s=X(o,t[o],t[o+1],s);else for(o=r-i;o>=e;o-=i)s=X(o,t[o],t[o+1],s);return s&&N(s,s.next)&&(j(s),s=s.next),s}function E(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!N(i,i.next)&&0!==L(i.prev,i,i.next))i=i.next;else{if(j(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function w(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=M(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;e<u&&(a++,i=i.nextZ);e++);for(h=u;a>0||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?P(t,i,n,o):S(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),j(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?w(t=I(t,e,r),e,r,i,n,o,2):2===s&&A(t,e,r,i,n,o):w(E(t),e,r,i,n,o,1);break}}}function S(t){var e=t.prev,r=t,i=t.next;if(L(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(R(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&L(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function P(t,e,r,i){var n=t.prev,o=t,s=t.next;if(L(n,o,s)>=0)return!1;for(var a=n.x<o.x?n.x<s.x?n.x:s.x:o.x<s.x?o.x:s.x,h=n.y<o.y?n.y<s.y?n.y:s.y:o.y<s.y?o.y:s.y,u=n.x>o.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=M(a,h,e,r,i),d=M(u,l,e,r,i),p=t.prevZ,f=t.nextZ;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&L(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&R(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&L(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function I(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!N(n,o)&&U(n,i,i.next,o)&&B(n,o)&&B(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),j(i),j(i.next),i=t=o),i=i.next}while(i!==t);return i}function A(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&F(s,a)){var h=k(s,a);return s=E(s,s.next),h=E(h,h.next),w(s,e,r,i,n,o),void w(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function O(t,e){return t.x-e.x}function C(t,e){if(e=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){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===s)return r.prev;var h,u=r,l=r.x,c=r.y,d=1/0;i=r.next;for(;i!==u;)n>=i.x&&i.x>=l&&n!==i.x&&R(o<c?n:s,o,l,c,o<c?s:n,o,i.x,i.y)&&((h=Math.abs(o-i.y)/(n-i.x))<d||h===d&&i.x>r.x)&&B(i,t)&&(r=i,d=h),i=i.next;return r}(t,e)){var r=k(e,t);E(r,r.next)}}function M(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function R(t,e,r,i,n,o,s,a){return(n-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function F(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&&U(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&B(t,e)&&B(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)}function L(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function N(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,r,i){return!!(N(t,e)&&N(r,i)||N(t,i)&&N(r,e))||L(t,e,r)>0!=L(t,e,i)>0&&L(r,i,t)>0!=L(r,i,e)>0}function B(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function k(t,e){var r=new G(t.i,t.x,t.y),i=new G(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 X(t,e,r,i){var n=new G(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 j(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 G(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function H(t,e,r,i){for(var n=0,o=e,s=r-i;o<r;o+=i)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}b.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,s=Math.abs(H(t,0,o,r));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*r,l=a<h-1?e[a+1]*r:t.length;s-=Math.abs(H(t,u,l,r))}var c=0;for(a=0;a<i.length;a+=3){var d=i[a]*r,p=i[a+1]*r,f=i[a+2]*r;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},b.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[n][o][s]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r},_.default=x;var Y=i(function(t,r){!function(i){var n=r&&!r.nodeType&&r,o=t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,g=128,m="-",y=/^xn--/,_=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=l-c,E=Math.floor,w=String.fromCharCode;function S(t){throw RangeError(b[t])}function P(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function I(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+P((t=t.replace(x,".")).split("."),e).join(".")}function A(t){for(var e,r,i=[],n=0,o=t.length;n<o;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<o?56320==(64512&(r=t.charCodeAt(n++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--):i.push(e);return i}function O(t){return P(t,function(t){var e="";return t>65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,r){var i=0;for(t=r?E(t/f):t>>1,t+=E(t/e);t>T*d>>1;i+=l)t=E(t/T);return E(i+(T+1)*t/(t+p))}function D(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,T=g,w=v;for((r=t.lastIndexOf(m))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&S("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n<x;){for(o=b,s=1,a=l;n>=x&&S("invalid-input"),((h=(y=t.charCodeAt(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>E((u-b)/s))&&S("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>E(u/(f=l-p))&&S("overflow"),s*=f;w=M(b-o,e=_.length+1,0==o),E(b/e)>u-T&&S("overflow"),T+=E(b/e),b%=e,_.splice(b++,0,T)}return O(_)}function R(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,T,P=[];for(_=(t=A(t)).length,e=g,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&P.push(w(y));for(i=n=P.length,n&&P.push(m);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&y<a&&(a=y);for(a-e>E((u-r)/(x=i+1))&&S("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])<e&&++r>u&&S("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)T=h-f,b=l-f,P.push(w(C(f+T%b,0))),h=E(T/b);P.push(w(C(h,0))),o=M(r,x,i==n),r=0,++i}++r,++e}return P.join("")}if(a={version:"1.3.2",ucs2:{decode:A,encode:O},decode:D,encode:R,toASCII:function(t){return I(t,function(t){return _.test(t)?"xn--"+R(t):t})},toUnicode:function(t){return I(t,function(t){return y.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasOwnProperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),z={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}};z.isString,z.isObject,z.isNull,z.isNullOrUndefined;function V(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var W=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<a;++h){var u,l,c,d,p=t[h].replace(o,"%20"),f=p.indexOf(r);f>=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeURIComponent(u),d=decodeURIComponent(l),V(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},q=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Z=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(q(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return n+encodeURIComponent(q(t))}).join(e):n+encodeURIComponent(q(t[i]))}).join(e):i?encodeURIComponent(q(i))+r+encodeURIComponent(q(t)):""},K=i(function(t,e){e.decode=e.parse=W,e.encode=e.stringify=Z}),J=(K.decode,K.parse,K.encode,K.stringify,vt),Q=function(t,e){return vt(t,!1,!0).resolve(e)},$=function(t,e){if(!t)return e;return vt(t,!1,!0).resolveObject(e)},tt=function(t){z.isString(t)&&(t=vt(t));if(!(t instanceof rt))return rt.prototype.format.call(t);return t.format()},et=rt;function rt(){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 it=/^([a-z0-9.+-]+:)/i,nt=/:[0-9]*$/,ot=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,st=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),at=["'"].concat(st),ht=["%","/","?",";","#"].concat(at),ut=["/","?","#"],lt=/^[+a-z0-9A-Z_-]{0,63}$/,ct=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},pt={javascript:!0,"javascript:":!0},ft={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vt(t,e,r){if(t&&z.isObject(t)&&t instanceof rt)return t;var i=new rt;return i.parse(t,e,r),i}rt.prototype.parse=function(t,e,r){if(!z.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&1===t.split("#").length){var a=ot.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?K.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var h=it.exec(s);if(h){var u=(h=h[0]).toLowerCase();this.protocol=u,s=s.substr(h.length)}if(r||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var l="//"===s.substr(0,2);!l||h&&pt[h]||(s=s.substr(2),this.slashes=!0)}if(!pt[h]&&(l||h&&!ft[h])){for(var c,d,p=-1,f=0;f<ut.length;f++){-1!==(v=s.indexOf(ut[f]))&&(-1===p||v<p)&&(p=v)}-1!==(d=-1===p?s.lastIndexOf("@"):s.lastIndexOf("@",p))&&(c=s.slice(0,d),s=s.slice(d+1),this.auth=decodeURIComponent(c)),p=-1;for(f=0;f<ht.length;f++){var v;-1!==(v=s.indexOf(ht[f]))&&(-1===p||v<p)&&(p=v)}-1===p&&(p=s.length),this.host=s.slice(0,p),s=s.slice(p),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var m=this.hostname.split(/\./),y=(f=0,m.length);f<y;f++){var _=m[f];if(_&&!_.match(lt)){for(var x="",b=0,T=_.length;b<T;b++)_.charCodeAt(b)>127?x+="x":x+=_[b];if(!x.match(lt)){var E=m.slice(0,f),w=m.slice(f+1),S=_.match(ct);S&&(E.push(S[1]),w.unshift(S[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=E.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Y.toASCII(this.hostname));var P=this.port?":"+this.port:"",I=this.hostname||"";this.host=I+P,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=at.length;f<y;f++){var A=at[f];if(-1!==s.indexOf(A)){var O=encodeURIComponent(A);O===A&&(O=escape(A)),s=s.split(A).join(O)}}var C=s.indexOf("#");-1!==C&&(this.hash=s.substr(C),s=s.slice(0,C));var M=s.indexOf("?");if(-1!==M?(this.search=s.substr(M),this.query=s.substr(M+1),e&&(this.query=K.parse(this.query)),s=s.slice(0,M)):e&&(this.search="",this.query={}),s&&(this.pathname=s),ft[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){P=this.pathname||"";var D=this.search||"";this.path=P+D}return this.href=this.format(),this},rt.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&z.isObject(this.query)&&Object.keys(this.query).length&&(o=K.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||ft[e])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),e+n+(r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+i},rt.prototype.resolve=function(t){return this.resolveObject(vt(t,!1,!0)).format()},rt.prototype.resolveObject=function(t){if(z.isString(t)){var e=new rt;e.parse(t,!1,!0),t=e}for(var r=new rt,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var h=s[a];"protocol"!==h&&(r[h]=t[h])}return ft[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!ft[t.protocol]){for(var u=Object.keys(t),l=0;l<u.length;l++){var c=u[l];r[c]=t[c]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||pt[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var p=r.pathname||"",f=r.search||"";r.path=p+f}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),g=t.host||t.pathname&&"/"===t.pathname.charAt(0),m=g||v||r.host&&t.pathname,y=m,_=r.pathname&&r.pathname.split("/")||[],x=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!ft[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),m=m&&(""===d[0]||""===_[0])),g)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,_=d;else if(d.length)_||(_=[]),_.pop(),_=_.concat(d),r.search=t.search,r.query=t.query;else if(!z.isNullOrUndefined(t.search)){if(x)r.hostname=r.host=_.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=t.search,r.query=t.query,z.isNull(r.pathname)&&z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],T=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,E=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),E++):E&&(_.splice(w,1),E--);if(!m&&!y)for(;E--;E)_.unshift("..");!m||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),T&&"/"!==_.join("/").substr(-1)&&_.push("");var S,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);x&&(r.hostname=r.host=P?"":_.length?_.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(m=m||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),z.isNull(r.pathname)&&z.isNull(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},rt.prototype.parseHost=function(){var t=this.host,e=nt.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var gt={parse:J,resolve:Q,resolveObject:$,format:tt,Url:et},mt={WEBGL_LEGACY:0,WEBGL:1,WEBGL2:2},yt={UNKNOWN:0,WEBGL:1,CANVAS:2},_t={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19,NONE:20,SRC_OVER:0,SRC_IN:21,SRC_OUT:22,SRC_ATOP:23,DST_OVER:24,DST_IN:25,DST_OUT:26,DST_ATOP:27,ERASE:26,SUBTRACT:28},xt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bt={RGBA:6408,RGB:6407,ALPHA:6406,LUMINANCE:6409,LUMINANCE_ALPHA:6410,DEPTH_COMPONENT:6402,DEPTH_STENCIL:34041},Tt={TEXTURE_2D:3553,TEXTURE_CUBE_MAP:34067,TEXTURE_2D_ARRAY:35866,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074},Et={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_SHORT_5_6_5:33635,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,FLOAT:5126,HALF_FLOAT:36193},wt={LINEAR:1,NEAREST:0},St={CLAMP:33071,REPEAT:10497,MIRRORED_REPEAT:33648},Pt={OFF:0,POW2:1,ON:2},It={AUTO:0,MANUAL:1},At={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"};m.RETINA_PREFIX=/@([0-9\.]+)x/;var Ot,Ct=!1,Mt="5.0.3";function Dt(t){if(!Ct){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c PixiJS "+Mt+" - ✰ "+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;"];window.console.log.apply(console,e)}else window.console&&window.console.log("PixiJS "+Mt+" - "+t+" - http://www.pixijs.com/");Ct=!0}}function Rt(){return void 0===Ot&&(Ot=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),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}}()),Ot}function Ft(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Lt(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)}function Nt(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var Ut=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[_t.NORMAL_NPM]=_t.NORMAL,t[_t.ADD_NPM]=_t.ADD,t[_t.SCREEN_NPM]=_t.SCREEN,e[_t.NORMAL]=_t.NORMAL_NPM,e[_t.ADD]=_t.ADD_NPM,e[_t.SCREEN]=_t.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function Bt(t,e){return Ut[e?1:0][t]}function kt(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 Xt(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=n*e+.5|0)}function jt(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 Gt(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i<e;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r}function Ht(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<o;++i)t[i]=t[i+r];t.length=o}}var Yt=0;function zt(){return++Yt}function Vt(t){return 0===t?0:t<0?-1:1}function Wt(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function qt(t){return!(t&t-1||!t)}function Zt(t){var e=(t>65535)<<4,r=((t>>>=e)>255)<<3;return e|=r,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}var Kt={},Jt=Object.create(null),Qt=Object.create(null);function $t(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(r=e/4%n,i=~~(e/4/n),null===u.top&&(u.top=i),null===u.left?u.left=r:r<u.left&&(u.left=r),null===u.right?u.right=r+1:u.right<r&&(u.right=r+1),null===u.bottom?u.bottom=i:u.bottom<i&&(u.bottom=i));return null!==u.top&&(n=u.right-u.left,o=u.bottom-u.top+1,l=s.getImageData(u.left,u.top,n,o)),{height:o,width:n,data:l}}var te=function(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||m.RESOLUTION,this.resize(t,e)},ee={width:{configurable:!0},height:{configurable:!0}};te.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},te.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},te.prototype.destroy=function(){this.context=null,this.canvas=null},ee.width.get=function(){return this.canvas.width},ee.width.set=function(t){this.canvas.width=t},ee.height.get=function(){return this.canvas.height},ee.height.set=function(t){this.canvas.height=t},Object.defineProperties(te.prototype,ee);var re,ie=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function ne(t){var e=ie.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}function oe(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,re||(re=document.createElement("a")),re.href=t;var r=!(t=gt.parse(re.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"}function se(t,e){var r=m.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}var ae={};function he(t,e,r){if(void 0===r&&(r=3),!ae[e]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(i))),ae[e]=!0}}var ue={BaseTextureCache:Qt,CanvasRenderTarget:te,DATA_URI:ie,ProgramCache:Kt,TextureCache:Jt,clearTextureCache:function(){var t;for(t in Jt)delete Jt[t];for(t in Qt)delete Qt[t]},correctBlendMode:Bt,createIndicesForQuads:Gt,decomposeDataUri:ne,deprecation:he,destroyTextureCache:function(){var t;for(t in Jt)Jt[t].destroy();for(t in Qt)Qt[t].destroy()},determineCrossOrigin:oe,getResolutionOfUrl:se,hex2rgb:Ft,hex2string:Lt,isPow2:qt,isWebGLSupported:Rt,log2:Zt,nextPow2:Wt,premultiplyBlendMode:Ut,premultiplyRgba:kt,premultiplyTint:Xt,premultiplyTintToRgba:jt,removeItems:Ht,rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},sayHello:Dt,sign:Vt,skipHello:function(){Ct=!0},string2hex:Nt,trimCanvas:$t,uid:zt,isMobile:g,EventEmitter:y,earcut:_,url:gt},le=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e};le.prototype.clone=function(){return new le(this.x,this.y)},le.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},le.prototype.copyTo=function(t){return t.set(this.x,this.y),t},le.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},le.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)};var ce=function(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},de={x:{configurable:!0},y:{configurable:!0}};ce.prototype.clone=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var r=t||this.cb,i=e||this.scope;return new ce(r,i,this._x,this._y)},ce.prototype.set=function(t,e){var r=t||0,i=e||(0!==e?r:0);this._x===r&&this._y===i||(this._x=r,this._y=i,this.cb.call(this.scope))},ce.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},ce.prototype.copyTo=function(t){return t.set(this._x,this._y),t},ce.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},de.x.get=function(){return this._x},de.x.set=function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},de.y.get=function(){return this._y},de.y.set=function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},Object.defineProperties(ce.prototype,de);var pe=2*Math.PI,fe=180/Math.PI,ve=Math.PI/180,ge={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},me=function(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.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this.array=null},ye={IDENTITY:{configurable:!0},TEMP_MATRIX:{configurable:!0}};me.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]},me.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},me.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},me.prototype.apply=function(t,e){e=e||new le;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},me.prototype.applyInverse=function(t,e){e=e||new le;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},me.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},me.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},me.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},me.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},me.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},me.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},me.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=-Math.atan2(-i,n),s=Math.atan2(r,e),a=Math.abs(o+s);return a<1e-5||Math.abs(pe-a)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=s),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx,t.position.y=this.ty,t},me.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},me.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},me.prototype.clone=function(){var t=new me;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},me.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},me.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},ye.IDENTITY.get=function(){return new me},ye.TEMP_MATRIX.get=function(){return new me},Object.defineProperties(me,ye);var _e=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],xe=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],be=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Te=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ee=[],we=[];function Se(t){return t<0?-1:t>0?1:0}!function(){for(var t=0;t<16;t++){var e=[];we.push(e);for(var r=0;r<16;r++)for(var i=Se(_e[t]*_e[r]+be[t]*xe[r]),n=Se(xe[t]*_e[r]+Te[t]*xe[r]),o=Se(_e[t]*be[r]+be[t]*Te[r]),s=Se(xe[t]*be[r]+Te[t]*Te[r]),a=0;a<16;a++)if(_e[a]===i&&xe[a]===n&&be[a]===o&&Te[a]===s){e.push(a);break}}for(var h=0;h<16;h++){var u=new me;u.set(_e[h],xe[h],be[h],Te[h],0,0),Ee.push(u)}}();var Pe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return _e[t]},uY:function(t){return xe[t]},vX:function(t){return be[t]},vY:function(t){return Te[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return we[t][e]},sub:function(t,e){return we[t][Pe.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?Pe.S:Pe.N:2*Math.abs(e)<=Math.abs(t)?t>0?Pe.E:Pe.W:e>0?t>0?Pe.SE:Pe.SW:t>0?Pe.NE:Pe.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Ee[Pe.inv(e)];n.tx=r,n.ty=i,t.append(n)}},Ie=function(){this.worldTransform=new me,this.localTransform=new me,this.position=new ce(this.onChange,this,0,0),this.scale=new ce(this.onChange,this,1,1),this.pivot=new ce(this.onChange,this,0,0),this.skew=new ce(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},Ae={rotation:{configurable:!0}};Ie.prototype.onChange=function(){this._localID++},Ie.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++},Ie.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)},Ie.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++}},Ie.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Ae.rotation.get=function(){return this._rotation},Ae.rotation.set=function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},Object.defineProperties(Ie.prototype,Ae),Ie.IDENTITY=new Ie;var Oe=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=ge.RECT},Ce={left:{configurable:!0},right:{configurable:!0},top:{configurable:!0},bottom:{configurable:!0}},Me={EMPTY:{configurable:!0}};Ce.left.get=function(){return this.x},Ce.right.get=function(){return this.x+this.width},Ce.top.get=function(){return this.y},Ce.bottom.get=function(){return this.y+this.height},Me.EMPTY.get=function(){return new Oe(0,0,0,0)},Oe.prototype.clone=function(){return new Oe(this.x,this.y,this.width,this.height)},Oe.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Oe.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Oe.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},Oe.prototype.pad=function(t,e){t=t||0,e=e||(0!==e?t:0),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e},Oe.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);this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0)},Oe.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;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},Oe.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);this.x=e,this.width=r-e,this.y=i,this.height=n-i},Object.defineProperties(Oe.prototype,Ce),Object.defineProperties(Oe,Me);var De=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),this.x=t,this.y=e,this.radius=r,this.type=ge.CIRC};De.prototype.clone=function(){return new De(this.x,this.y,this.radius)},De.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},De.prototype.getBounds=function(){return new Oe(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)};var Re=function(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=t,this.y=e,this.width=r,this.height=i,this.type=ge.ELIP};Re.prototype.clone=function(){return new Re(this.x,this.y,this.width,this.height)},Re.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},Re.prototype.getBounds=function(){return new Oe(this.x-this.width,this.y-this.height,this.width,this.height)};var Fe=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];if(Array.isArray(e[0])&&(e=e[0]),e[0]instanceof le){for(var i=[],n=0,o=e.length;n<o;n++)i.push(e[n].x,e[n].y);e=i}this.points=e,this.type=ge.POLY,this.closeStroke=!0};Fe.prototype.clone=function(){var t=new Fe(this.points.slice());return t.closeStroke=this.closeStroke,t},Fe.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r};var Le=function(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=ge.RREC};Le.prototype.clone=function(){return new Le(this.x,this.y,this.width,this.height,this.radius)},Le.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){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},m.SORTABLE_CHILDREN=!1;var Ne=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Ne.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Ne.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Ne.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Oe.EMPTY:((t=t||new Oe(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Ne.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)},Ne.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,i=o>i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Ne.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,g=s*e+h*r+l,m=a*e+u*r+c;d=g<d?g:d,p=m<p?m:p,f=g>f?g:f,v=m>v?m:v,d=(g=s*i+h*r+l)<d?g:d,p=(m=a*i+u*r+c)<p?m:p,f=g>f?g:f,v=m>v?m:v,d=(g=s*e+h*n+l)<d?g:d,p=(m=a*e+u*n+c)<p?m:p,f=g>f?g:f,v=m>v?m:v,d=(g=s*i+h*n+l)<d?g:d,p=(m=a*i+u*n+c)<p?m:p,f=g>f?g:f,v=m>v?m:v,this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Ne.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<r;a+=2){var h=t[a],u=t[a+1];i=h<i?h:i,n=u<n?u:n,o=h>o?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Ne.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=r;v<i;v+=2){var g=e[v],m=e[v+1],y=o*g+a*m+u,_=h*m+s*g+l;c=y<c?y:c,d=_<d?_:d,p=y>p?y:p,f=_>f?_:f}this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Ne.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Ne.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.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=n&&i<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}},Ne.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.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=n&&i<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}};var Ue=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new Ie,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ne,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=Object.keys(t),i=0;i<r.length;++i){var n=r[i];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},r._tempDisplayObjectParent.get=function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new e),this.tempDisplayObjectParent},e.prototype.updateTransform=function(){this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++},e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._boundsID!==this._lastBoundsID&&this.calculateBounds(),e||(this._boundsRect||(this._boundsRect=new Oe),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,t||(this._localBoundsRect||(this._localBoundsRect=new Oe),t=this._localBoundsRect);var i=this.getBounds(!1,t);return this.parent=r,this.transform=e,i},e.prototype.toGlobal=function(t,e,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},e.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},e.prototype.render=function(t){},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filterArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},r.x.get=function(){return this.position.x},r.x.set=function(t){this.transform.position.x=t},r.y.get=function(){return this.position.y},r.y.set=function(t){this.transform.position.y=t},r.worldTransform.get=function(){return this.transform.worldTransform},r.localTransform.get=function(){return this.transform.localTransform},r.position.get=function(){return this.transform.position},r.position.set=function(t){this.transform.position.copyFrom(t)},r.scale.get=function(){return this.transform.scale},r.scale.set=function(t){this.transform.scale.copyFrom(t)},r.pivot.get=function(){return this.transform.pivot},r.pivot.set=function(t){this.transform.pivot.copyFrom(t)},r.skew.get=function(){return this.transform.skew},r.skew.set=function(t){this.transform.skew.copyFrom(t)},r.rotation.get=function(){return this.transform.rotation},r.rotation.set=function(t){this.transform.rotation=t},r.angle.get=function(){return this.transform.rotation*fe},r.angle.set=function(t){this.transform.rotation=t*ve},r.zIndex.get=function(){return this._zIndex},r.zIndex.set=function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},r.worldVisible.get=function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},r.mask.get=function(){return this._mask},r.mask.set=function(t){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)},Object.defineProperties(e.prototype,r),e}(y);function Be(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}Ue.prototype.displayObjectUpdateTransform=Ue.prototype.updateTransform;var ke=function(t){function e(){t.call(this),this.children=[],this.sortableChildren=m.SORTABLE_CHILDREN,this.sortDirty=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0}};return e.prototype.onChildrenChange=function(){},e.prototype.addChild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i<r;i++)this.addChild(e[i]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this);return t},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},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<i?r:i)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);Ht(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(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i<r;i++)this.removeChild(e[i]);else{var n=this.children.indexOf(t);if(-1===n)return null;t.parent=null,t.transform._parentID=-1,Ht(this.children,n,1),this._boundsID++,this.onChildrenChange(n),t.emit("removed",this),this.emit("childRemoved",t,this,n)}return t},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,Ht(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0);var r,i=t,n="number"==typeof e?e:this.children.length,o=n-i;if(o>0&&o<=n){r=this.children.splice(i,o);for(var s=0;s<r.length;++s)r[s].parent=null,r[s].transform&&(r[s].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var a=0;a<r.length;++a)r[a].emit("removed",this),this.emit("childRemoved",r[a],this,a);return r}if(0===o&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,r=this.children.length;e<r;++e){var i=this.children[e];i._lastSortedIndex=e,t||0===i.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(Be),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;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];e.visible&&e.renderable&&(e.calculateBounds(),e._mask?(e._mask.calculateBounds(),this._bounds.addBoundsMask(e._bounds,e._mask._bounds)):e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds))}this._lastBoundsID=this._boundsID},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters)this.renderAdvanced(t);else{this._render(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var i=0;i<e.length;i++)e[i].enabled&&this._enabledFilters.push(e[i]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}r&&t.mask.push(this,this._mask),this._render(t);for(var n=0,o=this.children.length;n<o;n++)this.children[n].render(t);t.batch.flush(),r&&t.mask.pop(this,this._mask),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var r="boolean"==typeof e?e:e&&e.children,i=this.removeChildren(0,this.children.length);if(r)for(var n=0;n<i.length;++n)i[n].destroy(e)},r.width.get=function(){return this.scale.x*this.getLocalBounds().width},r.width.set=function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},r.height.get=function(){return this.scale.y*this.getLocalBounds().height},r.height.set=function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},Object.defineProperties(e.prototype,r),e}(Ue);ke.prototype.containerUpdateTransform=ke.prototype.updateTransform;var Xe={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:!1};Ue.mixin(Xe);var je=function(t){this._hookDiv=null,(g.tablet||g.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2,this.div=e,this.pool=[],this.renderId=0,this.debug=!1,this.renderer=t,this.children=[],this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this.isActive=!1,this.isMobileAccessibility=!1,window.addEventListener("keydown",this._onKeyDown,!1)};je.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2,e.style.backgroundColor="#FF0000",e.title="HOOK DIV",e.addEventListener("focus",function(){t.isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e},je.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},je.prototype.activate=function(){this.isActive||(this.isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode&&this.renderer.view.parentNode.appendChild(this.div))},je.prototype.deactivate=function(){this.isActive&&!this.isMobileAccessibility&&(this.isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},je.prototype.updateAccessibleObjects=function(t){if(t.visible){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,r=0;r<e.length;r++)this.updateAccessibleObjects(e[r])}},je.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var n=0;n<this.children.length;n++){var o=this.children[n];if(o.renderId!==this.renderId)o._accessibleActive=!1,Ht(this.children,n,1),this.div.removeChild(o._accessibleDiv),this.pool.push(o._accessibleDiv),o._accessibleDiv=null,n--,0===this.children.length&&this.deactivate();else{i=o._accessibleDiv;var s=o.hitArea,a=o.worldTransform;o.hitArea?(i.style.left=(a.tx+s.x*a.a)*e+"px",i.style.top=(a.ty+s.y*a.d)*r+"px",i.style.width=s.width*a.a*e+"px",i.style.height=s.height*a.d*r+"px"):(s=o.getBounds(),this.capHitArea(s),i.style.left=s.x*e+"px",i.style.top=s.y*r+"px",i.style.width=s.width*e+"px",i.style.height=s.height*r+"px",i.title!==o.accessibleTitle&&null!==o.accessibleTitle&&(i.title=o.accessibleTitle),i.getAttribute("aria-label")!==o.accessibleHint&&null!==o.accessibleHint&&i.setAttribute("aria-label",o.accessibleHint))}}this.renderId++}},je.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},je.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,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,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))),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),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},je.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},je.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},je.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},je.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},je.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},je.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var t=0;t<this.children.length;t++)this.children[t].div=null;window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null};var Ge={AccessibilityManager:je,accessibleTarget:Xe},He=function(t){this.items=[],this._name=t},Ye={empty:{configurable:!0},name:{configurable:!0}};He.prototype.emit=function(t,e,r,i,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");for(var h=this.name,u=this.items,l=0,c=u.length;l<c;l++)u[l][h](t,e,r,i,n,o,s,a);return this},He.prototype.add=function(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this},He.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&this.items.splice(e,1),this},He.prototype.contains=function(t){return-1!==this.items.indexOf(t)},He.prototype.removeAll=function(){return this.items.length=0,this},He.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Ye.empty.get=function(){return 0===this.items.length},Ye.name.get=function(){return this._name},Object.defineProperties(He.prototype,Ye),He.prototype.dispatch=He.prototype.emit,He.prototype.run=He.prototype.emit,m.TARGET_FPMS=.06;var ze={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50},Ve=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.fn=t,this.context=e,this.priority=r,this.once=i,this.next=null,this.previous=null,this._destroyed=!1};Ve.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},Ve.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},Ve.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},Ve.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};var We=function(){var t=this;this._head=new Ve(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/m.TARGET_FPMS,this.elapsedMS=1/m.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,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)))}},qe={FPS:{configurable:!0},minFPS:{configurable:!0},maxFPS:{configurable:!0}},Ze={shared:{configurable:!0},system:{configurable:!0}};We.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},We.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},We.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},We.prototype.add=function(t,e,r){return void 0===r&&(r=ze.NORMAL),this._addListener(new Ve(t,e,r))},We.prototype.addOnce=function(t,e,r){return void 0===r&&(r=ze.NORMAL),this._addListener(new Ve(t,e,r,!0))},We.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},We.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},We.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},We.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},We.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}},We.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&&e+1<this._minElapsedMS)return;this.deltaMS=e,this.deltaTime=this.deltaMS*m.TARGET_FPMS;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},qe.FPS.get=function(){return 1e3/this.elapsedMS},qe.minFPS.get=function(){return 1e3/this._maxElapsedMS},qe.minFPS.set=function(t){var e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,m.TARGET_FPMS);this._maxElapsedMS=1/r},qe.maxFPS.get=function(){return this._minElapsedMS?1e3/this._minElapsedMS:1e3*m.TARGET_FPMS},qe.maxFPS.set=function(t){if(t/1e3>=m.TARGET_FPMS)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t),r=Math.min(Math.max(1,e)/1e3,m.TARGET_FPMS);this._minElapsedMS=1/r}},Ze.shared.get=function(){if(!We._shared){var t=We._shared=new We;t.autoStart=!0,t._protected=!0}return We._shared},Ze.system.get=function(){if(!We._system){var t=We._system=new We;t.autoStart=!0,t._protected=!0}return We._system},Object.defineProperties(We.prototype,qe),Object.defineProperties(We,Ze);var Ke=function(){};Ke.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,ze.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?We.shared:new We,t.autoStart&&this.start()},Ke.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}};var Je=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new He("setRealSize",2),this.onUpdate=new He("update")},Qe={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};Je.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},Je.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t)},Je.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qe.valid.get=function(){return!!this._width&&!!this._height},Je.prototype.update=function(){this.destroyed||this.onUpdate.run()},Je.prototype.load=function(){return Promise.resolve()},Qe.width.get=function(){return this._width},Qe.height.get=function(){return this._height},Je.prototype.upload=function(t,e,r){return!1},Je.prototype.style=function(t,e,r){return!1},Je.prototype.dispose=function(){},Je.prototype.destroy=function(){this.destroyed||(this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null,this.destroyed=!0,this.dispose())},Object.defineProperties(Je.prototype,Qe);var $e=function(t){function e(e){var r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;t.call(this,r,i),this.source=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=oe(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},e.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;return i=i||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),e.target===n.TEXTURE_2D&&r.width===o&&r.height===s?n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,i):(r.width=o,r.height=s,n.texImage2D(e.target,0,e.format,e.format,e.type,i)),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,r=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,r),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(Je),tr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLImageElement)){var i=new Image;t.crossOrigin(i,e,r.crossorigin),i.src=e,e=i}t.call(this,e),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==r.createBitmap?r.createBitmap:m.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.premultiplyAlpha=!1!==r.premultiplyAlpha,this.bitmap=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(t){var e=this;return void 0!==t&&(this.createBitmap=t),this._load?this._load:(this._load=new Promise(function(t){e.url=e.source.src;var r=e.source,i=function(){e.destroyed||(r.onload=null,r.onerror=null,e.resize(r.width,r.height),e._load=null,e.createBitmap?t(e.process()):t(e))};r.complete&&r.src?i():r.onload=i}),this._load)},e.prototype.process=function(){var t=this;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(this.source,0,0,this.source.width,this.source.height,{premultiplyAlpha:this.premultiplyAlpha?"premultiply":"none"}).then(function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))}),this._process):Promise.resolve(this)},e.prototype.upload=function(e,r,i){if(r.premultiplyAlpha=this.premultiplyAlpha,!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0;for(var o in r._glTextures){var s=r._glTextures[o];if(s!==i&&s.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}($e),er=[];function rr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=er.length-1;n>=0;--n){var o=er[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;if(i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height)i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data);else{r.width=e.width,r.height=e.height;var n=e.format;2===t.context.webGLVersion&&e.type===t.gl.FLOAT&&e.format===t.gl.RGBA&&(n=t.gl.RGBA32F),i.texImage2D(e.target,0,n,e.width,e.height,0,e.format,e.type,this.data)}return!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(Je),nr={scaleMode:wt.NEAREST,format:bt.RGBA,premultiplyAlpha:!1},or=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null),t.call(this);var i=(r=r||{}).premultiplyAlpha,n=r.mipmap,o=r.scaleMode,s=r.width,a=r.height,h=r.wrapMode,u=r.format,l=r.type,c=r.target,d=r.resolution,p=r.resourceOptions;!e||e instanceof Je||((e=rr(e,p)).internal=!0),this.width=s||0,this.height=a||0,this.resolution=d||m.RESOLUTION,this.mipmap=void 0!==n?n:m.MIPMAP_TEXTURES,this.wrapMode=h||m.WRAP_MODE,this.scaleMode=void 0!==o?o:m.SCALE_MODE,this.format=u||bt.RGBA,this.type=l||Et.UNSIGNED_BYTE,this.target=c||Tt.TEXTURE_2D,this.premultiplyAlpha=!1!==i,this.uid=zt(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=s>0&&a>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={realWidth:{configurable:!0},realHeight:{configurable:!0}};return r.realWidth.get=function(){return this.width*this.resolution},r.realHeight.get=function(){return this.height*this.resolution},e.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},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=qt(this.realWidth)&&qt(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},e.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},e.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))},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Qt[this.cacheId],delete Jt[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.from=function(t,r){var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),i=t._pixiId);var n=Qt[i];return n||((n=new e(t,r)).cacheId=i,e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){t=t||new Float32Array(r*i*4);var o=new ir(t,{width:r,height:i}),s=t instanceof Float32Array?Et.FLOAT:Et.UNSIGNED_BYTE;return new e(o,Object.assign(nr,n||{width:r,height:i,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Qt[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Qt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Qt[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Qt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)delete Qt[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},Object.defineProperties(e.prototype,r),e}(y);or._globalBatch=0;var sr=function(t){function e(e,r){var i;r=r||{};var n=e;Array.isArray(e)&&(i=e,n=e.length),t.call(this,r.width,r.height),this.items=[],this.itemDirtyIds=[];for(var o=0;o<n;o++){var s=new or;this.items.push(s),this.itemDirtyIds.push(-1)}if(this.length=n,this._load=null,i)for(var a=0;a<n;a++)this.addResourceAt(rr(i[a],r),a)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=Tt.TEXTURE_2D_ARRAY;for(var r=0;r<this.length;r++)this.items[r].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map(function(t){return t.resource}),r=e.map(function(t){return t.load()});return this._load=Promise.all(r).then(function(){var r=e[0],i=r.width,n=r.height;return t.resize(i,n),Promise.resolve(t)}),this._load},e.prototype.upload=function(t,e,r){var i=this.length,n=this.itemDirtyIds,o=this.items,s=t.gl;r.dirtyId<0&&s.texImage3D(s.TEXTURE_2D_ARRAY,0,e.format,this._width,this._height,i,0,e.format,e.type,null);for(var a=0;a<i;a++){var h=o[a];n[a]<h.dirtyId&&(n[a]=h.dirtyId,h.valid&&s.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,a,h.resource.width,h.resource.height,1,e.format,e.type,h.resource.source))}return!0},e}(Je),ar=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.test=function(t){return t instanceof HTMLCanvasElement},e}($e),hr=function(t){function e(r,i){if(i=i||{},t.call(this,r,i),this.length!==e.SIDES)throw new Error("Invalid length. Got "+this.length+", expected 6");for(var n=0;n<e.SIDES;n++)this.items[n].target=Tt.TEXTURE_CUBE_MAP_POSITIVE_X+n;!1!==i.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=Tt.TEXTURE_CUBE_MAP},e.prototype.upload=function(t,r,i){for(var n=this.itemDirtyIds,o=0;o<e.SIDES;o++){var s=this.items[o];n[o]<s.dirtyId&&(n[o]=s.dirtyId,s.valid&&s.resource.upload(t,s,i))}return!0},e}(sr);hr.SIDES=6;var ur=function(t){function e(e,r){r=r||{},t.call(this,document.createElement("canvas")),this.svg=e,this.scale=r.scale||1,this._resolve=null,this._load=null,!1!==r.autoLoad&&this.load()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;return this._load?this._load:(this._load=new Promise(function(e){t._resolve=function(){t.resize(t.source.width,t.source.height),e(t)},/^\<svg/.test(t.svg.trim())&&(t.svg="data:image/svg+xml;utf8,"+t.svg);var r=ne(t.svg);r?t._loadDataUri(r):t._loadXhr()}),this._load)},e.prototype._loadDataUri=function(t){var e;if("base64"===t.encoding){if(!atob)throw new Error("Your browser doesn't support base64 conversions.");e=atob(t.data)}else e=t.data;this._loadString(e)},e.prototype._loadXhr=function(){var t=this,e=new XMLHttpRequest;e.onload=function(){if(e.readyState!==e.DONE||200!==e.status)throw new Error("Failed to load SVG using XHR.");t._loadString(e.response)},e.open("GET",this.svg,!0),e.send()},e.prototype._loadString=function(t){var r=this,i=e.getSize(t),n=new Image;n.src="data:image/svg+xml,"+t,n.onerror=function(){throw new Error("Unable to load image from: "+n.src)},n.onload=function(){var t=i.width,e=i.height;if(!t||!e)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var o=Math.round(t*r.scale),s=Math.round(e*r.scale),a=r.source;a.width=o,a.height=s,a._pixiId="canvas_"+zt(),a.getContext("2d").drawImage(n,0,0,t,e,0,0,o,s),r._resolve(),r._resolve=null}},e.getSize=function(t){var r=e.SVG_SIZE.exec(t),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null},e.test=function(t,e){return"svg"===e||"string"==typeof t&&0===t.indexOf("data:image/svg+xml")},e}($e);ur.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var lr=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n<e.length;++n){var o=document.createElement("source"),s=e[n],a=s.src,h=s.mime,u=(a=a||e[n]).split("?").shift().toLowerCase(),l=u.substr(u.lastIndexOf(".")+1);h=h||"video/"+l,o.src=a,o.type=h,i.appendChild(o)}e=i}t.call(this,e),this._autoUpdate=!0,this._isAutoUpdating=!1,this._updateFPS=r.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==r.autoPlay,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),!1!==r.autoLoad&&this.load()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={autoUpdate:{configurable:!0},updateFPS:{configurable:!0}};return e.prototype.update=function(e){if(void 0===e&&(e=0),!this.destroyed){var r=We.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this,e),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay)),this._load=new Promise(function(r){t.valid?r(t):(t._resolve=r,e.load())}),this._load},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(We.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(We.shared.remove(this.update,this),this._isAutoUpdating=!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._isAutoUpdating&&We.shared.remove(this.update,this),this.source&&(this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(We.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(We.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}($e);lr.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],er.push(tr,ar,lr,ur,ir,hr,sr);var cr={INSTALLED:er,autoDetectResource:rr,ArrayResource:sr,BufferResource:ir,CanvasResource:ar,CubeResource:hr,ImageResource:tr,SVGResource:ur,VideoResource:lr,Resource:Je,BaseImageResource:$e},dr=function(t){this.renderer=t,this.renderer.runners.contextChange.add(this)};dr.prototype.contextChange=function(t){},dr.prototype.destroy=function(){this.renderer.runners.contextChange.remove(this),this.renderer=null};var pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ir),fr=function(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||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 He("disposeFramebuffer",2)},vr={colorTexture:{configurable:!0}};vr.colorTexture.get=function(){return this.colorTextures[0]},fr.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new or(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.addDepthTexture=function(t){return this.depthTexture=t||new or(new pr(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:bt.DEPTH_COMPONENT,type:Et.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},fr.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var i=this.colorTextures[r],n=i.resolution;i.setSize(t/n,e/n)}if(this.depthTexture){var o=this.depthTexture.resolution;this.depthTexture.setSize(t/o,e/o)}}},fr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Object.defineProperties(fr.prototype,vr);var gr=function(t){function e(e){"number"==typeof e&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]});t.call(this,null,e);var r=e||{},i=r.width,n=r.height;this.mipmap=!1,this.width=Math.ceil(i)||100,this.height=Math.ceil(n)||100,this.valid=!0,this._canvasRenderTarget=null,this.clearColor=[0,0,0,0],this.framebuffer=new fr(this.width*this.resolution,this.height*this.resolution).addColorTexture(0,this).enableStencil(),this.stencilMaskStack=[],this.filterStack=[{}]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),this.framebuffer.resize(t*this.resolution,e*this.resolution)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this,!0),this.framebuffer=null,this.renderer=null},e}(or),mr=function(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)};mr.prototype.set=function(t,e,r){var i=e.width,n=e.height;if(r){var o=t.width/2/i,s=t.height/2/n,a=t.x/i+o,h=t.y/n+s;r=Pe.add(r,Pe.NW),this.x0=a+o*Pe.uX(r),this.y0=h+s*Pe.uY(r),r=Pe.add(r,2),this.x1=a+o*Pe.uX(r),this.y1=h+s*Pe.uY(r),r=Pe.add(r,2),this.x2=a+o*Pe.uX(r),this.y2=h+s*Pe.uY(r),r=Pe.add(r,2),this.x3=a+o*Pe.uX(r),this.y3=h+s*Pe.uY(r)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3};var yr=new mr,_r=function(t){function e(r,i,n,o,s,a){if(t.call(this),this.noFrame=!1,i||(this.noFrame=!0,i=new Oe(0,0,1,1)),r instanceof e&&(r=r.baseTexture),this.baseTexture=r,this._frame=i,this.trim=o,this.valid=!1,this.requiresUpdate=!1,this._uvs=yr,this.uvMatrix=null,this.orig=n||i,this._rotate=Number(s||0),!0===s)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=a?new le(a.x,a.y):new le(0,0),this._updateID=0,this.textureCacheIds=[],r.valid?this.noFrame?r.valid&&this.onBaseTextureUpdated(r):this.frame=i:r.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&r.on("update",this.onBaseTextureUpdated,this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={frame:{configurable:!0},rotate:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var r=this.baseTexture.resource;r&&Jt[r.url]&&e.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){return new e(this.baseTexture,this.frame,this.orig,this.trim,this.rotate,this.defaultAnchor)},e.prototype.updateUvs=function(){this._uvs===yr&&(this._uvs=new mr),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,r){void 0===r&&(r={});var i=null;"string"==typeof t?i=t:(t._pixiId||(t._pixiId="pixiid_"+zt()),i=t._pixiId);var n=Jt[i];return n||(r.resolution||(r.resolution=se(t)),(n=new e(new or(t,r))).baseTexture.cacheId=i,or.addToCache(n.baseTexture,i),e.addToCache(n,i)),n},e.fromBuffer=function(t,r,i,n){return new e(or.fromBuffer(t,r,i,n))},e.fromLoader=function(t,r,i){var n=new tr(t);n.url=r;var o=new e(new or(n,{scaleMode:m.SCALE_MODE,resolution:se(r)}));return i||(i=r),or.addToCache(o.baseTexture,i),e.addToCache(o,i),i!==r&&(or.addToCache(o.baseTexture,r),e.addToCache(o,r)),o},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Jt[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),Jt[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=Jt[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Jt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)Jt[t.textureCacheIds[i]]===t&&delete Jt[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},r.frame.get=function(){return this._frame},r.frame.set=function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,i=t.width,n=t.height,o=e+i>this.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()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,r),e}(y);function xr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}_r.EMPTY=new _r(new or),xr(_r.EMPTY),xr(_r.EMPTY.baseTexture),_r.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new _r(new or(new ar(t)))}(),xr(_r.WHITE),xr(_r.WHITE.baseTexture);var br=function(t){function e(e,r){var i=null;if(!(e instanceof gr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new gr({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),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){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new gr(t))},e}(_r),Tr=function(t,e,r,i,n,o,s){void 0===r&&(r=!1),void 0===i&&(i=5126),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s};Tr.prototype.destroy=function(){this.buffer=null},Tr.from=function(t,e,r,i,n){return new Tr(t,e,r,i,n)};var Er=0,wr=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Er++,this.disposeRunner=new He("disposeBuffer",2)};function Sr(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}wr.prototype.update=function(t){this.data=t||this.data,this._updateID++},wr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},wr.prototype.destroy=function(){this.dispose(),this.data=null},wr.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new wr(t)};var Pr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ir={5126:4,5123:2,5121:1},Ar=0,Or={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Cr=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ar++,this.instanced=!1,this.instanceCount=1,this._size=null,this.disposeRunner=new He("disposeGeometry",2),this.refCount=0};Cr.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e.data||(e instanceof Array&&(e=new Float32Array(e)),e=new wr(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,r,i,n);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new Tr(l,r,i,n,o,s,a),this.instanced=this.instanced||a,this},Cr.prototype.getAttribute=function(t){return this.attributes[t]},Cr.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},Cr.prototype.addIndex=function(t){return t.data||(t instanceof Array&&(t=new Uint16Array(t)),t=new wr(t)),t.index=!0,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},Cr.prototype.getIndex=function(){return this.indexBuffer},Cr.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],r=[],i=new wr;for(t in this.attributes){var n=this.attributes[t],o=this.buffers[n.buffer];e.push(o.data),r.push(n.size*Ir[n.type]/4),n.buffer=0}for(i.data=function(t,e){for(var r=0,i=0,n={},o=0;o<t.length;o++)i+=e[o],r+=t[o].length;for(var s=new ArrayBuffer(4*r),a=null,h=0,u=0;u<t.length;u++){var l=e[u],c=t[u],d=Sr(c);n[d]||(n[d]=new Pr[d](s)),a=n[d];for(var p=0;p<c.length;p++)a[(p/l|0)*i+h+p%l]=c[p];h+=l}return new Float32Array(s)}(e,r),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},Cr.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},Cr.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Cr.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer.destroy(),this.attributes=null},Cr.prototype.clone=function(){for(var t=new Cr,e=0;e<this.buffers.length;e++)t.buffers[e]=new wr(this.buffers[e].data.slice());for(var r in this.attributes){var i=this.attributes[r];t.attributes[r]=new Tr(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.index=!0),t},Cr.merge=function(t){for(var e,r=new Cr,i=[],n=[],o=[],s=0;s<t.length;s++){e=t[s];for(var a=0;a<e.buffers.length;a++)n[a]=n[a]||0,n[a]+=e.buffers[a].data.length,o[a]=0}for(var h=0;h<e.buffers.length;h++)i[h]=new(Or[Sr(e.buffers[h].data)])(n[h]),r.buffers[h]=new wr(i[h]);for(var u=0;u<t.length;u++){e=t[u];for(var l=0;l<e.buffers.length;l++)i[l].set(e.buffers[l].data,o[l]),o[l]+=e.buffers[l].data.length}if(r.attributes=e.attributes,e.indexBuffer){r.indexBuffer=r.buffers[e.buffers.indexOf(e.indexBuffer)],r.indexBuffer.index=!0;for(var c=0,d=0,p=0,f=0,v=0;v<e.buffers.length;v++)if(e.buffers[v]!==e.indexBuffer){f=v;break}for(var g in e.attributes){var m=e.attributes[g];(0|m.buffer)===f&&(d+=m.size*Ir[m.type]/4)}for(var y=0;y<t.length;y++){for(var _=t[y].indexBuffer.data,x=0;x<_.length;x++)r.indexBuffer.data[x+p]+=c;c+=e.buffers[f].data.length/d,p+=_.length}}return r};var Mr=function(t){function e(){t.call(this),this.addAttribute("aVertexPosition",[0,0,1,0,1,1,0,1]).addIndex([0,1,3,2])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Dr=function(t){function e(){t.call(this),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new wr(this.vertices),this.uvBuffer=new wr(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(Cr),Rr=0,Fr=function(t,e){this.uniforms=t,this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Rr++,this.static=!!e};Fr.prototype.update=function(){this.dirtyId++},Fr.prototype.add=function(t,e,r){this.uniforms[t]=new Fr(e,r)},Fr.from=function(t,e){return new Fr(t,e)};var Lr=function(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.sourceFrame=new Oe,this.destinationFrame=new Oe,this.filters=[]};Lr.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null};var Nr=function(t){function e(e){t.call(this,e),this.defaultFilterStack=[{}],this.texturePool={},this.statePool=[],this.quad=new Mr,this.quadUv=new Dr,this.tempRect=new Oe,this.activeState={},this.globalUniforms=new Fr({outputFrame:this.tempRect,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this._pixelsWidth=e.view.width,this._pixelsHeight=e.view.height}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e){for(var r=this.renderer,i=this.defaultFilterStack,n=this.statePool.pop()||new Lr,o=e[0].resolution,s=e[0].padding,a=e[0].autoFit,h=e[0].legacy,u=1;u<e.length;u++){var l=e[u];o=Math.min(o,l.resolution),s=Math.max(s,l.padding),a=a||l.autoFit,h=h||l.legacy}1===i.length&&(this.defaultFilterStack[0].renderTexture=r.renderTexture.current),i.push(n),n.resolution=o,n.legacy=h,n.target=t,n.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),n.sourceFrame.pad(s),a&&n.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),n.sourceFrame.ceil(o),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,o),n.filters=e,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height,n.renderTexture.filterFrame=n.sourceFrame,r.renderTexture.bind(n.renderTexture,n.sourceFrame),r.renderTexture.clear()},e.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;var i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;var n=i.inputSize,o=i.inputPixel,s=i.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=n[0]*e.resolution,o[1]=n[1]*e.resolution,o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*n[2]-.5*o[2],s[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){var a=i.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(1===r.length)r[0].apply(this,e.renderTexture,h.renderTexture,!1,e),this.returnFilterTexture(e.renderTexture);else{var u=e.renderTexture,l=this.getOptimalFilterTexture(u.width,u.height,e.resolution);l.filterFrame=u.filterFrame;var c=0;for(c=0;c<r.length-1;++c){r[c].apply(this,u,l,!0,e);var d=u;u=l,l=d}r[c].apply(this,u,h.renderTexture,!1,e),this.returnFilterTexture(u),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)},e.prototype.applyFilter=function(t,e,r,i){var n=this.renderer;n.renderTexture.bind(r,r?r.filterFrame:null),i&&n.renderTexture.clear(),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.state.setState(t.state),n.shader.bind(t),t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(xt.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(xt.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(me.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(t){void 0===t&&(t=!1),t?this.texturePool={}:this.emptyPool()},e.prototype.getOptimalFilterTexture=function(t,e,r){void 0===r&&(r=1);var i="screen";e*=r,(t*=r)===this._pixelsWidth&&e===this._pixelsHeight||(i=(65535&(t=Wt(t)))<<16|65535&(e=Wt(e))),this.texturePool[i]||(this.texturePool[i]=[]);var n=this.texturePool[i].pop();return n||(n=br.create({width:t/r,height:e/r,resolution:r})),n.filterPoolKey=i,n.setResolution(r),n},e.prototype.getFilterTexture=function(t){var e=this.activeState.renderTexture,r=this.getOptimalFilterTexture(e.width,e.height,t||e.baseTexture.resolution);return r.filterFrame=e.filterFrame,r},e.prototype.returnFilterTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},e.prototype.emptyPool=function(){for(var t in this.texturePool){var e=this.texturePool[t];if(e)for(var r=0;r<e.length;r++)e[r].destroy(!0)}this.texturePool={}},e.prototype.resize=function(){var t=this.texturePool.screen;if(t)for(var e=0;e<t.length;e++)t[e].destroy(!0);this.texturePool.screen=[],this._pixelsWidth=this.renderer.view.width,this._pixelsHeight=this.renderer.view.height},e}(dr),Ur=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.flush=function(){},e.prototype.render=function(t){},e}(dr),Br=function(t){function e(e){t.call(this,e),this.emptyRenderer=new Ur(e),this.currentRenderer=this.emptyRenderer}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e}(dr);m.PREFER_ENV=g.any?mt.WEBGL:mt.WEBGL2;var kr=0,Xr=function(t){function e(e){t.call(this,e),this.webGLVersion=1,this.extensions={},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isLost:{configurable:!0}};return r.isLost.get=function(){return!this.gl||this.gl.isContextLost()},e.prototype.contextChange=function(t){this.gl=t,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},e.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=kr++,this.renderer.runners.contextChange.run(t)},e.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},e.prototype.createContext=function(t,e){var r;if(m.PREFER_ENV>=mt.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),r},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion&&Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),floatTexture:t.getExtension("OES_texture_float"),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")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;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.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,r),e}(dr),jr=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new fr(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Oe,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n<t.colorTextures.length;n++)t.colorTextures[n].texturePart?this.renderer.texture.unbind(t.colorTextures[n].texture):this.renderer.texture.unbind(t.colorTextures[n]);t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,t.width,t.height)}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,r,i){var n=this.viewport;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))},r.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}},e.prototype.clear=function(t,e,r,i){var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},e.prototype.initFramebuffer=function(t){var e={framebuffer:this.gl.createFramebuffer(),stencil:null,dirtyId:0,dirtyFormat:0,dirtySize:0};return t.glFramebuffers[this.CONTEXT_UID]=e,this.managedFramebuffers.push(t),t.disposeRunner.add(this),e},e.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));for(var i=t.colorTextures,n=0;n<i.length;n++)this.renderer.texture.bind(i[n],0);t.depthTexture&&this.renderer.texture.bind(t.depthTexture,0)},e.prototype.updateFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID],i=t.colorTextures.length;e.drawBuffers||(i=Math.min(i,1));for(var n=[],o=0;o<i;o++){var s=t.colorTextures[o];s.texturePart?(this.renderer.texture.bind(s.texture,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,e.TEXTURE_CUBE_MAP_NEGATIVE_X+s.side,s.texture._glTextures[this.CONTEXT_UID].texture,0)):(this.renderer.texture.bind(s,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,e.TEXTURE_2D,s._glTextures[this.CONTEXT_UID].texture,0)),n.push(e.COLOR_ATTACHMENT0+o)}if((n.length>1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<e.count;r++)this.disposeFramebuffer(e[r],t)},e.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new Oe},Object.defineProperties(e.prototype,r),e}(dr),Gr=function(t){this.buffer=t,this.updateID=-1,this.byteLength=-1,this.refCount=0},Hr={5126:4,5123:2,5121:1},Yr=function(t){function e(e){t.call(this,e),this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.boundBuffers={},this.managedGeometries={},this.managedBuffers={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,!t.createVertexArray){var e=this.renderer.context.extensions.vertexArrayObject;m.PREFER_ENV===mt.WEBGL_LEGACY&&(e=null),e?(t.createVertexArray=function(){return e.createVertexArrayOES()},t.bindVertexArray=function(t){return e.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return e.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){},t.bindVertexArray=function(){},t.deleteVertexArray=function(){})}if(!t.vertexAttribDivisor){var r=t.getExtension("ANGLE_instanced_arrays");r?(t.vertexAttribDivisor=function(t,e){return r.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,i,n,o){return r.drawElementsInstancedANGLE(t,e,i,n,o)},t.drawArraysInstanced=function(t,e,i,n){return r.drawArraysInstancedANGLE(t,e,i,n)}):this.hasInstance=!1}},e.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var r=this.gl,i=t.glVertexArrayObjects[this.CONTEXT_UID];i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={});var n=i[e.program.id]||this.initGeometryVao(t,e.program);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()},e.prototype.reset=function(){this.unbind()},e.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.gl,r=0;r<t.buffers.length;r++){var i=t.buffers[r],n=i._glBuffers[this.CONTEXT_UID];if(i._updateID!==n.updateID){n.updateID=i._updateID;var o=i.index?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;if(e.bindBuffer(o,n.buffer),this._boundBuffer=n,n.byteLength>=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*Hr[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Hr[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Hr[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var g=0;g<a.length;g++){var m=a[g];m._glBuffers[i]||(m._glBuffers[i]=new Gr(r.createBuffer()),this.managedBuffers[m.id]=m,m.disposeRunner.add(this)),m._glBuffers[i].refCount++}return this.activateVao(t,e),this._activeVao=s,o[e.id]=s,o[n]=s,s},e.prototype.disposeBuffer=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])}},e.prototype.disposeGeometry=function(t,e){if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var r=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,n=t.buffers;if(t.disposeRunner.remove(this),r){for(var o=0;o<n.length;o++){var s=n[o]._glBuffers[this.CONTEXT_UID];s.refCount--,0!==s.refCount||e||this.disposeBuffer(n[o],e)}if(!e)for(var a in r)if("g"===a[0]){var h=r[a];this._activeVao===h&&this.unbind(),i.deleteVertexArray(h)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},e.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t);e=Object.keys(this.managedBuffers);for(var i=0;i<e.length;i++)this.disposeBuffer(this.managedBuffers[e[i]],t)},e.prototype.activateVao=function(t,e){var r=this.gl,i=this.CONTEXT_UID,n=t.buffers,o=t.attributes;t.indexBuffer&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.indexBuffer._glBuffers[i].buffer);var s=null;for(var a in o){var h=o[a],u=n[h.buffer]._glBuffers[i];if(e.attributeData[a]){s!==u&&(r.bindBuffer(r.ARRAY_BUFFER,u.buffer),s=u);var l=e.attributeData[a].location;if(r.enableVertexAttribArray(l),r.vertexAttribPointer(l,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(l,1)}}}},e.prototype.draw=function(t,e,r,i){var n=this.gl,o=this._activeGeometry;return o.indexBuffer?o.instanced?n.drawElementsInstanced(t,e||o.indexBuffer.data.length,n.UNSIGNED_SHORT,2*(r||0),i||1):n.drawElements(t,e||o.indexBuffer.data.length,n.UNSIGNED_SHORT,2*(r||0)):o.instanced?n.drawArraysInstanced(t,r,e||o.getSize(),i||1):n.drawArrays(t,r,e||o.getSize()),this},e.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},e}(dr);function zr(t,e,r,i){var n=Vr(t,t.VERTEX_SHADER,e),o=Vr(t,t.FRAGMENT_SHADER,r),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,o),i)for(var a in i)t.bindAttribLocation(s,i[a],a);return t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(s,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(s)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(s)),t.deleteProgram(s),s=null),t.deleteShader(n),t.deleteShader(o),s}function Vr(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:(console.warn(r),console.error(t.getShaderInfoLog(i)),null)}function Wr(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"bool":return!1;case"bvec2":return qr(2*e);case"bvec3":return qr(3*e);case"bvec4":return qr(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}function qr(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e}var Zr,Kr=null;function Jr(){if(!Kr){var t,e=document.createElement("canvas");if(m.PREFER_ENV>=mt.WEBGL2&&(t=e.getContext("webgl2",{})),!t){if(!(t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{})))throw new Error("This browser does not support WebGL. Try using the canvas renderer");t.getExtension("WEBGL_draw_buffers")}return Kr=t,t}return Kr}function Qr(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===At.HIGH&&r!==At.HIGH&&(i=At.MEDIUM),"precision "+i+" float;\n"+t}return r!==At.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var $r={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ti(t){return $r[t]}var ei=null,ri={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function ii(t,e){if(!ei){var r=Object.keys(ri);ei={};for(var i=0;i<r.length;++i){var n=r[i];ei[t[n]]=ri[n]}}return ei[e]}var ni={float:"\n    if(cv !== v)\n    {\n        cv.v = v;\n        gl.uniform1f(location, v)\n    }",vec2:"\n    if(cv[0] !== v[0] || cv[1] !== v[1])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        gl.uniform2f(location, v[0], v[1])\n    }",vec3:"\n    if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n    {\n        cv[0] = v[0];\n        cv[1] = v[1];\n        cv[2] = v[2];\n\n        gl.uniform3f(location, v[0], v[1], v[2])\n    }",vec4:"gl.uniform4f(location, v[0], v[1], v[2], v[3])",int:"gl.uniform1i(location, v)",ivec2:"gl.uniform2i(location, v[0], v[1])",ivec3:"gl.uniform3i(location, v[0], v[1], v[2])",ivec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",bool:"gl.uniform1i(location, v)",bvec2:"gl.uniform2i(location, v[0], v[1])",bvec3:"gl.uniform3i(location, v[0], v[1], v[2])",bvec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},oi={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var si,ai=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function hi(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var i=ai.replace(/%forloop%/gi,ui(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}function ui(t){for(var e="",r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var li=0,ci={},di=function t(e,r,i){void 0===i&&(i="pixi-shader"),this.id=li++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),ci[i]?(ci[i]++,i+="-"+ci[i]):ci[i]=1,this.vertexSrc="#define SHADER_NAME "+i+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+"\n"+this.fragmentSrc,this.vertexSrc=Qr(this.vertexSrc,m.PRECISION_VERTEX,At.HIGH),this.fragmentSrc=Qr(this.fragmentSrc,m.PRECISION_FRAGMENT,function(){if(!Zr){Zr=At.MEDIUM;var t=Jr();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);Zr=e.precision?At.HIGH:At.MEDIUM}}return Zr}())),this.extractData(this.vertexSrc,this.fragmentSrc),this.glPrograms={},this.syncUniforms=null},pi={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};di.prototype.extractData=function(t,e){var r=Jr();if(r){var i=zr(r,t,e);this.attributeData=this.getAttributeData(i,r),this.uniformData=this.getUniformData(i,r),r.deleteProgram(i)}else this.uniformData={},this.attributeData={}},di.prototype.getAttributeData=function(t,e){for(var r={},i=[],n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;o<n;o++){var s=e.getActiveAttrib(t,o),a=ii(e,s.type),h={type:a,name:s.name,size:ti(a),location:0};r[s.name]=h,i.push(h)}i.sort(function(t,e){return t.name>e.name?1:-1});for(var u=0;u<i.length;u++)i[u].location=u;return r},di.prototype.getUniformData=function(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=e.getActiveUniform(t,n),s=o.name.replace(/\[.*?\]/,""),a=o.name.match(/\[.*?\]/,""),h=ii(e,o.type);r[s]={type:h,size:o.size,isArray:a,value:Wr(h,o.size)}}return r},pi.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void){\r\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n   vTextureCoord = aTextureCoord;\r\n}\r\n"},pi.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\r\n\r\nuniform sampler2D uSampler;\r\n\r\nvoid main(void){\r\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\r\n}"},di.from=function(t,e,r){var i=t+e,n=Kt[i];return n||(Kt[i]=n=new di(t,e,r)),n},Object.defineProperties(di,pi);var fi=function(t,e){for(var r in this.program=t,this.uniformGroup=e?e instanceof Fr?e:new Fr(e):new Fr({}),t.uniformData)this.uniformGroup.uniforms[r]instanceof Array&&(this.uniformGroup.uniforms[r]=new Float32Array(this.uniformGroup.uniforms[r]))},vi={uniforms:{configurable:!0}};fi.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var i=e.uniforms[r];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},fi.prototype.destroy=function(){this.uniformGroup=null},vi.uniforms.get=function(){return this.uniformGroup.uniforms},fi.from=function(t,e,r){var i=di.from(t,e);return new fi(i,r)},Object.defineProperties(fi.prototype,vi);var gi=function(){this.data=0,this.blendMode=_t.NORMAL,this.polygonOffset=0,this.blend=!0},mi={blend:{configurable:!0},offsets:{configurable:!0},culling:{configurable:!0},depthTest:{configurable:!0},clockwiseFrontFace:{configurable:!0},blendMode:{configurable:!0},polygonOffset:{configurable:!0}};mi.blend.get=function(){return!!(1&this.data)},mi.blend.set=function(t){!!(1&this.data)!==t&&(this.data^=1)},mi.offsets.get=function(){return!!(2&this.data)},mi.offsets.set=function(t){!!(2&this.data)!==t&&(this.data^=2)},mi.culling.get=function(){return!!(4&this.data)},mi.culling.set=function(t){!!(4&this.data)!==t&&(this.data^=4)},mi.depthTest.get=function(){return!!(8&this.data)},mi.depthTest.set=function(t){!!(8&this.data)!==t&&(this.data^=8)},mi.clockwiseFrontFace.get=function(){return!!(16&this.data)},mi.clockwiseFrontFace.set=function(t){!!(16&this.data)!==t&&(this.data^=16)},mi.blendMode.get=function(){return this._blendMode},mi.blendMode.set=function(t){this.blend=t!==_t.NONE,this._blendMode=t},mi.polygonOffset.get=function(){return this._polygonOffset},mi.polygonOffset.set=function(t){this.offsets=!!t,this._polygonOffset=t},gi.for2d=function(){var t=new gi;return t.depthTest=!1,t.blend=!0,t},Object.defineProperties(gi.prototype,mi);var yi=function(t){function e(r,i,n){var o=di.from(r||e.defaultVertexSrc,i||e.defaultFragmentSrc);t.call(this,o,n),this.padding=0,this.resolution=m.FILTER_RESOLUTION,this.enabled=!0,this.autoFit=!0,this.legacy=!!this.program.attributeData.aTextureCoord,this.state=new gi}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blendMode:{configurable:!0}},i={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};return e.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i,n)},r.blendMode.get=function(){return this.state.blendMode},r.blendMode.set=function(t){this.state.blendMode=t},i.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\r\n\r\nuniform mat3 projectionMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nuniform vec4 inputSize;\r\nuniform vec4 outputFrame;\r\n\r\nvec4 filterVertexPosition( void )\r\n{\r\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\r\n\r\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\r\n}\r\n\r\nvec2 filterTextureCoord( void )\r\n{\r\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\r\n}\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = filterVertexPosition();\r\n    vTextureCoord = filterTextureCoord();\r\n}\r\n"},i.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\r\n\r\nuniform sampler2D uSampler;\r\n\r\nvoid main(void){\r\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\r\n}\r\n"},Object.defineProperties(e.prototype,r),Object.defineProperties(e,i),e}(fi);yi.SOURCE_KEY_MAP={};var _i="attribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 otherMatrix;\r\n\r\nvarying vec2 vMaskCoord;\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = aTextureCoord;\r\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\r\n}\r\n",xi="varying vec2 vMaskCoord;\r\nvarying vec2 vTextureCoord;\r\n\r\nuniform sampler2D uSampler;\r\nuniform sampler2D mask;\r\nuniform float alpha;\r\nuniform float npmAlpha;\r\nuniform vec4 maskClamp;\r\n\r\nvoid main(void)\r\n{\r\n    float clip = step(3.5,\r\n        step(maskClamp.x, vMaskCoord.x) +\r\n        step(maskClamp.y, vMaskCoord.y) +\r\n        step(vMaskCoord.x, maskClamp.z) +\r\n        step(vMaskCoord.y, maskClamp.w));\r\n\r\n    vec4 original = texture2D(uSampler, vTextureCoord);\r\n    vec4 masky = texture2D(mask, vMaskCoord);\r\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\r\n\r\n    original *= (alphaMul * masky.r * alpha * clip);\r\n\r\n    gl_FragColor = original;\r\n}\r\n",bi=new me,Ti=function(t,e){this._texture=t,this.mapCoord=new me,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=-1,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1},Ei={texture:{configurable:!0}};Ei.texture.get=function(){return this._texture},Ei.texture.set=function(t){this._texture=t,this._updateID=-1},Ti.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i<t.length;i+=2){var n=t[i],o=t[i+1];e[i]=n*r.a+o*r.c+r.tx,e[i+1]=n*r.b+o*r.d+r.ty}return e},Ti.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._updateID===e._updateID)return!1;this._updateID=e._updateID;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=e.orig,n=e.trim;n&&(bi.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(bi));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,h=this.clampOffset;return s[0]=(e._frame.x+a+h)/o.width,s[1]=(e._frame.y+a+h)/o.height,s[2]=(e._frame.x+e._frame.width-a+h)/o.width,s[3]=(e._frame.y+e._frame.height-a+h)/o.height,this.uClampOffset[0]=h/o.realWidth,this.uClampOffset[1]=h/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},Object.defineProperties(Ti.prototype,Ei);var wi=function(t){function e(e){var r=new me;t.call(this,_i,xi),e.renderable=!1,this.maskSprite=e,this.maskMatrix=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t,e,r,i){var n=this.maskSprite,o=this.maskSprite.texture;o.valid&&(o.transform||(o.transform=new Ti(o,0)),o.transform.update(),this.uniforms.npmAlpha=o.baseTexture.premultiplyAlpha?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.transform.uClampFrame,t.applyFilter(this,e,r,i))},e}(yi),Si=function(t){function e(e){t.call(this,e),this.scissor=!1,this.scissorData=null,this.scissorRenderTarget=null,this.enableScissor=!1,this.alphaMaskPool=[],this.alphaMaskIndex=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e){if(e.isSprite)this.pushSpriteMask(t,e);else if(this.enableScissor&&!this.scissor&&this.renderer._activeRenderTarget.root&&!this.renderer.stencil.stencilMaskStack.length&&e.isFastRect()){var r=e.worldTransform,i=Math.atan2(r.b,r.a);(i=Math.round(i*(180/Math.PI)))%90?this.pushStencilMask(e):this.pushScissorMask(t,e)}else this.pushStencilMask(e)},e.prototype.pop=function(t,e){e.isSprite?this.popSpriteMask(t,e):this.enableScissor&&!this.renderer.stencil.stencilMaskStack.length?this.popScissorMask(t,e):this.popStencilMask(t,e)},e.prototype.pushSpriteMask=function(t,e){var r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new wi(e)]),r[0].resolution=this.renderer.resolution,r[0].maskSprite=e;var i=t.filterArea;t.filterArea=e.getBounds(!0),this.renderer.filter.push(t,r),t.filterArea=i,this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filter.pop(),this.alphaMaskIndex--},e.prototype.pushStencilMask=function(t){this.renderer.batch.flush(),this.renderer.stencil.pushStencil(t)},e.prototype.popStencilMask=function(){this.renderer.stencil.popStencil()},e.prototype.pushScissorMask=function(t,e){e.renderable=!0;var r=this.renderer._activeRenderTarget,i=e.getBounds();i.fit(r.size),e.renderable=!1,this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);var n=this.renderer.resolution;this.renderer.gl.scissor(i.x*n,(r.root?r.size.height-i.y-i.height:i.y)*n,i.width*n,i.height*n),this.scissorRenderTarget=r,this.scissorData=e,this.scissor=!0},e.prototype.popScissorMask=function(){this.scissorRenderTarget=null,this.scissorData=null,this.scissor=!1;var t=this.renderer.gl;t.disable(t.SCISSOR_TEST)},e}(dr),Pi=function(t){function e(e){t.call(this,e),this.stencilMaskStack=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMaskStack=function(t){var e=this.renderer.gl;t.length!==this.stencilMaskStack.length&&(0===t.length?e.disable(e.STENCIL_TEST):e.enable(e.STENCIL_TEST)),this.stencilMaskStack=t},e.prototype.pushStencil=function(t){var e=this.renderer.gl,r=this.stencilMaskStack.length;0===r&&e.enable(e.STENCIL_TEST),this.stencilMaskStack.push(t),e.colorMask(!1,!1,!1,!1),e.stencilFunc(e.EQUAL,r,this._getBitwiseMask()),e.stencilOp(e.KEEP,e.KEEP,e.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent()},e.prototype.popStencil=function(){var t=this.renderer.gl,e=this.stencilMaskStack.pop();0===this.stencilMaskStack.length?(t.disable(t.STENCIL_TEST),t.clear(t.STENCIL_BUFFER_BIT),t.clearStencil(0)):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.stencilMaskStack.length,this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<<this.stencilMaskStack.length)-1},e.prototype.destroy=function(){t.prototype.destroy.call(this,this),this.stencilMaskStack=null},e}(dr),Ii=function(t){function e(e){t.call(this,e),this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new me,this.transform=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.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)},e.prototype.calculateProjection=function(t,e,r,i){var n=this.projectionMatrix;i?(n.a=1/t.width*2*r,n.d=-1/t.height*2*r,n.tx=-1-e.x*n.a,n.ty=1-e.y*n.d):(n.a=1/t.width*2*r,n.d=1/t.height*2*r,n.tx=-1-e.x*n.a,n.ty=-1-e.y*n.d)},e.prototype.setTransform=function(){},e}(dr),Ai=new Oe,Oi=function(t){function e(e){t.call(this,e),this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Oe,this.destinationFrame=new Oe}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(t,e,r){void 0===t&&(t=null),this.current=t;var i,n=this.renderer;if(t){var o=t.baseTexture;i=o.resolution,r||(Ai.width=o.realWidth,Ai.height=o.realHeight,r=Ai),e||(e=r),this.renderer.framebuffer.bind(o.framebuffer,r),this.renderer.projection.update(r,e,i,!1),this.renderer.stencil.setMaskStack(o.stencilMaskStack)}else i=this.renderer.resolution,r||(Ai.width=n.width,Ai.height=n.height,r=Ai),e||(e=r),n.framebuffer.bind(null,r),this.renderer.projection.update(r,e,i,!0),this.renderer.stencil.setMaskStack(this.defaultMaskStack);this.sourceFrame.copyFrom(e),this.destinationFrame.x=r.x/i,this.destinationFrame.y=r.y/i,this.destinationFrame.width=r.width/i,this.destinationFrame.height=r.height/i,e===r&&this.sourceFrame.copyFrom(this.destinationFrame)},e.prototype.clear=function(t){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor,this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3])},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e}(dr),Ci=function(t,e){this.program=t,this.uniformData=e,this.uniformGroups={}};Ci.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.program=null};var Mi=0,Di=function(t){function e(e){t.call(this,e),this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this.id=Mi++}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof si)return si;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");si=!0===t({a:"b"},"a","b")}catch(t){si=!1}return si}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(t){this.gl=t},e.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateShader(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),e||this.syncUniformGroup(t.uniformGroup),i},e.prototype.setUniforms=function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)},e.prototype.syncUniformGroup=function(t){var e=this.getglProgram();t.static&&t.dirtyId===e.uniformGroups[t.id]||(e.uniformGroups[t.id]=t.dirtyId,this.syncUniforms(t,e))},e.prototype.syncUniforms=function(t,e){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer)},e.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData);return this.cache[e]||(this.cache[e]=function(t,e){var r=0,i="var v = null;\n    var cv = null\n    var gl = renderer.gl";for(var n in t.uniforms){var o=e[n];o?"float"===o.type&&1===o.size?i+="\n            if(uv."+n+" !== ud."+n+".value)\n            {\n                ud."+n+".value = uv."+n+"\n                gl.uniform1f(ud."+n+".location, uv."+n+")\n            }\n":"sampler2D"!==o.type&&"samplerCube"!==o.type&&"sampler2DArray"!==o.type||1!==o.size||o.isArray?"mat3"===o.type&&1===o.size?void 0!==t.uniforms[n].a?i+="\n                gl.uniformMatrix3fv(ud."+n+".location, false, uv."+n+".toArray(true));\n                \n":i+="\n                gl.uniformMatrix3fv(ud."+n+".location, false, uv."+n+");\n                \n":"vec2"===o.type&&1===o.size?void 0!==t.uniforms[n].x?i+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v.x || cv[1] !== v.y)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    gl.uniform2f(ud."+n+".location, v.x, v.y);\n                }\n":i+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v[0] || cv[1] !== v[1])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    gl.uniform2f(ud."+n+".location, v[0], v[1]);\n                }\n                \n":"vec4"===o.type&&1===o.size?void 0!==t.uniforms[n].width?i+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n                {\n                    cv[0] = v.x;\n                    cv[1] = v.y;\n                    cv[2] = v.width;\n                    cv[3] = v.height;\n                    gl.uniform4f(ud."+n+".location, v.x, v.y, v.width, v.height)\n                }\n":i+="\n                cv = ud."+n+".value;\n                v = uv."+n+";\n\n                if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n                {\n                    cv[0] = v[0];\n                    cv[1] = v[1];\n                    cv[2] = v[2];\n                    cv[3] = v[3];\n\n                    gl.uniform4f(ud."+n+".location, v[0], v[1], v[2], v[3])\n                }\n                \n":i+="\n            cv = ud."+n+".value;\n            v = uv."+n+";\n            "+(1===o.size?ni:oi)[o.type].replace("location","ud."+n+".location")+";\n":(i+="\n            renderer.texture.bind(uv."+n+", "+r+");\n\n            if(ud."+n+".value !== "+r+")\n            {\n                ud."+n+".value = "+r+";\n                gl.uniform1i(ud."+n+".location, "+r+");\n; // eslint-disable-line max-len\n            }\n",r++):t.uniforms[n].group&&(i+="\n                    renderer.shader.syncUniformGroup(uv."+n+");\n                ")}return new Function("ud","uv","renderer",i)}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},e.prototype.getSignature=function(t,e){var r=t.uniforms,i=[];for(var n in r)i.push(n),e[n]&&i.push(e[n].type);return i.join("-")},e.prototype.getglProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateShader=function(t){var e=this.gl,r=t.program,i={};for(var n in r.attributeData)i[n]=r.attributeData[n].location;var o=zr(e,r.vertexSrc,r.fragmentSrc,i),s={};for(var a in r.uniformData){var h=r.uniformData[a];s[a]={location:e.getUniformLocation(o,a),value:Wr(h.type,h.size)}}var u=new Ci(o,s);return r.glPrograms[this.renderer.CONTEXT_UID]=u,u},e.prototype.reset=function(){this.program=null,this.shader=null},e.prototype.destroy=function(){this.destroyed=!0},e}(dr);var Ri=0,Fi=1,Li=2,Ni=3,Ui=4,Bi=function(t){function e(e){t.call(this,e),this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=_t.NONE,this._blendEq=!1,this.map=[],this.map[Ri]=this.setBlend,this.map[Fi]=this.setOffset,this.map[Li]=this.setCullFace,this.map[Ni]=this.setDepthTest,this.map[Ui]=this.setFrontFace,this.checks=[],this.defaultState=new gi,this.defaultState.blend=!0,this.defaultState.depth=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[_t.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.ADD]=[t.ONE,t.DST_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.NONE]=[0,0],e[_t.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.ADD_NPM]=[t.SRC_ALPHA,t.DST_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[_t.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[_t.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[_t.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[_t.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[_t.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[_t.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[_t.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[_t.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.setState(this.defaultState),this.reset()},e.prototype.setState=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(var i=0;i<this.checks.length;i++)this.checks[i](this,t)},e.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(var r=0;r<this.checks.length;r++)this.checks[r](this,t);this.stateId=t.data},e.prototype.setBlend=function(t){this.updateCheck(e.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},e.prototype.setOffset=function(t){this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},e.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},e.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},e.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},e.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},e.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},e.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(0),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},e.prototype.updateCheck=function(t,e){var r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)},e.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},e}(dr),ki=function(t){function e(e){t.call(this,e),this.count=0,this.checkCount=0,this.maxIdle=m.GC_MAX_IDLE,this.checkCountMax=m.GC_MAX_CHECK_COUNT,this.mode=m.GC_MODE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postrender=function(){this.count++,this.mode!==It.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;i<e.length;i++){var n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s<e.length;s++)null!==e[s]&&(e[o++]=e[s]);e.length=o}},e.prototype.unload=function(t){var e=this.renderer.textureSystem;t._texture&&t._texture._glRenderTargets&&e.destroyTexture(t._texture);for(var r=t.children.length-1;r>=0;r--)this.unload(t.children[r])},e}(dr),Xi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071},ji=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new or}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};var i=new Xi(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Xi(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(var n=0;n<6;n++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(var o=0;o<this.boundTextures.length;o++)this.bind(null,o)},e.prototype.bind=function(t,e){void 0===e&&(e=0);var r=this.gl;if(t){if((t=t.baseTexture||t).valid){t.touched=this.renderer.textureGC.count;var i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.boundTextures[e]!==t&&r.bindTexture(t.target,i.texture),i.dirtyId!==t.dirtyId&&this.updateTexture(t),this.boundTextures[e]=t}}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null},e.prototype.reset=function(){this._unknownBoundTextures=!0,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},e.prototype.unbind=function(t){var e=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var i=0;i<r.length;i++)r[i]===this.unknownTexture&&this.bind(null,i)}for(var n=0;n<r.length;n++)r[n]===t&&(this.currentLocation!==n&&(e.activeTexture(e.TEXTURE0+n),this.currentLocation=n),e.bindTexture(e.TEXTURE_2D,this.emptyTextures[t.target].texture),r[n]=null)},e.prototype.initTexture=function(t){var e=new Xi(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.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID],r=this.renderer;if(t.resource&&t.resource.upload(r,t,e));else{var i=t.realWidth,n=t.realHeight,o=r.gl;(e.width!==i||e.height!==n||e.dirtyId<0)&&(e.width=i,e.height=n,o.texImage2D(t.target,0,t.format,i,n,0,t.format,t.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId},e.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.baseTexture||t)._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&&Ht(this.managedTextures,i,1)}},e.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==Pt.POW2&&2===this.webGLVersion||t.isPowerOfTwo?(e.mipmap=t.mipmap>=1,e.wrapMode=t.wrapMode):(e.mipmap=0,e.wrapMode=St.CLAMP),t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var r=this.gl;e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap?r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST):r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode?r.LINEAR:r.NEAREST),r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode?r.LINEAR:r.NEAREST)},e}(dr),Gi={FilterSystem:Nr,BatchSystem:Br,ContextSystem:Xr,FramebufferSystem:jr,GeometrySystem:Yr,MaskSystem:Si,StencilSystem:Pi,ProjectionSystem:Ii,RenderTextureSystem:Oi,ShaderSystem:Di,StateSystem:Bi,TextureGCSystem:ki,TextureSystem:ji},Hi=new me,Yi=function(t){function e(e,r){t.call(this),(r=Object.assign({},m.RENDER_OPTIONS,r)).roundPixels&&(m.ROUND_PIXELS=r.roundPixels,he("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=r,this.type=yt.UNKNOWN,this.screen=new Oe(0,0,r.width,r.height),this.view=r.view||document.createElement("canvas"),this.resolution=r.resolution||m.RESOLUTION,this.transparent=r.transparent,this.autoDensity=r.autoDensity||r.autoResize||!1,this.preserveDrawingBuffer=r.preserveDrawingBuffer,this.clearBeforeRender=r.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=r.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new ke,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},r.width.get=function(){return this.view.width},r.height.get=function(){return this.view.height},e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},e.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=br.create(0|i.width,0|i.height,e,r);return Hi.tx=-i.x,Hi.ty=-i.y,this.render(t,n,!1,Hi,!!t.parent),n},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=yt.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},r.backgroundColor.get=function(){return this._backgroundColor},r.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Lt(t),Ft(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,r),e}(y),zi=function(t){function e(r){void 0===r&&(r={}),t.call(this,"WebGL",r),r=this.options,this.type=yt.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new He("destroy"),contextChange:new He("contextChange",1),reset:new He("reset"),update:new He("update"),postrender:new He("postrender"),prerender:new He("prerender"),resize:new He("resize",2)},this.globalUniforms=new Fr({projectionMatrix:new me},!0),this.addSystem(Si,"mask").addSystem(Xr,"context").addSystem(Bi,"state").addSystem(Di,"shader").addSystem(ji,"texture").addSystem(Yr,"geometry").addSystem(jr,"framebuffer").addSystem(Pi,"stencil").addSystem(Ii,"projection").addSystem(ki,"textureGC").addSystem(Nr,"filter").addSystem(Oi,"renderTexture").addSystem(Br,"batch"),this.initPlugins(e.__plugins),r.context?this.context.initFromContext(r.context):this.context.initFromOptions({alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,Dt(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t){if(Rt())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);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},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.run(e,r)},e.prototype.reset=function(){return this.runners.reset.run(),this},e.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},e.prototype.destroy=function(e){this.runners.destroy.run(),t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Yi);function Vi(t){return zi.create(t)}var Wi="attribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n    vTextureCoord = aTextureCoord;\r\n}",qi="attribute vec2 aVertexPosition;\r\n\r\nuniform mat3 projectionMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nuniform vec4 inputSize;\r\nuniform vec4 outputFrame;\r\n\r\nvec4 filterVertexPosition( void )\r\n{\r\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\r\n\r\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\r\n}\r\n\r\nvec2 filterTextureCoord( void )\r\n{\r\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\r\n}\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = filterVertexPosition();\r\n    vTextureCoord = filterTextureCoord();\r\n}\r\n",Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new hr(t,r))},e}(or),Ki=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new wr(null,e,!1),this._indexBuffer=new wr(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Et.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Et.FLOAT).addAttribute("aColor",this._buffer,4,!0,Et.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Et.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Cr),Ji=function(){this.textures=[],this.ids=[],this.blend=0,this.textureCount=0,this.start=0,this.size=0,this.type=4},Qi=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};Qi.prototype.destroy=function(){this.vertices=null,this.float32View=null,this.uint32View=null};var $i="precision highp float;\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\nattribute vec4 aColor;\r\nattribute float aTextureId;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform vec4 tint;\r\n\r\nvarying vec2 vTextureCoord;\r\nvarying vec4 vColor;\r\nvarying float vTextureId;\r\n\r\nvoid main(void){\r\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = aTextureCoord;\r\n    vTextureId = aTextureId;\r\n    vColor = aColor * tint;\r\n}\r\n",tn=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n"),en={},rn={};function nn(t,e){if(!rn[e]){for(var r=new Int32Array(e),i=0;i<e;i++)r[i]=i;en[e]=Fr.from({uSamplers:r},!0);var n=tn;n=(n=n.replace(/%count%/gi,e)).replace(/%forloop%/gi,function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"}(e)),rn[e]=new di($i,n)}var o={tint:new Float32Array([1,1,1,1]),translationMatrix:new me,default:en[e]};return new fi(rn[e],o)}var on=function(t){function e(e){t.call(this,e),this.vertSize=6,this.vertByteSize=4*this.vertSize,this.size=8e3,this.currentSize=0,this.currentIndexSize=0,this.attributeBuffers={},this.aBuffers={},this.iBuffers={},this.onlySprites=!1,this.shader=null,this.currentIndex=0,this.groups=[];for(var r=0;r<this.size/4;r++)this.groups[r]=new Ji;this.elements=[],this.vaos=[],this.vaoMax=2,this.vertexCount=0,this.renderer.on("prerender",this.onPrerender,this),this.state=gi.for2d()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contextChange=function(){var t=this.renderer.gl;m.PREFER_ENV===mt.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),m.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=hi(this.MAX_TEXTURES,t)),this.shader=nn(0,this.MAX_TEXTURES);for(var e=0;e<this.vaoMax;e++)this.vaos[e]=new Ki},e.prototype.onPrerender=function(){this.vertexCount=0},e.prototype.render=function(t){t._texture.valid&&(this.currentSize+t.vertexData.length/2>this.size&&this.flush(),this.elements[this.currentIndex++]=t,this.currentSize+=t.vertexData.length/2,this.currentIndexSize+=t.indices.length)},e.prototype.getIndexBuffer=function(t){var e=Wt(Math.ceil(t/12)),r=Zt(e),i=12*e;this.iBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.iBuffers[r];return n||(this.iBuffers[r]=n=new Uint16Array(i)),n},e.prototype.getAttributeBuffer=function(t){var e=Wt(Math.ceil(t/8)),r=Zt(e),i=8*e;this.aBuffers.length<=r&&(this.iBuffers.length=r+1);var n=this.aBuffers[i];return n||(this.aBuffers[i]=n=new Qi(i*this.vertByteSize)),n},e.prototype.flush=function(){if(0!==this.currentSize){var t,e,r=this.renderer.gl,i=this.MAX_TEXTURES,n=this.getAttributeBuffer(this.currentSize),o=this.getIndexBuffer(this.currentIndexSize),s=this.elements,a=this.groups,h=n.float32View,u=n.uint32View,l=this.renderer.textureGC.count,c=0,d=0,p=0,f=0,v=a[0],g=-1;v.textureCount=0,v.start=0,v.blend=g;var y,_=++or._globalBatch;for(y=0;y<this.currentIndex;++y){var x=s[y];s[y]=null,t=x._texture.baseTexture;var b=Ut[t.premultiplyAlpha?1:0][x.blendMode];g!==b&&(g=b,e=null,f=i,_++),e!==t&&(e=t,t._batchEnabled!==_&&(f===i&&(_++,f=0,v.size=d-v.start,(v=a[p++]).textureCount=0,v.blend=g,v.start=d),t.touched=l,t._batchEnabled=_,t._id=f,v.textures[v.textureCount++]=t,f++)),this.packGeometry(x,h,u,o,c,d),c+=x.vertexData.length/2*this.vertSize,d+=x.indices.length}or._globalBatch=_,v.size=d-v.start,m.CAN_UPLOAD_SAME_BUFFER?(this.vaos[this.vertexCount]._buffer.update(n.vertices,0),this.vaos[this.vertexCount]._indexBuffer.update(o,0),this.renderer.geometry.updateBuffers()):(this.vaoMax<=this.vertexCount&&(this.vaoMax++,this.vaos[this.vertexCount]=new Ki),this.vaos[this.vertexCount]._buffer.update(n.vertices,0),this.vaos[this.vertexCount]._indexBuffer.update(o,0),this.renderer.geometry.bind(this.vaos[this.vertexCount]),this.renderer.geometry.updateBuffers(),this.vertexCount++);var T=this.renderer.texture,E=this.renderer.state;for(y=0;y<p;y++){for(var w=a[y],S=w.textureCount,P=0;P<S;P++)T.bind(w.textures[P],P),w.textures[P]=null;E.setBlendMode(w.blend),r.drawElements(w.type,w.size,r.UNSIGNED_SHORT,2*w.start)}this.currentIndex=0,this.currentSize=0,this.currentIndexSize=0}},e.prototype.packGeometry=function(t,e,r,i,n,o){for(var s=n/this.vertSize,a=t.uvs,h=t.indices,u=t.vertexData,l=t._texture.baseTexture._id,c=Math.min(t.worldAlpha,1),d=c<1&&t._texture.baseTexture.premultiplyAlpha?Xt(t._tintRGB,c):t._tintRGB+(255*c<<24),p=0;p<u.length;p+=2)e[n++]=u[p],e[n++]=u[p+1],e[n++]=a[p],e[n++]=a[p+1],r[n++]=d,e[n++]=l;for(var f=0;f<h.length;f++)i[o++]=s+h[f]},e.prototype.start=function(){this.renderer.state.setState(this.state),this.renderer.shader.bind(this.shader),m.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this.vaos[this.vertexCount])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this.vaoMax;e++)this.vaos[e]&&this.vaos[e].destroy();this.indexBuffer&&this.indexBuffer.destroy(),this.renderer.off("prerender",this.onPrerender,this),this.shader&&(this.shader.destroy(),this.shader=null),this.vaos=null,this.indexBuffer=null,this.indices=null,this.sprites=null,t.prototype.destroy.call(this)},e}(Ur),sn=new Oe,an=function(t){this.renderer=t,t.extract=this};an.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},an.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},an.prototype.canvas=function(t){var e,r,i,n=this.renderer,o=!1,s=!1;t&&(t instanceof br?i=t:(i=this.renderer.generateTexture(t),s=!0)),i?(e=i.baseTexture.resolution,r=i.frame,o=!1,n.renderTexture.bind(i)):(e=this.renderer.resolution,o=!0,(r=sn).width=this.renderer.width,r.height=this.renderer.height,n.renderTexture.bind(null));var a=r.width*e,h=r.height*e,u=new te(a,h,1),l=new Uint8Array(4*a*h),c=n.gl;c.readPixels(r.x*e,r.y*e,a,h,c.RGBA,c.UNSIGNED_BYTE,l);var d=u.context.getImageData(0,0,a,h);return d.data.set(l),u.context.putImageData(d,0,0),o&&(u.context.scale(1,-1),u.context.drawImage(u.canvas,0,-h)),s&&i.destroy(!0),u.canvas},an.prototype.pixels=function(t){var e,r,i,n=this.renderer,o=!1;t&&(t instanceof br?i=t:(i=this.renderer.generateTexture(t),o=!0)),i?(e=i.baseTexture.resolution,r=i.frame,n.renderTexture.bind(i)):(e=n.resolution,(r=sn).width=n.width,r.height=n.height,n.renderTexture.bind(null));var s=r.width*e,a=r.height*e,h=new Uint8Array(4*s*a),u=n.gl;return u.readPixels(r.x*e,r.y*e,s,a,u.RGBA,u.UNSIGNED_BYTE,h),o&&i.destroy(!0),h},an.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null};var hn={Extract:an},un=function(){this.global=new le,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},ln={pointerId:{configurable:!0}};ln.pointerId.get=function(){return this.identifier},un.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},un.prototype.copyEvent=function(t){t.isPrimary&&(this.isPrimary=!0),this.button=t.button,this.buttons=Number.isInteger(t.buttons)?t.buttons:t.which,this.width=t.width,this.height=t.height,this.tiltX=t.tiltX,this.tiltY=t.tiltY,this.pointerType=t.pointerType,this.pressure=t.pressure,this.rotationAngle=t.rotationAngle,this.twist=t.twist||0,this.tangentialPressure=t.tangentialPressure||0},un.prototype.reset=function(){this.isPrimary=!1},Object.defineProperties(un.prototype,ln);var cn=function(){this.stopped=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null};cn.prototype.stopPropagation=function(){this.stopped=!0},cn.prototype.reset=function(){this.stopped=!1,this.currentTarget=null,this.target=null};var dn=function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE},pn={pointerId:{configurable:!0},flags:{configurable:!0},none:{configurable:!0},over:{configurable:!0},rightDown:{configurable:!0},leftDown:{configurable:!0}};dn.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},pn.pointerId.get=function(){return this._pointerId},pn.flags.get=function(){return this._flags},pn.flags.set=function(t){this._flags=t},pn.none.get=function(){return this._flags===this.constructor.FLAGS.NONE},pn.over.get=function(){return 0!=(this._flags&this.constructor.FLAGS.OVER)},pn.over.set=function(t){this._doSet(this.constructor.FLAGS.OVER,t)},pn.rightDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.RIGHT_DOWN)},pn.rightDown.set=function(t){this._doSet(this.constructor.FLAGS.RIGHT_DOWN,t)},pn.leftDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.LEFT_DOWN)},pn.leftDown.set=function(t){this._doSet(this.constructor.FLAGS.LEFT_DOWN,t)},Object.defineProperties(dn.prototype,pn),dn.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4});var fn={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};Ue.mixin(fn);var vn=1,gn={target:null,data:{global:null}},mn=function(t){function e(e,r){t.call(this),r=r||{},this.renderer=e,this.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,this.interactionFrequency=r.interactionFrequency||10,this.mouse=new un,this.mouse.identifier=vn,this.mouse.global.set(-999999),this.activeInteractionData={},this.activeInteractionData[vn]=this.mouse,this.interactionDataPool=[],this.eventData=new cn,this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.mouseOverRenderer=!1,this.supportsTouchEvents="ontouchstart"in window,this.supportsPointerEvents=!!window.PointerEvent,this.onPointerUp=this.onPointerUp.bind(this),this.processPointerUp=this.processPointerUp.bind(this),this.onPointerCancel=this.onPointerCancel.bind(this),this.processPointerCancel=this.processPointerCancel.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.processPointerDown=this.processPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.processPointerMove=this.processPointerMove.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.processPointerOverOut=this.processPointerOverOut.bind(this),this.onPointerOver=this.onPointerOver.bind(this),this.cursorStyles={default:"inherit",pointer:"pointer"},this.currentCursorMode=null,this.cursor=null,this._tempPoint=new le,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hitTest=function(t,e){return gn.target=null,gn.data.global=t,e||(e=this.renderer._lastObjectRendered),this.processInteractive(gn,e,null,!0),gn.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents()},e.prototype.addEvents=function(){this.interactionDOMElement&&(We.system.add(this.update,this,ze.INTERACTION),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0)},e.prototype.removeEvents=function(){this.interactionDOMElement&&(We.system.remove(this.update,this),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1)},e.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.interactionDOMElement))if(this.didMove)this.didMove=!1;else{for(var e in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(e)){var r=this.activeInteractionData[e];if(r.originalEvent&&"touch"!==r.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,r.originalEvent,r);this.processInteractive(i,this.renderer._lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){if(t=t||"default",this.currentCursorMode!==t){this.currentCursorMode=t;var e=this.cursorStyles[t];if(e)switch(typeof e){case"string":this.interactionDOMElement.style.cursor=e;break;case"function":e(t);break;case"object":Object.assign(this.interactionDOMElement.style,e)}else"string"!=typeof t||Object.prototype.hasOwnProperty.call(this.cursorStyles,t)||(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,r){r.stopped||(r.currentTarget=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},e.prototype.mapPositionToPoint=function(t,e,r){var i;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var n=1/this.resolution;t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)*n,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)*n},e.prototype.processInteractive=function(t,e,r,i,n){if(!e||!e.visible)return!1;var o=t.data.global,s=!1,a=n=e.interactive||n,h=!0;if(e.hitArea?(i&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?s=!0:(i=!1,h=!1)),a=!1):e._mask&&i&&(e._mask.containsPoint&&e._mask.containsPoint(o)||(i=!1)),h&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var c=u[l],d=this.processInteractive(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(s.data.originalEvent=t,this.processInteractive(s,this.renderer._lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===n.pointerType)this.emit("touchstart",s);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,r){var i=t.data,n=t.data.identifier;if(r)if(e.trackedPointers[n]||(e.trackedPointers[n]=new dn(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===i.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;o?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,r){for(var i=this.normalizeToPointerData(t),n=i.length,o=t.target!==this.interactionDOMElement?"outside":"",s=0;s<n;s++){var a=i[s],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.renderer._lastObjectRendered,r,e||!o),this.emit(e?"pointercancel":"pointerup"+o,u),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+o:"mouseup"+o,u)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,u),this.releaseInteractionDataForPointerId(a.pointerId,h))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var r=t.data,i=t.data.identifier;void 0!==e.trackedPointers[i]&&(delete e.trackedPointers[i],this.dispatchEvent(e,"pointercancel",t),"touch"===r.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,r){var i=t.data,n=t.data.identifier,o=e.trackedPointers[n],s="touch"===i.pointerType,a="mouse"===i.pointerType||"pen"===i.pointerType,h=!1;if(a){var u=2===i.button,l=dn.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,d=void 0!==o&&o.flags&c;r?(this.dispatchEvent(e,u?"rightup":"mouseup",t),d&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):d&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),o&&(u?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!h||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[n]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this.didMove=!0,this.cursor=null);for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);s.data.originalEvent=t;var a="touch"!==n.pointerType||this.moveWhenInside;this.processInteractive(s,this.renderer._lastObjectRendered,this.processPointerMove,a),this.emit("pointermove",s),"touch"===n.pointerType&&this.emit("touchmove",s),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,r){var i=t.data,n="touch"===i.pointerType,o="mouse"===i.pointerType||"pen"===i.pointerType;o&&this.processPointerOverOut(t,e,r),this.moveWhenInside&&!r||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,this.processInteractive(i,this.renderer._lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",i),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",i):this.releaseInteractionDataForPointerId(r.identifier)}},e.prototype.processPointerOverOut=function(t,e,r){var i=t.data,n=t.data.identifier,o="mouse"===i.pointerType||"pen"===i.pointerType,s=e.trackedPointers[n];r&&!s&&(s=e.trackedPointers[n]=new dn(n)),void 0!==s&&(r&&this.mouseOverRenderer?(s.over||(s.over=!0,this.dispatchEvent(e,"pointerover",t),o&&this.dispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[n]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",i),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",i)},e.prototype.getInteractionDataForPointerId=function(t){var e,r=t.pointerId;return r===vn||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[r]?e=this.activeInteractionData[r]:((e=this.interactionDataPool.pop()||new un).identifier=r,this.activeInteractionData[r]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,r){return t.data=r,this.mapPositionToPoint(r.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=r.global.x,e.globalY=r.global.y),r.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var r=0,i=t.changedTouches.length;r<i;r++){var n=t.changedTouches[r];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof window.PointerEvent?e.push(t):(void 0===t.isPrimary&&(t.isPrimary=!0),void 0===t.width&&(t.width=1),void 0===t.height&&(t.height=1),void 0===t.tiltX&&(t.tiltX=0),void 0===t.tiltY&&(t.tiltY=0),void 0===t.pointerType&&(t.pointerType="mouse"),void 0===t.pointerId&&(t.pointerId=vn),void 0===t.pressure&&(t.pressure=.5),void 0===t.twist&&(t.twist=0),void 0===t.tangentialPressure&&(t.tangentialPressure=0),t.isNormalized=!0,e.push(t));return e},e.prototype.destroy=function(){this.removeEvents(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this._tempPoint=null},e}(y),yn={InteractionData:un,InteractionEvent:cn,InteractionManager:mn,InteractionTrackingData:dn,interactiveTarget:fn},_n={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive)return e;var r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},xn=function(){this.reset()};xn.prototype.clone=function(){var t=new xn;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},xn.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=_r.WHITE,this.matrix=null,this.visible=!1},xn.prototype.destroy=function(){this.texture=null,this.matrix=null};var bn=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type,this.points=[],this.holes=[]};bn.prototype.clone=function(){return new bn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},bn.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};var Tn={build:function(t){var e,r,i=t.shape,n=t.points,o=i.x,s=i.y;if(n.length=0,t.type===ge.CIRC?(e=i.radius,r=i.radius):(e=i.width,r=i.height),0!==e&&0!==r){var a=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u<a;u++)n.push(o+Math.sin(-h*u)*e,s+Math.cos(-h*u)*r);n.push(n[0],n[1])}},triangulate:function(t,e){var r=t.points,i=e.points,n=e.indices,o=i.length/2,s=o;i.push(t.shape.x,t.shape.y);for(var a=0;a<r.length;a+=2)i.push(r[a],r[a+1]),n.push(o++,s,o)}};function En(t,e){t.lineStyle.native?function(t,e){var r=0,i=t.points||t.shape.points;if(0===i.length)return;var n=e.points,o=e.indices,s=i.length/2,a=n.length/2;for(r=1;r<s;r++){var h=i[2*(r-1)],u=i[2*(r-1)+1],l=i[2*r],c=i[2*r+1];n.push(h,u),n.push(l,c),o.push(a++,a++)}}(t,e):function(t,e){var r=t.shape,i=t.points||r.points.slice();if(0===i.length)return;var n=t.lineStyle,o=new le(i[0],i[1]),s=new le(i[i.length-2],i[i.length-1]),a=r.type!==ge.POLY||r.closeStroke,h=o.x===s.x&&o.y===s.y;if(a){i=i.slice(),h&&(i.pop(),i.pop(),s.set(i[i.length-2],i[i.length-1]));var u=s.x+.5*(o.x-s.x),l=s.y+.5*(o.y-s.y);i.unshift(u,l),i.push(u,l)}var c=e.points,d=i.length/2,p=i.length,f=c.length/2,v=n.width/2,g=i[0],m=i[1],y=i[2],_=i[3],x=0,b=0,T=-(m-_),E=g-y,w=0,S=0,P=0,I=0,A=Math.sqrt(T*T+E*E);T/=A,E/=A,T*=v,E*=v;var O=n.alignment,C=2*(1-O),M=2*O;c.push(g-T*C,m-E*C),c.push(g+T*M,m+E*M);for(var D=1;D<d-1;++D){g=i[2*(D-1)],m=i[2*(D-1)+1],y=i[2*D],_=i[2*D+1],x=i[2*(D+1)],b=i[2*(D+1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,w=-(_-b),S=y-x,A=Math.sqrt(w*w+S*S),w/=A,S/=A;var R=-E+m-(-E+_),F=-T+y-(-T+g),L=(-T+g)*(-E+_)-(-T+y)*(-E+m),N=-(S*=v)+b-(-S+_),U=-(w*=v)+y-(-w+x),B=(-w+x)*(-S+_)-(-w+y)*(-S+b),k=R*U-N*F;if(Math.abs(k)<.1)k+=10.1,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);else{var X=(F*B-U*L)/k,j=(N*L-R*B)/k,G=(X-y)*(X-y)+(j-_)*(j-_);G>196*v*v?(P=T-w,I=E-S,A=Math.sqrt(P*P+I*I),P/=A,I/=A,P*=v,I*=v,c.push(y-P*C,_-I*C),c.push(y+P*M,_+I*M),c.push(y-P*M*C,_-I*C),p++):(c.push(y+(X-y)*C,_+(j-_)*C),c.push(y-(X-y)*M,_-(j-_)*M))}}g=i[2*(d-2)],m=i[2*(d-2)+1],y=i[2*(d-1)],_=i[2*(d-1)+1],T=-(m-_),E=g-y,A=Math.sqrt(T*T+E*E),T/=A,E/=A,T*=v,E*=v,c.push(y-T*C,_-E*C),c.push(y+T*M,_+E*M);for(var H=e.indices,Y=0;Y<p-2;++Y)H.push(f,f+1,f+2),f++}(t,e)}var wn={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(r.length>=6){for(var s=[],a=0;a<i.length;a++){var h=i[a];s.push(r.length/2),r=r.concat(h.points)}var u=_(r,s,2);if(!u)return;for(var l=n.length/2,c=0;c<u.length;c+=3)o.push(u[c]+l),o.push(u[c+1]+l),o.push(u[c+2]+l);for(var d=0;d<r.length;d++)n.push(r[d])}}},Sn={build:function(t){var e=t.shape,r=t.points,i=e.x,n=e.y,o=e.width,s=e.height,a=e.radius;r.length=0,In(i,n+a,i,n,i+a,n,r),In(i+o-a,n,i+o,n,i+o,n+a,r),In(i+o,n+s-a,i+o,n+s,i+o-a,n+s,r),In(i+a,n+s,i,n+s,i,n+s-a,r)},triangulate:function(t,e){for(var r=t.points,i=e.points,n=e.indices,o=i.length/2,s=_(r,null,2),a=0,h=s.length;a<h;a+=3)n.push(s[a]+o),n.push(s[a+1]+o),n.push(s[a+2]+o);for(var u=0,l=r.length;u<l;u++)i.push(r[u],r[++u])}};function Pn(t,e,r){return t+(e-t)*r}function In(t,e,r,i,n,o,s){void 0===s&&(s=[]);for(var a=s,h=0,u=0,l=0,c=0,d=0,p=0,f=0,v=0;f<=20;++f)h=Pn(t,r,v=f/20),u=Pn(e,i,v),l=Pn(r,n,v),c=Pn(i,o,v),d=Pn(h,l,v),p=Pn(u,c,v),a.push(d,p);return a}var An=[],On=[],Cn={};Cn[ge.POLY]=wn,Cn[ge.CIRC]=Tn,Cn[ge.ELIP]=Tn,Cn[ge.RECT]={build:function(t){var e=t.shape,r=e.x,i=e.y,n=e.width,o=e.height,s=t.points;s.length=0,s.push(r,i,r+n,i,r+n,i+o,r,i+o)},triangulate:function(t,e){var r=t.points,i=e.points,n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},Cn[ge.RREC]=Sn;var Mn=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},Dn=function(t){function e(){t.call(this),this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.dirty=0,this.batchDirty=-1,this.cacheDirty=-1,this.clearDirty=0,this.drawCalls=[],this.batches=[],this.shapeIndex=0,this._bounds=new Ne,this.boundsDirty=-1,this.boundsPadding=0,this.batchable=!1,this.indicesUint16=null,this.uvsFloat32=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={bounds:{configurable:!0}};return r.bounds.get=function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},e.prototype.clear=function(){if(this.graphicsData.length>0){this.boundsDirty=-1,this.dirty++,this.clearDirty++,this.batchDirty++,this.graphicsData.length=0,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;t<this.drawCalls.length;t++)this.drawCalls[t].textures.length=0,On.push(this.drawCalls[t]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var r=this.batches[e];r.start=0,r.attribStart=0,r.style=null,An.push(r)}this.batches.length=0}return this},e.prototype.drawShape=function(t,e,r,i){var n=new bn(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(!this.graphicsData.length)return null;var r=new bn(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,r},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e);for(var r=0;r<this.graphicsData.length;++r)this.graphicsData[r].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,r=0;r<e.length;++r){var i=e[r];if(i.fillStyle.visible&&(i.shape&&i.shape.contains(t.x,t.y))){if(i.holes)for(var n=0;n<i.holes.length;n++){if(i.holes[n].shape.contains(t.x,t.y))return!1}return!0}}return!1},e.prototype.updateBatches=function(){if(this.dirty!==this.cacheDirty&&0!==this.graphicsData.length){if(this.dirty!==this.cacheDirty)for(var t=0;t<this.graphicsData.length;t++){var e=this.graphicsData[t];if(e.fillStyle&&!e.fillStyle.texture.baseTexture.valid)return;if(e.lineStyle&&!e.lineStyle.texture.baseTexture.valid)return}this.cacheDirty=this.dirty;var r=this.uvs,i=this.batches.pop()||An.pop()||new Mn;i.style=i.style||this.graphicsData[0].fillStyle||this.graphicsData[0].lineStyle;var n=i.style.texture.baseTexture,o=i.style.color+i.style.alpha;this.batches.push(i);for(var s=this.shapeIndex;s<this.graphicsData.length;s++){this.shapeIndex++;var a=this.graphicsData[s],h=Cn[a.type],u=a.fillStyle,l=a.lineStyle;h.build(a),a.matrix&&this.transformPoints(a.points,a.matrix);for(var c=0;c<2;c++){var d=0===c?u:l;if(d.visible){var p=d.texture.baseTexture;if(n!==p||d.color+d.alpha!==o){p.wrapMode=10497,n=p,o=d.color+d.alpha;var f=this.indices.length,v=this.points.length/2;i.size=f-i.start,i.attribSize=v-i.attribStart,i.size>0&&(i=An.pop()||new Mn,this.batches.push(i)),i.style=d,i.start=f,i.attribStart=v}var g=this.points.length/2;if(0===c)a.holes.length?(this.processHoles(a.holes),wn.triangulate(a,this)):h.triangulate(a,this);else{En(a,this);for(var m=0;m<a.holes.length;m++)En(a.holes[m],this)}var y=this.points.length/2-g;this.addUvs(this.points,r,d.texture,g,y,d.matrix)}}}var _=this.indices.length,x=this.points.length/2;if(i.size=_-i.start,i.attribSize=x-i.attribStart,this.indicesUint16=new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var b=0;b<this.batches.length;b++)for(var T=this.batches[b],E=0;E<T.size;E++){var w=T.start+E;this.indicesUint16[w]=this.indicesUint16[w]-T.attribStart}}else this.buildDrawCalls()}},e.prototype.isBatchable=function(){for(var t=this.batches,r=0;r<t.length;r++)if(t[r].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++or._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].textures.length=0,On.push(this.drawCalls[e]);this.drawCalls.length=0;var r=this.uvs,i=this.colors,n=this.textureIds,o=On.pop()||new Ji;o.textureCount=0,o.start=0,o.size=0,o.type=xt.TRIANGLES;var s=0,a=null,h=0,u=!1,l=xt.TRIANGLES,c=0;this.drawCalls.push(o);for(var d=0;d<this.batches.length;d++){var p=this.batches[d],f=p.style,v=f.texture.baseTexture;u!==f.native&&(l=(u=f.native)?xt.LINES:xt.TRIANGLES,a=null,s=8,t++),a!==v&&(a=v,v._batchEnabled!==t&&(8===s&&(t++,s=0,o.size>0&&(o=On.pop()||new Ji,this.drawCalls.push(o)),o.start=c,o.size=0,o.textureCount=0,o.type=l),v.touched=1,v._batchEnabled=t,v._id=s,v.wrapMode=10497,o.textures[o.textureCount++]=v,s++)),o.size+=p.size,c+=p.size,h=v._id,this.addColors(i,f.color,f.alpha,p.attribSize),this.addTextureIds(n,h,p.attribSize)}or._globalBatch=t;for(var g=this.points,m=new ArrayBuffer(3*g.length*4),y=new Float32Array(m),_=new Uint32Array(m),x=0,b=0;b<g.length/2;b++)y[x++]=g[2*b],y[x++]=g[2*b+1],y[x++]=r[2*b],y[x++]=r[2*b+1],_[x++]=i[b],y[x++]=n[b];this._buffer.update(m),this._indexBuffer.update(this.indicesUint16)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var r=t[e];Cn[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}},e.prototype.calculateBounds=function(){var t=1/0,e=-1/0,r=1/0,i=-1/0;if(this.graphicsData.length)for(var n=null,o=0,s=0,a=0,h=0,u=0;u<this.graphicsData.length;u++){var l=this.graphicsData[u],c=l.type,d=l.lineStyle?l.lineStyle.width:0;if(n=l.shape,c===ge.RECT||c===ge.RREC)o=n.x-d/2,s=n.y-d/2,t=o<t?o:t,e=o+(a=n.width+d)>e?o+a:e,r=s<r?s:r,i=s+(h=n.height+d)>i?s+h:i;else if(c===ge.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+d/2)<t?o-a:t,e=o+a>e?o+a:e,r=s-(h=n.radius+d/2)<r?s-h:r,i=s+h>i?s+h:i;else if(c===ge.ELIP)o=n.x,s=n.y,t=o-(a=n.width+d/2)<t?o-a:t,e=o+a>e?o+a:e,r=s-(h=n.height+d/2)<r?s-h:r,i=s+h>i?s+h:i;else for(var p=n.points,f=0,v=0,g=0,m=0,y=0,_=0,x=0,b=0,T=0;T+2<p.length;T+=2)o=p[T],s=p[T+1],f=p[T+2],v=p[T+3],g=Math.abs(f-o),m=Math.abs(v-s),h=d,(a=Math.sqrt(g*g+m*m))<1e-9||(t=(x=(f+o)/2)-(y=(h/a*m+g)/2)<t?x-y:t,e=x+y>e?x+y:e,r=(b=(v+s)/2)-(_=(h/a*g+m)/2)<r?b-_:r,i=b+_>i?b+_:i)}else t=0,e=0,r=0,i=0;var E=this.boundsPadding;this._bounds.minX=t-E,this._bounds.maxX=e+E,this._bounds.minY=r-E,this._bounds.maxY=i+E},e.prototype.transformPoints=function(t,e){for(var r=0;r<t.length/2;r++){var i=t[2*r],n=t[2*r+1];t[2*r]=e.a*i+e.c*n+e.tx,t[2*r+1]=e.b*i+e.d*n+e.ty}},e.prototype.addColors=function(t,e,r,i){for(var n=Xt((e>>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,r){for(;r-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;s<n;){var u=t[2*(i+s)],l=t[2*(i+s)+1];if(o){var c=o.a*u+o.c*l+o.tx;l=o.b*u+o.d*l+o.ty,u=c}s++,e.push(u/h.width,l/h.height)}var d=r.baseTexture;(h.width<d.width||h.height<d.height)&&this.adjustUvs(e,r,a,n)},e.prototype.adjustUvs=function(t,e,r,i){for(var n=e.baseTexture,o=r+2*i,s=e.frame,a=s.width/n.width,h=s.height/n.height,u=s.x/s.width,l=s.y/s.height,c=Math.floor(t[r]+1e-6),d=Math.floor(t[r+1]+1e-6),p=r+2;p<o;p+=2)c=Math.min(c,Math.floor(t[p]+1e-6)),d=Math.min(d,Math.floor(t[p+1]+1e-6));u-=c,l-=d;for(var f=r;f<o;f+=2)t[f]=(t[f]+u)*a,t[f+1]=(t[f+1]+l)*h},Object.defineProperties(e.prototype,r),e}(Ki);Dn.BATCHABLE_SIZE=100;var Rn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.width=0,this.alignment=.5,this.native=!1},e}(xn),Fn=function(){};Fn.curveLength=function(t,e,r,i,n,o,s,a){for(var h=0,u=0,l=0,c=0,d=0,p=0,f=0,v=0,g=0,m=0,y=0,_=t,x=e,b=1;b<=10;++b)m=_-(v=(f=(p=(d=1-(u=b/10))*d)*d)*t+3*p*u*r+3*d*(l=u*u)*n+(c=l*u)*s),y=x-(g=f*e+3*p*u*i+3*d*l*o+c*a),_=v,x=g,h+=Math.sqrt(m*m+y*y);return h},Fn.curveTo=function(t,e,r,i,n,o,s){var a=s[s.length-2],h=s[s.length-1];s.length-=2;var u=_n._segmentsCount(Fn.curveLength(a,h,t,e,r,i,n,o)),l=0,c=0,d=0,p=0,f=0;s.push(a,h);for(var v=1,g=0;v<=u;++v)d=(c=(l=1-(g=v/u))*l)*l,f=(p=g*g)*g,s.push(d*a+3*c*g*t+3*l*p*r+f*n,d*h+3*c*g*e+3*l*p*i+f*o)};var Ln=function(){};Ln.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,p=2*Math.sqrt(l+c+d),f=Math.sqrt(l),v=2*l*f,g=2*Math.sqrt(d),m=c/f;return(v*p+f*c*(p-g)+(4*d*l-c*c)*Math.log((2*f+m+p)/(m+g)))/(4*v)},Ln.curveTo=function(t,e,r,i,n){for(var o=n[n.length-2],s=n[n.length-1],a=_n._segmentsCount(Ln.curveLength(o,s,t,e,r,i)),h=0,u=0,l=1;l<=a;++l){var c=l/a;h=o+(t-o)*c,u=s+(e-s)*c,n.push(h+(t+(r-t)*c-h)*c,u+(e+(i-e)*c-u)*c)}};var Nn=function(){};Nn.curveTo=function(t,e,r,i,n,o){var s=o[o.length-2],a=o[o.length-1]-e,h=s-t,u=i-e,l=r-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var d=a*a+h*h,p=u*u+l*l,f=a*u+h*l,v=n*Math.sqrt(d)/c,g=n*Math.sqrt(p)/c,m=v*f/d,y=g*f/p,_=v*l+g*h,x=v*u+g*a,b=h*(g+m),T=a*(g+m),E=l*(v+y),w=u*(v+y);return{cx:_+t,cy:x+e,radius:n,startAngle:Math.atan2(T-x,b-_),endAngle:Math.atan2(w-x,E-_),anticlockwise:h*u>l*a}},Nn.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=_n._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/pe)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,g=v%1/v,m=0;m<=v;++m){var y=c+o+d*(m+g*m),_=Math.cos(y),x=-Math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var Un=function(t){function e(e,r,i,n,o,s){o=o||n/2;for(var a=-1*Math.PI/2+s,h=2*i,u=pe/h,l=[],c=0;c<h;c++){var d=c%2?o:n,p=c*u+a;l.push(e+d*Math.cos(p),r+d*Math.sin(p))}t.call(this,l)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Fe),Bn=new Float32Array(3),kn=null,Xn=function(t){function e(e){void 0===e&&(e=null),t.call(this),this.geometry=e||new Dn,this.geometry.refCount++,this.shader=null,this.state=gi.for2d(),this._fillStyle=new xn,this._lineStyle=new Rn,this._matrix=null,this._holeMode=!1,this.currentPath=null,this.batches=[],this.batchTint=-1,this.vertexData=null,this._transformID=-1,this.batchDirty=-1,this.tint=16777215,this.blendMode=_t.NORMAL}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blendMode:{configurable:!0},tint:{configurable:!0},fill:{configurable:!0},line:{configurable:!0}};return e.prototype.clone=function(){return this.finishPoly(),new e(this.geometry)},r.blendMode.set=function(t){this.state.blendMode=t},r.blendMode.get=function(){return this.state.blendMode},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t},r.fill.get=function(){return this._fillStyle},r.line.get=function(){return this._lineStyle},e.prototype.lineStyle=function(t,e,r,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=.5),void 0===n&&(n=!1),this.lineTextureStyle(t,_r.WHITE,e,r,null,i,n),this},e.prototype.lineTextureStyle=function(t,e,r,i,n,o,s){void 0===t&&(t=0),void 0===e&&(e=_r.WHITE),void 0===r&&(r=16777215),void 0===i&&(i=1),void 0===n&&(n=null),void 0===o&&(o=.5),void 0===s&&(s=!1),this.currentPath&&this.startPoly();var a=t>0&&i>0;return a?(n&&(n=n.clone()).invert(),Object.assign(this._lineStyle,{color:r,width:t,alpha:i,matrix:n,texture:e,alignment:o,native:s,visible:a})):this._lineStyle.reset(),this},e.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 Fe,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Fe,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.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},e.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)},e.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Ln.curveTo(t,e,r,i,n),this},e.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Fn.curveTo(t,e,r,i,n,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Nn.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},e.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=pe:o&&i<=n&&(i+=pe),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this.currentPath?this.currentPath.points:null;if(h){var u=Math.abs(h[h.length-2]-s),l=Math.abs(h[h.length-1]-a);u<.001&&l<.001||h.push(s,a)}else this.moveTo(s,a),h=this.currentPath.points;return Nn.arc(s,a,t,e,r,i,n,o,h),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill(_r.WHITE,t,e)},e.prototype.beginTextureFill=function(t,e,r,i){void 0===t&&(t=_r.WHITE),void 0===e&&(e=16777215),void 0===r&&(r=1),void 0===i&&(i=null),this.currentPath&&this.startPoly();var n=r>0;return n?(i&&(i=i.clone()).invert(),Object.assign(this._fillStyle,{color:e,alpha:r,texture:t,matrix:i,visible:n})):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,r,i){return this.drawShape(new Oe(t,e,r,i))},e.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Le(t,e,r,i,n))},e.prototype.drawCircle=function(t,e,r){return this.drawShape(new De(t,e,r))},e.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new Re(t,e,r,i))},e.prototype.drawPolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n<r.length;++n)r[n]=e[n]}var o=new Fe(r);return o.closeStroke=i,this.drawShape(o),this},e.prototype.drawShape=function(t){return this._holeMode?this.geometry.drawHole(t,this._matrix):this.geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.drawStar=function(t,e,r,i,n,o){return void 0===o&&(o=0),this.drawPolygon(new Un(t,e,r,i,n,o))},e.prototype.clear=function(){return this.geometry.clear(),this._matrix=null,this._holeMode=!1,this.currentPath=null,this._spriteRect=null,this},e.prototype.isFastRect=function(){return!1},e.prototype._render=function(t){this.finishPoly();var e=this.geometry;if(e.updateBatches(),e.batchable){if(this.batchDirty!==e.batchDirty){this.batches=[],this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.vertexData=new Float32Array(e.points);for(var r=this.blendMode,i=0;i<e.batches.length;i++){var n=e.batches[i],o=n.style.color,s=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(e.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),h={vertexData:s,blendMode:r,indices:new Uint16Array(e.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:Ft(o),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=h}}if(t.batch.setObjectRenderer(t.plugins.batch),this.batches.length){this.calculateVertices(),this.calculateTints();for(var u=0;u<this.batches.length;u++){var l=this.batches[u];l.worldAlpha=this.worldAlpha*l.alpha,t.plugins.batch.render(l)}}}else{if(t.batch.flush(),!this.shader){if(!kn){for(var c=new Int32Array(16),d=0;d<16;d++)c[d]=d;var p={tint:new Float32Array([1,1,1,1]),translationMatrix:new me,default:Fr.from({uSamplers:c},!0)},f=t.plugins.batch.shader.program;kn=new fi(f,p)}this.shader=kn}var v=this.shader.uniforms;v.translationMatrix=this.transform.worldTransform;var g=this.tint,m=this.worldAlpha;v.tint[0]=(g>>16&255)/255*m,v.tint[1]=(g>>8&255)/255*m,v.tint[2]=(255&g)/255*m,v.tint[3]=m,t.shader.bind(this.shader),t.geometry.bind(e,this.shader),t.state.setState(this.state);for(var y=0;y<e.drawCalls.length;y++){for(var _=e.drawCalls[y],x=_.textureCount,b=0;b<x;b++)t.texture.bind(_.textures[b],b);t.geometry.draw(_.type,_.size,_.start)}}},e.prototype._calculateBounds=function(){this.finishPoly();var t=this.geometry.bounds;this._bounds.addFrame(this.transform,t.minX,t.minY,t.maxX,t.maxY)},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this.geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=Ft(this.tint,Bn),e=0;e<this.batches.length;e++){var r=this.batches[e],i=r._batchRGB,n=(t[0]*i[0]*255<<16)+(t[1]*i[1]*255<<8)+(0|t[2]*i[2]*255);r._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},e.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexData,u=0,l=0;l<a.length;l+=2){var c=a[l],d=a[l+1];h[u++]=e*c+i*d+o,h[u++]=n*d+r*c+s}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this.geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},Object.defineProperties(e.prototype,r),e}(ke);Xn._TEMP_POINT=new le;var jn=new le,Gn=new Uint16Array([0,1,2,0,2,3]),Hn=function(t){function e(e){t.call(this),this._anchor=new ce(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=_t.NORMAL,this.shader=null,this.cachedTint=16777215,this.uvs=null,this.texture=e||_r.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=Gn,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=m.ROUND_PIXELS}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this.cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this._width&&(this.scale.x=Vt(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Vt(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._transformID=this.transform._worldID,this._textureID=t._updateID;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.vertexData,u=t.trim,l=t.orig,c=this._anchor,d=0,p=0,f=0,v=0;if(u?(d=(p=u.x-c._x*l.width)+u.width,f=(v=u.y-c._y*l.height)+u.height):(d=(p=-c._x*l.width)+l.width,f=(v=-c._y*l.height)+l.height),h[0]=r*p+n*v+s,h[1]=o*v+i*p+a,h[2]=r*d+n*v+s,h[3]=o*v+i*d+a,h[4]=r*d+n*f+s,h[5]=o*f+i*d+a,h[6]=r*p+n*f+s,h[7]=o*f+i*p+a,this._roundPixels)for(var g=0;g<8;g++)h[g]=Math.round(h[g])}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,r=t.orig,i=this._anchor,n=this.transform.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=-i._x*r.width,d=c+r.width,p=-i._y*r.height,f=p+r.height;e[0]=o*c+a*p+u,e[1]=h*p+s*c+l,e[2]=o*d+a*p+u,e[3]=h*p+s*d+l,e[4]=o*d+a*f+u,e[5]=h*f+s*d+l,e[6]=o*c+a*f+u,e[7]=h*f+s*c+l},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new Oe),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,jn);var e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x,n=0;return jn.x>=i&&jn.x<i+e&&(n=-r*this.anchor.y,jn.y>=n&&jn.y<n+r)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var r="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!r)}this._texture=null,this.shader=null},e.from=function(t,r){return new e(t instanceof _r?t:new _r.from(t,r))},r.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},r.roundPixels.get=function(){return this._roundPixels},r.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},r.width.set=function(t){var e=Vt(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},r.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},r.height.set=function(t){var e=Vt(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){this._anchor.copyFrom(t)},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},r.texture.get=function(){return this._texture},r.texture.set=function(t){this._texture!==t&&(this._texture=t||_r.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(e.prototype,r),e}(ke),Yn={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},zn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Yn.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},Vn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wn=function(t){this.styleID=0,this.reset(),Jn(this,t,t)},qn={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function Zn(t){return"number"==typeof t?Lt(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Kn(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=Zn(t[e]);return t}return Zn(t)}function Jn(t,e,r){for(var i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}Wn.prototype.clone=function(){var t={};return Jn(t,this,zn),new Wn(t)},Wn.prototype.reset=function(){Jn(this,zn,zn)},qn.align.get=function(){return this._align},qn.align.set=function(t){this._align!==t&&(this._align=t,this.styleID++)},qn.breakWords.get=function(){return this._breakWords},qn.breakWords.set=function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},qn.dropShadow.get=function(){return this._dropShadow},qn.dropShadow.set=function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},qn.dropShadowAlpha.get=function(){return this._dropShadowAlpha},qn.dropShadowAlpha.set=function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},qn.dropShadowAngle.get=function(){return this._dropShadowAngle},qn.dropShadowAngle.set=function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},qn.dropShadowBlur.get=function(){return this._dropShadowBlur},qn.dropShadowBlur.set=function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},qn.dropShadowColor.get=function(){return this._dropShadowColor},qn.dropShadowColor.set=function(t){var e=Kn(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},qn.dropShadowDistance.get=function(){return this._dropShadowDistance},qn.dropShadowDistance.set=function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},qn.fill.get=function(){return this._fill},qn.fill.set=function(t){var e=Kn(t);this._fill!==e&&(this._fill=e,this.styleID++)},qn.fillGradientType.get=function(){return this._fillGradientType},qn.fillGradientType.set=function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},qn.fillGradientStops.get=function(){return this._fillGradientStops},qn.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<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},qn.fontFamily.get=function(){return this._fontFamily},qn.fontFamily.set=function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},qn.fontSize.get=function(){return this._fontSize},qn.fontSize.set=function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},qn.fontStyle.get=function(){return this._fontStyle},qn.fontStyle.set=function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},qn.fontVariant.get=function(){return this._fontVariant},qn.fontVariant.set=function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},qn.fontWeight.get=function(){return this._fontWeight},qn.fontWeight.set=function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},qn.letterSpacing.get=function(){return this._letterSpacing},qn.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},qn.lineHeight.get=function(){return this._lineHeight},qn.lineHeight.set=function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},qn.leading.get=function(){return this._leading},qn.leading.set=function(t){this._leading!==t&&(this._leading=t,this.styleID++)},qn.lineJoin.get=function(){return this._lineJoin},qn.lineJoin.set=function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},qn.miterLimit.get=function(){return this._miterLimit},qn.miterLimit.set=function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},qn.padding.get=function(){return this._padding},qn.padding.set=function(t){this._padding!==t&&(this._padding=t,this.styleID++)},qn.stroke.get=function(){return this._stroke},qn.stroke.set=function(t){var e=Kn(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},qn.strokeThickness.get=function(){return this._strokeThickness},qn.strokeThickness.set=function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},qn.textBaseline.get=function(){return this._textBaseline},qn.textBaseline.set=function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},qn.trim.get=function(){return this._trim},qn.trim.set=function(t){this._trim!==t&&(this._trim=t,this.styleID++)},qn.whiteSpace.get=function(){return this._whiteSpace},qn.whiteSpace.set=function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},qn.wordWrap.get=function(){return this._wordWrap},qn.wordWrap.set=function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},qn.wordWrapWidth.get=function(){return this._wordWrapWidth},qn.wordWrapWidth.set=function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},Wn.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var r=e.length-1;r>=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&Vn.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Wn.prototype,qn);var Qn=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};Qn.measureText=function(t,e,r,i){void 0===i&&(i=Qn._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=Qn.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?Qn.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;l<a.length;l++){var c=s.measureText(a[l]).width+(a[l].length-1)*e.letterSpacing;h[l]=c,u=Math.max(u,c)}var d=u+e.strokeThickness;e.dropShadow&&(d+=e.dropShadowDistance);var p=e.lineHeight||o.fontSize+e.strokeThickness,f=Math.max(p,o.fontSize+e.strokeThickness)+(a.length-1)*(p+e.leading);return e.dropShadow&&(f+=e.dropShadowDistance),new Qn(t,e,d,f,a,h,p+e.leading,u,o)},Qn.wordWrap=function(t,e,r){void 0===r&&(r=Qn._canvas);for(var i=r.getContext("2d"),n=0,o="",s="",a={},h=e.letterSpacing,u=e.whiteSpace,l=Qn.collapseSpaces(u),c=Qn.collapseNewlines(u),d=!l,p=e.wordWrapWidth+h,f=Qn.tokenize(t),v=0;v<f.length;v++){var g=f[v];if(Qn.isNewline(g)){if(!c){s+=Qn.addLine(o),d=!l,o="",n=0;continue}g=" "}if(l){var m=Qn.isBreakingSpace(g),y=Qn.isBreakingSpace(o[o.length-1]);if(m&&y)continue}var _=Qn.getFromCache(g,h,a,i);if(_>p)if(""!==o&&(s+=Qn.addLine(o),o="",n=0),Qn.canBreakWords(g,e.breakWords))for(var x=g.split(""),b=0;b<x.length;b++){for(var T=x[b],E=1;x[b+E];){var w=x[b+E],S=T[T.length-1];if(Qn.canBreakChars(S,w,g,b,e.breakWords))break;T+=w,E++}b+=T.length-1;var P=Qn.getFromCache(T,h,a,i);P+n>p&&(s+=Qn.addLine(o),d=!1,o="",n=0),o+=T,n+=P}else{o.length>0&&(s+=Qn.addLine(o),o="",n=0);var I=v===f.length-1;s+=Qn.addLine(g,!I),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=Qn.addLine(o),o="",n=0),(o.length>0||!Qn.isBreakingSpace(g)||d)&&(o+=g,n+=_)}return s+=Qn.addLine(o,!1)},Qn.addLine=function(t,e){return void 0===e&&(e=!0),t=Qn.trimRight(t),t=e?t+"\n":t},Qn.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},Qn.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},Qn.collapseNewlines=function(t){return"normal"===t},Qn.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!Qn.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},Qn.isNewline=function(t){return"string"==typeof t&&Qn._newlines.indexOf(t.charCodeAt(0))>=0},Qn.isBreakingSpace=function(t){return"string"==typeof t&&Qn._breakingSpaces.indexOf(t.charCodeAt(0))>=0},Qn.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;i<t.length;i++){var n=t[i];Qn.isBreakingSpace(n)||Qn.isNewline(n)?(""!==r&&(e.push(r),r=""),e.push(n)):r+=n}return""!==r&&e.push(r),e},Qn.canBreakWords=function(t,e){return e},Qn.canBreakChars=function(t,e,r,i,n){return!0},Qn.measureFont=function(t){if(Qn._fonts[t])return Qn._fonts[t];var e={},r=Qn._canvas,i=Qn._context;i.font=t;var n=Qn.METRICS_STRING+Qn.BASELINE_SYMBOL,o=Math.ceil(i.measureText(n).width),s=Math.ceil(i.measureText(Qn.BASELINE_SYMBOL).width),a=2*s;s=s*Qn.BASELINE_MULTIPLIER|0,r.width=o,r.height=a,i.fillStyle="#f00",i.fillRect(0,0,o,a),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(n,0,s);var h=i.getImageData(0,0,o,a).data,u=h.length,l=4*o,c=0,d=0,p=!1;for(c=0;c<s;++c){for(var f=0;f<l;f+=4)if(255!==h[d+f]){p=!0;break}if(p)break;d+=l}for(e.ascent=s-c,d=u-l,p=!1,c=a;c>s;--c){for(var v=0;v<l;v+=4)if(255!==h[d+v]){p=!0;break}if(p)break;d-=l}return e.descent=c-s,e.fontSize=e.ascent+e.descent,Qn._fonts[t]=e,e},Qn.clearMetrics=function(t){void 0===t&&(t=""),t?delete Qn._fonts[t]:Qn._fonts={}};var $n=document.createElement("canvas");$n.width=$n.height=10,Qn._canvas=$n,Qn._context=$n.getContext("2d"),Qn._fonts={},Qn.METRICS_STRING="|ÉqÃ…",Qn.BASELINE_SYMBOL="M",Qn.BASELINE_MULTIPLIER=1.4,Qn._newlines=[10,13],Qn._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var to={texture:!0,children:!1,baseTexture:!0},eo=function(t){function e(e,r,i){(i=i||document.createElement("canvas")).width=3,i.height=3;var n=_r.from(i);n.orig=new Oe,n.trim=new Oe,t.call(this,n),this.canvas=i,this.context=this.canvas.getContext("2d"),this._resolution=m.RESOLUTION,this._autoResolution=!0,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=r,this.localStyleID=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={width:{configurable:!0},height:{configurable:!0},style:{configurable:!0},text:{configurable:!0},resolution:{configurable:!0}};return e.prototype.updateText=function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var r,i,n=this.context,o=Qn.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=o.width,a=o.height,h=o.lines,u=o.lineHeight,l=o.lineWidths,c=o.maxLineWidth,d=o.fontProperties;if(this.canvas.width=Math.ceil((Math.max(1,s)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,a)+2*e.padding)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.strokeStyle=e.stroke,n.lineWidth=e.strokeThickness,n.textBaseline=e.textBaseline,n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit,e.dropShadow){var p=e.dropShadowColor,f=Ft("number"==typeof p?p:Nt(p));n.shadowColor="rgba("+255*f[0]+","+255*f[1]+","+255*f[2]+","+e.dropShadowAlpha+")",n.shadowBlur=e.dropShadowBlur,n.shadowOffsetX=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,n.shadowOffsetY=Math.sin(e.dropShadowAngle)*e.dropShadowDistance}else n.shadowColor=0,n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;n.fillStyle=this._generateFillStyle(e,h);for(var v=0;v<h.length;v++)r=e.strokeThickness/2,i=e.strokeThickness/2+v*u+d.ascent,"right"===e.align?r+=c-l[v]:"center"===e.align&&(r+=(c-l[v])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[v],r+e.padding,i+e.padding,!0),e.fill&&this.drawLetterSpacing(h[v],r+e.padding,i+e.padding);this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,e,r,i){void 0===i&&(i=!1);var n=this._style.letterSpacing;if(0!==n)for(var o=e,s=Array.from?Array.from(t):t.split(""),a=0;a<s.length;++a){var h=s[a];i?this.context.strokeText(h,o,r):this.context.fillText(h,o,r),o+=this.context.measureText(h).width+n}else i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r)},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=$t(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var r=this._texture,i=this._style,n=i.trim?0:i.padding,o=r.baseTexture;r.trim.width=r._frame.width=t.width/this._resolution,r.trim.height=r._frame.height=t.height/this._resolution,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-2*n,r.orig.height=r._frame.height-2*n,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),this.dirty=!1},e.prototype.render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype.render.call(this,e)},e.prototype._renderCanvas=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._renderCanvas.call(this,e)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._onStyleChange=function(){this.dirty=!0},e.prototype._generateFillStyle=function(t,e){if(!Array.isArray(t.fill))return t.fill;var r,i,n,o,s=this.canvas.width/this._resolution,a=this.canvas.height/this._resolution,h=t.fill.slice(),u=t.fillGradientStops.slice();if(!u.length)for(var l=h.length+1,c=1;c<l;++c)u.push(c/l);if(h.unshift(t.fill[0]),u.unshift(0),h.push(t.fill[t.fill.length-1]),u.push(1),t.fillGradientType===Yn.LINEAR_VERTICAL){r=this.context.createLinearGradient(s/2,0,s/2,a),i=(h.length+1)*e.length,n=0;for(var d=0;d<e.length;d++){n+=1;for(var p=0;p<h.length;p++)o="number"==typeof u[p]?u[p]/e.length+d/e.length:n/i,r.addColorStop(o,h[p]),n++}}else{r=this.context.createLinearGradient(0,a/2,s,a/2),i=h.length+1,n=1;for(var f=0;f<h.length;f++)o="number"==typeof u[f]?u[f]:n/i,r.addColorStop(o,h[f]),n++}return r},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},to,e),t.prototype.destroy.call(this,e),this.context=null,this.canvas=null,this._style=null},r.width.get=function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},r.width.set=function(t){this.updateText(!0);var e=Vt(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},r.height.get=function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},r.height.set=function(t){this.updateText(!0);var e=Vt(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},r.style.get=function(){return this._style},r.style.set=function(t){t=t||{},this._style=t instanceof Wn?t:new Wn(t),this.localStyleID=-1,this.dirty=!0},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.resolution.get=function(){return this._resolution},r.resolution.set=function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},Object.defineProperties(e.prototype,r),e}(Hn);m.UPLOADS_PER_FRAME=4;var ro=function(t){this.maxItemsPerFrame=t,this.itemsLeft=0};ro.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},ro.prototype.allowedToUpload=function(){return this.itemsLeft-- >0};var io=function(t){var e=this;this.limiter=new ro(m.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(uo),this.registerFindHook(lo),this.registerFindHook(no),this.registerFindHook(oo),this.registerFindHook(so),this.registerUploadHook(ao),this.registerUploadHook(ho)};function no(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i<t._textures.length;i++)if(t._textures[i]instanceof _r){var n=t._textures[i].baseTexture;-1===e.indexOf(n)&&(e.push(n),r=!0)}return r}function oo(t,e){return t instanceof or&&(-1===e.indexOf(t)&&e.push(t),!0)}function so(t,e){if(t._texture&&t._texture instanceof _r){var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function ao(t,e){return e instanceof eo&&(e.updateText(!0),!0)}function ho(t,e){if(e instanceof Wn){var r=e.toFontString();return Qn.measureFont(r),!0}return!1}function uo(t,e){if(t instanceof eo){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function lo(t,e){return t instanceof Wn&&(-1===e.indexOf(t)&&e.push(t),!0)}io.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,We.system.addOnce(this.tick,this,ze.UTILITY))):e&&e()},io.prototype.tick=function(){setTimeout(this.delayedTick,0)},io.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)We.system.addOnce(this.tick,this,ze.UTILITY);else{this.ticking=!1;var n=this.completes.slice(0);this.completes.length=0;for(var o=0,s=n.length;o<s;o++)n[o]()}},io.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},io.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},io.prototype.add=function(t){for(var e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof ke)for(var i=t.children.length-1;i>=0;i--)this.add(t.children[i]);return this},io.prototype.destroy=function(){this.ticking&&We.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};var co=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(vo),this.registerUploadHook(po),this.registerUploadHook(fo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(io);function po(t,e){return e instanceof or&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function fo(t,e){return e instanceof Xn&&((e.dirty||e.clearDirty||!e._webGL[t.plugins.graphics.CONTEXT_UID])&&t.plugins.graphics.updateGraphics(e),!0)}function vo(t,e){return t instanceof Xn&&(e.push(t),!0)}var go=function(t){this.maxMilliseconds=t,this.frameStart=0};go.prototype.beginFrame=function(){this.frameStart=Date.now()},go.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds};var mo={BasePrepare:io,CountLimiter:ro,Prepare:co,TimeLimiter:go},yo=function t(e){var r=this;e=Object.assign({forceCanvas:!1},e),this.renderer=Vi(e),this.stage=new ke,t._plugins.forEach(function(t){t.init.call(r,e)})},_o={view:{configurable:!0},screen:{configurable:!0}};yo.registerPlugin=function(t){yo._plugins.push(t)},yo.prototype.render=function(){this.renderer.render(this.stage)},_o.view.get=function(){return this.renderer.view},_o.screen.get=function(){return this.renderer.screen},yo.prototype.destroy=function(t){var e=this,r=yo._plugins.slice(0);r.reverse(),r.forEach(function(t){t.destroy.call(e)}),this.stage.destroy(),this.stage=null,this.renderer.destroy(t),this.renderer=null,this._options=null},Object.defineProperties(yo.prototype,_o),yo._plugins=[];var xo=function(){};xo.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){window.removeEventListener("resize",this.resize),this._resizeTo=t,t&&(window.addEventListener("resize",this.resize),this.resize())},get:function(){return this._resizeTo}}),this.resize=function(){e._resizeTo&&(e._resizeTo===window?e.renderer.resize(window.innerWidth,window.innerHeight):e.renderer.resize(e._resizeTo.clientWidth,e._resizeTo.clientHeight))},this._resizeTo=null,this.resizeTo=t.resizeTo||null},xo.destroy=function(){this.resizeTo=null,this.resize=null},yo.registerPlugin(xo);var bo=i(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(e,r,n){void 0===r&&(r=!1),i(this,t),this._fn=e,this._once=r,this._thisArg=n,this._next=this._prev=this._owner=null}return r(t,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),t}();function o(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var s=function(){function t(){i(this,t),this._head=this._tail=void 0}return r(t,[{key:"handlers",value:function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r}},{key:"has",value:function(t){if(!(t instanceof n))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=arguments,e=this._head;if(!e)return!1;for(;e;)e._once&&this.detach(e),e._fn.apply(e._thisArg,t),e=e._next;return!0}},{key:"add",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return o(this,new n(t,!1,e))}},{key:"once",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return o(this,new n(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof n))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return t._owner!==this?this:(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null,this)}},{key:"detachAll",value:function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this}}]),t}();s.MiniSignalBinding=n,e.default=s,t.exports=e.default}),To=(r(bo),function(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=r.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[r.key[o]]=i[o]||"";return n[r.q.name]={},n[r.key[12]].replace(r.q.parser,function(t,e,i){e&&(n[r.q.name][e]=i)}),n}),Eo=i(function(t,e){function r(){}function i(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}e.__esModule=!0,e.eachSeries=function(t,e,r,i){var n=0,o=t.length;!function s(a){a||n===o?r&&r(a):i?setTimeout(function(){e(t[n++],s)},1):e(t[n++],s)}()},e.queue=function(t,e){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var n=0,o={_tasks:[],concurrency:e,saturated:r,unsaturated:r,buffer:e/4,empty:r,drain:r,error:r,started:!1,paused:!1,push:function(t,e){s(t,!1,e)},kill:function(){n=0,o.drain=r,o.started=!1,o._tasks=[]},unshift:function(t,e){s(t,!0,e)},process:function(){for(;!o.paused&&n<o.concurrency&&o._tasks.length;){var e=o._tasks.shift();0===o._tasks.length&&o.empty(),(n+=1)===o.concurrency&&o.saturated(),t(e.data,i(a(e)))}},length:function(){return o._tasks.length},running:function(){return n},idle:function(){return o._tasks.length+n===0},pause:function(){!0!==o.paused&&(o.paused=!0)},resume:function(){if(!1!==o.paused){o.paused=!1;for(var t=1;t<=o.concurrency;t++)o.process()}}};function s(t,e,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(o.started=!0,null==t&&o.idle())setTimeout(function(){return o.drain()},1);else{var n={data:t,callback:"function"==typeof i?i:r};e?o._tasks.unshift(n):o._tasks.push(n),setTimeout(function(){return o.process()},1)}}function a(t){return function(){n-=1,t.callback.apply(t,arguments),null!=arguments[0]&&o.error(arguments[0],t.data),n<=o.concurrency-o.buffer&&o.unsaturated(),o.idle()&&o.drain(),o.process()}}return o}}),wo=(r(Eo),Eo.eachSeries,Eo.queue,i(function(t,e){e.__esModule=!0,e.Resource=void 0;var r=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),i=o(To),n=o(bo);function o(t){return t&&t.__esModule?t:{default:t}}var s=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),a=null;function h(){}var u=e.Resource=function(){function t(e,r,i){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"string"!=typeof e||"string"!=typeof r)throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===r.indexOf("data:")),this.name=e,this.url=r,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===i.crossOrigin?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=h,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new n.default,this.onProgress=new n.default,this.onComplete=new n.default,this.onAfterMiddleware=new n.default}return t.setExtensionLoadType=function(e,r){l(t._loadTypeMap,e,r)},t.setExtensionXhrType=function(e,r){l(t._xhrTypeMap,e,r)},t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(e){var r=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(r)},1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:s&&this.crossOrigin?this._loadXdr():this._loadXhr()}},t.prototype._hasFlag=function(t){return 0!=(this._flags&t)},t.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{var i=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(i)?i[0]:i))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},t.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},t.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},t.prototype._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=r,i},t.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},t.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var t=this.xhr;this.abort(c(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},t.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(c(t)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(c(t)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var e=this.xhr,r="",i=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(r=e.responseText),0===i&&(r.length>0||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(window.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(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&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(){var t=this.url,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"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u})),So=(r(wo),wo.Resource,i(function(t,e){e.__esModule=!0,e.Loader=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),n=a(bo),o=a(To),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(Eo);function a(t){return t&&t.__esModule?t:{default:t}}var h=/(#[\w-]+)?$/,u=e.Loader=function(){function t(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.baseUrl=r,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,r){return e._loadResource(t,r)},this._queue=s.queue(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new n.default,this.onError=new n.default,this.onLoad=new n.default,this.onStart=new n.default,this.onComplete=new n.default;for(var o=0;o<t._defaultBeforeMiddleware.length;++o)this.pre(t._defaultBeforeMiddleware[o]);for(var a=0;a<t._defaultAfterMiddleware.length;++a)this.use(t._defaultAfterMiddleware[a])}return t.prototype.add=function(t,e,i,n){if(Array.isArray(t)){for(var o=0;o<t.length;++o)this.add(t[o]);return this}if("object"===(void 0===t?"undefined":r(t))&&(n=e||t.callback||t.onComplete,i=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(n=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof i&&(n=i,i=null),this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new wo.Resource(t,e,i),"function"==typeof n&&this.resources[t].onAfterMiddleware.once(n),this.loading){for(var s=i.parentResource,a=[],h=0;h<s.children.length;++h)s.children[h].isComplete||a.push(s.children[h]);var u=s.progressChunk*(a.length+1)/(a.length+2);s.children.push(this.resources[t]),s.progressChunk=u;for(var l=0;l<a.length;++l)a[l].progressChunk=u;this.resources[t].progressChunk=u}return this._queue.push(this.resources[t]),this},t.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},t.prototype.use=function(t){return this._afterMiddleware.push(t),this},t.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort()}return this.resources={},this},t.prototype.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},t.prototype._prepareUrl=function(t){var e=(0,o.default)(t,{strictMode:!0}),r=void 0;if(r=e.protocol||!e.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var i=h.exec(r)[0];-1!==(r=r.substr(0,r.length-i.length)).indexOf("?")?r+="&"+this.defaultQueryString:r+="?"+this.defaultQueryString,r+=i}return r},t.prototype._loadResource=function(t,e){var r=this;t._dequeue=e,s.eachSeries(this._beforeMiddleware,function(e,i){e.call(r,t,function(){i(t.isComplete?{}:null)})},function(){t.isComplete?r._onLoad(t):(t._onLoadBinding=t.onComplete.once(r._onLoad,r),t.load())},!0)},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),s.eachSeries(this._afterMiddleware,function(r,i){r.call(e,t,i)},function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()},!0)},i(t,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t}}]),t}();u._defaultBeforeMiddleware=[],u._defaultAfterMiddleware=[],u.pre=function(t){return u._defaultBeforeMiddleware.push(t),u},u.use=function(t){return u._defaultAfterMiddleware.push(t),u}})),Po=(r(So),So.Loader,i(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i<t.length;){for(var n=[0,0,0],o=[0,0,0,0],s=0;s<n.length;++s)i<t.length?n[s]=255&t.charCodeAt(i++):n[s]=0;switch(o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a<o.length;++a)e+=r.charAt(o[a])}return e}t.exports.default=i})),Io=(r(Po),Po.encodeBinary,So.Loader),Ao=wo.Resource;Io.Resource=Ao,Io.async=Eo,Io.encodeBinary=Po,Io.base64=Po;var Oo=Io,Co=Io,Mo=Io,Do=Oo.Resource;function Ro(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Fo(t,e){return t(e={exports:{}},e.exports),e.exports}Oo.Loader=Co,Oo.default=Mo;var Lo=function(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=r.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[r.key[o]]=i[o]||"";return n[r.q.name]={},n[r.key[12]].replace(r.q.parser,function(t,e,i){e&&(n[r.q.name][e]=i)}),n},No=Fo(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}();function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(e,r,n){void 0===r&&(r=!1),i(this,t),this._fn=e,this._once=r,this._thisArg=n,this._next=this._prev=this._owner=null}return r(t,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),t}();function o(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var s=function(){function t(){i(this,t),this._head=this._tail=void 0}return r(t,[{key:"handlers",value:function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r}},{key:"has",value:function(t){if(!(t instanceof n))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=arguments,e=this._head;if(!e)return!1;for(;e;)e._once&&this.detach(e),e._fn.apply(e._thisArg,t),e=e._next;return!0}},{key:"add",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return o(this,new n(t,!1,e))}},{key:"once",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return o(this,new n(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof n))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return t._owner!==this?this:(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null,this)}},{key:"detachAll",value:function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this}}]),t}();s.MiniSignalBinding=n,e.default=s,t.exports=e.default});Ro(No);var Uo=Fo(function(t,e){e.__esModule=!0,e.Resource=void 0;var r=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),i=o(Lo),n=o(No);function o(t){return t&&t.__esModule?t:{default:t}}var s=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),a=null;function h(){}var u=e.Resource=function(){function t(e,r,i){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"string"!=typeof e||"string"!=typeof r)throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===r.indexOf("data:")),this.name=e,this.url=r,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===i.crossOrigin?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=h,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new n.default,this.onProgress=new n.default,this.onComplete=new n.default,this.onAfterMiddleware=new n.default}return t.setExtensionLoadType=function(e,r){l(t._loadTypeMap,e,r)},t.setExtensionXhrType=function(e,r){l(t._xhrTypeMap,e,r)},t.prototype.complete=function(){this._clearEvents(),this._finish()},t.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},t.prototype.load=function(e){var r=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(r)},1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:s&&this.crossOrigin?this._loadXdr():this._loadXhr()}},t.prototype._hasFlag=function(t){return 0!=(this._flags&t)},t.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},t.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},t.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},t.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},t.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{var i=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(i)?i[0]:i))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},t.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},t.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},t.prototype._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=r,i},t.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},t.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},t.prototype._onTimeout=function(){this.abort("Load timed out.")},t.prototype._xhrOnError=function(){var t=this.xhr;this.abort(c(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},t.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(c(t)+" Request timed out.")},t.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(c(t)+" Request was aborted by the user.")},t.prototype._xhrOnLoad=function(){var e=this.xhr,r="",i=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(r=e.responseText),0===i&&(r.length>0||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(window.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(window.origin!==window.location.origin)return"anonymous";e=e||window.location,a||(a=document.createElement("a")),a.href=t;var r=!(t=(0,i.default)(a.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&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(){var t=this.url,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"}},r(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function l(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function c(t){return t.toString().replace("object ","")}u.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},u.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},u.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},u.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},u._loadTypeMap={gif:u.LOAD_TYPE.IMAGE,png:u.LOAD_TYPE.IMAGE,bmp:u.LOAD_TYPE.IMAGE,jpg:u.LOAD_TYPE.IMAGE,jpeg:u.LOAD_TYPE.IMAGE,tif:u.LOAD_TYPE.IMAGE,tiff:u.LOAD_TYPE.IMAGE,webp:u.LOAD_TYPE.IMAGE,tga:u.LOAD_TYPE.IMAGE,svg:u.LOAD_TYPE.IMAGE,"svg+xml":u.LOAD_TYPE.IMAGE,mp3:u.LOAD_TYPE.AUDIO,ogg:u.LOAD_TYPE.AUDIO,wav:u.LOAD_TYPE.AUDIO,mp4:u.LOAD_TYPE.VIDEO,webm:u.LOAD_TYPE.VIDEO},u._xhrTypeMap={xhtml:u.XHR_RESPONSE_TYPE.DOCUMENT,html:u.XHR_RESPONSE_TYPE.DOCUMENT,htm:u.XHR_RESPONSE_TYPE.DOCUMENT,xml:u.XHR_RESPONSE_TYPE.DOCUMENT,tmx:u.XHR_RESPONSE_TYPE.DOCUMENT,svg:u.XHR_RESPONSE_TYPE.DOCUMENT,tsx:u.XHR_RESPONSE_TYPE.DOCUMENT,gif:u.XHR_RESPONSE_TYPE.BLOB,png:u.XHR_RESPONSE_TYPE.BLOB,bmp:u.XHR_RESPONSE_TYPE.BLOB,jpg:u.XHR_RESPONSE_TYPE.BLOB,jpeg:u.XHR_RESPONSE_TYPE.BLOB,tif:u.XHR_RESPONSE_TYPE.BLOB,tiff:u.XHR_RESPONSE_TYPE.BLOB,webp:u.XHR_RESPONSE_TYPE.BLOB,tga:u.XHR_RESPONSE_TYPE.BLOB,json:u.XHR_RESPONSE_TYPE.JSON,text:u.XHR_RESPONSE_TYPE.TEXT,txt:u.XHR_RESPONSE_TYPE.TEXT,ttf:u.XHR_RESPONSE_TYPE.BUFFER,otf:u.XHR_RESPONSE_TYPE.BUFFER},u.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",t.exports.default=u});Ro(Uo);Uo.Resource;var Bo=Fo(function(t,e){e.__esModule=!0,e.encodeBinary=i;var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",i=0;i<t.length;){for(var n=[0,0,0],o=[0,0,0,0],s=0;s<n.length;++s)i<t.length?n[s]=255&t.charCodeAt(i++):n[s]=0;switch(o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],i-(t.length-1)){case 2:o[3]=64,o[2]=64;break;case 1:o[3]=64}for(var a=0;a<o.length;++a)e+=r.charAt(o[a])}return e}t.exports.default=i});Ro(Bo);Bo.encodeBinary;var ko=Fo(function(t,e){e.__esModule=!0,e.blobMiddlewareFactory=function(){return function(t,e){if(t.data){if(t.xhr&&t.xhrType===Uo.Resource.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=r.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=Uo.Resource.TYPE.IMAGE,void(t.data.onload=function(){r.revokeObjectURL(i),t.data.onload=null,e()})}}else{var n=t.xhr.getResponseHeader("content-type");if(n&&0===n.indexOf("image"))return t.data=new Image,t.data.src="data:"+n+";base64,"+(0,Bo.encodeBinary)(t.xhr.responseText),t.type=Uo.Resource.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}};var r=window.URL||window.webkitURL});Ro(ko);var Xo=ko.blobMiddlewareFactory,jo=function(){};jo.use=function(t,e){t.data&&t.type===Do.TYPE.IMAGE&&(t.texture=_r.fromLoader(t.data,t.url,t.name)),e()};var Go=function(t){function e(r,i){var n=this;t.call(this,r,i),y.call(this);for(var o=0;o<e._plugins.length;++o){var s=e._plugins[o],a=s.pre,h=s.use;a&&this.pre(a),h&&this.use(h)}this.onStart.add(function(t){return n.emit("start",t)}),this.onProgress.add(function(t,e){return n.emit("progress",t,e)}),this.onError.add(function(t,e,r){return n.emit("error",t,e,r)}),this.onLoad.add(function(t,e){return n.emit("load",t,e)}),this.onComplete.add(function(t,e){return n.emit("complete",t,e)}),this._protected=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={shared:{configurable:!0}};return e.prototype.destroy=function(){this._protected||(this.removeAllListeners(),this.reset())},r.shared.get=function(){var t=e._shared;return t||((t=new e)._protected=!0,e._shared=t),t},Object.defineProperties(e,r),e}(Oo);Object.assign(Go.prototype,y.prototype),Go._plugins=[],Go.registerPlugin=function(t){return Go._plugins.push(t),t.add&&t.add(),Go},Go.registerPlugin({use:Xo()}),Go.registerPlugin(jo);var Ho=function(){};Ho.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Go.shared:new Go},Ho.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)};var Yo=Do,zo=function(t){function e(e,r,i,n){void 0===e&&(e=1500),void 0===i&&(i=16384),void 0===n&&(n=!1),t.call(this);i>16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=_t.NORMAL,this.autoResize=n,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0}};return e.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])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},r.tint.get=function(){return this._tint},r.tint.set=function(t){this._tint=t,Ft(t,this.tintRgb)},e.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))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(e.prototype,r),e}(ke),Vo=function(t,e,r){this.geometry=new Cr,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<t.length;++i){var n=t[i];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||Et.FLOAT,offset:n.offset},e[i]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};Vo.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new wr(Gt(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var r=0;r<this.dynamicProperties.length;++r){var i=this.dynamicProperties[r];i.offset=e,e+=i.size,this.dynamicStride+=i.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new wr(this.dynamicData,!1,!1);var o=0;this.staticStride=0;for(var s=0;s<this.staticProperties.length;++s){var a=this.staticProperties[s];a.offset=o,o+=a.size,this.staticStride+=a.size}var h=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(h),this.staticDataUint32=new Uint32Array(h),this.staticBuffer=new wr(this.staticData,!0,!1);for(var u=0;u<this.dynamicProperties.length;++u){var l=this.dynamicProperties[u];t.addAttribute(l.attributeName,this.dynamicBuffer,0,l.type===Et.UNSIGNED_BYTE,l.type,4*this.dynamicStride,4*l.offset)}for(var c=0;c<this.staticProperties.length;++c){var d=this.staticProperties[c];t.addAttribute(d.attributeName,this.staticBuffer,0,d.type===Et.UNSIGNED_BYTE,d.type,4*this.staticStride,4*d.offset)}},Vo.prototype.uploadDynamic=function(t,e,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(t,e,r,n.type===Et.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},Vo.prototype.uploadStatic=function(t,e,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(t,e,r,n.type===Et.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},Vo.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var Wo="attribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\nattribute vec4 aColor;\r\n\r\nattribute vec2 aPositionCoord;\r\nattribute float aRotation;\r\n\r\nuniform mat3 translationMatrix;\r\nuniform vec4 uColor;\r\n\r\nvarying vec2 vTextureCoord;\r\nvarying vec4 vColor;\r\n\r\nvoid main(void){\r\n    float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\r\n    float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\r\n\r\n    vec2 v = vec2(x, y);\r\n    v = v + aPositionCoord;\r\n\r\n    gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = aTextureCoord;\r\n    vColor = aColor * uColor;\r\n}\r\n",qo="varying vec2 vTextureCoord;\r\nvarying vec4 vColor;\r\n\r\nuniform sampler2D uSampler;\r\n\r\nvoid main(void){\r\n    vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\r\n    gl_FragColor = color;\r\n}",Zo=function(t){function e(e){t.call(this,e),this.shader=null,this.properties=null,this.tempMatrix=new me,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:Et.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=fi.from(Wo,qo,{})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t){var e=t.children,r=t._maxSize,i=t._batchSize,n=this.renderer,o=e.length;if(0!==o){o>r&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(Bt(t.blendMode,a.premultiplyAlpha));var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=kt(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultiplyAlpha),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;c<o;c+=i,d+=1){var p=o-c;p>i&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var v=t._bufferUpdateIDs[d]||0;(l=l||f._updateID<v)&&(f._updateID=t._updateID,f.uploadStatic(e,c,p)),n.geometry.bind(f.geometry),h.drawElements(h.TRIANGLES,6*p,h.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],r=t._maxSize,i=t._batchSize,n=t._properties,o=0;o<r;o+=i)e.push(new Vo(this.properties,n,i));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,r=t._properties;return new Vo(this.properties,r,e)},e.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s=0,a=0,h=0,u=0,l=0;l<r;++l){var c=t[e+l],d=c._texture,p=c.scale.x,f=c.scale.y,v=d.trim,g=d.orig;v?(s=(a=v.x-c.anchor.x*g.width)+v.width,h=(u=v.y-c.anchor.y*g.height)+v.height):(s=g.width*(1-c.anchor.x),a=g.width*-c.anchor.x,h=g.height*(1-c.anchor.y),u=g.height*-c.anchor.y),i[o]=a*p,i[o+1]=u*f,i[o+n]=s*p,i[o+n+1]=u*f,i[o+2*n]=s*p,i[o+2*n+1]=h*f,i[o+3*n]=a*p,i[o+3*n+1]=h*f,o+=4*n}},e.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},e.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},e.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},e.prototype.uploadTint=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s],h=a._texture.baseTexture.premultiplyAlpha,u=a.alpha,l=u<1&&h?Xt(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}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(Ur),Ko=function(t,e,r){void 0===r&&(r=null),this.baseTexture=t,this.textures={},this.animations={},this.data=e,this.resolution=this._updateResolution(r||(this.baseTexture.resource?this.baseTexture.resource.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null},Jo={BATCH_SIZE:{configurable:!0}};Jo.BATCH_SIZE.get=function(){return 1e3},Ko.prototype._updateResolution=function(t){var e=this.data.meta.scale,r=se(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&this.baseTexture.setResolution(r),r},Ko.prototype.parse=function(t){this._batchIndex=0,this._callback=t,this._frameKeys.length<=Ko.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},Ko.prototype._processFrames=function(t){for(var e=t,r=Ko.BATCH_SIZE;e-t<r&&e<this._frameKeys.length;){var i=this._frameKeys[e],n=this._frames[i],o=n.frame;if(o){var s=null,a=null,h=!1!==n.trimmed&&n.sourceSize?n.sourceSize:n.frame,u=new Oe(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution);s=n.rotated?new Oe(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):new Oe(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),!1!==n.trimmed&&n.spriteSourceSize&&(a=new Oe(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[i]=new _r(this.baseTexture,s,u,a,n.rotated?2:0,n.anchor),_r.addToCache(this.textures[i],i)}e++}},Ko.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var r=0;r<t[e].length;r++){var i=t[e][r];this.animations[e].push(this.textures[i])}}},Ko.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},Ko.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*Ko.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*Ko.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())},0)},Ko.prototype.destroy=function(t){for(var e in void 0===t&&(t=!1),this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&this.baseTexture.destroy(),this.baseTexture=null},Object.defineProperties(Ko,Jo);var Qo=function(){};Qo.use=function(t,e){var r=t.name+"_image";if(t.data&&t.type===Yo.TYPE.JSON&&t.data.frames&&!this.resources[r]){var i={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},n=Qo.getResourcePath(t,this.baseUrl);this.add(r,n,i,function(r){if(r.error)e(r.error);else{var i=new Ko(r.texture.baseTexture,t.data,t.url);i.parse(function(){t.spritesheet=i,t.textures=i.textures,e()})}})}else e()},Qo.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:gt.resolve(t.url.replace(e,""),t.data.meta.image)};var $o=new le,ts=function(t){function e(e,r,i){void 0===r&&(r=100),void 0===i&&(i=100),t.call(this,e),this.tileTransform=new Ie,this._width=r,this._height=i,this._canvasPattern=null,this.uvMatrix=e.uvMatrix||new Ti(e),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={clampMargin:{configurable:!0},tileScale:{configurable:!0},tilePosition:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return r.clampMargin.get=function(){return this.uvMatrix.clampMargin},r.clampMargin.set=function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},r.tileScale.get=function(){return this.tileTransform.scale},r.tileScale.set=function(t){this.tileTransform.scale.copyFrom(t)},r.tilePosition.get=function(){return this.tileTransform.position},r.tilePosition.set=function(t){this.tileTransform.position.copyFrom(t)},e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this.cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new Oe),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,$o);var e=this._width,r=this._height,i=-e*this.anchor._x;if($o.x>=i&&$o.x<i+e){var n=-r*this.anchor._y;if($o.y>=n&&$o.y<n+r)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,r,i){return new e(_r.from(t),r,i)},e.fromFrame=function(t,r,i){var n=Jt[t];if(!n)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new e(n,r,i)},e.fromImage=function(t,r,i,n){return n&&"object"!=typeof n&&(n={scaleMode:arguments[4],resourceOptions:{crossorigin:arguments[3]}}),new e(_r.from(t,n),r,i)},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t},Object.defineProperties(e.prototype,r),e}(Hn),es="attribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTransform;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n",rs="varying vec2 vTextureCoord;\r\n\r\nuniform sampler2D uSampler;\r\nuniform vec4 uColor;\r\nuniform mat3 uMapCoord;\r\nuniform vec4 uClampFrame;\r\nuniform vec2 uClampOffset;\r\n\r\nvoid main(void)\r\n{\r\n    vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\r\n    coord = (uMapCoord * vec3(coord, 1.0)).xy;\r\n    coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\r\n\r\n    vec4 sample = texture2D(uSampler, coord);\r\n    gl_FragColor = sample * uColor;\r\n}\r\n",is="varying vec2 vTextureCoord;\r\n\r\nuniform sampler2D uSampler;\r\nuniform vec4 uColor;\r\n\r\nvoid main(void)\r\n{\r\n    vec4 sample = texture2D(uSampler, vTextureCoord);\r\n    gl_FragColor = sample * uColor;\r\n}\r\n",ns=new me,os=function(t){function e(e){t.call(this,e);var r={globals:this.renderer.globalUniforms};this.shader=fi.from(es,rs,r),this.simpleShader=fi.from(es,is,r),this.quad=new Dr}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(t){var e=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((i=r.uvs)[0]=i[6]=-t.anchor.x,i[1]=i[3]=-t.anchor.y,i[2]=i[4]=1-t.anchor.x,i[5]=i[7]=1-t.anchor.y),r.invalidate();var n=t._texture,o=n.baseTexture,s=t.tileTransform.localTransform,a=t.uvMatrix,h=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;h&&(o._glTextures[e.CONTEXT_UID]?h=o.wrapMode!==St.CLAMP:o.wrapMode===St.CLAMP&&(o.wrapMode=St.REPEAT));var u=h?this.simpleShader:this.shader,l=n.width,c=n.height,d=t._width,p=t._height;ns.set(s.a*l/d,s.b*l/p,s.c*c/d,s.d*c/p,s.tx/d,s.ty/p),ns.invert(),h?ns.prepend(a.mapCoord):(u.uniforms.uMapCoord=a.mapCoord.toArray(!0),u.uniforms.uClampFrame=a.uClampFrame,u.uniforms.uClampOffset=a.uClampOffset),u.uniforms.uTransform=ns.toArray(!0),u.uniforms.uColor=jt(t.tint,t.worldAlpha,u.uniforms.uColor,o.premultiplyAlpha),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.uSampler=n,e.shader.bind(u),e.geometry.bind(r),e.state.setBlendMode(Bt(t.blendMode,o.premultiplyAlpha)),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(Ur),ss=function(t){function e(e,r){var i=this;void 0===r&&(r={}),t.call(this),this._textWidth=0,this._textHeight=0,this._glyphs=[],this._font={tint:void 0!==r.tint?r.tint:16777215,align:r.align||"left",name:null,size:0},this.font=r.font,this._text=e,this._maxWidth=0,this._maxLineHeight=0,this._letterSpacing=0,this._anchor=new ce(function(){i.dirty=!0},this,0,0),this.dirty=!1,this.roundPixels=m.ROUND_PIXELS,this.updateText()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={tint:{configurable:!0},align:{configurable:!0},anchor:{configurable:!0},font:{configurable:!0},text:{configurable:!0},maxWidth:{configurable:!0},maxLineHeight:{configurable:!0},textWidth:{configurable:!0},letterSpacing:{configurable:!0},textHeight:{configurable:!0}};return e.prototype.updateText=function(){for(var t=e.fonts[this._font.name],r=this._font.size/t.size,i=new le,n=[],o=[],s=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",a=s.length,h=this._maxWidth*t.size/this._font.size,u=null,l=0,c=0,d=0,p=-1,f=0,v=0,g=0,m=0;m<a;m++){var y=s.charCodeAt(m),_=s.charAt(m);if(/(?:\s)/.test(_)&&(p=m,f=l),"\r"!==_&&"\n"!==_){var x=t.chars[y];x&&(u&&x.kerning[u]&&(i.x+=x.kerning[u]),n.push({texture:x.texture,line:d,charCode:y,position:new le(i.x+x.xOffset+this._letterSpacing/2,i.y+x.yOffset)}),i.x+=x.xAdvance+this._letterSpacing,l=i.x,g=Math.max(g,x.yOffset+x.texture.height),u=y,-1!==p&&h>0&&i.x>h&&(Ht(n,1+p-++v,1+m-p),m=p,p=-1,o.push(f),c=Math.max(c,f),d++,i.x=0,i.y+=t.lineHeight,u=null))}else o.push(l),c=Math.max(c,l),++d,++v,i.x=0,i.y+=t.lineHeight,u=null}var b=s.charAt(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=Math.max(c,l));for(var T=[],E=0;E<=d;E++){var w=0;"right"===this._font.align?w=c-o[E]:"center"===this._font.align&&(w=(c-o[E])/2),T.push(w)}for(var S=n.length,P=this.tint,I=0;I<S;I++){var A=this._glyphs[I];A?A.texture=n[I].texture:((A=new Hn(n[I].texture)).roundPixels=this.roundPixels,this._glyphs.push(A)),A.position.x=(n[I].position.x+T[n[I].line])*r,A.position.y=n[I].position.y*r,A.scale.x=A.scale.y=r,A.tint=P,A.parent||this.addChild(A)}for(var O=S;O<this._glyphs.length;++O)this.removeChild(this._glyphs[O]);if(this._textWidth=c*r,this._textHeight=(i.y+t.lineHeight)*r,0!==this.anchor.x||0!==this.anchor.y)for(var C=0;C<S;C++)this._glyphs[C].x-=this._textWidth*this.anchor.x,this._glyphs[C].y-=this._textHeight*this.anchor.y;this._maxLineHeight=g*r},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},r.tint.get=function(){return this._font.tint},r.tint.set=function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxWidth.get=function(){return this._maxWidth},r.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},r.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},r.textWidth.get=function(){return this.validate(),this._textWidth},r.letterSpacing.get=function(){return this._letterSpacing},r.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},r.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,r){var i={},n=t.getElementsByTagName("info")[0],o=t.getElementsByTagName("common")[0],s=t.getElementsByTagName("page"),a=se(s[0].getAttribute("file"),m.RESOLUTION),h={};i.font=n.getAttribute("face"),i.size=parseInt(n.getAttribute("size"),10),i.lineHeight=parseInt(o.getAttribute("lineHeight"),10)/a,i.chars={},r instanceof _r&&(r=[r]);for(var u=0;u<s.length;u++){var l=s[u].getAttribute("id"),c=s[u].getAttribute("file");h[l]=r instanceof Array?r[u]:r[c]}for(var d=t.getElementsByTagName("char"),p=0;p<d.length;p++){var f=d[p],v=parseInt(f.getAttribute("id"),10),g=f.getAttribute("page")||0,y=new Oe(parseInt(f.getAttribute("x"),10)/a+h[g].frame.x/a,parseInt(f.getAttribute("y"),10)/a+h[g].frame.y/a,parseInt(f.getAttribute("width"),10)/a,parseInt(f.getAttribute("height"),10)/a);i.chars[v]={xOffset:parseInt(f.getAttribute("xoffset"),10)/a,yOffset:parseInt(f.getAttribute("yoffset"),10)/a,xAdvance:parseInt(f.getAttribute("xadvance"),10)/a,kerning:{},texture:new _r(h[g].baseTexture,y),page:g}}for(var _=t.getElementsByTagName("kerning"),x=0;x<_.length;x++){var b=_[x],T=parseInt(b.getAttribute("first"),10)/a,E=parseInt(b.getAttribute("second"),10)/a,w=parseInt(b.getAttribute("amount"),10)/a;i.chars[E]&&(i.chars[E].kerning[T]=w)}return e.fonts[i.font]=i,i},Object.defineProperties(e.prototype,r),e}(ke);ss.fonts={};var as=function(){};as.parse=function(t,e){t.bitmapFont=ss.registerFont(t.data,e)},as.add=function(){Yo.setExtensionXhrType("fnt",Yo.XHR_RESPONSE_TYPE.DOCUMENT)},as.dirname=function(t){var e=t.replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},as.use=function(t,e){if(t.data&&t.type===Yo.TYPE.XML)if(0!==t.data.getElementsByTagName("page").length&&0!==t.data.getElementsByTagName("info").length&&null!==t.data.getElementsByTagName("info")[0].getAttribute("face")){var r=t.isDataUrl?"":as.dirname(t.url);t.isDataUrl&&("."===r&&(r=""),this.baseUrl&&r&&"/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(r+="/")),(r=r.replace(this.baseUrl,""))&&"/"!==r.charAt(r.length-1)&&(r+="/");for(var i=t.data.getElementsByTagName("page"),n={},o=function(r){n[r.metadata.pageFile]=r.texture,Object.keys(n).length===i.length&&(as.parse(t,n),e())},s=0;s<i.length;++s){var a=i[s].getAttribute("file"),h=r+a,u=!1;for(var l in this.resources){var c=this.resources[l];if(c.url===h){c.metadata.pageFile=a,c.texture?o(c):c.onAfterMiddleware.add(o),u=!0;break}}if(!u){var d={crossOrigin:t.crossOrigin,loadType:Yo.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:a},t.metadata.imageMetadata),parentResource:t};this.add(h,d,o)}}}else e();else e()};var hs="varying vec2 vTextureCoord;\r\n\r\nuniform sampler2D uSampler;\r\nuniform float uAlpha;\r\n\r\nvoid main(void)\r\n{\r\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\r\n}\r\n",us=function(t){function e(e){void 0===e&&(e=1),t.call(this,Wi,hs,{uAlpha:1}),this.alpha=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={alpha:{configurable:!0}};return r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi),ls="\n    attribute vec2 aVertexPosition;\n\n    uniform mat3 projectionMatrix;\n\n    uniform float strength;\n\n    varying vec2 vBlurTexCoords[%size%];\n\n    uniform vec4 inputSize;\n    uniform vec4 outputFrame;\n    \n    vec4 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    \n    vec2 filterTextureCoord( void )\n    {\n        return aVertexPosition * (outputFrame.zw * inputSize.zw);\n    }\n\n    void main(void)\n    {\n        gl_Position = filterVertexPosition();\n\n        vec2 textureCoord = filterTextureCoord();\n        %blur%\n    }";var cs={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},ds=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");var ps=function(t){function e(e,r,i,n,o){var s=function(t,e){var r,i=Math.ceil(t/2),n=ls,o="";r=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var a=r.replace("%index%",s);o+=a=a.replace("%sampleIndex%",s-(i-1)+".0"),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o=o||5,e),a=function(t){for(var e,r=cs[t],i=r.length,n=ds,o="",s=0;s<t;s++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s);e=s,s>=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.RESOLUTION,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return 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,!1);for(var h=1;h<this.passes-1;h++){o.renderTexture.bind(s,s.filterFrame),this.uniforms.uSampler=a;var u=a;a=s,s=u,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,r,i),t.returnFilterTexture(n)}},r.blur.get=function(){return this.strength},r.blur.set=function(t){this.padding=1+2*Math.abs(t),this.strength=t},r.quality.get=function(){return this._quality},r.quality.set=function(t){this._quality=t,this.passes=t},Object.defineProperties(e.prototype,r),e}(yi),fs=function(t){function e(e,r,i,n){t.call(this),this.blurXFilter=new ps(!0,e,r,i,n),this.blurYFilter=new ps(!1,e,r,i,n),this.resolution=i||m.RESOLUTION,this.quality=r||4,this.blur=e||8,this.repeatEdgePixels=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0},blendMode:{configurable:!0},repeatEdgePixels:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){var n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){var s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,!0),this.blurYFilter.apply(t,s,r,i),t.returnFilterTexture(s)}else o?this.blurYFilter.apply(t,e,r,i):this.blurXFilter.apply(t,e,r,i)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},r.blur.get=function(){return this.blurXFilter.blur},r.blur.set=function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},r.quality.get=function(){return this.blurXFilter.quality},r.quality.set=function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},r.blurX.get=function(){return this.blurXFilter.blur},r.blurX.set=function(t){this.blurXFilter.blur=t,this.updatePadding()},r.blurY.get=function(){return this.blurYFilter.blur},r.blurY.set=function(t){this.blurYFilter.blur=t,this.updatePadding()},r.blendMode.get=function(){return this.blurYFilter.blendMode},r.blendMode.set=function(t){this.blurYFilter.blendMode=t},r.repeatEdgePixels.get=function(){return this._repeatEdgePixels},r.repeatEdgePixels.set=function(t){this._repeatEdgePixels=t,this.updatePadding()},Object.defineProperties(e.prototype,r),e}(yi),vs="varying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\nuniform float m[20];\r\nuniform float uAlpha;\r\n\r\nvoid main(void)\r\n{\r\n    vec4 c = texture2D(uSampler, vTextureCoord);\r\n\r\n    if (uAlpha == 0.0) {\r\n        gl_FragColor = c;\r\n        return;\r\n    }\r\n\r\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\r\n    if (c.a > 0.0) {\r\n      c.rgb /= c.a;\r\n    }\r\n\r\n    vec4 result;\r\n\r\n    result.r = (m[0] * c.r);\r\n        result.r += (m[1] * c.g);\r\n        result.r += (m[2] * c.b);\r\n        result.r += (m[3] * c.a);\r\n        result.r += m[4];\r\n\r\n    result.g = (m[5] * c.r);\r\n        result.g += (m[6] * c.g);\r\n        result.g += (m[7] * c.b);\r\n        result.g += (m[8] * c.a);\r\n        result.g += m[9];\r\n\r\n    result.b = (m[10] * c.r);\r\n       result.b += (m[11] * c.g);\r\n       result.b += (m[12] * c.b);\r\n       result.b += (m[13] * c.a);\r\n       result.b += m[14];\r\n\r\n    result.a = (m[15] * c.r);\r\n       result.a += (m[16] * c.g);\r\n       result.a += (m[17] * c.b);\r\n       result.a += (m[18] * c.a);\r\n       result.a += m[19];\r\n\r\n    vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\r\n\r\n    // Premultiply alpha again.\r\n    rgb *= result.a;\r\n\r\n    gl_FragColor = vec4(rgb, result.a);\r\n}\r\n",gs=function(t){function e(){var e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};t.call(this,qi,vs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return 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.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)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.uAlpha},r.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,r),e}(yi);gs.prototype.grayscale=gs.prototype.greyscale;var ms="attribute vec2 aVertexPosition;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 filterMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\nvarying vec2 vFilterCoord;\r\n\r\nuniform vec4 inputSize;\r\nuniform vec4 outputFrame;\r\n\r\nvec4 filterVertexPosition( void )\r\n{\r\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\r\n\r\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\r\n}\r\n\r\nvec2 filterTextureCoord( void )\r\n{\r\n    return aVertexPosition * (outputFrame.zw * inputSize.zw);\r\n}\r\n\r\nvoid main(void)\r\n{\r\n\tgl_Position = filterVertexPosition();\r\n\tvTextureCoord = filterTextureCoord();\r\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0)  ).xy;\r\n}\r\n",ys="varying vec2 vFilterCoord;\r\nvarying vec2 vTextureCoord;\r\n\r\nuniform vec2 scale;\r\nuniform mat2 rotation;\r\nuniform sampler2D uSampler;\r\nuniform sampler2D mapSampler;\r\n\r\nuniform highp vec4 inputSize;\r\nuniform vec4 inputClamp;\r\n\r\nvoid main(void)\r\n{\r\n  vec4 map =  texture2D(mapSampler, vFilterCoord);\r\n\r\n  map -= 0.5;\r\n  map.xy = scale * inputSize.zw * (rotation * map.xy);\r\n\r\n  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\r\n}\r\n",_s=function(t){function e(e,r){var i=new me;e.renderable=!1,t.call(this,ms,ys,{mapSampler:e._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=i,null==r&&(r=20),this.scale=new le(r,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return 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.transform.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)},r.map.get=function(){return this.uniforms.mapSampler},r.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(e.prototype,r),e}(yi),xs="\r\nattribute vec2 aVertexPosition;\r\n\r\nuniform mat3 projectionMatrix;\r\n\r\nvarying vec2 v_rgbNW;\r\nvarying vec2 v_rgbNE;\r\nvarying vec2 v_rgbSW;\r\nvarying vec2 v_rgbSE;\r\nvarying vec2 v_rgbM;\r\n\r\nvarying vec2 vFragCoord;\r\n\r\nuniform vec4 inputPixel;\r\nuniform vec4 outputFrame;\r\n\r\nvec4 filterVertexPosition( void )\r\n{\r\n    vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\r\n\r\n    return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\r\n}\r\n\r\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\r\n               out vec2 v_rgbNW, out vec2 v_rgbNE,\r\n               out vec2 v_rgbSW, out vec2 v_rgbSE,\r\n               out vec2 v_rgbM) {\r\n    v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\r\n    v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\r\n    v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\r\n    v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\r\n    v_rgbM = vec2(fragCoord * inverseVP);\r\n}\r\n\r\nvoid main(void) {\r\n\r\n   gl_Position = filterVertexPosition();\r\n\r\n   vFragCoord = aVertexPosition * outputFrame.zw;\r\n\r\n   texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\r\n}\r\n",bs='varying vec2 v_rgbNW;\r\nvarying vec2 v_rgbNE;\r\nvarying vec2 v_rgbSW;\r\nvarying vec2 v_rgbSE;\r\nvarying vec2 v_rgbM;\r\n\r\nvarying vec2 vFragCoord;\r\nuniform sampler2D uSampler;\r\nuniform highp vec4 inputPixel;\r\n\r\n\r\n/**\r\n Basic FXAA implementation based on the code on geeks3d.com with the\r\n modification that the texture2DLod stuff was removed since it\'s\r\n unsupported by WebGL.\r\n\r\n --\r\n\r\n From:\r\n https://github.com/mitsuhiko/webgl-meincraft\r\n\r\n Copyright (c) 2011 by Armin Ronacher.\r\n\r\n Some rights reserved.\r\n\r\n Redistribution and use in source and binary forms, with or without\r\n modification, are permitted provided that the following conditions are\r\n met:\r\n\r\n * Redistributions of source code must retain the above copyright\r\n notice, this list of conditions and the following disclaimer.\r\n\r\n * Redistributions in binary form must reproduce the above\r\n copyright notice, this list of conditions and the following\r\n disclaimer in the documentation and/or other materials provided\r\n with the distribution.\r\n\r\n * The names of the contributors may not be used to endorse or\r\n promote products derived from this software without specific\r\n prior written permission.\r\n\r\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n */\r\n\r\n#ifndef FXAA_REDUCE_MIN\r\n#define FXAA_REDUCE_MIN   (1.0/ 128.0)\r\n#endif\r\n#ifndef FXAA_REDUCE_MUL\r\n#define FXAA_REDUCE_MUL   (1.0 / 8.0)\r\n#endif\r\n#ifndef FXAA_SPAN_MAX\r\n#define FXAA_SPAN_MAX     8.0\r\n#endif\r\n\r\n//optimized version for mobile, where dependent\r\n//texture reads can be a bottleneck\r\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\r\n          vec2 v_rgbNW, vec2 v_rgbNE,\r\n          vec2 v_rgbSW, vec2 v_rgbSE,\r\n          vec2 v_rgbM) {\r\n    vec4 color;\r\n    vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\r\n    vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\r\n    vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\r\n    vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\r\n    vec4 texColor = texture2D(tex, v_rgbM);\r\n    vec3 rgbM  = texColor.xyz;\r\n    vec3 luma = vec3(0.299, 0.587, 0.114);\r\n    float lumaNW = dot(rgbNW, luma);\r\n    float lumaNE = dot(rgbNE, luma);\r\n    float lumaSW = dot(rgbSW, luma);\r\n    float lumaSE = dot(rgbSE, luma);\r\n    float lumaM  = dot(rgbM,  luma);\r\n    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\r\n    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\r\n\r\n    mediump vec2 dir;\r\n    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\r\n    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));\r\n\r\n    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\r\n                          (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\r\n\r\n    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\r\n    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\r\n              max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\r\n                  dir * rcpDirMin)) * inverseVP;\r\n\r\n    vec3 rgbA = 0.5 * (\r\n                       texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\r\n                       texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\r\n    vec3 rgbB = rgbA * 0.5 + 0.25 * (\r\n                                     texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\r\n                                     texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\r\n\r\n    float lumaB = dot(rgbB, luma);\r\n    if ((lumaB < lumaMin) || (lumaB > lumaMax))\r\n        color = vec4(rgbA, texColor.a);\r\n    else\r\n        color = vec4(rgbB, texColor.a);\r\n    return color;\r\n}\r\n\r\nvoid main() {\r\n\r\n      vec4 color;\r\n\r\n      color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\r\n\r\n      gl_FragColor = color;\r\n}\r\n',Ts=function(t){function e(){t.call(this,xs,bs)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(yi),Es="precision highp float;\r\n\r\nvarying vec2 vTextureCoord;\r\nvarying vec4 vColor;\r\n\r\nuniform float uNoise;\r\nuniform float uSeed;\r\nuniform sampler2D uSampler;\r\n\r\nfloat rand(vec2 co)\r\n{\r\n    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\r\n}\r\n\r\nvoid main()\r\n{\r\n    vec4 color = texture2D(uSampler, vTextureCoord);\r\n    float randomValue = rand(gl_FragCoord.xy * uSeed);\r\n    float diff = (randomValue - 0.5) * uNoise;\r\n\r\n    // Un-premultiply alpha before applying the color matrix. See issue #3539.\r\n    if (color.a > 0.0) {\r\n        color.rgb /= color.a;\r\n    }\r\n\r\n    color.r += diff;\r\n    color.g += diff;\r\n    color.b += diff;\r\n\r\n    // Premultiply alpha again.\r\n    color.rgb *= color.a;\r\n\r\n    gl_FragColor = color;\r\n}\r\n",ws=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random()),t.call(this,qi,Es,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.uNoise},r.noise.set=function(t){this.uniforms.uNoise=t},r.seed.get=function(){return this.uniforms.uSeed},r.seed.set=function(t){this.uniforms.uSeed=t},Object.defineProperties(e.prototype,r),e}(yi),Ss=new me;Ue.prototype._cacheAsBitmap=!1,Ue.prototype._cacheData=!1;var Ps=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(Ue.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ps),(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))}}}),Ue.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))},Ue.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getLocalBounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.RESOLUTION);var n=t._activeRenderTarget,o=br.create(r.width,r.height),s="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=s,or.addToCache(o.baseTexture,s),_r.addToCache(o,s);var a=Ss;a.tx=-r.x,a.ty=-r.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,o,!0,a,!0),t.renderTexture.bind(n),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Hn(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,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)}},Ue.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))},Ue.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(m.RESOLUTION);var n=br.create(e.width,e.height),o="cacheAsBitmap_"+zt();this._cacheData.textureCacheId=o,or.addToCache(n.baseTexture,o),_r.addToCache(n,o);var s=Ss;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new Hn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},Ue.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Ue.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Ue.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,or.removeFromCache(this._cacheData.textureCacheId),_r.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ue.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ue.prototype.name=null,ke.prototype.getChildByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null},Ue.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new le),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var Is="5.0.0";var As=function(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0};As.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++}};var Os=new le,Cs=new Fe,Ms=function(t){function e(e,r,i,n){void 0===n&&(n=xt.TRIANGLES),t.call(this),this.geometry=e,e.refCount++,this.shader=r,this.state=i||gi.for2d(),this.drawMode=n,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=0,this._transformID=-1,this.tint=16777215,this.blendMode=_t.NORMAL,this._roundPixels=m.ROUND_PIXELS,this.batchUvs=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={uvBuffer:{configurable:!0},verticesBuffer:{configurable:!0},material:{configurable:!0},blendMode:{configurable:!0},roundPixels:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return r.uvBuffer.get=function(){return this.geometry.buffers[1]},r.verticesBuffer.get=function(){return this.geometry.buffers[0]},r.material.set=function(t){this.shader=t},r.material.get=function(){return this.shader},r.blendMode.set=function(t){this.state.blendMode=t},r.blendMode.get=function(){return this.state.blendMode},r.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},r.roundPixels.get=function(){return this._roundPixels},r.tint.get=function(){return this.shader.tint},r.tint.set=function(t){this.shader.tint=t},r.texture.get=function(){return this.shader.texture},r.texture.set=function(t){this.shader.texture=t},e.prototype._render=function(t){var r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===xt.TRIANGLES&&r.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.program.uniformData.translationMatrix&&(e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),t.shader.bind(e),t.state.setState(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==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 r=this.transform.worldTransform,i=r.a,n=r.b,o=r.c,s=r.d,a=r.tx,h=r.ty,u=this.vertexData,l=0;l<u.length/2;l++){var c=e[2*l],d=e[2*l+1];u[2*l]=i*c+o*d+a,u[2*l+1]=n*c+s*d+h}if(this._roundPixels)for(var p=0;p<u.length;p++)u[p]=Math.round(u[p]);this.vertexDirty=t.vertexDirtyId}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new As(t,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,Os);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=Cs.points,i=this.geometry.getIndex().data,n=i.length,o=4===this.drawMode?3:1,s=0;s+2<n;s+=o){var a=2*i[s],h=2*i[s+1],u=2*i[s+2];if(r[0]=e[a],r[1]=e[a+1],r[2]=e[h],r[3]=e[h+1],r[4]=e[u],r[5]=e[u+1],Cs.contains(Os.x,Os.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Object.defineProperties(e.prototype,r),e}(ke);Ms.BATCHABLE_SIZE=100;var Ds="attribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n    gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n    vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n",Rs="varying vec2 vTextureCoord;\r\nuniform vec4 uColor;\r\n\r\nuniform sampler2D uSampler;\r\n\r\nvoid main(void)\r\n{\r\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\r\n}\r\n",Fs=function(t){function e(e,r){var i={uSampler:e,alpha:1,uTextureMatrix:me.IDENTITY,uColor:new Float32Array([1,1,1,1])};(r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r)).uniforms&&Object.assign(i,r.uniforms),t.call(this,r.program||di.from(Ds,Rs),i),this._colorDirty=!1,this.uvMatrix=new Ti(e),this.batchable=void 0===r.program,this.pluginName=r.pluginName,this.tint=r.tint,this.alpha=r.alpha}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={texture:{configurable:!0},alpha:{configurable:!0},tint:{configurable:!0}};return r.texture.get=function(){return this.uniforms.uSampler},r.texture.set=function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},r.alpha.set=function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},r.alpha.get=function(){return this._alpha},r.tint.set=function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;jt(this._tint,this._alpha,this.uniforms.uColor,t.premultiplyAlpha)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(e.prototype,r),e}(fi),Ls=function(t){function e(e,r,i){t.call(this);var n=new wr(e),o=new wr(r,!0),s=new wr(i,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,Et.FLOAT).addAttribute("aTextureCoord",o,2,!1,Et.FLOAT).addIndex(s),this._updateId=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertexDirtyId:{configurable:!0}};return r.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(e.prototype,r),e}(Cr),Ns=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segWidth=i,this.segHeight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;h<t;h++){var u=h%this.segWidth,l=h/this.segWidth|0;e.push(u*s,l*a),r.push(u/n,l/o)}for(var c=n*o,d=0;d<c;d++){var p=d%n,f=d/n|0,v=f*this.segWidth+p,g=f*this.segWidth+p+1,m=(f+1)*this.segWidth+p,y=(f+1)*this.segWidth+p+1;i.push(v,g,m,g,y,m)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(Ls),Us=function(t){function e(e,r){void 0===e&&(e=200),t.call(this,new Float32Array(4*r.length),new Float32Array(4*r.length),new Uint16Array(6*(r.length-1))),this.points=r,this.width=e,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),i=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),r.data=new Float32Array(4*t.length),i.data=new Uint16Array(6*(t.length-1)));var n=r.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;for(var s=t.length,a=0;a<s;a++){var h=4*a,u=a/(s-1);n[h]=u,n[h+1]=0,n[h+2]=u,n[h+3]=1}for(var l=0,c=0;c<s-1;c++){var d=2*c;o[l++]=d,o[l++]=d+1,o[l++]=d+2,o[l++]=d+2,o[l++]=d+1,o[l++]=d+3}r.update(),i.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,r=t[0],i=0,n=0,o=this.buffers[0].data,s=t.length,a=0;a<s;a++){var h=t[a],u=4*a;n=-((e=a<t.length-1?t[a+1]:h).x-r.x),i=e.y-r.y;var l=Math.sqrt(i*i+n*n),c=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.updateVertices()},e}(Ls),Bs=function(t){function e(e,r){var i=new Us(e.height,r),n=new Fs(e);t.call(this,i,n),this.autoUpdate=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._render=function(e){(this.autoUpdate||this.geometry.width!==this.shader.texture.height)&&(this.geometry.width=this.shader.texture.height,this.geometry.update()),t.prototype._render.call(this,e)},e}(Ms),ks=function(t){function e(e,r,i){var n=new Ns(e.width,e.height,r,i),o=new Fs(_r.WHITE);t.call(this,n,o),this.texture=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={texture:{configurable:!0}};return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this.geometry.width=this.shader.texture.width,this.geometry.height=this.shader.texture.height,this.geometry.build()},r.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))},r.texture.get=function(){return this.shader.texture},e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},Object.defineProperties(e.prototype,r),e}(Ms),Xs=function(t){function e(e,r,i,n,o){void 0===e&&(e=_r.EMPTY);var s=new Ls(r,i,n);s.getBuffer("aVertexPosition").static=!1;var a=new Fs(e);t.call(this,s,a,null,o),this.autoUpdate=!0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertices:{configurable:!0}};return r.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},r.vertices.set=function(t){this.geometry.getBuffer("aVertexPosition").data=t},e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},Object.defineProperties(e.prototype,r),e}(Ms),js=10,Gs=function(t){function e(e,r,i,n,o){t.call(this,_r.WHITE,4,4),this._origWidth=e.orig.width,this._origHeight=e.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=void 0!==r?r:js,this._rightWidth=void 0!==n?n:js,this._topHeight=void 0!==i?i:js,this._bottomHeight=void 0!==o?o:js,this.texture=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertices:{configurable:!0},width:{configurable:!0},height:{configurable:!0},leftWidth:{configurable:!0},rightWidth:{configurable:!0},topHeight:{configurable:!0},bottomHeight:{configurable:!0}};return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},r.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},r.vertices.set=function(t){this.geometry.getBuffer("aVertexPosition").data=t},e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._topHeight+this._bottomHeight,r=this._height>e?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},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()},Object.defineProperties(e.prototype,r),e}(ks),Hs=function(t){function e(e,r){t.call(this,e[0]instanceof _r?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this._autoUpdate=!1!==r,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return e.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&We.shared.remove(this.update,this))},e.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&We.shared.add(this.update,this,ze.HIGH))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){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.currentFrame<r?this.onLoop():this.animationSpeed<0&&this.currentFrame>r&&this.onLoop()),this.updateTexture())},e.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this.cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var r=[],i=0;i<t.length;++i)r.push(_r.from(t[i]));return new e(r)},e.fromImages=function(t){for(var r=[],i=0;i<t.length;++i)r.push(_r.from(t[i]));return new e(r)},r.totalFrames.get=function(){return this._textures.length},r.textures.get=function(){return this._textures},r.textures.set=function(t){if(t[0]instanceof _r)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this.gotoAndStop(0),this.updateTexture()},r.currentFrame.get=function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},Object.defineProperties(e.prototype,r),e}(Hn);zi.registerPlugin("accessibility",je),zi.registerPlugin("extract",an),zi.registerPlugin("interaction",mn),zi.registerPlugin("particle",Zo),zi.registerPlugin("prepare",co),zi.registerPlugin("batch",on),zi.registerPlugin("tilingSprite",os),Go.registerPlugin(as),Go.registerPlugin(Qo),yo.registerPlugin(Ke),yo.registerPlugin(Ho);var Ys={AlphaFilter:us,BlurFilter:fs,BlurFilterPass:ps,ColorMatrixFilter:gs,DisplacementFilter:_s,FXAAFilter:Ts,NoiseFilter:ws};return t.AbstractRenderer=Yi,t.AnimatedSprite=Hs,t.AppLoaderPlugin=Ho,t.Application=yo,t.Attribute=Tr,t.BLEND_MODES=_t,t.BaseRenderTexture=gr,t.BaseTexture=or,t.BatchDrawCall=Ji,t.BatchGeometry=Ki,t.BatchRenderer=on,t.BitmapFontLoader=as,t.BitmapText=ss,t.Bounds=Ne,t.Buffer=wr,t.Circle=De,t.Container=ke,t.CubeTexture=Zi,t.DEG_TO_RAD=ve,t.DRAW_MODES=xt,t.DisplayObject=Ue,t.ENV=mt,t.Ellipse=Re,t.FORMATS=bt,t.FillStyle=xn,t.Filter=yi,t.Framebuffer=fr,t.GC_MODES=It,t.GLProgram=Ci,t.GLTexture=or,t.GRAPHICS_CURVES=_n,t.Geometry=Cr,t.Graphics=Xn,t.GraphicsData=bn,t.GraphicsGeometry=Dn,t.GroupD8=Pe,t.LineStyle=Rn,t.Loader=Go,t.LoaderResource=Yo,t.MIPMAP_MODES=Pt,t.Matrix=me,t.Mesh=Ms,t.MeshBatchUvs=As,t.MeshGeometry=Ls,t.MeshMaterial=Fs,t.NineSlicePlane=Gs,t.ObjectRenderer=Ur,t.ObservablePoint=ce,t.PI_2=pe,t.PRECISION=At,t.ParticleContainer=zo,t.ParticleRenderer=Zo,t.PlaneGeometry=Ns,t.Point=le,t.Polygon=Fe,t.Program=di,t.Quad=Mr,t.QuadUv=Dr,t.RAD_TO_DEG=fe,t.RENDERER_TYPE=yt,t.Rectangle=Oe,t.RenderTexture=br,t.Renderer=zi,t.RopeGeometry=Us,t.RoundedRectangle=Le,t.Runner=He,t.SCALE_MODES=wt,t.SHAPES=ge,t.Shader=fi,t.SimpleMesh=Xs,t.SimplePlane=ks,t.SimpleRope=Bs,t.Sprite=Hn,t.SpriteMaskFilter=wi,t.Spritesheet=Ko,t.SpritesheetLoader=Qo,t.State=gi,t.System=dr,t.TARGETS=Tt,t.TEXT_GRADIENT=Yn,t.TYPES=Et,t.Text=eo,t.TextMetrics=Qn,t.TextStyle=Wn,t.Texture=_r,t.TextureLoader=jo,t.TextureMatrix=Ti,t.TextureUvs=mr,t.Ticker=We,t.TickerPlugin=Ke,t.TilingSprite=ts,t.TilingSpriteRenderer=os,t.Transform=Ie,t.UPDATE_PRIORITY=ze,t.UniformGroup=Fr,t.VERSION="5.0.3",t.WRAP_MODES=St,t.accessibility=Ge,t.autoDetectRenderer=Vi,t.checkMaxIfStatementsInShader=hi,t.defaultFilterVertex=qi,t.defaultVertex=Wi,t.extract=hn,t.filters=Ys,t.generateMultiTextureShader=nn,t.interaction=yn,t.isMobile=g,t.prepare=mo,t.resources=cr,t.settings=m,t.systems=Gi,t.useDeprecated=function(){var t=this;Object.defineProperties(t,{SVG_SIZE:{get:function(){return he(Is,"PIXI.utils.SVG_SIZE property has moved to PIXI.resources.SVGResource.SVG_SIZE"),t.SVGResource.SVG_SIZE}},TransformStatic:{get:function(){return he(Is,"PIXI.TransformStatic class has been removed, use PIXI.Transform"),t.Transform}},TransformBase:{get:function(){return he(Is,"PIXI.TransformBase class has been removed, use PIXI.Transform"),t.Transform}},TRANSFORM_MODE:{get:function(){return he(Is,"PIXI.TRANSFORM_MODE property has been removed"),{STATIC:0,DYNAMIC:1}}},WebGLRenderer:{get:function(){return he(Is,"PIXI.WebGLRenderer class has moved to PIXI.Renderer"),t.Renderer}},CanvasRenderTarget:{get:function(){return he(Is,"PIXI.CanvasRenderTarget class has moved to PIXI.utils.CanvasRenderTarget"),t.utils.CanvasRenderTarget}},loader:{get:function(){return he(Is,"PIXI.loader instance has moved to PIXI.Loader.shared"),t.Loader.shared}},FilterManager:{get:function(){return he(Is,"PIXI.FilterManager class has moved to PIXI.systems.FilterSystem"),t.systems.FilterSystem}}}),t.extras={},Object.defineProperties(t.extras,{TilingSprite:{get:function(){return he(Is,"PIXI.extras.TilingSprite class has moved to PIXI.TilingSprite"),t.TilingSprite}},TilingSpriteRenderer:{get:function(){return he(Is,"PIXI.extras.TilingSpriteRenderer class has moved to PIXI.TilingSpriteRenderer"),t.TilingSpriteRenderer}},AnimatedSprite:{get:function(){return he(Is,"PIXI.extras.AnimatedSprite class has moved to PIXI.AnimatedSprite"),t.AnimatedSprite}},BitmapText:{get:function(){return he(Is,"PIXI.extras.BitmapText class has moved to PIXI.BitmapText"),t.BitmapText}}}),Object.defineProperties(t.utils,{getSvgSize:{get:function(){return he(Is,"PIXI.utils.getSvgSize function has moved to PIXI.resources.SVGResource.getSize"),t.SVGResource.getSize}}}),t.mesh={},Object.defineProperties(t.mesh,{Mesh:{get:function(){return he(Is,"PIXI.mesh.Mesh class has moved to PIXI.SimpleMesh"),t.SimpleMesh}},NineSlicePlane:{get:function(){return he(Is,"PIXI.mesh.NineSlicePlane class has moved to PIXI.NineSlicePlane"),t.NineSlicePlane}},Plane:{get:function(){return he(Is,"PIXI.mesh.Plane class has moved to PIXI.SimplePlane"),t.SimplePlane}},Rope:{get:function(){return he(Is,"PIXI.mesh.Rope class has moved to PIXI.SimpleRope"),t.SimpleRope}},RawMesh:{get:function(){return he(Is,"PIXI.mesh.RawMesh class has moved to PIXI.Mesh"),t.Mesh}},CanvasMeshRenderer:{get:function(){return he(Is,"PIXI.mesh.CanvasMeshRenderer class has moved to PIXI.CanvasMeshRenderer"),t.CanvasMeshRenderer}},MeshRenderer:{get:function(){return he(Is,"PIXI.mesh.MeshRenderer class has moved to PIXI.MeshRenderer"),t.MeshRenderer}}}),t.particles={},Object.defineProperties(t.particles,{ParticleContainer:{get:function(){return he(Is,"PIXI.particles.ParticleContainer class has moved to PIXI.ParticleContainer"),t.ParticleContainer}},ParticleRenderer:{get:function(){return he(Is,"PIXI.particles.ParticleRenderer class has moved to PIXI.ParticleRenderer"),t.ParticleRenderer}}}),t.ticker={},Object.defineProperties(t.ticker,{Ticker:{get:function(){return he(Is,"PIXI.ticker.Ticker class has moved to PIXI.Ticker"),t.Ticker}},shared:{get:function(){return he(Is,"PIXI.ticker.shared instance has moved to PIXI.Ticker.shared"),t.Ticker.shared}}}),t.loaders={},Object.defineProperties(t.loaders,{Loader:{get:function(){return he(Is,"PIXI.loaders.Loader class has moved to PIXI.Loader"),t.Loader}},Resource:{get:function(){return he(Is,"PIXI.loaders.Resource class has moved to PIXI.LoaderResource"),t.LoaderResource}},bitmapFontParser:{get:function(){return he(Is,"PIXI.loaders.bitmapFontParser function has moved to PIXI.BitmapFontLoader.use"),t.BitmapFontLoader.use}},parseBitmapFontData:{get:function(){return he(Is,"PIXI.loaders.parseBitmapFontData function has moved to PIXI.BitmapFontLoader.parse"),t.BitmapFontLoader.parse}},spritesheetParser:{get:function(){return he(Is,"PIXI.loaders.spritesheetParser function has moved to PIXI.SpritesheetLoader.use"),t.SpritesheetLoader.use}},getResourcePath:{get:function(){return he(Is,"PIXI.loaders.getResourcePath property has moved to PIXI.SpritesheetLoader.getResourcePath"),t.SpritesheetLoader.getResourcePath}}}),t.Loader.addPixiMiddleware=function(e){return he(Is,"PIXI.loaders.Loader.addPixiMiddleware function is deprecated, use PIXI.loaders.Loader.registerPlugin"),t.loaders.Loader.registerPlugin({use:e()})},Object.defineProperty(t.extract,"WebGLExtract",{get:function(){return he(Is,"PIXI.extract.WebGLExtract method has moved to PIXI.extract.Extract"),t.extract.Extract}}),Object.defineProperty(t.prepare,"WebGLPrepare",{get:function(){return he(Is,"PIXI.prepare.WebGLPrepare class has moved to PIXI.prepare.Prepare"),t.prepare.Prepare}}),t.Container.prototype._renderWebGL=function(t){he(Is,"PIXI.Container._renderWebGL method has moved to PIXI.Container._render"),this._render(t)},t.Container.prototype.renderWebGL=function(t){he(Is,"PIXI.Container.renderWebGL method has moved to PIXI.Container.render"),this.render(t)},t.DisplayObject.prototype.renderWebGL=function(t){he(Is,"PIXI.DisplayObject.renderWebGL method has moved to PIXI.DisplayObject.render"),this.render(t)},t.Container.prototype.renderAdvancedWebGL=function(t){he(Is,"PIXI.Container.renderAdvancedWebGL method has moved to PIXI.Container.renderAdvanced"),this.renderAdvanced(t)},Object.defineProperties(t.settings,{TRANSFORM_MODE:{get:function(){return he(Is,"PIXI.settings.TRANSFORM_MODE property has been removed"),0},set:function(){he(Is,"PIXI.settings.TRANSFORM_MODE property has been removed")}}});var e=t.BaseTexture;e.prototype.loadSource=function(e){he(Is,"PIXI.BaseTexture.loadSource method has been deprecated");var r=t.resources.autoDetectResource(e);r.internal=!0,this.setResource(r),this.update()},Object.defineProperties(e.prototype,{hasLoaded:{get:function(){return he(Is,"PIXI.BaseTexture.hasLoaded property has been removed, use PIXI.BaseTexture.valid"),this.valid}},imageUrl:{get:function(){return he(Is,"PIXI.BaseTexture.imageUrl property has been removed, use resource.url"),this.resource&&this.resource.url}},source:{get:function(){return he(Is,"PIXI.BaseTexture.source property has been moved, use `resource.source`"),this.resource&&this.resource.source},set:function(t){he(Is,"PIXI.BaseTexture.source property has been moved, use `resource.source` if you want to set HTMLCanvasElement. Otherwise, create new BaseTexture."),this.resource&&(this.resource.source=t)}}}),e.fromImage=function(t,r,i,n){he(Is,"PIXI.BaseTexture.fromImage method has been replaced with PIXI.BaseTexture.from");var o={scale:n,crossorigin:r};return e.from(t,{scaleMode:i,resourceOptions:o})},e.fromCanvas=function(t,r){return he(Is,"PIXI.BaseTexture.fromCanvas method has been replaced with PIXI.BaseTexture.from"),e.from(t,{scaleMode:r})},e.fromSVG=function(t,r,i,n){he(Is,"PIXI.BaseTexture.fromSVG method has been replaced with PIXI.BaseTexture.from");var o={scale:n,crossorigin:r};return e.from(t,{scaleMode:i,resourceOptions:o})},t.Point.prototype.copy=function(t){return he(Is,"PIXI.Point.copy method has been replaced with PIXI.Point.copyFrom"),this.copyFrom(t)},t.ObservablePoint.prototype.copy=function(t){return he(Is,"PIXI.ObservablePoint.copy method has been replaced with PIXI.ObservablePoint.copyFrom"),this.copyFrom(t)},t.Rectangle.prototype.copy=function(t){return he(Is,"PIXI.Rectangle.copy method has been replaced with PIXI.Rectangle.copyFrom"),this.copyFrom(t)},t.Matrix.prototype.copy=function(t){return he(Is,"PIXI.Matrix.copy method has been replaced with PIXI.Matrix.copyTo"),this.copyTo(t)},Object.assign(t.systems.FilterSystem.prototype,{getRenderTarget:function(t,e){return he(Is,"PIXI.FilterManager.getRenderTarget method has been replaced with PIXI.systems.FilterSystem#getFilterTexture"),this.getFilterTexture(e)},returnRenderTarget:function(t){he(Is,"PIXI.FilterManager.returnRenderTarget method has been replaced with PIXI.systems.FilterSystem.returnFilterTexture"),this.returnFilterTexture(t)},calculateScreenSpaceMatrix:function(t){he(Is,"PIXI.systems.FilterSystem.calculateScreenSpaceMatrix method is removed, use `(vTextureCoord * inputSize.xy) + outputFrame.xy` instead");var e=t.identity(),r=this.activeState,i=r.sourceFrame,n=r.destinationFrame;return e.translate(i.x/n.width,i.y/n.height),e.scale(n.width,n.height),e},calculateNormalizedScreenSpaceMatrix:function(t){he(Is,"PIXI.systems.FilterManager.calculateNormalizedScreenSpaceMatrix method is removed, use `((vTextureCoord * inputSize.xy) + outputFrame.xy) / outputFrame.zw` instead.");var e=this.activeState,r=e.sourceFrame,i=e.destinationFrame,n=t.identity();n.translate(r.x/i.width,r.y/i.height);var o=i.width/r.width,s=i.height/r.height;return n.scale(o,s),n}}),Object.defineProperties(t.RenderTexture.prototype,{sourceFrame:{get:function(){return he(Is,"PIXI.RenderTexture.sourceFrame property has been removed"),this.filterFrame}},size:{get:function(){return he(Is,"PIXI.RenderTexture.size property has been removed"),this._frame}}});var r=function(t){function e(e,r,i,n){he(Is,"PIXI.filters.BlurXFilter class is deprecated, use PIXI.filters.BlurFilterPass"),t.call(this,!0,e,r,i,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.filters.BlurFilterPass),i=function(t){function e(e,r,i,n){he(Is,"PIXI.filters.BlurYFilter class is deprecated, use PIXI.filters.BlurFilterPass"),t.call(this,!1,e,r,i,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(t.filters.BlurFilterPass);Object.assign(t.filters,{BlurXFilter:r,BlurYFilter:i});var n=t.Sprite,o=t.Texture,s=t.Graphics;function a(t,e,r,i){return he(Is,"PIXI.Sprite."+t+" method is deprecated, use PIXI.Sprite.from"),n.from(e,{resourceOptions:{scale:i,crossorigin:r}})}function h(t,e,r,i){return he(Is,"PIXI.Texture."+t+" method is deprecated, use PIXI.Texture.from"),o.from(e,{resourceOptions:{scale:i,crossorigin:r}})}s.prototype.generateCanvasTexture||(s.prototype.generateCanvasTexture=function(){he(Is,'PIXI.Graphics.generateCanvasTexture method is only available in "pixi.js-legacy"')}),n.fromImage=a.bind(null,"fromImage"),n.fromSVG=a.bind(null,"fromSVG"),n.fromCanvas=a.bind(null,"fromCanvas"),n.fromVideo=a.bind(null,"fromVideo"),n.fromFrame=a.bind(null,"fromFrame"),o.fromImage=h.bind(null,"fromImage"),o.fromSVG=h.bind(null,"fromSVG"),o.fromCanvas=h.bind(null,"fromCanvas"),o.fromVideo=h.bind(null,"fromVideo"),o.fromFrame=h.bind(null,"fromFrame"),Object.defineProperty(t.AbstractRenderer.prototype,"autoResize",{get:function(){return he(Is,"PIXI.AbstractRenderer.autoResize property is deprecated, use autoDensity"),this.autoDensity},set:function(t){he(Is,"PIXI.AbstractRenderer.autoResize property is deprecated, use autoDensity"),this.autoDensity=t}}),t.utils.mixins={mixin:function(){he(Is,"PIXI.utils.mixins.mixin function is no longer available")},delayMixin:function(){he(Is,"PIXI.utils.mixins.delayMixin function is no longer available")},performMixins:function(){he(Is,"PIXI.utils.mixins.performMixins function is no longer available")}}},t.utils=ue,t}({});PIXI.useDeprecated();
  9. //# sourceMappingURL=pixi.min.js.map
Add Comment
Please, Sign In to add comment