-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.js
164 lines (164 loc) · 332 KB
/
bundle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
var Orb=function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=8)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(e,i,r){void 0===i&&(i=!1),n(this,t),this._fn=e,this._once=i,this._thisArg=r,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 a=function(){function t(){n(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 i=[];e;)i.push(e),e=e._next;return i}},{key:"has",value:function(t){if(!(t instanceof s))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,arguments),t=t._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 s(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 s(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof s))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}();a.MiniSignalBinding=s,e.default=a,t.exports=e.default},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var r=i(14),n=i(16);function s(){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}e.parse=_,e.resolve=function(t,e){return _(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?_(t,!1,!0).resolveObject(e):e},e.format=function(t){n.isString(t)&&(t=_(t));return t instanceof s?t.format():s.prototype.format.call(t)},e.Url=s;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=i(17);function _(t,e,i){if(t&&n.isObject(t)&&t instanceof s)return t;var r=new s;return r.parse(t,e,i),r}s.prototype.parse=function(t,e,i){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),a=-1!==s&&s<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var _=t=u.join(a);if(_=_.trim(),!i&&1===t.split("#").length){var x=h.exec(_);if(x)return this.path=_,this.href=_,this.pathname=x[1],x[2]?(this.search=x[2],this.query=e?g.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=o.exec(_);if(b){var T=(b=b[0]).toLowerCase();this.protocol=T,_=_.substr(b.length)}if(i||b||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var w="//"===_.substr(0,2);!w||b&&y[b]||(_=_.substr(2),this.slashes=!0)}if(!y[b]&&(w||b&&!m[b])){for(var E,S,A=-1,O=0;O<d.length;O++){-1!==(P=_.indexOf(d[O]))&&(-1===A||P<A)&&(A=P)}-1!==(S=-1===A?_.lastIndexOf("@"):_.lastIndexOf("@",A))&&(E=_.slice(0,S),_=_.slice(S+1),this.auth=decodeURIComponent(E)),A=-1;for(O=0;O<c.length;O++){var P;-1!==(P=_.indexOf(c[O]))&&(-1===A||P<A)&&(A=P)}-1===A&&(A=_.length),this.host=_.slice(0,A),_=_.slice(A),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var C=this.hostname.split(/\./),D=(O=0,C.length);O<D;O++){var M=C[O];if(M&&!M.match(p)){for(var R="",L=0,N=M.length;L<N;L++)M.charCodeAt(L)>127?R+="x":R+=M[L];if(!R.match(p)){var F=C.slice(0,O),U=C.slice(O+1),k=M.match(f);k&&(F.push(k[1]),U.unshift(k[2])),U.length&&(_="/"+U.join(".")+_),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+B,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!v[T])for(O=0,D=l.length;O<D;O++){var X=l[O];if(-1!==_.indexOf(X)){var H=encodeURIComponent(X);H===X&&(H=escape(X)),_=_.split(X).join(H)}}var G=_.indexOf("#");-1!==G&&(this.hash=_.substr(G),_=_.slice(0,G));var z=_.indexOf("?");if(-1!==z?(this.search=_.substr(z),this.query=_.substr(z+1),e&&(this.query=g.parse(this.query)),_=_.slice(0,z)):e&&(this.search="",this.query={}),_&&(this.pathname=_),m[T]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var Y=this.search||"";this.path=B+Y}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",r=this.hash||"",s=!1,o="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&n.isObject(this.query)&&Object.keys(this.query).length&&(o=g.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||m[e])&&!1!==s?(s="//"+(s||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):s||(s=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),e+s+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(a=a.replace("#","%23"))+r},s.prototype.resolve=function(t){return this.resolveObject(_(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if(n.isString(t)){var e=new s;e.parse(t,!1,!0),t=e}for(var i=new s,r=Object.keys(this),o=0;o<r.length;o++){var a=r[o];i[a]=this[a]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(i[l]=t[l])}return m[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!m[t.protocol]){for(var c=Object.keys(t),d=0;d<c.length;d++){var p=c[d];i[p]=t[p]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||y[t.protocol])i.pathname=t.pathname;else{for(var f=(t.pathname||"").split("/");f.length&&!(t.host=f.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),i.pathname=f.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var v=i.pathname||"",g=i.search||"";i.path=v+g}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var _=i.pathname&&"/"===i.pathname.charAt(0),x=t.host||t.pathname&&"/"===t.pathname.charAt(0),b=x||_||i.host&&t.pathname,T=b,w=i.pathname&&i.pathname.split("/")||[],E=(f=t.pathname&&t.pathname.split("/")||[],i.protocol&&!m[i.protocol]);if(E&&(i.hostname="",i.port=null,i.host&&(""===w[0]?w[0]=i.host:w.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===f[0]?f[0]=t.host:f.unshift(t.host)),t.host=null),b=b&&(""===f[0]||""===w[0])),x)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,w=f;else if(f.length)w||(w=[]),w.pop(),w=w.concat(f),i.search=t.search,i.query=t.query;else if(!n.isNullOrUndefined(t.search)){if(E)i.hostname=i.host=w.shift(),(I=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=I.shift(),i.host=i.hostname=I.shift());return i.search=t.search,i.query=t.query,n.isNull(i.pathname)&&n.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!w.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var S=w.slice(-1)[0],A=(i.host||t.host||w.length>1)&&("."===S||".."===S)||""===S,O=0,P=w.length;P>=0;P--)"."===(S=w[P])?w.splice(P,1):".."===S?(w.splice(P,1),O++):O&&(w.splice(P,1),O--);if(!b&&!T)for(;O--;O)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),A&&"/"!==w.join("/").substr(-1)&&w.push("");var I,C=""===w[0]||w[0]&&"/"===w[0].charAt(0);E&&(i.hostname=i.host=C?"":w.length?w.shift():"",(I=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=I.shift(),i.host=i.hostname=I.shift()));return(b=b||i.host&&w.length)&&!C&&w.unshift(""),w.length?i.pathname=w.join("/"):(i.pathname=null,i.path=null),n.isNull(i.pathname)&&n.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},s.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,i){"use strict";t.exports=function(t,e){e=e||{};for(var i={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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=i.parser[e.strictMode?"strict":"loose"].exec(t),n={},s=14;s--;)n[i.key[s]]=r[s]||"";return n[i.q.name]={},n[i.key[12]].replace(i.q.parser,function(t,e,r){e&&(n[i.q.name][e]=r)}),n}},function(t,e,i){"use strict";var r=Object.prototype.hasOwnProperty,n="~";function s(){}function o(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,r,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,r||t,s),h=n?n+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 h(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function u(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(n=!1)),u.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)r.call(t,e)&&i.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},u.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},u.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},u.prototype.emit=function(t,e,i,r,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,r),!0;case 5:return l.fn.call(l.context,e,i,r,s),!0;case 6:return l.fn.call(l.context,e,i,r,s,o),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,i);break;case 4:l[u].fn.call(l[u].context,e,i,r);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];l[u].fn.apply(l[u].context,h)}}return!0},u.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},u.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},u.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return h(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||h(this,s);else{for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==e||r&&!o[a].once||i&&o[a].context!==i)&&u.push(o[a]);u.length?this._events[s]=1===u.length?u[0]:u:h(this,s)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&h(this,e)):(this._events=new s,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u},function(t,e,i){"use strict";function r(t,e,i){i=i||2;var r,a,h,u,l,p,f,y=e&&e.length,m=y?e[0]*i:t.length,g=n(t,0,m,i,!0),_=[];if(!g||g.next===g.prev)return _;if(y&&(g=function(t,e,i,r){var o,a,h,u,l,p=[];for(o=0,a=e.length;o<a;o++)h=e[o]*r,u=o<a-1?e[o+1]*r:t.length,(l=n(t,h,u,r,!1))===l.next&&(l.steiner=!0),p.push(v(l));for(p.sort(c),o=0;o<p.length;o++)d(p[o],i),i=s(i,i.next);return i}(t,e,g,i)),t.length>80*i){r=h=t[0],a=u=t[1];for(var x=i;x<m;x+=i)(l=t[x])<r&&(r=l),(p=t[x+1])<a&&(a=p),l>h&&(h=l),p>u&&(u=p);f=0!==(f=Math.max(h-r,u-a))?1/f:0}return o(g,_,i,r,a,f),_}function n(t,e,i,r,n){var s,o;if(n===P(t,e,i,r)>0)for(s=e;s<i;s+=r)o=S(s,t[s],t[s+1],o);else for(s=i-r;s>=e;s-=r)o=S(s,t[s],t[s+1],o);return o&&_(o,o.next)&&(A(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!_(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(A(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function o(t,e,i,r,n,c,d){if(t){!d&&c&&function(t,e,i,r){var n=t;do{null===n.z&&(n.z=f(n.x,n.y,e,i,r)),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,i,r,n,s,o,a,h,u=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,r=i,a=0,e=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;a>0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,h--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=r}s.nextZ=null,u*=2}while(o>1)}(n)}(t,r,n,c);for(var p,v,y=t;t.prev!==t.next;)if(p=t.prev,v=t.next,c?h(t,r,n,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(v.i/i),A(t),t=v.next,y=v.next;else if((t=v)===y){d?1===d?o(t=u(s(t),e,i),e,i,r,n,c,2):2===d&&l(t,e,i,r,n,c):o(s(t),e,i,r,n,c,1);break}}}function a(t){var e=t.prev,i=t,r=t.next;if(g(e,i,r)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(y(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&g(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,i,r){var n=t.prev,s=t,o=t.next;if(g(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,h=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,u=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,l=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,c=f(a,h,e,i,r),d=f(u,l,e,i,r),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&g(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&y(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&g(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function u(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!_(n,o)&&x(n,r,r.next,o)&&w(n,o)&&w(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),A(r),A(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function l(t,e,i,r,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&m(h,u)){var l=E(h,u);return h=s(h,h.next),l=s(l,l.next),o(h,e,i,r,n,a),void o(l,e,i,r,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,r=e,n=t.x,s=t.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!i)return null;if(n===o)return i;var h,u=i,l=i.x,c=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=l&&n!==r.x&&y(s<c?n:o,s,l,c,s<c?o:n,s,r.x,r.y)&&(h=Math.abs(s-r.y)/(n-r.x),w(r,t)&&(h<d||h===d&&(r.x>i.x||r.x===i.x&&p(i,r)))&&(i=r,d=h)),r=r.next}while(r!==u);return i}(t,e)){var i=E(e,t);s(e,e.next),s(i,i.next)}}function p(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function f(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function v(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function y(t,e,i,r,n,s,o,a){return(n-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(r-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||_(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,r){var n=T(g(t,e,i)),s=T(g(t,e,r)),o=T(g(i,r,t)),a=T(g(i,r,e));return n!==s&&o!==a||(!(0!==n||!b(t,i,e))||(!(0!==s||!b(t,r,e))||(!(0!==o||!b(i,t,r))||!(0!==a||!b(i,e,r)))))}function b(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function E(t,e){var i=new O(t.i,t.x,t.y),r=new O(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function S(t,e,i,r){var n=new O(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function A(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 O(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(t,e,i,r){for(var n=0,s=e,o=i-r;s<i;s+=r)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}t.exports=r,t.exports.default=r,r.deviation=function(t,e,i,r){var n=e&&e.length,s=n?e[0]*i:t.length,o=Math.abs(P(t,0,s,i));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*i,l=a<h-1?e[a+1]*i:t.length;o-=Math.abs(P(t,u,l,i))}var c=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,f=r[a+2]*i;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===o&&0===c?0:Math.abs((c-o)/o)},r.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var s=0;s<t[n].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[n][s][o]);n>0&&(r+=t[n-1].length,i.holes.push(r))}return i}},function(t,e,i){(function(r,n){var s;!function(r){var o=r.Promise,a=o&&"resolve"in o&&"reject"in o&&"all"in o&&"race"in o&&function(){var t;return new o(function(e){t=e}),"function"==typeof t}();e?(e.Promise=a?o:O,e.Polyfill=O):void 0===(s=function(){return a?o:O}.call(e,i,e,t))||(t.exports=s);var h="pending",u="sealed",l="fulfilled",c="rejected",d=function(){};function p(t){return"[object Array]"===Object.prototype.toString.call(t)}var f,v=void 0!==n?n:setTimeout,y=[];function m(){for(var t=0;t<y.length;t++)y[t][0](y[t][1]);y=[],f=!1}function g(t,e){y.push([t,e]),f||(f=!0,v(m,0))}function _(t){var e=t.owner,i=e.state_,r=e.data_,n=t[i],s=t.then;if("function"==typeof n){i=l;try{r=n(r)}catch(t){w(s,t)}}x(s,r)||(i===l&&b(s,r),i===c&&w(s,r))}function x(t,e){var i;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(r){i||(i=!0,e!==r?b(t,r):T(t,r))},function(e){i||(i=!0,w(t,e))}),!0}}catch(e){return i||w(t,e),!0}return!1}function b(t,e){t!==e&&x(t,e)||T(t,e)}function T(t,e){t.state_===h&&(t.state_=u,t.data_=e,g(S,t))}function w(t,e){t.state_===h&&(t.state_=u,t.data_=e,g(A,t))}function E(t){var e=t.then_;t.then_=void 0;for(var i=0;i<e.length;i++)_(e[i])}function S(t){t.state_=l,E(t)}function A(t){t.state_=c,E(t)}function O(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof O==!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 i(t){w(e,t)}try{t(function(t){b(e,t)},i)}catch(t){i(t)}}(t,this)}O.prototype={constructor:O,state_:h,then_:null,data_:void 0,then:function(t,e){var i={owner:this,then:new this.constructor(d),fulfilled:t,rejected:e};return this.state_===l||this.state_===c?g(_,i):this.then_.push(i),i.then},catch:function(t){return this.then(null,t)}},O.all=function(t){if(!p(t))throw new TypeError("You must pass an array to Promise.all().");return new this(function(e,i){var r=[],n=0;function s(t){return n++,function(i){r[t]=i,--n||e(r)}}for(var o,a=0;a<t.length;a++)(o=t[a])&&"function"==typeof o.then?o.then(s(a),i):r[a]=o;n||e(r)})},O.race=function(t){if(!p(t))throw new TypeError("You must pass an array to Promise.race().");return new this(function(e,i){for(var r,n=0;n<t.length;n++)(r=t[n])&&"function"==typeof r.then?r.then(e,i):e(r)})},O.resolve=function(t){return t&&"object"==typeof t&&t.constructor===this?t:new this(function(e){e(t)})},O.reject=function(t){return new this(function(e,i){i(t)})}}("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this)}).call(this,i(1),i(11).setImmediate)},function(t,e,i){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=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={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var i,a,h=o(t),u=1;u<arguments.length;u++){for(var l in i=Object(arguments[u]))n.call(i,l)&&(h[l]=i[l]);if(r){a=r(i);for(var c=0;c<a.length;c++)s.call(i,a[c])&&(h[a[c]]=i[a[c]])}}return h}},function(t,e,i){t.exports=i(9)},function(t,e,i){const r=i(20);t.exports=function(t){r.app(t)}},function(t,e,i){"use strict";(function(t){var e=i(6),r=i(7),n=i.n(r);
/*!
* @pixi/polyfill - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/polyfill is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
window.Promise||(window.Promise=e.Polyfill),Object.assign||(Object.assign=n.a);var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!s.performance||!s.performance.now){var o=Date.now();s.performance||(s.performance={}),s.performance.now=function(){return Date.now()-o}}for(var a=Date.now(),h=["ms","moz","webkit","o"],u=0;u<h.length&&!s.requestAnimationFrame;++u){var l=h[u];s.requestAnimationFrame=s[l+"RequestAnimationFrame"],s.cancelAnimationFrame=s[l+"CancelAnimationFrame"]||s[l+"CancelRequestAnimationFrame"]}s.requestAnimationFrame||(s.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+a-e;return i<0&&(i=0),a=e,setTimeout(function(){a=Date.now(),t(performance.now())},i)}),s.cancelAnimationFrame||(s.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)}).call(this,i(1))},function(t,e,i){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function s(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new s(n.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new s(n.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},i(12),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,i(1))},function(t,e,i){(function(t,e){!function(t,i){"use strict";if(!t.setImmediate){var r,n,s,o,a,h=1,u={},l=!1,c=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){f(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){f(t.data)},r=function(t){s.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,r=function(t){var e=c.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):r=function(t){setTimeout(f,0,t)}:(o="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&f(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(o+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var n={callback:t,args:e};return u[h]=n,r(h),h++},d.clearImmediate=p}function p(t){delete u[t]}function f(t){if(l)setTimeout(f,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(i,r)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(1),i(13))},function(t,e){var i,r,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var h,u=[],l=!1,c=-1;function d(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=a(d);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function v(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new f(t,e)),1!==u.length||l||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=v,n.addListener=v,n.once=v,n.off=v,n.removeListener=v,n.removeAllListeners=v,n.emit=v,n.prependListener=v,n.prependOnceListener=v,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e,i){(function(t,r){var n;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(s){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof r&&r;o.global!==o&&o.window!==o&&o.self;var a,h=2147483647,u=36,l=1,c=26,d=38,p=700,f=72,v=128,y="-",m=/^xn--/,g=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=u-l,T=Math.floor,w=String.fromCharCode;function E(t){throw new RangeError(x[t])}function S(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function A(t,e){var i=t.split("@"),r="";return i.length>1&&(r=i[0]+"@",t=i[1]),r+S((t=t.replace(_,".")).split("."),e).join(".")}function O(t){for(var e,i,r=[],n=0,s=t.length;n<s;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<s?56320==(64512&(i=t.charCodeAt(n++)))?r.push(((1023&e)<<10)+(1023&i)+65536):(r.push(e),n--):r.push(e);return r}function P(t){return S(t,function(t){var e="";return t>65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function I(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,i){var r=0;for(t=i?T(t/p):t>>1,t+=T(t/e);t>b*c>>1;r+=u)t=T(t/b);return T(r+(b+1)*t/(t+d))}function D(t){var e,i,r,n,s,o,a,d,p,m,g,_=[],x=t.length,b=0,w=v,S=f;for((i=t.lastIndexOf(y))<0&&(i=0),r=0;r<i;++r)t.charCodeAt(r)>=128&&E("not-basic"),_.push(t.charCodeAt(r));for(n=i>0?i+1:0;n<x;){for(s=b,o=1,a=u;n>=x&&E("invalid-input"),((d=(g=t.charCodeAt(n++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:u)>=u||d>T((h-b)/o))&&E("overflow"),b+=d*o,!(d<(p=a<=S?l:a>=S+c?c:a-S));a+=u)o>T(h/(m=u-p))&&E("overflow"),o*=m;S=C(b-s,e=_.length+1,0==s),T(b/e)>h-w&&E("overflow"),w+=T(b/e),b%=e,_.splice(b++,0,w)}return P(_)}function M(t){var e,i,r,n,s,o,a,d,p,m,g,_,x,b,S,A=[];for(_=(t=O(t)).length,e=v,i=0,s=f,o=0;o<_;++o)(g=t[o])<128&&A.push(w(g));for(r=n=A.length,n&&A.push(y);r<_;){for(a=h,o=0;o<_;++o)(g=t[o])>=e&&g<a&&(a=g);for(a-e>T((h-i)/(x=r+1))&&E("overflow"),i+=(a-e)*x,e=a,o=0;o<_;++o)if((g=t[o])<e&&++i>h&&E("overflow"),g==e){for(d=i,p=u;!(d<(m=p<=s?l:p>=s+c?c:p-s));p+=u)S=d-m,b=u-m,A.push(w(I(m+S%b,0))),d=T(S/b);A.push(w(I(d,0))),s=C(i,x,r==n),i=0,++r}++i,++e}return A.join("")}a={version:"1.4.1",ucs2:{decode:O,encode:P},decode:D,encode:M,toASCII:function(t){return A(t,function(t){return g.test(t)?"xn--"+M(t):t})},toUnicode:function(t){return A(t,function(t){return m.test(t)?D(t.slice(4).toLowerCase()):t})}},void 0===(n=function(){return a}.call(e,i,e,t))||(t.exports=n)}()}).call(this,i(15)(t),i(1))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,i){"use strict";t.exports={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}}},function(t,e,i){"use strict";e.decode=e.parse=i(18),e.encode=e.stringify=i(19)},function(t,e,i){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,i,s){e=e||"&",i=i||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(e);var h=1e3;s&&"number"==typeof s.maxKeys&&(h=s.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;l<u;++l){var c,d,p,f,v=t[l].replace(a,"%20"),y=v.indexOf(i);y>=0?(c=v.substr(0,y),d=v.substr(y+1)):(c=v,d=""),p=decodeURIComponent(c),f=decodeURIComponent(d),r(o,p)?n(o[p])?o[p].push(f):o[p]=[o[p],f]:o[p]=f}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,i){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,i,a){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?s(o(t),function(o){var a=encodeURIComponent(r(o))+i;return n(t[o])?s(t[o],function(t){return a+encodeURIComponent(r(t))}).join(e):a+encodeURIComponent(r(t[o]))}).join(e):a?encodeURIComponent(r(a))+i+encodeURIComponent(r(t)):""};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function s(t,e){if(t.map)return t.map(e);for(var i=[],r=0;r<t.length;r++)i.push(e(t[r],r));return i}var o=Object.keys||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e}},function(t,e,i){"use strict";i.r(e);var r={};i.r(r),i.d(r,"vec2",function(){return fs}),i.d(r,"copy",function(){return vs}),i.d(r,"makeAttribute",function(){return ys}),i.d(r,"add",function(){return ms}),i.d(r,"sub",function(){return gs}),i.d(r,"mul",function(){return _s}),i.d(r,"div",function(){return xs}),i.d(r,"scale",function(){return bs}),i.d(r,"setScale",function(){return Ts}),i.d(r,"addScale",function(){return ws}),i.d(r,"length",function(){return Es}),i.d(r,"normalize",function(){return Ss}),i.d(r,"direction",function(){return As}),i.d(r,"cscale",function(){return Os}),i.d(r,"csub",function(){return Ps}),i.d(r,"cadd",function(){return Is});i(10);const n=/iPhone/i,s=/iPod/i,o=/iPad/i,a=/\bAndroid(?:.+)Mobile\b/i,h=/Android/i,u=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,l=/Silk/i,c=/Windows Phone/i,d=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,f=/BB10/i,v=/Opera Mini/i,y=/\b(CriOS|Chrome)(?:.+)Mobile/i,m=/Mobile(?:.+)Firefox\b/i;function g(t,e){return t.test(e)}
/*!
* @pixi/settings - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/settings is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var _=function(t){let e=(t=t||("undefined"!=typeof navigator?navigator.userAgent:"")).split("[FBAN");void 0!==e[1]&&(t=e[0]),void 0!==(e=t.split("Twitter"))[1]&&(t=e[0]);const i={apple:{phone:g(n,t)&&!g(c,t),ipod:g(s,t),tablet:!g(n,t)&&g(o,t)&&!g(c,t),device:(g(n,t)||g(s,t)||g(o,t))&&!g(c,t)},amazon:{phone:g(u,t),tablet:!g(u,t)&&g(l,t),device:g(u,t)||g(l,t)},android:{phone:!g(c,t)&&g(u,t)||!g(c,t)&&g(a,t),tablet:!g(c,t)&&!g(u,t)&&!g(a,t)&&(g(l,t)||g(h,t)),device:!g(c,t)&&(g(u,t)||g(l,t)||g(a,t)||g(h,t))||g(/\bokhttp\b/i,t)},windows:{phone:g(c,t),tablet:g(d,t),device:g(c,t)||g(d,t)},other:{blackberry:g(p,t),blackberry10:g(f,t),opera:g(v,t),firefox:g(m,t),chrome:g(y,t),device:g(p,t)||g(f,t)||g(v,t)||g(m,t)||g(y,t)},any:!1,phone:!1,tablet:!1};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}();var x,b,T,w,E,S,A,O,P,I,C,D,M,R,L={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(_.tablet||_.phone){if(e=!1,_.apple.device){var i=navigator.userAgent.match(/OS (\d+)_(\d+)?/);i&&parseInt(i[1],10)>=11&&(e=!0)}if(_.android.device){var r=navigator.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[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:_.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!_.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},N=i(4),F=i.n(N),U=i(5),k=i.n(U),B=i(2),j=i.n(B);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(x||(x={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(b||(b={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(T||(T={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(w||(w={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(E||(E={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(S||(S={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.FLOAT=5126]="FLOAT",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(A||(A={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(O||(O={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(P||(P={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON"}(I||(I={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(C||(C={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(D||(D={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(M||(M={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(R||(R={})),
/*!
* @pixi/utils - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/utils is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
L.RETINA_PREFIX=/@([0-9\.]+)x/,L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var X,H=!1,G="5.2.1";function z(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function Y(t){var e=t.toString(16);return"#"+(e="000000".substr(0,6-e.length)+e)}var V=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;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 r=[];return r.push(e),r.push(t),r}();function W(t,e){return V[e?1:0][t]}function q(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,r=t>>8&255,n=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((r=r*e+.5|0)<<8)+(n=n*e+.5|0)}function K(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(r||void 0===r)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}Float32Array,Uint32Array,Int32Array,Uint8Array;function Z(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function J(t){return!(t&t-1||!t)}function $(t){var e=(t>65535?1:0)<<4,i=((t>>>=e)>255?1:0)<<3;return e|=i,e|=i=((t>>>=i)>15?1:0)<<2,(e|=i=((t>>>=i)>3?1:0)<<1)|(t>>>=i)>>1}function Q(t,e,i){var r,n=t.length;if(!(e>=n||0===i)){var s=n-(i=e+i>n?n-e:i);for(r=e;r<s;++r)t[r]=t[r+i];t.length=s}}function tt(t){return 0===t?0:t<0?-1:1}var et=0;function it(){return++et}var rt={};function nt(t,e,i){if(void 0===i&&(i=3),!rt[e]){var r=(new Error).stack;void 0===r?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(r=r.split("\n").splice(i).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(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(r))),rt[e]=!0}}var st={},ot=Object.create(null),at=Object.create(null);var ht=function(){function t(t,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||L.RESOLUTION,this.resize(t,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t},enumerable:!0,configurable:!0}),t}();var ut;function lt(t,e){var i=L.RETINA_PREFIX.exec(t);return i?parseFloat(i[1]):void 0!==e?e:1}
/*!
* @pixi/math - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/math is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/var ct,dt=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t}(),pt=function(){function t(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this._x=i,this._y=r,this.cb=t,this.scope=e}return t.prototype.clone=function(e,i){return void 0===e&&(e=this.cb),void 0===i&&(i=this.scope),new t(e,i,this._x,this._y)},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!0,configurable:!0}),t}(),ft=2*Math.PI,vt=180/Math.PI,yt=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(ct||(ct={}));var mt=function(){function t(t,e,i,r,n,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===s&&(s=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=s}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,e,i,r,n,s){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=s,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},t.prototype.apply=function(t,e){e=e||new dt;var i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new dt;var i=1/(this.a*this.d+this.c*-this.b),r=t.x,n=t.y;return e.x=this.d*i*r+-this.c*i*n+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*n+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e},t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},t.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.a,n=this.c,s=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=s*e-this.ty*i,this.ty=s*i+this.ty*e,this},t.prototype.append=function(t){var e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},t.prototype.setTransform=function(t,e,i,r,n,s,o,a,h){return this.a=Math.cos(o+h)*n,this.b=Math.sin(o+h)*n,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,s=-Math.atan2(-r,n),o=Math.atan2(i,e),a=Math.abs(s+o);return a<1e-5||Math.abs(ft-a)<1e-5?(t.rotation=o,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=o),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx,t.position.y=this.ty,t},t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,s=t*r-e*i;return this.a=r/s,this.b=-e/s,this.c=-i/s,this.d=t/s,this.tx=(i*this.ty-r*n)/s,this.ty=-(t*this.ty-e*n)/s,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!0,configurable:!0}),t}(),gt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],_t=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],xt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],bt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Tt=[],wt=[],Et=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];Tt.push(e);for(var i=0;i<16;i++)for(var r=Et(gt[t]*gt[i]+xt[t]*_t[i]),n=Et(_t[t]*gt[i]+bt[t]*_t[i]),s=Et(gt[t]*xt[i]+xt[t]*bt[i]),o=Et(_t[t]*xt[i]+bt[t]*bt[i]),a=0;a<16;a++)if(gt[a]===r&&_t[a]===n&&xt[a]===s&&bt[a]===o){e.push(a);break}}for(t=0;t<16;t++){var h=new mt;h.set(gt[t],_t[t],xt[t],bt[t],0,0),wt.push(h)}}();var St={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return gt[t]},uY:function(t){return _t[t]},vX:function(t){return xt[t]},vY:function(t){return bt[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Tt[t][e]},sub:function(t,e){return Tt[t][St.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?St.S:St.N:2*Math.abs(e)<=Math.abs(t)?t>0?St.E:St.W:e>0?t>0?St.SE:St.SW:t>0?St.NE:St.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=wt[St.inv(e)];n.tx=i,n.ty=r,t.append(n)}},At=function(){function t(){this.worldTransform=new mt,this.localTransform=new mt,this.position=new pt(this.onChange,this,0,0),this.scale=new pt(this.onChange,this,1,1),this.pivot=new pt(this.onChange,this,0,0),this.skew=new pt(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!0,configurable:!0}),t.IDENTITY=new t,t}(),Ot=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=ct.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.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)},t.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this},t.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this},t}(),Pt=function(){function t(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.radius=i,this.type=ct.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,r=this.x-t,n=this.y-e;return(r*=r)+(n*=n)<=i},t.prototype.getBounds=function(){return new Ot(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),It=function(){function t(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.width=i,this.height=r,this.type=ct.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,r=(e-this.y)/this.height;return(i*=i)+(r*=r)<=1},t.prototype.getBounds=function(){return new Ot(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),Ct=function(){function t(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(Array.isArray(e[0])&&(e=e[0]),e[0]instanceof dt){for(var r=[],n=0,s=(e=e).length;n<s;n++)r.push(e[n].x,e[n].y);e=r}this.points=e,this.type=ct.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,s=r-1;n<r;s=n++){var o=this.points[2*n],a=this.points[2*n+1],h=this.points[2*s],u=this.points[2*s+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-o)+o&&(i=!i)}return i},t}(),Dt=function(){function t(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=ct.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.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 i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},t}();
/*!
* @pixi/display - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/display is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
L.SORTABLE_CHILDREN=!1;var Mt=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};Mt.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Mt.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Mt.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ot.EMPTY:((t=t||new Ot(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Mt.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)},Mt.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,s=t[0],o=t[1];e=s<e?s:e,i=o<i?o:i,r=s>r?s:r,n=o>n?o:n,e=(s=t[2])<e?s:e,i=(o=t[3])<i?o:i,r=s>r?s:r,n=o>n?o:n,e=(s=t[4])<e?s:e,i=(o=t[5])<i?o:i,r=s>r?s:r,n=o>n?o:n,e=(s=t[6])<e?s:e,i=(o=t[7])<i?o:i,r=s>r?s:r,n=o>n?o:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Mt.prototype.addFrame=function(t,e,i,r,n){this.addFrameMatrix(t.worldTransform,e,i,r,n)},Mt.prototype.addFrameMatrix=function(t,e,i,r,n){var s=t.a,o=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,v=s*e+a*i+u,y=o*e+h*i+l;c=v<c?v:c,d=y<d?y:d,p=v>p?v:p,f=y>f?y:f,c=(v=s*r+a*i+u)<c?v:c,d=(y=o*r+h*i+l)<d?y:d,p=v>p?v:p,f=y>f?y:f,c=(v=s*e+a*n+u)<c?v:c,d=(y=o*e+h*n+l)<d?y:d,p=v>p?v:p,f=y>f?y:f,c=(v=s*r+a*n+u)<c?v:c,d=(y=o*r+h*n+l)<d?y:d,p=v>p?v:p,f=y>f?y:f,this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Mt.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,s=this.maxX,o=this.maxY,a=e;a<i;a+=2){var h=t[a],u=t[a+1];r=h<r?h:r,n=u<n?u:n,s=h>s?h:s,o=u>o?u:o}this.minX=r,this.minY=n,this.maxX=s,this.maxY=o},Mt.prototype.addVertices=function(t,e,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)},Mt.prototype.addVerticesMatrix=function(t,e,i,r,n,s){var o=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty;n=n||0,s=s||0;for(var d=this.minX,p=this.minY,f=this.maxX,v=this.maxY,y=i;y<r;y+=2){var m=e[y],g=e[y+1],_=o*m+h*g+l,x=u*g+a*m+c;d=Math.min(d,_-n),f=Math.max(f,_+n),p=Math.min(p,x-s),v=Math.max(v,x+s)}this.minX=d,this.minY=p,this.maxX=f,this.maxY=v},Mt.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Mt.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,s=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=n&&r<=s){var o=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<o?i:o,this.minY=r<a?r:a,this.maxX=n>h?n:h,this.maxY=s>u?s:u}},Mt.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},Mt.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,s=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=n&&r<=s){var o=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=i<o?i:o,this.minY=r<a?r:a,this.maxX=n>h?n:h,this.maxY=s>u?s:u}},Mt.prototype.pad=function(t,e){t=t||0,e=e||(0!==e?t:0),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},Mt.prototype.addFramePad=function(t,e,i,r,n,s){t-=n,e-=s,i+=n,r+=s,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r};var Rt=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new At,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 Mt,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={_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 i=Object.keys(t),r=0;r<i.length;++r){var n=i[r];Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t,n))}},i._tempDisplayObjectParent.get=function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new e),this.tempDisplayObjectParent},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.calculateBounds=function(){},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(),this._lastBoundsID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new Ot),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){var e=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,t||(this._localBoundsRect||(this._localBoundsRect=new Ot),t=this._localBoundsRect);var r=this.getBounds(!1,t);return this.parent=i,this.transform=e,r},e.prototype.toGlobal=function(t,e,i){return void 0===i&&(i=!1),i||(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,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},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,i,r,n,s,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=1),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=r||1,this.rotation=n,this.skew.x=s,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this},e.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.removeAllListeners(),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},i.x.get=function(){return this.position.x},i.x.set=function(t){this.transform.position.x=t},i.y.get=function(){return this.position.y},i.y.set=function(t){this.transform.position.y=t},i.worldTransform.get=function(){return this.transform.worldTransform},i.localTransform.get=function(){return this.transform.localTransform},i.position.get=function(){return this.transform.position},i.position.set=function(t){this.transform.position.copyFrom(t)},i.scale.get=function(){return this.transform.scale},i.scale.set=function(t){this.transform.scale.copyFrom(t)},i.pivot.get=function(){return this.transform.pivot},i.pivot.set=function(t){this.transform.pivot.copyFrom(t)},i.skew.get=function(){return this.transform.skew},i.skew.set=function(t){this.transform.skew.copyFrom(t)},i.rotation.get=function(){return this.transform.rotation},i.rotation.set=function(t){this.transform.rotation=t},i.angle.get=function(){return this.transform.rotation*vt},i.angle.set=function(t){this.transform.rotation=t*yt},i.zIndex.get=function(){return this._zIndex},i.zIndex.set=function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},i.worldVisible.get=function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},i.mask.get=function(){return this._mask},i.mask.set=function(t){if(this._mask){var e=this._mask.maskObject||this._mask;e.renderable=!0,e.isMask=!1}if(this._mask=t,this._mask){var i=this._mask.maskObject||this._mask;i.renderable=!1,i.isMask=!0}},Object.defineProperties(e.prototype,i),e}(F.a);function Lt(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}Rt.prototype.displayObjectUpdateTransform=Rt.prototype.updateTransform;var Nt=function(t){function e(){t.call(this),this.children=[],this.sortableChildren=L.SORTABLE_CHILDREN,this.sortDirty=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={width:{configurable:!0},height:{configurable:!0}};return e.prototype.onChildrenChange=function(){},e.prototype.addChild=function(t){var e=arguments,i=arguments.length;if(i>1)for(var r=0;r<i;r++)this.addChild(e[r]);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 i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i<r?i:r)}},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 i=this.getChildIndex(t);Q(this.children,i,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,i=arguments.length;if(i>1)for(var r=0;r<i;r++)this.removeChild(e[r]);else{var n=this.children.indexOf(t);if(-1===n)return null;t.parent=null,t.transform._parentID=-1,Q(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,Q(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 i,r=t,n="number"==typeof e?e:this.children.length,s=n-r;if(s>0&&s<=n){i=this.children.splice(r,s);for(var o=0;o<i.length;++o)i[o].parent=null,i[o].transform&&(i[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var a=0;a<i.length;++a)i[a].emit("removed",this),this.emit("childRemoved",i[a],this,a);return i}if(0===s&&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,i=this.children.length;e<i;++e){var r=this.children[e];r._lastSortedIndex=e,t||0===r.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(Lt),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 i=this.children[t];i.visible&&i.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var i=e._mask.maskObject||e._mask;i.calculateBounds(),this._bounds.addBoundsMask(e._bounds,i._bounds)}else 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.filters.length)this.renderAdvanced(t);else{this._render(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var e=this.filters,i=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var r=0;r<e.length;r++)e[r].enabled&&this._enabledFilters.push(e[r]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}i&&t.mask.push(this,this._mask),this._render(t);for(var n=0,s=this.children.length;n<s;n++)this.children[n].render(t);t.batch.flush(),i&&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 i="boolean"==typeof e?e:e&&e.children,r=this.removeChildren(0,this.children.length);if(i)for(var n=0;n<r.length;++n)r[n].destroy(e)},i.width.get=function(){return this.scale.x*this.getLocalBounds().width},i.width.set=function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},i.height.get=function(){return this.scale.y*this.getLocalBounds().height},i.height.set=function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},Object.defineProperties(e.prototype,i),e}(Rt);Nt.prototype.containerUpdateTransform=Nt.prototype.updateTransform;Rt.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:!1,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0});var Ft,Ut=function(t){this._hookDiv=null,(_.tablet||_.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)};Ut.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},Ut.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},Ut.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))},Ut.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))},Ut.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}},Ut.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,i=t.height/this.renderer.height,r=this.div;r.style.left=t.left+"px",r.style.top=t.top+"px",r.style.width=this.renderer.width+"px",r.style.height=this.renderer.height+"px";for(var n=0;n<this.children.length;n++){var s=this.children[n];if(s.renderId!==this.renderId)s._accessibleActive=!1,Q(this.children,n,1),this.div.removeChild(s._accessibleDiv),this.pool.push(s._accessibleDiv),s._accessibleDiv=null,n--,0===this.children.length&&this.deactivate();else{r=s._accessibleDiv;var o=s.hitArea,a=s.worldTransform;s.hitArea?(r.style.left=(a.tx+o.x*a.a)*e+"px",r.style.top=(a.ty+o.y*a.d)*i+"px",r.style.width=o.width*a.a*e+"px",r.style.height=o.height*a.d*i+"px"):(o=s.getBounds(),this.capHitArea(o),r.style.left=o.x*e+"px",r.style.top=o.y*i+"px",r.style.width=o.width*e+"px",r.style.height=o.height*i+"px",r.title!==s.accessibleTitle&&null!==s.accessibleTitle&&(r.title=s.accessibleTitle),r.getAttribute("aria-label")!==s.accessibleHint&&null!==s.accessibleHint&&r.setAttribute("aria-label",s.accessibleHint)),s.accessibleTitle===r.title&&s.tabIndex===r.tabIndex||(r.title=s.accessibleTitle,r.tabIndex=s.tabIndex,this.debug&&this.updateDebugHTML(r))}}this.renderId++}},Ut.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},Ut.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)},Ut.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},Ut.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData),e.dispatchEvent(t.target.displayObject,"pointertap",e.eventData),e.dispatchEvent(t.target.displayObject,"tap",e.eventData)},Ut.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)},Ut.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)},Ut.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},Ut.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},Ut.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},
/*!
* @pixi/ticker - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/ticker is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
L.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(Ft||(Ft={}));var kt=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=0),void 0===r&&(r=!1),this.fn=t,this.context=e,this.priority=i,this.once=r,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),Bt=function(){function t(){var t=this;this._head=new kt(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/L.TARGET_FPMS,this.elapsedMS=1/L.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-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)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,i){return void 0===i&&(i=Ft.NORMAL),this._addListener(new kt(t,e,i))},t.prototype.addOnce=function(t,e,i){return void 0===i&&(i=Ft.NORMAL),this._addListener(new kt(t,e,i,!0))},t.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.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}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*L.TARGET_FPMS;for(var r=this._head,n=r.next;n;)n=n.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,L.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!0,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!0,configurable:!0}),t}(),jt=function(){function t(){}return t.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,Ft.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?Bt.shared:new Bt,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t}(),Xt=function(){this.global=new dt,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},Ht={pointerId:{configurable:!0}};Ht.pointerId.get=function(){return this.identifier},Xt.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},Xt.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},Xt.prototype.reset=function(){this.isPrimary=!1},Object.defineProperties(Xt.prototype,Ht);var Gt=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null};Gt.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},Gt.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null};var zt=function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE},Yt={pointerId:{configurable:!0},flags:{configurable:!0},none:{configurable:!0},over:{configurable:!0},rightDown:{configurable:!0},leftDown:{configurable:!0}};zt.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Yt.pointerId.get=function(){return this._pointerId},Yt.flags.get=function(){return this._flags},Yt.flags.set=function(t){this._flags=t},Yt.none.get=function(){return this._flags===this.constructor.FLAGS.NONE},Yt.over.get=function(){return 0!=(this._flags&this.constructor.FLAGS.OVER)},Yt.over.set=function(t){this._doSet(this.constructor.FLAGS.OVER,t)},Yt.rightDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.RIGHT_DOWN)},Yt.rightDown.set=function(t){this._doSet(this.constructor.FLAGS.RIGHT_DOWN,t)},Yt.leftDown.get=function(){return 0!=(this._flags&this.constructor.FLAGS.LEFT_DOWN)},Yt.leftDown.set=function(t){this._doSet(this.constructor.FLAGS.LEFT_DOWN,t)},Object.defineProperties(zt.prototype,Yt),zt.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4});var Vt=function(){this._tempPoint=new dt};Vt.prototype.recursiveFindHit=function(t,e,i,r,n){if(!e||!e.visible)return!1;var s=t.data.global,o=!1,a=n=e.interactive||n,h=!0;if(e.hitArea?(r&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?o=!0:(r=!1,h=!1)),a=!1):e._mask&&r&&(e._mask.containsPoint&&e._mask.containsPoint(s)||(r=!1)),h&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var c=u[l],d=this.recursiveFindHit(t,c,i,r,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(r=!1),o=!0)}}return n&&(r&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(o=!0),e.interactive&&(o&&!t.target&&(t.target=e),i&&i(t,e,!!o))),o},Vt.prototype.findHit=function(t,e,i,r){this.recursiveFindHit(t,e,i,r,!1)};var Wt={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};Rt.mixin(Wt);var qt=1,Kt={target:null,data:{global:null}},Zt=function(t){function e(e,i){t.call(this),i=i||{},this.renderer=e,this.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,this.interactionFrequency=i.interactionFrequency||10,this.mouse=new Xt,this.mouse.identifier=qt,this.mouse.global.set(-999999),this.activeInteractionData={},this.activeInteractionData[qt]=this.mouse,this.interactionDataPool=[],this.eventData=new Gt,this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.tickerAdded=!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.resolution=1,this.delayedEvents=[],this.search=new Vt,this._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,this.setTargetElement(this.renderer.view,this.renderer.resolution)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={useSystemTicker:{configurable:!0}};return i.useSystemTicker.get=function(){return this._useSystemTicker},i.useSystemTicker.set=function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},e.prototype.hitTest=function(t,e){return Kt.target=null,Kt.data.global=t,e||(e=this.renderer._lastObjectRendered),this.processInteractive(Kt,e,null,!0),Kt.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(Bt.system.add(this.tickerUpdate,this,Ft.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Bt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){!this.eventsAdded&&this.interactionDOMElement&&(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.eventsAdded&&this.interactionDOMElement&&(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.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this.didMove)this.didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);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,i){i.stopPropagationHint&&t!==i.stopsPropagatingAt||(i.currentTarget=t,i.type=e,t.emit(e,i),t[e]&&t[e](i))},e.prototype.delayDispatchEvent=function(t,e,i){this.delayedEvents.push({displayObject:t,eventString:e,eventData:i})},e.prototype.mapPositionToPoint=function(t,e,i){var r;r=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var n=1/this.resolution;t.x=(e-r.left)*(this.interactionDOMElement.width/r.width)*n,t.y=(i-r.top)*(this.interactionDOMElement.height/r.height)*n},e.prototype.processInteractive=function(t,e,i,r){var n=this.search.findHit(t,e,i,r),s=this.delayedEvents;if(!s.length)return n;t.stopPropagationHint=!1;var o=s.length;this.delayedEvents=[];for(var a=0;a<o;a++){var h=s[a],u=h.displayObject,l=h.eventString,c=h.eventData;c.stopsPropagatingAt===u&&(c.stopPropagationHint=!0),this.dispatchEvent(u,l,c)}return n},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 i=e.length,r=0;r<i;r++){var n=e[r],s=this.getInteractionDataForPointerId(n),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);if(o.data.originalEvent=t,this.processInteractive(o,this.renderer._lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",o),"touch"===n.pointerType)this.emit("touchstart",o);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,i){var r=t.data,n=t.data.identifier;if(i)if(e.trackedPointers[n]||(e.trackedPointers[n]=new zt(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===r.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===r.pointerType||"pen"===r.pointerType){var s=2===r.button;s?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,s?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,i){for(var r=this.normalizeToPointerData(t),n=r.length,s=t.target!==this.interactionDOMElement?"outside":"",o=0;o<n;o++){var a=r[o],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.renderer._lastObjectRendered,i,e||!s),this.emit(e?"pointercancel":"pointerup"+s,u),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+s:"mouseup"+s,u)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+s,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 i=t.data,r=t.data.identifier;void 0!==e.trackedPointers[r]&&(delete e.trackedPointers[r],this.dispatchEvent(e,"pointercancel",t),"touch"===i.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,i){var r=t.data,n=t.data.identifier,s=e.trackedPointers[n],o="touch"===r.pointerType,a="mouse"===r.pointerType||"pen"===r.pointerType,h=!1;if(a){var u=2===r.button,l=zt.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,d=void 0!==s&&s.flags&c;i?(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),s&&(u?s.rightDown=!1:s.leftDown=!1)}i?(this.dispatchEvent(e,"pointerup",t),o&&this.dispatchEvent(e,"touchend",t),s&&(a&&!h||this.dispatchEvent(e,"pointertap",t),o&&(this.dispatchEvent(e,"tap",t),s.over=!1))):s&&(this.dispatchEvent(e,"pointerupoutside",t),o&&this.dispatchEvent(e,"touchendoutside",t)),s&&s.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 i=e.length,r=0;r<i;r++){var n=e[r],s=this.getInteractionDataForPointerId(n),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);o.data.originalEvent=t,this.processInteractive(o,this.renderer._lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",o),"touch"===n.pointerType&&this.emit("touchmove",o),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",o)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,i){var r=t.data,n="touch"===r.pointerType,s="mouse"===r.pointerType||"pen"===r.pointerType;s&&this.processPointerOverOut(t,e,i),this.moveWhenInside&&!i||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),s&&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 i=this.getInteractionDataForPointerId(e),r=this.configureInteractionEventForDOMEvent(this.eventData,e,i);r.data.originalEvent=e,this.processInteractive(r,this.renderer._lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",r),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",r):this.releaseInteractionDataForPointerId(i.identifier)}},e.prototype.processPointerOverOut=function(t,e,i){var r=t.data,n=t.data.identifier,s="mouse"===r.pointerType||"pen"===r.pointerType,o=e.trackedPointers[n];i&&!o&&(o=e.trackedPointers[n]=new zt(n)),void 0!==o&&(i&&this.mouseOverRenderer?(o.over||(o.over=!0,this.delayDispatchEvent(e,"pointerover",t),s&&this.delayDispatchEvent(e,"mouseover",t)),s&&null===this.cursor&&(this.cursor=e.cursor)):o.over&&(o.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),s&&this.dispatchEvent(e,"mouseout",t),o.none&&delete e.trackedPointers[n]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],i=this.getInteractionDataForPointerId(e),r=this.configureInteractionEventForDOMEvent(this.eventData,e,i);r.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",r),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",r)},e.prototype.getInteractionDataForPointerId=function(t){var e,i=t.pointerId;return i===qt||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[i]?e=this.activeInteractionData[i]:((e=this.interactionDataPool.pop()||new Xt).identifier=i,this.activeInteractionData[i]=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,i){return t.data=i,this.mapPositionToPoint(i.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=i.global.x,e.globalY=i.global.y),i.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var i=0,r=t.changedTouches.length;i<r;i++){var n=t.changedTouches[i];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=qt),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.removeTickerListener(),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.search=null},Object.defineProperties(e.prototype,i),e}(F.a),Jt=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,i,r,n,s,o,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this,u=h.name,l=h.items;this._aliasCount++;for(var c=0,d=l.length;c<d;c++)l[c][u](t,e,i,r,n,s,o,a);return l===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t}();Object.defineProperties(Jt.prototype,{dispatch:{value:Jt.prototype.emit},run:{value:Jt.prototype.emit}});
/*!
* @pixi/core - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/core is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var $t=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 Jt("setRealSize",2),this.onUpdate=new Jt("update"),this.onError=new Jt("onError",1)},Qt={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};$t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.run(this._width,this._height)},$t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},$t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.run(t,e))},Qt.valid.get=function(){return!!this._width&&!!this._height},$t.prototype.update=function(){this.destroyed||this.onUpdate.run()},$t.prototype.load=function(){return Promise.resolve()},Qt.width.get=function(){return this._width},Qt.height.get=function(){return this._height},$t.prototype.upload=function(t,e,i){return!1},$t.prototype.style=function(t,e,i){return!1},$t.prototype.dispose=function(){},$t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},Object.defineProperties($t.prototype,Qt);var te=function(t){function e(e){var i=e.naturalWidth||e.videoWidth||e.width,r=e.naturalHeight||e.videoHeight||e.height;t.call(this,i,r),this.source=e,this.noSubImage=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=function(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,ut||(ut=document.createElement("a")),ut.href=t;var i=Object(B.parse)(ut.href),r=!i.port&&""===e.port||i.port===e.port;return i.hostname===e.hostname&&r&&i.protocol===e.protocol?"":"anonymous"}(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,r){var n=t.gl,s=e.realWidth,o=e.realHeight;return r=r||this.source,n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===C.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||i.width!==s||i.height!==o?(i.width=s,i.height=o,n.texImage2D(e.target,0,e.format,e.format,e.type,r)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,e.type,r),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source.naturalWidth||this.source.videoWidth||this.source.width,i=this.source.naturalHeight||this.source.videoHeight||this.source.height;this.resize(e,i),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}($t),ee=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLImageElement)){var r=new Image;t.crossOrigin(r,e,i.crossorigin),r.src=e,e=r}t.call(this,e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(void 0!==i.createBitmap?i.createBitmap:L.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,this.alphaMode="number"==typeof i.alphaMode?i.alphaMode:null,void 0!==i.premultiplyAlpha&&(this.premultiplyAlpha=i.premultiplyAlpha),this.bitmap=null,this._load=null,!1!==i.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 i=e.source,r=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?r():(i.onload=r,i.onerror=function(t){return e.onError.run(t)})}),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===C.UNPACK?"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,i,r){if("number"==typeof this.alphaMode&&(i.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,i,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,r,this.bitmap),!this.preserveBitmap){var n=!0;for(var s in i._glTextures){var o=i._glTextures[s];if(o!==r&&o.dirtyId!==i.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e}(te),ie=[];function re(t,e){if(!t)return null;var i="";if("string"==typeof t){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);r&&(i=r[1].toLowerCase())}for(var n=ie.length-1;n>=0;--n){var s=ie[n];if(s.test&&s.test(t,i))return new s(t,e)}return new ee(t,e)}var ne=function(t){function e(e,i){var r=i||{},n=r.width,s=r.height;if(!n||!s)throw new Error("BufferResource width or height invalid");t.call(this,n,s),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,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===C.UNPACK),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,i.internalFormat,e.width,e.height,0,e.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}($t),se={scaleMode:O.NEAREST,format:E.RGBA,alphaMode:C.NPM},oe=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null),t.call(this);var r=(i=i||{}).alphaMode,n=i.mipmap,s=i.anisotropicLevel,o=i.scaleMode,a=i.width,h=i.height,u=i.wrapMode,l=i.format,c=i.type,d=i.target,p=i.resolution,f=i.resourceOptions;!e||e instanceof $t||((e=re(e,f)).internal=!0),this.width=a||0,this.height=h||0,this.resolution=p||L.RESOLUTION,this.mipmap=void 0!==n?n:L.MIPMAP_TEXTURES,this.anisotropicLevel=void 0!==s?s:L.ANISOTROPIC_LEVEL,this.wrapMode=u||L.WRAP_MODE,this.scaleMode=void 0!==o?o:L.SCALE_MODE,this.format=l||E.RGBA,this.type=c||A.UNSIGNED_BYTE,this.target=d||S.TEXTURE_2D,this.alphaMode=void 0!==r?r:C.UNPACK,void 0!==i.premultiplyAlpha&&(this.premultiplyAlpha=i.premultiplyAlpha),this.uid=it(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.setResource(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={realWidth:{configurable:!0},realHeight:{configurable:!0}};return i.realWidth.get=function(){return Math.ceil(this.width*this.resolution-1e-4)},i.realHeight.get=function(){return Math.ceil(this.height*this.resolution-1e-4)},e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=J(this.realWidth)&&J(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.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete at[this.cacheId],delete ot[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,i,r){void 0===r&&(r=L.STRICT_TEXTURE_CACHE);var n="string"==typeof t,s=null;n?s=t:(t._pixiId||(t._pixiId="pixiid_"+it()),s=t._pixiId);var o=at[s];if(n&&r&&!o)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return o||((o=new e(t,i)).cacheId=s,e.addToCache(o,s)),o},e.fromBuffer=function(t,i,r,n){t=t||new Float32Array(i*r*4);var s=new ne(t,{width:i,height:r}),o=t instanceof Float32Array?A.FLOAT:A.UNSIGNED_BYTE;return new e(s,Object.assign(se,n||{width:i,height:r,type:o}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),at[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),at[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=at[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete at[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)delete at[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},Object.defineProperties(e.prototype,i),e}(F.a);oe._globalBatch=0;var ae=function(t){function e(e,i){var r;i=i||{};var n=e;Array.isArray(e)&&(r=e,n=e.length),t.call(this,i.width,i.height),this.items=[],this.itemDirtyIds=[];for(var s=0;s<n;s++){var o=new oe;this.items.push(o),this.itemDirtyIds.push(-1)}if(this.length=n,this._load=null,r)for(var a=0;a<n;a++)this.addResourceAt(re(r[a],i),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=S.TEXTURE_2D_ARRAY;for(var i=0;i<this.length;i++)this.items[i].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].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}),i=e.map(function(t){return t.load()});return this._load=Promise.all(i).then(function(){var i=e[0],r=i.width,n=i.height;return t.resize(r,n),Promise.resolve(t)}),this._load},e.prototype.upload=function(t,e,i){var r=this.length,n=this.itemDirtyIds,s=this.items,o=t.gl;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,e.format,this._width,this._height,r,0,e.format,e.type,null);for(var a=0;a<r;a++){var h=s[a];n[a]<h.dirtyId&&(n[a]=h.dirtyId,h.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,a,h.resource.width,h.resource.height,1,e.format,e.type,h.resource.source))}return!0},e}($t),he=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){var e=window.OffscreenCanvas;return!!(e&&t instanceof e)||t instanceof HTMLCanvasElement},e}(te),ue=function(t){function e(i,r){if(r=r||{},t.call(this,i,r),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=S.TEXTURE_CUBE_MAP_POSITIVE_X+n;!1!==r.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=S.TEXTURE_CUBE_MAP},e.prototype.upload=function(t,i,r){for(var n=this.itemDirtyIds,s=0;s<e.SIDES;s++){var o=this.items[s];n[s]<o.dirtyId&&(n[s]=o.dirtyId,o.valid&&o.resource.upload(t,o,r))}return!0},e}(ae);ue.SIDES=6;var le=function(t){function e(e,i){i=i||{},t.call(this,document.createElement("canvas")),this._width=0,this._height=0,this.svg=e,this.scale=i.scale||1,this._overrideWidth=i.width,this._overrideHeight=i.height,this._resolve=null,this._crossorigin=i.crossorigin,this._load=null,!1!==i.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){if(t._resolve=function(){t.resize(t.source.width,t.source.height),e(t)},/^\<svg/.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}),this._load)},e.prototype._loadSvg=function(){var e=this,i=new Image;t.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(t){i.onerror=null,e.onError.run(t)},i.onload=function(){var t=i.width,r=i.height;if(!t||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=t*e.scale,s=r*e.scale;(e._overrideWidth||e._overrideHeight)&&(n=e._overrideWidth||e._overrideHeight/r*t,s=e._overrideHeight||e._overrideWidth/t*r),n=Math.round(n),s=Math.round(s);var o=e.source;o.width=n,o.height=s,o._pixiId="canvas_"+it(),o.getContext("2d").drawImage(i,0,0,t,r,0,0,n,s),e._resolve(),e._resolve=null}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),r={};return i&&(r[i[1]]=Math.round(parseFloat(i[3])),r[i[5]]=Math.round(parseFloat(i[7]))),r},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,e){return"svg"===e||"string"==typeof t&&0===t.indexOf("data:image/svg+xml;base64")||"string"==typeof t&&0===t.indexOf("<svg")},e}(te);le.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var ce=function(t){function e(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){var r=document.createElement("video");r.setAttribute("preload","auto"),r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(r,e[0].src||e[0],i.crossorigin);for(var n=0;n<e.length;++n){var s=document.createElement("source"),o=e[n],a=o.src,h=o.mime,u=(a=a||e[n]).split("?").shift().toLowerCase(),l=u.substr(u.lastIndexOf(".")+1);h=h||"video/"+l,s.src=a,s.type=h,r.appendChild(s)}e=r}t.call(this,e),this.noSubImage=!0,this._autoUpdate=!0,this._isAutoUpdating=!1,this._updateFPS=i.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==i.autoPlay,this._load=null,this._resolve=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),!1!==i.autoLoad&&this.load()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={autoUpdate:{configurable:!0},updateFPS:{configurable:!0}};return e.prototype.update=function(e){if(void 0===e&&(e=0),!this.destroyed){var i=Bt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!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),e.addEventListener("error",this._onError,!0)),this._load=new Promise(function(i){t.valid?i(t):(t._resolve=i,e.load())}),this._load},e.prototype._onError=function(){this.source.removeEventListener("error",this._onError,!0),this.onError.run(event)},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&&(Bt.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(Bt.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&&Bt.shared.remove(this.update,this),this.source&&(this.source.removeEventListener("error",this._onError,!0),this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},i.autoUpdate.get=function(){return this._autoUpdate},i.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(Bt.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(Bt.shared.add(this.update,this),this._isAutoUpdating=!0))},i.updateFPS.get=function(){return this._updateFPS},i.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},Object.defineProperties(e.prototype,i),e}(te);ce.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"];var de=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!!window.createImageBitmap&&t instanceof ImageBitmap},e}(te);ie.push(ee,de,he,ce,le,ne,ue,ae);var pe=function(t){this.renderer=t};pe.prototype.destroy=function(){this.renderer=null};var fe=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,i){var r=t.gl;return r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===C.UNPACK),i.width===e.width&&i.height===e.height?r.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,r.texImage2D(e.target,0,r.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(ne),ve=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 Jt("disposeFramebuffer",2)},ye={colorTexture:{configurable:!0}};ye.colorTexture.get=function(){return this.colorTextures[0]},ve.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new oe(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},ve.prototype.addDepthTexture=function(t){return this.depthTexture=t||new oe(new fe(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:E.DEPTH_COMPONENT,type:A.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},ve.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},ve.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},ve.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 i=0;i<this.colorTextures.length;i++){var r=this.colorTextures[i],n=r.resolution;r.setSize(t/n,e/n)}if(this.depthTexture){var s=this.depthTexture.resolution;this.depthTexture.setSize(t/s,e/s)}}},ve.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Object.defineProperties(ve.prototype,ye);var me=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 i=e||{},r=i.width,n=i.height;this.mipmap=!1,this.width=Math.ceil(r)||100,this.height=Math.ceil(n)||100,this.valid=!0,this._canvasRenderTarget=null,this.clearColor=[0,0,0,0],this.framebuffer=new ve(this.width*this.resolution,this.height*this.resolution).addColorTexture(0,this),this.maskStack=[],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},e}(oe),ge=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)};ge.prototype.set=function(t,e,i){var r=e.width,n=e.height;if(i){var s=t.width/2/r,o=t.height/2/n,a=t.x/r+s,h=t.y/n+o;i=St.add(i,St.NW),this.x0=a+s*St.uX(i),this.y0=h+o*St.uY(i),i=St.add(i,2),this.x1=a+s*St.uX(i),this.y1=h+o*St.uY(i),i=St.add(i,2),this.x2=a+s*St.uX(i),this.y2=h+o*St.uY(i),i=St.add(i,2),this.x3=a+s*St.uX(i),this.y3=h+o*St.uY(i)}else this.x0=t.x/r,this.y0=t.y/n,this.x1=(t.x+t.width)/r,this.y1=t.y/n,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/n,this.x3=t.x/r,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3};var _e=new ge,xe=function(t){function e(i,r,n,s,o,a){if(t.call(this),this.noFrame=!1,r||(this.noFrame=!0,r=new Ot(0,0,1,1)),i instanceof e&&(i=i.baseTexture),this.baseTexture=i,this._frame=r,this.trim=s,this.valid=!1,this.requiresUpdate=!1,this._uvs=_e,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(o||0),!0===o)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 dt(a.x,a.y):new dt(0,0),this._updateID=0,this.textureCacheIds=[],i.valid?this.noFrame?i.valid&&this.onBaseTextureUpdated(i):this.frame=r:i.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&i.on("update",this.onBaseTextureUpdated,this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={resolution:{configurable:!0},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 i=this.baseTexture.resource;i&&ot[i.url]&&e.removeFromCache(i.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===_e&&(this._uvs=new ge),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i,r){void 0===i&&(i={}),void 0===r&&(r=L.STRICT_TEXTURE_CACHE);var n="string"==typeof t,s=null;n?s=t:(t._pixiId||(t._pixiId="pixiid_"+it()),s=t._pixiId);var o=ot[s];if(n&&r&&!o)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return o||(i.resolution||(i.resolution=lt(t)),(o=new e(new oe(t,i))).baseTexture.cacheId=s,oe.addToCache(o.baseTexture,s),e.addToCache(o,s)),o},e.fromBuffer=function(t,i,r,n){return new e(oe.fromBuffer(t,i,r,n))},e.fromLoader=function(t,i,r){var n=new ee(t);n.url=i;var s=new e(new oe(n,{scaleMode:L.SCALE_MODE,resolution:lt(i)}));return r||(r=i),oe.addToCache(s.baseTexture,r),e.addToCache(s,r),r!==i&&(oe.addToCache(s.baseTexture,i),e.addToCache(s,i)),s},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),ot[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),ot[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=ot[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete ot[t],e}}else if(t&&t.textureCacheIds){for(var r=0;r<t.textureCacheIds.length;++r)ot[t.textureCacheIds[r]]===t&&delete ot[t.textureCacheIds[r]];return t.textureCacheIds.length=0,t}return null},i.resolution.get=function(){return this.baseTexture.resolution},i.frame.get=function(){return this._frame},i.frame.set=function(t){this._frame=t,this.noFrame=!1;var e=t.x,i=t.y,r=t.width,n=t.height,s=e+r>this.baseTexture.width,o=i+n>this.baseTexture.height;if(s||o){var a=s&&o?"and":"or",h="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,u="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},i.rotate.get=function(){return this._rotate},i.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},i.width.get=function(){return this.orig.width},i.height.get=function(){return this.orig.height},Object.defineProperties(e.prototype,i),e}(F.a);function be(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}xe.EMPTY=new xe(new oe),be(xe.EMPTY),be(xe.EMPTY.baseTexture),xe.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 xe(new oe(new he(t)))}(),be(xe.WHITE),be(xe.WHITE.baseTexture);var Te=function(t){function e(e,i){var r=null;if(!(e instanceof me)){var n=arguments[1],s=arguments[2],o=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+s+") instead of the ctor directly."),r=arguments[0],i=null,e=new me({width:n,height:s,scaleMode:o,resolution:a})}t.call(this,e,i),this.legacyRenderer=r,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,i){void 0===i&&(i=!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,i&&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 me(t))},e}(xe),we=function(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0};we.prototype.createTexture=function(t,e){var i=new me(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new Te(i)},we.prototype.getOptimalTexture=function(t,e,i){void 0===i&&(i=1);var r=we.SCREEN_KEY;t*=i,e*=i,this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight||(r=(65535&(t=Z(t)))<<16|65535&(e=Z(e))),this.texturePool[r]||(this.texturePool[r]=[]);var n=this.texturePool[r].pop();return n||(n=this.createTexture(t,e)),n.filterPoolKey=r,n.setResolution(i),n},we.prototype.getFilterTexture=function(t,e){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution);return i.filterFrame=t.filterFrame,i},we.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},we.prototype.returnFilterTexture=function(t){this.returnTexture(t)},we.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var r=0;r<i.length;r++)i[r].destroy(!0)}this.texturePool={}},we.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){var e=we.SCREEN_KEY,i=this.texturePool[e];if(this.enableFullScreen=t.width>0&&t.height>0,i)for(var r=0;r<i.length;r++)i[r].destroy(!0);this.texturePool[e]=[],this._pixelsWidth=t.width,this._pixelsHeight=t.height}},we.SCREEN_KEY="screen";var Ee=function(t,e,i,r,n,s,o){void 0===i&&(i=!1),void 0===r&&(r=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=r,this.stride=n,this.start=s,this.instance=o};Ee.prototype.destroy=function(){this.buffer=null},Ee.from=function(t,e,i,r,n){return new Ee(t,e,i,r,n)};var Se=0,Ae=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=Se++,this.disposeRunner=new Jt("disposeBuffer",2)};function Oe(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}Ae.prototype.update=function(t){this.data=t||this.data,this._updateID++},Ae.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Ae.prototype.destroy=function(){this.dispose(),this.data=null},Ae.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Ae(t)};var Pe={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var Ie={5126:4,5123:2,5121:1},Ce=0,De={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},Me=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=Ce++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Jt("disposeGeometry",2),this.refCount=0};Me.prototype.addAttribute=function(t,e,i,r,n,s,o,a){if(void 0===r&&(r=!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 Ae(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,i,r,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 Ee(l,i,r,n,s,o,a),this.instanced=this.instanced||a,this},Me.prototype.getAttribute=function(t){return this.attributes[t]},Me.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},Me.prototype.addIndex=function(t){return t.data||(t instanceof Array&&(t=new Uint16Array(t)),t=new Ae(t)),t.index=!0,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},Me.prototype.getIndex=function(){return this.indexBuffer},Me.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],i=[],r=new Ae;for(t in this.attributes){var n=this.attributes[t],s=this.buffers[n.buffer];e.push(s.data),i.push(n.size*Ie[n.type]/4),n.buffer=0}for(r.data=function(t,e){for(var i=0,r=0,n={},s=0;s<t.length;s++)r+=e[s],i+=t[s].length;for(var o=new ArrayBuffer(4*i),a=null,h=0,u=0;u<t.length;u++){var l=e[u],c=t[u],d=Oe(c);n[d]||(n[d]=new Pe[d](o)),a=n[d];for(var p=0;p<c.length;p++)a[(p/l|0)*r+h+p%l]=c[p];h+=l}return new Float32Array(o)}(e,i),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},Me.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},Me.prototype.dispose=function(){this.disposeRunner.run(this,!1)},Me.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},Me.prototype.clone=function(){for(var t=new Me,e=0;e<this.buffers.length;e++)t.buffers[e]=new Ae(this.buffers[e].data.slice());for(var i in this.attributes){var r=this.attributes[i];t.attributes[i]=new Ee(r.buffer,r.size,r.normalized,r.type,r.stride,r.start,r.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.index=!0),t},Me.merge=function(t){for(var e,i=new Me,r=[],n=[],s=[],o=0;o<t.length;o++){e=t[o];for(var a=0;a<e.buffers.length;a++)n[a]=n[a]||0,n[a]+=e.buffers[a].data.length,s[a]=0}for(var h=0;h<e.buffers.length;h++)r[h]=new(De[Oe(e.buffers[h].data)])(n[h]),i.buffers[h]=new Ae(r[h]);for(var u=0;u<t.length;u++){e=t[u];for(var l=0;l<e.buffers.length;l++)r[l].set(e.buffers[l].data,s[l]),s[l]+=e.buffers[l].data.length}if(i.attributes=e.attributes,e.indexBuffer){i.indexBuffer=i.buffers[e.buffers.indexOf(e.indexBuffer)],i.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 y in e.attributes){var m=e.attributes[y];(0|m.buffer)===f&&(d+=m.size*Ie[m.type]/4)}for(var g=0;g<t.length;g++){for(var _=t[g].indexBuffer.data,x=0;x<_.length;x++)i.indexBuffer.data[x+p]+=c;c+=e.buffers[f].data.length/d,p+=_.length}}return i};var Re=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}(Me),Le=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 Ae(this.vertices),this.uvBuffer=new Ae(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 i=0,r=0;return this.uvs[0]=i,this.uvs[1]=r,this.uvs[2]=i+e.width/t.width,this.uvs[3]=r,this.uvs[4]=i+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=i,this.uvs[7]=r+e.height/t.height,i=e.x,r=e.y,this.vertices[0]=i,this.vertices[1]=r,this.vertices[2]=i+e.width,this.vertices[3]=r,this.vertices[4]=i+e.width,this.vertices[5]=r+e.height,this.vertices[6]=i,this.vertices[7]=r+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(Me),Ne=0,Fe=function(t,e){this.uniforms=t,this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Ne++,this.static=!!e};Fe.prototype.update=function(){this.dirtyId++},Fe.prototype.add=function(t,e,i){this.uniforms[t]=new Fe(e,i)},Fe.from=function(t,e){return new Fe(t,e)};var Ue=function(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.sourceFrame=new Ot,this.destinationFrame=new Ot,this.filters=[]};Ue.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null};var ke=function(t){function e(e){t.call(this,e),this.defaultFilterStack=[{}],this.texturePool=new we,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new Re,this.quadUv=new Le,this.tempRect=new Ot,this.activeState={},this.globalUniforms=new Fe({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 i=this.renderer,r=this.defaultFilterStack,n=this.statePool.pop()||new Ue,s=e[0].resolution,o=e[0].padding,a=e[0].autoFit,h=e[0].legacy,u=1;u<e.length;u++){var l=e[u];s=Math.min(s,l.resolution),o=Math.max(o,l.padding),a=a||l.autoFit,h=h||l.legacy}1===r.length&&(this.defaultFilterStack[0].renderTexture=i.renderTexture.current),r.push(n),n.resolution=s,n.legacy=h,n.target=t,n.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),n.sourceFrame.pad(o),a&&n.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),n.sourceFrame.ceil(s),n.renderTexture=this.getOptimalFilterTexture(n.sourceFrame.width,n.sourceFrame.height,s),n.filters=e,n.destinationFrame.width=n.renderTexture.width,n.destinationFrame.height=n.renderTexture.height,n.renderTexture.filterFrame=n.sourceFrame,i.renderTexture.bind(n.renderTexture,n.sourceFrame),i.renderTexture.clear()},e.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;var r=this.globalUniforms.uniforms;r.outputFrame=e.sourceFrame,r.resolution=e.resolution;var n=r.inputSize,s=r.inputPixel,o=r.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],s[0]=n[0]*e.resolution,s[1]=n[1]*e.resolution,s[2]=1/s[0],s[3]=1/s[1],o[0]=.5*s[2],o[1]=.5*s[3],o[2]=e.sourceFrame.width*n[2]-.5*s[2],o[3]=e.sourceFrame.height*n[3]-.5*s[3],e.legacy){var a=r.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,r.filterClamp=r.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(1===i.length)i[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<i.length-1;++c){i[c].apply(this,u,l,!0,e);var d=u;u=l,l=d}i[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,i,r){var n=this.renderer;n.renderTexture.bind(i,i?i.filterFrame:null),r&&n.renderTexture.clear(),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.state.set(t.state),n.shader.bind(t),t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(w.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(w.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,r=i.sourceFrame,n=i.destinationFrame,s=e._texture.orig,o=t.set(n.width,0,0,n.height,r.x,r.y),a=e.worldTransform.copyTo(mt.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o},e.prototype.destroy=function(){this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(t,e,i){return void 0===i&&(i=1),this.texturePool.getOptimalTexture(t,e,i)},e.prototype.getFilterTexture=function(t,e){if("number"==typeof t){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var r=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution);return r.filterFrame=t.filterFrame,r},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e}(pe),Be=function(t){this.renderer=t};Be.prototype.flush=function(){},Be.prototype.destroy=function(){this.renderer=null},Be.prototype.start=function(){},Be.prototype.stop=function(){this.flush()},Be.prototype.render=function(t){};var je=function(t){function e(e){t.call(this,e),this.emptyRenderer=new Be(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.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,r=e-1;r>=0;--r)t[r]=i[r]||null,t[r]&&(t[r]._batchLocation=r)},e.prototype.boundArray=function(t,e,i,r){for(var n=t.elements,s=t.ids,o=t.count,a=0,h=0;h<o;h++){var u=n[h],l=u._batchLocation;if(l>=0&&l<r&&e[l]===u)s[h]=l;else for(;a<r;){var c=e[a];if(!c||c._batchEnabled!==i||c._batchLocation!==a){s[h]=a,u._batchLocation=a,e[a]=u;break}a++}}},e}(pe);L.PREFER_ENV=_.any?x.WEBGL:x.WEBGL2,L.STRICT_TEXTURE_CACHE=!1;var Xe=0,He=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 i={isLost:{configurable:!0}};return i.isLost.get=function(){return!this.gl||this.gl.isContextLost()},e.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Xe++,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=Xe++,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 i;if(L.PREFER_ENV>=x.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),i},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"),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"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},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.renderer.renderingToScreen&&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,i),e}(pe),Ge=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new ve(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={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 Ot,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;L.PREFER_ENV===x.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var i=this.gl;if(t){var r=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,r.framebuffer)),r.dirtyId!==t.dirtyId&&(r.dirtyId=t.dirtyId,r.dirtyFormat!==t.dirtyFormat?(r.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):r.dirtySize!==t.dirtySize&&(r.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,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,i,r){var n=this.viewport;n.width===i&&n.height===r&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,r))},i.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,i,r){var n=this.gl;n.clearColor(t,e,i,r),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,i=t.glFramebuffers[this.CONTEXT_UID];i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));for(var r=t.colorTextures,n=0;n<r.length;n++)this.renderer.texture.bind(r[n],0);t.depthTexture&&this.renderer.texture.bind(t.depthTexture,0)},e.prototype.updateFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],r=t.colorTextures.length;e.drawBuffers||(r=Math.min(r,1));for(var n=[],s=0;s<r;s++){var o=t.colorTextures[s];o.texturePart?(this.renderer.texture.bind(o.texture,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+s,e.TEXTURE_CUBE_MAP_NEGATIVE_X+o.side,o.texture._glTextures[this.CONTEXT_UID].texture,0)):(this.renderer.texture.bind(o,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+s,e.TEXTURE_2D,o._glTextures[this.CONTEXT_UID].texture,0)),n.push(e.COLOR_ATTACHMENT0+s)}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)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil))},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.stencil&&r.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<e.length;i++)this.disposeFramebuffer(e[i],t)},e.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.enableStencil();var i=t.width,r=t.height,n=this.gl,s=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,s),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,i,r),e.stencil=s,n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,s)}}},e.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new Ot},Object.defineProperties(e.prototype,i),e}(pe),ze=function(t){this.buffer=t,this.updateID=-1,this.byteLength=-1,this.refCount=0},Ye={5126:4,5123:2,5121:1},Ve=function(t){function e(e){t.call(this,e),this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,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,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,!t.createVertexArray){var i=this.renderer.context.extensions.vertexArrayObject;L.PREFER_ENV===x.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(t){return i.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return i.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,s){return r.drawElementsInstancedANGLE(t,e,i,n,s)},t.drawArraysInstanced=function(t,e,i,n){return r.drawArraysInstancedANGLE(t,e,i,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},e.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var i=this.gl,r=t.glVertexArrayObjects[this.CONTEXT_UID];r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={});var n=r[e.program.id]||this.initGeometryVao(t,e.program);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?i.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,i=0;i<t.buffers.length;i++){var r=t.buffers[i],n=r._glBuffers[this.CONTEXT_UID];if(r._updateID!==n.updateID){n.updateID=r._updateID;var s=r.index?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;if(e.bindBuffer(s,n.buffer),this._boundBuffer=n,n.byteLength>=r.data.byteLength)e.bufferSubData(s,0,r.data);else{var o=r.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=r.data.byteLength,e.bufferData(s,r.data,o)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,r=e.attributeData;for(var n in r)if(!i[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,r=e.attributeData,n=["g",t.id];for(var s in i)r[s]&&n.push(s);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var i=this.gl,r=this.CONTEXT_UID,n=this.getSignature(t,e),s=t.glVertexArrayObjects[this.CONTEXT_UID],o=s[n];if(o)return s[e.id]=o,o;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*Ye[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*Ye[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*Ye[f.type])}o=i.createVertexArray(),i.bindVertexArray(o);for(var y=0;y<a.length;y++){var m=a[y];m._glBuffers[r]||(m._glBuffers[r]=new ze(i.createBuffer()),this.managedBuffers[m.id]=m,m.disposeRunner.add(this)),m._glBuffers[r].refCount++}return this.activateVao(t,e),this._activeVao=o,s[e.id]=o,s[n]=o,o},e.prototype.disposeBuffer=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeGeometry=function(t,e){if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,n=t.buffers;if(t.disposeRunner.remove(this),i){for(var s=0;s<n.length;s++){var o=n[s]._glBuffers[this.CONTEXT_UID];o.refCount--,0!==o.refCount||e||this.disposeBuffer(n[s],e)}if(!e)for(var a in i)if("g"===a[0]){var h=i[a];this._activeVao===h&&this.unbind(),r.deleteVertexArray(h)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},e.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t);e=Object.keys(this.managedBuffers);for(var r=0;r<e.length;r++)this.disposeBuffer(this.managedBuffers[e[r]],t)},e.prototype.activateVao=function(t,e){var i=this.gl,r=this.CONTEXT_UID,n=t.buffers,s=t.attributes;t.indexBuffer&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.indexBuffer._glBuffers[r].buffer);var o=null;for(var a in s){var h=s[a],u=n[h.buffer]._glBuffers[r];if(e.attributeData[a]){o!==u&&(i.bindBuffer(i.ARRAY_BUFFER,u.buffer),o=u);var l=e.attributeData[a].location;if(i.enableVertexAttribArray(l),i.vertexAttribPointer(l,h.size,h.type||i.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");i.vertexAttribDivisor(l,1)}}}},e.prototype.draw=function(t,e,i,r){var n=this.gl,s=this._activeGeometry;if(s.indexBuffer){var o=s.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?s.instanced?n.drawElementsInstanced(t,e||s.indexBuffer.data.length,a,(i||0)*o,r||1):n.drawElements(t,e||s.indexBuffer.data.length,a,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else s.instanced?n.drawArraysInstanced(t,i,e||s.getSize(),r||1):n.drawArrays(t,i,e||s.getSize());return this},e.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},e}(pe),We=function(t){this.type=R.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._target=null};function qe(t,e,i,r){var n=Ke(t,t.VERTEX_SHADER,e),s=Ke(t,t.FRAGMENT_SHADER,i),o=t.createProgram();if(t.attachShader(o,n),t.attachShader(o,s),r)for(var a in r)t.bindAttribLocation(o,r[a],a);return t.linkProgram(o),t.getProgramParameter(o,t.LINK_STATUS)||(t.getShaderParameter(n,t.COMPILE_STATUS)||(console.warn(e),console.error(t.getShaderInfoLog(n))),t.getShaderParameter(s,t.COMPILE_STATUS)||(console.warn(i),console.error(t.getShaderInfoLog(s))),console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(o,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(o)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(o)),t.deleteProgram(o),o=null),t.deleteShader(n),t.deleteShader(s),o}function Ke(t,e,i){var r=t.createShader(e);return t.shaderSource(r,i),t.compileShader(r),r}function Ze(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 Je(2*e);case"bvec3":return Je(3*e);case"bvec4":return Je(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 Je(t){for(var e=new Array(t),i=0;i<e.length;i++)e[i]=!1;return e}We.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=R.NONE,this.autoDetect=!0),this._target=null},We.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)};var $e,Qe={},ti=Qe;function ei(){if(ti===Qe||ti&&ti.isContextLost()){var t,e=document.createElement("canvas");L.PREFER_ENV>=x.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),ti=t}return ti}function ii(t,e,i){if("precision"!==t.substring(0,9)){var r=e;return e===M.HIGH&&i!==M.HIGH&&(r=M.MEDIUM),"precision "+r+" float;\n"+t}return i!==M.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var ri={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 ni(t){return ri[t]}var si=null,oi={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 ai(t,e){if(!si){var i=Object.keys(oi);si={};for(var r=0;r<i.length;++r){var n=i[r];si[t[n]]=oi[n]}}return si[e]}var hi={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)"},ui={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 li,ci=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function di(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}var pi=0,fi={},vi=function t(e,i,r){void 0===r&&(r="pixi-shader"),this.id=pi++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=i||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(r=r.replace(/\s+/g,"-"),fi[r]?(fi[r]++,r+="-"+fi[r]):fi[r]=1,this.vertexSrc="#define SHADER_NAME "+r+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+r+"\n"+this.fragmentSrc,this.vertexSrc=ii(this.vertexSrc,L.PRECISION_VERTEX,M.HIGH),this.fragmentSrc=ii(this.fragmentSrc,L.PRECISION_FRAGMENT,function(){if(!$e){$e=M.MEDIUM;var t=ei();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);$e=e.precision?M.HIGH:M.MEDIUM}}return $e}())),this.extractData(this.vertexSrc,this.fragmentSrc),this.glPrograms={},this.syncUniforms=null},yi={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};vi.prototype.extractData=function(t,e){var i=ei();if(i){var r=qe(i,t,e);this.attributeData=this.getAttributeData(r,i),this.uniformData=this.getUniformData(r,i),i.deleteProgram(r)}else this.uniformData={},this.attributeData={}},vi.prototype.getAttributeData=function(t,e){for(var i={},r=[],n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),s=0;s<n;s++){var o=e.getActiveAttrib(t,s),a=ai(e,o.type),h={type:a,name:o.name,size:ni(a),location:0};i[o.name]=h,r.push(h)}r.sort(function(t,e){return t.name>e.name?1:-1});for(var u=0;u<r.length;u++)r[u].location=u;return i},vi.prototype.getUniformData=function(t,e){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<r;n++){var s=e.getActiveUniform(t,n),o=s.name.replace(/\[.*?\]/,""),a=s.name.match(/\[.*?\]/,""),h=ai(e,s.type);i[o]={type:h,size:s.size,isArray:a,value:Ze(h,s.size)}}return i},yi.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},yi.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},vi.from=function(t,e,i){var r=t+e,n=st[r];return n||(st[r]=n=new vi(t,e,i)),n},Object.defineProperties(vi,yi);var mi=function(t,e){for(var i in this.program=t,this.uniformGroup=e?e instanceof Fe?e:new Fe(e):new Fe({}),t.uniformData)this.uniformGroup.uniforms[i]instanceof Array&&(this.uniformGroup.uniforms[i]=new Float32Array(this.uniformGroup.uniforms[i]))},gi={uniforms:{configurable:!0}};mi.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var i in e.uniforms){var r=e.uniforms[i];if(r.group&&this.checkUniformExists(t,r))return!0}return!1},mi.prototype.destroy=function(){this.uniformGroup=null},gi.uniforms.get=function(){return this.uniformGroup.uniforms},mi.from=function(t,e,i){var r=vi.from(t,e);return new mi(r,i)},Object.defineProperties(mi.prototype,gi);var _i=function(){this.data=0,this.blendMode=T.NORMAL,this.polygonOffset=0,this.blend=!0},xi={blend:{configurable:!0},offsets:{configurable:!0},culling:{configurable:!0},depthTest:{configurable:!0},clockwiseFrontFace:{configurable:!0},blendMode:{configurable:!0},polygonOffset:{configurable:!0}};xi.blend.get=function(){return!!(1&this.data)},xi.blend.set=function(t){!!(1&this.data)!==t&&(this.data^=1)},xi.offsets.get=function(){return!!(2&this.data)},xi.offsets.set=function(t){!!(2&this.data)!==t&&(this.data^=2)},xi.culling.get=function(){return!!(4&this.data)},xi.culling.set=function(t){!!(4&this.data)!==t&&(this.data^=4)},xi.depthTest.get=function(){return!!(8&this.data)},xi.depthTest.set=function(t){!!(8&this.data)!==t&&(this.data^=8)},xi.clockwiseFrontFace.get=function(){return!!(16&this.data)},xi.clockwiseFrontFace.set=function(t){!!(16&this.data)!==t&&(this.data^=16)},xi.blendMode.get=function(){return this._blendMode},xi.blendMode.set=function(t){this.blend=t!==T.NONE,this._blendMode=t},xi.polygonOffset.get=function(){return this._polygonOffset},xi.polygonOffset.set=function(t){this.offsets=!!t,this._polygonOffset=t},_i.for2d=function(){var t=new _i;return t.depthTest=!1,t.blend=!0,t},Object.defineProperties(_i.prototype,xi);var bi=function(t){function e(i,r,n){var s=vi.from(i||e.defaultVertexSrc,r||e.defaultFragmentSrc);t.call(this,s,n),this.padding=0,this.resolution=L.FILTER_RESOLUTION,this.enabled=!0,this.autoFit=!0,this.legacy=!!this.program.attributeData.aTextureCoord,this.state=new _i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blendMode:{configurable:!0}},r={defaultVertexSrc:{configurable:!0},defaultFragmentSrc:{configurable:!0}};return e.prototype.apply=function(t,e,i,r,n){t.applyFilter(this,e,i,r,n)},i.blendMode.get=function(){return this.state.blendMode},i.blendMode.set=function(t){this.state.blendMode=t},r.defaultVertexSrc.get=function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},r.defaultFragmentSrc.get=function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},Object.defineProperties(e.prototype,i),Object.defineProperties(e,r),e}(mi);bi.SOURCE_KEY_MAP={};var Ti="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",wi="varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",Ei=new mt,Si=function(t,e){this._texture=t,this.mapCoord=new mt,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},Ai={texture:{configurable:!0}};Ai.texture.get=function(){return this._texture},Ai.texture.set=function(t){this._texture=t,this._updateID=-1},Si.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var i=this.mapCoord,r=0;r<t.length;r+=2){var n=t[r],s=t[r+1];e[r]=n*i.a+s*i.c+i.tx,e[r+1]=n*i.b+s*i.d+i.ty}return e},Si.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 i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var r=e.orig,n=e.trim;n&&(Ei.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(Ei));var s=e.baseTexture,o=this.uClampFrame,a=this.clampMargin/s.resolution,h=this.clampOffset;return o[0]=(e._frame.x+a+h)/s.width,o[1]=(e._frame.y+a+h)/s.height,o[2]=(e._frame.x+e._frame.width-a+h)/s.width,o[3]=(e._frame.y+e._frame.height-a+h)/s.height,this.uClampOffset[0]=h/s.realWidth,this.uClampOffset[1]=h/s.realHeight,this.isSimple=e._frame.width===s.width&&e._frame.height===s.height&&0===e.rotate,!0},Object.defineProperties(Si.prototype,Ai);var Oi=function(t){function e(e){var i=new mt;t.call(this,Ti,wi),e.renderable=!1,this.maskSprite=e,this.maskMatrix=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t,e,i,r){var n=this.maskSprite,s=this.maskSprite.texture;s.valid&&(s.transform||(s.transform=new Si(s,0)),s.transform.update(),this.uniforms.npmAlpha=s.baseTexture.alphaMode?0:1,this.uniforms.mask=s,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(s.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=s.transform.uClampFrame,t.applyFilter(this,e,i,r))},e}(bi),Pi=function(t){function e(e){t.call(this,e),this.scissorRenderTarget=null,this.enableScissor=!1,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},e.prototype.push=function(t,e){if(!e.isMaskData){var i=this.maskDataPool.pop()||new We;i.pooled=!0,i.maskObject=e,e=i}switch(e.autoDetect&&this.detect(e),e.copyCountersOrReset(this.maskStack[this.maskStack.length-1]),e._target=t,e.type){case R.SCISSOR:this.maskStack.push(e),this.renderer.scissor.push(e);break;case R.STENCIL:this.maskStack.push(e),this.renderer.stencil.push(e);break;case R.SPRITE:e.copyCountersOrReset(null),this.pushSpriteMask(e),this.maskStack.push(e)}},e.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){switch(e.type){case R.SCISSOR:this.renderer.scissor.pop();break;case R.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case R.SPRITE:this.popSpriteMask()}e.reset(),e.pooled&&this.maskDataPool.push(e)}},e.prototype.detect=function(t){var e=t.maskObject;if(e.isSprite)t.type=R.SPRITE;else if(t.type=R.STENCIL,this.enableScissor&&e.isFastRect&&e.isFastRect()){var i=e.worldTransform,r=Math.atan2(i.b,i.a),n=Math.atan2(i.d,i.c);r=Math.round(r*(180/Math.PI)*100),n=((n=Math.round(n*(180/Math.PI)*100)-r)%18e3+18e3)%18e3,0===(r=(r%9e3+9e3)%9e3)&&9e3===n&&(t.type=R.SCISSOR)}},e.prototype.pushSpriteMask=function(t){var e=t.maskObject,i=t._target,r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new Oi(e)]),r[0].resolution=this.renderer.resolution,r[0].maskSprite=e;var n=i.filterArea;i.filterArea=e.getBounds(!0),this.renderer.filter.push(i,r),i.filterArea=n,this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filter.pop(),this.alphaMaskIndex--},e}(pe),Ii=function(t){function e(e){t.call(this,e),this.maskStack=[],this.glConst=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var r=this.getStackLength();r!==i&&(0===r?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this,this),this.maskStack=null},e}(pe),Ci=function(t){function e(e){t.call(this,e),this.glConst=WebGLRenderingContext.SCISSOR_TEST}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.push=function(t){var e=t.maskObject;e.renderable=!0;var i=t._scissorRect,r=e.getBounds(!0),n=this.renderer.gl;e.renderable=!1,i?r.fit(i):n.enable(n.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=r,this._useCurrent()},e.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,i=this.renderer.projection,r=i.transform,n=i.sourceFrame,s=i.destinationFrame,o=e?e.resolution:this.renderer.resolution,a=(t.x-n.x)*o+s.x,h=(t.y-n.y)*o+s.y,u=t.width*o,l=t.height*o;r&&(a+=r.tx*o,h+=r.ty*o),e||(h=this.renderer.height-l-h),this.renderer.gl.scissor(a,h,u,l)},e}(Ii),Di=function(t){function e(e){t.call(this,e),this.glConst=WebGLRenderingContext.STENCIL_TEST}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,i=this.renderer.gl,r=t._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),i.enable(i.STENCIL_TEST)),t._stencilCounter++,i.colorMask(!1,!1,!1,!1),i.stencilFunc(i.EQUAL,r,this._getBitwiseMask()),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<<this.getStackLength())-1},e}(Ii),Mi=function(t){function e(e){t.call(this,e),this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new mt,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,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,r),this.transform&&this.projectionMatrix.append(this.transform);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,i,r){var n=this.projectionMatrix;r?(n.a=1/t.width*2*i,n.d=-1/t.height*2*i,n.tx=-1-e.x*n.a,n.ty=1-e.y*n.d):(n.a=1/t.width*2*i,n.d=1/t.height*2*i,n.tx=-1-e.x*n.a,n.ty=-1-e.y*n.d)},e.prototype.setTransform=function(){},e}(pe),Ri=new Ot,Li=function(t){function e(e){t.call(this,e),this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ot,this.destinationFrame=new Ot}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.bind=function(t,e,i){void 0===t&&(t=null),this.current=t;var r,n=this.renderer;if(t){var s=t.baseTexture;r=s.resolution,i||(Ri.width=s.realWidth,Ri.height=s.realHeight,i=Ri),e||(e=i),this.renderer.framebuffer.bind(s.framebuffer,i),this.renderer.projection.update(i,e,r,!1),this.renderer.mask.setMaskStack(s.maskStack)}else r=this.renderer.resolution,i||(Ri.width=n.width,Ri.height=n.height,i=Ri),e||(e=i),n.framebuffer.bind(null,i),this.renderer.projection.update(i,e,r,!0),this.renderer.mask.setMaskStack(this.defaultMaskStack);this.sourceFrame.copyFrom(e),this.destinationFrame.x=i.x/r,this.destinationFrame.y=i.y/r,this.destinationFrame.width=i.width/r,this.destinationFrame.height=i.height/r,e===i&&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}(pe),Ni=function(t,e){this.program=t,this.uniformData=e,this.uniformGroups={}};Ni.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.program=null};var Fi=0,Ui={textureCount:0},ki=function(t){function e(e){t.call(this,e),this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this.id=Fi++}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 li)return li;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");li=!0===t({a:"b"},"a","b")}catch(t){li=!1}return li}())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,this.reset()},e.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var i=t.program,r=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateShader(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(r.program)),e||(Ui.textureCount=0,this.syncUniformGroup(t.uniformGroup,Ui)),r},e.prototype.setUniforms=function(t){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)},e.prototype.syncUniformGroup=function(t,e){var i=this.getglProgram();t.static&&t.dirtyId===i.uniformGroups[t.id]||(i.uniformGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))},e.prototype.syncUniforms=function(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)},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 i="var v = null;\n var cv = null\n var t = 0;\n var gl = renderer.gl\n ";for(var r in t.uniforms){var n=e[r];n?"float"===n.type&&1===n.size?i+="\n if(uv."+r+" !== ud."+r+".value)\n {\n ud."+r+".value = uv."+r+"\n gl.uniform1f(ud."+r+".location, uv."+r+")\n }\n":"sampler2D"!==n.type&&"samplerCube"!==n.type&&"sampler2DArray"!==n.type||1!==n.size||n.isArray?"mat3"===n.type&&1===n.size?void 0!==t.uniforms[r].a?i+="\n gl.uniformMatrix3fv(ud."+r+".location, false, uv."+r+".toArray(true));\n \n":i+="\n gl.uniformMatrix3fv(ud."+r+".location, false, uv."+r+");\n \n":"vec2"===n.type&&1===n.size?void 0!==t.uniforms[r].x?i+="\n cv = ud."+r+".value;\n v = uv."+r+";\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."+r+".location, v.x, v.y);\n }\n":i+="\n cv = ud."+r+".value;\n v = uv."+r+";\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."+r+".location, v[0], v[1]);\n }\n \n":"vec4"===n.type&&1===n.size?void 0!==t.uniforms[r].width?i+="\n cv = ud."+r+".value;\n v = uv."+r+";\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."+r+".location, v.x, v.y, v.width, v.height)\n }\n":i+="\n cv = ud."+r+".value;\n v = uv."+r+";\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."+r+".location, v[0], v[1], v[2], v[3])\n }\n \n":i+="\n cv = ud."+r+".value;\n v = uv."+r+";\n "+(1===n.size?hi:ui)[n.type].replace("location","ud."+r+".location")+";\n":i+="\n\n t = syncData.textureCount++;\n\n renderer.texture.bind(uv."+r+", t);\n \n if(ud."+r+".value !== t)\n {\n ud."+r+".value = t;\n gl.uniform1i(ud."+r+".location, t);\n; // eslint-disable-line max-len\n }\n":t.uniforms[r].group&&(i+="\n renderer.shader.syncUniformGroup(uv."+r+", syncData);\n ")}return new Function("ud","uv","renderer","syncData",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 i=t.uniforms,r=[];for(var n in i)r.push(n),e[n]&&r.push(e[n].type);return r.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,i=t.program,r={};for(var n in i.attributeData)r[n]=i.attributeData[n].location;var s=qe(e,i.vertexSrc,i.fragmentSrc,r),o={};for(var a in i.uniformData){var h=i.uniformData[a];o[a]={location:e.getUniformLocation(s,a),value:Ze(h.type,h.size)}}var u=new Ni(s,o);return i.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}(pe);var Bi=0,ji=1,Xi=2,Hi=3,Gi=4,zi=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[Bi]=this.setBlend,this.map[ji]=this.setOffset,this.map[Xi]=this.setCullFace,this.map[Hi]=this.setDepthTest,this.map[Gi]=this.setFrontFace,this.checks=[],this.defaultState=new _i,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.ONE],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.ONE,t.ONE,t.ONE],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.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[T.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},e.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,i=0;e;)1&e&&this.map[i].call(this,!!(t.data&1<<i)),e>>=1,i++;this.stateId=t.data}for(var r=0;r<this.checks.length;r++)this.checks[r](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 i=0;i<this.checks.length;i++)this.checks[i](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.updateCheck(e.checkPolygonOffset,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],i=this.gl;2===e.length?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.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 i=this.checks.indexOf(t);e&&-1===i?this.checks.push(t):e||-1===i||this.checks.splice(i,1)},e.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},e.checkPolygonOffset=function(t,e){t.setPolygonOffset(e.polygonOffset,0)},e}(pe),Yi=function(t){function e(e){t.call(this,e),this.count=0,this.checkCount=0,this.maxIdle=L.GC_MAX_IDLE,this.checkCountMax=L.GC_MAX_CHECK_COUNT,this.mode=L.GC_MODE}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==D.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,i=!1,r=0;r<e.length;r++){var n=e[r];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[r]=null,i=!0)}if(i){for(var s=0,o=0;o<e.length;o++)null!==e[o]&&(e[s++]=e[o]);e.length=s}},e.prototype.unload=function(t){var e=this.renderer.textureSystem;t._texture&&t._texture._glRenderTargets&&e.destroyTexture(t._texture);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},e}(pe),Vi=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121},Wi=function(t){function e(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new oe}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 i=0;i<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var r=new Vi(t.createTexture());t.bindTexture(t.TEXTURE_2D,r.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]=r,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new Vi(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 s=0;s<this.boundTextures.length;s++)this.bind(null,s)},e.prototype.bind=function(t,e){void 0===e&&(e=0);var i=this.gl;if(t){if((t=t.baseTexture||t).valid){t.touched=this.renderer.textureGC.count;var r=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,r.texture)),r.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},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,i=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var r=0;r<i.length;r++)i[r]===this.unknownTexture&&this.bind(null,r)}for(var n=0;n<i.length;n++)i[n]===t&&(this.currentLocation!==n&&(e.activeTexture(e.TEXTURE0+n),this.currentLocation=n),e.bindTexture(e.TEXTURE_2D,this.emptyTextures[t.target].texture),i[n]=null)},e.prototype.initTexture=function(t){var e=new Vi(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(t,e){if(e.internalFormat=t.format,e.type=t.type,2===this.webGLVersion){var i=this.renderer.gl;t.type===i.FLOAT&&t.format===i.RGBA&&(e.internalFormat=i.RGBA32F),t.type===A.HALF_FLOAT&&(e.type=i.HALF_FLOAT),e.type===i.HALF_FLOAT&&t.format===i.RGBA&&(e.internalFormat=i.RGBA16F)}},e.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e));else{var r=t.realWidth,n=t.realHeight,s=i.gl;(e.width!==r||e.height!==n||e.dirtyId<0)&&(e.width=r,e.height=n,s.texImage2D(t.target,0,e.internalFormat,r,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},e.prototype.destroyTexture=function(t,e){var i=this.gl;if((t=t.baseTexture||t)._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var r=this.managedTextures.indexOf(t);-1!==r&&Q(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==I.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=0,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=P.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 i=this.gl;if(e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&t.anisotropicLevel>0&&t.scaleMode===O.LINEAR){var n=Math.min(t.anisotropicLevel,i.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},e}(pe),qi=new mt,Ki=function(t){function e(i){void 0===i&&(i={}),t.call(this,"WebGL",i),i=this.options,this.type=b.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new Jt("destroy"),contextChange:new Jt("contextChange",1),reset:new Jt("reset"),update:new Jt("update"),postrender:new Jt("postrender"),prerender:new Jt("prerender"),resize:new Jt("resize",2)},this.globalUniforms=new Fe({projectionMatrix:new mt},!0),this.addSystem(Pi,"mask").addSystem(He,"context").addSystem(zi,"state").addSystem(ki,"shader").addSystem(Wi,"texture").addSystem(Ve,"geometry").addSystem(Ge,"framebuffer").addSystem(Ci,"scissor").addSystem(Di,"stencil").addSystem(Mi,"projection").addSystem(Yi,"textureGC").addSystem(ke,"filter").addSystem(Li,"renderTexture").addSystem(je,"batch"),this.initPlugins(e.__plugins),i.context?this.context.initFromContext(i.context):this.context.initFromOptions({alpha:this.transparent,antialias:i.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,function(t){var e;if(!H){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var i=["\n %c %c %c PixiJS "+G+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=window.console).log.apply(e,i)}else window.console&&window.console.log("PixiJS "+G+" - "+t+" - http://www.pixijs.com/");H=!0}}(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(void 0===X&&(X=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var n=i.getExtension("WEBGL_lose_context");n&&n.loseContext()}return i=null,r}catch(t){return!1}}()),X)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 i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var r in this[e]=i,this.runners)this.runners[r].add(i);return this},e.prototype.render=function(t,e,i,r,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=r,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var s=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=s}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i: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,i){t.prototype.resize.call(this,e,i),this.runners.resize.run(e,i)},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){for(var i in this.runners.destroy.run(),this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(function(t){function e(e,i){t.call(this),(i=Object.assign({},L.RENDER_OPTIONS,i)).roundPixels&&(L.ROUND_PIXELS=i.roundPixels,nt("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=i,this.type=b.UNKNOWN,this.screen=new Ot(0,0,i.width,i.height),this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution||L.RESOLUTION,this.transparent=i.transparent,this.autoDensity=i.autoDensity||i.autoResize||!1,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new Nt,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={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)},i.width.get=function(){return this.view.width},i.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,i,r){0===(r=r||t.getLocalBounds()).width&&(r.width=1),0===r.height&&(r.height=1);var n=Te.create(0|r.width,0|r.height,e,i);return qi.tx=-r.x,qi.ty=-r.y,this.render(t,n,!1,qi,!!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=b.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},i.backgroundColor.get=function(){return this._backgroundColor},i.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=Y(t),z(t,this._backgroundColorRgba)},Object.defineProperties(e.prototype,i),e}(F.a));var Zi="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",Ji=function(){this.texArray=null,this.blend=0,this.type=w.TRIANGLES,this.start=0,this.size=0,this.data=null},$i=function(){this.elements=[],this.ids=[],this.count=0};$i.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0};var Qi=function(t){this.rawBinaryData=new ArrayBuffer(t),this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)},tr={int8View:{configurable:!0},uint8View:{configurable:!0},int16View:{configurable:!0},uint16View:{configurable:!0},int32View:{configurable:!0}};tr.int8View.get=function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},tr.uint8View.get=function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},tr.int16View.get=function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},tr.uint16View.get=function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},tr.int32View.get=function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},Qi.prototype.view=function(t){return this[t+"View"]},Qi.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},Qi.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},Object.defineProperties(Qi.prototype,tr);var er=function(t){function e(e){t.call(this,e),this.shaderGenerator=null,this.geometryClass=null,this.vertexSize=null,this.state=_i.for2d(),this.size=4*L.SPRITE_BATCH_SIZE,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.MAX_TEXTURES=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}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;L.PREFER_ENV===x.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),L.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var i=e.createShader(e.FRAGMENT_SHADER);;){var r=ci.replace(/%forloop%/gi,di(t));if(e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,i=e._textureArrayPool,r=this.size/4,n=Math.floor(r/this.MAX_TEXTURES)+1;t.length<r;)t.push(new Ji);for(;i.length<n;)i.push(new $i);for(var s=0;s<this.MAX_TEXTURES;s++)this._tempBoundTextures[s]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,i=this.MAX_TEXTURES,r=e._textureArrayPool,n=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count,a=++oe._globalBatch,h=0,u=r[0],l=0;n.copyBoundTextures(s,i);for(var c=0;c<this._bufferSize;++c){var d=t[c];t[c]=null,d._batchEnabled!==a&&(u.count>=i&&(n.boundArray(u,s,a,i),this.buildDrawCalls(u,l,c),l=c,u=r[++h],++a),d._batchEnabled=a,d.touched=o,u.elements[u.count++]=d)}u.count>0&&(n.boundArray(u,s,a,i),this.buildDrawCalls(u,l,this._bufferSize),++h,++a);for(var p=0;p<s.length;p++)s[p]=null;oe._globalBatch=a},e.prototype.buildDrawCalls=function(t,i,r){var n=this._bufferedElements,s=this._attributeBuffer,o=this._indexBuffer,a=this.vertexSize,h=e._drawCallPool,u=this._dcIndex,l=this._aIndex,c=this._iIndex,d=h[u];d.start=this._iIndex,d.texArray=t;for(var p=i;p<r;++p){var f=n[p],v=f._texture.baseTexture,y=V[v.alphaMode?1:0][f.blendMode];n[p]=null,i<p&&d.blend!==y&&(d.size=c-d.start,i=p,(d=h[++u]).texArray=t,d.start=c),this.packInterleavedGeometry(f,s,o,l,c),l+=f.vertexData.length/2*a,c+=f.indices.length,d.blend=y}i<r&&(d.size=c-d.start,++u),this._dcIndex=u,this._aIndex=l,this._iIndex=c},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,i=0;i<t.count;i++)e.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this._packedGeometries,e=this._attributeBuffer,i=this._indexBuffer;L.CAN_UPLOAD_SAME_BUFFER?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,i=this.renderer,r=i.gl,n=i.state,s=e._drawCallPool,o=null,a=0;a<t;a++){var h=s[a],u=h.texArray,l=h.type,c=h.size,d=h.start,p=h.blend;o!==u&&(o=u,this.bindAndClearTexArray(u)),this.state.blendMode=p,n.set(this.state),r.drawElements(l,c,r.UNSIGNED_SHORT,2*d)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.shader.bind(this._shader),L.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=Z(Math.ceil(t/8)),i=$(e),r=8*e;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var n=this._aBuffers[r];return n||(this._aBuffers[r]=n=new Qi(r*this.vertexSize*4)),n},e.prototype.getIndexBuffer=function(t){var e=Z(Math.ceil(t/12)),i=$(e),r=12*e;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var n=this._iBuffers[i];return n||(this._iBuffers[i]=n=new Uint16Array(r)),n},e.prototype.packInterleavedGeometry=function(t,e,i,r,n){for(var s=e.uint32View,o=e.float32View,a=r/this.vertexSize,h=t.uvs,u=t.indices,l=t.vertexData,c=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),p=d<1&&t._texture.baseTexture.alphaMode?q(t._tintRGB,d):t._tintRGB+(255*d<<24),f=0;f<l.length;f+=2)o[r++]=l[f],o[r++]=l[f+1],o[r++]=h[f],o[r++]=h[f+1],s[r++]=p,o[r++]=c;for(var v=0;v<u.length;v++)i[n++]=a+u[v]},e}(Be);er._drawCallPool=[],er._textureArrayPool=[];var ir=function(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')};ir.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=i;this.defaultGroupCache[t]=Fe.from({uSamplers:e},!0);var r=this.fragTemplate;r=(r=r.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new vi(this.vertexSrc,r)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new mt,default:this.defaultGroupCache[t]};return new mi(this.programCache[t],n)},ir.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var i=0;i<t;i++)i>0&&(e+="\nelse "),i<t-1&&(e+="if(vTextureId < "+i+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+i+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"};var rr=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this._buffer=new Ae(null,e,!1),this._indexBuffer=new Ae(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,A.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,A.FLOAT).addAttribute("aColor",this._buffer,4,!0,A.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,A.FLOAT).addIndex(this._indexBuffer)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Me),nr="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",sr="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n",or=function(){},ar={defaultVertexSrc:{configurable:!0},defaultFragmentTemplate:{configurable:!0}};or.create=function(t){var e=Object.assign({vertex:nr,fragment:sr,geometryClass:rr,vertexSize:6},t),i=e.vertex,r=e.fragment,n=e.vertexSize,s=e.geometryClass;return function(t){function e(e){t.call(this,e),this.shaderGenerator=new ir(i,r),this.geometryClass=s,this.vertexSize=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(er)},ar.defaultVertexSrc.get=function(){return nr},ar.defaultFragmentTemplate.get=function(){return sr},Object.defineProperties(or,ar);var hr=or.create(),ur=function t(e){var i=this;e=Object.assign({forceCanvas:!1},e),this.renderer=function(t){return Ki.create(t)}(e),this.stage=new Nt,t._plugins.forEach(function(t){t.init.call(i,e)})},lr={view:{configurable:!0},screen:{configurable:!0}};
/*!
* @pixi/app - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/app is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/ur.registerPlugin=function(t){ur._plugins.push(t)},ur.prototype.render=function(){this.renderer.render(this.stage)},lr.view.get=function(){return this.renderer.view},lr.screen.get=function(){return this.renderer.screen},ur.prototype.destroy=function(t,e){var i=this,r=ur._plugins.slice(0);r.reverse(),r.forEach(function(t){t.destroy.call(i)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null,this._options=null},Object.defineProperties(ur.prototype,lr),ur._plugins=[];var cr=function(){};cr.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},cr.destroy=function(){this.resizeTo=null,this.resize=null},ur.registerPlugin(cr);
/*!
* @pixi/extract - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/extract is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var dr=new Ot,pr=function(t){this.renderer=t,t.extract=this};pr.prototype.image=function(t,e,i){var r=new Image;return r.src=this.base64(t,e,i),r},pr.prototype.base64=function(t,e,i){return this.canvas(t).toDataURL(e,i)},pr.prototype.canvas=function(t){var e,i,r,n=this.renderer,s=!1,o=!1;t&&(t instanceof Te?r=t:(r=this.renderer.generateTexture(t),o=!0)),r?(e=r.baseTexture.resolution,i=r.frame,s=!1,n.renderTexture.bind(r)):(e=this.renderer.resolution,s=!0,(i=dr).width=this.renderer.width,i.height=this.renderer.height,n.renderTexture.bind(null));var a=Math.floor(i.width*e+1e-4),h=Math.floor(i.height*e+1e-4),u=new ht(a,h,1),l=new Uint8Array(4*a*h),c=n.gl;c.readPixels(i.x*e,i.y*e,a,h,c.RGBA,c.UNSIGNED_BYTE,l);var d=u.context.getImageData(0,0,a,h);return pr.arrayPostDivide(l,d.data),u.context.putImageData(d,0,0),s&&(u.context.scale(1,-1),u.context.drawImage(u.canvas,0,-h)),o&&r.destroy(!0),u.canvas},pr.prototype.pixels=function(t){var e,i,r,n=this.renderer,s=!1;t&&(t instanceof Te?r=t:(r=this.renderer.generateTexture(t),s=!0)),r?(e=r.baseTexture.resolution,i=r.frame,n.renderTexture.bind(r)):(e=n.resolution,(i=dr).width=n.width,i.height=n.height,n.renderTexture.bind(null));var o=i.width*e,a=i.height*e,h=new Uint8Array(4*o*a),u=n.gl;return u.readPixels(i.x*e,i.y*e,o,a,u.RGBA,u.UNSIGNED_BYTE,h),s&&r.destroy(!0),pr.arrayPostDivide(h,h),h},pr.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},pr.arrayPostDivide=function(t,e){for(var i=0;i<t.length;i+=4){var r=e[i+3]=t[i+3];0!==r?(e[i]=Math.round(Math.min(255*t[i]/r,255)),e[i+1]=Math.round(Math.min(255*t[i+1]/r,255)),e[i+2]=Math.round(Math.min(255*t[i+2]/r,255))):(e[i]=t[i],e[i+1]=t[i+1],e[i+2]=t[i+2])}};var fr=i(3),vr=i.n(fr),yr=i(0),mr=i.n(yr);
/*!
* resource-loader - v3.0.1
* https://github.com/pixijs/pixi-sound
* Compiled Tue, 02 Jul 2019 14:06:18 UTC
*
* resource-loader is licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license
*/
function gr(){}function _r(t,e,i,r){var n=0,s=t.length;!function o(a){a||n===s?i&&i(a):r?setTimeout(function(){e(t[n++],o)},1):e(t[n++],o)}()}function xr(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function br(t,e){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var i=0,r={_tasks:[],concurrency:e,saturated:gr,unsaturated:gr,buffer:e/4,empty:gr,drain:gr,error:gr,started:!1,paused:!1,push:function(t,e){n(t,!1,e)},kill:function(){i=0,r.drain=gr,r.started=!1,r._tasks=[]},unshift:function(t,e){n(t,!0,e)},process:function(){for(;!r.paused&&i<r.concurrency&&r._tasks.length;){var e=r._tasks.shift();0===r._tasks.length&&r.empty(),(i+=1)===r.concurrency&&r.saturated(),t(e.data,xr(s(e)))}},length:function(){return r._tasks.length},running:function(){return i},idle:function(){return r._tasks.length+i===0},pause:function(){!0!==r.paused&&(r.paused=!0)},resume:function(){if(!1!==r.paused){r.paused=!1;for(var t=1;t<=r.concurrency;t++)r.process()}}};function n(t,e,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout(function(){return r.drain()},1);else{var n={data:t,callback:"function"==typeof i?i:gr};e?r._tasks.unshift(n):r._tasks.push(n),setTimeout(function(){return r.process()},1)}}function s(t){return function(){i-=1,t.callback.apply(t,arguments),null!=arguments[0]&&r.error(arguments[0],t.data),i<=r.concurrency-r.buffer&&r.unsaturated(),r.idle()&&r.drain(),r.process()}}return r}var Tr={};function wr(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Er(t,e,i){return e&&wr(t.prototype,e),i&&wr(t,i),t}var Sr=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),Ar=null;function Or(){}var Pr=function(){function t(e,i,r){if("string"!=typeof e||"string"!=typeof i)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===i.indexOf("data:")),this.name=e,this.url=i,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=Or,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 mr.a,this.onProgress=new mr.a,this.onComplete=new mr.a,this.onAfterMiddleware=new mr.a}t.setExtensionLoadType=function(e,i){Ir(t._loadTypeMap,e,i)},t.setExtensionXhrType=function(e,i){Ir(t._xhrTypeMap,e,i)};var e=t.prototype;return e.complete=function(){this._clearEvents(),this._finish()},e.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()}},e.load=function(e){var i=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout(function(){return e(i)},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:Sr&&this.crossOrigin?this._loadXdr():this._loadXhr()}},e._hasFlag=function(t){return 0!=(this._flags&t)},e._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},e._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))},e._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)},e._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))},e._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,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(t,this.url[i],Array.isArray(e)?e[i]:e));else{var r=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(r)?r[0]:r))}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)},e._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()},e._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)},e._createSource=function(t,e,i){i||(i=t+"/"+this._getExtension(e));var r=document.createElement("source");return r.src=e,r.type=i,r},e._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},e._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},e._onTimeout=function(){this.abort("Load timed out.")},e._xhrOnError=function(){var t=this.xhr;this.abort(Cr(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},e._xhrOnTimeout=function(){var t=this.xhr;this.abort(Cr(t)+" Request timed out.")},e._xhrOnAbort=function(){var t=this.xhr;this.abort(Cr(t)+" Request was aborted by the user.")},e._xhrOnLoad=function(){var e=this.xhr,i="",r=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(i=e.responseText),0===r&&(i.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),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(i,"text/xml")}else{var s=document.createElement("div");s.innerHTML=i,this.data=s}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},e._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,Ar||(Ar=document.createElement("a")),Ar.href=t;var i=!(t=vr()(Ar.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,r=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&r===e.protocol?"":"anonymous"},e._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},e._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},e._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var r=t.indexOf("?"),n=t.indexOf("#"),s=Math.min(r>-1?r:t.length,n>-1?n:t.length);e=(t=t.substring(0,s)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},e._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"}},Er(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 Ir(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function Cr(t){return t.toString().replace("object ","")}Pr.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},Pr.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},Pr.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},Pr.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},Pr._loadTypeMap={gif:Pr.LOAD_TYPE.IMAGE,png:Pr.LOAD_TYPE.IMAGE,bmp:Pr.LOAD_TYPE.IMAGE,jpg:Pr.LOAD_TYPE.IMAGE,jpeg:Pr.LOAD_TYPE.IMAGE,tif:Pr.LOAD_TYPE.IMAGE,tiff:Pr.LOAD_TYPE.IMAGE,webp:Pr.LOAD_TYPE.IMAGE,tga:Pr.LOAD_TYPE.IMAGE,svg:Pr.LOAD_TYPE.IMAGE,"svg+xml":Pr.LOAD_TYPE.IMAGE,mp3:Pr.LOAD_TYPE.AUDIO,ogg:Pr.LOAD_TYPE.AUDIO,wav:Pr.LOAD_TYPE.AUDIO,mp4:Pr.LOAD_TYPE.VIDEO,webm:Pr.LOAD_TYPE.VIDEO},Pr._xhrTypeMap={xhtml:Pr.XHR_RESPONSE_TYPE.DOCUMENT,html:Pr.XHR_RESPONSE_TYPE.DOCUMENT,htm:Pr.XHR_RESPONSE_TYPE.DOCUMENT,xml:Pr.XHR_RESPONSE_TYPE.DOCUMENT,tmx:Pr.XHR_RESPONSE_TYPE.DOCUMENT,svg:Pr.XHR_RESPONSE_TYPE.DOCUMENT,tsx:Pr.XHR_RESPONSE_TYPE.DOCUMENT,gif:Pr.XHR_RESPONSE_TYPE.BLOB,png:Pr.XHR_RESPONSE_TYPE.BLOB,bmp:Pr.XHR_RESPONSE_TYPE.BLOB,jpg:Pr.XHR_RESPONSE_TYPE.BLOB,jpeg:Pr.XHR_RESPONSE_TYPE.BLOB,tif:Pr.XHR_RESPONSE_TYPE.BLOB,tiff:Pr.XHR_RESPONSE_TYPE.BLOB,webp:Pr.XHR_RESPONSE_TYPE.BLOB,tga:Pr.XHR_RESPONSE_TYPE.BLOB,json:Pr.XHR_RESPONSE_TYPE.JSON,text:Pr.XHR_RESPONSE_TYPE.TEXT,txt:Pr.XHR_RESPONSE_TYPE.TEXT,ttf:Pr.XHR_RESPONSE_TYPE.BUFFER,otf:Pr.XHR_RESPONSE_TYPE.BUFFER},Pr.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";var Dr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var Mr=window.URL||window.webkitURL;var Rr={caching:function(t,e){var i=this;Tr[t.url]?(t.data=Tr[t.url],t.complete()):t.onComplete.once(function(){return Tr[i.url]=i.data}),e()},parsing:function(t,e){if(t.data){if(t.xhr&&t.xhrType===Pr.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=Mr.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=Pr.TYPE.IMAGE,void(t.data.onload=function(){Mr.revokeObjectURL(i),t.data.onload=null,e()})}}else{var r=t.xhr.getResponseHeader("content-type");if(r&&0===r.indexOf("image"))return t.data=new Image,t.data.src="data:"+r+";base64,"+function(t){for(var e="",i=0;i<t.length;){for(var r=[0,0,0],n=[0,0,0,0],s=0;s<r.length;++s)i<t.length?r[s]=255&t.charCodeAt(i++):r[s]=0;switch(n[0]=r[0]>>2,n[1]=(3&r[0])<<4|r[1]>>4,n[2]=(15&r[1])<<2|r[2]>>6,n[3]=63&r[2],i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var o=0;o<n.length;++o)e+=Dr.charAt(n[o])}return e}(t.xhr.responseText),t.type=Pr.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}},Lr=/(#[\w-]+)?$/,Nr=function(){function t(e,i){var r=this;void 0===e&&(e=""),void 0===i&&(i=10),this.baseUrl=e,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this._queue=br(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new mr.a,this.onError=new mr.a,this.onLoad=new mr.a,this.onStart=new mr.a,this.onComplete=new mr.a;for(var n=0;n<t._defaultBeforeMiddleware.length;++n)this.pre(t._defaultBeforeMiddleware[n]);for(var s=0;s<t._defaultAfterMiddleware.length;++s)this.use(t._defaultAfterMiddleware[s])}var e=t.prototype;return e.add=function(t,e,i,r){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"==typeof t&&(r=e||t.callback||t.onComplete,i=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(r=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof i&&(r=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 Pr(t,e,i),"function"==typeof r&&this.resources[t].onAfterMiddleware.once(r),this.loading){for(var s=i.parentResource,o=[],a=0;a<s.children.length;++a)s.children[a].isComplete||o.push(s.children[a]);var h=s.progressChunk*(o.length+1)/(o.length+2);s.children.push(this.resources[t]),s.progressChunk=h;for(var u=0;u<o.length;++u)o[u].progressChunk=h;this.resources[t].progressChunk=h}return this._queue.push(this.resources[t]),this},e.pre=function(t){return this._beforeMiddleware.push(t),this},e.use=function(t){return this._afterMiddleware.push(t),this},e.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},e.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,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},e._prepareUrl=function(t){var e,i=vr()(t,{strictMode:!0});if(e=i.protocol||!i.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 r=Lr.exec(e)[0];-1!==(e=e.substr(0,e.length-r.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=r}return e},e._loadResource=function(t,e){var i=this;t._dequeue=e,_r(this._beforeMiddleware,function(e,r){e.call(i,t,function(){r(t.isComplete?{}:null)})},function(){t.isComplete?i._onLoad(t):(t._onLoadBinding=t.onComplete.once(i._onLoad,i),t.load())},!0)},e._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},e._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},e._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),_r(this._afterMiddleware,function(i,r){i.call(e,t,r)},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)},Er(t,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t}}]),t}();Nr._defaultBeforeMiddleware=[],Nr._defaultAfterMiddleware=[],Nr.pre=function(t){return Nr._defaultBeforeMiddleware.push(t),Nr},Nr.use=function(t){return Nr._defaultAfterMiddleware.push(t),Nr};
/*!
* @pixi/loaders - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/loaders is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var Fr=function(){};Fr.use=function(t,e){t.data&&t.type===Pr.TYPE.IMAGE&&(t.texture=xe.fromLoader(t.data,t.url,t.name)),e()};var Ur=function(t){function e(i,r){var n=this;t.call(this,i,r),F.a.call(this);for(var s=0;s<e._plugins.length;++s){var o=e._plugins[s],a=o.pre,h=o.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,i){return n.emit("error",t,e,i)}),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 i={shared:{configurable:!0}};return e.prototype.destroy=function(){this._protected||(this.removeAllListeners(),this.reset())},i.shared.get=function(){var t=e._shared;return t||((t=new e)._protected=!0,e._shared=t),t},Object.defineProperties(e,i),e}(Nr);Object.assign(Ur.prototype,F.a.prototype),Ur._plugins=[],Ur.registerPlugin=function(t){return Ur._plugins.push(t),t.add&&t.add(),Ur},Ur.registerPlugin({use:Rr.parsing}),Ur.registerPlugin(Fr);var kr=function(){};kr.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?Ur.shared:new Ur},kr.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)};var Br=Pr,jr=function(t,e,i){this.geometry=new Me,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var r=0;r<t.length;++r){var n=t[r];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||A.FLOAT,offset:n.offset},e[r]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};
/*!
* @pixi/particles - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/particles is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/jr.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new Ae(function(t,e){void 0===e&&(e=null);var i=6*t;if((e=e||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+i);for(var r=0,n=0;r<i;r+=6,n+=4)e[r+0]=n+0,e[r+1]=n+1,e[r+2]=n+2,e[r+3]=n+0,e[r+4]=n+2,e[r+5]=n+3;return e}(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i){var r=this.dynamicProperties[i];r.offset=e,e+=r.size,this.dynamicStride+=r.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new Ae(this.dynamicData,!1,!1);var s=0;this.staticStride=0;for(var o=0;o<this.staticProperties.length;++o){var a=this.staticProperties[o];a.offset=s,s+=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 Ae(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===A.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===A.UNSIGNED_BYTE,d.type,4*this.staticStride,4*d.offset)}},jr.prototype.uploadDynamic=function(t,e,i){for(var r=0;r<this.dynamicProperties.length;r++){var n=this.dynamicProperties[r];n.uploadFunction(t,e,i,n.type===A.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},jr.prototype.uploadStatic=function(t,e,i){for(var r=0;r<this.staticProperties.length;r++){var n=this.staticProperties[r];n.uploadFunction(t,e,i,n.type===A.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},jr.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 Xr="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n",Hr="varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",Gr=function(t){function e(e){t.call(this,e),this.shader=null,this.properties=null,this.tempMatrix=new mt,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:A.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=mi.from(Xr,Hr,{}),this.state=_i.for2d()}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,i=t._maxSize,r=t._batchSize,n=this.renderer,s=e.length;if(0!==s){s>i&&!t.autoResize&&(s=i);var o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.state.blendMode=W(t.blendMode,a.alphaMode),n.state.set(this.state);var h,u,l,c,d=n.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=(h=t.tintRgb,u=t.worldAlpha,l=this.shader.uniforms.uColor,c=a.alphaMode,l=l||new Float32Array(4),c||void 0===c?(l[0]=h[0]*u,l[1]=h[1]*u,l[2]=h[2]*u):(l[0]=h[0],l[1]=h[1],l[2]=h[2]),l[3]=u,l),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var f=!1,v=0,y=0;v<s;v+=r,y+=1){var m=s-v;m>r&&(m=r),y>=o.length&&o.push(this._generateOneMoreBuffer(t));var g=o[y];g.uploadDynamic(e,v,m);var _=t._bufferUpdateIDs[y]||0;(f=f||g._updateID<_)&&(g._updateID=t._updateID,g.uploadStatic(e,v,m)),n.geometry.bind(g.geometry),d.drawElements(d.TRIANGLES,6*m,d.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,n=t._properties,s=0;s<i;s+=r)e.push(new jr(this.properties,n,r));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new jr(this.properties,i,e)},e.prototype.uploadVertices=function(t,e,i,r,n,s){for(var o=0,a=0,h=0,u=0,l=0;l<i;++l){var c=t[e+l],d=c._texture,p=c.scale.x,f=c.scale.y,v=d.trim,y=d.orig;v?(o=(a=v.x-c.anchor.x*y.width)+v.width,h=(u=v.y-c.anchor.y*y.height)+v.height):(o=y.width*(1-c.anchor.x),a=y.width*-c.anchor.x,h=y.height*(1-c.anchor.y),u=y.height*-c.anchor.y),r[s]=a*p,r[s+1]=u*f,r[s+n]=o*p,r[s+n+1]=u*f,r[s+2*n]=o*p,r[s+2*n+1]=h*f,r[s+3*n]=a*p,r[s+3*n+1]=h*f,s+=4*n}},e.prototype.uploadPosition=function(t,e,i,r,n,s){for(var o=0;o<i;o++){var a=t[e+o].position;r[s]=a.x,r[s+1]=a.y,r[s+n]=a.x,r[s+n+1]=a.y,r[s+2*n]=a.x,r[s+2*n+1]=a.y,r[s+3*n]=a.x,r[s+3*n+1]=a.y,s+=4*n}},e.prototype.uploadRotation=function(t,e,i,r,n,s){for(var o=0;o<i;o++){var a=t[e+o].rotation;r[s]=a,r[s+n]=a,r[s+2*n]=a,r[s+3*n]=a,s+=4*n}},e.prototype.uploadUvs=function(t,e,i,r,n,s){for(var o=0;o<i;++o){var a=t[e+o]._texture._uvs;a?(r[s]=a.x0,r[s+1]=a.y0,r[s+n]=a.x1,r[s+n+1]=a.y1,r[s+2*n]=a.x2,r[s+2*n+1]=a.y2,r[s+3*n]=a.x3,r[s+3*n+1]=a.y3,s+=4*n):(r[s]=0,r[s+1]=0,r[s+n]=0,r[s+n+1]=0,r[s+2*n]=0,r[s+2*n+1]=0,r[s+3*n]=0,r[s+3*n+1]=0,s+=4*n)}},e.prototype.uploadTint=function(t,e,i,r,n,s){for(var o=0;o<i;++o){var a=t[e+o],h=a._texture.baseTexture.alphaMode>0,u=a.alpha,l=u<1&&h?q(a._tintRGB,u):a._tintRGB+(255*u<<24);r[s]=l,r[s+n]=l,r[s+2*n]=l,r[s+3*n]=l,s+=4*n}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(Be),zr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||Number.isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},Yr=function(){this.reset()};Yr.prototype.clone=function(){var t=new Yr;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},Yr.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=xe.WHITE,this.matrix=null,this.visible=!1},Yr.prototype.destroy=function(){this.texture=null,this.matrix=null};var Vr={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,r=t.holes,n=e.points,s=e.indices;if(i.length>=6){for(var o=[],a=0;a<r.length;a++){var h=r[a];o.push(i.length/2),i=i.concat(h.points)}var u=k()(i,o,2);if(!u)return;for(var l=n.length/2,c=0;c<u.length;c+=3)s.push(u[c]+l),s.push(u[c+1]+l),s.push(u[c+2]+l);for(var d=0;d<i.length;d++)n.push(i[d])}}},Wr={build:function(t){var e,i,r=t.shape,n=t.points,s=r.x,o=r.y;if(n.length=0,t.type===ct.CIRC?(e=r.radius,i=r.radius):(e=r.width,i=r.height),0!==e&&0!==i){var a=Math.floor(30*Math.sqrt(r.radius))||Math.floor(15*Math.sqrt(r.width+r.height));a/=2.3;for(var h=2*Math.PI/a,u=0;u<a-.5;u++)n.push(s+Math.sin(-h*u)*e,o+Math.cos(-h*u)*i);n.push(n[0],n[1])}},triangulate:function(t,e){var i=t.points,r=e.points,n=e.indices,s=r.length/2,o=s;r.push(t.shape.x,t.shape.y);for(var a=0;a<i.length;a+=2)r.push(i[a],i[a+1]),n.push(s++,o,s)}},qr={build:function(t){var e=t.shape,i=e.x,r=e.y,n=e.width,s=e.height,o=t.points;o.length=0,o.push(i,r,i+n,r,i+n,r+s,i,r+s)},triangulate:function(t,e){var i=t.points,r=e.points,n=r.length/2;r.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},Kr={build:function(t){var e=t.shape,i=t.points,r=e.x,n=e.y,s=e.width,o=e.height,a=e.radius;i.length=0,Jr(r,n+a,r,n,r+a,n,i),Jr(r+s-a,n,r+s,n,r+s,n+a,i),Jr(r+s,n+o-a,r+s,n+o,r+s-a,n+o,i),Jr(r+a,n+o,r,n+o,r,n+o-a,i)},triangulate:function(t,e){for(var i=t.points,r=e.points,n=e.indices,s=r.length/2,o=k()(i,null,2),a=0,h=o.length;a<h;a+=3)n.push(o[a]+s),n.push(o[a+1]+s),n.push(o[a+2]+s);for(var u=0,l=i.length;u<l;u++)r.push(i[u],i[++u])}};function Zr(t,e,i){return t+(e-t)*i}function Jr(t,e,i,r,n,s,o){void 0===o&&(o=[]);for(var a=o,h=0,u=0,l=0,c=0,d=0,p=0,f=0,v=0;f<=20;++f)h=Zr(t,i,v=f/20),u=Zr(e,r,v),l=Zr(i,n,v),c=Zr(r,s,v),d=Zr(h,l,v),p=Zr(u,c,v),a.push(d,p);return a}function $r(t,e){t.lineStyle.native?function(t,e){var i=0,r=t.shape,n=t.points||r.points,s=r.type!==ct.POLY||r.closeStroke;if(0===n.length)return;var o=e.points,a=e.indices,h=n.length/2,u=o.length/2,l=u;for(o.push(n[0],n[1]),i=1;i<h;i++)o.push(n[2*i],n[2*i+1]),a.push(l,l+1),l++;s&&a.push(l,u)}(t,e):function(t,e){var i=t.shape,r=t.points||i.points.slice(),n=e.closePointEps;if(0===r.length)return;var s=t.lineStyle,o=new dt(r[0],r[1]),a=new dt(r[r.length-2],r[r.length-1]),h=i.type!==ct.POLY||i.closeStroke,u=Math.abs(o.x-a.x)<n&&Math.abs(o.y-a.y)<n;if(h){r=r.slice(),u&&(r.pop(),r.pop(),a.set(r[r.length-2],r[r.length-1]));var l=a.x+.5*(o.x-a.x),c=a.y+.5*(o.y-a.y);r.unshift(l,c),r.push(l,c)}var d=e.points,p=r.length/2,f=r.length,v=d.length/2,y=s.width/2,m=r[0],g=r[1],_=r[2],x=r[3],b=0,T=0,w=-(g-x),E=m-_,S=0,A=0,O=0,P=0,I=Math.sqrt(w*w+E*E);w/=I,E/=I,w*=y,E*=y;var C=s.alignment,D=2*(1-C),M=2*C;d.push(m-w*D,g-E*D),d.push(m+w*M,g+E*M);for(var R=1;R<p-1;++R){m=r[2*(R-1)],g=r[2*(R-1)+1],_=r[2*R],x=r[2*R+1],b=r[2*(R+1)],T=r[2*(R+1)+1],w=-(g-x),E=m-_,I=Math.sqrt(w*w+E*E),w/=I,E/=I,w*=y,E*=y,S=-(x-T),A=_-b,I=Math.sqrt(S*S+A*A),S/=I,A/=I;var L=-E+g-(-E+x),N=-w+_-(-w+m),F=(-w+m)*(-E+x)-(-w+_)*(-E+g),U=-(A*=y)+T-(-A+x),k=-(S*=y)+_-(-S+b),B=(-S+b)*(-A+x)-(-S+_)*(-A+T),j=L*k-U*N;if(Math.abs(j)<.1)j+=10.1,d.push(_-w*D,x-E*D),d.push(_+w*M,x+E*M);else{var X=(N*B-k*F)/j,H=(U*F-L*B)/j,G=(X-_)*(X-_)+(H-x)*(H-x);G>196*y*y?(O=w-S,P=E-A,I=Math.sqrt(O*O+P*P),O/=I,P/=I,O*=y,P*=y,d.push(_-O*D,x-P*D),d.push(_+O*M,x+P*M),d.push(_-O*M*D,x-P*D),f++):(d.push(_+(X-_)*D,x+(H-x)*D),d.push(_-(X-_)*M,x-(H-x)*M))}}m=r[2*(p-2)],g=r[2*(p-2)+1],_=r[2*(p-1)],x=r[2*(p-1)+1],w=-(g-x),E=m-_,I=Math.sqrt(w*w+E*E),w/=I,E/=I,w*=y,E*=y,d.push(_-w*D,x-E*D),d.push(_+w*M,x+E*M);for(var z=e.indices,Y=0;Y<f-2;++Y)z.push(v,v+1,v+2),v++}(t,e)}var Qr=function(t){function e(e,i,r,n,s,o){s=s||n/2;for(var a=-1*Math.PI/2+o,h=2*r,u=ft/h,l=[],c=0;c<h;c++){var d=c%2?s:n,p=c*u+a;l.push(e+d*Math.cos(p),i+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}(Ct),tn=function(){};tn.curveTo=function(t,e,i,r,n,s){var o=s[s.length-2],a=s[s.length-1]-e,h=o-t,u=r-e,l=i-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)return s[s.length-2]===t&&s[s.length-1]===e||s.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,y=n*Math.sqrt(p)/c,m=v*f/d,g=y*f/p,_=v*l+y*h,x=v*u+y*a,b=h*(y+m),T=a*(y+m),w=l*(v+g),E=u*(v+g);return{cx:_+t,cy:x+e,radius:n,startAngle:Math.atan2(T-x,b-_),endAngle:Math.atan2(E-x,w-_),anticlockwise:h*u>l*a}},tn.arc=function(t,e,i,r,n,s,o,a,h){for(var u=o-s,l=zr._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/ft)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),v=l-1,y=v%1/v,m=0;m<=v;++m){var g=c+s+d*(m+y*m),_=Math.cos(g),x=-Math.sin(g);h.push((p*_+f*x)*n+i,(p*-x+f*_)*n+r)}};var en=function(){};en.curveLength=function(t,e,i,r,n,s,o,a){for(var h=0,u=0,l=0,c=0,d=0,p=0,f=0,v=0,y=0,m=0,g=0,_=t,x=e,b=1;b<=10;++b)m=_-(v=(f=(p=(d=1-(u=b/10))*d)*d)*t+3*p*u*i+3*d*(l=u*u)*n+(c=l*u)*o),g=x-(y=f*e+3*p*u*r+3*d*l*s+c*a),_=v,x=y,h+=Math.sqrt(m*m+g*g);return h},en.curveTo=function(t,e,i,r,n,s,o){var a=o[o.length-2],h=o[o.length-1];o.length-=2;var u=zr._segmentsCount(en.curveLength(a,h,t,e,i,r,n,s)),l=0,c=0,d=0,p=0,f=0;o.push(a,h);for(var v=1,y=0;v<=u;++v)d=(c=(l=1-(y=v/u))*l)*l,f=(p=y*y)*y,o.push(d*a+3*c*y*t+3*l*p*i+f*n,d*h+3*c*y*e+3*l*p*r+f*s)};var rn=function(){};rn.curveLength=function(t,e,i,r,n,s){var o=t-2*i+n,a=e-2*r+s,h=2*i-2*t,u=2*r-2*e,l=4*(o*o+a*a),c=4*(o*h+a*u),d=h*h+u*u,p=2*Math.sqrt(l+c+d),f=Math.sqrt(l),v=2*l*f,y=2*Math.sqrt(d),m=c/f;return(v*p+f*c*(p-y)+(4*d*l-c*c)*Math.log((2*f+m+p)/(m+y)))/(4*v)},rn.curveTo=function(t,e,i,r,n){for(var s=n[n.length-2],o=n[n.length-1],a=zr._segmentsCount(rn.curveLength(s,o,t,e,i,r)),h=0,u=0,l=1;l<=a;++l){var c=l/a;h=s+(t-s)*c,u=o+(e-o)*c,n.push(h+(t+(i-t)*c-h)*c,u+(e+(r-e)*c-u)*c)}};var nn=function(){this.reset()};nn.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},nn.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},nn.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0};var sn={};sn[ct.POLY]=Vr,sn[ct.CIRC]=Wr,sn[ct.ELIP]=Wr,sn[ct.RECT]=qr,sn[ct.RREC]=Kr;var on=[],an=[],hn=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};hn.prototype.clone=function(){return new hn(this.shape,this.fillStyle,this.lineStyle,this.matrix)},hn.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 un=new dt,ln=new Mt,cn=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 Mt,this.boundsDirty=-1,this.boundsPadding=0,this.batchable=!1,this.indicesUint16=null,this.uvsFloat32=null,this.closePointEps=1e-4}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={bounds:{configurable:!0}};return i.bounds.get=function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].textures.length=0,an.push(this.drawCalls[t]);this.drawCalls.length=0;for(var e=0;e<this.batches.length;e++){var i=this.batches[e];i.reset(),on.push(i)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,i,r){var n=new hn(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},e.prototype.drawHole=function(t,e){if(!this.graphicsData.length)return null;var i=new hn(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e);for(var i=0;i<this.graphicsData.length;++i)this.graphicsData[i].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,i=0;i<e.length;++i){var r=e[i];if(r.fillStyle.visible&&(r.shape&&(r.matrix?r.matrix.applyInverse(t,un):un.copyFrom(t),r.shape.contains(un.x,un.y)))){var n=!1;if(r.holes)for(var s=0;s<r.holes.length;s++){if(r.holes[s].shape.contains(un.x,un.y)){n=!0;break}}if(!n)return!0}}return!1},e.prototype.updateBatches=function(){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var t=this.uvs,e=this.graphicsData,i=null,r=null;this.batches.length>0&&(r=(i=this.batches[this.batches.length-1]).style);for(var n=this.shapeIndex;n<e.length;n++){this.shapeIndex++;var s=e[n],o=s.fillStyle,a=s.lineStyle;sn[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix);for(var h=0;h<2;h++){var u=0===h?o:a;if(u.visible){var l=u.texture.baseTexture,c=this.indices.length,d=this.points.length/2;l.wrapMode=P.REPEAT,0===h?this.processFill(s):this.processLine(s);var p=this.points.length/2-d;0!==p&&(i&&!this._compareStyles(r,u)&&(i.end(c,d),i=null),i||((i=on.pop()||new nn).begin(u,c,d),this.batches.push(i),r=u),this.addUvs(this.points,t,u.texture,d,p,u.matrix))}}}if(i){var f=this.indices.length,v=this.points.length/2;i.end(f,v)}0!==this.batches.length?(this.indicesUint16=new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()):this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var i=this.graphicsData[t],r=i.fillStyle,n=i.lineStyle;if(r&&!r.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,i=t.length;e<i;e++)for(var r=t[e],n=0;n<r.size;n++){var s=r.start+n;this.indicesUint16[s]=this.indicesUint16[s]-r.attribStart}},e.prototype.isBatchable=function(){for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++oe._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].textures.length=0,an.push(this.drawCalls[e]);this.drawCalls.length=0;var i=this.colors,r=this.textureIds,n=an.pop();n||((n=new Ji).textures=new $i),n.textures.count=0,n.start=0,n.size=0,n.type=w.TRIANGLES;var s=0,o=null,a=0,h=!1,u=w.TRIANGLES,l=0;this.drawCalls.push(n);for(var c=0;c<this.batches.length;c++){var d=this.batches[c],p=d.style,f=p.texture.baseTexture;h!==!!p.native&&(u=(h=!!p.native)?w.LINES:w.TRIANGLES,o=null,s=8,t++),o!==f&&(o=f,f._batchEnabled!==t&&(8===s&&(t++,s=0,n.size>0&&((n=an.pop())||((n=new Ji).textures=new $i),this.drawCalls.push(n)),n.start=l,n.size=0,n.textures.count=0,n.type=u),f.touched=1,f._batchEnabled=t,f._batchLocation=s,f.wrapMode=10497,n.textures.elements[n.textures.count++]=f,s++)),n.size+=d.size,l+=d.size,a=f._batchLocation,this.addColors(i,p.color,p.alpha,d.attribSize),this.addTextureIds(r,a,d.attribSize)}oe._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,n=new ArrayBuffer(3*t.length*4),s=new Float32Array(n),o=new Uint32Array(n),a=0,h=0;h<t.length/2;h++)s[a++]=t[2*h],s[a++]=t[2*h+1],s[a++]=e[2*h],s[a++]=e[2*h+1],o[a++]=i[h],s[a++]=r[h];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),Vr.triangulate(t,this)):sn[t.type].triangulate(t,this)},e.prototype.processLine=function(t){$r(t,this);for(var e=0;e<t.holes.length;e++)$r(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];sn[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,e=ln,i=mt.IDENTITY;this._bounds.clear(),e.clear();for(var r=0;r<this.graphicsData.length;r++){var n=this.graphicsData[r],s=n.shape,o=n.type,a=n.lineStyle,h=n.matrix||mt.IDENTITY,u=0;if(a&&a.visible){var l=a.alignment;u=a.width,o===ct.POLY?u*=.5+Math.abs(.5-l):u*=Math.max(0,l)}i!==h&&(e.isEmpty()||(t.addBoundsMatrix(e,i),e.clear()),i=h),o===ct.RECT||o===ct.RREC?e.addFramePad(s.x,s.y,s.x+s.width,s.y+s.height,u,u):o===ct.CIRC?e.addFramePad(s.x,s.y,s.x,s.y,s.radius+u,s.radius+u):o===ct.ELIP?e.addFramePad(s.x,s.y,s.x,s.y,s.width+u,s.height+u):t.addVerticesMatrix(i,s.points,0,s.points.length,u,u)}e.isEmpty()||t.addBoundsMatrix(e,i),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var r=t[2*i],n=t[2*i+1];t[2*i]=e.a*r+e.c*n+e.tx,t[2*i+1]=e.b*r+e.d*n+e.ty}},e.prototype.addColors=function(t,e,i,r){for(var n=q((e>>16)+(65280&e)+((255&e)<<16),i);r-- >0;)t.push(n)},e.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},e.prototype.addUvs=function(t,e,i,r,n,s){for(var o=0,a=e.length,h=i.frame;o<n;){var u=t[2*(r+o)],l=t[2*(r+o)+1];if(s){var c=s.a*u+s.c*l+s.tx;l=s.b*u+s.d*l+s.ty,u=c}o++,e.push(u/h.width,l/h.height)}var d=i.baseTexture;(h.width<d.width||h.height<d.height)&&this.adjustUvs(e,i,a,n)},e.prototype.adjustUvs=function(t,e,i,r){for(var n=e.baseTexture,s=i+2*r,o=e.frame,a=o.width/n.width,h=o.height/n.height,u=o.x/o.width,l=o.y/o.height,c=Math.floor(t[i]+1e-6),d=Math.floor(t[i+1]+1e-6),p=i+2;p<s;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=i;f<s;f+=2)t[f]=(t[f]+u)*a,t[f+1]=(t[f+1]+l)*h},Object.defineProperties(e.prototype,i),e}(rr);cn.BATCHABLE_SIZE=100;var dn=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}(Yr),pn=new Float32Array(3),fn={},vn=function(t){function e(e){void 0===e&&(e=null),t.call(this),this.geometry=e||new cn,this.geometry.refCount++,this.shader=null,this.state=_i.for2d(),this._fillStyle=new Yr,this._lineStyle=new dn,this._matrix=null,this._holeMode=!1,this.currentPath=null,this.batches=[],this.batchTint=-1,this.vertexData=null,this._transformID=-1,this.batchDirty=-1,this.pluginName="batch",this.tint=16777215,this.blendMode=T.NORMAL}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={blendMode:{configurable:!0},tint:{configurable:!0},fill:{configurable:!0},line:{configurable:!0}};return e.prototype.clone=function(){return this.finishPoly(),new e(this.geometry)},i.blendMode.set=function(t){this.state.blendMode=t},i.blendMode.get=function(){return this.state.blendMode},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t},i.fill.get=function(){return this._fillStyle},i.line.get=function(){return this._lineStyle},e.prototype.lineStyle=function(t){if("number"==typeof t){var e=arguments;t={width:e[0]||0,color:e[1]||0,alpha:void 0!==e[2]?e[2]:1,alignment:void 0!==e[3]?e[3]:.5,native:!!e[4]}}return this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){if("number"==typeof t){nt("v5.2.0","Please use object-based options for Graphics#lineTextureStyle");var e=arguments[0],i=arguments[1],r=arguments[2],n=arguments[3],s=arguments[4],o=arguments[5],a=arguments[6];t={width:e,texture:i,color:r,alpha:n,matrix:s,alignment:o,native:a},Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]})}t=Object.assign({width:0,texture:xe.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1},t),this.currentPath&&this.startPoly();var h=t.width>0&&t.alpha>0;return h?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:h},t)):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 Ct,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Ct,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 i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.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,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),rn.curveTo(t,e,i,r,n),this},e.prototype.bezierCurveTo=function(t,e,i,r,n,s){return this._initCurve(),en.curveTo(t,e,i,r,n,s,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var s=this.currentPath.points,o=tn.curveTo(t,e,i,r,n,s);if(o){var a=o.cx,h=o.cy,u=o.radius,l=o.startAngle,c=o.endAngle,d=o.anticlockwise;this.arc(a,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,r,n,s){if(void 0===s&&(s=!1),r===n)return this;if(!s&&n<=r?n+=ft:s&&r<=n&&(r+=ft),0===n-r)return this;var o=t+Math.cos(r)*i,a=e+Math.sin(r)*i,h=this.geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-o),c=Math.abs(u[u.length-1]-a);l<h&&c<h||u.push(o,a)}else this.moveTo(o,a),u=this.currentPath.points;return tn.arc(o,a,t,e,i,r,n,s,u),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:xe.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){if(t instanceof xe){nt("v5.2.0","Please use object-based options for Graphics#beginTextureFill");var e=arguments[0],i=arguments[1],r=arguments[2],n=arguments[3];t={texture:e,color:i,alpha:r,matrix:n},Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]})}t=Object.assign({texture:xe.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var s=t.alpha>0;return s?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:s},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,r){return this.drawShape(new Ot(t,e,i,r))},e.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new Dt(t,e,i,r,n))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new Pt(t,e,i))},e.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new It(t,e,i,r))},e.prototype.drawPolygon=function(t){var e=arguments,i=t,r=!0;if(i.points&&(r=i.closeStroke,i=i.points),!Array.isArray(i)){i=new Array(arguments.length);for(var n=0;n<i.length;++n)i[n]=e[n]}var s=new Ct(i);return s.closeStroke=r,this.drawShape(s),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,i,r,n,s){return void 0===s&&(s=0),this.drawPolygon(new Qr(t,e,i,r,n,s))},e.prototype.clear=function(){return this.geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){return 1===this.geometry.graphicsData.length&&this.geometry.graphicsData[0].shape.type===ct.RECT&&!this.geometry.graphicsData[0].lineWidth},e.prototype._render=function(t){this.finishPoly();var e=this.geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this.geometry,e=this.blendMode;this.batches=[],this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.vertexData=new Float32Array(t.points);for(var i=0,r=t.batches.length;i<r;i++){var n=t.batches[i],s=n.style.color,o=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),h={vertexData:o,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:z(s),_tintRGB:s,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=h}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,i=this.batches.length;e<i;e++){var r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),i=this.geometry,r=this.tint,n=this.worldAlpha,s=e.uniforms,o=i.drawCalls;s.translationMatrix=this.transform.worldTransform,s.tint[0]=(r>>16&255)/255*n,s.tint[1]=(r>>8&255)/255*n,s.tint[2]=(255&r)/255*n,s.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,h=o.length;a<h;a++)this._renderDrawCallDirect(t,i.drawCalls[a])},e.prototype._renderDrawCallDirect=function(t,e){for(var i=e.textures,r=e.type,n=e.size,s=e.start,o=i.count,a=0;a<o;a++)t.texture.bind(i.elements[a],a);t.geometry.draw(r,n,s)},e.prototype._resolveDirectShader=function(t){var e=this.shader,i=this.pluginName;if(!e){if(!fn[i]){for(var r=new Int32Array(16),n=0;n<16;n++)r[n]=n;var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new mt,default:Fe.from({uSamplers:r},!0)},o=t.plugins[i]._shader.program;fn[i]=new mi(o,s)}e=fn[i]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this.geometry;if(t.graphicsData.length){var e=t.bounds,i=e.minX,r=e.minY,n=e.maxX,s=e.maxY;this._bounds.addFrame(this.transform,i,r,n,s)}},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=z(this.tint,pn),e=0;e<this.batches.length;e++){var i=this.batches[e],r=i._batchRGB,n=(t[0]*r[0]*255<<16)+(t[1]*r[1]*255<<8)+(0|t[2]*r[2]*255);i._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,i=t.b,r=t.c,n=t.d,s=t.tx,o=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+r*d+s,h[u++]=n*d+i*c+o}}},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,i),e}(Nt);vn._TEMP_POINT=new dt;
/*!
* @pixi/sprite - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/sprite is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var yn=new dt,mn=new Uint16Array([0,1,2,0,2,3]),gn=function(t){function e(e){t.call(this),this._anchor=new pt(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||xe.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=mn,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=L.ROUND_PIXELS}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={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._width&&(this.scale.x=tt(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=tt(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._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,s=e.d,o=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]=i*p+n*v+o,h[1]=s*v+r*p+a,h[2]=i*d+n*v+o,h[3]=s*v+r*d+a,h[4]=i*d+n*f+o,h[5]=s*f+r*d+a,h[6]=i*p+n*f+o,h[7]=s*f+r*p+a,this._roundPixels)for(var y=L.RESOLUTION,m=0;m<h.length;++m)h[m]=Math.round((h[m]*y|0)/y)}},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,i=t.orig,r=this._anchor,n=this.transform.worldTransform,s=n.a,o=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=-r._x*i.width,d=c+i.width,p=-r._y*i.height,f=p+i.height;e[0]=s*c+a*p+u,e[1]=h*p+o*c+l,e[2]=s*d+a*p+u,e[3]=h*p+o*d+l,e[4]=s*d+a*f+u,e[5]=h*f+o*d+l,e[6]=s*c+a*f+u,e[7]=h*f+o*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 Ot),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,yn);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,n=0;return yn.x>=r&&yn.x<r+e&&(n=-i*this.anchor.y,yn.y>=n&&yn.y<n+i)},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 i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null,this.shader=null},e.from=function(t,i){return new e(t instanceof xe?t:xe.from(t,i))},i.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},i.roundPixels.get=function(){return this._roundPixels},i.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},i.width.set=function(t){var e=tt(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},i.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},i.height.set=function(t){var e=tt(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){this._anchor.copyFrom(t)},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},i.texture.get=function(){return this._texture},i.texture.set=function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||xe.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,i),e}(Nt),_n=0,xn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:_n,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},bn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Tn=function(t){this.styleID=0,this.reset(),An(this,t,t)},wn={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 En(t){return"number"==typeof t?Y(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function Sn(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=En(t[e]);return t}return En(t)}function An(t,e,i){for(var r in i)Array.isArray(e[r])?t[r]=e[r].slice():t[r]=e[r]}Tn.prototype.clone=function(){var t={};return An(t,this,xn),new Tn(t)},Tn.prototype.reset=function(){An(this,xn,xn)},wn.align.get=function(){return this._align},wn.align.set=function(t){this._align!==t&&(this._align=t,this.styleID++)},wn.breakWords.get=function(){return this._breakWords},wn.breakWords.set=function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},wn.dropShadow.get=function(){return this._dropShadow},wn.dropShadow.set=function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},wn.dropShadowAlpha.get=function(){return this._dropShadowAlpha},wn.dropShadowAlpha.set=function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},wn.dropShadowAngle.get=function(){return this._dropShadowAngle},wn.dropShadowAngle.set=function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},wn.dropShadowBlur.get=function(){return this._dropShadowBlur},wn.dropShadowBlur.set=function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},wn.dropShadowColor.get=function(){return this._dropShadowColor},wn.dropShadowColor.set=function(t){var e=Sn(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},wn.dropShadowDistance.get=function(){return this._dropShadowDistance},wn.dropShadowDistance.set=function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},wn.fill.get=function(){return this._fill},wn.fill.set=function(t){var e=Sn(t);this._fill!==e&&(this._fill=e,this.styleID++)},wn.fillGradientType.get=function(){return this._fillGradientType},wn.fillGradientType.set=function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},wn.fillGradientStops.get=function(){return this._fillGradientStops},wn.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 i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},wn.fontFamily.get=function(){return this._fontFamily},wn.fontFamily.set=function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},wn.fontSize.get=function(){return this._fontSize},wn.fontSize.set=function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},wn.fontStyle.get=function(){return this._fontStyle},wn.fontStyle.set=function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},wn.fontVariant.get=function(){return this._fontVariant},wn.fontVariant.set=function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},wn.fontWeight.get=function(){return this._fontWeight},wn.fontWeight.set=function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},wn.letterSpacing.get=function(){return this._letterSpacing},wn.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},wn.lineHeight.get=function(){return this._lineHeight},wn.lineHeight.set=function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},wn.leading.get=function(){return this._leading},wn.leading.set=function(t){this._leading!==t&&(this._leading=t,this.styleID++)},wn.lineJoin.get=function(){return this._lineJoin},wn.lineJoin.set=function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},wn.miterLimit.get=function(){return this._miterLimit},wn.miterLimit.set=function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},wn.padding.get=function(){return this._padding},wn.padding.set=function(t){this._padding!==t&&(this._padding=t,this.styleID++)},wn.stroke.get=function(){return this._stroke},wn.stroke.set=function(t){var e=Sn(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},wn.strokeThickness.get=function(){return this._strokeThickness},wn.strokeThickness.set=function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},wn.textBaseline.get=function(){return this._textBaseline},wn.textBaseline.set=function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},wn.trim.get=function(){return this._trim},wn.trim.set=function(t){this._trim!==t&&(this._trim=t,this.styleID++)},wn.whiteSpace.get=function(){return this._whiteSpace},wn.whiteSpace.set=function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},wn.wordWrap.get=function(){return this._wordWrap},wn.wordWrap.set=function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},wn.wordWrapWidth.get=function(){return this._wordWrapWidth},wn.wordWrapWidth.set=function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},Tn.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 i=e.length-1;i>=0;i--){var r=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&bn.indexOf(r)<0&&(r='"'+r+'"'),e[i]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(Tn.prototype,wn);var On=function(t,e,i,r,n,s,o,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=n,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h};On.measureText=function(t,e,i,r){void 0===r&&(r=On._canvas),i=null==i?e.wordWrap:i;var n=e.toFontString(),s=On.measureFont(n);0===s.fontSize&&(s.fontSize=e.fontSize,s.ascent=e.fontSize);var o=r.getContext("2d");o.font=n;for(var a=(i?On.wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;l<a.length;l++){var c=o.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||s.fontSize+e.strokeThickness,f=Math.max(p,s.fontSize+e.strokeThickness)+(a.length-1)*(p+e.leading);return e.dropShadow&&(f+=e.dropShadowDistance),new On(t,e,d,f,a,h,p+e.leading,u,s)},On.wordWrap=function(t,e,i){void 0===i&&(i=On._canvas);for(var r=i.getContext("2d"),n=0,s="",o="",a={},h=e.letterSpacing,u=e.whiteSpace,l=On.collapseSpaces(u),c=On.collapseNewlines(u),d=!l,p=e.wordWrapWidth+h,f=On.tokenize(t),v=0;v<f.length;v++){var y=f[v];if(On.isNewline(y)){if(!c){o+=On.addLine(s),d=!l,s="",n=0;continue}y=" "}if(l){var m=On.isBreakingSpace(y),g=On.isBreakingSpace(s[s.length-1]);if(m&&g)continue}var _=On.getFromCache(y,h,a,r);if(_>p)if(""!==s&&(o+=On.addLine(s),s="",n=0),On.canBreakWords(y,e.breakWords))for(var x=On.wordWrapSplit(y),b=0;b<x.length;b++){for(var T=x[b],w=1;x[b+w];){var E=x[b+w],S=T[T.length-1];if(On.canBreakChars(S,E,y,b,e.breakWords))break;T+=E,w++}b+=T.length-1;var A=On.getFromCache(T,h,a,r);A+n>p&&(o+=On.addLine(s),d=!1,s="",n=0),s+=T,n+=A}else{s.length>0&&(o+=On.addLine(s),s="",n=0);var O=v===f.length-1;o+=On.addLine(y,!O),d=!1,s="",n=0}else _+n>p&&(d=!1,o+=On.addLine(s),s="",n=0),(s.length>0||!On.isBreakingSpace(y)||d)&&(s+=y,n+=_)}return o+=On.addLine(s,!1)},On.addLine=function(t,e){return void 0===e&&(e=!0),t=On.trimRight(t),t=e?t+"\n":t},On.getFromCache=function(t,e,i,r){var n=i[t];if(void 0===n){var s=t.length*e;n=r.measureText(t).width+s,i[t]=n}return n},On.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},On.collapseNewlines=function(t){return"normal"===t},On.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!On.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},On.isNewline=function(t){return"string"==typeof t&&On._newlines.indexOf(t.charCodeAt(0))>=0},On.isBreakingSpace=function(t){return"string"==typeof t&&On._breakingSpaces.indexOf(t.charCodeAt(0))>=0},On.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var r=0;r<t.length;r++){var n=t[r];On.isBreakingSpace(n)||On.isNewline(n)?(""!==i&&(e.push(i),i=""),e.push(n)):i+=n}return""!==i&&e.push(i),e},On.canBreakWords=function(t,e){return e},On.canBreakChars=function(t,e,i,r,n){return!0},On.wordWrapSplit=function(t){return t.split("")},On.measureFont=function(t){if(On._fonts[t])return On._fonts[t];var e={},i=On._canvas,r=On._context;r.font=t;var n=On.METRICS_STRING+On.BASELINE_SYMBOL,s=Math.ceil(r.measureText(n).width),o=Math.ceil(r.measureText(On.BASELINE_SYMBOL).width),a=2*o;o=o*On.BASELINE_MULTIPLIER|0,i.width=s,i.height=a,r.fillStyle="#f00",r.fillRect(0,0,s,a),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(n,0,o);var h=r.getImageData(0,0,s,a).data,u=h.length,l=4*s,c=0,d=0,p=!1;for(c=0;c<o;++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=o-c,d=u-l,p=!1,c=a;c>o;--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-o,e.fontSize=e.ascent+e.descent,On._fonts[t]=e,e},On.clearMetrics=function(t){void 0===t&&(t=""),t?delete On._fonts[t]:On._fonts={}};var Pn=function(){try{var t=new OffscreenCanvas(0,0),e=t.getContext("2d");return e&&e.measureText?t:document.createElement("canvas")}catch(t){return document.createElement("canvas")}}();Pn.width=Pn.height=10,On._canvas=Pn,On._context=Pn.getContext("2d"),On._fonts={},On.METRICS_STRING="|ÉqÅ",On.BASELINE_SYMBOL="M",On.BASELINE_MULTIPLIER=1.4,On._newlines=[10,13],On._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var In={texture:!0,children:!1,baseTexture:!0},Cn=function(t){function e(e,i,r){(r=r||document.createElement("canvas")).width=3,r.height=3;var n=xe.from(r);n.orig=new Ot,n.trim=new Ot,t.call(this,n),this.canvas=r,this.context=this.canvas.getContext("2d"),this._resolution=L.RESOLUTION,this._autoResolution=!0,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=i,this.localStyleID=-1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={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 i,r,n=this.context,s=On.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),o=s.width,a=s.height,h=s.lines,u=s.lineHeight,l=s.lineWidths,c=s.maxLineWidth,d=s.fontProperties;this.canvas.width=Math.ceil((Math.max(1,o)+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.lineWidth=e.strokeThickness,n.textBaseline=e.textBaseline,n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit;for(var p,f=e.dropShadow?2:1,v=0;v<f;++v){var y=e.dropShadow&&0===v,m=y?2*a:0,g=m*this.resolution;if(y){n.fillStyle="black",n.strokeStyle="black";var _=e.dropShadowColor,x=z("number"==typeof _?_:("string"==typeof(p=_)&&"#"===p[0]&&(p=p.substr(1)),parseInt(p,16)));n.shadowColor="rgba("+255*x[0]+","+255*x[1]+","+255*x[2]+","+e.dropShadowAlpha+")",n.shadowBlur=e.dropShadowBlur,n.shadowOffsetX=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,n.shadowOffsetY=Math.sin(e.dropShadowAngle)*e.dropShadowDistance+g}else n.fillStyle=this._generateFillStyle(e,h),n.strokeStyle=e.stroke,n.shadowColor=0,n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;for(var b=0;b<h.length;b++)i=e.strokeThickness/2,r=e.strokeThickness/2+b*u+d.ascent,"right"===e.align?i+=c-l[b]:"center"===e.align&&(i+=(c-l[b])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[b],i+e.padding,r+e.padding-m,!0),e.fill&&this.drawLetterSpacing(h[b],i+e.padding,r+e.padding-m)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,e,i,r){void 0===r&&(r=!1);var n=this._style.letterSpacing;if(0!==n)for(var s=e,o=Array.from?Array.from(t):t.split(""),a=this.context.measureText(t).width,h=0,u=0;u<o.length;++u){var l=o[u];r?this.context.strokeText(l,s,i):this.context.fillText(l,s,i),s+=a-(h=this.context.measureText(t.substring(u+1)).width)+n,a=h}else r?this.context.strokeText(t,e,i):this.context.fillText(t,e,i)},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=function(t){var e,i,r,n=t.width,s=t.height,o=t.getContext("2d"),a=o.getImageData(0,0,n,s).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]&&(i=e/4%n,r=~~(e/4/n),null===u.top&&(u.top=r),null===u.left?u.left=i:i<u.left&&(u.left=i),null===u.right?u.right=i+1:u.right<i&&(u.right=i+1),null===u.bottom?u.bottom=r:u.bottom<r&&(u.bottom=r));return null!==u.top&&(n=u.right-u.left,s=u.bottom-u.top+1,l=o.getImageData(u.left,u.top,n,s)),{height:s,width:n,data:l}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var i=this._texture,r=this._style,n=r.trim?0:r.padding,s=i.baseTexture;i.trim.width=i._frame.width=Math.ceil(t.width/this._resolution),i.trim.height=i._frame.height=Math.ceil(t.height/this._resolution),i.trim.x=-n,i.trim.y=-n,i.orig.width=i._frame.width-2*n,i.orig.height=i._frame.height-2*n,this._onTextureUpdate(),s.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.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;if(1===t.fill.length)return t.fill[0];var i,r,n,s,o=t.dropShadow?t.dropShadowDistance:0,a=Math.ceil(this.canvas.width/this._resolution)-o,h=Math.ceil(this.canvas.height/this._resolution)-o,u=t.fill.slice(),l=t.fillGradientStops.slice();if(!l.length)for(var c=u.length+1,d=1;d<c;++d)l.push(d/c);if(u.unshift(t.fill[0]),l.unshift(0),u.push(t.fill[t.fill.length-1]),l.push(1),t.fillGradientType===_n){i=this.context.createLinearGradient(a/2,0,a/2,h),r=(u.length+1)*e.length,n=0;for(var p=0;p<e.length;p++){n+=1;for(var f=0;f<u.length;f++)s="number"==typeof l[f]?l[f]/e.length+p/e.length:n/r,i.addColorStop(s,u[f]),n++}}else{i=this.context.createLinearGradient(0,h/2,a,h/2),r=u.length+1,n=1;for(var v=0;v<u.length;v++)s="number"==typeof l[v]?l[v]:n/r,i.addColorStop(s,u[v]),n++}return i},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},In,e),t.prototype.destroy.call(this,e),this.context=null,this.canvas=null,this._style=null},i.width.get=function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},i.width.set=function(t){this.updateText(!0);var e=tt(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},i.height.get=function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},i.height.set=function(t){this.updateText(!0);var e=tt(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},i.style.get=function(){return this._style},i.style.set=function(t){t=t||{},this._style=t instanceof Tn?t:new Tn(t),this.localStyleID=-1,this.dirty=!0},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.resolution.get=function(){return this._resolution},i.resolution.set=function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},Object.defineProperties(e.prototype,i),e}(gn);
/*!
* @pixi/prepare - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/prepare is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
L.UPLOADS_PER_FRAME=4;var Dn=function(t){this.maxItemsPerFrame=t,this.itemsLeft=0};Dn.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},Dn.prototype.allowedToUpload=function(){return this.itemsLeft-- >0};var Mn=function(t){var e=this;this.limiter=new Dn(L.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(kn),this.registerFindHook(Bn),this.registerFindHook(Rn),this.registerFindHook(Ln),this.registerFindHook(Nn),this.registerUploadHook(Fn),this.registerUploadHook(Un)};function Rn(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var r=0;r<t._textures.length;r++)if(t._textures[r]instanceof xe){var n=t._textures[r].baseTexture;-1===e.indexOf(n)&&(e.push(n),i=!0)}return i}function Ln(t,e){if(t.baseTexture instanceof oe){var i=t.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function Nn(t,e){if(t._texture&&t._texture instanceof xe){var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function Fn(t,e){return e instanceof Cn&&(e.updateText(!0),!0)}function Un(t,e){if(e instanceof Tn){var i=e.toFontString();return On.measureFont(i),!0}return!1}function kn(t,e){if(t instanceof Cn){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function Bn(t,e){return t instanceof Tn&&(-1===e.indexOf(t)&&e.push(t),!0)}Mn.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,Bt.system.addOnce(this.tick,this,Ft.UTILITY))):e&&e()},Mn.prototype.tick=function(){setTimeout(this.delayedTick,0)},Mn.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 i=0,r=this.uploadHooks.length;i<r;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)Bt.system.addOnce(this.tick,this,Ft.UTILITY);else{this.ticking=!1;var n=this.completes.slice(0);this.completes.length=0;for(var s=0,o=n.length;s<o;s++)n[s]()}},Mn.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},Mn.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},Mn.prototype.add=function(t){for(var e=0,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Nt)for(var r=t.children.length-1;r>=0;r--)this.add(t.children[r]);return this},Mn.prototype.destroy=function(){this.ticking&&Bt.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 jn=function(t){function e(e){t.call(this,e),this.uploadHookHelper=this.renderer,this.registerFindHook(Gn),this.registerUploadHook(Xn),this.registerUploadHook(Hn)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Mn);function Xn(t,e){return e instanceof oe&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function Hn(t,e){if(!(e instanceof vn))return!1;var i=e.geometry;e.finishPoly(),i.updateBatches();for(var r=i.batches,n=0;n<r.length;n++){var s=r[n].style.texture;s&&Xn(t,s.baseTexture)}return i.batchable||t.geometry.bind(i,e._resolveDirectShader()),!0}function Gn(t,e){return t instanceof vn&&(e.push(t),!0)}var zn=function(t){this.maxMilliseconds=t,this.frameStart=0};zn.prototype.beginFrame=function(){this.frameStart=Date.now()},zn.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds};
/*!
* @pixi/spritesheet - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/spritesheet is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var Yn=function(t,e,i){void 0===i&&(i=null),this.baseTexture=t,this.textures={},this.animations={},this.data=e,this.resolution=this._updateResolution(i||(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},Vn={BATCH_SIZE:{configurable:!0}};Vn.BATCH_SIZE.get=function(){return 1e3},Yn.prototype._updateResolution=function(t){var e=this.data.meta.scale,i=lt(t,null);return null===i&&(i=void 0!==e?parseFloat(e):1),1!==i&&this.baseTexture.setResolution(i),i},Yn.prototype.parse=function(t){this._batchIndex=0,this._callback=t,this._frameKeys.length<=Yn.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},Yn.prototype._processFrames=function(t){for(var e=t,i=Yn.BATCH_SIZE;e-t<i&&e<this._frameKeys.length;){var r=this._frameKeys[e],n=this._frames[r],s=n.frame;if(s){var o=null,a=null,h=!1!==n.trimmed&&n.sourceSize?n.sourceSize:n.frame,u=new Ot(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution);o=n.rotated?new Ot(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new Ot(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==n.trimmed&&n.spriteSourceSize&&(a=new Ot(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[r]=new xe(this.baseTexture,o,u,a,n.rotated?2:0,n.anchor),xe.addToCache(this.textures[r],r)}e++}},Yn.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var i=0;i<t[e].length;i++){var r=t[e][i];this.animations[e].push(this.textures[r])}}},Yn.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},Yn.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*Yn.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*Yn.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())},0)},Yn.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(Yn,Vn);var Wn=function(){};Wn.use=function(t,e){var i=t.name+"_image";if(t.data&&t.type===Br.TYPE.JSON&&t.data.frames&&!this.resources[i]){var r={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},n=Wn.getResourcePath(t,this.baseUrl);this.add(i,n,r,function(i){if(i.error)e(i.error);else{var r=new Yn(i.texture.baseTexture,t.data,t.url);r.parse(function(){t.spritesheet=r,t.textures=r.textures,e()})}})}else e()},Wn.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:j.a.resolve(t.url.replace(e,""),t.data.meta.image)};
/*!
* @pixi/sprite-tiling - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/sprite-tiling is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
new dt;var qn="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",Kn="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - floor(vTextureCoord - uClampOffset);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",Zn="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",Jn=new mt,$n=function(t){function e(e){t.call(this,e);var i={globals:this.renderer.globalUniforms};this.shader=mi.from(qn,Kn,i),this.simpleShader=mi.from(qn,Zn,i),this.quad=new Le,this.state=_i.for2d()}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,i=this.quad,r=i.vertices;r[0]=r[6]=t._width*-t.anchor.x,r[1]=r[3]=t._height*-t.anchor.y,r[2]=r[4]=t._width*(1-t.anchor.x),r[5]=r[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((r=i.uvs)[0]=r[6]=-t.anchor.x,r[1]=r[3]=-t.anchor.y,r[2]=r[4]=1-t.anchor.x,r[5]=r[7]=1-t.anchor.y),i.invalidate();var n=t._texture,s=n.baseTexture,o=t.tileTransform.localTransform,a=t.uvMatrix,h=s.isPowerOfTwo&&n.frame.width===s.width&&n.frame.height===s.height;h&&(s._glTextures[e.CONTEXT_UID]?h=s.wrapMode!==P.CLAMP:s.wrapMode===P.CLAMP&&(s.wrapMode=P.REPEAT));var u=h?this.simpleShader:this.shader,l=n.width,c=n.height,d=t._width,p=t._height;Jn.set(o.a*l/d,o.b*l/p,o.c*c/d,o.d*c/p,o.tx/d,o.ty/p),Jn.invert(),h?Jn.prepend(a.mapCoord):(u.uniforms.uMapCoord=a.mapCoord.toArray(!0),u.uniforms.uClampFrame=a.uClampFrame,u.uniforms.uClampOffset=a.uClampOffset),u.uniforms.uTransform=Jn.toArray(!0),u.uniforms.uColor=K(t.tint,t.worldAlpha,u.uniforms.uColor,s.alphaMode),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.uSampler=n,e.shader.bind(u),e.geometry.bind(i),this.state.blendMode=W(t.blendMode,s.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(Be),Qn=function(t){function e(e,i){var r=this;void 0===i&&(i={}),t.call(this),this._textWidth=0,this._textHeight=0,this._glyphs=[],this._font={tint:void 0!==i.tint?i.tint:16777215,align:i.align||"left",name:null,size:0},this.font=i.font,this._text=e,this._maxWidth=0,this._maxLineHeight=0,this._letterSpacing=0,this._anchor=new pt(function(){r.dirty=!0},this,0,0),this.dirty=!1,this.roundPixels=L.ROUND_PIXELS,this.updateText()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={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],i=this._font.size/t.size,r=new dt,n=[],s=[],o=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",a=o.length,h=this._maxWidth*t.size/this._font.size,u=null,l=0,c=0,d=0,p=-1,f=0,v=0,y=0,m=0;m<a;m++){var g=o.charCodeAt(m),_=o.charAt(m);if(/(?:\s)/.test(_)&&(p=m,f=l),"\r"!==_&&"\n"!==_){var x=t.chars[g];x&&(u&&x.kerning[u]&&(r.x+=x.kerning[u]),n.push({texture:x.texture,line:d,charCode:g,position:new dt(r.x+x.xOffset+this._letterSpacing/2,r.y+x.yOffset)}),r.x+=x.xAdvance+this._letterSpacing,l=r.x,y=Math.max(y,x.yOffset+x.texture.height),u=g,-1!==p&&h>0&&r.x>h&&(Q(n,1+p-++v,1+m-p),m=p,p=-1,s.push(f),c=Math.max(c,f),d++,r.x=0,r.y+=t.lineHeight,u=null))}else s.push(l),c=Math.max(c,l),++d,++v,r.x=0,r.y+=t.lineHeight,u=null}var b=o.charAt(o.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),s.push(l),c=Math.max(c,l));for(var T=[],w=0;w<=d;w++){var E=0;"right"===this._font.align?E=c-s[w]:"center"===this._font.align&&(E=(c-s[w])/2),T.push(E)}for(var S=n.length,A=this.tint,O=0;O<S;O++){var P=this._glyphs[O];P?P.texture=n[O].texture:((P=new gn(n[O].texture)).roundPixels=this.roundPixels,this._glyphs.push(P)),P.position.x=(n[O].position.x+T[n[O].line])*i,P.position.y=n[O].position.y*i,P.scale.x=P.scale.y=i,P.tint=A,P.parent||this.addChild(P)}for(var I=S;I<this._glyphs.length;++I)this.removeChild(this._glyphs[I]);if(this._textWidth=c*i,this._textHeight=(r.y+t.lineHeight)*i,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=y*i},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)},i.tint.get=function(){return this._font.tint},i.tint.set=function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0},i.align.get=function(){return this._font.align},i.align.set=function(t){this._font.align=t||"left",this.dirty=!0},i.anchor.get=function(){return this._anchor},i.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},i.font.get=function(){return this._font},i.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)},i.text.get=function(){return this._text},i.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},i.maxWidth.get=function(){return this._maxWidth},i.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},i.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},i.textWidth.get=function(){return this.validate(),this._textWidth},i.letterSpacing.get=function(){return this._letterSpacing},i.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},i.textHeight.get=function(){return this.validate(),this._textHeight},e.registerFont=function(t,i){var r={},n=t.getElementsByTagName("info")[0],s=t.getElementsByTagName("common")[0],o=t.getElementsByTagName("page"),a=lt(o[0].getAttribute("file"),L.RESOLUTION),h={};r.font=n.getAttribute("face"),r.size=parseInt(n.getAttribute("size"),10),r.lineHeight=parseInt(s.getAttribute("lineHeight"),10)/a,r.chars={},i instanceof xe&&(i=[i]);for(var u=0;u<o.length;u++){var l=o[u].getAttribute("id"),c=o[u].getAttribute("file");h[l]=i instanceof Array?i[u]:i[c]}for(var d=t.getElementsByTagName("char"),p=0;p<d.length;p++){var f=d[p],v=parseInt(f.getAttribute("id"),10),y=f.getAttribute("page")||0,m=new Ot(parseInt(f.getAttribute("x"),10)/a+h[y].frame.x/a,parseInt(f.getAttribute("y"),10)/a+h[y].frame.y/a,parseInt(f.getAttribute("width"),10)/a,parseInt(f.getAttribute("height"),10)/a);r.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 xe(h[y].baseTexture,m),page:y}}for(var g=t.getElementsByTagName("kerning"),_=0;_<g.length;_++){var x=g[_],b=parseInt(x.getAttribute("first"),10)/a,T=parseInt(x.getAttribute("second"),10)/a,w=parseInt(x.getAttribute("amount"),10)/a;r.chars[T]&&(r.chars[T].kerning[b]=w)}return e.fonts[r.font]=r,r},Object.defineProperties(e.prototype,i),e}(Nt);Qn.fonts={};var ts=function(){};ts.parse=function(t,e){t.bitmapFont=Qn.registerFont(t.data,e)},ts.add=function(){Br.setExtensionXhrType("fnt",Br.XHR_RESPONSE_TYPE.DOCUMENT)},ts.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},ts.use=function(t,e){if(t.data&&t.type===Br.TYPE.XML)if(0!==t.data.getElementsByTagName("page").length&&0!==t.data.getElementsByTagName("info").length&&null!==t.data.getElementsByTagName("info")[0].getAttribute("face")){var i=t.isDataUrl?"":ts.dirname(t.url);t.isDataUrl&&("."===i&&(i=""),this.baseUrl&&i&&"/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(i+="/")),(i=i.replace(this.baseUrl,""))&&"/"!==i.charAt(i.length-1)&&(i+="/");for(var r=t.data.getElementsByTagName("page"),n={},s=function(i){n[i.metadata.pageFile]=i.texture,Object.keys(n).length===r.length&&(ts.parse(t,n),e())},o=0;o<r.length;++o){var a=r[o].getAttribute("file"),h=i+a,u=!1;for(var l in this.resources){var c=this.resources[l];if(c.url===h){c.metadata.pageFile=a,c.texture?s(c):c.onAfterMiddleware.add(s),u=!0;break}}if(!u){var d={crossOrigin:t.crossOrigin,loadType:Br.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:a},t.metadata.imageMetadata),parentResource:t};this.add(h,d,s)}}}else e();else e()};["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");var es="varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",is=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,Zi,es,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},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 i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},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 i=Math.cos(t),r=Math.sin(t),n=1/3,s=(0,Math.sqrt)(n),o=[i+(1-i)*n,n*(1-i)-s*r,n*(1-i)+s*r,0,0,n*(1-i)+s*r,i+n*(1-i),n*(1-i)-s*r,0,0,n*(1-i)-s*r,n*(1-i)+s*r,i+n*(1-i),0,0,0,0,0,1,0];this._loadMatrix(o,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,r=-.5*(i-1),n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,e)},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,i,r,n){var s=((i=i||16770432)>>16&255)/255,o=(i>>8&255)/255,a=(255&i)/255,h=((r=r||3375104)>>16&255)/255,u=(r>>8&255)/255,l=(255&r)/255,c=[.3,.59,.11,0,0,s,o,a,t=t||.2,0,h,u,l,e=e||.15,0,s-h,o-u,a-l,0,0];this._loadMatrix(c,n)},e.prototype.night=function(t,e){var i=[-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(i,e)},e.prototype.predator=function(t,e){var i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)},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)},i.matrix.get=function(){return this.uniforms.m},i.matrix.set=function(t){this.uniforms.m=t},i.alpha.get=function(){return this.uniforms.uAlpha},i.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(e.prototype,i),e}(bi);is.prototype.grayscale=is.prototype.greyscale;
/*!
* @pixi/filter-displacement - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/filter-displacement is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var rs=new mt;Rt.prototype._cacheAsBitmap=!1,Rt.prototype._cacheData=!1;var ns=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(Rt.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new ns),(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))}}}),Rt.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))},Rt.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds().clone();if(this.filters){var r=this.filters[0].padding;i.pad(r)}i.ceil(L.RESOLUTION);var n=t.renderTexture.current,s=t.renderTexture.sourceFrame,o=t.projection.transform,a=Te.create(i.width,i.height),h="cacheAsBitmap_"+it();this._cacheData.textureCacheId=h,oe.addToCache(a.baseTexture,h),xe.addToCache(a,h);var u=rs;u.tx=-i.x,u.ty=-i.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,t.render(this,a,!0,u,!0),t.projection.transform=o,t.renderTexture.bind(n,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var l=new gn(a);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-i.x/i.width,l.anchor.y=-i.y/i.height,l.alpha=e,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)}},Rt.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))},Rt.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),i=this.alpha;this.alpha=1;var r=t.context;e.ceil(L.RESOLUTION);var n=Te.create(e.width,e.height),s="cacheAsBitmap_"+it();this._cacheData.textureCacheId=s,oe.addToCache(n.baseTexture,s),xe.addToCache(n,s);var o=rs;this.transform.localTransform.copyTo(o),o.invert(),o.tx-=e.x,o.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,o,!1),t.context=r,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 gn(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=i,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)}},Rt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},Rt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},Rt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,oe.removeFromCache(this._cacheData.textureCacheId),xe.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Rt.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},
/*!
* @pixi/mixin-get-child-by-name - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/mixin-get-child-by-name is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
Rt.prototype.name=null,Nt.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},
/*!
* @pixi/mixin-get-global-position - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/mixin-get-global-position is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
Rt.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new dt),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};
/*!
* @pixi/mesh - v5.2.1
* Compiled Tue, 28 Jan 2020 23:33:11 UTC
*
* @pixi/mesh is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
var ss=function(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0};ss.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 dt,as=new Ct,hs=function(t){function e(e,i,r,n){void 0===n&&(n=w.TRIANGLES),t.call(this),this.geometry=e,e.refCount++,this.shader=i,this.state=r||_i.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=L.ROUND_PIXELS,this.batchUvs=null}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={uvBuffer:{configurable:!0},verticesBuffer:{configurable:!0},material:{configurable:!0},blendMode:{configurable:!0},roundPixels:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return i.uvBuffer.get=function(){return this.geometry.buffers[1]},i.verticesBuffer.get=function(){return this.geometry.buffers[0]},i.material.set=function(t){this.shader=t},i.material.get=function(){return this.shader},i.blendMode.set=function(t){this.state.blendMode=t},i.blendMode.get=function(){return this.state.blendMode},i.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},i.roundPixels.get=function(){return this._roundPixels},i.tint.get=function(){return this.shader.tint},i.tint.set=function(t){this.shader.tint=t},i.texture.get=function(){return this.shader.texture},i.texture.set=function(t){this.shader.texture=t},e.prototype._render=function(t){var i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===w.TRIANGLES&&i.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.set(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 i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].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 i=this.transform.worldTransform,r=i.a,n=i.b,s=i.c,o=i.d,a=i.tx,h=i.ty,u=this.vertexData,l=0;l<u.length/2;l++){var c=e[2*l],d=e[2*l+1];u[2*l]=r*c+s*d+a,u[2*l+1]=n*c+o*d+h}if(this._roundPixels)for(var p=L.RESOLUTION,f=0;f<u.length;++f)u[f]=Math.round((u[f]*p|0)/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 ss(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,i=as.points,r=this.geometry.getIndex().data,n=r.length,s=4===this.drawMode?3:1,o=0;o+2<n;o+=s){var a=2*r[o],h=2*r[o+1],u=2*r[o+2];if(i[0]=e[a],i[1]=e[a+1],i[2]=e[h],i[3]=e[h+1],i[4]=e[u],i[5]=e[u+1],as.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,i),e}(Nt);hs.BATCHABLE_SIZE=100;Ki.registerPlugin("accessibility",Ut),Ki.registerPlugin("extract",pr),Ki.registerPlugin("interaction",Zt),Ki.registerPlugin("particle",Gr),Ki.registerPlugin("prepare",jn),Ki.registerPlugin("batch",hr),Ki.registerPlugin("tilingSprite",$n),Ur.registerPlugin(ts),Ur.registerPlugin(Wn),ur.registerPlugin(jt),ur.registerPlugin(kr);const us=(t,e,i)=>{let r=[];for(let n=0;n<i;n++){let i=e.replace("%",n);r.push(t[i])}return r};var ls=function(){return{nbTilesX:22,nbTilesY:14,sensitivity:2}};function cs(t){let e=t.clientWidth,i=t.clientHeight;this.width=e,this.height=i,this.aspect=this.width/this.height;const r=this.app=new ur({width:e,height:i});t.appendChild(r.view),this.withApp=t=>t(r),this.bounds=t.getBoundingClientRect();let n=new ds,s=new ps;this.resize=()=>{let e=t.clientWidth,i=t.clientHeight,o=window.devicePixelRatio||1;this.pixelRatio=o,this.width=e,this.height=i,this.aspect=this.width/this.height,this.bounds=t.getBoundingClientRect(),r.resizeTo=t,r.resize(),n.clear(),s.publish()},this.addResizeListener=t=>{s.subscribe(t)},this.responsiveBounds=n.setF(this),this.bindResize=()=>(function(t){e=window,i="resize",r=function(t){return e=>{t.resize()}}(t),e.addEventListener(i,r);var e,i,r})(this)}function ds(){let t=new WeakMap;this.clear=()=>t=new WeakMap,this.setF=(...e)=>i=>()=>{let r=t.get(i);return void 0===r&&t.set(i,r=i(...e)),r}}function ps(){let t=[];this.publish=()=>{t.forEach(t=>t())},this.subscribe=e=>{t.push(e)}}function fs(t=0,e=t){return[t,e]}function vs(t){return[t[0],t[1]]}function ys(t){return(e=t[0],i=t[1])=>(t[0]=e,t[1]=i,t)}function ms(t,e){return t[0]+=e[0],t[1]+=e[1],t}function gs(t,e){return t[0]-=e[0],t[1]-=e[1],t}function _s(t,e){return t[0]*=e[0],t[1]*=e[1],t}function xs(t,e){return t[0]/=e[0],t[1]/=e[1],t}function bs(t,e){return t[0]*=e,t[1]*=e,t}function Ts(t,e,i){t[0]=e[0]*i,t[1]=e[1]*i}function ws(t,e,i){return t[0]+=e[0]*i,t[1]+=e[1]*i,t}function Es(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ss(t){return bs(t,1/Es(t)),t}function As(t,e){return Ss(Ps(e,t))}function Os(t,e){return bs(vs(t),e)}function Ps(t,e){return gs(vs(t),e)}function Is(t,e){return ms(vs(t),e)}const{vec2:Cs}=r;function Ds(){let t=this.data={touches:{}};this.update=e=>{let{current:i}=t;i&&(i.dpos=Ps(i.epos,i.start),i.tapping&&(i.tapping.handled?delete i.tapping:i.tapping.handled=!0),i.ending&&(i.ending.handled?delete t.current:i.ending.handled=!0))},this.bindTouch=()=>(function(t){const e=[],i=function(t){return function(e){const i=Rs(e);t.current={tapping:{},start:i,epos:i,dpos:Cs(0)}}}(t),r=function(t){return function(e){t.current.ending={}}}(t),n=function(t){return function(e){if(t.current){const i=Rs(e);t.current.epos=i}}}(t);return["mousedown","touchstart"].forEach(t=>e.push(Ms(document,t,i))),["mousemove","touchmove"].forEach(t=>e.push(Ms(document,t,n))),["mouseup","touchend"].forEach(t=>e.push(Ms(document,t,r))),()=>{e.forEach(t=>t())}})(this.data)}function Ms(t,e,i){return t.addEventListener(e,i),()=>t.removeEventListener(e,i)}const Rs=t=>t.clientX||0===t.clientX?[t.clientX,t.clientY]:t.touches&&t.targetTouches[0]?[t.targetTouches[0].clientX,t.targetTouches[0].clientY]:void 0;function Ls(){return new Nt}function Ns(t){return new gn(t)}function Fs(t,e){this.A=t,this.B=e;this.Mid=[(t[0]+e[0])/2,(t[1]+e[1])/2];let i=e[0]-t[0],r=e[1]-t[1];this.translate=this.scale=i=>{return new Fs(ms(Os(t,1-i),Os(e,i)),ms(Os(t,i),Os(e,1-i)))},this.pointFrom=(e,n)=>{return[t[0]+i*e-r*n,t[1]+r*e+i*n]}}function Us(t,e){return new Fs(t,e)}function ks(t,e,i,r){return new Bs(t,e,i,r)}function Bs(t,e,i,r){this.width=i,this.height=r,this.x=t,this.y=e;let n=this.x1=t+i,s=this.y1=e+r,o=this.A=[t,e],a=this.B=[t,s],h=this.C=[n,s],u=this.D=[n,e];this.AB=Us(o,a),this.BC=Us(a,h),this.CD=Us(h,u),this.DA=Us(u,o),this.contains=i=>t<i.x&&e<i.y&&n>i.x1&&s>i.y1,this.intersects=i=>!(t>i.x1||i.x>n)&&!(e>i.y1||i.y>s),this.containsPoint=(i,r)=>i>t&&i<n&&r>e&&r<s}Math.PI;function js(t){return(Math.sin(t)+1)/2}function Xs(t,e){e={name:"pool",warnLeak:400,...e};const i=(()=>{let t=0;return()=>t++})();let r=[],n=[];this.name=()=>e.name,this.alives=()=>r.length,this.total=()=>n.length+r.length,this.warnLeak=()=>e.warnLeak,this.toString=()=>`[${this.name()} alives: ${this.alives()} deads: ${n.length}]`,this.acquire=(e=(()=>{}))=>{let s;return this.total()>this.warnLeak()&&(console.warn(`possible pool leak at ${this.name()}.`),this.releaseLast()),e(s=n.length>0?n.pop():t(i())),r.push(s),s},this.acquireLimit=(t,e)=>{for(;this.alives()<e;)this.acquire(t)},this.release=t=>{this.releaseIndex(r.indexOf(t))},this.releaseIndex=t=>{t>-1&&n.push(r.splice(t,1)[0])},this.releaseLast=()=>{this.releaseIndex(0)},this.releaseAll=()=>{n=[...n,...r],r=[]},this.releaseIf=(t,e=(()=>{}))=>{let i=[],s=[];r.forEach(r=>{t(r)?(e(r),i.push(r)):s.push(r)}),r=s,n=[...i,...n]},this.reduce=(t,e)=>r.reduce(t,e),this.map=t=>r.map(t),this.flatMap=t=>r.flatMap(t),this.each=t=>{r.forEach(t)},this.find=t=>r.find(t)}function Hs(){}const{vec2:Gs}=r;function zs({getPosition:t,vWidth:e=100,vHeight:i=100,onOn:r=Hs,onOff:n=Hs,onView:s=Hs}){let o=Gs(0),a=Gs(0),h=new Xs(()=>new Ys(this,t),{name:"Viewport",warnLeak:1e4});const u=()=>Is(o,a),l=t=>{let e=Gs(0);return ms(e,t),gs(e,u()),e};this.addChild=(t,e)=>h.acquire(e=>e.init({item:t,onOn:r,onOff:n,onView:s})),this.removeChild=t=>h.release(t),this.removeChildren=()=>h.releaseAll(),this.drag=(t,e=1)=>(Ts(o,t,-e),this),this.commitDrag=()=>{ms(a,o),bs(o,0)},this.update=t=>{h.each(e=>e.update(t))},this.viewToWorld=t=>(t=>{let e=Gs(0);return ms(e,t),ms(e,u()),e})(t),this.visiblePosition=t=>l(t),this.visible=t=>{let r=l(t);return!(r[0]<0||r[1]<0||r[0]>e||r[1]>i)}}function Ys(t,e){let i,r,n,s,o;const a=()=>e(i);this.visiblePosition=()=>t.visiblePosition(a()),this.init=t=>{o=void 0,i=t.item,r=t.onOn,n=t.onOff,s=t.onView},this.update=t=>{h()?(o||(o=!0,r(i)),s(i,this.visiblePosition())):(o||void 0===o)&&(o=!1,n(i))};const h=()=>t.visible(a())}function Vs(t,e,i,r,n=null,s=4,o=0,a=null){let h=new Bs(t,e,i,r);this.updateWithRectangle=(t,e)=>{t.contains(h)?this.foldChildrenToParent(e):(t.intersects(h)||h.contains(t))&&this.updateChildren(e,(e,i)=>{e.updateWithRectangle(t,i)})},this.updateWithCircle=(t,e)=>{t.containsRect(h)?this.foldChildrenToParent(e):(t.intersectsRect(h)||h.containsPoint(t.x,t.y))&&this.updateChildren(e,(e,i)=>{e.updateWithCircle(t,i)})},this.traverse=t=>{null!==a?a.forEach(e=>e.traverse(t)):t(n,h,o)},this.updateTree=(t,e)=>{if(null===a){let i=e(n);t(this,i)}else a.forEach(i=>{i.updateTree(t,e)})},this.updateChildren=(t,e)=>{s>0?(null===a&&c(t),a.forEach(i=>{e(i,t)}),u()):l(t)};const u=()=>{},l=this.foldChildrenToParent=t=>{a=null,n=t},c=t=>{let e=[{w:0,h:0},{w:1,h:0},{w:0,h:1},{w:1,h:1}];a=[];for(let t=0;t<4;t++){let i=e[t],r=new Vs(h.x+h.width/2*i.w,h.y+h.height/2*i.h,h.width/2,h.height/2,n,s-1,t);a.push(r)}}}function Ws(t,e,i,r,n,s){let o=new Vs(t,e,i,r,n,s);this.traverse=o.traverse,this.modifyByRectangle=(t,e)=>{o.updateWithRectangle(t,e)},this.modifyByCircle=(t,e)=>{o.updateWithCircle(t,e)}}function qs(t,e,i,r,n=8){this.width=i,this.height=r;const s=(o=n,t=>{if(0==o)return t;let e=t%o;return 0==e?t:t-e});var o;const a=(()=>{let s=[];for(let o=t;o<i;o+=n)for(let t=e;t<r;t+=n)s.push([o,t]);return s})(),h=(a.map(Zs),a.map(t=>[t,Zs(t)])),u={visible:!1},l={},c=t=>({hero:!0,part:t});let d=this.tiles={},p=new Ws(t,e,i,r,{visible:!0},8);h.forEach(([t,e])=>{d[e]=new Ks(t)}),this.hideRect=t=>{p.modifyByRectangle(t,u),m()};const f=t=>{let e=[s(t[0]),s(t[1])];return{head:e,torso:ms(vs(e),[0,n]),arms1:ms(vs(e),[n,n]),arms2:ms(vs(e),[-n,n]),legs:ms(vs(e),[0,2*n])}};this.addHero=t=>{let{head:e,torso:i,arms1:r,arms2:n,legs:s}=f(t);y(d[Zs(e)],c("head")),y(d[Zs(i)],c("torso")),y(d[Zs(r)],c("arms1")),y(d[Zs(n)],c("arms2")),y(d[Zs(s)],c("legs"))},this.removeHero=t=>{let{head:e,torso:i,arms1:r,arms2:n,legs:s}=f(t);y(d[Zs(e)],l),y(d[Zs(i)],l),y(d[Zs(r)],l),y(d[Zs(n)],l),y(d[Zs(s)],l)},this.moveHero=(t,e)=>{this.removeHero(t),this.addHero(e)};const v=(t,e)=>t.sync("collision",e),y=(t,e)=>t.sync("entity",e),m=()=>{p.traverse((t,e)=>{for(let i=e.x;i<e.x1;i+=n)for(let r=e.y;r<e.y1;r+=n){let e=[s(i),s(r)],n=Zs(e);v(d[n],t)}})};m()}function Ks(t){let e={};this.pos=t,this.data=()=>e,this.sync=(t,i)=>e[t]=i}const Zs=t=>t[0]+";"+t[1],{vec2:Js}=r;function $s(){let t=[];this.clear=()=>t=[],this.points=()=>t,this.line=e=>{let i=e.A,r=Ps(e.B,i),n=Es(r),s=Os(r,1/n),o=vs(i);for(let e=0;e<n;e++){let e=vs(o);e[0]=Math.round(e[0]),e[1]=Math.round(e[1]),t.push(e),ms(o,s)}},this.bent=(t,e=.2)=>{let i=t.pointFrom(.3,e),r=t.pointFrom(.7,e);this.bezier(i,r,t)},this.bezier=(e,i,r)=>{let n=r.A,s=r.B,o=n[0],a=n[1],h=s[0],u=s[1],l=e[0],c=e[1],d=i[0],p=i[1],f=Es(Ps(s,n)),v=0,y=0,m=0,g=0,_=0;t.push(vs(n));for(let e=1,i=0;e<=f;e++){let r=(m=(y=(v=1-(i=e/f))*v)*v)*o+3*y*i*l+3*v*(g=i*i)*d+(_=g*i)*h,n=m*a+3*y*i*c+3*v*g*p+_*u;t.push([Math.round(r),Math.round(n)])}}}function Qs(){let t=this.cats=[];this.update=e=>{t.forEach(t=>t.update(e))},this.cat=(e,i,r,n)=>{let s=new to(e,i,r,n);t.push(s)}}function to(t,e,i,r){let n=new $s;this.points=n.points;let s=ks(t,e,i,r),o=100*Math.random();this.update=t=>{o+=.01*t,n.clear();let e=s.AB.scale(.94),i=s.BC.scale(.94),r=s.CD.scale(.94),a=s.DA.scale(.94),h=.05*Math.sin(10*o);n.bent(Us(e.A,i.B),.2),n.bent(Us(i.A,r.B),.2),n.bent(Us(r.A,a.B),.2),n.bent(Us(a.A,e.B),.2),n.bent(e,h),n.bent(i,h),n.bent(r,h),n.bent(a,h)}}function eo(t,e){const{canvas:i,textures:r,events:n,config:s}=e;let o=i.responsiveBounds(({width:t,height:e})=>({width:t,height:e}));i.addResizeListener(()=>{d()});let a,h=o(),u=new Xs(()=>Ns(r.hud),{name:"Turtles",warnLeak:1e4}),l=new zs({vWidth:h.width,vHeight:h.height,getPosition:({worm:t})=>t.pos,onOn:t=>{let e=u.acquire(t=>{t.height=8,t.width=8});c.addChild(e),t.dO=e},onOff:t=>{u.release(t.dO),c.removeChild(t.dO),delete t.dO},onView:({dO:t,worm:e},i)=>{let{entity:r,collision:{visible:n}}=e.data();if(t.visible=!!n,r&&r.hero){let{part:e}=r;t.visible=!0}t.position.x=i[0],t.position.y=i[1]}});this.init=t=>{let e=o();(function(t){const{width:e,height:i}=t;let r=.8*i;t.hideRect(ks(0,0,e,r));for(let i=0;i<e;i+=8){let e=64*js(i/32);t.hideRect(ks(i,r,8,e))}})(a=new qs(0,0,e.width,e.height)),a.addHero([10,10]),a.moveHero([10,10],[20,20]),function(t,e){let i={};Object.keys(t).forEach(r=>{i[r]=e(r,t[r])})}(a.tiles,(t,e)=>{l.addChild({worm:e})}),d()};const c=this.container=Ls(),d=()=>{o();c.removeChildren()};this.update=t=>{l.update(t)},this.render=()=>{}}function io(t,e){const{canvas:i,textures:r,events:n,config:s}=e;let o=i.responsiveBounds(({width:t,height:e})=>({width:t,height:e}));i.addResizeListener(()=>{l()});o();let a,h=new Xs(()=>{let t=Ns(r.hud);return t.width=4,t.height=4,t},{name:"Cats",warnLeak:1e3});this.init=t=>{(a=new Qs).cat(50,50,20,20),a.cat(10,10,50,40),l()};const u=this.container=Ls(),l=()=>{o();u.removeChildren()};this.update=t=>{h.each(t=>u.removeChild(t)),h.releaseAll(),a.update(t),a.cats.forEach(t=>{t.points().forEach(([t,e])=>{h.acquire(i=>{i.position.set(4*t,4*e),u.addChild(i)})})})},this.render=()=>{}}function ro(t){let e=new eo(this,t),i=new io(this,t);this.init=t=>{this.data=t,e.init({}),i.init({}),n()},this.update=t=>{e.update(t),i.update(t)};const r=this.container=Ls(),n=()=>{r.addChild(i.container),r.addChild(e.container)};this.render=()=>{e.render(),i.render()}}function no(t,e){const i=ls(),r=new cs(t);let n;Ur.shared.add("orb","data/orb/orb.json").add("heart","data/orb/hearth.json").add("flame","data/orb/flame.json").add("smoke","data/orb/smoke.json").add("magic","data/orb/magic.json").add("hud","data/orb/Sprite-Hud-0001.json").add("moonclouds","data/orb/moonclouds.png").add("mountainstiled","data/orb/mountainstiled.png").load((t,e)=>{const s=function(t){const e=e=>t[e].spritesheet.textures;return{moonclouds:t.moonclouds.texture,mountainstiled:t.mountainstiled.texture,orb:e("orb")["orb.aseprite"],heart:e("heart")["hearth.aseprite"],hud:e("hud")["Sprite-0001."],smoke:us(e("smoke"),"smoke %.aseprite",12),magic:us(e("magic"),"magic %.aseprite",6),flame:us(e("flame"),"flame %.aseprite",6)}}(e),o=new Ds;o.bindTouch(),r.bindResize();(n=new ro({canvas:r,config:i,textures:s,events:o})).init({}),r.withApp(t=>{t.stage.addChild(n.container),t.ticker.add(t=>{o.update(t),n.update(t),n.render()})})})}i.d(e,"app",function(){return no})}]);