/*! * pixi.js - v5.2.4 * compiled sun, 03 may 2020 22:38:52 utc * * pixi.js is licensed under the mit license. * http://www.opensource.org/licenses/mit-license */ var pixi=function(t){"use strict";var e="undefined"!=typeof globalthis?globalthis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t,e){return t(e={exports:{}},e.exports),e.exports}var i=r(function(t,r){!function(t){var e=t.promise,i=e&&"resolve"in e&&"reject"in e&&"all"in e&&"race"in e&&function(){var t;return new e(function(e){t=e}),"function"==typeof t}();r?(r.promise=i?e:t,r.polyfill=t):i||(t.promise=t);var n="pending",o="sealed",s="fulfilled",a="rejected",h=function(){};function u(t){return"[object array]"===object.prototype.tostring.call(t)}var l,c="undefined"!=typeof setimmediate?setimmediate:settimeout,d=[];function p(){for(var t=0;t0?1:-1}),number.isinteger||(number.isinteger=function(t){return"number"==typeof t&&isfinite(t)&&math.floor(t)===t}),window.arraybuffer||(window.arraybuffer=array),window.float32array||(window.float32array=array),window.uint32array||(window.uint32array=array),window.uint16array||(window.uint16array=array),window.uint8array||(window.uint8array=array),window.int32array||(window.int32array=array);var v=/iphone/i,m=/ipod/i,g=/ipad/i,y=/\bios-universal(?:.+)mac\b/i,_=/\bandroid(?:.+)mobile\b/i,x=/android/i,b=/(?:sd4930ur|\bsilk(?:.+)mobile\b)/i,e=/silk/i,t=/windows phone/i,w=/\bwindows(?:.+)arm\b/i,s=/blackberry/i,i=/bb10/i,p=/opera mini/i,a=/\b(crios|chrome)(?:.+)mobile/i,o=/mobile(?:.+)firefox\b/i,d=function(t){return void 0!==t&&"macintel"===t.platform&&"number"==typeof t.maxtouchpoints&&t.maxtouchpoints>1&&"undefined"==typeof msstream};var c=function(t){var e={useragent:"",platform:"",maxtouchpoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.useragent=t:t&&t.useragent&&(e={useragent:t.useragent,platform:t.platform,maxtouchpoints:t.maxtouchpoints||0}):e={useragent:navigator.useragent,platform:navigator.platform,maxtouchpoints:navigator.maxtouchpoints||0};var r=e.useragent,i=r.split("[fban");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("twitter"))[1]&&(r=i[0]);var n=function(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(v)&&!n(t),ipod:n(m),tablet:!n(v)&&(n(g)||d(e))&&!n(t),universal:n(y),device:(n(v)||n(m)||n(g)||n(y)||d(e))&&!n(t)},amazon:{phone:n(b),tablet:!n(b)&&n(e),device:n(b)||n(e)},android:{phone:!n(t)&&n(b)||!n(t)&&n(_),tablet:!n(t)&&!n(b)&&!n(_)&&(n(e)||n(x)),device:!n(t)&&(n(b)||n(e)||n(_)||n(x))||n(/\bokhttp\b/i)},windows:{phone:n(t),tablet:n(w),device:n(t)||n(w)},other:{blackberry:n(s),blackberry10:n(i),opera:n(p),firefox:n(o),chrome:n(a),device:n(s)||n(i)||n(p)||n(o)||n(a)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(window.navigator);var m={mipmap_textures:1,anisotropic_level:0,resolution:1,filter_resolution:1,sprite_max_textures:function(t){var e=!0;if(c.tablet||c.phone){if(e=!1,c.apple.device){var r=navigator.useragent.match(/os (\d+)_(\d+)?/);r&&parseint(r[1],10)>=11&&(e=!0)}if(c.android.device){var i=navigator.useragent.match(/android\s([0-9.]*)/);i&&parseint(i[1],10)>=7&&(e=!0)}}return e?t:4}(32),sprite_batch_size:4096,render_options:{view:null,antialias:!1,forcefxaa:!1,autodensity:!1,transparent:!1,backgroundcolor:0,clearbeforerender:!0,preservedrawingbuffer:!1,width:800,height:600,legacy:!1},gc_mode:0,gc_max_idle:3600,gc_max_check_count:600,wrap_mode:33071,scale_mode:1,precision_vertex:"highp",precision_fragment:c.apple.device?"highp":"mediump",can_upload_same_buffer:!c.apple.device,create_image_bitmap:!1,round_pixels:!1},r=r(function(t){var e=object.prototype.hasownproperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,i,o,s){if("function"!=typeof i)throw new typeerror("the listener must be a function");var a=new n(i,o||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventscount++),t}function s(t,e){0==--t._eventscount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventscount=0}object.create&&(i.prototype=object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventnames=function(){var t,i,n=[];if(0===this._eventscount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return object.getownpropertysymbols?n.concat(object.getownpropertysymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new array(o);n80*r){i=o=t[0],n=s=t[1];for(var f=r;fo&&(o=a),h>s&&(s=h);u=0!==(u=math.max(o-i,s-n))?1/u:0}return k(d,p,r,i,n,u),p}function b(t,e,r,i,n){var o,s;if(n===at(t,e,r,i)>0)for(o=e;o=e;o-=i)s=nt(o,t[o],t[o+1],s);return s&&q(s,s.next)&&(ot(s),s=s.next),s}function u(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!q(i,i.next)&&0!==j(i.prev,i,i.next))i=i.next;else{if(ot(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function k(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=w(n.x,n.y,e,r,i)),n.prevz=n.prev,n.nextz=n.next,n=n.next}while(n!==t);n.prevz.nextz=null,n.prevz=null,function(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextz,a--):(n=i,i=i.nextz,h--),o?o.nextz=n:t=n,n.prevz=o,o=n;r=i}o.nextz=null,u*=2}while(s>1)}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?j(t,i,n,o):x(t))e.push(a.i/r),e.push(t.i/r),e.push(h.i/r),ot(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?k(t=h(u(t),e,r),e,r,i,n,o,2):2===s&&g(t,e,r,i,n,o):k(u(t),e,r,i,n,o,1);break}}}function x(t){var e=t.prev,r=t,i=t.next;if(j(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(k(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&j(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function j(t,e,r,i){var n=t.prev,o=t,s=t.next;if(j(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=w(a,h,e,r,i),d=w(u,l,e,r,i),p=t.prevz,f=t.nextz;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&k(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&j(p.prev,p,p.next)>=0)return!1;if(p=p.prevz,f!==t.prev&&f!==t.next&&k(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&j(f.prev,f,f.next)>=0)return!1;f=f.nextz}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&k(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&j(p.prev,p,p.next)>=0)return!1;p=p.prevz}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&k(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&j(f.prev,f,f.next)>=0)return!1;f=f.nextz}return!0}function h(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!q(n,o)&&$(n,i,i.next,o)&&rt(n,o)&&rt(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),ot(i),ot(i.next),i=t=o),i=i.next}while(i!==t);return u(i)}function g(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&z(s,a)){var h=it(s,a);return s=u(s,s.next),h=u(h,h.next),k(s,e,r,i,n,o),void k(h,e,r,i,n,o)}a=a.next}s=s.next}while(s!==t)}function y(t,e){return t.x-e.x}function v(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&k(or.x||i.x===r.x&&z(r,i)))&&(r=i,d=h)),i=i.next}while(i!==u);return r}(t,e)){var r=it(e,t);u(e,e.next),u(r,r.next)}}function z(t,e){return j(t.prev,t,e.prev)<0&&j(e.next,t,t.next)<0}function w(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function q(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function z(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&$(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(rt(t,e)&&rt(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(j(t.prev,t,e.prev)||j(t,e.prev,e))||q(t,e)&&j(t.prev,t,t.next)>0&&j(e.prev,e,e.next)>0)}function j(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function q(t,e){return t.x===e.x&&t.y===e.y}function $(t,e,r,i){var n=et(j(t,e,r)),o=et(j(t,e,i)),s=et(j(r,i,t)),a=et(j(r,i,e));return n!==o&&s!==a||(!(0!==n||!tt(t,r,e))||(!(0!==o||!tt(t,i,e))||(!(0!==s||!tt(r,t,i))||!(0!==a||!tt(r,e,i)))))}function tt(t,e,r){return e.x<=math.max(t.x,r.x)&&e.x>=math.min(t.x,r.x)&&e.y<=math.max(t.y,r.y)&&e.y>=math.min(t.y,r.y)}function et(t){return t>0?1:t<0?-1:0}function rt(t,e){return j(t.prev,t,t.next)<0?j(t,e,t.next)>=0&&j(t,t.prev,e)>=0:j(t,e,t.prev)<0||j(t,t.next,e)<0}function it(t,e){var r=new st(t.i,t.x,t.y),i=new st(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function nt(t,e,r,i){var n=new st(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function ot(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 st(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevz=null,this.nextz=null,this.steiner=!1}function at(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r},l.default=n;var ht=r(function(t,r){!function(i){var n=r&&!r.nodetype&&r,o=t&&!t.nodetype&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(i=s);var a,h,u=2147483647,l=36,c=1,d=26,p=38,f=700,v=72,m=128,g="-",y=/^xn--/,_=/[^\x20-\x7e]/,x=/[\x2e\u3002\uff0e\uff61]/g,b={overflow:"overflow: input needs wider integers to process","not-basic":"illegal input >= 0x80 (not a basic code point)","invalid-input":"invalid input"},e=l-c,t=math.floor,w=string.fromcharcode;function s(t){throw rangeerror(b[t])}function i(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function p(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+i((t=t.replace(x,".")).split("."),e).join(".")}function a(t){for(var e,r,i=[],n=0,o=t.length;n=55296&&e<=56319&&n65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)}).join("")}function d(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function c(t,e,r){var i=0;for(t=r?t(t/f):t>>1,t+=t(t/e);t>e*d>>1;i+=l)t=t(t/e);return t(i+(e+1)*t/(t+p))}function m(t){var e,r,i,n,o,s,a,h,p,f,y,_=[],x=t.length,b=0,e=m,w=v;for((r=t.lastindexof(g))<0&&(r=0),i=0;i=128&&s("not-basic"),_.push(t.charcodeat(i));for(n=r>0?r+1:0;n=x&&s("invalid-input"),((h=(y=t.charcodeat(n++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:l)>=l||h>t((u-b)/s))&&s("overflow"),b+=h*s,!(h<(p=a<=w?c:a>=w+d?d:a-w));a+=l)s>t(u/(f=l-p))&&s("overflow"),s*=f;w=c(b-o,e=_.length+1,0==o),t(b/e)>u-e&&s("overflow"),e+=t(b/e),b%=e,_.splice(b++,0,e)}return o(_)}function r(t){var e,r,i,n,o,s,a,h,p,f,y,_,x,b,e,i=[];for(_=(t=a(t)).length,e=m,r=0,o=v,s=0;s<_;++s)(y=t[s])<128&&i.push(w(y));for(i=n=i.length,n&&i.push(g);i<_;){for(a=u,s=0;s<_;++s)(y=t[s])>=e&&yt((u-r)/(x=i+1))&&s("overflow"),r+=(a-e)*x,e=a,s=0;s<_;++s)if((y=t[s])u&&s("overflow"),y==e){for(h=r,p=l;!(h<(f=p<=o?c:p>=o+d?d:p-o));p+=l)e=h-f,b=l-f,i.push(w(d(f+e%b,0))),h=t(e/b);i.push(w(d(h,0))),o=c(r,x,i==n),r=0,++i}++r,++e}return i.join("")}if(a={version:"1.3.2",ucs2:{decode:a,encode:o},decode:m,encode:r,toascii:function(t){return p(t,function(t){return _.test(t)?"xn--"+r(t):t})},tounicode:function(t){return p(t,function(t){return y.test(t)?m(t.slice(4).tolowercase()):t})}},n&&o)if(t.exports==n)o.exports=a;else for(h in a)a.hasownproperty(h)&&(n[h]=a[h]);else i.punycode=a}(e)}),ut={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}};ut.isstring,ut.isobject,ut.isnull,ut.isnullorundefined;function lt(t,e){return object.prototype.hasownproperty.call(t,e)}var ct=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxkeys&&(s=i.maxkeys);var a=t.length;s>0&&a>s&&(a=s);for(var h=0;h=0?(u=p.substr(0,f),l=p.substr(f+1)):(u=p,l=""),c=decodeuricomponent(u),d=decodeuricomponent(l),lt(n,c)?array.isarray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},dt=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isfinite(t)?t:"";default:return""}},pt=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?object.keys(t).map(function(i){var n=encodeuricomponent(dt(i))+r;return array.isarray(t[i])?t[i].map(function(t){return n+encodeuricomponent(dt(t))}).join(e):n+encodeuricomponent(dt(t[i]))}).join(e):i?encodeuricomponent(dt(i))+r+encodeuricomponent(dt(t)):""},ft=r(function(t,e){e.decode=e.parse=ct,e.encode=e.stringify=pt}),vt=(ft.decode,ft.parse,ft.encode,ft.stringify,rt),mt=function(t,e){return rt(t,!1,!0).resolve(e)},gt=function(t,e){if(!t)return e;return rt(t,!1,!0).resolveobject(e)},yt=function(t){ut.isstring(t)&&(t=rt(t));if(!(t instanceof xt))return xt.prototype.format.call(t);return t.format()},_t=xt;function xt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var bt=/^([a-z0-9.+-]+:)/i,et=/:[0-9]*$/,tt=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,wt=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),st=["'"].concat(wt),it=["%","/","?",";","#"].concat(st),pt=["/","?","#"],at=/^[+a-z0-9a-z_-]{0,63}$/,ot=/^([+a-z0-9a-z_-]{0,63})(.*)$/,dt={javascript:!0,"javascript:":!0},ct={javascript:!0,"javascript:":!0},mt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function rt(t,e,r){if(t&&ut.isobject(t)&&t instanceof xt)return t;var i=new xt;return i.parse(t,e,r),i}xt.prototype.parse=function(t,e,r){if(!ut.isstring(t))throw new typeerror("parameter 'url' must be a string, not "+typeof t);var i=t.indexof("?"),n=-1!==i&&i127?x+="x":x+=_[b];if(!x.match(at)){var t=g.slice(0,f),w=g.slice(f+1),s=_.match(ot);s&&(t.push(s[1]),w.unshift(s[2])),w.length&&(s="/"+w.join(".")+s),this.hostname=t.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.tolowercase(),m||(this.hostname=ht.toascii(this.hostname));var i=this.port?":"+this.port:"",p=this.hostname||"";this.host=p+i,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!dt[u])for(f=0,y=st.length;f0)&&r.host.split("@"))&&(r.auth=s.shift(),r.host=r.hostname=s.shift());return r.search=t.search,r.query=t.query,ut.isnull(r.pathname)&&ut.isnull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var b=_.slice(-1)[0],e=(r.host||t.host||_.length>1)&&("."===b||".."===b)||""===b,t=0,w=_.length;w>=0;w--)"."===(b=_[w])?_.splice(w,1):".."===b?(_.splice(w,1),t++):t&&(_.splice(w,1),t--);if(!g&&!y)for(;t--;t)_.unshift("..");!g||""===_[0]||_[0]&&"/"===_[0].charat(0)||_.unshift(""),e&&"/"!==_.join("/").substr(-1)&&_.push("");var s,i=""===_[0]||_[0]&&"/"===_[0].charat(0);x&&(r.hostname=r.host=i?"":_.length?_.shift():"",(s=!!(r.host&&r.host.indexof("@")>0)&&r.host.split("@"))&&(r.auth=s.shift(),r.host=r.hostname=s.shift()));return(g=g||r.host&&_.length)&&!i&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),ut.isnull(r.pathname)&&ut.isnull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},xt.prototype.parsehost=function(){var t=this.host,e=et.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var lt,nt,ft,bt,ut,kt,xt,jt,ht,gt,yt,vt,zt,wt,qt={parse:vt,resolve:mt,resolveobject:gt,format:yt,url:_t};(lt=t.env||(t.env={}))[lt.webgl_legacy=0]="webgl_legacy",lt[lt.webgl=1]="webgl",lt[lt.webgl2=2]="webgl2",(nt=t.renderer_type||(t.renderer_type={}))[nt.unknown=0]="unknown",nt[nt.webgl=1]="webgl",nt[nt.canvas=2]="canvas",(ft=t.blend_modes||(t.blend_modes={}))[ft.normal=0]="normal",ft[ft.add=1]="add",ft[ft.multiply=2]="multiply",ft[ft.screen=3]="screen",ft[ft.overlay=4]="overlay",ft[ft.darken=5]="darken",ft[ft.lighten=6]="lighten",ft[ft.color_dodge=7]="color_dodge",ft[ft.color_burn=8]="color_burn",ft[ft.hard_light=9]="hard_light",ft[ft.soft_light=10]="soft_light",ft[ft.difference=11]="difference",ft[ft.exclusion=12]="exclusion",ft[ft.hue=13]="hue",ft[ft.saturation=14]="saturation",ft[ft.color=15]="color",ft[ft.luminosity=16]="luminosity",ft[ft.normal_npm=17]="normal_npm",ft[ft.add_npm=18]="add_npm",ft[ft.screen_npm=19]="screen_npm",ft[ft.none=20]="none",ft[ft.src_over=0]="src_over",ft[ft.src_in=21]="src_in",ft[ft.src_out=22]="src_out",ft[ft.src_atop=23]="src_atop",ft[ft.dst_over=24]="dst_over",ft[ft.dst_in=25]="dst_in",ft[ft.dst_out=26]="dst_out",ft[ft.dst_atop=27]="dst_atop",ft[ft.erase=26]="erase",ft[ft.subtract=28]="subtract",ft[ft.xor=29]="xor",(bt=t.draw_modes||(t.draw_modes={}))[bt.points=0]="points",bt[bt.lines=1]="lines",bt[bt.line_loop=2]="line_loop",bt[bt.line_strip=3]="line_strip",bt[bt.triangles=4]="triangles",bt[bt.triangle_strip=5]="triangle_strip",bt[bt.triangle_fan=6]="triangle_fan",(ut=t.formats||(t.formats={}))[ut.rgba=6408]="rgba",ut[ut.rgb=6407]="rgb",ut[ut.alpha=6406]="alpha",ut[ut.luminance=6409]="luminance",ut[ut.luminance_alpha=6410]="luminance_alpha",ut[ut.depth_component=6402]="depth_component",ut[ut.depth_stencil=34041]="depth_stencil",(kt=t.targets||(t.targets={}))[kt.texture_2d=3553]="texture_2d",kt[kt.texture_cube_map=34067]="texture_cube_map",kt[kt.texture_2d_array=35866]="texture_2d_array",kt[kt.texture_cube_map_positive_x=34069]="texture_cube_map_positive_x",kt[kt.texture_cube_map_negative_x=34070]="texture_cube_map_negative_x",kt[kt.texture_cube_map_positive_y=34071]="texture_cube_map_positive_y",kt[kt.texture_cube_map_negative_y=34072]="texture_cube_map_negative_y",kt[kt.texture_cube_map_positive_z=34073]="texture_cube_map_positive_z",kt[kt.texture_cube_map_negative_z=34074]="texture_cube_map_negative_z",(xt=t.types||(t.types={}))[xt.unsigned_byte=5121]="unsigned_byte",xt[xt.unsigned_short=5123]="unsigned_short",xt[xt.unsigned_short_5_6_5=33635]="unsigned_short_5_6_5",xt[xt.unsigned_short_4_4_4_4=32819]="unsigned_short_4_4_4_4",xt[xt.unsigned_short_5_5_5_1=32820]="unsigned_short_5_5_5_1",xt[xt.float=5126]="float",xt[xt.half_float=36193]="half_float",(jt=t.scale_modes||(t.scale_modes={}))[jt.nearest=0]="nearest",jt[jt.linear=1]="linear",(ht=t.wrap_modes||(t.wrap_modes={}))[ht.clamp=33071]="clamp",ht[ht.repeat=10497]="repeat",ht[ht.mirrored_repeat=33648]="mirrored_repeat",(gt=t.mipmap_modes||(t.mipmap_modes={}))[gt.off=0]="off",gt[gt.pow2=1]="pow2",gt[gt.on=2]="on",(yt=t.alpha_modes||(t.alpha_modes={}))[yt.npm=0]="npm",yt[yt.unpack=1]="unpack",yt[yt.pma=2]="pma",yt[yt.no_premultiplied_alpha=0]="no_premultiplied_alpha",yt[yt.premultiply_on_upload=1]="premultiply_on_upload",yt[yt.premultiply_alpha=2]="premultiply_alpha",(vt=t.gc_modes||(t.gc_modes={}))[vt.auto=0]="auto",vt[vt.manual=1]="manual",(zt=t.precision||(t.precision={})).low="lowp",zt.medium="mediump",zt.high="highp",(wt=t.mask_types||(t.mask_types={}))[wt.none=0]="none",wt[wt.scissor=1]="scissor",wt[wt.stencil=2]="stencil",wt[wt.sprite=3]="sprite",m.retina_prefix=/@([0-9\.]+)x/,m.fail_if_major_performance_caveat=!0;var kt,zt=!1,jt="5.2.4";function qt(t){var e;if(!zt){if(navigator.useragent.tolowercase().indexof("chrome")>-1){var r=["\n %c %c %c pixijs "+jt+" - ✰ "+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,r)}else window.console&&window.console.log("pixijs "+jt+" - "+t+" - http://www.pixijs.com/");zt=!0}}function $t(){return void 0===kt&&(kt=function(){var t={stencil:!0,failifmajorperformancecaveat:m.fail_if_major_performance_caveat};try{if(!window.webglrenderingcontext)return!1;var e=document.createelement("canvas"),r=e.getcontext("webgl",t)||e.getcontext("experimental-webgl",t),i=!(!r||!r.getcontextattributes().stencil);if(r){var n=r.getextension("webgl_lose_context");n&&n.losecontext()}return r=null,i}catch(t){return!1}}()),kt}function te(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function ee(t){var e=t.tostring(16);return"#"+(e="000000".substr(0,6-e.length)+e)}function re(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseint(t,16)}var ie=function(){for(var e=[],r=[],i=0;i<32;i++)e[i]=i,r[i]=i;e[t.blend_modes.normal_npm]=t.blend_modes.normal,e[t.blend_modes.add_npm]=t.blend_modes.add,e[t.blend_modes.screen_npm]=t.blend_modes.screen,r[t.blend_modes.normal]=t.blend_modes.normal_npm,r[t.blend_modes.add]=t.blend_modes.add_npm,r[t.blend_modes.screen]=t.blend_modes.screen_npm;var n=[];return n.push(r),n.push(e),n}();function ne(t,e){return ie[e?1:0][t]}function oe(t,e,r,i){return r=r||new float32array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function se(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function ae(t,e,r,i){return(r=r||new float32array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function he(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new uint16array(r)).length!==r)throw new error("out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function de(t){return!(t&t-1||!t)}function pe(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function fe(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i=0?ye.s:ye.n:2*math.abs(e)<=math.abs(t)?t>0?ye.e:ye.w:e>0?t>0?ye.se:ye.sw:t>0?ye.ne:ye.nw},matrixappendrotationinv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=he[ye.inv(e)];n.tx=r,n.ty=i,t.append(n)}},ve=function(){function t(){this.worldtransform=new fe,this.localtransform=new fe,this.position=new me(this.onchange,this,0,0),this.scale=new me(this.onchange,this,1,1),this.pivot=new me(this.onchange,this,0,0),this.skew=new me(this.updateskew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localid=0,this._currentlocalid=0,this._worldid=0,this._parentid=0}return t.prototype.onchange=function(){this._localid++},t.prototype.updateskew=function(){this._cx=math.cos(this._rotation+this.skew.y),this._sx=math.sin(this._rotation+this.skew.y),this._cy=-math.sin(this._rotation-this.skew.x),this._sy=math.cos(this._rotation-this.skew.x),this._localid++},t.prototype.updatelocaltransform=function(){var t=this.localtransform;this._localid!==this._currentlocalid&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentlocalid=this._localid,this._parentid=-1)},t.prototype.updatetransform=function(t){var e=this.localtransform;if(this._localid!==this._currentlocalid&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentlocalid=this._localid,this._parentid=-1),this._parentid!==t._worldid){var r=t.worldtransform,i=this.worldtransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentid=t._worldid,this._worldid++}},t.prototype.setfrommatrix=function(t){t.decompose(this),this._localid++},object.defineproperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateskew())},enumerable:!0,configurable:!0}),t.identity=new t,t}(),ze=function(){function e(e,r,i,n){void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=number(e),this.y=number(r),this.width=number(i),this.height=number(n),this.type=t.shapes.rect}return object.defineproperty(e.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),object.defineproperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),object.defineproperty(e.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),object.defineproperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),object.defineproperty(e,"empty",{get:function(){return new e(0,0,0,0)},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copyfrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},e.prototype.copyto=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},e.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ee!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r},e}(),ze=function(){function e(e,r,i,n,o){void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=20),this.x=e,this.y=r,this.width=i,this.height=n,this.radius=o,this.type=t.shapes.rrec}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},e}();m.sortable_children=!1;var je=function(){this.minx=1/0,this.miny=1/0,this.maxx=-1/0,this.maxy=-1/0,this.rect=null};je.prototype.isempty=function(){return this.minx>this.maxx||this.miny>this.maxy},je.prototype.clear=function(){this.minx=1/0,this.miny=1/0,this.maxx=-1/0,this.maxy=-1/0},je.prototype.getrectangle=function(t){return this.minx>this.maxx||this.miny>this.maxy?ze.empty:((t=t||new ze(0,0,1,1)).x=this.minx,t.y=this.miny,t.width=this.maxx-this.minx,t.height=this.maxy-this.miny,t)},je.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)},je.prototype.addquad=function(t){var e=this.minx,r=this.miny,i=this.maxx,n=this.maxy,o=t[0],s=t[1];e=oi?o:i,n=s>n?s:n,e=(o=t[2])i?o:i,n=s>n?s:n,e=(o=t[4])i?o:i,n=s>n?s:n,e=(o=t[6])i?o:i,n=s>n?s:n,this.minx=e,this.miny=r,this.maxx=i,this.maxy=n},je.prototype.addframe=function(t,e,r,i,n){this.addframematrix(t.worldtransform,e,r,i,n)},je.prototype.addframematrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minx,d=this.miny,p=this.maxx,f=this.maxy,v=o*e+a*r+u,m=s*e+h*r+l;c=vp?v:p,f=m>f?m:f,c=(v=o*i+a*r+u)p?v:p,f=m>f?m:f,c=(v=o*e+a*n+u)p?v:p,f=m>f?m:f,c=(v=o*i+a*n+u)p?v:p,f=m>f?m:f,this.minx=c,this.miny=d,this.maxx=p,this.maxy=f},je.prototype.addvertexdata=function(t,e,r){for(var i=this.minx,n=this.miny,o=this.maxx,s=this.maxy,a=e;ao?h:o,s=u>s?u:s}this.minx=i,this.miny=n,this.maxx=o,this.maxy=s},je.prototype.addvertices=function(t,e,r,i){this.addverticesmatrix(t.worldtransform,e,r,i)},je.prototype.addverticesmatrix=function(t,e,r,i,n,o){var s=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty;n=n||0,o=o||0;for(var d=this.minx,p=this.miny,f=this.maxx,v=this.maxy,m=r;mi?t.maxx:i,this.maxy=t.maxy>n?t.maxy:n},je.prototype.addboundsmask=function(t,e){var r=t.minx>e.minx?t.minx:e.minx,i=t.miny>e.miny?t.miny:e.miny,n=t.maxxh?n:h,this.maxy=o>u?o:u}},je.prototype.addboundsmatrix=function(t,e){this.addframematrix(e,t.minx,t.miny,t.maxx,t.maxy)},je.prototype.addboundsarea=function(t,e){var r=t.minx>e.x?t.minx:e.x,i=t.miny>e.y?t.miny:e.y,n=t.maxxh?n:h,this.maxy=o>u?o:u}},je.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)},je.prototype.addframepad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minx=this.minxr?this.maxx:r,this.miny=this.minyi?this.maxy:i};var qe=function(t){function e(){t.call(this),this.tempdisplayobjectparent=null,this.transform=new ve,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 je,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 r={_tempdisplayobjectparent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldtransform:{configurable:!0},localtransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zindex:{configurable:!0},worldvisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var r=object.keys(t),i=0;i1)for(var i=0;ithis.children.length)throw new error(t+"addchildat: the index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removechild(t),t.parent=this,this.sortdirty=!0,t.transform._parentid=-1,this.children.splice(e,0,t),this._boundsid++,this.onchildrenchange(e),t.emit("added",this),this.emit("childadded",t,this,e),t},e.prototype.swapchildren=function(t,e){if(t!==e){var r=this.getchildindex(t),i=this.getchildindex(e);this.children[r]=e,this.children[i]=t,this.onchildrenchange(r=this.children.length)throw new error("the index "+e+" supplied is out of bounds "+this.children.length);var r=this.getchildindex(t);fe(this.children,r,1),this.children.splice(e,0,t),this.onchildrenchange(e)},e.prototype.getchildat=function(t){if(t<0||t>=this.children.length)throw new error("getchildat: index ("+t+") does not exist.");return this.children[t]},e.prototype.removechild=function(t){var e=arguments,r=arguments.length;if(r>1)for(var i=0;i0&&o<=n){r=this.children.splice(i,o);for(var s=0;s1&&this.children.sort($e),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 title : "+t.title+"
tabindex: "+t.tabindex},rr.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)},rr.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},rr.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)},rr.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)},rr.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)},rr.prototype._onkeydown=function(t){9===t.keycode&&this.activate()},rr.prototype._onmousemove=function(t){0===t.movementx&&0===t.movementy||this.deactivate()},rr.prototype.destroy=function(){this.destroytouchhook(),this.div=null;for(var t=0;te.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startifpossible(),this},e.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelifneeded(),this},object.defineproperty(e.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestifneeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelifneeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lasttime){if((e=this.elapsedms=t-this.lasttime)>this._maxelapsedms&&(e=this._maxelapsedms),e*=this.speed,this._minelapsedms){var r=t-this._lastframe|0;if(r=0;l--){var c=u[l],d=this.recursivefindhit(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitarea&&e.containspoint&&e.containspoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},pr.prototype.findhit=function(t,e,r,i){this.recursivefindhit(t,e,r,i,!1)};var fr={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};qe.mixin(fr);var vr=1,mr={target:null,data:{global:null}},gr=function(e){function r(t,r){e.call(this),r=r||{},this.renderer=t,this.autopreventdefault=void 0===r.autopreventdefault||r.autopreventdefault,this.interactionfrequency=r.interactionfrequency||10,this.mouse=new hr,this.mouse.identifier=vr,this.mouse.global.set(-999999),this.activeinteractiondata={},this.activeinteractiondata[vr]=this.mouse,this.interactiondatapool=[],this.eventdata=new lr,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 pr,this._usesystemticker=void 0===r.usesystemticker||r.usesystemticker,this.settargetelement(this.renderer.view,this.renderer.resolution)}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;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()},r.prototype.hittest=function(t,e){return mr.target=null,mr.data.global=t,e||(e=this.renderer._lastobjectrendered),this.processinteractive(mr,e,null,!0),mr.target},r.prototype.settargetelement=function(t,e){void 0===e&&(e=1),this.removetickerlistener(),this.removeevents(),this.interactiondomelement=t,this.resolution=e,this.addevents(),this.addtickerlistener()},r.prototype.addtickerlistener=function(){!this.tickeradded&&this.interactiondomelement&&this._usesystemticker&&(sr.system.add(this.tickerupdate,this,t.update_priority.interaction),this.tickeradded=!0)},r.prototype.removetickerlistener=function(){this.tickeradded&&(sr.system.remove(this.tickerupdate,this),this.tickeradded=!1)},r.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)},r.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)},r.prototype.tickerupdate=function(t){this._deltatime+=t,this._deltatime8)throw new error("max arguments reached");var h=this.name,u=this.items;this._aliascount++;for(var l=0,c=u.length;l0&&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(_r.prototype,{dispatch:{value:_r.prototype.emit},run:{value:_r.prototype.emit}});var xr=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 _r("setrealsize",2),this.onupdate=new _r("update"),this.onerror=new _r("onerror",1)},br={valid:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};xr.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)},xr.prototype.unbind=function(t){this.onresize.remove(t),this.onupdate.remove(t),this.onerror.remove(t)},xr.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onresize.run(t,e))},br.valid.get=function(){return!!this._width&&!!this._height},xr.prototype.update=function(){this.destroyed||this.onupdate.run()},xr.prototype.load=function(){return promise.resolve()},br.width.get=function(){return this._width},br.height.get=function(){return this._height},xr.prototype.upload=function(t,e,r){return!1},xr.prototype.style=function(t,e,r){return!1},xr.prototype.dispose=function(){},xr.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(xr.prototype,br);var er=function(e){function r(t){var r=t.naturalwidth||t.videowidth||t.width,i=t.naturalheight||t.videoheight||t.height;e.call(this,r,i),this.source=t,this.nosubimage=!1}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.crossorigin=function(t,e,r){void 0===r&&0!==e.indexof("data:")?t.crossorigin=pe(e):!1!==r&&(t.crossorigin="string"==typeof r?r:"anonymous")},r.prototype.upload=function(e,r,i,n){var o=e.gl,s=r.realwidth,a=r.realheight;return n=n||this.source,o.pixelstorei(o.unpack_premultiply_alpha_webgl,r.alphamode===t.alpha_modes.unpack),this.nosubimage||r.target!==o.texture_2d||i.width!==s||i.height!==a?(i.width=s,i.height=a,o.teximage2d(r.target,0,r.format,r.format,r.type,n)):o.texsubimage2d(o.texture_2d,0,0,0,r.format,r.type,n),!0},r.prototype.update=function(){if(!this.destroyed){var t=this.source.naturalwidth||this.source.videowidth||this.source.width,r=this.source.naturalheight||this.source.videoheight||this.source.height;this.resize(t,r),e.prototype.update.call(this)}},r.prototype.dispose=function(){this.source=null},r}(xr),tr=function(e){function r(t,r){if(r=r||{},!(t instanceof htmlimageelement)){var i=new image;e.crossorigin(i,t,r.crossorigin),i.src=t,t=i}e.call(this,t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preservebitmap=!1,this.createbitmap=(void 0!==r.createbitmap?r.createbitmap:m.create_image_bitmap)&&!!window.createimagebitmap,this.alphamode="number"==typeof r.alphamode?r.alphamode:null,void 0!==r.premultiplyalpha&&(this.premultiplyalpha=r.premultiplyalpha),this.bitmap=null,this._load=null,!1!==r.autoload&&this.load()}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(t){var e=this;return this._load?this._load:(void 0!==t&&(this.createbitmap=t),this._load=new promise(function(t,r){e.url=e.source.src;var i=e.source,n=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?n():(i.onload=n,i.onerror=function(t){r(t),e.onerror.emit(t)})}),this._load)},r.prototype.process=function(){var e=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===t.alpha_modes.unpack?"premultiply":"none"}).then(function(t){return e.destroyed?promise.reject():(e.bitmap=t,e.update(),e._process=null,promise.resolve(e))}),this._process):promise.resolve(this)},r.prototype.upload=function(t,r,i){if("number"==typeof this.alphamode&&(r.alphamode=this.alphamode),!this.createbitmap)return e.prototype.upload.call(this,t,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(e.prototype.upload.call(this,t,r,i,this.bitmap),!this.preservebitmap){var n=!0;for(var o in r._gltextures){var s=r._gltextures[o];if(s!==i&&s.dirtyid!==r.dirtyid){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},r.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,e.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},r}(er),wr=[];function sr(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].tolowercase())}for(var n=wr.length-1;n>=0;--n){var o=wr[n];if(o.test&&o.test(t,r))return new o(t,e)}return new tr(t,e)}var ir=function(e){function r(t,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new error("bufferresource width or height invalid");e.call(this,n,o),this.data=t}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.upload=function(e,r,i){var n=e.gl;return n.pixelstorei(n.unpack_premultiply_alpha_webgl,r.alphamode===t.alpha_modes.unpack),i.width===r.width&&i.height===r.height?n.texsubimage2d(r.target,0,0,0,r.width,r.height,r.format,r.type,this.data):(i.width=r.width,i.height=r.height,n.teximage2d(r.target,0,i.internalformat,r.width,r.height,0,r.format,i.type,this.data)),!0},r.prototype.dispose=function(){this.data=null},r.test=function(t){return t instanceof float32array||t instanceof uint8array||t instanceof uint32array},r}(xr),pr={scalemode:t.scale_modes.nearest,format:t.formats.rgba,alphamode:t.alpha_modes.npm},ar=function(e){function r(r,i){void 0===r&&(r=null),void 0===i&&(i=null),e.call(this);var n=(i=i||{}).alphamode,o=i.mipmap,s=i.anisotropiclevel,a=i.scalemode,h=i.width,u=i.height,l=i.wrapmode,c=i.format,d=i.type,p=i.target,f=i.resolution,v=i.resourceoptions;!r||r instanceof xr||((r=sr(r,v)).internal=!0),this.width=h||0,this.height=u||0,this.resolution=f||m.resolution,this.mipmap=void 0!==o?o:m.mipmap_textures,this.anisotropiclevel=void 0!==s?s:m.anisotropic_level,this.wrapmode=l||m.wrap_mode,this.scalemode=void 0!==a?a:m.scale_mode,this.format=c||t.formats.rgba,this.type=d||t.types.unsigned_byte,this.target=p||t.targets.texture_2d,this.alphamode=void 0!==n?n:t.alpha_modes.unpack,void 0!==i.premultiplyalpha&&(this.premultiplyalpha=i.premultiplyalpha),this.uid=ge(),this.touched=0,this.ispoweroftwo=!1,this._refreshpot(),this._gltextures={},this.dirtyid=0,this.dirtystyleid=0,this.cacheid=null,this.valid=h>0&&u>0,this.texturecacheids=[],this.destroyed=!1,this.resource=null,this._batchenabled=0,this._batchlocation=0,this.setresource(r)}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;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)},r.prototype.setstyle=function(t,e){var r;return void 0!==t&&t!==this.scalemode&&(this.scalemode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtystyleid++,this},r.prototype.setsize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshpot(),this.update(),this},r.prototype.setrealsize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshpot(),this.update(),this},r.prototype._refreshpot=function(){this.ispoweroftwo=de(this.realwidth)&&de(this.realheight)},r.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)},r.prototype.setresource=function(t){if(this.resource===t)return this;if(this.resource)throw new error("resource can be set only once");return t.bind(this),this.resource=t,this},r.prototype.update=function(){this.valid?(this.dirtyid++,this.dirtystyleid++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},r.prototype.onerror=function(t){this.emit("error",this,t)},r.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheid&&(delete ee[this.cacheid],delete be[this.cacheid],this.cacheid=null),this.dispose(),r.removefromcache(this),this.texturecacheids=null,this.destroyed=!0},r.prototype.dispose=function(){this.emit("dispose",this)},r.from=function(t,e,i){void 0===i&&(i=m.strict_texture_cache);var n="string"==typeof t,o=null;n?o=t:(t._pixiid||(t._pixiid="pixiid_"+ge()),o=t._pixiid);var s=ee[o];if(n&&i&&!s)throw new error('the cacheid "'+o+'" does not exist in basetexturecache.');return s||((s=new r(t,e)).cacheid=o,r.addtocache(s,o)),s},r.frombuffer=function(e,i,n,o){e=e||new float32array(i*n*4);var s=new ir(e,{width:i,height:n}),a=e instanceof float32array?t.types.float:t.types.unsigned_byte;return new r(s,object.assign(pr,o||{width:i,height:n,type:a}))},r.addtocache=function(t,e){e&&(-1===t.texturecacheids.indexof(e)&&t.texturecacheids.push(e),ee[e]&&console.warn("basetexture added to the cache with an id ["+e+"] that already had an entry"),ee[e]=t)},r.removefromcache=function(t){if("string"==typeof t){var e=ee[t];if(e){var r=e.texturecacheids.indexof(t);return r>-1&&e.texturecacheids.splice(r,1),delete ee[t],e}}else if(t&&t.texturecacheids){for(var i=0;i]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var rr=function(t){function e(e,r){if(r=r||{},!(e instanceof htmlvideoelement)){var i=document.createelement("video");i.setattribute("preload","auto"),i.setattribute("webkit-playsinline",""),i.setattribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossorigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!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.autoupdate&&!this._isconnectedtoticker&&(sr.shared.add(this.update,this),this._isconnectedtoticker=!0)},e.prototype._onplaystop=function(){this._isconnectedtoticker&&(sr.shared.remove(this.update,this),this._isconnectedtoticker=!1)},e.prototype._oncanplay=function(){var t=this.source;t.removeeventlistener("canplay",this._oncanplay),t.removeeventlistener("canplaythrough",this._oncanplay);var e=this.valid;this.resize(t.videowidth,t.videoheight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._issourceplaying()?this._onplaystart():this.autoplay&&t.play()},e.prototype.dispose=function(){this._isconnectedtoticker&&sr.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)},r.autoupdate.get=function(){return this._autoupdate},r.autoupdate.set=function(t){t!==this._autoupdate&&(this._autoupdate=t,!this._autoupdate&&this._isconnectedtoticker?(sr.shared.remove(this.update,this),this._isconnectedtoticker=!1):this._autoupdate&&!this._isconnectedtoticker&&this._issourceplaying()&&(sr.shared.add(this.update,this),this._isconnectedtoticker=!0))},r.updatefps.get=function(){return this._updatefps},r.updatefps.set=function(t){t!==this._updatefps&&(this._updatefps=t)},e.test=function(t,r){return t instanceof htmlvideoelement||e.types.indexof(r)>-1},object.defineproperties(e.prototype,r),e}(er);rr.types=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"];var lr=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}(er);wr.push(tr,lr,dr,rr,mr,ir,cr,or);var nr={installed:wr,autodetectresource:sr,arrayresource:or,bufferresource:ir,canvasresource:dr,cuberesource:cr,imageresource:tr,imagebitmapresource:lr,svgresource:mr,videoresource:rr,resource:xr,baseimageresource:er},fr=function(t){this.renderer=t};fr.prototype.destroy=function(){this.renderer=null};var br=function(e){function r(){e.apply(this,arguments)}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.upload=function(e,r,i){var n=e.gl;return n.pixelstorei(n.unpack_premultiply_alpha_webgl,r.alphamode===t.alpha_modes.unpack),i.width===r.width&&i.height===r.height?n.texsubimage2d(r.target,0,0,0,r.width,r.height,r.format,r.type,this.data):(i.width=r.width,i.height=r.height,n.teximage2d(r.target,0,1===e.context.webglversion?n.depth_component:n.depth_component16,r.width,r.height,0,r.format,r.type,this.data)),!0},r}(ir),ur=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 _r("disposeframebuffer",2)},kr={colortexture:{configurable:!0}};kr.colortexture.get=function(){return this.colortextures[0]},ur.prototype.addcolortexture=function(e,r){return void 0===e&&(e=0),this.colortextures[e]=r||new ar(null,{scalemode:t.scale_modes.nearest,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyid++,this.dirtyformat++,this},ur.prototype.adddepthtexture=function(e){return this.depthtexture=e||new ar(new br(null,{width:this.width,height:this.height}),{scalemode:t.scale_modes.nearest,resolution:1,width:this.width,height:this.height,mipmap:!1,format:t.formats.depth_component,type:t.types.unsigned_short}),this.dirtyid++,this.dirtyformat++,this},ur.prototype.enabledepth=function(){return this.depth=!0,this.dirtyid++,this.dirtyformat++,this},ur.prototype.enablestencil=function(){return this.stencil=!0,this.dirtyid++,this.dirtyformat++,this},ur.prototype.resize=function(t,e){if(t=math.ceil(t),e=math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyid++,this.dirtysize++;for(var r=0;r-1&&e.texturecacheids.splice(r,1),delete be[t],e}}else if(t&&t.texturecacheids){for(var i=0;ithis.basetexture.width,s=r+n>this.basetexture.height;if(o||s){var a=o&&s?"and":"or",h="x: "+e+" + "+i+" = "+(e+i)+" > "+this.basetexture.width,u="y: "+r+" + "+n+" = "+(r+n)+" > "+this.basetexture.height;throw new error("texture error: frame does not fit inside the base texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.basetexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateuvs()},r.rotate.get=function(){return this._rotate},r.rotate.set=function(t){this._rotate=t,this.valid&&this.updateuvs()},r.width.get=function(){return this.orig.width},r.height.get=function(){return this.orig.height},object.defineproperties(e.prototype,r),e}(r);function yr(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}gr.empty=new gr(new ar),yr(gr.empty),yr(gr.empty.basetexture),gr.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 gr(new ar(new dr(t)))}(),yr(gr.white),yr(gr.white.basetexture);var vr=function(t){function e(e,r){var i=null;if(!(e instanceof xr)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("please use rendertexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new xr({width:n,height:o,scalemode:s,resolution:a})}t.call(this,e,r),this.legacyrenderer=i,this.valid=!0,this.filterframe=null,this.filterpoolkey=null,this.updateuvs()}return t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=math.ceil(t),e=math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.basetexture.resize(t,e),this.updateuvs()},e.prototype.setresolution=function(t){var e=this.basetexture;e.resolution!==t&&(e.setresolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scalemode:arguments[2],resolution:arguments[3]}),new e(new xr(t))},e}(gr),zr=function(t){this.texturepool={},this.textureoptions=t||{},this.enablefullscreen=!1,this._pixelswidth=0,this._pixelsheight=0};zr.prototype.createtexture=function(t,e){var r=new xr(object.assign({width:t,height:e,resolution:1},this.textureoptions));return new vr(r)},zr.prototype.getoptimaltexture=function(t,e,r){void 0===r&&(r=1);var i=zr.screen_key;t*=r,e*=r,this.enablefullscreen&&t===this._pixelswidth&&e===this._pixelsheight||(i=(65535&(t=ce(t)))<<16|65535&(e=ce(e))),this.texturepool[i]||(this.texturepool[i]=[]);var n=this.texturepool[i].pop();return n||(n=this.createtexture(t,e)),n.filterpoolkey=i,n.setresolution(r),n},zr.prototype.getfiltertexture=function(t,e){var r=this.getoptimaltexture(t.width,t.height,e||t.resolution);return r.filterframe=t.filterframe,r},zr.prototype.returntexture=function(t){var e=t.filterpoolkey;t.filterframe=null,this.texturepool[e].push(t)},zr.prototype.returnfiltertexture=function(t){this.returntexture(t)},zr.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturepool){var r=this.texturepool[e];if(r)for(var i=0;i0&&t.height>0,r)for(var i=0;i1){for(var u=0;u=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchlocation=i)},e.prototype.boundarray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h=0&&l=t.env.webgl2&&(i=e.getcontext("webgl2",r)),i)this.webglversion=2;else if(this.webglversion=1,!(i=e.getcontext("webgl",r)||e.getcontext("experimental-webgl",r)))throw new error("this browser does not support webgl. try using the canvas renderer");return this.gl=i,this.getextensions(),i},r.prototype.getextensions=function(){var t=this.gl;1===this.webglversion?object.assign(this.extensions,{drawbuffers:t.getextension("webgl_draw_buffers"),depthtexture:t.getextension("webgl_depth_texture"),losecontext:t.getextension("webgl_lose_context"),vertexarrayobject:t.getextension("oes_vertex_array_object")||t.getextension("moz_oes_vertex_array_object")||t.getextension("webkit_oes_vertex_array_object"),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")})},r.prototype.handlecontextlost=function(t){t.preventdefault()},r.prototype.handlecontextrestored=function(){this.renderer.runners.contextchange.run(this.gl)},r.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()},r.prototype.postrender=function(){this.renderer.renderingtoscreen&&this.gl.flush()},r.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(r.prototype,i),r}(fr),di=function(e){function r(t){e.call(this,t),this.managedframebuffers=[],this.unknownframebuffer=new ur(10,10)}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;var i={size:{configurable:!0}};return r.prototype.contextchange=function(){var e=this.gl=this.renderer.gl;if(this.context_uid=this.renderer.context_uid,this.current=this.unknownframebuffer,this.viewport=new ze,this.hasmrt=!0,this.writedepthtexture=!0,this.disposeall(!0),1===this.renderer.context.webglversion){var r=this.renderer.context.extensions.drawbuffers,i=this.renderer.context.extensions.depthtexture;m.prefer_env===t.env.webgl_legacy&&(r=null,i=null),r?e.drawbuffers=function(t){return r.drawbufferswebgl(t)}:(this.hasmrt=!1,e.drawbuffers=function(){}),i||(this.writedepthtexture=!1)}},r.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glframebuffers[this.context_uid]||this.initframebuffer(t);this.current!==t&&(this.current=t,r.bindframebuffer(r.framebuffer,i.framebuffer)),i.dirtyid!==t.dirtyid&&(i.dirtyid=t.dirtyid,i.dirtyformat!==t.dirtyformat?(i.dirtyformat=t.dirtyformat,this.updateframebuffer(t)):i.dirtysize!==t.dirtysize&&(i.dirtysize=t.dirtysize,this.resizeframebuffer(t)));for(var n=0;n1&&e.drawbuffers(n),t.depthtexture)&&this.writedepthtexture){var a=t.depthtexture;this.renderer.texture.bind(a,0),e.framebuffertexture2d(e.framebuffer,e.depth_attachment,e.texture_2d,a._gltextures[this.context_uid].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createrenderbuffer(),e.bindrenderbuffer(e.renderbuffer,r.stencil),e.renderbufferstorage(e.renderbuffer,e.depth_stencil,t.width,t.height),t.depthtexture||e.framebufferrenderbuffer(e.framebuffer,e.depth_stencil_attachment,e.renderbuffer,r.stencil))},r.prototype.disposeframebuffer=function(t,e){var r=t.glframebuffers[this.context_uid],i=this.gl;if(r){delete t.glframebuffers[this.context_uid];var n=this.managedframebuffers.indexof(t);n>=0&&this.managedframebuffers.splice(n,1),t.disposerunner.remove(this),e||(i.deleteframebuffer(r.framebuffer),r.stencil&&i.deleterenderbuffer(r.stencil))}},r.prototype.disposeall=function(t){var e=this.managedframebuffers;this.managedframebuffers=[];for(var r=0;r=i.data.bytelength)e.buffersubdata(o,0,i.data);else{var s=i.static?e.static_draw:e.dynamic_draw;n.bytelength=i.data.bytelength,e.bufferdata(o,i.data,s)}}}},r.prototype.checkcompatibility=function(t,e){var r=t.attributes,i=e.attributedata;for(var n in i)if(!r[n])throw new error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},r.prototype.getsignature=function(t,e){var r=t.attributes,i=e.attributedata,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},r.prototype.initgeometryvao=function(t,e){this.checkcompatibility(t,e);var r=this.gl,i=this.context_uid,n=this.getsignature(t,e),o=t.glvertexarrayobjects[this.context_uid],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributedata[d]?h[d].size=e.attributedata[d].size:h[d].size||console.warn("pixi geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*fi[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*fi[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*fi[f.type])}s=r.createvertexarray(),r.bindvertexarray(s);for(var m=0;m=t.env.webgl2&&(e=r.getcontext("webgl2",{})),e||((e=r.getcontext("webgl",{})||r.getcontext("experimental-webgl",{}))?e.getextension("webgl_draw_buffers"):e=null),ti=e}return ti}function si(e,r,i){if("precision"!==e.substring(0,9)){var n=r;return r===t.precision.high&&i!==t.precision.high&&(n=t.precision.medium),"precision "+n+" float;\n"+e}return i!==t.precision.high&&"precision highp"===e.substring(0,15)?e.replace("precision highp","precision mediump"):e}var ii={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 pi(t){return ii[t]}var ai=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 di(t,e){if(!ai){var r=object.keys(oi);ai={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u0?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,r=this.renderer.projection,i=r.transform,n=r.sourceframe,o=r.destinationframe,s=e?e.resolution:this.renderer.resolution,a=(t.x-n.x)*s+o.x,h=(t.y-n.y)*s+o.y,u=t.width*s,l=t.height*s;i&&(a+=i.tx*s,h+=i.ty*s),e||(h=this.renderer.height-l-h),this.renderer.gl.scissor(a,h,u,l)},e}($i),en=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,r=this.renderer.gl,i=t._stencilcounter;0===i&&(this.renderer.framebuffer.forcestencil(),r.enable(r.stencil_test)),t._stencilcounter++,r.colormask(!1,!1,!1,!1),r.stencilfunc(r.equal,i,this._getbitwisemask()),r.stencilop(r.keep,r.keep,r.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<>=1,r++;this.stateid=t.data}for(var i=0;ithis.checkcountmax&&(this.checkcount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedtextures,r=!1,i=0;ithis.maxidle&&(t.destroytexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},r}(fr),gn=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},yn=function(e){function r(t){e.call(this,t),this.boundtextures=[],this.currentlocation=-1,this.managedtextures=[],this._unknownboundtextures=!1,this.unknowntexture=new ar}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.contextchange=function(){var t=this.gl=this.renderer.gl;this.context_uid=this.renderer.context_uid,this.webglversion=this.renderer.context.webglversion;var e=t.getparameter(t.max_texture_image_units);this.boundtextures.length=e;for(var r=0;r=1:r.mipmap=0,2===this.webglversion||e.ispoweroftwo?r.wrapmode=e.wrapmode:r.wrapmode=t.wrap_modes.clamp,e.resource&&e.resource.style(this.renderer,e,r)||this.setstyle(e,r),r.dirtystyleid=e.dirtystyleid)},r.prototype.setstyle=function(e,r){var i=this.gl;if(r.mipmap&&i.generatemipmap(e.target),i.texparameteri(e.target,i.texture_wrap_s,r.wrapmode),i.texparameteri(e.target,i.texture_wrap_t,r.wrapmode),r.mipmap){i.texparameteri(e.target,i.texture_min_filter,e.scalemode===t.scale_modes.linear?i.linear_mipmap_linear:i.nearest_mipmap_nearest);var n=this.renderer.context.extensions.anisotropicfiltering;if(n&&e.anisotropiclevel>0&&e.scalemode===t.scale_modes.linear){var o=math.min(e.anisotropiclevel,i.getparameter(n.max_texture_max_anisotropy_ext));i.texparameterf(e.target,n.texture_max_anisotropy_ext,o)}}else i.texparameteri(e.target,i.texture_min_filter,e.scalemode===t.scale_modes.linear?i.linear:i.nearest);i.texparameteri(e.target,i.texture_mag_filter,e.scalemode===t.scale_modes.linear?i.linear:i.nearest)},r}(fr),_n={filtersystem:ai,batchsystem:ui,contextsystem:ci,framebuffersystem:di,geometrysystem:vi,masksystem:qi,scissorsystem:tn,stencilsystem:en,projectionsystem:rn,rendertexturesystem:on,shadersystem:un,statesystem:vn,texturegcsystem:mn,texturesystem:yn},xn=new fe,bn=function(e){function r(r,i){e.call(this),(i=object.assign({},m.render_options,i)).roundpixels&&(m.round_pixels=i.roundpixels,_e("5.0.0","renderer roundpixels option is deprecated, please use pixi.settings.round_pixels",2)),this.options=i,this.type=t.renderer_type.unknown,this.screen=new ze(0,0,i.width,i.height),this.view=i.view||document.createelement("canvas"),this.resolution=i.resolution||m.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 tr,this._lastobjectrendered=this._tempdisplayobjectparent,this.plugins={}}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;var i={width:{configurable:!0},height:{configurable:!0},backgroundcolor:{configurable:!0}};return r.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},r.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")},r.prototype.generatetexture=function(t,e,r,i){0===(i=i||t.getlocalbounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=vr.create({width:0|i.width,height:0|i.height,scalemode:e,resolution:r});return xn.tx=-i.x,xn.ty=-i.y,this.render(t,n,!1,xn,!!t.parent),n},r.prototype.destroy=function(e){for(var r in this.plugins)this.plugins[r].destroy(),this.plugins[r]=null;e&&this.view.parentnode&&this.view.parentnode.removechild(this.view),this.plugins=null,this.type=t.renderer_type.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=ee(t),te(t,this._backgroundcolorrgba)},object.defineproperties(r.prototype,i),r}(r),en=function(e){function r(i){void 0===i&&(i={}),e.call(this,"webgl",i),i=this.options,this.type=t.renderer_type.webgl,this.gl=null,this.context_uid=0,this.runners={destroy:new _r("destroy"),contextchange:new _r("contextchange",1),reset:new _r("reset"),update:new _r("update"),postrender:new _r("postrender"),prerender:new _r("prerender"),resize:new _r("resize",2)},this.globaluniforms=new oi({projectionmatrix:new fe},!0),this.addsystem(qi,"mask").addsystem(ci,"context").addsystem(vn,"state").addsystem(un,"shader").addsystem(yn,"texture").addsystem(vi,"geometry").addsystem(di,"framebuffer").addsystem(tn,"scissor").addsystem(en,"stencil").addsystem(rn,"projection").addsystem(mn,"texturegc").addsystem(ai,"filter").addsystem(on,"rendertexture").addsystem(ui,"batch"),this.initplugins(r.__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,qt(2===this.context.webglversion?"webgl 2":"webgl 1"),this.resize(this.options.width,this.options.height)}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.create=function(t){if($t())return new r(t);throw new error('webgl unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},r.prototype.addsystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new error('whoops! the name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},r.prototype.render=function(t,e,r,i,n){if(this.renderingtoscreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.islost){if(e||(this._lastobjectrendered=t),!n){var o=t.parent;t.parent=this._tempdisplayobjectparent,t.updatetransform(),t.parent=o}this.rendertexture.bind(e),this.batch.currentrenderer.start(),(void 0!==r?r:this.clearbeforerender)&&this.rendertexture.clear(),t.render(this),this.batch.currentrenderer.flush(),e&&e.basetexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},r.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.run(t,r)},r.prototype.reset=function(){return this.runners.reset.run(),this},r.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},r.prototype.destroy=function(t){for(var r in this.runners.destroy.run(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},r.registerplugin=function(t,e){r.__plugins=r.__plugins||{},r.__plugins[t]=e},r}(bn);function tn(t){return en.create(t)}var wn="attribute vec2 avertexposition;\nattribute vec2 atexturecoord;\n\nuniform mat3 projectionmatrix;\n\nvarying vec2 vtexturecoord;\n\nvoid main(void)\n{\n gl_position = vec4((projectionmatrix * vec3(avertexposition, 1.0)).xy, 0.0, 1.0);\n vtexturecoord = atexturecoord;\n}",sn="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",in=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new cr(t,r))},e}(ar),pn=function(){this.texarray=null,this.blend=0,this.type=t.draw_modes.triangles,this.start=0,this.size=0,this.data=null},an=function(){this.elements=[],this.ids=[],this.count=0};an.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexcount+=t.vertexdata.length/2,this._indexcount+=t.indices.length,this._bufferedtextures[this._buffersize]=t._texture.basetexture,this._bufferedelements[this._buffersize++]=t)},r.prototype.buildtexturesanddrawcalls=function(){var t=this._bufferedtextures,e=this.max_textures,i=r._texturearraypool,n=this.renderer.batch,o=this._tempboundtextures,s=this.renderer.texturegc.count,a=++ar._globalbatch,h=0,u=i[0],l=0;n.copyboundtextures(o,e);for(var c=0;c=e&&(n.boundarray(u,o,a,e),this.builddrawcalls(u,l,c),l=c,u=i[++h],++a),d._batchenabled=a,d.touched=s,u.elements[u.count++]=d)}u.count>0&&(n.boundarray(u,o,a,e),this.builddrawcalls(u,l,this._buffersize),++h,++a);for(var p=0;p0&&(e+="\nelse "),r0||e.responsetype===t.xhr_response_type.buffer)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrtype===t.xhr_response_type.text)this.data=r,this.type=t.type.text;else if(this.xhrtype===t.xhr_response_type.json)try{this.data=json.parse(r),this.type=t.type.json}catch(t){return void this.abort("error trying to parse loaded json: "+t)}else if(this.xhrtype===t.xhr_response_type.document)try{if(window.domparser){var n=new domparser;this.data=n.parsefromstring(r,"text/xml")}else{var o=document.createelement("div");o.innerhtml=r,this.data=o}this.type=t.type.xml}catch(t){return void this.abort("error trying to parse loaded xml: "+t)}else this.data=e.response||r;this.complete()}else this.abort("["+e.status+"] "+e.statustext+": "+e.responseurl)},e._determinecrossorigin=function(t,e){if(0===t.indexof("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,to||(to=document.createelement("a")),to.href=t;var r=!(t=yn(to.href,{strictmode:!0})).port&&""===e.port||t.port===e.port,i=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&i===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 r=t.indexof("/");e=t.substring(r+1,t.indexof(";",r))}else{var i=t.indexof("?"),n=t.indexof("#"),o=math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastindexof(".")+1)}return e.tolowercase()},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"}},qn(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 io(t,e,r){e&&0===e.indexof(".")&&(e=e.substring(1)),e&&(t[e]=r)}function no(t){return t.tostring().replace("object ","")}ro.status_flags={none:0,data_url:1,complete:2,loading:4},ro.type={unknown:0,json:1,xml:2,image:3,audio:4,video:5,text:6},ro.load_type={xhr:1,image:2,audio:3,video:4},ro.xhr_response_type={default:"text",buffer:"arraybuffer",blob:"blob",document:"document",json:"json",text:"text"},ro._loadtypemap={gif:ro.load_type.image,png:ro.load_type.image,bmp:ro.load_type.image,jpg:ro.load_type.image,jpeg:ro.load_type.image,tif:ro.load_type.image,tiff:ro.load_type.image,webp:ro.load_type.image,tga:ro.load_type.image,svg:ro.load_type.image,"svg+xml":ro.load_type.image,mp3:ro.load_type.audio,ogg:ro.load_type.audio,wav:ro.load_type.audio,mp4:ro.load_type.video,webm:ro.load_type.video},ro._xhrtypemap={xhtml:ro.xhr_response_type.document,html:ro.xhr_response_type.document,htm:ro.xhr_response_type.document,xml:ro.xhr_response_type.document,tmx:ro.xhr_response_type.document,svg:ro.xhr_response_type.document,tsx:ro.xhr_response_type.document,gif:ro.xhr_response_type.blob,png:ro.xhr_response_type.blob,bmp:ro.xhr_response_type.blob,jpg:ro.xhr_response_type.blob,jpeg:ro.xhr_response_type.blob,tif:ro.xhr_response_type.blob,tiff:ro.xhr_response_type.blob,webp:ro.xhr_response_type.blob,tga:ro.xhr_response_type.blob,json:ro.xhr_response_type.json,text:ro.xhr_response_type.text,txt:ro.xhr_response_type.text,ttf:ro.xhr_response_type.buffer,otf:ro.xhr_response_type.buffer},ro.empty_gif="data:image/gif;base64,r0lgodlhaqabaiaaap///waaach5baeaaaaalaaaaaabaaeaaaicraeaow==";var oo="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/=";var so=window.url||window.webkiturl;var ao={caching:function(t,e){var r=this;zn[t.url]?(t.data=zn[t.url],t.complete()):t.oncomplete.once(function(){return zn[r.url]=r.data}),e()},parsing:function(t,e){if(t.data){if(t.xhr&&t.xhrtype===ro.xhr_response_type.blob)if(window.blob&&"string"!=typeof t.data){if(0===t.data.type.indexof("image")){var r=so.createobjecturl(t.data);return t.blob=t.data,t.data=new image,t.data.src=r,t.type=ro.type.image,void(t.data.onload=function(){so.revokeobjecturl(r),t.data.onload=null,e()})}}else{var i=t.xhr.getresponseheader("content-type");if(i&&0===i.indexof("image"))return t.data=new image,t.data.src="data:"+i+";base64,"+function(t){for(var e="",r=0;r>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var s=0;s16384&&(n=16384),this._properties=[!1,!0,!1,!1,!1],this._maxsize=r,this._batchsize=n,this._buffers=null,this._bufferupdateids=[],this._updateid=0,this.interactivechildren=!1,this.blendmode=t.blend_modes.normal,this.autoresize=o,this.roundpixels=!0,this.basetexture=null,this.setproperties(i),this._tint=0,this.tintrgb=new float32array(4),this.tint=16777215}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;var i={tint:{configurable:!0}};return r.prototype.setproperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updatetransform=function(){this.displayobjectupdatetransform()},i.tint.get=function(){return this._tint},i.tint.set=function(t){this._tint=t,te(t,this.tintrgb)},r.prototype.render=function(t){var e=this;this.visible&&!(this.worldalpha<=0)&&this.children.length&&this.renderable&&(this.basetexture||(this.basetexture=this.children[0]._texture.basetexture,this.basetexture.valid||this.basetexture.once("update",function(){return e.onchildrenchange(0)})),t.batch.setobjectrenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onchildrenchange=function(t){for(var e=math.floor(t/this._batchsize);this._bufferupdateids.lengthr&&!t.autoresize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generatebuffers(t));var a=e[0]._texture.basetexture;this.state.blendmode=ne(t.blendmode,a.alphamode),n.state.set(this.state);var h=n.gl,u=t.worldtransform.copyto(this.tempmatrix);u.prepend(n.globaluniforms.uniforms.projectionmatrix),this.shader.uniforms.translationmatrix=u.toarray(!0),this.shader.uniforms.ucolor=oe(t.tintrgb,t.worldalpha,this.shader.uniforms.ucolor,a.alphamode),this.shader.uniforms.usampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;ci&&(p=i),d>=s.length&&s.push(this._generateonemorebuffer(t));var f=s[d];f.uploaddynamic(e,c,p);var v=t._bufferupdateids[d]||0;(l=l||f._updateid0,u=a.alpha,l=u<1&&h?se(a._tintrgb,u):a._tintrgb+(255*u<<24);i[o]=l,i[o+n]=l,i[o+2*n]=l,i[o+3*n]=l,o+=4*n}},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempmatrix=null},r}(hi),xo={adaptive:!0,maxlength:10,minsegments:8,maxsegments:2048,_segmentscount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isnan(t))return e;var r=math.ceil(t/this.maxlength);return rthis.maxsegments&&(r=this.maxsegments),r}},bo=function(){this.reset()};bo.prototype.clone=function(){var t=new bo;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},bo.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=gr.white,this.matrix=null,this.visible=!1},bo.prototype.destroy=function(){this.texture=null,this.matrix=null};var eo={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(r.length>=6){for(var s=[],a=0;a196*g*g?(a=w-i,o=s-p,d=math.sqrt(a*a+o*o),a/=d,o/=d,a*=g,o*=g,p.push(x-a*m,b-o*m),p.push(x+a*r,b+o*r),p.push(x-a*r*m,b-o*m),v++):(p.push(x+(h-x)*m,b+(g-b)*m),p.push(x-(h-x)*r,b-(g-b)*r))}}y=n[2*(f-2)],_=n[2*(f-2)+1],x=n[2*(f-1)],b=n[2*(f-1)+1],w=-(_-b),s=y-x,d=math.sqrt(w*w+s*s),w/=d,s/=d,w*=g,s*=g,p.push(x-w*m,b-s*m),p.push(x+w*r,b+s*r);for(var v=r.indices,z=0;zl*a}},do.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=xo._segmentscount(math.abs(u)*n,40*math.ceil(math.abs(u)/re)),c=u/(2*l),d=2*c,p=math.cos(c),f=math.sin(c),v=l-1,m=v%1/v,g=0;g<=v;++g){var y=c+o+d*(g+m*g),_=math.cos(y),x=-math.sin(y);h.push((p*_+f*x)*n+r,(p*-x+f*_)*n+i)}};var co=function(){};co.curvelength=function(t,e,r,i,n,o,s,a){for(var h=0,u=0,l=0,c=0,d=0,p=0,f=0,v=0,m=0,g=0,y=0,_=t,x=e,b=1;b<=10;++b)g=_-(v=(f=(p=(d=1-(u=b/10))*d)*d)*t+3*p*u*r+3*d*(l=u*u)*n+(c=l*u)*s),y=x-(m=f*e+3*p*u*i+3*d*l*o+c*a),_=v,x=m,h+=math.sqrt(g*g+y*y);return h},co.curveto=function(t,e,r,i,n,o,s){var a=s[s.length-2],h=s[s.length-1];s.length-=2;var u=xo._segmentscount(co.curvelength(a,h,t,e,r,i,n,o)),l=0,c=0,d=0,p=0,f=0;s.push(a,h);for(var v=1,m=0;v<=u;++v)d=(c=(l=1-(m=v/u))*l)*l,f=(p=m*m)*m,s.push(d*a+3*c*m*t+3*l*p*r+f*n,d*h+3*c*m*e+3*l*p*i+f*o)};var mo=function(){};mo.curvelength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,h=2*r-2*t,u=2*i-2*e,l=4*(s*s+a*a),c=4*(s*h+a*u),d=h*h+u*u,p=2*math.sqrt(l+c+d),f=math.sqrt(l),v=2*l*f,m=2*math.sqrt(d),g=c/f;return(v*p+f*c*(p-m)+(4*d*l-c*c)*math.log((2*f+g+p)/(g+m)))/(4*v)},mo.curveto=function(t,e,r,i,n){for(var o=n[n.length-2],s=n[n.length-1],a=xo._segmentscount(mo.curvelength(o,s,t,e,r,i)),h=0,u=0,l=1;l<=a;++l){var c=l/a;h=o+(t-o)*c,u=s+(e-s)*c,n.push(h+(t+(r-t)*c-h)*c,u+(e+(i-e)*c-u)*c)}};var ro=function(){this.reset()};ro.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribstart=r},ro.prototype.end=function(t,e){this.attribsize=e-this.attribstart,this.size=t-this.start},ro.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribstart=0,this.attribsize=0};var lo={};lo[t.shapes.poly]=eo,lo[t.shapes.circ]=to,lo[t.shapes.elip]=to,lo[t.shapes.rect]=wo,lo[t.shapes.rrec]=so;var no=[],fo=[],bo={buildpoly:eo,buildcircle:to,buildrectangle:wo,buildroundedrectangle:so,fill_commands:lo,batch_pool:no,draw_call_pool:fo,buildline:ao,buildcomplexpoly:function(t,e){var r=t.points.slice();if(!(r.length<6)){var i=e.indices;e.points=r,e.alpha=t.fillalpha,e.color=te(t.fillcolor);for(var n=1/0,o=-1/0,s=1/0,a=-1/0,h=0,u=0,l=0;lo?h:o,s=(u=r[l+1])a?u:a;r.push(n,s,o,s,o,a,n,a);for(var c=r.length/2,d=0;d0&&(this.invalidate(),this.cleardirty++,this.graphicsdata.length=0),this},r.prototype.drawshape=function(t,e,r,i){var n=new uo(t,e,r,i);return this.graphicsdata.push(n),this.dirty++,this},r.prototype.drawhole=function(t,e){if(!this.graphicsdata.length)return null;var r=new uo(t,null,null,e),i=this.graphicsdata[this.graphicsdata.length-1];return r.linestyle=i.linestyle,i.holes.push(r),this.dirty++,this},r.prototype.destroy=function(t){e.prototype.destroy.call(this,t);for(var r=0;r0&&(n=(i=this.batches[this.batches.length-1]).style);for(var o=this.shapeindex;o0&&((o=fo.pop())||((o=new pn).textures=new an),this.drawcalls.push(o)),o.start=c,o.size=0,o.textures.count=0,o.type=l),v.touched=1,v._batchenabled=e,v._batchlocation=s,v.wrapmode=10497,o.textures.elements[o.textures.count++]=v,s++)),o.size+=p.size,c+=p.size,h=v._batchlocation,this.addcolors(i,f.color,f.alpha,p.attribsize),this.addtextureids(n,h,p.attribsize)}ar._globalbatch=e,this.packattributes()},r.prototype.packattributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,i=this.textureids,n=new arraybuffer(3*t.length*4),o=new float32array(n),s=new uint32array(n),a=0,h=0;h>16)+(65280&e)+((255&e)<<16),r);i-- >0;)t.push(n)},r.prototype.addtextureids=function(t,e,r){for(;r-- >0;)t.push(e)},r.prototype.adduvs=function(t,e,r,i,n,o){for(var s=0,a=e.length,h=r.frame;s0&&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},r.prototype.startpoly=function(){if(this.currentpath){var t=this.currentpath.points,e=this.currentpath.points.length;e>2&&(this.drawshape(this.currentpath),this.currentpath=new ke,this.currentpath.closestroke=!1,this.currentpath.points.push(t[e-2],t[e-1]))}else this.currentpath=new ke,this.currentpath.closestroke=!1},r.prototype.finishpoly=function(){this.currentpath&&(this.currentpath.points.length>2?(this.drawshape(this.currentpath),this.currentpath=null):this.currentpath.points.length=0)},r.prototype.moveto=function(t,e){return this.startpoly(),this.currentpath.points[0]=t,this.currentpath.points[1]=e,this},r.prototype.lineto=function(t,e){this.currentpath||this.moveto(0,0);var r=this.currentpath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},r.prototype._initcurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentpath?0===this.currentpath.points.length&&(this.currentpath.points=[t,e]):this.moveto(t,e)},r.prototype.quadraticcurveto=function(t,e,r,i){this._initcurve();var n=this.currentpath.points;return 0===n.length&&this.moveto(0,0),mo.curveto(t,e,r,i,n),this},r.prototype.beziercurveto=function(t,e,r,i,n,o){return this._initcurve(),co.curveto(t,e,r,i,n,o,this.currentpath.points),this},r.prototype.arcto=function(t,e,r,i,n){this._initcurve(t,e);var o=this.currentpath.points,s=do.curveto(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startangle,c=s.endangle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},r.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=re:o&&i<=n&&(i+=re),0===n-i)return this;var s=t+math.cos(i)*r,a=e+math.sin(i)*r,h=this.geometry.closepointeps,u=this.currentpath?this.currentpath.points:null;if(u){var l=math.abs(u[u.length-2]-s),c=math.abs(u[u.length-1]-a);l0;return o?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),object.assign(this._fillstyle,{visible:o},t)):this._fillstyle.reset(),this},r.prototype.endfill=function(){return this.finishpoly(),this._fillstyle.reset(),this},r.prototype.drawrect=function(t,e,r,i){return this.drawshape(new ze(t,e,r,i))},r.prototype.drawroundedrect=function(t,e,r,i,n){return this.drawshape(new ze(t,e,r,i,n))},r.prototype.drawcircle=function(t,e,r){return this.drawshape(new we(t,e,r))},r.prototype.drawellipse=function(t,e,r,i){return this.drawshape(new qe(t,e,r,i))},r.prototype.drawpolygon=function(t){var e=arguments,r=t,i=!0;if(r.points&&(i=r.closestroke,r=r.points),!array.isarray(r)){r=new array(arguments.length);for(var n=0;n>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,h=s.length;a>16)+(65280&n)+((255&n)<<16)}}},r.prototype.calculatevertices=function(){if(this._transformid!==this.transform._worldid){this._transformid=this.transform._worldid;for(var t=this.transform.worldtransform,e=t.a,r=t.b,i=t.c,n=t.d,o=t.tx,s=t.ty,a=this.geometry.points,h=this.vertexdata,u=0,l=0;l=i&&zo.x=n&&zo.y>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||gr.empty,this._cachedtint=16777215,this._textureid=-1,this._texturetrimmedid=-1,t&&(t.basetexture.valid?this._ontextureupdate():t.once("update",this._ontextureupdate,this)))},object.defineproperties(r.prototype,i),r}(tr),ko={linear_vertical:0,linear_horizontal:1},zo={align:"left",breakwords:!1,dropshadow:!1,dropshadowalpha:1,dropshadowangle:math.pi/6,dropshadowblur:0,dropshadowcolor:"black",dropshadowdistance:5,fill:"black",fillgradienttype:ko.linear_vertical,fillgradientstops:[],fontfamily:"arial",fontsize:26,fontstyle:"normal",fontvariant:"normal",fontweight:"normal",letterspacing:0,lineheight:0,linejoin:"miter",miterlimit:10,padding:0,stroke:"black",strokethickness:0,textbaseline:"alphabetic",trim:!1,whitespace:"pre",wordwrap:!1,wordwrapwidth:100,leading:0},jo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],qo=function(t){this.styleid=0,this.reset(),rs(this,t,t)},$o={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 ts(t){return"number"==typeof t?ee(t):("string"==typeof t&&0===t.indexof("0x")&&(t=t.replace("0x","#")),t)}function es(t){if(array.isarray(t)){for(var e=0;e=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&jo.indexof(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontstyle+" "+this.fontvariant+" "+this.fontweight+" "+t+" "+e.join(",")},object.defineproperties(qo.prototype,$o);var is=function(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.linewidths=o,this.lineheight=s,this.maxlinewidth=a,this.fontproperties=h};is.measuretext=function(t,e,r,i){void 0===i&&(i=is._canvas),r=null==r?e.wordwrap:r;var n=e.tofontstring(),o=is.measurefont(n);0===o.fontsize&&(o.fontsize=e.fontsize,o.ascent=e.fontsize);var s=i.getcontext("2d");s.font=n;for(var a=(r?is.wordwrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new array(a.length),u=0,l=0;lp)if(""!==o&&(s+=is.addline(o),o="",n=0),is.canbreakwords(m,e.breakwords))for(var x=is.wordwrapsplit(m),b=0;bp&&(s+=is.addline(o),d=!1,o="",n=0),o+=e,n+=i}else{o.length>0&&(s+=is.addline(o),o="",n=0);var p=v===f.length-1;s+=is.addline(m,!p),d=!1,o="",n=0}else _+n>p&&(d=!1,s+=is.addline(o),o="",n=0),(o.length>0||!is.isbreakingspace(m)||d)&&(o+=m,n+=_)}return s+=is.addline(o,!1)},is.addline=function(t,e){return void 0===e&&(e=!0),t=is.trimright(t),t=e?t+"\n":t},is.getfromcache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measuretext(t).width+o,r[t]=n}return n},is.collapsespaces=function(t){return"normal"===t||"pre-line"===t},is.collapsenewlines=function(t){return"normal"===t},is.trimright=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!is.isbreakingspace(r))break;t=t.slice(0,-1)}return t},is.isnewline=function(t){return"string"==typeof t&&is._newlines.indexof(t.charcodeat(0))>=0},is.isbreakingspace=function(t){return"string"==typeof t&&is._breakingspaces.indexof(t.charcodeat(0))>=0},is.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;is;--c){for(var v=0;v0};var hs=function(t){var e=this;this.limiter=new as(m.uploads_per_frame),this.renderer=t,this.uploadhookhelper=null,this.queue=[],this.addhooks=[],this.uploadhooks=[],this.completes=[],this.ticking=!1,this.delayedtick=function(){e.queue&&e.prepareitems()},this.registerfindhook(fs),this.registerfindhook(vs),this.registerfindhook(us),this.registerfindhook(ls),this.registerfindhook(cs),this.registeruploadhook(ds),this.registeruploadhook(ps)};function us(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i=0;i--)this.add(t.children[i]);return this},hs.prototype.destroy=function(){this.ticking&&sr.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 ms=function(t){function e(e){t.call(this,e),this.uploadhookhelper=this.renderer,this.registerfindhook(_s),this.registeruploadhook(gs),this.registeruploadhook(ys)}return t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e,e}(hs);function gs(t,e){return e instanceof ar&&(e._gltextures[t.context_uid]||t.texture.bind(e),!0)}function ys(t,e){if(!(e instanceof vo))return!1;var r=e.geometry;e.finishpoly(),r.updatebatches();for(var i=r.batches,n=0;n=i&&ws.x=n&&ws.y0&&i.x>h&&(fe(n,1+p-++v,1+g-p),g=p,p=-1,o.push(f),c=math.max(c,f),d++,i.x=0,i.y+=t.lineheight,u=null))}else o.push(l),c=math.max(c,l),++d,++v,i.x=0,i.y+=t.lineheight,u=null}var b=s.charat(s.length-1);"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(l=f),o.push(l),c=math.max(c,l));for(var e=[],t=0;t<=d;t++){var w=0;"right"===this._font.align?w=c-o[t]:"center"===this._font.align&&(w=(c-o[t])/2),e.push(w)}for(var s=n.length,i=this.tint,p=0;p=0?t:16777215,this.dirty=!0},r.align.get=function(){return this._font.align},r.align.set=function(t){this._font.align=t||"left",this.dirty=!0},r.anchor.get=function(){return this._anchor},r.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyfrom(t)},r.font.get=function(){return this._font},r.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseint(t[0],10):e.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseint(t.size,10)),this.dirty=!0)},r.text.get=function(){return this._text},r.text.set=function(t){t=string(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},r.maxwidth.get=function(){return this._maxwidth},r.maxwidth.set=function(t){this._maxwidth!==t&&(this._maxwidth=t,this.dirty=!0)},r.maxlineheight.get=function(){return this.validate(),this._maxlineheight},r.textwidth.get=function(){return this.validate(),this._textwidth},r.letterspacing.get=function(){return this._letterspacing},r.letterspacing.set=function(t){this._letterspacing!==t&&(this._letterspacing=t,this.dirty=!0)},r.textheight.get=function(){return this.validate(),this._textheight},e.registerfont=function(t,r){var i={},n=t.getelementsbytagname("info")[0],o=t.getelementsbytagname("common")[0],s=t.getelementsbytagname("page"),a=ae(s[0].getattribute("file")),h={};i.font=n.getattribute("face"),i.size=parseint(n.getattribute("size"),10),i.lineheight=parseint(o.getattribute("lineheight"),10)/a,i.chars={},r instanceof gr&&(r=[r]);for(var u=0;u=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e]),o+="\n"}return n=(n=n.replace("%blur%",o)).replace("%size%",t)}(o);t.call(this,s,a),this.horizontal=e,this.resolution=n||m.resolution,this._quality=0,this.quality=i||4,this.blur=r||8}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={blur:{configurable:!0},quality:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyfilter(this,e,r,i);else{var n=t.getfiltertexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyfilter(this,s,a,!0);for(var h=1;h 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, ualpha);\n\n // premultiply alpha again.\n rgb *= result.a;\n\n gl_fragcolor = vec4(rgb, result.a);\n}\n",js=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,sn,xs,e),this.alpha=1}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={matrix:{configurable:!0},alpha:{configurable:!0}};return e.prototype._loadmatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colormatrix(r)),this.uniforms.m=r},e.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},e.prototype._colormatrix=function(t){var e=new float32array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadmatrix(r,e)},e.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadmatrix(r,e)},e.prototype.blackandwhite=function(t){this._loadmatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*math.pi;var r=math.cos(t),i=math.sin(t),n=1/3,o=(0,math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadmatrix(s,e)},e.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadmatrix(n,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadmatrix(n,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadmatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadmatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadmatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},e.prototype.polaroid=function(t){this._loadmatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.tobgr=function(t){this._loadmatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadmatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},e.prototype.browni=function(t){this._loadmatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadmatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colortone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadmatrix(c,n)},e.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadmatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadmatrix(r,e)},e.prototype.lsd=function(t){this._loadmatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadmatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},r.matrix.get=function(){return this.uniforms.m},r.matrix.set=function(t){this.uniforms.m=t},r.alpha.get=function(){return this.uniforms.ualpha},r.alpha.set=function(t){this.uniforms.ualpha=t},object.defineproperties(e.prototype,r),e}(vi);js.prototype.grayscale=js.prototype.greyscale;var hs="attribute vec2 avertexposition;\n\nuniform mat3 projectionmatrix;\nuniform mat3 filtermatrix;\n\nvarying vec2 vtexturecoord;\nvarying vec2 vfiltercoord;\n\nuniform vec4 inputsize;\nuniform vec4 outputframe;\n\nvec4 filtervertexposition( void )\n{\n vec2 position = avertexposition * max(outputframe.zw, vec2(0.)) + outputframe.xy;\n\n return vec4((projectionmatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filtertexturecoord( void )\n{\n return avertexposition * (outputframe.zw * inputsize.zw);\n}\n\nvoid main(void)\n{\n\tgl_position = filtervertexposition();\n\tvtexturecoord = filtertexturecoord();\n\tvfiltercoord = ( filtermatrix * vec3( vtexturecoord, 1.0) ).xy;\n}\n",gs="varying vec2 vfiltercoord;\nvarying vec2 vtexturecoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2d usampler;\nuniform sampler2d mapsampler;\n\nuniform highp vec4 inputsize;\nuniform vec4 inputclamp;\n\nvoid main(void)\n{\n vec4 map = texture2d(mapsampler, vfiltercoord);\n\n map -= 0.5;\n map.xy = scale * inputsize.zw * (rotation * map.xy);\n\n gl_fragcolor = texture2d(usampler, clamp(vec2(vtexturecoord.x + map.x, vtexturecoord.y + map.y), inputclamp.xy, inputclamp.zw));\n}\n",ys=function(t){function e(e,r){var i=new fe;e.renderable=!1,t.call(this,hs,gs,{mapsampler:e._texture,filtermatrix:i,scale:{x:1,y:1},rotation:new float32array([1,0,0,1])}),this.masksprite=e,this.maskmatrix=i,null==r&&(r=20),this.scale=new ce(r,r)}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={map:{configurable:!0}};return e.prototype.apply=function(t,e,r,i){this.uniforms.filtermatrix=t.calculatespritematrix(this.maskmatrix,this.masksprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.masksprite.transform.worldtransform,o=math.sqrt(n.a*n.a+n.b*n.b),s=math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyfilter(this,e,r,i)},r.map.get=function(){return this.uniforms.mapsampler},r.map.set=function(t){this.uniforms.mapsampler=t},object.defineproperties(e.prototype,r),e}(vi),vs="\nattribute vec2 avertexposition;\n\nuniform mat3 projectionmatrix;\n\nvarying vec2 v_rgbnw;\nvarying vec2 v_rgbne;\nvarying vec2 v_rgbsw;\nvarying vec2 v_rgbse;\nvarying vec2 v_rgbm;\n\nvarying vec2 vfragcoord;\n\nuniform vec4 inputpixel;\nuniform vec4 outputframe;\n\nvec4 filtervertexposition( void )\n{\n vec2 position = avertexposition * max(outputframe.zw, vec2(0.)) + outputframe.xy;\n\n return vec4((projectionmatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragcoord, vec2 inversevp,\n out vec2 v_rgbnw, out vec2 v_rgbne,\n out vec2 v_rgbsw, out vec2 v_rgbse,\n out vec2 v_rgbm) {\n v_rgbnw = (fragcoord + vec2(-1.0, -1.0)) * inversevp;\n v_rgbne = (fragcoord + vec2(1.0, -1.0)) * inversevp;\n v_rgbsw = (fragcoord + vec2(-1.0, 1.0)) * inversevp;\n v_rgbse = (fragcoord + vec2(1.0, 1.0)) * inversevp;\n v_rgbm = vec2(fragcoord * inversevp);\n}\n\nvoid main(void) {\n\n gl_position = filtervertexposition();\n\n vfragcoord = avertexposition * outputframe.zw;\n\n texcoords(vfragcoord, inputpixel.zw, v_rgbnw, v_rgbne, v_rgbsw, v_rgbse, v_rgbm);\n}\n",zs='varying vec2 v_rgbnw;\nvarying vec2 v_rgbne;\nvarying vec2 v_rgbsw;\nvarying vec2 v_rgbse;\nvarying vec2 v_rgbm;\n\nvarying vec2 vfragcoord;\nuniform sampler2d usampler;\nuniform highp vec4 inputpixel;\n\n\n/**\n basic fxaa implementation based on the code on geeks3d.com with the\n modification that the texture2dlod stuff was removed since it\'s\n unsupported by webgl.\n\n --\n\n from:\n https://github.com/mitsuhiko/webgl-meincraft\n\n copyright (c) 2011 by armin ronacher.\n\n some rights reserved.\n\n redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * the names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n this software is provided by the copyright holders and contributors\n "as is" and any express or implied warranties, including, but not\n limited to, the implied warranties of merchantability and fitness for\n a particular purpose are disclaimed. in no event shall the copyright\n owner or contributors be liable for any direct, indirect, incidental,\n special, exemplary, or consequential damages (including, but not\n limited to, procurement of substitute goods or services; loss of use,\n data, or profits; or business interruption) however caused and on any\n theory of liability, whether in contract, strict liability, or tort\n (including negligence or otherwise) arising in any way out of the use\n of this software, even if advised of the possibility of such damage.\n */\n\n#ifndef fxaa_reduce_min\n#define fxaa_reduce_min (1.0/ 128.0)\n#endif\n#ifndef fxaa_reduce_mul\n#define fxaa_reduce_mul (1.0 / 8.0)\n#endif\n#ifndef fxaa_span_max\n#define fxaa_span_max 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2d tex, vec2 fragcoord, vec2 inversevp,\n vec2 v_rgbnw, vec2 v_rgbne,\n vec2 v_rgbsw, vec2 v_rgbse,\n vec2 v_rgbm) {\n vec4 color;\n vec3 rgbnw = texture2d(tex, v_rgbnw).xyz;\n vec3 rgbne = texture2d(tex, v_rgbne).xyz;\n vec3 rgbsw = texture2d(tex, v_rgbsw).xyz;\n vec3 rgbse = texture2d(tex, v_rgbse).xyz;\n vec4 texcolor = texture2d(tex, v_rgbm);\n vec3 rgbm = texcolor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumanw = dot(rgbnw, luma);\n float lumane = dot(rgbne, luma);\n float lumasw = dot(rgbsw, luma);\n float lumase = dot(rgbse, luma);\n float lumam = dot(rgbm, luma);\n float lumamin = min(lumam, min(min(lumanw, lumane), min(lumasw, lumase)));\n float lumamax = max(lumam, max(max(lumanw, lumane), max(lumasw, lumase)));\n\n mediump vec2 dir;\n dir.x = -((lumanw + lumane) - (lumasw + lumase));\n dir.y = ((lumanw + lumasw) - (lumane + lumase));\n\n float dirreduce = max((lumanw + lumane + lumasw + lumase) *\n (0.25 * fxaa_reduce_mul), fxaa_reduce_min);\n\n float rcpdirmin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirreduce);\n dir = min(vec2(fxaa_span_max, fxaa_span_max),\n max(vec2(-fxaa_span_max, -fxaa_span_max),\n dir * rcpdirmin)) * inversevp;\n\n vec3 rgba = 0.5 * (\n texture2d(tex, fragcoord * inversevp + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2d(tex, fragcoord * inversevp + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbb = rgba * 0.5 + 0.25 * (\n texture2d(tex, fragcoord * inversevp + dir * -0.5).xyz +\n texture2d(tex, fragcoord * inversevp + dir * 0.5).xyz);\n\n float lumab = dot(rgbb, luma);\n if ((lumab < lumamin) || (lumab > lumamax))\n color = vec4(rgba, texcolor.a);\n else\n color = vec4(rgbb, texcolor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(usampler, vfragcoord, inputpixel.zw, v_rgbnw, v_rgbne, v_rgbsw, v_rgbse, v_rgbm);\n\n gl_fragcolor = color;\n}\n',ws=function(t){function e(){t.call(this,vs,zs)}return t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e,e}(vi),qs="precision highp float;\n\nvarying vec2 vtexturecoord;\nvarying vec4 vcolor;\n\nuniform float unoise;\nuniform float useed;\nuniform sampler2d usampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2d(usampler, vtexturecoord);\n float randomvalue = rand(gl_fragcoord.xy * useed);\n float diff = (randomvalue - 0.5) * unoise;\n\n // un-premultiply alpha before applying the color matrix. see issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // premultiply alpha again.\n color.rgb *= color.a;\n\n gl_fragcolor = color;\n}\n",ks=function(t){function e(e,r){void 0===e&&(e=.5),void 0===r&&(r=math.random()),t.call(this,sn,qs,{unoise:0,useed:0}),this.noise=e,this.seed=r}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={noise:{configurable:!0},seed:{configurable:!0}};return r.noise.get=function(){return this.uniforms.unoise},r.noise.set=function(t){this.uniforms.unoise=t},r.seed.get=function(){return this.uniforms.useed},r.seed.set=function(t){this.uniforms.useed=t},object.defineproperties(e.prototype,r),e}(vi),zs=new fe;qe.prototype._cacheasbitmap=!1,qe.prototype._cachedata=!1;var js=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(qe.prototype,{cacheasbitmap:{get:function(){return this._cacheasbitmap},set:function(t){var e;this._cacheasbitmap!==t&&(this._cacheasbitmap=t,t?(this._cachedata||(this._cachedata=new js),(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))}}}),qe.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))},qe.prototype._initcacheddisplayobject=function(t){if(!this._cachedata||!this._cachedata.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var r=this.getlocalbounds().clone();if(this.filters){var i=this.filters[0].padding;r.pad(i)}r.ceil(m.resolution);var n=t.rendertexture.current,o=t.rendertexture.sourceframe.clone(),s=t.projection.transform,a=vr.create(r.width,r.height),h="cacheasbitmap_"+ge();this._cachedata.texturecacheid=h,ar.addtocache(a.basetexture,h),gr.addtocache(a,h);var u=zs;u.tx=-r.x,u.ty=-r.y,this.transform.worldtransform.identity(),this.render=this._cachedata.originalrender,t.render(this,a,!0,u,!0),t.projection.transform=s,t.rendertexture.bind(n,o),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 qo(a);l.transform.worldtransform=this.transform.worldtransform,l.anchor.x=-r.x/r.width,l.anchor.y=-r.y/r.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)}},qe.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))},qe.prototype._initcacheddisplayobjectcanvas=function(t){if(!this._cachedata||!this._cachedata.sprite){var e=this.getlocalbounds(),r=this.alpha;this.alpha=1;var i=t.context,n=t._projtransform;e.ceil(m.resolution);var o=vr.create(e.width,e.height),s="cacheasbitmap_"+ge();this._cachedata.texturecacheid=s,ar.addtocache(o.basetexture,s),gr.addtocache(o,s);var a=zs;this.transform.localtransform.copyto(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.rendercanvas=this._cachedata.originalrendercanvas,t.render(this,o,!0,a,!1),t.context=i,t._projtransform=n,this.rendercanvas=this._rendercachedcanvas,this.updatetransform=this.displayobjectupdatetransform,this.calculatebounds=this._calculatecachedbounds,this.getlocalbounds=this._getcachedlocalbounds,this._mask=null,this.filterarea=null;var h=new qo(o);h.transform.worldtransform=this.transform.worldtransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=r,h._bounds=this._bounds,this._cachedata.sprite=h,this.transform._parentid=-1,this.parent?this.updatetransform():(this.parent=t._tempdisplayobjectparent,this.updatetransform(),this.parent=null),this.containspoint=h.containspoint.bind(h)}},qe.prototype._calculatecachedbounds=function(){this._bounds.clear(),this._cachedata.sprite.transform._worldid=this.transform._worldid,this._cachedata.sprite._calculatebounds(),this._lastboundsid=this._boundsid},qe.prototype._getcachedlocalbounds=function(){return this._cachedata.sprite.getlocalbounds()},qe.prototype._destroycacheddisplayobject=function(){this._cachedata.sprite._texture.destroy(!0),this._cachedata.sprite=null,ar.removefromcache(this._cachedata.texturecacheid),gr.removefromcache(this._cachedata.texturecacheid),this._cachedata.texturecacheid=null},qe.prototype._cacheasbitmapdestroy=function(t){this.cacheasbitmap=!1,this.destroy(t)},qe.prototype.name=null,tr.prototype.getchildbyname=function(t){for(var e=0;e>16)+(65280&t)+((255&t)<<16),this._colordirty=!0)},r.tint.get=function(){return this._tint},e.prototype.update=function(){if(this._colordirty){this._colordirty=!1;var t=this.texture.basetexture;ae(this._tint,this._alpha,this.uniforms.ucolor,t.alphamode)}this.uvmatrix.update()&&(this.uniforms.utexturematrix=this.uvmatrix.mapcoord)},object.defineproperties(e.prototype,r),e}(ji),sa=function(e){function r(r,i,n){e.call(this);var o=new kr(r),s=new kr(i,!0),a=new kr(n,!0,!0);this.addattribute("avertexposition",o,2,!1,t.types.float).addattribute("atexturecoord",s,2,!1,t.types.float).addindex(a),this._updateid=-1}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;var i={vertexdirtyid:{configurable:!0}};return i.vertexdirtyid.get=function(){return this.buffers[0]._updateid},object.defineproperties(r.prototype,i),r}(ei),aa=function(t){function e(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10),t.call(this),this.segwidth=i,this.segheight=n,this.width=e,this.height=r,this.build()}return t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segwidth*this.segheight,e=[],r=[],i=[],n=this.segwidth-1,o=this.segheight-1,s=this.width/n,a=this.height/o,h=0;h0){var d=a.x-t[l].x,p=a.y-t[l].y,f=math.sqrt(d*d+p*p);a=t[l],s+=f/h}else s=l/(u-1);n[c]=s,n[c+1]=0,n[c+2]=s,n[c+3]=1}for(var v=0,m=0;m0?this.texturescale*this.width/2:this.width/2;i/=l,n/=l,i*=c,n*=c,o[u]=h.x+i,o[u+1]=h.y+n,o[u+2]=h.x-i,o[u+3]=h.y-n,r=h}this.buffers[0].update()}},e.prototype.update=function(){this.texturescale>0?this.build():this.updatevertices()},e}(sa),ua=function(e){function r(r,i,n){void 0===n&&(n=0);var o=new ha(r.height,i,n),s=new oa(r);n>0&&(r.basetexture.wrapmode=t.wrap_modes.repeat),e.call(this,o,s),this.autoupdate=!0}return e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype._render=function(t){(this.autoupdate||this.geometry.width!==this.shader.texture.height)&&(this.geometry.width=this.shader.texture.height,this.geometry.update()),e.prototype._render.call(this,t)},r}(ra),la=function(t){function e(e,r,i){var n=new aa(e.width,e.height,r,i),o=new oa(gr.white);t.call(this,n,o),this.texture=e}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={texture:{configurable:!0}};return e.prototype.textureupdated=function(){this._textureid=this.shader.texture._updateid,this.geometry.width=this.shader.texture.width,this.geometry.height=this.shader.texture.height,this.geometry.build()},r.texture.set=function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureid=-1,t.basetexture.valid?this.textureupdated():t.once("update",this.textureupdated,this))},r.texture.get=function(){return this.shader.texture},e.prototype._render=function(e){this._textureid!==this.shader.texture._updateid&&this.textureupdated(),t.prototype._render.call(this,e)},object.defineproperties(e.prototype,r),e}(ra),ca=function(t){function e(e,r,i,n,o){void 0===e&&(e=gr.empty);var s=new sa(r,i,n);s.getbuffer("avertexposition").static=!1;var a=new oa(e);t.call(this,s,a,null,o),this.autoupdate=!0}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertices:{configurable:!0}};return r.vertices.get=function(){return this.geometry.getbuffer("avertexposition").data},r.vertices.set=function(t){this.geometry.getbuffer("avertexposition").data=t},e.prototype._render=function(e){this.autoupdate&&this.geometry.getbuffer("avertexposition").update(),t.prototype._render.call(this,e)},object.defineproperties(e.prototype,r),e}(ra),da=10,pa=function(t){function e(e,r,i,n,o){t.call(this,gr.white,4,4),this._origwidth=e.orig.width,this._origheight=e.orig.height,this._width=this._origwidth,this._height=this._origheight,this._leftwidth=void 0!==r?r:da,this._rightwidth=void 0!==n?n:da,this._topheight=void 0!==i?i:da,this._bottomheight=void 0!==o?o:da,this.texture=e}t&&(e.__proto__=t),e.prototype=object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertices:{configurable:!0},width:{configurable:!0},height:{configurable:!0},leftwidth:{configurable:!0},rightwidth:{configurable:!0},topheight:{configurable:!0},bottomheight:{configurable:!0}};return e.prototype.textureupdated=function(){this._textureid=this.shader.texture._updateid,this._refresh()},r.vertices.get=function(){return this.geometry.getbuffer("avertexposition").data},r.vertices.set=function(t){this.geometry.getbuffer("avertexposition").data=t},e.prototype.updatehorizontalvertices=function(){var t=this.vertices,e=this._getminscale();t[9]=t[11]=t[13]=t[15]=this._topheight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomheight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateverticalvertices=function(){var t=this.vertices,e=this._getminscale();t[2]=t[10]=t[18]=t[26]=this._leftwidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightwidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getminscale=function(){var t=this._leftwidth+this._rightwidth,e=this._width>t?1:this._width/t,r=this._topheight+this._bottomheight,i=this._height>r?1:this._height/r;return math.min(e,i)},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftwidth.get=function(){return this._leftwidth},r.leftwidth.set=function(t){this._leftwidth=t,this._refresh()},r.rightwidth.get=function(){return this._rightwidth},r.rightwidth.set=function(t){this._rightwidth=t,this._refresh()},r.topheight.get=function(){return this._topheight},r.topheight.set=function(t){this._topheight=t,this._refresh()},r.bottomheight.get=function(){return this._bottomheight},r.bottomheight.set=function(t){this._bottomheight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origwidth=t.orig.width,this._origheight=t.orig.height;var r=1/this._origwidth,i=1/this._origheight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftwidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightwidth,e[9]=e[11]=e[13]=e[15]=i*this._topheight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomheight,this.updatehorizontalvertices(),this.updateverticalvertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},object.defineproperties(e.prototype,r),e}(la),fa=function(e){function r(t,r){e.call(this,t[0]instanceof gr?t[0]:t[0].texture),this._textures=null,this._durations=null,this._autoupdate=!1!==r,this._isconnectedtoticker=!1,this.animationspeed=1,this.loop=!0,this.updateanchor=!1,this.oncomplete=null,this.onframechange=null,this.onloop=null,this._currenttime=0,this._playing=!1,this._previousframe=null,this.textures=t}e&&(r.__proto__=e),r.prototype=object.create(e&&e.prototype),r.prototype.constructor=r;var i={totalframes:{configurable:!0},textures:{configurable:!0},currentframe:{configurable:!0},playing:{configurable:!0},autoupdate:{configurable:!0}};return r.prototype.stop=function(){this.playing&&(this._playing=!1,this._autoupdate&&this._isconnectedtoticker&&(sr.shared.remove(this.update,this),this._isconnectedtoticker=!1))},r.prototype.play=function(){this.playing||(this._playing=!0,this._autoupdate&&!this._isconnectedtoticker&&(sr.shared.add(this.update,this,t.update_priority.high),this._isconnectedtoticker=!0))},r.prototype.gotoandstop=function(t){this.stop();var e=this.currentframe;this._currenttime=t,e!==this.currentframe&&this.updatetexture()},r.prototype.gotoandplay=function(t){var e=this.currentframe;this._currenttime=t,e!==this.currentframe&&this.updatetexture(),this.play()},r.prototype.update=function(t){var e=this.animationspeed*t,r=this.currentframe;if(null!==this._durations){var i=this._currenttime%1*this._durations[this.currentframe];for(i+=e/60*1e3;i<0;)this._currenttime--,i+=this._durations[this.currentframe];var n=math.sign(this.animationspeed*t);for(this._currenttime=math.floor(this._currenttime);i>=this._durations[this.currentframe];)i-=this._durations[this.currentframe]*n,this._currenttime+=n;this._currenttime+=i/this._durations[this.currentframe]}else this._currenttime+=e;this._currenttime<0&&!this.loop?(this.gotoandstop(0),this.oncomplete&&this.oncomplete()):this._currenttime>=this._textures.length&&!this.loop?(this.gotoandstop(this._textures.length-1),this.oncomplete&&this.oncomplete()):r!==this.currentframe&&(this.loop&&this.onloop&&(this.animationspeed>0&&this.currentframer&&this.onloop()),this.updatetexture())},r.prototype.updatetexture=function(){var t=this.currentframe;this._previousframe!==t&&(this._previousframe=t,this._texture=this._textures[t],this._textureid=-1,this._texturetrimmedid=-1,this._cachedtint=16777215,this.uvs=this._texture._uvs.uvsfloat32,this.updateanchor&&this._anchor.copyfrom(this._texture.defaultanchor),this.onframechange&&this.onframechange(this.currentframe))},r.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.oncomplete=null,this.onframechange=null,this.onloop=null},r.fromframes=function(t){for(var e=[],i=0;i