!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.OptimalSelect=e():t.OptimalSelect=e()}(this,function(){return i=[function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertNodeList=function(t){for(var e=t.length,i=new Array(e),r=0;r@~]/g,"\\$&").replace(/\n/g,"A")}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCommonAncestor=function(t){for(var e=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(r.length<2)return c("",t,"",e);var n=[r.pop()];for(;1/g,"> ").trim()};var r=i(3),h=(r=r)&&r.__esModule?r:{default:r},u=i(0);function c(i,r,n,s){if(i.length&&(i+=" "),n.length&&(n=" "+n),/\[*\]/.test(r)){var t=r.replace(/=.*$/,"]"),o=""+i+t+n;if(p(document.querySelectorAll(o),s))r=t;else for(var a=document.querySelectorAll(""+i+t),l=0,e=a.length;l/.test(r)&&(t=r.replace(/>/,""),o=""+i+t+n,p(document.querySelectorAll(o),s)&&(r=t)),/:nth-child/.test(r)&&(t=r.replace(/nth-child/g,"nth-of-type"),o=""+i+t+n,p(document.querySelectorAll(o),s)&&(r=t)),/\.\S+\.\S+/.test(r)){for(var h=r.trim().split(".").slice(1).map(function(t){return"."+t}).sort(function(t,e){return t.length-e.length});h.length;){var u=r.replace(h.shift(),"").trim();if(!(o=(""+i+u+n).trim()).length||">"===o.charAt(0)||">"===o.charAt(o.length-1))break;p(document.querySelectorAll(o),s)&&(r=u)}if((h=r&&r.match(/\./g))&&2)(\S)/g,"$1 $2").trim()).split(" ").reverse().map(function(t,e){var i,r,n,s=0===e,e=t.split(":"),t=m(e,2),o=t[0],e=t[1],a=null,l=null;switch(!0){case/>/.test(o):l=function(e){return function(t){return t(e.parent)&&e.parent}};break;case/^\./.test(o):var h=o.substr(1).split(".");a=function(t){var e=t.attribs.class;return e&&h.every(function(t){return-1 "+l+":nth-child("+(o+1)+")",r.unshift(h)):console.warn("\n Element couldn't be matched through strict ignore pattern!\n ",u,i,l)}}(s,l,o,a)}l=l.parentNode,h=a.length}l===r&&(e=m(s,l,o),a.unshift(e));return a.join(" ")};var p=i(0),c={attribute:function(t){return-1<["style","data-reactid","data-react-checksum"].indexOf(t)}};function d(t,e,i,r,n){n=4\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",e=n.console&&(n.console.warn||n.console.log);return e&&e.call(n.console,r,t),i.apply(this,arguments)}}var a="function"!=typeof Object.assign?function(t){if(t===u||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;ie[i]}):r.sort():r}function f(t,e){for(var i,r=e[0].toUpperCase()+e.slice(1),n=0;nc(o.y)?o.x:o.y,r.scale=a?function(t,e){return P(e[0],e[1],A)/P(t[0],t[1],A)}(a.pointers,e):1,r.rotation=a?function(t,e){return ut(e[1],e[0],A)+ut(t[1],t[0],A)}(a.pointers,e):0,r.maxPointers=!s.prevInput||r.pointers.length>s.prevInput.maxPointers?r.pointers.length:s.prevInput.maxPointers,function(t,e){var i,r,n,s=t.lastInterval||e,o=e.timeStamp-s.timeStamp;{var a,l;e.eventType!=v&&(itc(o.y)?o.x:o.y,a=ht(a,l),t.lastInterval=e):(i=s.velocity,r=s.velocityX,n=s.velocityY,a=s.direction)}e.velocity=i,e.velocityX=r,e.velocityY=n,e.direction=a}(s,r),n.element);q(r.srcEvent.target,l)&&(l=r.srcEvent.target),r.target=l,t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function ot(t){for(var e=[],i=0;i=c(e)?t<0?b:x:e<0?T:w}function P(t,e,i){var r=e[(i=i||nt)[0]]-t[i[0]],e=e[i[1]]-t[i[1]];return Math.sqrt(r*r+e*e)}function ut(t,e,i){var r=e[(i=i||nt)[0]]-t[i[0]],e=e[i[1]]-t[i[1]];return 180*Math.atan2(e,r)/Math.PI}O.prototype={handler:function(){},init:function(){this.evEl&&e(this.element,this.evEl,this.domHandler),this.evTarget&&e(this.target,this.evTarget,this.domHandler),this.evWin&&e(Q(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&r(this.element,this.evEl,this.domHandler),this.evTarget&&r(this.target,this.evTarget,this.domHandler),this.evWin&&r(Q(this.element),this.evWin,this.domHandler)}};var ct={mousedown:_,mousemove:2,mouseup:g};function R(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,O.apply(this,arguments)}t(R,O,{handler:function(t){var e=ct[t.type];e&_&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=g),this.pressed&&(e&g&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:et,srcEvent:t}))}});var pt={pointerdown:_,pointermove:2,pointerup:g,pointercancel:v,pointerout:v},dt={2:m,3:"pen",4:et,5:"kinect"},ft="pointerdown",mt="pointermove pointerup pointercancel";function _t(){this.evEl=ft,this.evWin=mt,O.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(ft="MSPointerDown",mt="MSPointerMove MSPointerUp MSPointerCancel"),t(_t,O,{handler:function(t){var e=this.store,i=!1,r=t.type.toLowerCase().replace("ms",""),r=pt[r],n=dt[t.pointerType]||t.pointerType,s=n==m,o=p(e,t.pointerId,"pointerId");r&_&&(0===t.button||s)?o<0&&(e.push(t),o=e.length-1):r&(g|v)&&(i=!0),o<0||(e[o]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:n,srcEvent:t}),i&&e.splice(o,1))}});var gt={touchstart:_,touchmove:2,touchend:g,touchcancel:v};function vt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,O.apply(this,arguments)}t(vt,O,{handler:function(t){var e,i=gt[t.type];i===_&&(this.started=!0),this.started&&(e=function(t,e){var i=d(t.touches),t=d(t.changedTouches);e&(g|v)&&(i=K(i.concat(t),"identifier",!0));return[i,t]}.call(this,t,i),i&(g|v)&&e[0].length-e[1].length==0&&(this.started=!1),this.callback(this.manager,i,{pointers:e[0],changedPointers:e[1],pointerType:m,srcEvent:t}))}});var yt={touchstart:_,touchmove:2,touchend:g,touchcancel:v};function bt(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},O.apply(this,arguments)}t(bt,O,{handler:function(t){var e=yt[t.type],i=function(t,e){var i=d(t.touches),r=this.targetIds;if(e&(2|_)&&1===i.length)return r[i[0].identifier]=!0,[i,i];var n,s,o=d(t.changedTouches),a=[],l=this.target;if(s=i.filter(function(t){return q(t.target,l)}),e===_)for(n=0;ne.threshold&&n&e.direction},attrTest:function(t){return D.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=It(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),t(Lt,D,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[C]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){var e;1!==t.scale&&(e=t.scale<1?"in":"out",t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),t(Nt,I,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,r=t.distancee.time;if(this._input=t,!r||!i||t.eventType&(g|v)&&!n)this.reset();else if(t.eventType&_)this.reset(),this._timer=j(function(){this.state=8,this.tryEmit()},e.time,this);else if(t.eventType&g)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&g?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=U(),this.manager.emit(this.options.event,this._input)))}}),t(zt,D,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[C]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),t(Bt,D,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:E|S,pointers:1},getTouchAction:function(){return Ft.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(E|S)?e=t.overallVelocity:i&E?e=t.overallVelocityX:i&S&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&c(e)>this.options.velocity&&t.eventType&g},emit:function(t){var e=It(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),t(Ut,I,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Rt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,r=t.distance=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&o=r.x&&r.x>=u&&n!==r.x&&bt(si.x||r.x===i.x&&function(t,e){return xt(t.prev,t,e.prev)<0&&xt(e.next,t,t.next)<0}(i,r)))&&(i=r,p=l)),r=r.next,r!==h;);return i}(t,e);return i?(_t(t=Ot(i,t),t.next),_t(i,i.next)):e}(l[n],i);return i}(t,e,u,i)),t.length>80*i){for(var p=r=t[0],d=n=t[1],f=i;f=g&&b&&b.z<=v;){if(y.x>=d&&y.x<=m&&y.y>=f&&y.y<=_&&y!==n&&y!==o&&bt(a,u,l,c,h,p,y.x,y.y)&&0<=xt(y.prev,y,y.next))return;if(y=y.prevZ,b.x>=d&&b.x<=m&&b.y>=f&&b.y<=_&&b!==n&&b!==o&&bt(a,u,l,c,h,p,b.x,b.y)&&0<=xt(b.prev,b,b.next))return;b=b.nextZ}for(;y&&y.z>=g;){if(y.x>=d&&y.x<=m&&y.y>=f&&y.y<=_&&y!==n&&y!==o&&bt(a,u,l,c,h,p,y.x,y.y)&&0<=xt(y.prev,y,y.next))return;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=d&&b.x<=m&&b.y>=f&&b.y<=_&&b!==n&&b!==o&&bt(a,u,l,c,h,p,b.x,b.y)&&0<=xt(b.prev,b,b.next))return;b=b.nextZ}return 1}(t,r,n,s):function(t){var e=t.prev,i=t,t=t.next;if(0<=xt(e,i,t))return;var r=e.x,n=i.x,s=t.x,o=e.y,a=i.y,l=t.y,h=r=h&&d.x<=c&&d.y>=u&&d.y<=p&&bt(r,o,n,a,s,l,d.x,d.y)&&0<=xt(d.prev,d,d.next))return;d=d.next}return 1}(t))e.push(T.i/i|0),e.push(t.i/i|0),e.push(w.i/i|0),Rt(t),t=w.next,E=w.next;else if((t=w)===E){o?1===o?gt(t=function(t,e,i){var r=t;do{var n=r.prev,s=r.next.next}while(!Tt(n,s)&&wt(n,r,r.next,s)&&At(n,s)&&At(s,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(s.i/i|0),Rt(r),Rt(r.next),r=t=s),r=r.next,r!==t);return _t(r)}(_t(t),e,i),e,i,r,n,s,2):2===o&&function(t,e,i,r,n,s){var o=t;do{for(var a,l=o.next.next;l!==o.prev;){if(o.i!==l.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&wt(i,i.next,t,e))return 1}while(i=i.next,i!==t);return}(t,e)&&(At(t,e)&&At(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,s=(t.y+e.y)/2;for(;i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next,i!==t;);return r}(t,e)&&(xt(t.prev,t,e.prev)||xt(t,e.prev,e))||Tt(t,e)&&0=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function St(t){return 0= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=g-1,y=Math.floor,b=String.fromCharCode;function x(t){throw RangeError(p[t])}function f(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function m(t,e){var i=t.split("@"),r="",i=(1>>10&1023|55296),t=56320|1023&t),e+=b(t)}).join("")}function E(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function S(t,e,i){var r=0;for(t=i?y(t/l):t>>1,t+=y(t/e);d*v>>1y((_-u)/s))&&x("overflow"),u+=a*s,!(a<(a=o<=p?1:p+v<=o?v:o-p));o+=g)s>y(_/(a=g-a))&&x("overflow"),s*=a;p=S(u-n,e=l.length+1,0==n),y(u/e)>_-c&&x("overflow"),c+=y(u/e),u%=e,l.splice(u++,0,c)}return w(l)}function O(t){for(var e,i,r,n,s,o,a,l,h,u,c=[],p=(t=T(t)).length,d=128,f=72,m=e=0;my((_-e)/(l=i+1))&&x("overflow"),e+=(n-d)*l,d=n,m=0;m_&&x("overflow"),a==d){for(s=e,o=g;!(s<(h=o<=f?1:f+v<=o?v:o-f));o+=g)c.push(b(E(h+(u=s-h)%(h=g-h),0))),s=y(u/h);c.push(b(E(s,0))),f=S(e,l,i==r),e=0,++i}++e,++d}return c.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:w},decode:A,encode:O,toASCII:function(t){return m(t,function(t){return u.test(t)?"xn--"+O(t):t})},toUnicode:function(t){return m(t,function(t){return h.test(t)?A(t.slice(4).toLowerCase()):t})}},r&&e)if(t.exports==r)e.exports=s;else for(o in s)s.hasOwnProperty(o)&&(r[o]=s[o]);else i.punycode=s}),It=function(t){return"string"==typeof t},Dt=function(t){return"object"==typeof t&&null!==t},Ft=function(t){return null===t},Lt=function(t){return null==t};function Nt(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"==typeof t&&0!==t.length){var s=/\+/g,e=(t=t.split(e),1e3),o=(r&&"number"==typeof r.maxKeys&&(e=r.maxKeys),t.length);0",'"',"`"," ","\r","\n","\t"]),qt=["'"].concat(i),Kt=["%","/","?",";","#"].concat(qt),Zt=["/","?","#"],Qt=/^[+a-z0-9A-Z_-]{0,63}$/,$t=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Jt={javascript:!0,"javascript:":!0},te={javascript:!0,"javascript:":!0},ee={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function ie(t,e,i){var r;return t&&Dt(t)&&t instanceof Ht?t:((r=new Ht).parse(t,e,i),r)}Ht.prototype.parse=function(t,e,i){if(!It(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),r=-1!==r&&r]*?)$/i.test(t)},hasProtocol:function(t){return/^[^/:]+:\//.test(this.toPosix(t))},getProtocol:function(t){se(t),t=this.toPosix(t);var e="",i=/^file:\/\/\//.exec(t),r=/^[^/:]+:\/\//.exec(t),n=/^[^/:]+:\//.exec(t);return(i||r||n)&&(i=(null==i?void 0:i[0])||(null==r?void 0:r[0])||(null==n?void 0:n[0]),t=t.slice((e=i).length)),e},toAbsolute:function(t,e,i){return this.isDataUrl(t)?t:(e=oe(this.toPosix(null!=e?e:C.ADAPTER.getBaseUrl())),i=oe(this.toPosix(null!=i?i:this.rootname(e))),se(t),(t=this.toPosix(t)).startsWith("/")?le.join(i,t.slice(1)):this.isAbsolute(t)?t:this.join(e,t))},normalize:function(t){var e,i,r;return se(t=this.toPosix(t)),0===t.length?".":(e="",i=t.startsWith("/"),this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length)),r=t.endsWith("/"),0<(t=function(t,e){for(var i,r="",n=0,s=-1,o=0,a=0;a<=t.length;++a){if(a>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function fe(t){t=t.toString(16);return"#"+("000000".substring(0,6-t.length)+t)}function me(t){return"string"==typeof t&&"#"===(t=pe[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}var _e=function(){for(var t=[],e=[],i=0;i<32;i++)e[t[i]=i]=i;t[J.BLEND_MODES.NORMAL_NPM]=J.BLEND_MODES.NORMAL,t[J.BLEND_MODES.ADD_NPM]=J.BLEND_MODES.ADD,t[J.BLEND_MODES.SCREEN_NPM]=J.BLEND_MODES.SCREEN,e[J.BLEND_MODES.NORMAL]=J.BLEND_MODES.NORMAL_NPM,e[J.BLEND_MODES.ADD]=J.BLEND_MODES.ADD_NPM,e[J.BLEND_MODES.SCREEN]=J.BLEND_MODES.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function ge(t,e){return _e[e?1:0][t]}function ve(t,e,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function ye(t,e){return 1===e?(255*e<<24)+t:0===e?0:(255*e<<24)+(((t>>16&255)*e+.5|0)<<16)+(((t>>8&255)*e+.5|0)<<8)+((255&t)*e+.5|0)}function be(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,!r&&void 0!==r||(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function xe(t,e){var i=6*t;if((e=(e=void 0===e?null:e)||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+i);for(var r=0,n=0;r>>1)|t>>>2)|t>>>4)|t>>>8)|t>>>16)+1}function Se(t){return!(t&t-1||!t)}function Ae(t){var e=(65535>>=e)?1:0)<<3;return(e|=i)|(i=(15<(t>>>=i)?1:0)<<2)|(i=(3<(t>>>=i)?1:0)<<1)|(t>>>=i)>>1}function Oe(t,e,i){var r=t.length;if(!(r<=e||0===i)){for(var n=r-(i=r=this.x&&t=this.y&&e=r||Math.max(o.y,f.y,a.y,l.y)<=n||Math.min(o.y,f.y,a.y,l.y)>=s)&&(u=(e=h*(f.y-o.y))*i+(f=h*(o.x-f.x))*n,c=e*r+f*n,p=e*i+f*s,d=e*r+f*s,!(Math.max(u,c,p,d)<=e*o.x+f*o.y||Math.min(u,c,p,d)>=e*l.x+f*l.y)&&(p=(u=h*(o.y-a.y))*i+(c=h*(a.x-o.x))*n,d=u*r+c*n,e=u*i+c*s,f=u*r+c*s,!(Math.max(p,d,e,f)<=u*o.x+c*o.y||Math.min(p,d,e,f)>=u*l.x+c*l.y))))))):(h=(this.xt.right?t:this).right<=h)&&(this.yt.bottom?t:this).bottom)},Ke.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},Ke.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),t=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(t-r,0),this},Ke.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this},Ke.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),t=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=t-r,this},Ke.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},Ke);function Ke(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=J.SHAPES.RECT}Qe.prototype.clone=function(){return new Qe(this.x,this.y,this.radius)},Qe.prototype.contains=function(t,e){var i;return!(this.radius<=0)&&(i=this.radius*this.radius,t=this.x-t,e=this.y-e,(t*=t)+(e*=e)<=i)},Qe.prototype.getBounds=function(){return new w(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},Qe.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"};var Ze=Qe;function Qe(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),this.x=t=void 0===t?0:t,this.y=e,this.radius=i,this.type=J.SHAPES.CIRC}Je.prototype.clone=function(){return new Je(this.x,this.y,this.width,this.height)},Je.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t=(t-this.x)/this.width,e=(e-this.y)/this.height,(t*=t)+(e*=e)<=1)},Je.prototype.getBounds=function(){return new w(this.x-this.width,this.y-this.height,this.width,this.height)},Je.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"};var $e=Je;function Je(t,e,i,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t=void 0===t?0:t,this.y=e,this.width=i,this.height=r,this.type=J.SHAPES.ELIP}ei.prototype.clone=function(){var t=new ei(this.points.slice());return t.closeStroke=this.closeStroke,t},ei.prototype.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,s=r-1;n=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;var r=t-(this.x+i),n=e-(this.y+i),s=i*i;if(r*r+n*n<=s)return!0;if((r=t-(this.x+this.width-i))*r+n*n<=s)return!0;if(r*r+(n=e-(this.y+this.height-i))*n<=s)return!0;if((r=t-(this.x+i))*r+n*n<=s)return!0}return!1},ri.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"};var ii=ri;function ri(t,e,i,r,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t=void 0===t?0:t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=J.SHAPES.RREC}si.prototype.clone=function(t,e){return new si(t=void 0===t?this.cb:t,e=void 0===e?this.scope:e,this._x,this._y)},si.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},si.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},si.prototype.copyTo=function(t){return t.set(this._x,this._y),t},si.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},si.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(si.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(si.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0});var ni=si;function si(t,e,i,r){void 0===r&&(r=0),this._x=i=void 0===i?0:i,this._y=r,this.cb=t,this.scope=e}ai.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},ai.prototype.set=function(t,e,i,r,n,s){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=s,this},ai.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));e=e||this.array;return t?(e[0]=this.a,e[1]=this.b,e[2]=0,e[3]=this.c,e[4]=this.d,e[5]=0,e[6]=this.tx,e[7]=this.ty):(e[0]=this.a,e[1]=this.c,e[2]=this.tx,e[3]=this.b,e[4]=this.d,e[5]=this.ty,e[6]=0,e[7]=0),e[8]=1,e},ai.prototype.apply=function(t,e){e=e||new tt;var i=t.x,t=t.y;return e.x=this.a*i+this.c*t+this.tx,e.y=this.b*i+this.d*t+this.ty,e},ai.prototype.applyInverse=function(t,e){e=e||new tt;var i=1/(this.a*this.d+this.c*-this.b),r=t.x,t=t.y;return e.x=this.d*i*r+-this.c*i*t+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*t+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e},ai.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},ai.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},ai.prototype.rotate=function(t){var e=Math.cos(t),t=Math.sin(t),i=this.a,r=this.c,n=this.tx;return this.a=i*e-this.b*t,this.b=i*t+this.b*e,this.c=r*e-this.d*t,this.d=r*t+this.d*e,this.tx=n*e-this.ty*t,this.ty=n*t+this.ty*e,this},ai.prototype.append=function(t){var e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},ai.prototype.setTransform=function(t,e,i,r,n,s,o,a,l){return this.a=Math.cos(o+l)*n,this.b=Math.sin(o+l)*n,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this},ai.prototype.prepend=function(t){var e,i,r=this.tx;return 1===t.a&&0===t.b&&0===t.c&&1===t.d||(e=this.a,i=this.c,this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d),this.tx=r*t.a+this.ty*t.c+t.tx,this.ty=r*t.b+this.ty*t.d+t.ty,this},ai.prototype.decompose=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,s=t.pivot,o=-Math.atan2(-r,n),a=Math.atan2(i,e),l=Math.abs(o+a);return l<1e-5||Math.abs(He-l)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=a),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(s.x*e+s.y*r),t.position.y=this.ty+(s.x*i+s.y*n),t},ai.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,s=t*r-e*i;return this.a=r/s,this.b=-e/s,this.c=-i/s,this.d=t/s,this.tx=(i*this.ty-r*n)/s,this.ty=-(t*this.ty-e*n)/s,this},ai.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},ai.prototype.clone=function(){var t=new ai;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},ai.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},ai.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},ai.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(ai,"IDENTITY",{get:function(){return new ai},enumerable:!1,configurable:!0}),Object.defineProperty(ai,"TEMP_MATRIX",{get:function(){return new ai},enumerable:!1,configurable:!0});var oi=ai;function ai(t,e,i,r,n,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===s&&(s=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=s}var li=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],hi=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ui=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ci=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],pi=[],di=[],fi=Math.sign;for(var mi=0;mi<16;mi++){var _i=[];pi.push(_i);for(var gi=0;gi<16;gi++)for(var vi=fi(li[mi]*li[gi]+ui[mi]*hi[gi]),yi=fi(hi[mi]*li[gi]+ci[mi]*hi[gi]),bi=fi(li[mi]*ui[gi]+ui[mi]*ci[gi]),xi=fi(hi[mi]*ui[gi]+ci[mi]*ci[gi]),Ti=0;Ti<16;Ti++)if(li[Ti]===vi&&hi[Ti]===yi&&ui[Ti]===bi&&ci[Ti]===xi){_i.push(Ti);break}}for(mi=0;mi<16;mi++){var wi=new oi;wi.set(li[mi],hi[mi],ui[mi],ci[mi],0,0),di.push(wi)}var Ei={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return li[t]},uY:function(t){return hi[t]},vX:function(t){return ui[t]},vY:function(t){return ci[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return pi[t][e]},sub:function(t,e){return pi[t][Ei.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?0<=e?Ei.S:Ei.N:2*Math.abs(e)<=Math.abs(t)?0this.maxX||this.minY>this.maxY},Pi.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Pi.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?w.EMPTY:((t=t||new w(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Pi.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)},Pi.prototype.addPointMatrix=function(t,e){var i=t.a,r=t.b,n=t.c,s=t.d,o=t.tx,t=t.ty,i=i*e.x+n*e.y+o,n=r*e.x+s*e.y+t;this.minX=Math.min(this.minX,i),this.maxX=Math.max(this.maxX,i),this.minY=Math.min(this.minY,n),this.maxY=Math.max(this.maxY,n)},Pi.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,s=t[0],o=t[1],e=sr?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Pi.prototype.addBoundsMask=function(t,e){var i,r,n,s=(t.minX>e.minX?t:e).minX,o=(t.minY>e.minY?t:e).minY,a=(t.maxXe.x?t.minX:e.x,o=t.minY>e.y?t.minY:e.y,a=t.maxXi?this.maxX:i,this.minY=this.minYr?this.maxY:r};var Oi=Pi;function Pi(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}var Ri=function(t,e){return(Ri=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function Ci(t,e){function i(){this.constructor=t}Ri(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}Ci(l,Mi=it),l.mixin=function(t){for(var e=Object.keys(t),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).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},h.prototype.swapChildren=function(t,e){var i,r;t!==e&&(i=this.getChildIndex(t),r=this.getChildIndex(e),this.children[i]=e,this.children[r]=t,this.onChildrenChange(i=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Oe(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},h.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},h.prototype.removeChild=function(){for(var t=arguments,e=[],i=0;ie.priority){t.connect(i);break}e=(i=e).next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},u.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(u.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),u.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},u.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},u.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}},u.prototype.update=function(t){var e;if((t=void 0===t?performance.now():t)>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var yr,f=br;function br(t,e){var i=this;return e=e||{},(i=yr.call(this,C.ADAPTER.createCanvas())||this)._width=0,i._height=0,i.svg=t,i.scale=e.scale||1,i._overrideWidth=e.width,i._overrideHeight=e.height,i._resolve=null,i._crossorigin=e.crossorigin,i._load=null,!1!==e.autoLoad&&i.load(),i}c(wr,xr=ur),wr.prototype.update=function(t){var e;this.destroyed||(e=Wi.shared.elapsedMS*this.source.playbackRate,this._msToNextUpdate=Math.floor(this._msToNextUpdate-e),(!this._updateFPS||this._msToNextUpdate<=0)&&(xr.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0))},wr.prototype.load=function(){var e,i=this;return this._load||(((e=this.source).readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise(function(t){i.valid?t(i):(i._resolve=t,e.load())})),this._load},wr.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},wr.prototype._isSourcePlaying=function(){var t=this.source;return 0this.baseTexture.width,o=i+n>this.baseTexture.height;if(s||o)throw e="X: "+e+" + "+r+" = "+(e+r)+" > "+this.baseTexture.width,i="Y: "+i+" + "+n+" = "+(i+n)+" > "+this.baseTexture.height,new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+e+" "+(s&&o?"and":"or")+" "+i);this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),m.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(m,"EMPTY",{get:function(){return m._EMPTY||(Br(m._EMPTY=new m(new M)),Br(m._EMPTY.baseTexture)),m._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(m,"WHITE",{get:function(){var t,e;return m._WHITE||(e=(t=C.ADAPTER.createCanvas(16,16)).getContext("2d"),t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),Br(m._WHITE=new m(M.from(t))),Br(m._WHITE.baseTexture)),m._WHITE},enumerable:!1,configurable:!0});var Ur,et=m;function m(t,e,i,r,n,s){var o=Ur.call(this)||this;if(o.noFrame=!1,e||(o.noFrame=!0,e=new w(0,0,1,1)),t instanceof m&&(t=t.baseTexture),o.baseTexture=t,o._frame=e,o.trim=r,o.valid=!1,o._uvs=zr,o.uvMatrix=null,o.orig=i||e,o._rotate=Number(n||0),!0===n)o._rotate=2;else if(o._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return o.defaultAnchor=s?new tt(s.x,s.y):new tt(0,0),o._updateID=0,o.textureCacheIds=[],t.valid?o.noFrame?t.valid&&o.onBaseTextureUpdated(t):o.frame=e:t.once("loaded",o.onBaseTextureUpdated,o),o.noFrame&&t.on("update",o.onBaseTextureUpdated,o),o}c(Xr,jr=et),Object.defineProperty(Xr.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(Xr.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),Xr.prototype.resize=function(t,e,i){void 0===i&&(i=!0);var r=this.baseTexture.resolution,t=Math.round(t*r)/r,e=Math.round(e*r)/r;this.valid=0>>0,1=J.ENV.WEBGL2?t.getContext("webgl2",e):i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},Sn.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},Sn.prototype.handleContextLost=function(t){t.preventDefault()},Sn.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},Sn.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},Sn.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},Sn.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext,e=(i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly"),i||!!t.getExtension("OES_element_index_uint"));(this.supports.uint32Indices=e)||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},Sn);function Sn(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}var An=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=J.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},On=new w,Pn=(Rn.prototype.contextChange=function(){var e,t,i=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new w,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion?(e=this.renderer.context.extensions.drawBuffers,t=this.renderer.context.extensions.depthTexture,C.PREFER_ENV===J.ENV.WEBGL_LEGACY&&(t=e=null),e?i.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,i.drawBuffers=function(){}),t||(this.writeDepthTexture=!1)):this.msaaSamples=i.getInternalformatParameter(i.RENDERBUFFER,i.RGBA8,i.SAMPLES)},Rn.prototype.bind=function(t,e,i){void 0===i&&(i=0);var r=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=i),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var s,o,a=0;a>i,o=e.height>>i,n=s/e.width,this.setViewport(e.x*n,e.y*n,s,o)):(s=t.width>>i,o=t.height>>i,this.setViewport(0,0,s,o))}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},Rn.prototype.setViewport=function(t,e,i,r){var n=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),n.width===i&&n.height===r&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=i,n.height=r,this.gl.viewport(t,e,i,r))},Object.defineProperty(Rn.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),Rn.prototype.clear=function(t,e,i,r,n){void 0===n&&(n=J.BUFFER_BITS.COLOR|J.BUFFER_BITS.DEPTH);var s=this.gl;s.clearColor(t,e,i,r),s.clear(n)},Rn.prototype.initFramebuffer=function(t){var e=this.gl,e=new An(e.createFramebuffer());return e.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=e,this.managedFramebuffers.push(t),t.disposeRunner.add(this),e},Rn.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],r=(i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height)),t.colorTextures),n=r.length;e.drawBuffers||(n=Math.min(n,1));for(var s=0;s=J.ENV.WEBGL2?t.getContext("webgl2",{}):e)||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),jn=e),jn}function Xn(t,e,i){return"precision"!==t.substring(0,9)?"precision "+(e===J.PRECISION.HIGH&&i!==J.PRECISION.HIGH?J.PRECISION.MEDIUM:e)+" float;\n"+t:i!==J.PRECISION.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Hn={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Yn(t){return Hn[t]}var Wn=null,Vn={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function qn(t,e){if(!Wn){var i=Object.keys(Vn);Wn={};for(var r=0;r>=1,i++;this.stateId=t.data}for(i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},Qs.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,r=0;rthis.maxIdle&&(t.destroyTexture(n,!0),i=!(e[r]=null))}if(i){for(var s=0,r=0;r=t.data.byteLength?i.bufferSubData(t.type,0,t.data):(e=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW,r.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,e)))},lo.prototype.dispose=function(t,e){var i,r;this.managedBuffers[t.id]&&(delete this.managedBuffers[t.id],i=t._glBuffers[this.CONTEXT_UID],r=this.gl,t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID]))},lo.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i=J.MSAA_QUALITY.HIGH?this.multisample=J.MSAA_QUALITY.HIGH:t>=J.MSAA_QUALITY.MEDIUM?this.multisample=J.MSAA_QUALITY.MEDIUM:t>=J.MSAA_QUALITY.LOW?this.multisample=J.MSAA_QUALITY.LOW:this.multisample=J.MSAA_QUALITY.NONE},co.prototype.addSystem=function(t,e){var i,r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(i in this[e]=r,this.runners)this.runners[i].add(r);return this},co.prototype.render=function(t,e){var i,r,n,s;e&&(s=e instanceof Gr?(ke("6.0.0","Renderer#render arguments changed, use options instead."),i=e,r=arguments[2],n=arguments[3],arguments[4]):(i=e.renderTexture,r=e.clear,n=e.transform,e.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,this.context.isLost||(i||(this._lastObjectRendered=t),s||(e=t.enableTempParent(),t.updateTransform(),t.disableTempParent(e)),this.renderTexture.bind(i),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),i&&i.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender"))},co.prototype.generateTexture=function(t,e,i,r){t=ho.prototype.generateTexture.call(this,t,e=void 0===e?{}:e,i,r);return this.framebuffer.blit(),t},co.prototype.resize=function(t,e){ho.prototype.resize.call(this,t,e),this.runners.resize.emit(this.screen.height,this.screen.width)},co.prototype.reset=function(){return this.runners.reset.emit(),this},co.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},co.prototype.destroy=function(t){for(var e in this.runners.destroy.emit(),this.runners)this.runners[e].destroy();ho.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(co.prototype,"extract",{get:function(){return ke("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),co.registerPlugin=function(t,e){ke("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),ji.add({name:t,type:J.ExtensionType.RendererPlugin,ref:e})},co.__plugins={};var ho,uo=co;function co(t){var e=ho.call(this,J.RENDERER_TYPE.WEBGL,t)||this;return t=e.options,e.gl=null,e.CONTEXT_UID=0,e.runners={destroy:new Gi("destroy"),contextChange:new Gi("contextChange"),reset:new Gi("reset"),update:new Gi("update"),postrender:new Gi("postrender"),prerender:new Gi("prerender"),resize:new Gi("resize")},e.runners.contextChange.add(e),e.globalUniforms=new cn({projectionMatrix:new oi},!0),e.addSystem(gs,"mask").addSystem(En,"context").addSystem(qs,"state").addSystem(Ws,"shader").addSystem(Js,"texture").addSystem(ao,"buffer").addSystem(Mn,"geometry").addSystem(Pn,"framebuffer").addSystem(ws,"scissor").addSystem(As,"stencil").addSystem(Ps,"projection").addSystem(Zs,"textureGC").addSystem(gn,"filter").addSystem(ks,"renderTexture").addSystem(xn,"batch"),e.initPlugins(co.__plugins),e.multisample=void 0,t.context?e.context.initFromContext(t.context):e.context.initFromOptions({alpha:!!e.useContextAlpha,antialias:t.antialias,premultipliedAlpha:e.useContextAlpha&&"notMultiplied"!==e.useContextAlpha,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:e.options.powerPreference}),e.renderingToScreen=!0,ue(2===e.context.webGLVersion?"WebGL 2":"WebGL 1"),e.resize(e.options.width,e.options.height),e}function po(t){return uo.create(t)}ji.handleByMap(J.ExtensionType.RendererPlugin,uo.__plugins);var fo="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}",mo="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",_o=(go.prototype.destroy=function(){this.renderer=null},go);function go(t){ke("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=t}var vo=function(){this.texArray=null,this.blend=0,this.type=J.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null},yo=(bo.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)},So.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,i=So._textureArrayPool,r=this.renderer.batch,n=this._tempBoundTextures,s=this.renderer.textureGC.count,o=++M._globalBatch,a=0,l=i[0],h=0;r.copyBoundTextures(n,e);for(var u=0;u=e&&(r.boundArray(l,n,o,e),this.buildDrawCalls(l,h,u),h=u,l=i[++a],++o),c._batchEnabled=o,c.touched=s,l.elements[l.count++]=c)}0 title : "+t.title+"
tabIndex: "+t.tabIndex},zo.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,i=e.width,e=e.height;t.x+t.width>i&&(t.width=i-t.x),t.y+t.height>e&&(t.height=e-t.y)},zo.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",-1>2,n[1]=(3&r[0])<<4|r[1]>>4,n[2]=(15&r[1])<<2|r[2]>>6,n[3]=63&r[2],i-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(s=0;sa[0]&&e[1]>1||1)+r-1&~(r-1))*(p=(u=u>>1||1)+n-1&~(n-1))*wa[e];return a};var Ca,Ma=ka;function ka(t,e){var i=Ca.call(this,t,e)||this;return i.format=e.format,i.levels=e.levels||1,i._width=e.width,i._height=e.height,i._extension=ka._formatToExtension(i.format),(e.levelBuffers||i.buffer)&&(i._levelBuffers=e.levelBuffers||ka._createLevelBuffers(t instanceof Uint8Array?t:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}Ia.use=function(i,r){var t=i.data;if(i.type===J.LoaderResource.TYPE.JSON&&t&&t.cacheID&&t.textures){for(var e,n,s=t.textures,o=void 0,a=void 0,l=0,h=s.length;l>>=1,m>>>=1;for(var g=148,_=0;_>1||1)+4-1&-4)*(x=(y=y>>1||1)+4-1&-4)*_}return 0!==s?{uncompressed:f.map(function(t){var e=t[0].levelBuffer,i=!1;return s===J.TYPES.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):s===J.TYPES.UNSIGNED_INT?(i=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):s===J.TYPES.INT&&(i=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new er(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:s,format:i?function(t){switch(t){case J.FORMATS.RGBA:return J.FORMATS.RGBA_INTEGER;case J.FORMATS.RGB:return J.FORMATS.RGB_INTEGER;case J.FORMATS.RG:return J.FORMATS.RG_INTEGER;case J.FORMATS.RED:return J.FORMATS.RED_INTEGER;default:return t}}(o):o}}),kvData:i}:{compressed:f.map(function(t){return new Ma(null,{format:a,width:l,height:h,levels:p,levelBuffers:t})}),kvData:i}}J.LoaderResource.setExtensionXhrType("dds",J.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);cl.use=function(t,e){if("dds"===t.extension&&t.data)try{Object.assign(t,Da(t.name||t.url,Va(t.data),t.metadata))}catch(t){return void e(t)}e()},cl.extension=J.ExtensionType.Loader;var v=cl;function cl(){}J.LoaderResource.setExtensionXhrType("ktx",J.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);dl.use=function(t,e){if("ktx"===t.extension&&t.data)try{var r,n=t.name||t.url,i=ul(n,t.data,this.loadKeyValueData),s=i.compressed,o=i.uncompressed,a=i.kvData;if(s){var l=Da(n,s,t.metadata);if(a&&l.textures)for(var h in l.textures)l.textures[h].baseTexture.ktxKeyValueData=a;Object.assign(t,l)}else o&&(r={},o.forEach(function(t,e){var t=new et(new M(t.resource,{mipmap:J.MIPMAP_MODES.OFF,alphaMode:J.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:t.type,format:t.format})),i=n+"-"+(e+1);a&&(t.baseTexture.ktxKeyValueData=a),M.addToCache(t.baseTexture,i),et.addToCache(t,i),0===e&&(r[n]=t,M.addToCache(t.baseTexture,n),et.addToCache(t,n)),r[i]=t}),Object.assign(t,{textures:r}))}catch(t){return void e(t)}e()},dl.extension=J.ExtensionType.Loader,dl.loadKeyValueData=!1;var pl=dl;function dl(){}var fl=function(t,e){return(fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ml(t,e){function i(){this.constructor=t}fl(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}ml(vl,_l=zi),vl.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])},vl.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(vl.prototype,"tint",{get:function(){return this._tint},set:function(t){de(this._tint=t,this.tintRgb)},enumerable:!1,configurable:!0}),vl.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))},vl.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length=o.length&&o.push(this._generateOneMoreBuffer(t)),o[p]),m=(f.uploadDynamic(e,c,d),t._bufferUpdateIDs[p]||0);(u=u||f._updateIDthis.maxSegments&&(t=this.maxSegments),t):e}},Sl=(Al.prototype.clone=function(){var t=new Al;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},Al.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=et.WHITE,this.matrix=null,this.visible=!1},Al.prototype.destroy=function(){this.texture=null,this.matrix=null},Al);function Al(){this.color=16777215,this.alpha=1,this.texture=et.WHITE,this.matrix=null,this.visible=!1,this.reset()}var Ol=function(t,e){return(Ol=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function Pl(t,e){function i(){this.constructor=t}Ol(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function Rl(t,e){void 0===e&&(e=!1);var i=t.length;if(!(i<6)){for(var r=0,n=0,s=t[i-2],o=t[i-1];n>0),m=c/f;if(p+=m,a){o.push(t,e),o.push(i,r);for(var _=1,g=p;_>16)+(65280&e)+((255&e)<<16),i);t.length=Math.max(t.length,n+r);for(var o=0;o>16&255)/255*n,s.tint[1]=(r>>8&255)/255*n,s.tint[2]=(255&r)/255*n,s.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,l=o.length;a>16)+(65280&r)+((255&r)<<16)}}},b.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,n=t.d,s=t.tx,o=t.ty,a=this._geometry.points,l=this.vertexData,h=0,u=0;u=i&&ph.x=i&&ph.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(_h.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||et.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),_h);function mh(){this.constructor=ch}function _h(t){var e=uh.call(this)||this;return e._anchor=new ni(e._onAnchorUpdate,e,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),e._texture=null,e._width=0,e._height=0,e._tint=null,e._tintRGB=null,e.tint=16777215,e.blendMode=J.BLEND_MODES.NORMAL,e._cachedTint=16777215,e.uvs=null,e.texture=t||et.EMPTY,e.vertexData=new Float32Array(8),e.vertexTrimmedData=null,e._transformID=-1,e._textureID=-1,e._transformTrimmedID=-1,e._textureTrimmedID=-1,e.indices=dh,e.pluginName="batch",e.isSprite=!0,e._roundPixels=C.ROUND_PIXELS,e}var gh=function(t,e){return(gh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};J.TEXT_GRADIENT=void 0,(Fl=J.TEXT_GRADIENT||(J.TEXT_GRADIENT={}))[Fl.LINEAR_VERTICAL=0]="LINEAR_VERTICAL";var vh={align:"left",breakWords:!(Fl[Fl.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"),dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:J.TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},yh=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],bh=(x.prototype.clone=function(){var t={};return wh(t,this,vh),new x(t)},x.prototype.reset=function(){wh(this,vh,vh)},Object.defineProperty(x.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){t=Th(t);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"fill",{get:function(){return this._fill},set:function(t){t=Th(t);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){!function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return;if(t.length!==e.length)return;for(var i=0;i=i&&nu.x=i&&nu.y>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),wu.prototype.update=function(){var t;this._colorDirty&&(this._colorDirty=!1,t=this.texture.baseTexture,be(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)};var xu,Tu=wu;function wu(t,e){var i=this,r={uSampler:t,alpha:1,uTextureMatrix:oi.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e)).uniforms&&Object.assign(r,e.uniforms),(i=xu.call(this,e.program||rs.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),r)||this)._colorDirty=!1,i.uvMatrix=new ps(t),i.batchable=void 0===e.program,i.pluginName=e.pluginName,i.tint=e.tint,i.alpha=e.alpha,i}du(Au,Eu=en),Object.defineProperty(Au.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0});var Eu,Su=Au;function Au(t,e,i){var r=Eu.call(this)||this,t=new Kr(t),e=new Kr(e,!0),i=new Kr(i,!0,!0);return r.addAttribute("aVertexPosition",t,2,!1,J.TYPES.FLOAT).addAttribute("aTextureCoord",e,2,!1,J.TYPES.FLOAT).addIndex(i),r._updateId=-1,r}var Ou=function(t,e){return(Ou=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};var Pu=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},Ru=(Cu.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},Cu.parse=function(t){var e,i=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(e in i){var n,s=i[e].match(/^[a-z]+/gm)[0],o=i[e].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(n in o){var l=o[n].split("="),h=l[0],l=l[1].replace(/"/gm,""),u=parseFloat(l),l=isNaN(u)?l:u;a[h]=l}r[s].push(a)}var c=new Pu;return r.info.forEach(function(t){return c.info.push({face:t.face,size:parseInt(t.size,10)})}),r.common.forEach(function(t){return c.common.push({lineHeight:parseInt(t.lineHeight,10)})}),r.page.forEach(function(t){return c.page.push({id:parseInt(t.id,10),file:t.file})}),r.char.forEach(function(t){return c.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})}),r.kerning.forEach(function(t){return c.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})}),r.distanceField.forEach(function(t){return c.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})}),c},Cu);function Cu(){}ku.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},ku.parse=function(t){for(var e=new Pu,i=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),s=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField"),l=0;l")&&(t=(new globalThis.DOMParser).parseFromString(t,"text/xml"),Mu.test(t))},Du.parse=function(t){t=(new globalThis.DOMParser).parseFromString(t,"text/xml");return Mu.parse(t)};var Iu=Du;function Du(){}var Fu=[Ru,Mu,Iu];function Lu(t){for(var e=0;eL&&(Oe(r,1+c-++z,1+f-c),f=c,c=-1,n.push(p),s.push(06*E)||I.vertices.length<2*yu.BATCHABLE_SIZE)I.vertices=new Float32Array(8*E),I.uvs=new Float32Array(8*E),I.indices=new Uint16Array(6*E);else for(var Y=I.total,W=I.vertices,V=4*Y*2;V>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0],e)},E.prototype.greyscale=function(t,e){this._loadMatrix([t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0],e)},E.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},E.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),t=Math.sin(t),r=(0,Math.sqrt)(1/3);this._loadMatrix([i+1/3*(1-i),1/3*(1-i)-r*t,1/3*(1-i)+r*t,0,0,1/3*(1-i)+r*t,i+1/3*(1-i),1/3*(1-i)-r*t,0,0,1/3*(1-i)-r*t,1/3*(1-i)+r*t,i+1/3*(1-i),0,0,0,0,0,1,0],e)},E.prototype.contrast=function(t,e){var t=(t||0)+1,i=-.5*(t-1);this._loadMatrix([t,0,0,0,i,0,t,0,0,i,0,0,t,0,i,0,0,0,1,0],e)},E.prototype.saturate=function(t,e){var t=2*(t=void 0===t?0:t)/3+1,i=-.5*(t-1);this._loadMatrix([t,i,i,0,0,i,t,i,0,0,i,i,t,0,0,0,0,0,1,0],e)},E.prototype.desaturate=function(){this.saturate(-1)},E.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},E.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},E.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},E.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},E.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},E.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},E.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},E.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},E.prototype.colorTone=function(t,e,i,r,n){var s=((i=i||16770432)>>16&255)/255,o=(i>>8&255)/255,i=(255&i)/255,a=((r=r||3375104)>>16&255)/255,l=(r>>8&255)/255,r=(255&r)/255;this._loadMatrix([.3,.59,.11,0,0,s,o,i,t=t||.2,0,a,l,r,e=e||.15,0,s-a,o-l,i-r,0,0],n)},E.prototype.night=function(t,e){this._loadMatrix([-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},E.prototype.predator=function(t,e){this._loadMatrix([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],e)},E.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},E.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(E.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0});var _c,gc,vc=E;function yc(){this.constructor=gc}function E(){var t=this,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};return(t=_c.call(this,mo,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",e)||this).alpha=1,t}vc.prototype.grayscale=vc.prototype.greyscale;var bc=function(t,e){return(bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};bc(Tc=Sc,wc=xc=$),Tc.prototype=null===wc?Object.create(wc):(Ec.prototype=wc.prototype,new Ec),Sc.prototype.apply=function(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,s=Math.sqrt(n.a*n.a+n.b*n.b),o=Math.sqrt(n.c*n.c+n.d*n.d);0!==s&&0!==o&&(this.uniforms.rotation[0]=n.a/s,this.uniforms.rotation[1]=n.b/s,this.uniforms.rotation[2]=n.c/o,this.uniforms.rotation[3]=n.d/o),t.applyFilter(this,e,i,r)},Object.defineProperty(Sc.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0});var xc,Tc,wc=Sc;function Ec(){this.constructor=Tc}function Sc(t,e){var i=this,r=new oi;return t.renderable=!1,(i=xc.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=t,i.maskMatrix=r,i.scale=new tt(e=null==e?20:e,e),i}var Ac=function(t,e){return(Ac=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};Ac(Pc=Mc,Rc=Oc=$),Pc.prototype=null===Rc?Object.create(Rc):(Cc.prototype=Rc.prototype,new Cc);var Oc,Pc,Rc=Mc;function Cc(){this.constructor=Pc}function Mc(){return Oc.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}var kc=function(t,e){return(kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};kc(Dc=Nc,Fc=Ic=$),Dc.prototype=null===Fc?Object.create(Fc):(Lc.prototype=Fc.prototype,new Lc),Object.defineProperty(Nc.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(Nc.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0});var Ic,Dc,Fc=Nc;function Lc(){this.constructor=Dc}function Nc(t,e){void 0===t&&(t=.5),void 0===e&&(e=Math.random());var i=Ic.call(this,mo,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return i.noise=t,i.seed=e,i}(A={NORMAL:0,0:"NORMAL",ADD:1,1:"ADD",MULTIPLY:2,2:"MULTIPLY",SCREEN:3,3:"SCREEN",OVERLAY:4,4:"OVERLAY",DARKEN:5,5:"DARKEN",LIGHTEN:6,6:"LIGHTEN",COLOR_DODGE:7,7:"COLOR_DODGE",COLOR_BURN:8,8:"COLOR_BURN",HARD_LIGHT:9,9:"HARD_LIGHT",SOFT_LIGHT:10,10:"SOFT_LIGHT",DIFFERENCE:11,11:"DIFFERENCE",EXCLUSION:12,12:"EXCLUSION",HUE:13,13:"HUE",SATURATION:14,14:"SATURATION",COLOR:15,15:"COLOR",LUMINOSITY:16,16:"LUMINOSITY",NORMAL_NPM:17,17:"NORMAL_NPM",ADD_NPM:18,18:"ADD_NPM",SCREEN_NPM:19,19:"SCREEN_NPM",NONE:20,20:"NONE",SRC_OVER:0})[0]="SRC_OVER",A[A.SRC_IN=21]="SRC_IN",A[A.SRC_OUT=22]="SRC_OUT",A[A.SRC_ATOP=23]="SRC_ATOP",A[A.DST_OVER=24]="DST_OVER",A[A.DST_IN=25]="DST_IN",A[A.DST_OUT=26]="DST_OUT",A[A.DST_ATOP=27]="DST_ATOP",A[A.ERASE=26]="ERASE",A[A.SUBTRACT=28]="SUBTRACT",A[A.XOR=29]="XOR",(A={NPM:0,0:"NPM",UNPACK:1,1:"UNPACK",PMA:2,2:"PMA",NO_PREMULTIPLIED_ALPHA:0})[0]="NO_PREMULTIPLIED_ALPHA",A[A.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",A[A.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",A[A.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",(A={NO:0,0:"NO",YES:1,1:"YES",AUTO:2,2:"AUTO",BLEND:0})[0]="BLEND",A[A.CLEAR=1]="CLEAR",A[A.BLIT=2]="BLIT",(A=O=O||{})[A.NONE=0]="NONE",A[A.LOW=2]="LOW",A[A.MEDIUM=4]="MEDIUM",A[A.HIGH=8]="HIGH";var zc,Bc,Uc,jc,Gc,Xc,Hc=new oi,Yc=(i.prototype._cacheAsBitmap=!1,i.prototype._cacheData=null,i.prototype._cacheAsBitmapResolution=null,i.prototype._cacheAsBitmapMultisample=O.NONE,function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}),A=(Object.defineProperties(i.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&((this._cacheAsBitmap=t)?(this._cacheData||(this._cacheData=new Yc),(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))}}}),i.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))},i.prototype._initCachedDisplayObject=function(t){var e,i,r,n,s,o,a,l;this._cacheData&&this._cacheData.sprite||(e=this.alpha,this.alpha=1,t.batch.flush(),i=this.getLocalBounds(null,!0).clone(),this.filters&&this.filters.length&&(r=this.filters[0].padding,i.pad(r)),i.ceil(C.RESOLUTION),r=t.renderTexture.current,n=t.renderTexture.sourceFrame.clone(),s=t.renderTexture.destinationFrame.clone(),o=t.projection.transform,a=Gr.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!=(a=this.cacheAsBitmapMultisample)?a:t.multisample}),l="cacheAsBitmap_"+ ++Re,this._cacheData.textureCacheId=l,M.addToCache(a.baseTexture,l),et.addToCache(a,l),l=this.transform.localTransform.copyTo(Hc).invert().translate(-i.x,-i.y),this.render=this._cacheData.originalRender,t.render(this,{renderTexture:a,clear:!0,transform:l,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=o,t.renderTexture.bind(r,n,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e,(l=new fh(a)).transform.worldTransform=this.transform.worldTransform,l.anchor.x=-(i.x/i.width),l.anchor.y=-(i.y/i.height),l.alpha=e,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=l.containsPoint.bind(l))},i.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))},i.prototype._initCachedDisplayObjectCanvas=function(t){var e,i,r,n,s,o;this._cacheData&&this._cacheData.sprite||(e=this.getLocalBounds(null,!0),i=this.alpha,this.alpha=1,r=t.context,n=t._projTransform,e.ceil(C.RESOLUTION),s=Gr.create({width:e.width,height:e.height}),o="cacheAsBitmap_"+ ++Re,this._cacheData.textureCacheId=o,M.addToCache(s.baseTexture,o),et.addToCache(s,o),this.transform.localTransform.copyTo(o=Hc),o.invert(),o.tx-=e.x,o.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:s,clear:!0,transform:o,skipUpdateTransform:!1}),t.context=r,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i,(o=new fh(s)).transform.worldTransform=this.transform.worldTransform,o.anchor.x=-(e.x/e.width),o.anchor.y=-(e.y/e.height),o.alpha=i,o._bounds=this._bounds,this._cacheData.sprite=o,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=o.containsPoint.bind(o))},i.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},i.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},i.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,M.removeFromCache(this._cacheData.textureCacheId),et.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},i.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},i.prototype.name=null,zi.prototype.getChildByName=function(t,e){for(var i=0,r=this.children.length;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=g-1,y=Math.floor,b=String.fromCharCode;function x(t){throw RangeError(p[t])}function f(t,e){for(var i=t.length,r=[];i--;)r[i]=e(t[i]);return r}function m(t,e){var i=t.split("@"),r="",i=(1>>10&1023|55296),t=56320|1023&t),e+=b(t)}).join("")}function E(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function S(t,e,i){var r=0;for(t=i?y(t/l):t>>1,t+=y(t/e);d*v>>1y((_-u)/s))&&x("overflow"),u+=a*s,!(a<(a=o<=p?1:p+v<=o?v:o-p));o+=g)s>y(_/(a=g-a))&&x("overflow"),s*=a;p=S(u-n,e=l.length+1,0==n),y(u/e)>_-c&&x("overflow"),c+=y(u/e),u%=e,l.splice(u++,0,c)}return w(l)}function O(t){for(var e,i,r,n,s,o,a,l,h,u,c=[],p=(t=T(t)).length,d=128,f=72,m=e=0;my((_-e)/(l=i+1))&&x("overflow"),e+=(n-d)*l,d=n,m=0;m_&&x("overflow"),a==d){for(s=e,o=g;!(s<(h=o<=f?1:f+v<=o?v:o-f));o+=g)c.push(b(E(h+(u=s-h)%(h=g-h),0))),s=y(u/h);c.push(b(E(s,0))),f=S(e,l,i==r),e=0,++i}++e,++d}return c.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:w},decode:A,encode:O,toASCII:function(t){return m(t,function(t){return u.test(t)?"xn--"+O(t):t})},toUnicode:function(t){return m(t,function(t){return h.test(t)?A(t.slice(4).toLowerCase()):t})}},r&&e)if(t.exports==r)e.exports=s;else for(o in s)s.hasOwnProperty(o)&&(r[o]=s[o]);else i.punycode=s});function dp(t,e,i,r){e=e||"&",i=i||"=";var n={};if("string"==typeof t&&0!==t.length){var s=/\+/g,e=(t=t.split(e),1e3),o=(r&&"number"==typeof r.maxKeys&&(e=r.maxKeys),t.length);0t?1:this._width/t,e=this._topHeight+this._bottomHeight,e=this._height>e?1:this._height/e;return Math.min(t,e)},Object.defineProperty(Bp.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(Bp.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(Bp.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(Bp.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(Bp.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(Bp.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Bp.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data,t=(this._origWidth=t.orig.width,this._origHeight=t.orig.height,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]=t*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-t*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()};var zp,rp=Bp;function Bp(t,e,i,r,n){void 0===e&&(e=10),void 0===i&&(i=10),void 0===r&&(r=10),void 0===n&&(n=10);var s=zp.call(this,et.WHITE,4,4)||this;return s._origWidth=t.orig.width,s._origHeight=t.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=e,s._rightWidth=r,s._topHeight=i,s._bottomHeight=n,s.texture=t,s}var Up=function(t,e){return(Up=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};Up(Gp=Hp,np=jp=fh),Gp.prototype=null===np?Object.create(np):(Xp.prototype=np.prototype,new Xp),Hp.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Wi.shared.remove(this.update,this),this._isConnectedToTicker=!1))},Hp.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Wi.shared.add(this.update,this,J.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},Hp.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},Hp.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},Hp.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=r/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()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(0i)&&this.onLoop(),this.updateTexture())}},Hp.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))},Hp.prototype.destroy=function(t){this.stop(),jp.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},Hp.fromFrames=function(t){for(var e=[],i=0;i>0,r=t[e];t[e]=t[i],t[i]=r}},E.prototype._randomizeOffsets=function(){for(var t=0;t>0,t,1+o>>0),r+=o}e.baseTexture.update(),this.uniforms.displacementMap=e},Object.defineProperty(E.prototype,"sizes",{get:function(){return this._sizes},set:function(t){for(var e=Math.min(this._slices,t.length),i=0;i>0)},Object.defineProperty(x.prototype,"offset",{get:function(){return this.uniforms.uOffset},set:function(t){this.uniforms.uOffset=t},enumerable:!1,configurable:!0}),x),Gt=(e(b,J=a.Filter),Object.defineProperty(b.prototype,"replacements",{get:function(){return this._replacements},set:function(t){var e=this.uniforms.originalColors,i=this.uniforms.targetColors,r=t.length;if(r>this._maxColors)throw new Error("Length of replacements ("+r+") exceeds the maximum colors length ("+this._maxColors+")");e[3*r]=-1;for(var n=0;n= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n".replace("${maxKernelSize}",e.toFixed(1)))||this;return Object.assign(e,t),e}function r(t){var e=U.call(this,p,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n")||this;return Object.assign(e,r.defaults,t),e}function n(t,e,i,r){void 0===t&&(t=100),void 0===e&&(e=600);var n=j.call(this)||this;return n.tiltShiftXFilter=new $t(t,e,i,r),n.tiltShiftYFilter=new Jt(t,e,i,r),n}function re(){return null!==G&&G.apply(this,arguments)||this}function ne(){return null!==X&&X.apply(this,arguments)||this}function s(t,e,i,r){void 0===t&&(t=100),void 0===e&&(e=600);var n=H.call(this,p,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n")||this;return n.uniforms.blur=t,n.uniforms.gradientBlur=e,n.uniforms.start=i||new l.Point(0,window.innerHeight/2),n.uniforms.end=r||new l.Point(600,window.innerHeight/2),n.uniforms.delta=new l.Point(30,30),n.uniforms.texSize=new l.Point(window.innerWidth,window.innerHeight),n.updateDelta(),n}function o(t,e,i){void 0===e&&(e=0),void 0===i&&(i=1);var r=Y.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n")||this;return r._color=0,r.uniforms.dimensions=new Float32Array(2),r.uniforms.ambientColor=new Float32Array([0,0,0,i]),r.texture=t,r.color=e,r}function f(t,e,i){void 0===t&&(t=[0,0]),void 0===i&&(i=0);var r=W.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n")||this;return r.center=t,Object.assign(r,f.defaults,e),r.time=i,r}function m(t,e,i){void 0===t&&(t=[-10,0]),void 0===e&&(e=[0,10]),void 0===i&&(i=[0,0]);var r=V.call(this,p,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n")||this;return r.red=t,r.green=e,r.blue=i,r}function _(t){var e=q.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n")||this;return e.time=0,e.uniforms.amplitude=new Float32Array(2),e.uniforms.waveLength=new Float32Array(2),e.uniforms.alpha=new Float32Array(2),e.uniforms.dimensions=new Float32Array(2),Object.assign(e,_.defaults,t),e}function g(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=[0,0]),void 0===i&&(i=5),void 0===r&&(r=-1);var n=K.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n")||this;return n._angle=0,n.angle=t,n.center=e,n.kernelSize=i,n.radius=r,n}function se(t){void 0===t&&(t=10);var e=Z.call(this,p,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n")||this;return e.size=t,e}function v(t,e,i){void 0===t&&(t=1),void 0===e&&(e=0);var r=Q.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,v.getAngleStep(i=void 0===i?.1:i)))||this;return r._thickness=1,r.uniforms.thickness=new Float32Array([0,0]),r.uniforms.outlineColor=new Float32Array([0,0,0,1]),Object.assign(r,{thickness:t,color:e,quality:i}),r}function y(t,e){void 0===e&&(e=0);var i=$.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nuniform float sepia;\nuniform float noise;\nuniform float noiseSize;\nuniform float scratch;\nuniform float scratchDensity;\nuniform float scratchWidth;\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\nuniform float seed;\n\nconst float SQRT_2 = 1.414213;\nconst vec3 SEPIA_RGB = vec3(112.0 / 255.0, 66.0 / 255.0, 20.0 / 255.0);\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec3 Overlay(vec3 src, vec3 dst)\n{\n // if (dst <= 0.5) then: 2 * src * dst\n // if (dst > 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n")||this;return i.seed=0,i.uniforms.dimensions=new Float32Array(2),"number"==typeof t?(i.seed=t,t=void 0):i.seed=e,Object.assign(i,y.defaults,t),i}function b(t,e,i){void 0===e&&(e=.05),void 0===i&&(i=t.length);var r=J.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float epsilon;\n\nconst int MAX_COLORS = %maxColors%;\n\nuniform vec3 originalColors[MAX_COLORS];\nuniform vec3 targetColors[MAX_COLORS];\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n\n float alpha = gl_FragColor.a;\n if (alpha < 0.0001)\n {\n return;\n }\n\n vec3 color = gl_FragColor.rgb / alpha;\n\n for(int i = 0; i < MAX_COLORS; i++)\n {\n vec3 origColor = originalColors[i];\n if (origColor.r < 0.0)\n {\n break;\n }\n vec3 colorDiff = origColor - color;\n if (length(colorDiff) < epsilon)\n {\n vec3 targetColor = targetColors[i];\n gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha);\n return;\n }\n }\n}\n".replace(/%maxColors%/g,i.toFixed(0)))||this;return r._replacements=[],r._maxColors=0,r.epsilon=e,r._maxColors=i,r.uniforms.originalColors=new Float32Array(3*i),r.uniforms.targetColors=new Float32Array(3*i),r.replacements=t,r}function x(t,e,i){void 0===t&&(t=[0,0]),void 0===e&&(e=5),void 0===i&&(i=0);var r=tt.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uVelocity;\nuniform int uKernelSize;\nuniform float uOffset;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\n// Notice:\n// the perfect way:\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\n// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always.\n// So use uKernelSize directly.\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n vec2 velocity = uVelocity / filterArea.xy;\n float offset = -uOffset / length(uVelocity) - 0.5;\n int k = uKernelSize - 1;\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n vec2 bias = velocity * (float(i) / float(k) + offset);\n color += texture2D(uSampler, vTextureCoord + bias);\n }\n gl_FragColor = color / float(uKernelSize);\n}\n")||this;return r.kernelSize=5,r.uniforms.uVelocity=new Float32Array(2),r._velocity=new l.ObservablePoint(r.velocityChanged,r),r.setVelocity(t),r.kernelSize=e,r.offset=i,r}function T(t){var e=et.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nuniform vec2 light;\nuniform bool parallel;\nuniform float aspect;\n\nuniform float gain;\nuniform float lacunarity;\nuniform float time;\nuniform float alpha;\n\n${perlin}\n\nvoid main(void) {\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n float d;\n\n if (parallel) {\n float _cos = light.x;\n float _sin = light.y;\n d = (_cos * coord.x) + (_sin * coord.y * aspect);\n } else {\n float dx = coord.x - light.x / dimensions.x;\n float dy = (coord.y - light.y / dimensions.y) * aspect;\n float dis = sqrt(dx * dx + dy * dy) + 0.00001;\n d = dy / dis;\n }\n\n vec3 dir = vec3(d, d, 0.0);\n\n float noise = turb(dir + vec3(time, 0.0, 62.1 + time) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain);\n noise = mix(noise, 0.0, 0.3);\n //fade vertically.\n vec4 mist = vec4(noise, noise, noise, 1.0) * (1.0 - coord.y);\n mist.a = 1.0;\n // apply user alpha\n mist *= alpha;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord) + mist;\n\n}\n".replace("${perlin}","vec3 mod289(vec3 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x)\n{\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 permute(vec4 x)\n{\n return mod289(((x * 34.0) + 1.0) * x);\n}\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nvec3 fade(vec3 t)\n{\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n}\n// Classic Perlin noise, periodic variant\nfloat pnoise(vec3 P, vec3 rep)\n{\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\n Pi0 = mod289(Pi0);\n Pi1 = mod289(Pi1);\n vec3 Pf0 = fract(P); // Fractional part for interpolation\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n vec4 gx0 = ixy0 * (1.0 / 7.0);\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n vec4 gx1 = ixy1 * (1.0 / 7.0);\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n}\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain)\n{\n float sum = 0.0;\n float sc = 1.0;\n float totalgain = 1.0;\n for (float i = 0.0; i < 6.0; i++)\n {\n sum += totalgain * pnoise(P * sc, rep);\n sc *= lacunarity;\n totalgain *= gain;\n }\n return abs(sum);\n}\n"))||this,t=(e.parallel=!0,e.time=0,e._angle=0,e.uniforms.dimensions=new Float32Array(2),Object.assign(T.defaults,t));return e._angleLight=new l.Point,e.angle=t.angle,e.gain=t.gain,e.lacunarity=t.lacunarity,e.alpha=t.alpha,e.parallel=t.parallel,e.center=t.center,e.time=t.time,e}function w(t){var e=this,t=Object.assign({},w.defaults,t),i=t.outerStrength,r=t.innerStrength,n=t.color,s=t.knockout,o=t.quality,t=Math.round(t.distance);return(e=it.call(this,p,"varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nuniform float outerStrength;\nuniform float innerStrength;\n\nuniform vec4 glowColor;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform bool knockout;\n\nconst float PI = 3.14159265358979323846264;\n\nconst float DIST = __DIST__;\nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\nconst float ANGLE_STEP_NUM = ceil(PI * 2.0 / ANGLE_STEP_SIZE);\n\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.0) / 2.0;\n\nvoid main(void) {\n vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\n\n float totalAlpha = 0.0;\n\n vec2 direction;\n vec2 displaced;\n vec4 curColor;\n\n for (float angle = 0.0; angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\n direction = vec2(cos(angle), sin(angle)) * px;\n\n for (float curDistance = 0.0; curDistance < DIST; curDistance++) {\n displaced = clamp(vTextureCoord + direction * \n (curDistance + 1.0), filterClamp.xy, filterClamp.zw);\n\n curColor = texture2D(uSampler, displaced);\n\n totalAlpha += (DIST - curDistance) * curColor.a;\n }\n }\n \n curColor = texture2D(uSampler, vTextureCoord);\n\n float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\n\n float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\n float innerGlowStrength = min(1.0, innerGlowAlpha);\n \n vec4 innerColor = mix(curColor, glowColor, innerGlowStrength);\n\n float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a);\n float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);\n\n vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;\n \n if (knockout) {\n float resultAlpha = outerGlowAlpha + innerGlowAlpha;\n gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);\n }\n else {\n gl_FragColor = innerColor + outerGlowColor;\n }\n}\n".replace(/__ANGLE_STEP_SIZE__/gi,""+(1/o/t).toFixed(7)).replace(/__DIST__/gi,t.toFixed(0)+".0"))||this).uniforms.glowColor=new Float32Array([0,0,0,1]),Object.assign(e,{color:n,outerStrength:i,innerStrength:r,padding:t,knockout:s}),e}function E(t){var e=rt.call(this,p,"// precision highp float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == TRANSPARENT) {\n discard;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n")||this;return e.offset=100,e.fillMode=E.TRANSPARENT,e.average=!1,e.seed=0,e.minSize=8,e.sampleSize=512,e._slices=0,e._offsets=new Float32Array(1),e._sizes=new Float32Array(1),e._direction=-1,e.uniforms.dimensions=new Float32Array(2),e._canvas=document.createElement("canvas"),e._canvas.width=4,e._canvas.height=e.sampleSize,e.texture=a.Texture.from(e._canvas,{scaleMode:c.SCALE_MODES.NEAREST}),Object.assign(e,E.defaults,t),e}function oe(t){void 0===t&&(t=5);var e=nt.call(this,p,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n")||this;return e.strength=t,e}function S(t){var e=st.call(this)||this,t=(e.angle=45,e._distance=5,e._resolution=h.settings.FILTER_RESOLUTION,t?xt(xt({},S.defaults),t):S.defaults),i=t.kernels,r=t.blur,n=t.quality,s=t.pixelSize,o=t.resolution,i=(e._tintFilter=new a.Filter(p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\n\nuniform vec2 shift;\nuniform vec4 inputSize;\n\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\n\n // Premultiply alpha\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),e._tintFilter.uniforms.color=new Float32Array(4),e._tintFilter.uniforms.shift=new l.Point,e._tintFilter.resolution=o,e._blurFilter=i?new d(i):new d(r,n),e.pixelSize=s,e.resolution=o,t.shadowOnly),r=t.rotation,n=t.distance,s=t.alpha,o=t.color;return e.shadowOnly=i,e.rotation=r,e.distance=n,e.alpha=s,e.color=o,e._updatePadding(),e}function A(t,e){void 0===t&&(t=1),void 0===e&&(e=5);var i=ot.call(this,p,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n")||this;return i.scale=t,i.angle=e,i}function O(t){var e=at.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5));\n \n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0)\n {\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n")||this;return e.time=0,e.seed=0,e.uniforms.dimensions=new Float32Array(2),Object.assign(e,O.defaults,t),e}function ae(){return lt.call(this,p,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")||this}function P(t,e,i){void 0===e&&(e=200),void 0===i&&(i=200);var r=ht.call(this,p,"precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n")||this;return r.uniforms.texelSize=new Float32Array(2),r.uniforms.matrix=new Float32Array(9),void 0!==t&&(r.matrix=t),r.width=e,r.height=i,r}function R(t,e,i){void 0===t&&(t=16711680),void 0===e&&(e=0),void 0===i&&(i=.4);var r=ut.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n")||this;return r._originalColor=16711680,r._newColor=0,r.uniforms.originalColor=new Float32Array(3),r.uniforms.newColor=new Float32Array(3),r.originalColor=t,r.newColor=e,r.epsilon=i,r}function le(t,e){void 0===t&&(t=0),void 0===e&&(e=1);var i=ct.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 color;\nuniform float alpha;\n\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a);\n}\n")||this;return i._color=0,i._alpha=1,i.uniforms.color=new Float32Array(3),i.color=t,i.alpha=e,i}function C(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=1);var r=pt.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}")||this;return r.mix=1,r._size=0,r._sliceSize=0,r._slicePixelSize=0,r._sliceInnerSize=0,r._nearest=!1,r._scaleMode=null,r._colorMap=null,r._scaleMode=null,r.nearest=e,r.mix=i,r.colorMap=t,r}function M(t){var e=dt.call(this,p,"uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n")||this;return e.uniforms.dimensions=new Float32Array(2),Object.assign(e,M.defaults,t),e}function k(t,e,i,r){void 0===t&&(t=2),void 0===e&&(e=4),void 0===i&&(i=h.settings.FILTER_RESOLUTION),void 0===r&&(r=5);var n,s,o=ft.call(this)||this;return"number"==typeof t?s=n=t:t instanceof l.Point?(n=t.x,s=t.y):Array.isArray(t)&&(n=t[0],s=t[1]),o.blurXFilter=new N.BlurFilterPass(!0,n,e,i,r),o.blurYFilter=new N.BlurFilterPass(!1,s,e,i,r),o.blurYFilter.blendMode=c.BLEND_MODES.SCREEN,o.defaultFilter=new L.AlphaFilter,o}function I(t){var e=mt.call(this,p,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n")||this;return e._thickness=2,e._angle=0,e.uniforms.lightColor=new Float32Array(3),e.uniforms.shadowColor=new Float32Array(3),Object.assign(e,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),e.padding=1,e}function he(t){void 0===t&&(t=8);var e=_t.call(this,p,"varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n")||this;return e.size=t,e}function D(t){var e=gt.call(this,p,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n")||this,t=(e.bloomScale=1,e.brightness=1,e._resolution=h.settings.FILTER_RESOLUTION,"number"==typeof t&&(t={threshold:t}),Object.assign(D.defaults,t)),i=(e.bloomScale=t.bloomScale,e.brightness=t.brightness,t.kernels),r=t.blur,n=t.quality,s=t.pixelSize,o=t.resolution;return e._extractFilter=new wt(t.threshold),e._extractFilter.resolution=o,e._blurFilter=i?new d(i):new d(r,n),e.pixelSize=s,e.resolution=o,e}function F(t,e,i){void 0===t&&(t=4),void 0===e&&(e=3);var r=vt.call(this,p,(i=void 0===i?!1:i)?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}")||this;return r._kernels=[],r._blur=4,r._quality=3,r.uniforms.uOffset=new Float32Array(2),r._pixelSize=new l.Point,r.pixelSize=1,r._clamp=i,Array.isArray(t)?r.kernels=t:(r._blur=t,r.quality=e),r}function ue(t){void 0===t&&(t=.5);var e=yt.call(this,p,"\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform float threshold;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n // A simple & fast algorithm for getting brightness.\n // It's inaccuracy , but good enought for this feature.\n float _max = max(max(color.r, color.g), color.b);\n float _min = min(min(color.r, color.g), color.b);\n float brightness = (_max + _min) * 0.5;\n\n if(brightness > threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n")||this;return e.threshold=t,e}function ce(t){var e=bt.call(this,p,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (c.a > 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n")||this;return e.gamma=1,e.saturation=1,e.contrast=1,e.brightness=1,e.red=1,e.green=1,e.blue=1,e.alpha=1,Object.assign(e,t),e}return t.AdjustmentFilter=Tt,t.AdvancedBloomFilter=Et,t.AsciiFilter=St,t.BevelFilter=At,t.BloomFilter=Ot,t.BulgePinchFilter=Pt,t.CRTFilter=Dt,t.ColorMapFilter=Rt,t.ColorOverlayFilter=Ct,t.ColorReplaceFilter=Mt,t.ConvolutionFilter=kt,t.CrossHatchFilter=It,t.DotFilter=Ft,t.DropShadowFilter=Lt,t.EmbossFilter=Nt,t.GlitchFilter=zt,t.GlowFilter=Bt,t.GodrayFilter=Ut,t.KawaseBlurFilter=d,t.MotionBlurFilter=jt,t.MultiColorReplaceFilter=Gt,t.OldFilmFilter=Xt,t.OutlineFilter=Ht,t.PixelateFilter=Yt,t.RGBSplitFilter=qt,t.RadialBlurFilter=Wt,t.ReflectionFilter=Vt,t.ShockwaveFilter=Kt,t.SimpleLightmapFilter=Zt,t.TiltShiftAxisFilter=Qt,t.TiltShiftFilter=te,t.TiltShiftXFilter=$t,t.TiltShiftYFilter=Jt,t.TwistFilter=ee,t.ZoomBlurFilter=ie,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,PIXI,PIXI,PIXI.utils,PIXI,PIXI.filters,PIXI.filters),_gsScope=(Object.assign(PIXI.filters,__filters),this.PIXI=this.PIXI||{},!function(l,m){"use strict";h.createList=function(t){if("list"in t){var e=t.list,i=void 0,r=e[0],n=r.value,r=r.time,r=i=new h("string"==typeof n?l.ParticleUtils.hexToRGB(n):n,r,t.ease);if(2o.time;)n=o,o=t[++s];var l=(l-n.time)/(o.time-n.time),h=p.hexToRGB(n.value),u=p.hexToRGB(o.value),u={r:(u.r-h.r)*l+h.r,g:(u.g-h.g)*l+h.g,b:(u.b-h.b)*l+h.b};r.next=new c(u,a/e),r=r.next}return i};var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function n(t){return this.ease&&(t=this.ease(t)),(this.next.value-this.current.value)*t+this.current.value}function s(t){this.ease&&(t=this.ease(t));var e=this.current.value,i=this.next.value,r=(i.r-e.r)*t+e.r,n=(i.g-e.g)*t+e.g,i=(i.b-e.b)*t+e.b;return l.ParticleUtils.combineRGBComponents(r,n,i)}function o(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;return t=(t-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*t+this.current.value}function a(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;t=(t-this.current.time)/(this.next.time-this.current.time);var e=this.current.value,i=this.next.value,r=(i.r-e.r)*t+e.r,n=(i.g-e.g)*t+e.g,i=(i.b-e.b)*t+e.b;return l.ParticleUtils.combineRGBComponents(r,n,i)}function d(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function f(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;var e=this.current.value;return l.ParticleUtils.combineRGBComponents(e.r,e.g,e.b)}g.prototype.reset=function(t){this.current=t,this.next=t.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?s:n:t.isStepped?this.interpolate=this.isColor?f:d:this.interpolate=this.isColor?a:o,this.ease=this.current.ease};var _=g;function g(t){void 0===t&&(t=!1),this.current=null,this.next=null,this.isColor=!!t,this.interpolate=null,this.ease=null}i(b,v=m.Sprite),b.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,l.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=l.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=l.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=l.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var t=this.colorList.current.value;this.tint=l.ParticleUtils.combineRGBComponents(t.r,t.g,t.b),this.visible=!0},b.prototype.applyArt=function(t){this.texture=t||m.Texture.EMPTY},b.prototype.update=function(t){var e,i,r,n,s,o;return this.age+=t,this.age>=this.maxLife||this.age<0?(this.kill(),-1):(e=this.age*this._oneOverLife,this.ease&&(e=4===this.ease.length?this.ease(e,0,1,1):this.ease(e)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(e)),this._doScale&&(i=this.scaleList.interpolate(e)*this.scaleMultiplier,this.scale.x=this.scale.y=i),this._doNormalMovement&&(s=i=void 0,s=this._doSpeed?(r=this.speedList.interpolate(e)*this.speedMultiplier,l.ParticleUtils.normalize(this.velocity),l.ParticleUtils.scaleBy(this.velocity,r),i=this.velocity.x*t,this.velocity.y*t):this._doAcceleration?(r=this.velocity.x,n=this.velocity.y,this.velocity.x+=this.acceleration.x*t,this.velocity.y+=this.acceleration.y*t,this.maxSpeed&&(o=l.ParticleUtils.length(this.velocity))>this.maxSpeed&&l.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/o),i=(r+this.velocity.x)/2*t,(n+this.velocity.y)/2*t):(i=this.velocity.x*t,this.velocity.y*t),this.position.x+=i,this.position.y+=s),this._doColor&&(this.tint=this.colorList.interpolate(e)),0!==this.rotationAcceleration?(o=this.rotationSpeed+this.rotationAcceleration*t,this.rotation+=(this.rotationSpeed+o)/2*t,this.rotationSpeed=o):0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*t:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x)),e)},b.prototype.kill=function(){this.emitter.recycle(this)},b.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},b.parseArt=function(t){for(var e=t.length;0<=e;--e)"string"==typeof t[e]&&(t[e]=u(t[e]));if(l.ParticleUtils.verbose)for(e=t.length-1;0=this.maxParticles);else{var l=void 0,l=this.minLifetime===this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime;if(-this._spawnTimer=this.spawnChance||(p=void 0,this._poolFirst?(p=this._poolFirst,this._poolFirst=this._poolFirst.next,p.next=null):p=new this.particleConstructor(this),1=this.particleImages.length)&&(this._currentImageIndex=0)):p.applyArt(this.particleImages[Math.floor(Math.random()*this.particleImages.length)]):p.applyArt(this.particleImages[0]),p.alphaList.reset(this.startAlpha),1!==this.minimumSpeedMultiplier&&(p.speedMultiplier=Math.random()*(1-this.minimumSpeedMultiplier)+this.minimumSpeedMultiplier),p.speedList.reset(this.startSpeed),p.acceleration.x=this.acceleration.x,p.acceleration.y=this.acceleration.y,p.maxSpeed=this.maxSpeed,1!==this.minimumScaleMultiplier&&(p.scaleMultiplier=Math.random()*(1-this.minimumScaleMultiplier)+this.minimumScaleMultiplier),p.scaleList.reset(this.startScale),p.colorList.reset(this.startColor),this.minRotationSpeed===this.maxRotationSpeed?p.rotationSpeed=this.minRotationSpeed:p.rotationSpeed=Math.random()*(this.maxRotationSpeed-this.minRotationSpeed)+this.minRotationSpeed,p.rotationAcceleration=this.rotationAcceleration,p.noRotation=this.noRotation,p.maxLife=l,p.blendMode=this.particleBlendMode,p.ease=this.customEase,p.extraData=this.extraData,this.applyAdditionalProperties(p),this._spawnFunc(p,u,c,d),p.init(),this.addAtBack?this._parent.addChildAt(p,0):this._parent.addChild(p),this._activeParticlesLast?((this._activeParticlesLast.next=p).prev=this._activeParticlesLast,this._activeParticlesLast=p):this._activeParticlesLast=this._activeParticlesFirst=p,++this.particleCount,p.update(-this._spawnTimer))}}this._spawnTimer+=this._frequency}this._posChanged&&(this._prevEmitterPos.x=o,this._prevEmitterPos.y=a,this._prevPosIsValid=!0,this._posChanged=!1),this._emit||this._activeParticlesFirst||(this._completeCallback&&(s=this._completeCallback,this._completeCallback=null,s()),this._destroyWhenComplete&&this.destroy())}},S.prototype.applyAdditionalProperties=function(t){},S.prototype._spawnPoint=function(t,e,i){this.minStartRotation===this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,t.position.x=e,t.position.y=i},S.prototype._spawnRect=function(t,e,i){this.minStartRotation===this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,E.x=Math.random()*this.spawnRect.width+this.spawnRect.x,E.y=Math.random()*this.spawnRect.height+this.spawnRect.y,0!==this.rotation&&l.ParticleUtils.rotatePoint(this.rotation,E),t.position.x=e+E.x,t.position.y=i+E.y},S.prototype._spawnCircle=function(t,e,i){this.minStartRotation===this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,E.x=Math.random()*this.spawnCircle.radius,E.y=0,l.ParticleUtils.rotatePoint(360*Math.random(),E),E.x+=this.spawnCircle.x,E.y+=this.spawnCircle.y,0!==this.rotation&&l.ParticleUtils.rotatePoint(this.rotation,E),t.position.x=e+E.x,t.position.y=i+E.y},S.prototype._spawnRing=function(t,e,i){var r=this.spawnCircle,r=(this.minStartRotation===this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,r.minRadius!==r.radius?E.x=Math.random()*(r.radius-r.minRadius)+r.minRadius:E.x=r.radius,E.y=0,360*Math.random());t.rotation+=r,l.ParticleUtils.rotatePoint(r,E),E.x+=this.spawnCircle.x,E.y+=this.spawnCircle.y,0!==this.rotation&&l.ParticleUtils.rotatePoint(this.rotation,E),t.position.x=e+E.x,t.position.y=i+E.y},S.prototype._spawnPolygonalChain=function(t,e,i){this.minStartRotation===this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,this.spawnPolygonalChain.getRandomPoint(E),0!==this.rotation&&l.ParticleUtils.rotatePoint(this.rotation,E),t.position.x=e+E.x,t.position.y=i+E.y},S.prototype._spawnBurst=function(t,e,i,r){0===this.particleSpacing?t.rotation=360*Math.random():t.rotation=this.angleStart+this.particleSpacing*r+this.rotation,t.position.x=e,t.position.y=i},S.prototype.cleanup=function(){for(var t,e=this._activeParticlesFirst;e;e=t)t=e.next,this.recycle(e),e.parent&&e.parent.removeChild(e);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0},S.prototype.destroy=function(){var t;this.autoUpdate=!1,this.cleanup();for(var e=this._poolFirst;e;e=t)t=e.next,e.destroy();this._poolFirst=this._parent=this.particleImages=this.spawnPos=this.ownerPos=this.startColor=this.startScale=this.startAlpha=this.startSpeed=this.customEase=this._completeCallback=null},S);function S(t,e,i){this._currentImageIndex=-1,this._particleConstructor=y,this.particleImages=null,this.startAlpha=null,this.startSpeed=null,this.minimumSpeedMultiplier=1,this.acceleration=null,this.maxSpeed=NaN,this.startScale=null,this.minimumScaleMultiplier=1,this.startColor=null,this.minLifetime=0,this.maxLifetime=0,this.minStartRotation=0,this.maxStartRotation=0,this.noRotation=!1,this.minRotationSpeed=0,this.maxRotationSpeed=0,this.particleBlendMode=0,this.customEase=null,this.extraData=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=null,this.spawnType=null,this._spawnFunc=null,this.spawnRect=null,this.spawnCircle=null,this.spawnPolygonalChain=null,this.particlesPerWave=1,this.particleSpacing=0,this.angleStart=0,this.rotation=0,this.ownerPos=null,this._prevEmitterPos=null,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._origArt=null,this._autoUpdate=!1,this._currentImageIndex=-1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&i&&this.init(e,i),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}var A=new m.Point,O=["pow","sqrt","abs","floor","round","ceil","E","PI","sin","cos","tan","asin","acos","atan","atan2","log"],P=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(O).join("|"),"g");i(M,R=y),M.prototype.init=function(){this.initialRotation=this.rotation,this.Particle_init(),this.path=this.extraData.path,this._doNormalMovement=!this.path,this.movement=0,this.initialPosition.x=this.position.x,this.initialPosition.y=this.position.y},M.prototype.update=function(t){var e,i=this.Particle_update(t);return 0<=i&&this.path&&(e=this._doSpeed?this.speedList.interpolate(i)*this.speedMultiplier:this.speedList.current.value*this.speedMultiplier,this.movement+=e*t,A.x=this.movement,A.y=this.path(this.movement),l.ParticleUtils.rotatePoint(this.initialRotation,A),this.position.x=this.initialPosition.x+A.x,this.position.y=this.initialPosition.y+A.y),i},M.prototype.destroy=function(){this.Particle_destroy(),this.path=this.initialPosition=null},M.parseArt=function(t){return y.parseArt(t)},M.parseData=function(t){var e={};if(t&&t.path)try{e.path=function(t){for(var e=t.match(P),i=e.length-1;0<=i;--i)0<=O.indexOf(e[i])&&(e[i]="Math."+e[i]);return t=e.join(""),new Function("x","return "+t+";")}(t.path)}catch(t){l.ParticleUtils.verbose&&console.error("PathParticle: error in parsing path expression"),e.path=null}else l.ParticleUtils.verbose&&console.error("PathParticle requires a path string in extraData!"),e.path=null;return e};var R,C=M;function M(t){t=R.call(this,t)||this;return t.path=null,t.initialRotation=0,t.initialPosition=new m.Point,t.movement=0,t}i(I,k=y),I.prototype.init=function(){this.Particle_init(),this.elapsed=0,this.framerate<0&&(this.duration=this.maxLife,this.framerate=this.textures.length/this.duration)},I.prototype.applyArt=function(t){this.textures=t.textures,this.framerate=t.framerate,this.duration=t.duration,this.loop=t.loop},I.prototype.update=function(t){var e=this.Particle_update(t);return 0<=e&&(this.elapsed+=t,this.elapsed>=this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6),t=this.elapsed*this.framerate+1e-7|0,this.texture=this.textures[t]||this.textures[this.textures.length-1]||m.Texture.EMPTY),e},I.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},I.parseArt=function(t){for(var e=[],i=0;ithis._childCount)throw new Error("addChildAt: The index "+e+" supplied is out of bounds "+this._childCount);t.parent&&t.parent.removeChild(t),(t.parent=this).sortDirty=!0,t.transform._parentID=-1;var i=t;if(this._firstChild)if(0===e)(this._firstChild.prevChild=i).nextChild=this._firstChild,this._firstChild=i;else if(e===this._childCount)(this._lastChild.nextChild=i).prevChild=this._lastChild,this._lastChild=i;else{for(var r=0,n=this._firstChild;r=this._childCount)throw new Error("The index "+e+" supplied is out of bounds "+this._childCount);if(t.parent!==this)throw new Error("The supplied DisplayObject must be a child of the caller");if(t.nextChild&&(t.nextChild.prevChild=t.prevChild),t.prevChild&&(t.prevChild.nextChild=t.nextChild),this._firstChild===t&&(this._firstChild=t.nextChild),this._lastChild===t&&(this._lastChild=t.prevChild),t.nextChild=null,t.prevChild=null,this._firstChild)if(0===e)(this._firstChild.prevChild=t).nextChild=this._firstChild,this._firstChild=t;else if(e===this._childCount)(this._lastChild.nextChild=t).prevChild=this._lastChild,this._lastChild=t;else{for(var i=0,r=this._firstChild;i=this._childCount)throw new Error("getChildAt: Index ("+t+") does not exist.");if(0===t)return this._firstChild;if(t===this._childCount)return this._lastChild;for(var e=0,i=this._firstChild;e=a.TRANSFORM_STEP.PROJ?(r||this.displayObjectUpdateTransform(),(this.proj.affine?this.transform.worldTransform:this.proj.world).applyInverse(t,i)):(this.parent?i=this.parent.worldTransform.applyInverse(t,i):(i.x=t.x,i.y=t.y),n===a.TRANSFORM_STEP.NONE?i:this.transform.localTransform.applyInverse(i,i))}get worldTransform(){return this.proj.affine?this.transform.worldTransform:this.proj.world}}const J=$.prototype.toLocal;class f extends s.Mesh{static __initStatic(){this.defaultVertexShader=`precision highp float; attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; uniform mat3 translationMatrix; uniform mat3 uTextureMatrix; varying vec2 vTextureCoord; void main(void) { gl_Position.xyw = projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0); gl_Position.z = 0.0; vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy; } `}static __initStatic2(){this.defaultFragmentShader=` varying vec2 vTextureCoord; uniform vec4 uColor; uniform sampler2D uSampler; void main(void) { gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor; }`}constructor(t,e,i,r){super(t,e,i,r),f.prototype.__init.call(this),this.proj=new l(this.transform)}__init(){this.vertexData2d=null}calculateVertices(){if(this.proj._affine)this.vertexData2d=null,super.calculateVertices();else{var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length)),this.vertexData2d&&this.vertexData2d.length===3*e.length/2||(this.vertexData2d=new Float32Array(3*e.length));var i=this.proj.world.mat3,r=this.vertexData2d,n=this.vertexData;for(let t=0;ti.call(e,...t)),e=void 0)}return i}([e,"access",t=>t.program,"access",t=>t.uniformData,"optionalAccess",t=>t.translationMatrix])&&(e.uniforms.translationMatrix=this.worldTransform.toArray(!0)),t.shader.bind(e,!1),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}toLocal(t,e,i,r,n=a.TRANSFORM_STEP.ALL){return J.call(this,t,e,i,r,n)}get worldTransform(){return this.proj.affine?this.transform.worldTransform:this.proj.world}}f.__initStatic(),f.__initStatic2();class tt extends f{constructor(t,e,i,r,n){super(new s.MeshGeometry(e,i,r),new s.MeshMaterial(t,{program:_.Program.from(f.defaultVertexShader,f.defaultFragmentShader),pluginName:"batch2d"}),null,n),tt.prototype.__init2.call(this),this.geometry.getBuffer("aVertexPosition").static=!1}__init2(){this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class m extends e.Sprite{constructor(t){super(t),m.prototype.__init.call(this),this.proj=new l(this.transform),this.pluginName="batch2d"}__init(){this.vertexData2d=null}_calculateBounds(){this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData)}calculateVertices(){var n=this._texture;if(this.proj._affine)this.vertexData2d=null,super.calculateVertices();else{this.vertexData2d||(this.vertexData2d=new Float32Array(12));var s=this.transform._worldID,o=n._updateID;if(this._transformID!==s||this._textureID!==o){this._textureID!==o&&(this.uvs=n._uvs.uvsFloat32),this._transformID=s,this._textureID=o;var s=this.proj.world.mat3,o=this.vertexData2d,a=this.vertexData,l=n.trim,n=n.orig,h=this._anchor;let t,e,i,r;i=l?(e=l.x-h._x*n.width,t=e+l.width,(r=l.y-h._y*n.height)+l.height):(e=-h._x*n.width,t=e+n.width,(r=-h._y*n.height)+n.height),o[0]=s[0]*e+s[3]*r+s[6],o[1]=s[1]*e+s[4]*r+s[7],o[2]=s[2]*e+s[5]*r+s[8],o[3]=s[0]*t+s[3]*r+s[6],o[4]=s[1]*t+s[4]*r+s[7],o[5]=s[2]*t+s[5]*r+s[8],o[6]=s[0]*t+s[3]*i+s[6],o[7]=s[1]*t+s[4]*i+s[7],o[8]=s[2]*t+s[5]*i+s[8],o[9]=s[0]*e+s[3]*i+s[6],o[10]=s[1]*e+s[4]*i+s[7],o[11]=s[2]*e+s[5]*i+s[8],a[0]=o[0]/o[2],a[1]=o[1]/o[2],a[2]=o[3]/o[5],a[3]=o[4]/o[5],a[4]=o[6]/o[8],a[5]=o[7]/o[8],a[6]=o[9]/o[11],a[7]=o[10]/o[11]}}}calculateTrimmedVertices(){if(this.proj._affine)super.calculateTrimmedVertices();else{var t=this.transform._worldID,e=this._texture._updateID;if(this.vertexTrimmedData){if(this._transformTrimmedID===t&&this._textureTrimmedID===e)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=t,this._textureTrimmedID=e;var t=this._texture,e=this.vertexTrimmedData,t=t.orig,i=this.tileProj?this._width:t.width,t=this.tileProj?this._height:t.height,r=this._anchor,n=this.proj.world.mat3,s=-r._x*i,i=s+i,r=-r._y*t,t=r+t,o=1/(n[2]*s+n[5]*r+n[8]);e[0]=o*(n[0]*s+n[3]*r+n[6]),e[1]=o*(n[1]*s+n[4]*r+n[7]),o=1/(n[2]*i+n[5]*r+n[8]),e[2]=o*(n[0]*i+n[3]*r+n[6]),e[3]=o*(n[1]*i+n[4]*r+n[7]),o=1/(n[2]*i+n[5]*t+n[8]),e[4]=o*(n[0]*i+n[3]*t+n[6]),e[5]=o*(n[1]*i+n[4]*t+n[7]),o=1/(n[2]*s+n[5]*t+n[8]),e[6]=o*(n[0]*s+n[3]*t+n[6]),e[7]=o*(n[1]*s+n[4]*t+n[7])}}toLocal(t,e,i,r,n=a.TRANSFORM_STEP.ALL){return J.call(this,t,e,i,r,n)}get worldTransform(){return this.proj.affine?this.transform.worldTransform:this.proj.world}}const et=new d.Transform;class it extends L.TilingSprite{constructor(t,e,i){super(t,e,i),this.tileProj=new l(this.tileTransform),this.tileProj.reverseLocalOrder=!0,this.proj=new l(this.transform),this.pluginName="tilingSprite2d",this.uvRespectAnchor=!0}get worldTransform(){return this.proj.affine?this.transform.worldTransform:this.proj.world}toLocal(t,e,i,r,n=a.TRANSFORM_STEP.ALL){return J.call(this,t,e,i,r,n)}_render(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateTransform(et),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}}function rt(){this.proj||(this.proj=new l(this.transform),this.toLocal=$.prototype.toLocal,Object.defineProperty(this,"worldTransform",{get:Q,enumerable:!0,configurable:!0}))}t.Container.prototype.convertTo2d=rt,e.Sprite.prototype.convertTo2d=function(){this.proj||(this.calculateVertices=m.prototype.calculateVertices,this.calculateTrimmedVertices=m.prototype.calculateTrimmedVertices,this._calculateBounds=m.prototype._calculateBounds,this.pluginName="batch2d",rt.call(this))},t.Container.prototype.convertSubtreeTo2d=function(){this.convertTo2d();for(let t=0;t vFrame.z || pixels.y < vFrame.y || pixels.y > vFrame.w) { uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z; uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z; pixels = uv * vSamplerSize; if (pixels.x < vFrame.x || pixels.x > vFrame.z || pixels.y < vFrame.y || pixels.y > vFrame.w) { discard; } } vec4 edge; edge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0)); edge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0)); float alpha = 1.0; //edge.x * edge.y * edge.z * edge.w; vec4 rColor = vColor * alpha; float textureId = floor(vTextureId+0.5); vec2 vTextureCoord = uv; vec4 color; %forloop% gl_FragColor = color * rColor; }`,geometryClass:_t,vertexSize:16},t);return X=class extends Y{constructor(t){super(t),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),this.shaderGenerator=new _.BatchShaderGenerator(e,i),this.geometryClass=n,this.vertexSize=r}__init(){this.defUniforms={translationMatrix:new d.Matrix,distortion:new Float32Array([0,0,1/0,1/0])}}__init2(){this.size=1e3}__init3(){this.forceMaxTextures=1}getUniforms(t){t=t.proj;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms}packInterleavedGeometry(t,e,i,r,n){var{uint32View:s,float32View:o}=e,a=r/this.vertexSize,l=t.indices,h=t.vertexData,u=t._texture._frame,c=t.aTrans,{_batchLocation:p,realWidth:d,realHeight:f,resolution:m}=t._texture.baseTexture,e=Math.min(t.worldAlpha,1),_=e<1&&t._texture.baseTexture.alphaMode?g.premultiplyTint(t._tintRGB,e):t._tintRGB+(255*e<<24);for(let t=0;te[t]&&(r=e[t]),se[t+1]&&(n=e[t+1]),oC[t]&&(l=R[e],R[e]=R[t],R[t]=l,l=C[e],C[e]=C[t],C[t]=l)}e[0]=R[0].x,e[1]=R[0].y,e[2]=R[1].x,e[3]=R[1].y,e[4]=R[2].x,e[5]=R[2].y,e[6]=R[3].x,e[7]=R[3].y,(R[3].x-R[2].x)*(R[1].y-R[2].y)-(R[1].x-R[2].x)*(R[3].y-R[2].y)<0&&(e[4]=R[3].x,e[5]=R[3].y)}}}const vt=new d.Matrix,k=new d.Rectangle,I=new d.Point;class yt extends M{constructor(...t){super(...t),yt.prototype.__init.call(this)}__init(){this.distortion=new d.Point}clear(){this.distortion.set(0,0)}apply(t,e){e=e||new d.Point;var i=this.distortion,r=t.x*t.y;return e.x=t.x+i.x*r,e.y=t.y+i.y*r,e}applyInverse(t,e){e=e||new d.Point;var i=t.x,t=t.y,r=this.distortion.x,n=this.distortion.y;if(0===r)e.x=i,e.y=t/(1+n*i);else if(0===n)e.y=t,e.x=i/(1+r*t);else{var t=.5*(t*r-i*n+1)/n,s=t*t+i/n;if(s<=1e-5)return e.set(NaN,NaN),e;e.x=0>0,0!==u._cycle&&u._cycle===u._totalTime/c&&d<=t&&u._cycle--,u._time=u._totalTime-u._cycle*c,u._yoyo&&0!=(1&u._cycle)&&(u._time=m-u._time,(h=u._yoyoEase||u.vars.yoyoEase)&&(u._yoyoEase||(!0!==h||u._initted?u._yoyoEase=h=!0===h?u._ease:h instanceof Ease?h:Ease.map[h]:(h=u.vars.ease,u._yoyoEase=h=h?h instanceof Ease?h:"function"==typeof h?new Ease(h,u.vars.easeParams):Ease.map[h]||g.defaultEase:g.defaultEase)),u.ratio=h?1-h.getRatio((m-u._time)/m):0)),u._time>m?u._time=m:u._time<0&&(u._time=0)),u._easeType&&!h?(c=u._time/m,(1===(o=u._easeType)||3===o&&.5<=c)&&(c=1-c),3===o&&(c*=2),1===(a=u._easePower)?c*=c:2===a?c*=c*c:3===a?c*=c*c*c:4===a&&(c*=c*c*c*c),u.ratio=1===o?1-c:2===o?c:u._time/m<.5?c/2:1-c/2):h||(u.ratio=u._ease.getRatio(u._time/m))),p!==u._time||i||f!==u._cycle){if(!u._initted){if(u._init(),!u._initted||u._gc)return;if(!i&&u._firstPT&&(!1!==u.vars.lazy&&u._duration||u.vars.lazy&&!u._duration))return u._time=p,u._totalTime=d,u._rawPrevTime=_,u._cycle=f,x.lazyTweens.push(u),void(u._lazy=[t,e]);!u._time||r||h?r&&this._ease._calcEnd&&!h&&(u.ratio=u._ease.getRatio(0===u._time?0:1)):u.ratio=u._ease.getRatio(u._time/m)}for(!1!==u._lazy&&(u._lazy=!1),u._active||!u._paused&&u._time!==p&&0<=t&&(u._active=!0),0===d&&(2===u._initted&&0t._startTime;l._timeline;)h&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return u},t.remove=function(t){var e;if(t instanceof c)return this._remove(t,!1),e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline,t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this;if(t instanceof Array||t&&t.push&&d(t)){for(var i=t.length;-1<--i;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},t._remove=function(t,e){return p.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},t.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},t.insert=t.insertMultiple=function(t,e,i,r){return this.add(t,e||0,i,r)},t.appendMultiple=function(t,e,i,r){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,r)},t.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},t.addPause=function(t,e,i,r){i=f.delayedCall(0,n,i,r||this);return i.vars.onComplete=i.vars.onReverseComplete=e,i.data="isPause",this._hasPause=!0,this.add(i,t)},t.removeLabel=function(t){return delete this._labels[t],this},t.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},t._parseTimeOrLabel=function(t,e,i,r){var n,s;if(r instanceof c&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&d(r)))for(s=r.length;-1<--s;)r[s]instanceof c&&r[s].timeline===this&&this.remove(r[s]);if(n="number"!=typeof t||e?99999999999=t&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,c.pause(),c._pauseTime=u}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=s}!c._onUpdate||e||(b.length&&x(),c._callback("onUpdate")),!o||c._gc||f!==c._startTime&&m===c._timeScale||(0===c._time||d>=c.totalDuration())&&(n&&(b.length&&x(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[o]&&c._callback(o))}},t._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},t.getChildren=function(t,e,i,r){r=r||-9999999999;for(var n=[],s=this._first,o=0;s;)s._startTime=i&&(n._startTime+=t),n=n._next;if(e)for(r in s)s[r]>=i&&(s[r]+=t);return this._uncache(!0)},t._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(t,e)&&(n=!0);return n},t.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;-1<--i;)e[i]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},t.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},t._enabled=function(t,e){if(t===this._gc)for(var i=this._first;i;)i._enabled(t,!0),i=i._next;return p.prototype._enabled.call(this,t,e)},t.totalTime=function(t,e,i){this._forcingPlayhead=!0;var r=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},t.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},t.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,i,r=0,n=this,s=n._last,o=999999999999;s;)e=s._prev,s._dirty&&s.totalDuration(),s._startTime>o&&n._sortChildren&&!s._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(s,s._startTime-s._delay),n._calculatingDuration=0):o=s._startTime,s._startTime<0&&!s._paused&&(r-=s._startTime,n._timeline.smoothChildTiming&&(n._startTime+=s._startTime/n._timeScale,n._time-=s._startTime,n._totalTime-=s._startTime,n._rawPrevTime-=s._startTime),n.shiftChildren(-s._startTime,!1,-9999999999),o=0),r<(i=s._startTime+s._totalDuration/s._timeScale)&&(r=i),s=e;n._duration=n._totalDuration=r,n._dirty=!1}return this._totalDuration},t.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},t.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},t.rawTime=function(t){return t&&(this._paused||this._repeat&&0>0,c._cycle&&c._cycle===c._totalTime/x&&m<=t&&c._cycle--,c._time=c._totalTime-c._cycle*x,c._yoyo&&1&c._cycle&&(c._time=f-c._time),c._time>f?t=(c._time=f)+1e-4:c._time<0?c._time=t=0:t=c._time));if(c._hasPause&&!c._forcingPlayhead&&!e){if(p<(t=c._time)||c._repeat&&b!==c._cycle)for(r=c._first;r&&r._startTime<=t&&!l;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===c._rawPrevTime||(l=r),r=r._next;else for(r=c._last;r&&r._startTime>=t&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,c.pause(),c._pauseTime=u}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=s}!c._onUpdate||e||(P.length&&R(),c._callback("onUpdate")),!o||c._locked||c._gc||_!==c._startTime&&g===c._timeScale||(0===c._time||d>=c.totalDuration())&&(n&&(P.length&&R(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[o]&&c._callback(o))}else m!==c._totalTime&&c._onUpdate&&!e&&c._callback("onUpdate")},r.getActive=function(t,e,i){for(var r,n=[],s=this.getChildren(t||null==t,e||null==t,!!i),o=0,a=s.length,l=0;lt)return e[r].name;return null},r.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;-1<--i;)if(e[i].time>0||6)-1,c=[],p=[];for(i in t){x=b=y=v=x=g=_=m=f=d=y=A=S=void 0;for(var d,f,m,_,g,v,y,b,x,T=t[i],w=o,E=e,S=1/E,A=T.length;-1<--A;)for(f=(b=T[A]).a,m=b.d-f,_=b.c-f,g=b.b-f,d=0,v=1;v<=E;v++)y=d-(d=((x=S*v)*x*m+3*(y=1-x)*(x*_+y*g))*x),w[x=A*E+v-1]=(w[x]||0)+y*y}for(n=o.length,r=0;r>0]=p,a[s]=h,l=0,p=[]);return{length:h,lengths:a,segments:c}}(this._beziers,this._timeRes),this._length=u.length,this._lengths=u.lengths,this._segments=u.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length),c=this._autoRotate)for(this._initialRotations=[],c[0]instanceof Array||(this._autoRotate=c=[c]),s=c.length;-1<--s;){for(o=0;o<3;o++)r=c[s][o],this._func[r]="function"==typeof t[r]&&t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)];r=c[s][2],this._initialRotations[s]=(this._func[r]?this._func[r].call(this._target):this._target[r])||0,this._overwriteProps.push(r)}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(t){var e,i,r,n,s,o,a,l,h,u,c=this._segCount,p=this._func,d=this._target,f=t!==this._startRatio;if(this._timeRes){if(l=this._lengths,h=this._curSeg,u=t*this._length,w=this._li,u>this._l2&&w=u;);0===w&&uthis._s2&&w=u;);0===w&&u>0)*(1/c))*c;for(i=1-s,w=this._props.length;-1<--w;)r=this._props[w],o=(s*s*(n=this._beziers[r][e]).da+3*i*(s*n.ca+i*n.ba))*s+n.a,this._mod[r]&&(o=this._mod[r](o,d)),p[r]?d[r](o):d[r]=o;if(this._autoRotate)for(var m,_,g,v,y,b,x,T=this._autoRotate,w=T.length;-1<--w;)r=T[w][2],b=T[w][3]||0,x=!0===T[w][4]?1:E,n=this._beziers[T[w][0]],m=this._beziers[T[w][1]],n&&m&&(n=n[e],m=m[e],_=n.a+(n.b-n.a)*s,_+=((v=n.b+(n.c-n.b)*s)-_)*s,v+=(n.c+(n.d-n.c)*s-v)*s,g=m.a+(m.b-m.a)*s,g+=((y=m.b+(m.c-m.b)*s)-g)*s,y+=(m.c+(m.d-m.c)*s-y)*s,o=f?Math.atan2(y-g,v-_)*x+b:this._initialRotations[w],this._mod[r]&&(o=this._mod[r](o,d)),p[r]?d[r](o):d[r]=o)}}),t=_.prototype,_.bezierThrough=p,_.cubicToQuadratic=U,_._autoCSS=!0,_.quadraticToCubic=function(t,e,i){return new B(t,(2*e+t)/3,(2*e+i)/3,i)},_._cssRegister=function(){var d,f,m,t=e.CSSPlugin;t&&(t=t._internals,d=t._parseToProxy,f=t._setPluginRatio,m=t.CSSPropTween,t._registerComplexSpecialProp("bezier",{parser:function(t,e,i,r,n,s){e instanceof Array&&(e={values:e}),s=new _;var o,a,l,h=e.values,u=h.length-1,c=[],p={};if(!(u<0)){for(o=0;o<=u;o++)l=d(t,h[o],r,n,s,u!==o),c[o]=l.end;for(a in e)p[a]=e[a];p.values=c,(n=new m(t,"bezier",0,0,l.pt,2)).data=l,n.plugin=s,n.setRatio=f,0===p.autoRotate&&(p.autoRotate=!0),!p.autoRotate||p.autoRotate instanceof Array||(o=!0===p.autoRotate?0:Number(p.autoRotate),p.autoRotate=null!=l.end.left?[["left","top","rotation",o,!1]]:null!=l.end.x&&[["x","y","rotation",o,!1]]),p.autoRotate&&(r._transform||r._enableTransforms(!1),l.autoRotate=r._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,r._overwriteProps.push("rotation")),s._onInitTween(l.proxy,p,r._tween)}return n}}))},t._mod=function(t){for(var e,i=this._overwriteProps,r=i.length;-1<--r;)(e=t[i[r]])&&"function"==typeof e&&(this._mod[i[r]]=e)},t._kill=function(t){var e,i,r=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=r.length;-1<--i;)r[i]===e&&r.splice(i,1);if(r=this._autoRotate)for(i=r.length;-1<--i;)t[r[i][2]]&&r.splice(i,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(o,C){function M(){o.call(this,"css"),this._overwriteProps.length=0,this.setRatio=M.prototype.setRatio}function a(t,e){return e.toUpperCase()}function l(t,e){return(e=F.createElementNS?F.createElementNS(e||"http://www.w3.org/1999/xhtml",t):F.createElement(t)).style?e:F.createElement(t)}function h(t){return nt.test("string"==typeof t?t:(t.currentStyle||t.style).filter||"")?parseFloat(RegExp.$1)/100:1}function _(t){_gsScope.console&&console.log(t)}function T(t,e){var i,r,n=(e=e||L).style;if(void 0!==n[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],r=5;-1<--r&&void 0===n[i[r]+t];);return 0<=r?(vt="-"+(yt=3===r?"ms":i[r]).toLowerCase()+"-",yt+t):null}function f(t){return bt.getComputedStyle(t)}function p(t,e){var i,r,n={};if(e=e||f(t))if(i=e.length)for(;-1<--i;)-1!==(r=e[i]).indexOf("-transform")&&Gt!==r||(n[r.replace(ht,a)]=e.getPropertyValue(r));else for(i in e)-1!==i.indexOf("Transform")&&H!==i||(n[i]=e[i]);else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===n[i]&&(n[i.replace(ht,a)]=e[i]);return N||(n.opacity=h(t)),t=Zt(t,e,!1),n.rotation=t.rotation,n.skewX=t.skewX,n.scaleX=t.scaleX,n.scaleY=t.scaleY,n.x=t.x,n.y=t.y,Y&&(n.z=t.z,n.rotationX=t.rotationX,n.rotationY=t.rotationY,n.scaleZ=t.scaleZ),n.filters&&delete n.filters,n}function g(t,e,i,r,n){var s,o,a,l={},h=t.style;for(o in i)"cssText"===o||"length"!==o&&isNaN(o)&&(e[o]!==(s=i[o])||n&&n[o])&&-1===o.indexOf("Origin")&&("number"==typeof s||"string"==typeof s)&&(l[o]="auto"!==s||"left"!==o&&"top"!==o?""!==s&&"auto"!==s&&"none"!==s||"string"!=typeof e[o]||""===e[o].replace(it,"")?s:0:xt(t,o),void 0!==h[o]&&(a=new Pt(h,o,h[o],a)));if(r)for(o in r)"className"!==o&&(l[o]=r[o]);return{difs:l,firstMPT:a}}function A(t,e){return"string"==typeof(t="function"==typeof t?t(R,P):t)&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)||0}function E(t,e){var i="string"==typeof(t="function"==typeof t?t(R,P):t)&&"="===t.charAt(1);return null==(t="string"==typeof t&&"v"===t.charAt(t.length-2)?(i?t.substr(0,2):0)+window["inner"+("vh"===t.substr(-2)?"Height":"Width")]*(parseFloat(i?t.substr(2):t)/100):t)?e:i?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2))+e:parseFloat(t)||0}function S(t,e,i,r){var n,s;return n=(n=null==(t="function"==typeof t?t(R,P):t)?e:"number"==typeof t?t:(n=t.split("_"),s=((s="="===t.charAt(1))?parseInt(t.charAt(0)+"1",10)*parseFloat(n[0].substr(2)):parseFloat(n[0]))*(-1===t.indexOf("rad")?1:D)-(s?0:e),n.length&&(r&&(r[i]=e+s),-1!==t.indexOf("short")&&(s%=360)!==s%180&&(s=s<0?s+360:s-360),-1!==t.indexOf("_cw")&&s<0?s=(s+3599999999640)%360-360*(s/360|0):-1!==t.indexOf("ccw")&&0>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),Et[t])i=Et[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(r=t.charAt(1))+r+(n=t.charAt(2))+n+(s=t.charAt(3))+s),i=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(i=h=t.match($),e){if(-1!==t.indexOf("="))return t.match(J)}else o=Number(i[0])%360/360,a=Number(i[1])/100,r=2*(l=Number(i[2])/100)-(n=l<=.5?l*(a+1):l+a-l*a),3r--)for(;++rr--)for(;++r>0];return r.parse(t,o,n,s)}}function Pt(t,e,i,r,n){this.t=t,this.p=e,this.v=i,this.r=n,r&&((r._prev=this)._next=r)}e._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,r,n,s,o=this.data,a=o.proxy,l=o.firstMPT;l;)e=a[l.v],l.r?e=l.r(e):e<1e-6&&-1e-6a.length?l:a).length,o=0;on.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:o=n,(n._next=s)?s._prev=n:a=n,n=l}this._firstPT=o}return!0},t.parse=function(t,e,i,r){var n,s,o,a,l,h,u,c,p=t.style;for(n in e){if(l=e[n],a=m[n],"function"!=typeof l||a&&a.allowFunc||(l=l(R,P)),a)i=a.parse(t,l,n,this,i,r,e);else{if("--"===n.substr(0,2)){this._tween._propLookup[n]=this._addTween.call(this._tween,t.style,"setProperty",f(t).getPropertyValue(n)+"",l+"",n,!1,n);continue}a=z(t,n,O)+"",u="string"==typeof l,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||u&&at.test(l)?(u||(l=(3<(l=St(l)).length?"rgba(":"rgb(")+l.join(",")+")"),i=Ct(p,n,a,l,!0,"transparent",i,0,r)):u&&ft.test(l)?i=Ct(p,n,a,l,!0,null,i,0,r):(h=(s=parseFloat(a))||0===s?a.substr((s+"").length):"",""!==a&&"auto"!==a||(h="width"===n||"height"===n?(s=function(t,e,i){if("svg"===(t.nodeName+"").toLowerCase())return(i||f(t))[e]||0;if(t.getCTM&&qt(t))return t.getBBox()[e]||0;var r=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),n=Tt[e],s=n.length;for(i=i||f(t);-1<--s;)r=(r-=parseFloat(z(t,"padding"+n[s],i,!0))||0)-(parseFloat(z(t,"border"+n[s]+"Width",i,!0))||0);return r}(t,n,O),"px"):"left"===n||"top"===n?(s=xt(t,n,O),"px"):(s="opacity"!==n?0:1,"")),""===(u=(c=u&&"="===l.charAt(1))?(o=parseInt(l.charAt(0)+"1",10),l=l.substr(2),o*=parseFloat(l),l.replace(rt,"")):(o=parseFloat(l),u?l.replace(rt,""):""))&&(u=n in W?W[n]:h),l=o||0===o?(c?o+s:o)+u:e[n],h===u||""===u&&"lineHeight"!==n||(o||0===o)&&s&&(s=w(t,n,s,h),"%"===u?(s/=w(t,n,100,"%")/100,!0!==e.strictUnits&&(a=s+"%")):"em"===u||"rem"===u||"vw"===u||"vh"===u?s/=w(t,n,1,u):"px"!==u&&(o=w(t,n,o,u),u="px"),c&&(o||0===o)&&(l=o+s+u)),c&&(o+=s),!s&&0!==s||!o&&0!==o?void 0!==p[n]&&(l||l+""!="NaN"&&null!=l)?(i=new j(p,n,o||s||0,0,i,-1,n,!1,0,a,l)).xs0="none"!==l||"display"!==n&&-1===n.indexOf("Style")?l:a:_("invalid "+n+" tween value: "+e[n]):(i=new j(p,n,s,o-s,i,0,n,!1!==V&&("px"===u||"zIndex"===n),0,a,l)).xs0=u)}r&&i&&!i.plugin&&(i.plugin=r)}return i},t.setRatio=function(t){var e,i,r,n=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(e=n.c*t+n.s,n.r?e=n.r(e):e<1e-6&&-1e-6this._p3?this._calcEnd?1===t?0:1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},p.ease=new p(.7,.7),d.config=p.config=function(t,e,i){return new p(t,e,i)},(d=(r=u("easing.SteppedEase",function(t,e){this._p1=1/(t=t||1),this._p2=t+(e?0:1),this._p3=e?1:0},!0)).prototype=new _).constructor=r,d.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),((this._p2*t|0)+this._p3)*this._p1},d.config=r.config=function(t,e){return new r(t,e)},(d=(n=u("easing.ExpoScaleEase",function(t,e,i){this._p1=Math.log(e/t),this._p2=e-t,this._p3=t,this._ease=i},!0)).prototype=new _).constructor=n,d.getRatio=function(t){return this._ease&&(t=this._ease.getRatio(t)),(this._p3*Math.exp(this._p1*t)-this._p3)/this._p2},d.config=n.config=function(t,e,i){return new n(t,e,i)},(d=(s=u("easing.RoughEase",function(t){for(var e,i,r,n,s,o,a=(t=t||{}).taper||"none",l=[],h=0,u=0|(t.points||20),c=u,p=!1!==t.randomize,d=!0===t.clamp,f=t.template instanceof _?t.template:null,m="number"==typeof t.strength?.4*t.strength:.4;-1<--c;)e=p?Math.random():1/u*c,i=f?f.getRatio(e):e,r="none"===a?m:"out"===a?(n=1-e)*n*m:"in"===a?e*e*m:e<.5?(n=2*e)*n*.5*m:(n=2*(1-e))*n*.5*m,p?i+=Math.random()*r-.5*r:c%2?i+=.5*r:i-=.5*r,d&&(1e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},d.config=function(t){return new s(t)},s.ease=new s,e("Bounce",t("BounceOut",function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),t("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),t("BounceInOut",function(t){var e=t<.5;return(t=e?1-2*t:2*t-1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),e("Circ",t("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),t("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),t("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),e("Elastic",(d=function(t,e,i){var r=u("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||i)/(t<1?t:1),this._p3=this._p2/l*(Math.asin(1/this._p1)||0),this._p2=l/this._p2},!0),t=r.prototype=new _;return t.constructor=r,t.getRatio=e,t.config=function(t,e){return new r(t,e)},r})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),d("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*--t)*Math.sin((t-this._p3)*this._p2))},.3),d("ElasticInOut",function(t){return(t*=2)<1?this._p1*Math.pow(2,10*--t)*Math.sin((t-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*--t)*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),e("Expo",t("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),t("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),t("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),e("Sine",t("SineOut",function(t){return Math.sin(t*h)}),t("SineIn",function(t){return 1-Math.cos(t*h)}),t("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),u("easing.EaseLookup",{find:function(t){return _.map[t]}},!0),c(o.SlowMo,"SlowMo","ease,"),c(s,"RoughEase","ease,"),c(r,"SteppedEase","ease,"),a},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(m,p){"use strict";var d={},f=m.document,_=m.GreenSockGlobals=m.GreenSockGlobals||m,t=_[p];if(t)"undefined"!=typeof module&&module.exports&&(module.exports=t);else{var g,e,L,N=function(t){for(var e=t.split("."),i=_,r=0;r=e&&tthis._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(g||P.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var r=this._totalDuration,n=this._timeline;if(rs;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var r,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)r=n._next,(n._active||t>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=r},n.rawTime=function(){return g||P.wake(),this._totalTime},x("TweenLite",function(t,e,i){if(a.call(this,e,i),this.render=R.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"==typeof t&&R.selector(t)||t;var r,n,s,i=t.jquery||t.length&&t!==m&&t[0]&&(t[0]===m||t[0].nodeType&&t[0].style&&!t.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?tt[R.defaultOverwrite]:"number"==typeof o?o>>0:tt[o],(i||t instanceof Array||t.push&&y(t))&&"number"!=typeof t[0])for(this._targets=s=z(t),this._propLookup=[],this._siblings=[],r=0;r=et){for(i in et=P.frame+(parseInt(R.autoSleep,10)||120),l){for(t=(e=l[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete l[i]}if((!(i=u._first)||i._paused)&&R.autoSleep&&!h._first&&1===P._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||P.sleep()}}},P.addEventListener("tick",a._updateRoot),function(t,e,i){var r,n,s=t._gsTweenID;if(l[s||(t._gsTweenID=s="t"+$++)]||(l[s]={target:t,tweens:[]}),e&&((r=l[s].tweens)[n=r.length]=e,i))for(;-1<--n;)r[n]===e&&r.splice(n,1);return l[s].tweens}),it=function(t,e,i,r){var n,s,o=t.vars.onOverwrite;return o&&(n=o(t,e,i,r)),(o=R.onOverwrite)&&(s=o(t,e,i,r)),!1!==n&&!1!==s},rt=function(t,e,i,r,n){var s,o,a;if(1===r||4<=r){for(a=n.length,d=0;dh&&((p||!o._initted)&&h-o._startTime<=2e-8||(u[c++]=o)));for(d=c;-1<--d;)a=(o=u[d])._firstPT,2===r&&o._kill(i,t,e)&&(s=!0),(2!==r||!o._firstPT&&o._initted&&a)&&(2===r||it(o,e))&&o._enabled(!1,!1)&&(s=!0)}return s},nt=function(t,e,i){for(var r=t._timeline,n=r._timeScale,s=t._startTime;r._timeline;){if(s+=r._startTime,n*=r._timeScale,r._paused)return-100;r=r._timeline}return e<(s/=n)?s-e:i&&s===e||!t._initted&&s-e<2e-8?v:(s+=t.totalDuration()/t._timeScale/n)>e+v?0:s-e-v},F=(n._init=function(){var t,e,i,r,n,s,o=this.vars,a=this._overwrittenProps,l=this._duration,h=!!o.immediateRender,u=o.ease,c=this._startAt;if(o.startAt){for(r in c&&(c.render(-1,!0),c.kill()),n={},o.startAt)n[r]=o.startAt[r];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==o.lazy,n.startAt=n.delay=null,n.onUpdate=o.onUpdate,n.onUpdateParams=o.onUpdateParams,n.onUpdateScope=o.onUpdateScope||o.callbackScope||this,this._startAt=R.to(this.target||{},0,n),h)if(0a.pr;)r=r._next;(a._prev=r?r._prev:s)?a._prev._next=a:n=a,(a._next=r)?r._prev=a:s=a,a=o}a=e._firstPT=n}for(;a;)a.pg&&"function"==typeof a.t[t]&&a.t[t]()&&(i=!0),a=a._next;return i},F.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===F.API&&(k[(new t[e])._propName]=t[e]);return!0},r.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,r=t.priority||0,n=t.overwriteProps,s={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},o=x("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){F.call(this,i,r),this._overwriteProps=n||[]},!0===t.global),a=o.prototype=new F(i);for(e in(a.constructor=o).API=t.API,s)"function"==typeof t[e]&&(a[s[e]]=t[e]);return o.version=t.version,F.activate([o]),o},s=m._gsQueue){for(o=0;o>0,c._cycle&&c._cycle===c._totalTime/x&&m<=t&&c._cycle--,c._time=c._totalTime-c._cycle*x,c._yoyo&&1&c._cycle&&(c._time=f-c._time),c._time>f?t=(c._time=f)+1e-4:c._time<0?c._time=t=0:t=c._time));if(c._hasPause&&!c._forcingPlayhead&&!e){if(p<(t=c._time)||c._repeat&&b!==c._cycle)for(r=c._first;r&&r._startTime<=t&&!l;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===c._rawPrevTime||(l=r),r=r._next;else for(r=c._last;r&&r._startTime>=t&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,c.pause(),c._pauseTime=u}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=s}!c._onUpdate||e||(P.length&&R(),c._callback("onUpdate")),!o||c._locked||c._gc||_!==c._startTime&&g===c._timeScale||(0===c._time||d>=c.totalDuration())&&(n&&(P.length&&R(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[o]&&c._callback(o))}else m!==c._totalTime&&c._onUpdate&&!e&&c._callback("onUpdate")},r.getActive=function(t,e,i){for(var r,n=[],s=this.getChildren(t||null==t,e||null==t,!!i),o=0,a=s.length,l=0;lt)return e[r].name;return null},r.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;-1<--i;)if(e[i].timet._startTime;l._timeline;)h&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return u},t.remove=function(t){var e;if(t instanceof c)return this._remove(t,!1),e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline,t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this;if(t instanceof Array||t&&t.push&&d(t)){for(var i=t.length;-1<--i;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},t._remove=function(t,e){return p.prototype._remove.call(this,t,e),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},t.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},t.insert=t.insertMultiple=function(t,e,i,r){return this.add(t,e||0,i,r)},t.appendMultiple=function(t,e,i,r){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,r)},t.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},t.addPause=function(t,e,i,r){i=f.delayedCall(0,n,i,r||this);return i.vars.onComplete=i.vars.onReverseComplete=e,i.data="isPause",this._hasPause=!0,this.add(i,t)},t.removeLabel=function(t){return delete this._labels[t],this},t.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},t._parseTimeOrLabel=function(t,e,i,r){var n,s;if(r instanceof c&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&d(r)))for(s=r.length;-1<--s;)r[s]instanceof c&&r[s].timeline===this&&this.remove(r[s]);if(n="number"!=typeof t||e?99999999999=t&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,c.pause(),c._pauseTime=u}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=s}!c._onUpdate||e||(b.length&&x(),c._callback("onUpdate")),!o||c._gc||f!==c._startTime&&m===c._timeScale||(0===c._time||d>=c.totalDuration())&&(n&&(b.length&&x(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!e&&c.vars[o]&&c._callback(o))}},t._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof m&&t._hasPausedChild())return!0;t=t._next}return!1},t.getChildren=function(t,e,i,r){r=r||-9999999999;for(var n=[],s=this._first,o=0;s;)s._startTime=i&&(n._startTime+=t),n=n._next;if(e)for(r in s)s[r]>=i&&(s[r]+=t);return this._uncache(!0)},t._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(t,e)&&(n=!0);return n},t.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;-1<--i;)e[i]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},t.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},t._enabled=function(t,e){if(t===this._gc)for(var i=this._first;i;)i._enabled(t,!0),i=i._next;return p.prototype._enabled.call(this,t,e)},t.totalTime=function(t,e,i){this._forcingPlayhead=!0;var r=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},t.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},t.totalDuration=function(t){if(arguments.length)return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this;if(this._dirty){for(var e,i,r=0,n=this,s=n._last,o=999999999999;s;)e=s._prev,s._dirty&&s.totalDuration(),s._startTime>o&&n._sortChildren&&!s._paused&&!n._calculatingDuration?(n._calculatingDuration=1,n.add(s,s._startTime-s._delay),n._calculatingDuration=0):o=s._startTime,s._startTime<0&&!s._paused&&(r-=s._startTime,n._timeline.smoothChildTiming&&(n._startTime+=s._startTime/n._timeScale,n._time-=s._startTime,n._totalTime-=s._startTime,n._rawPrevTime-=s._startTime),n.shiftChildren(-s._startTime,!1,-9999999999),o=0),r<(i=s._startTime+s._totalDuration/s._timeScale)&&(r=i),s=e;n._duration=n._totalDuration=r,n._dirty=!1}return this._totalDuration},t.paused=function(t){if(!1===t&&this._paused)for(var e=this._first;e;)e._startTime===this._time&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},t.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},t.rawTime=function(t){return t&&(this._paused||this._repeat&&0>10|55296,1023&r|56320)}function N(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}function z(){T()}var t,d,b,s,B,f,U,j,x,l,h,T,w,i,E,m,r,n,_,S="sizzle"+ +new Date,g=L.document,A=0,G=0,X=ct(),H=ct(),v=ct(),Y=function(t,e){return t===e&&(h=!0),0},W={}.hasOwnProperty,e=[],V=e.pop,q=e.push,O=e.push,K=e.slice,y=function(t,e){for(var i=0,r=t.length;i+~]|"+o+")"+o+"*"),it=new RegExp("="+o+"*([^\\]'\"]*?)"+o+"*\\]","g"),rt=new RegExp($),nt=new RegExp("^"+a+"$"),p={ID:new RegExp("^#("+a+")"),CLASS:new RegExp("^\\.("+a+")"),TAG:new RegExp("^("+a+"|[*])"),ATTR:new RegExp("^"+Q),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+o+"*(even|odd|(([+-]|)(\\d*)n|)"+o+"*(?:([+-]|)"+o+"*(\\d+)|))"+o+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+o+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+o+"*((?:-\\d)?\\d*)"+o+"*\\)|)(?=[^-]|$)","i")},st=/^(?:input|select|textarea|button)$/i,ot=/^h\d$/i,u=/^[^{]+\{\s*\[native \w/,at=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,lt=/[+~]/,R=new RegExp("\\\\([\\da-f]{1,6}"+o+"?|("+o+")|.)","ig"),ht=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ut=F(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{O.apply(e=K.call(g.childNodes),g.childNodes),e[g.childNodes.length].nodeType}catch(t){O={apply:e.length?function(t,e){q.apply(t,K.call(e))}:function(t,e){for(var i=t.length,r=0;t[i++]=e[r++];);t.length=i-1}}}function C(t,e,i,r){var n,s,o,a,l,h,u,c=e&&e.ownerDocument,p=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return i;if(!r&&((e?e.ownerDocument||e:g)!==w&&T(e),e=e||w,E)){if(11!==p&&(l=at.exec(t)))if(n=l[1]){if(9===p){if(!(o=e.getElementById(n)))return i;if(o.id===n)return i.push(o),i}else if(c&&(o=c.getElementById(n))&&_(e,o)&&o.id===n)return i.push(o),i}else{if(l[2])return O.apply(i,e.getElementsByTagName(t)),i;if((n=l[3])&&d.getElementsByClassName&&e.getElementsByClassName)return O.apply(i,e.getElementsByClassName(n)),i}if(d.qsa&&!v[t+" "]&&(!m||!m.test(t))){if(1!==p)c=e,u=t;else if("object"!==e.nodeName.toLowerCase()){for((a=e.getAttribute("id"))?a=a.replace(ht,N):e.setAttribute("id",a=S),s=(h=f(t)).length;s--;)h[s]="#"+a+" "+D(h[s]);u=h.join(","),c=lt.test(t)&&mt(e.parentNode)||e}if(u)try{return O.apply(i,c.querySelectorAll(u)),i}catch(t){}finally{a===S&&e.removeAttribute("id")}}}return j(t.replace(P,"$1"),e,i,r)}function ct(){var i=[];function r(t,e){return i.push(t+" ")>b.cacheLength&&delete r[i.shift()],r[t+" "]=e}return r}function M(t){return t[S]=!0,t}function k(t){var e=w.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e)}}function pt(t,e){for(var i=t.split("|"),r=i.length;r--;)b.attrHandle[i[r]]=e}function dt(t,e){var i=e&&t,r=i&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function ft(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ut(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function I(o){return M(function(s){return s=+s,M(function(t,e){for(var i,r=o([],t.length,s),n=r.length;n--;)t[i=r[n]]&&(t[i]=!(e[i]=t[i]))})})}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(t in d=C.support={},B=C.isXML=function(t){t=t&&(t.ownerDocument||t).documentElement;return!!t&&"HTML"!==t.nodeName},T=C.setDocument=function(t){var t=t?t.ownerDocument||t:g;return t!==w&&9===t.nodeType&&t.documentElement&&(i=(w=t).documentElement,E=!B(w),g!==w&&(t=w.defaultView)&&t.top!==t&&(t.addEventListener?t.addEventListener("unload",z,!1):t.attachEvent&&t.attachEvent("onunload",z)),d.attributes=k(function(t){return t.className="i",!t.getAttribute("className")}),d.getElementsByTagName=k(function(t){return t.appendChild(w.createComment("")),!t.getElementsByTagName("*").length}),d.getElementsByClassName=u.test(w.getElementsByClassName),d.getById=k(function(t){return i.appendChild(t).id=S,!w.getElementsByName||!w.getElementsByName(S).length}),d.getById?(b.filter.ID=function(t){var e=t.replace(R,c);return function(t){return t.getAttribute("id")===e}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&E)return(e=e.getElementById(t))?[e]:[]}):(b.filter.ID=function(t){var e=t.replace(R,c);return function(t){t=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return t&&t.value===e}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&E){var i,r,n,s=e.getElementById(t);if(s){if((i=s.getAttributeNode("id"))&&i.value===t)return[s];for(n=e.getElementsByName(t),r=0;s=n[r++];)if((i=s.getAttributeNode("id"))&&i.value===t)return[s]}return[]}}),b.find.TAG=d.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):d.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,r=[],n=0,s=e.getElementsByTagName(t);if("*"!==t)return s;for(;i=s[n++];)1===i.nodeType&&r.push(i);return r},b.find.CLASS=d.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&E)return e.getElementsByClassName(t)},r=[],m=[],(d.qsa=u.test(w.querySelectorAll))&&(k(function(t){i.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+o+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+o+"*(?:value|"+Z+")"),t.querySelectorAll("[id~="+S+"-]").length||m.push("~="),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+S+"+*").length||m.push(".#.+[+~]")}),k(function(t){t.innerHTML="";var e=w.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+o+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),i.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")})),(d.matchesSelector=u.test(n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.oMatchesSelector||i.msMatchesSelector))&&k(function(t){d.disconnectedMatch=n.call(t,"*"),n.call(t,"[s!='']:x"),r.push("!=",$)}),m=m.length&&new RegExp(m.join("|")),r=r.length&&new RegExp(r.join("|")),t=u.test(i.compareDocumentPosition),_=t||u.test(i.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,e=e&&e.parentNode;return t===e||!(!e||1!==e.nodeType||!(i.contains?i.contains(e):t.compareDocumentPosition&&16&t.compareDocumentPosition(e)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Y=t?function(t,e){var i;return t===e?(h=!0,0):(i=!t.compareDocumentPosition-!e.compareDocumentPosition)||(1&(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!d.sortDetached&&e.compareDocumentPosition(t)===i?t===w||t.ownerDocument===g&&_(g,t)?-1:e===w||e.ownerDocument===g&&_(g,e)?1:l?y(l,t)-y(l,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var i,r=0,n=t.parentNode,s=e.parentNode,o=[t],a=[e];if(!n||!s)return t===w?-1:e===w?1:n?-1:s?1:l?y(l,t)-y(l,e):0;if(n===s)return dt(t,e);for(i=t;i=i.parentNode;)o.unshift(i);for(i=e;i=i.parentNode;)a.unshift(i);for(;o[r]===a[r];)r++;return r?dt(o[r],a[r]):o[r]===g?-1:a[r]===g?1:0}),w},C.matches=function(t,e){return C(t,null,null,e)},C.matchesSelector=function(t,e){if((t.ownerDocument||t)!==w&&T(t),e=e.replace(it,"='$1']"),d.matchesSelector&&E&&!v[e+" "]&&(!r||!r.test(e))&&(!m||!m.test(e)))try{var i=n.call(t,e);if(i||d.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(R,c),t[3]=(t[3]||t[4]||t[5]||"").replace(R,c),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||C.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&C.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return p.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&rt.test(i)&&(e=f(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(R,c).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=X[t+" "];return e||(e=new RegExp("(^|"+o+")"+t+"("+o+"|$)"))&&X(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(e,i,r){return function(t){t=C.attr(t,e);return null==t?"!="===i:!i||(t+="","="===i?t===r:"!="===i?t!==r:"^="===i?r&&0===t.indexOf(r):"*="===i?r&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function J(t,i,r){return v(i)?w.grep(t,function(t,e){return!!i.call(t,e,t)!==r}):i.nodeType?w.grep(t,function(t){return t===i!==r}):"string"!=typeof i?w.grep(t,function(t){return-1)[^>]*|#([\w-]+))$/,it=((w.fn.init=function(t,e,i){if(t){if(i=i||tt,"string"!=typeof t)return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(w):w.makeArray(t,this);if(!(r="<"===t[0]&&">"===t[t.length-1]&&3<=t.length?[null,t,null]:et.exec(t))||!r[1]&&e)return(!e||e.jquery?e||i:this.constructor(e)).find(t);if(r[1]){if(e=e instanceof w?e[0]:e,w.merge(this,w.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:T,!0)),$.test(r[1])&&w.isPlainObject(e))for(var r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r])}else(i=T.getElementById(r[2]))&&(this[0]=i,this.length=1)}return this}).prototype=w.fn,tt=w(T),/^(?:parents|prev(?:Until|All))/),rt={children:!0,contents:!0,next:!0,prev:!0};function nt(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}w.fn.extend({has:function(t){var e=w(t,this),i=e.length;return this.filter(function(){for(var t=0;t\x20\t\r\n\f]+)/i,wt=/^$|^module$|\/(?:java|ecma)script/i,S={option:[1,""],thead:[1,"
","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function A(t,e){var i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&l(t,e)?w.merge([t],i):i}function Et(t,e){for(var i=0,r=t.length;ix",_.noCloneChecked=!!M.cloneNode(!0).lastChild.defaultValue;var Ot=T.documentElement,Pt=/^key/,Rt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ct=/^([^.]*)(?:\.(.+)|)/;function Mt(){return!0}function O(){return!1}function kt(){try{return T.activeElement}catch(t){}}function It(t,e,i,r,n,s){var o,a;if("object"==typeof e){for(a in"string"!=typeof i&&(r=r||i,i=void 0),e)It(t,a,i,r,e[a],s);return t}if(null==r&&null==n?(n=i,r=i=void 0):null==n&&("string"==typeof i?(n=r,r=void 0):(n=r,r=i,i=void 0)),!1===n)n=O;else if(!n)return t;return 1===s&&(o=n,(n=function(t){return w().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=w.guid++)),t.each(function(){w.event.add(this,e,n,r,i)})}w.event={global:{},add:function(e,t,i,r,n){var s,o,a,l,h,u,c,p,d,f=g.get(e);if(f)for(i.handler&&(i=(s=i).handler,n=s.selector),n&&w.find.matchesSelector(Ot,n),i.guid||(i.guid=w.guid++),(a=f.events)||(a=f.events={}),(o=f.handle)||(o=f.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(E)||[""]).length;l--;)c=d=(p=Ct.exec(t[l])||[])[1],p=(p[2]||"").split(".").sort(),c&&(h=w.event.special[c]||{},c=(n?h.delegateType:h.bindType)||c,h=w.event.special[c]||{},d=w.extend({type:c,origType:d,data:r,handler:i,guid:i.guid,selector:n,needsContext:n&&w.expr.match.needsContext.test(n),namespace:p.join(".")},s),(u=a[c])||((u=a[c]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(e,r,p,o)||e.addEventListener&&e.addEventListener(c,o)),h.add&&(h.add.call(e,d),d.handler.guid||(d.handler.guid=i.guid)),n?u.splice(u.delegateCount++,0,d):u.push(d),w.event.global[c]=!0)},remove:function(t,e,i,r,n){var s,o,a,l,h,u,c,p,d,f,m,_=g.hasData(t)&&g.get(t);if(_&&(l=_.events)){for(h=(e=(e||"").match(E)||[""]).length;h--;)if(d=m=(a=Ct.exec(e[h])||[])[1],f=(a[2]||"").split(".").sort(),d){for(c=w.event.special[d]||{},p=l[d=(r?c.delegateType:c.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=p.length;s--;)u=p[s],!n&&m!==u.origType||i&&i.guid!==u.guid||a&&!a.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(s,1),u.selector&&p.delegateCount--,c.remove&&c.remove.call(t,u));o&&!p.length&&(c.teardown&&!1!==c.teardown.call(t,f,_.handle)||w.removeEvent(t,d,_.handle),delete l[d])}else for(d in l)w.event.remove(t,d+e[h],i,r,!0);w.isEmptyObject(l)&&g.remove(t,"handle events")}},dispatch:function(t){var e,i,r,n,s,o=w.event.fix(t),a=new Array(arguments.length),t=(g.get(this,"events")||{})[o.type]||[],l=w.event.special[o.type]||{};for(a[0]=o,e=1;e\x20\t\r\n\f]*)[^>]*)\/>/gi,Ft=/\s*$/g;function zt(t,e){return l(t,"table")&&l(11!==e.nodeType?e:e.firstChild,"tr")&&w(t).children("tbody")[0]||t}function Bt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function jt(t,e){var i,r,n,s,o,a;if(1===e.nodeType){if(g.hasData(t)&&(s=g.access(t),o=g.set(e,s),a=s.events))for(n in delete o.handle,o.events={},a)for(i=0,r=a[n].length;i")},clone:function(t,e,i){var r,n,s,o,a,l,h,u=t.cloneNode(!0),c=w.contains(t.ownerDocument,t);if(!(_.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||w.isXMLDoc(t)))for(o=A(u),r=0,n=(s=A(t)).length;r").prop({charset:i.scriptCharset,src:i.url}).on("load error",n=function(t){r.remove(),n=null,t&&e("error"===t.type?404:200,t.type)}),T.head.appendChild(r[0])},abort:function(){n&&n()}}}),[]),Ve=/(=)\?(?=&|$)|\?\?/,qe=(w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=We.pop()||w.expando+"_"+Se++;return this[t]=!0,t}}),w.ajaxPrefilter("json jsonp",function(t,e,i){var r,n,s,o=!1!==t.jsonp&&(Ve.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ve.test(t.data)&&"data");if(o||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,o?t[o]=t[o].replace(Ve,"$1"+r):!1!==t.jsonp&&(t.url+=(Ae.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||w.error(r+" was not called"),s[0]},t.dataTypes[0]="json",n=x[r],x[r]=function(){s=arguments},i.always(function(){void 0===n?w(x).removeProp(r):x[r]=n,t[r]&&(t.jsonpCallback=e.jsonpCallback,We.push(r)),s&&v(n)&&n(s[0]),s=n=void 0}),"script"}),_.createHTMLDocument=((t=T.implementation.createHTMLDocument("").body).innerHTML="
",2===t.childNodes.length),w.parseHTML=function(t,e,i){var r;return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(_.createHTMLDocument?((r=(e=T.implementation.createHTMLDocument("")).createElement("base")).href=T.location.href,e.head.appendChild(r)):e=T),r=!i&&[],(i=$.exec(t))?[e.createElement(i[1])]:(i=At([t],e,r),r&&r.length&&w(r).remove(),w.merge([],i.childNodes)))},w.fn.load=function(t,e,i){var r,n,s,o=this,a=t.indexOf(" ");return-1").append(w.parseHTML(t)).find(r):t)}).always(i&&function(t,e){o.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){w.fn[e]=function(t){return this.on(e,t)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(t,e,i){var r,n,s,o,a=w.css(t,"position"),l=w(t),h={};"static"===a&&(t.style.position="relative"),s=l.offset(),r=w.css(t,"top"),o=w.css(t,"left"),a=("absolute"===a||"fixed"===a)&&-1<(r+o).indexOf("auto")?(n=(a=l.position()).top,a.left):(n=parseFloat(r)||0,parseFloat(o)||0),null!=(e=v(e)?e.call(t,i,w.extend({},s)):e).top&&(h.top=e.top-s.top+n),null!=e.left&&(h.left=e.left-s.left+a),"using"in e?e.using.call(t,h):l.css(h)}},w.fn.extend({offset:function(e){var t,i;return arguments.length?void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)}):(i=this[0])?i.getClientRects().length?(t=i.getBoundingClientRect(),i=i.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,r=this[0],n={top:0,left:0};if("fixed"===w.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),i=r.ownerDocument,t=r.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===w.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((n=w(t).offset()).top+=w.css(t,"borderTopWidth",!0),n.left+=w.css(t,"borderLeftWidth",!0))}return{top:e.top-n.top-w.css(r,"marginTop",!0),left:e.left-n.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===w.css(t,"position");)t=t.offsetParent;return t||Ot})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var s="pageYOffset"===n;w.fn[e]=function(t){return c(this,function(t,e,i){var r;if(m(t)?r=t:9===t.nodeType&&(r=t.defaultView),void 0===i)return r?r[n]:t[e];r?r.scrollTo(s?r.pageXOffset:i,s?i:r.pageYOffset):t[e]=i},e,t,arguments.length)}}),w.each(["top","left"],function(t,i){w.cssHooks[i]=Jt(_.pixelPosition,function(t,e){if(e)return e=R(t,i),Zt.test(e)?w(t).position()[i]+"px":e})}),w.each({Height:"height",Width:"width"},function(o,a){w.each({padding:"inner"+o,content:a,"":"outer"+o},function(r,s){w.fn[s]=function(t,e){var i=arguments.length&&(r||"boolean"!=typeof t),n=r||(!0===t||!0===e?"margin":"border");return c(this,function(t,e,i){var r;return m(t)?0===s.indexOf("outer")?t["inner"+o]:t.document.documentElement["client"+o]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+o],r["scroll"+o],t.body["offset"+o],r["offset"+o],r["client"+o])):void 0===i?w.css(t,e,n):w.style(t,e,i,n)},a,i?t:void 0,i)}})}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,i){w.fn[i]=function(t,e){return 0this.updateCoord(t,a,"x");break;case"scaleY":case"skewY":n=i,s=i-(r=t[a=e.substr(0,e.length-1)].y),o=t=>this.updateCoord(t,a,"y");break;case"tint":case"blend":const l=Array.isArray(i)?i:[t.tint,i];r=0,s=n=l.length,o="tint"===e?t=>this.updateTint(t,l):t=>this.updateBlend(t,l);break;case"shake":r={x:t.x,y:t.y},n=i,o=t=>this.updateShake(t);break;case"position":r={x:t.x,y:t.y},s={x:(n={x:i.x,y:i.y}).x-r.x,y:n.y-r.y},o=t=>this.updatePosition(t);break;case"skew":case"scale":n=i,s=i-(r=t[e].x),o=t=>this.updatePoint(t,e);break;case"face":r=t.rotation,s=(n=h.shortestAngle(r,Math.atan2(i.y-t.y,i.x-t.x)))-r,o=t=>this.updateOne(t,"rotation");break;default:n=i,s=i-(r=t[e]),o=t=>this.updateOne(t,e)}this.eases.push({element:t,entry:e,update:o,start:r,to:n,delta:s})}static shortestAngle(t,e){var i=2*Math.PI,r=Math.abs(t-e)%i;return(r>Math.PI?i-r:r)*(0<((e-t+Math.PI)%i+i)%i-Math.PI?1:-1)}remove(e,i){if(0===arguments.length)this.eases=[];else{"string"==typeof i&&(i=[i]);for(let t=0;t>16)+i*(e>>16)<<16|o*(s>>8&255)+i*(e>>8&255)<<8|o*(255&s)+i*(255&e)}updateShake(t){function e(t){return Math.floor(Math.random()*t)-Math.floor(t/2)}t.element.x=t.start.x+e(t.to),t.element.y=t.start.y+e(t.to)}complete(t){"shake"===t.entry&&(t.element.x=t.start.x,t.element.y=t.start.y)}reverse(t){var e,i;"position"===t.entry?(i=t.to.x,e=t.to.y,t.to.x=t.start.x,t.to.y=t.start.y,t.start.x=i,t.start.y=e,t.delta.x=-t.delta.x,t.delta.y=-t.delta.y):(i=t.to,t.to=t.start,t.start=i,t.delta=-t.delta)}repeat(t){switch(t.entry){case"skewX":t.element.skew.x=t.start;break;case"skewY":t.element.skew.y=t.start;break;case"skew":t.element.skew.x=t.start,t.element.skew.y=t.start;break;case"scaleX":t.element.scale.x=t.start;break;case"scaleY":t.element.scale.y=t.start;break;case"scale":t.element.scale.x=t.start,t.element.scale.y=t.start;break;case"position":t.element.x=t.start.x,t.element.y=t.start.y;break;default:t.element[t.entry]=t.start}}update(t){if(0===this.eases.length)return!0;if(this.options.wait){if(this.options.wait-=t,0=this.options.duration&&(e=this.time-this.options.duration,this.time=this.options.duration);for(let t=0;t=this.options.duration)if(this.options.reverse)this.eases.forEach(t=>this.reverse(t)),(this.time=e)&&this.eases.forEach(t=>t.update(t)),this.emit("reverse",this),this.options.repeat?!0!==this.options.repeat&&this.options.repeat--:this.options.reverse=!1;else{if(!this.options.repeat)return this.eases.forEach(t=>this.complete(t)),this.emit("complete",this),!0;this.eases.forEach(t=>this.repeat(t)),(this.time=e)&&this.eases.forEach(t=>t.update(t)),!0!==this.options.repeat&&this.options.repeat--,this.emit("repeat",this)}}get count(){return this.eases.length}}const s={duration:1e3,ease:r.easeInOutSine,maxFrame:1e3/60,ticker:null,useRAF:!0};class o extends n{constructor(t){super(),this.options=Object.assign({},s,t),this.easings=[],this.empty=!0,this.options.ticker&&this.options.ticker.add(this.update,this)}destroy(){this.removeAll(),this.options.useTicker?this.ticker.remove(this.update,this):this.options.useRAF&&(cancelAnimationFrame(this.handleRAF),this.handleRAF=null)}add(t,e,i){(i=i||{}).duration=(void 0!==i.duration?i:this.options).duration,i.ease=i.ease||this.options.ease,"string"==typeof i.ease&&(i.ease=r[i.ease]);t=new h(t,e,i);return this.easings.push(t),this.empty&&this.options.useRAF&&(this.handleRAF=requestAnimationFrame(()=>this.update()),this.lastTime=Date.now()),this.empty=!1,t}target(t,e,i,r){i=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))/i;return(r=r||{}).duration=i,this.add(t,{x:e.x,y:e.y},r)}face(t,e,i,r){e=h.shortestAngle(t.rotation,Math.atan2(e.y-t.y,e.x-t.x)),i=Math.abs(e-t.rotation)/i;return(r=r||{}).duration=i,this.add(t,{rotation:e},r)}removeEase(e,i){for(let t=0;tthis.update()):this.handleRAF=null}get count(){return this.easings.length}countRunning(){let t=0;for(var e of this.easings)t+=e.count;return t}set duration(t){this.options.duration=t}get duration(){return this.options.duration}set ease(t){this.options.ease=t}get ease(){return this.options.ease}}o.id=0;n=new o;o.ease=n,t.Ease=o,t.List=class{constructor(){console.warn("Ease.List was deprecated. Use new Ease() instead.")}},t.ease=n,Object.defineProperty(t,"__esModule",{value:!0})}),this.PIXI=this.PIXI||{},function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@pixi/math"),require("@pixi/display"),require("@pixi/ticker")):"function"==typeof define&&define.amd?define(["exports","@pixi/math","@pixi/display","@pixi/ticker"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pixi_viewport={},t.PIXI,t.PIXI,t.PIXI)}(this,function(t,a,e,i){"use strict";class r{constructor(t){this.parent=t,this.paused=!1}destroy(){}down(t){return!1}move(t){return!1}up(t){return!1}wheel(t){return!1}update(t){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(e){!function(){var n={linear:function(t,e,i,r){return i*t/r+e},easeInQuad:function(t,e,i,r){return i*(t/=r)*t+e},easeOutQuad:function(t,e,i,r){return-i*(t/=r)*(t-2)+e},easeInOutQuad:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,r){return i*(t/=r)*t*t+e},easeOutCubic:function(t,e,i,r){return i*((t=t/r-1)*t*t+1)+e},easeInOutCubic:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,r){return i*(t/=r)*t*t*t+e},easeOutQuart:function(t,e,i,r){return-i*((t=t/r-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,r){return i*(t/=r)*t*t*t*t+e},easeOutQuint:function(t,e,i,r){return i*((t=t/r-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,r){return(t/=r/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,r){return-i*Math.cos(t/r*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,r){return i*Math.sin(t/r*(Math.PI/2))+e},easeInOutSine:function(t,e,i,r){return-i/2*(Math.cos(Math.PI*t/r)-1)+e},easeInExpo:function(t,e,i,r){return 0===t?e:i*Math.pow(2,10*(t/r-1))+e},easeOutExpo:function(t,e,i,r){return t===r?e+i:i*(1-Math.pow(2,-10*t/r))+e},easeInOutExpo:function(t,e,i,r){return(t/=r/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,i,r){return-i*(Math.sqrt(1-(t/=r)*t)-1)+e},easeOutCirc:function(t,e,i,r){return i*Math.sqrt(1-(t=t/r-1)*t)+e},easeInOutCirc:function(t,e,i,r){return(t/=r/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,i,r){var n=1.70158,s=0,o=i;return 0!==t&&(t/=r),s=s||.3*r,n=o=this.options.time?(e=this.parent.width,i=this.parent.height,this.complete(),e===this.parent.width&&i===this.parent.height||this.parent.emit("zoomed",{viewport:this.parent,original:t,type:"animate"})):(e=this.options.ease(this.time,0,1,this.options.time),null!==this.width&&(i=this.startWidth,r=this.deltaWidth,this.parent.fitWidth(i+r*e,this.keepCenter,null===this.height)),null!==this.height&&(i=this.startHeight,r=this.deltaHeight,this.parent.fitHeight(i+r*e,this.keepCenter,null===this.width)),null===this.width?this.parent.scale.x=this.parent.scale.y:null===this.height&&(this.parent.scale.y=this.parent.scale.x),this.keepCenter||(i=this.startX,r=this.startY,n=this.deltaX,s=this.deltaY,o=new a.Point(this.parent.x,this.parent.y),this.parent.moveCenter(i+n*e,r+s*e),this.parent.emit("moved",{viewport:this.parent,original:o,type:"animate"})),(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:t,type:"animate"})))}}function p(t){let e=void 0,i=t[0],r=1;for(;ri.call(e,...t)),e=void 0)}return i}const d={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class f extends r{constructor(t,e={}){super(t),this.options=Object.assign({},d,e),this.ease=h(this.options.ease,"easeInOutSine"),this.options.sides?"all"===this.options.sides?this.top=this.bottom=this.left=this.right=!0:"horizontal"===this.options.sides?(this.right=this.left=!0,this.top=this.bottom=!1):"vertical"===this.options.sides?(this.left=this.right=!1,this.top=this.bottom=!0):(this.top=-1!==this.options.sides.indexOf("top"),this.bottom=-1!==this.options.sides.indexOf("bottom"),this.left=-1!==this.options.sides.indexOf("left"),this.right=-1!==this.options.sides.indexOf("right")):this.left=this.top=this.right=this.bottom=!1;t=this.options.underflow.toLowerCase();"center"===t?(this.underflowX=0,this.underflowY=0):(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0),this.reset()}isActive(){return null!==this.toX||null!==this.toY}down(){return this.toX=this.toY=null,!1}up(){return this.bounce(),!1}update(t){var e;this.paused||(this.bounce(),this.toX&&((e=this.toX).time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.options.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.options.time)),this.toY&&((e=this.toY).time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),e.time>=this.options.time?(this.parent.y=e.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(e.time,e.start,e.delta,this.options.time)))}calcUnderflowX(){let t;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}calcUnderflowY(){let t;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}oob(){var t,e,i,r=this.options.bounceBox;return r?(t=void 0===r.x?0:r.x,e=void 0===r.y?0:r.y,i=void 0===r.width?this.parent.worldWidth:r.width,r=void 0===r.height?this.parent.worldHeight:r.height,{left:this.parent.lefti,top:this.parent.topr,topLeft:new a.Point(t*this.parent.scale.x,e*this.parent.scale.y),bottomRight:new a.Point(i*this.parent.scale.x-this.parent.screenWidth,r*this.parent.scale.y-this.parent.screenHeight)}):{left:this.parent.left<0,right:this.parent.right>this.parent.worldWidth,top:this.parent.top<0,bottom:this.parent.bottom>this.parent.worldHeight,topLeft:new a.Point(0,0),bottomRight:new a.Point(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){if(!this.paused){let e,t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.x&&t.percentChangeX===p([t,"access",t=>t.options,"optionalAccess",t=>t.friction])||t.y&&t.percentChangeY===p([t,"access",t=>t.options,"optionalAccess",t=>t.friction]))&&(((e=this.oob()).left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.options.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.options.friction));var i=this.parent.plugins.get("drag",!0)||{},r=this.parent.plugins.get("pinch",!0)||{};if(t=t||{},!(p([i,"optionalAccess",t=>t.active])||p([r,"optionalAccess",t=>t.active])||this.toX&&this.toY||t.x&&t.y)){i=(e=e||this.oob()).topLeft,r=e.bottomRight;if(!this.toX&&!t.x){let t=null;e.left&&this.left?t=this.parent.screenWorldWidth(!0===this.options.right?this.parent.worldWidth:this.options.right)&&(this.parent.x=-(!0===this.options.right?this.parent.worldWidth:this.options.right)*this.parent.scale.x+this.parent.screenWidth,i.x=0,t=!0);t&&this.parent.emit("moved",{viewport:this.parent,original:e,type:"clamp-x"})}if(null!==this.options.top||null!==this.options.bottom){let t=!1;if(!this.noUnderflow&&this.parent.screenWorldHeight(!0===this.options.bottom?this.parent.worldHeight:this.options.bottom)&&(this.parent.y=-(!0===this.options.bottom?this.parent.worldHeight:this.options.bottom)*this.parent.scale.y+this.parent.screenHeight,i.y=0,t=!0);t&&this.parent.emit("moved",{viewport:this.parent,original:e,type:"clamp-y"})}this.last.x=this.parent.x,this.last.y=this.parent.y,this.last.scaleX=this.parent.scale.x,this.last.scaleY=this.parent.scale.y}}reset(){this.update()}}const g={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class v extends r{constructor(t,e={}){super(t),this.options=Object.assign({},g,e),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused)if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;null!==this.options.minWidth&&tthis.options.maxWidth&&(r=this.parent.scale.x,this.parent.fitWidth(this.options.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/r,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),null!==this.options.minHeight&&ethis.options.maxHeight&&(r=this.parent.scale.y,this.parent.fitHeight(this.options.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/r,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}else if(this.options.minScale||this.options.maxScale){var i,r={x:null,y:null},n={x:null,y:null};"number"==typeof this.options.minScale?(r.x=this.options.minScale,r.y=this.options.minScale):null!==this.options.minScale&&(i=this.options.minScale,r.x=void 0===i.x?null:i.x,r.y=void 0===i.y?null:i.y),"number"==typeof this.options.maxScale?(n.x=this.options.maxScale,n.y=this.options.maxScale):null!==this.options.maxScale&&(i=this.options.maxScale,n.x=void 0===i.x?null:i.x,n.y=void 0===i.y?null:i.y);let t=this.parent.scale.x,e=this.parent.scale.y;null!==r.x&&tn.x&&(t=n.x),null!==r.y&&en.y&&(e=n.y),t===this.parent.scale.x&&e===this.parent.scale.y||(this.parent.scale.set(t,e),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}reset(){this.clamp()}}const y={friction:.98,bounce:.8,minSpeed:.01};class b extends r{constructor(t,e={}){super(t),this.options=Object.assign({},y,e),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",t=>this.moved(t))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!(!this.x&&!this.y)}move(){var t;return this.paused||(1===(t=this.parent.input.count())||1=t-100){var e=t-i.time;this.x=(this.parent.x-i.x)/e,this.y=(this.parent.y-i.y)/e,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(t){void 0!==(t=t||{}).x&&(this.x=t.x,this.percentChangeX=this.options.friction),void 0!==t.y&&(this.y=t.y,this.percentChangeY=this.options.friction)}update(t){var e,i,r,n,s;this.paused||(e=this.x||this.y,i=this.timeSinceRelease,r=this.timeSinceRelease+t,this.x&&(s=this.percentChangeX,n=Math.log(s),this.parent.x+=16*this.x/n*(Math.pow(s,r/16)-Math.pow(s,i/16)),this.x*=Math.pow(this.percentChangeX,t/16)),this.y&&(n=this.percentChangeY,s=Math.log(n),this.parent.y+=16*this.y/s*(Math.pow(n,r/16)-Math.pow(n,i/16)),this.y*=Math.pow(this.percentChangeY,t/16)),this.timeSinceRelease+=t,this.x&&this.y?Math.abs(this.x){e.includes(t.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",t=>{e.includes(t.code)&&(this.keyIsPressed=!1)})}mouseButtons(t){this.mouse=t&&"all"!==t?[-1!==t.indexOf("left"),-1!==t.indexOf("middle"),-1!==t.indexOf("right")]:[!0,!0,!0]}parseUnderflow(){var t=this.options.underflow.toLowerCase();"center"===t?(this.underflowX=0,this.underflowY=0):(t.includes("left")?this.underflowX=-1:t.includes("right")?this.underflowX=1:this.underflowX=0,t.includes("top")?this.underflowY=-1:t.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(t){var e="mouse"===t.data.pointerType,i=this.parent.input.count();return!(!(1===i||1this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if("x"!==this.options.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}}const w={speed:0,acceleration:null,radius:null};class E extends r{constructor(t,e,i={}){super(t),this.target=e,this.options=Object.assign({},w,i),this.velocity={x:0,y:0}}update(i){if(!this.paused){var r=this.parent.center;let t=this.target.x,e=this.target.y;if(this.options.radius){if(!(Math.sqrt(Math.pow(this.target.y-r.y,2)+Math.pow(this.target.x-r.x,2))>this.options.radius))return;var n=Math.atan2(this.target.y-r.y,this.target.x-r.x);t=this.target.x-Math.cos(n)*this.options.radius,e=this.target.y-Math.sin(n)*this.options.radius}var s,o,a,n=t-r.x,l=e-r.y;(n||l)&&(this.options.speed?this.options.acceleration?(o=Math.atan2(e-r.y,t-r.x),(s=Math.sqrt(Math.pow(n,2)+Math.pow(l,2)))&&(a=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration),this.velocity=aMath.abs(n)?t:r.x+a,o=Math.abs(s)>Math.abs(l)?e:r.y+s,this.parent.moveCenter(i,o),this.parent.emit("moved",{viewport:this.parent,type:"follow"}))):(a=Math.atan2(e-r.y,t-r.x),s=Math.cos(a)*this.options.speed,i=Math.sin(a)*this.options.speed,o=Math.abs(s)>Math.abs(n)?t:r.x+s,a=Math.abs(i)>Math.abs(l)?e:r.y+i,this.parent.moveCenter(o,a),this.parent.emit("moved",{viewport:this.parent,type:"follow"})):(this.parent.moveCenter(t,e),this.parent.emit("moved",{viewport:this.parent,type:"follow"})))}}}const S={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class A extends r{constructor(t,e={}){super(t),this.options=Object.assign({},S,e),this.reverse=this.options.reverse?1:-1,this.radiusSquared="number"==typeof this.options.radius?Math.pow(this.options.radius,2):null,this.resize()}resize(){var t=this.options.distance;null!==t?(this.left=t,this.top=t,this.right=this.parent.screenWidth-t,this.bottom=this.parent.screenHeight-t):this.options.radius||(this.left=this.options.left,this.top=this.options.top,this.right=null===this.options.right?null:this.parent.screenWidth-this.options.right,this.bottom=null===this.options.bottom?null:this.parent.screenHeight-this.options.bottom)}down(){return this.paused||this.options.allowButtons||(this.horizontal=this.vertical=null),!1}move(t){var e,i;return this.paused||"mouse"!==t.data.pointerType&&1!==t.data.identifier||!this.options.allowButtons&&0!==t.data.buttons||(e=t.data.global.x,t=t.data.global.y,this.radiusSquared?(i=this.parent.toScreen(this.parent.center),Math.pow(i.x-e,2)+Math.pow(i.y-t,2)>=this.radiusSquared?(i=Math.atan2(i.y-t,i.x-e),this.options.linear?(this.horizontal=Math.round(Math.cos(i))*this.options.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(i))*this.options.speed*this.reverse*.06):(this.horizontal=Math.cos(i)*this.options.speed*this.reverse*.06,this.vertical=Math.sin(i)*this.options.speed*this.reverse*.06)):(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0)):(null!==this.left&&ethis.right?this.horizontal=-1*this.reverse*this.options.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),null!==this.top&&tthis.bottom?this.vertical=-1*this.reverse*this.options.speed*.06:(this.decelerateVertical(),this.vertical=0))),!1}decelerateHorizontal(){var t=this.parent.plugins.get("decelerate",!0);this.horizontal&&t&&!this.options.noDecelerate&&t.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){var t=this.parent.plugins.get("decelerate",!0);this.vertical&&t&&!this.options.noDecelerate&&t.activate({y:this.vertical*this.options.speed*this.reverse/(1e3/60)})}up(){return this.paused||(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null),!1}update(){var t;this.paused||(this.horizontal||this.vertical)&&(t=this.parent.center,this.horizontal&&(t.x+=this.horizontal*this.options.speed),this.vertical&&(t.y+=this.vertical*this.options.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"}))}}const L={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class O extends r{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(t,e={}){super(t),O.prototype.__init.call(this),O.prototype.__init2.call(this),O.prototype.__init3.call(this),this.options=Object.assign({},L,e)}down(){return 2<=this.parent.input.count()&&(this.active=!0)}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}move(i){if(!this.paused&&this.active){var r=i.data.global.x,n=i.data.global.y,s=this.parent.input.touches;if(2<=s.length){var o=s[0],s=s[1],a=o.last&&s.last?Math.sqrt(Math.pow(s.last.x-o.last.x,2)+Math.pow(s.last.y-o.last.y,2)):null;if(o.id===i.data.pointerId?o.last={x:r,y:n,data:i.data}:s.id===i.data.pointerId&&(s.last={x:r,y:n,data:i.data}),a){let t;r={x:o.last.x+(s.last.x-o.last.x)/2,y:o.last.y+(s.last.y-o.last.y)/2};this.options.center||(t=this.parent.toLocal(r));let e=Math.sqrt(Math.pow(s.last.x-o.last.x,2)+Math.pow(s.last.y-o.last.y,2));n=(1-a/(e=0===e?e=1e-10:e))*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y),i=(this.isAxisX()&&(this.parent.scale.x+=n),this.isAxisY()&&(this.parent.scale.y+=n),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:r}),this.parent.plugins.get("clamp-zoom",!0));i&&i.clamp(),this.options.center?this.parent.moveCenter(this.options.center):(s=this.parent.toGlobal(t),this.parent.x+=(r.x-s.x)*this.options.factor,this.parent.y+=(r.y-s.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(r.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(r.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=r,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}}return!1}up(){return!!(this.pinching&&this.parent.input.touches.length<=1)&&(this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0)}}const N={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class P extends r{constructor(t,e,i,r={}){super(t),this.options=Object.assign({},N,r),this.ease=h(r.ease,"easeInOutSine"),this.x=e,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};var t=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.y,this.parent.emit("snap-start",this.parent)}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap"):this.options.interrupt&&(this.snapping=null),!1}up(){var t;return 0===this.parent.input.count()&&(t=this.parent.plugins.get("decelerate",!0))&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.options.friction),!1}update(r){if(!(this.paused||this.options.interrupt&&0!==this.parent.input.count()))if(this.snapping){var n=this.snapping;n.time+=r;let t,e,i;var r=this.startX,s=this.startY,o=this.deltaX,a=this.deltaY;i=n.time>this.options.time?(t=!0,e=r+o,s+a):(n=this.ease(n.time,0,1,this.options.time),e=r+o*n,s+a*n),this.options.topLeft?this.parent.moveCorner(e,i):this.parent.moveCenter(e,i),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),t&&(this.options.removeOnComplete&&this.parent.plugins.remove("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{r=this.options.topLeft?this.parent.corner:this.parent.center;r.x===this.x&&r.y===this.y||this.snapStart()}}}const z={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class R extends r{constructor(t,e={}){super(t),this.options=Object.assign({},z,e),this.ease=h(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,(this.yScale=0)=this.options.time?(this.parent.scale.set(this.xScale,this.yScale),this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null):(e=this.snapping,i=this.ease(e.time,e.startX,e.deltaX,this.options.time),e=this.ease(e.time,e.startY,e.deltaY,this.options.time),this.parent.scale.x=this.parent.screenWidth/i,this.parent.scale.y=this.parent.screenHeight/e),(i=this.parent.plugins.get("clamp-zoom",!0))&&i.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(t))):this.parent.scale.x===this.xScale&&this.parent.scale.y===this.yScale||this.createSnapping()}}resume(){this.snapping=null,super.resume()}}const B={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class C extends r{constructor(t,e={}){super(t),this.options=Object.assign({},B,e),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(e){window.addEventListener("keydown",t=>{e.includes(t.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",t=>{e.includes(t.code)&&(this.keyIsPressed=!1)})}checkKeyPress(){return!this.options.keyToPress||this.keyIsPressed}down(){return this.options.interrupt&&(this.smoothing=null),!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}update(){if(this.smoothing){var e=this.smoothingCenter,i=this.smoothing;let t;this.options.center||(t=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x+=i.x),this.isAxisY()&&(this.parent.scale.y+=i.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});var i=this.parent.plugins.get("clamp-zoom",!0);i&&i.clamp(),this.options.center?this.parent.moveCenter(this.options.center):(i=this.parent.toGlobal(t),this.parent.x+=e.x-i.x,this.parent.y+=e.y-i.y),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(e){if(!this.paused){var i=this.parent.input.getPointerPosition(e),r=-e.deltaY*(e.deltaMode?this.options.lineHeight:1)/200,r=Math.pow(2,(1+this.options.percent)*r);let t;this.options.center||(t=this.parent.toLocal(i)),this.isAxisX()&&(this.parent.scale.x*=r),this.isAxisY()&&(this.parent.scale.y*=r),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});r=this.parent.plugins.get("clamp-zoom",!0);r&&r.clamp(),this.options.center?this.parent.moveCenter(this.options.center):(r=this.parent.toGlobal(t),this.parent.x+=i.x-r.x,this.parent.y+=i.y-r.y),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:e.deltaX,dy:e.deltaY,dz:e.deltaZ},event:e,viewport:this.parent})}}wheel(t){if(this.paused)return!1;if(!this.checkKeyPress())return!1;if(t.ctrlKey&&this.options.trackpadPinch)this.pinch(t);else if(this.options.wheelZoom){var e=this.parent.input.getPointerPosition(t),i=(this.options.reverse?-1:1)*-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/500,i=Math.pow(2,(1+this.options.percent)*i);if(this.options.smooth){var r={x:this.smoothing?this.smoothing.x*(this.options.smooth-this.smoothingCount):0,y:this.smoothing?this.smoothing.y*(this.options.smooth-this.smoothingCount):0};this.smoothing={x:((this.parent.scale.x+r.x)*i-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+r.y)*i-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{let t;this.options.center||(t=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=i),this.isAxisY()&&(this.parent.scale.y*=i),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});r=this.parent.plugins.get("clamp-zoom",!0);r&&r.clamp(),this.options.center?this.parent.moveCenter(this.options.center):(i=this.parent.toGlobal(t),this.parent.x+=e.x-i.x,this.parent.y+=e.y-i.y)}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:t.deltaX,dy:t.deltaY,dz:t.deltaZ},event:t,viewport:this.parent})}return!this.parent.options.passiveWheel}}class M{constructor(t){this.viewport=t,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new a.Rectangle(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.on("pointermove",this.move,this),this.viewport.on("pointerup",this.up,this),this.viewport.on("pointerupoutside",this.up,this),this.viewport.on("pointercancel",this.up,this),this.viewport.on("pointerout",this.up,this),this.wheelFunction=t=>this.handleWheel(t),this.viewport.options.divWheel.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){this.viewport.options.divWheel.removeEventListener("wheel",this.wheelFunction)}down(t){var e,i;!this.viewport.pause&&this.viewport.worldVisible&&("mouse"===t.data.pointerType?this.isMouseDown=!0:this.get(t.data.pointerId)||this.touches.push({id:t.data.pointerId,last:null}),1!==this.count()||(this.last=t.data.global.clone(),e=this.viewport.plugins.get("decelerate",!0),i=this.viewport.plugins.get("bounce",!0),e&&e.isActive()||i&&i.isActive())?this.clickedAvailable=!1:this.clickedAvailable=!0,this.viewport.plugins.down(t)&&this.viewport.options.stopPropagation&&t.stopPropagation())}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(t){return Math.abs(t)>=this.viewport.threshold}move(t){var e,i,r;!this.viewport.pause&&this.viewport.worldVisible&&(e=this.viewport.plugins.move(t),this.clickedAvailable&&this.last&&(i=t.data.global.x-this.last.x,r=t.data.global.y-this.last.y,(this.checkThreshold(i)||this.checkThreshold(r))&&(this.clickedAvailable=!1)),e&&this.viewport.options.stopPropagation&&t.stopPropagation())}up(t){var e;!this.viewport.pause&&this.viewport.worldVisible&&("mouse"===t.data.pointerType&&(this.isMouseDown=!1),"mouse"!==t.data.pointerType&&this.remove(t.data.pointerId),e=this.viewport.plugins.up(t),this.clickedAvailable&&0===this.count()&&this.last&&(this.viewport.emit("clicked",{event:t,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this}),this.clickedAvailable=!1),e&&this.viewport.options.stopPropagation&&t.stopPropagation())}getPointerPosition(t){var e,i=new a.Point;return this.viewport.options.interaction?this.viewport.options.interaction.mapPositionToPoint(i,t.clientX,t.clientY):this.viewport.options.useDivWheelForInputManager&&this.viewport.options.divWheel?(e=this.viewport.options.divWheel.getBoundingClientRect(),i.x=t.clientX-e.left,i.y=t.clientY-e.top):(i.x=t.clientX,i.y=t.clientY),i}handleWheel(t){var e;this.viewport.pause||!this.viewport.worldVisible||this.viewport.options.interaction&&this.viewport.options.interaction.interactionDOMElement!==t.target||(e=this.viewport.toLocal(this.getPointerPosition(t)),this.viewport.left<=e.x&&e.x<=this.viewport.right&&this.viewport.top<=e.y&&e.y<=this.viewport.bottom&&this.viewport.plugins.wheel(t)&&!this.viewport.options.passiveWheel&&t.preventDefault())}pause(){this.touches=[],this.isMouseDown=!1}get(t){for(const e of this.touches)if(e.id===t)return e;return null}remove(e){for(let t=0;ti.call(e,...t)),e=void 0)}return i}const I=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class D{constructor(t){this.viewport=t,this.list=[],this.plugins={}}add(t,e,i=I.length){this.plugins[t]=e;e=I.indexOf(t);-1!==e&&I.splice(e,1),I.splice(i,0,t),this.sort()}get(e,t){return t&&k([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.paused])?null:this.plugins[e]}update(t){for(const e of this.list)e.update(t)}resize(){for(const t of this.list)t.resize()}reset(){for(const t of this.list)t.reset()}removeAll(){this.plugins={},this.sort()}remove(t){this.plugins[t]&&(delete this.plugins[t],this.viewport.emit(t+"-remove"),this.sort())}pause(e){k([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){k([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const t of I)this.plugins[t]&&this.list.push(this.plugins[t])}down(t){let e=!1;for(const i of this.list)i.down(t)&&(e=!0);return e}move(t){let e=!1;for(const i of this.viewport.plugins.list)i.move(t)&&(e=!0);return e}up(t){let e=!1;for(const i of this.list)i.up(t)&&(e=!0);return e}wheel(t){let e=!1;for(const i of this.list)i.wheel(t)&&(e=!0);return e}}const U={screenWidth:window.innerWidth,screenHeight:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,interaction:null,disableOnContextMenu:!1,ticker:i.Ticker.shared};class F extends e.Container{__init(){this._disableOnContextMenu=t=>t.preventDefault()}constructor(t={}){super(),F.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},U,t),this.screenWidth=this.options.screenWidth,this.screenHeight=this.options.screenHeight,this._worldWidth=this.options.worldWidth,this._worldHeight=this.options.worldHeight,this.forceHitArea=this.options.forceHitArea,this.threshold=this.options.threshold,this.options.divWheel=this.options.divWheel||document.body,this.options.disableOnContextMenu&&this.options.divWheel.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new M(this),this.plugins=new D(this)}destroy(t){!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&this.options.divWheel.removeEventListener("contextmenu",this._disableOnContextMenu),this.input.destroy(),super.destroy(t)}update(t){this.pause||(this.plugins.update(t),this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this._hitAreaDefault=new a.Rectangle(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight),this.hitArea=this._hitAreaDefault),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y},this.emit("frame-end",this))}resize(t=window.innerWidth,e=window.innerHeight,i,r){this.screenWidth=t,this.screenHeight=e,void 0!==i&&(this._worldWidth=i),void 0!==r&&(this._worldHeight=r),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth||this.width/this.scale.x}set worldWidth(t){this._worldWidth=t,this.plugins.resize()}get worldHeight(){return this._worldHeight||this.height/this.scale.y}set worldHeight(t){this._worldHeight=t,this.plugins.resize()}getVisibleBounds(){return new a.Rectangle(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(t,e){return 2===arguments.length?this.toLocal(new a.Point(t,e)):this.toLocal(t)}toScreen(t,e){return 2===arguments.length?this.toGlobal(new a.Point(t,e)):this.toGlobal(t)}get worldScreenWidth(){return this.screenWidth/this.scale.x}get worldScreenHeight(){return this.screenHeight/this.scale.y}get screenWorldWidth(){return this.worldWidth*this.scale.x}get screenWorldHeight(){return this.worldHeight*this.scale.y}get center(){return new a.Point(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(t){this.moveCenter(t)}moveCenter(...t){let e,i;i="number"==typeof t[0]?(e=t[0],t[1]):(e=t[0].x,t[0].y);var t=(this.worldScreenWidth/2-e)*this.scale.x,r=(this.worldScreenHeight/2-i)*this.scale.y;return this.x===t&&this.y===r||(this.position.set(t,r),this.plugins.reset(),this.dirty=!0),this}get corner(){return new a.Point(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(t){this.moveCorner(t)}moveCorner(...t){let e,i;return i=1===t.length?(e=-t[0].x*this.scale.x,-t[0].y*this.scale.y):(e=-t[0]*this.scale.x,-t[1]*this.scale.y),e===this.x&&i===this.y||(this.position.set(e,i),this.plugins.reset(),this.dirty=!0),this}get screenWidthInWorldPixels(){return this.screenWidth/this.scale.x}get screenHeightInWorldPixels(){return this.screenHeight/this.scale.y}findFitWidth(t){return this.screenWidth/t}findFitHeight(t){return this.screenHeight/t}findFit(t,e){t=this.screenWidth/t,e=this.screenHeight/e;return Math.min(t,e)}findCover(t,e){t=this.screenWidth/t,e=this.screenHeight/e;return Math.max(t,e)}fitWidth(t=this.worldWidth,e,i=!0,r){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,i&&(this.scale.y=this.scale.x);t=this.plugins.get("clamp-zoom",!0);return!r&&t&&t.clamp(),e&&n&&this.moveCenter(n),this}fitHeight(t=this.worldHeight,e,i=!0,r){let n;e&&(n=this.center),this.scale.y=this.screenHeight/t,i&&(this.scale.x=this.scale.y);t=this.plugins.get("clamp-zoom",!0);return!r&&t&&t.clamp(),e&&n&&this.moveCenter(n),this}fitWorld(t){let e;t&&(e=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.xthis.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new a.Point(this.worldWidth*this.scale.x-this.screenWidth,this.worldHeight*this.scale.y-this.screenHeight)}}get right(){return-this.x/this.scale.x+this.worldScreenWidth}set right(t){this.x=-t*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(t){this.x=-t*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(t){this.y=-t*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(t){this.y=-t*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(t){this._dirty=t}get forceHitArea(){return this._forceHitArea}set forceHitArea(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=null,this.hitArea=new a.Rectangle(0,0,this.worldWidth,this.worldHeight))}drag(t){return this.plugins.add("drag",new T(this,t)),this}clamp(t){return this.plugins.add("clamp",new _(this,t)),this}decelerate(t){return this.plugins.add("decelerate",new b(this,t)),this}bounce(t){return this.plugins.add("bounce",new f(this,t)),this}pinch(t){return this.plugins.add("pinch",new O(this,t)),this}snap(t,e,i){return this.plugins.add("snap",new P(this,t,e,i)),this}follow(t,e){return this.plugins.add("follow",new E(this,t,e)),this}wheel(t){return this.plugins.add("wheel",new C(this,t)),this}animate(t){return this.plugins.add("animate",new c(this,t)),this}clampZoom(t){return this.plugins.add("clamp-zoom",new v(this,t)),this}mouseEdges(t){return this.plugins.add("mouse-edges",new A(this,t)),this}get pause(){return!!this._pause}set pause(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&this.input.pause()}ensureVisible(t,e,i,r,n){n&&(i>this.worldScreenWidth||r>this.worldScreenHeight)&&(this.fit(!0,i,r),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let s=!1;tthis.right&&(this.right=t+i,s=!0),ethis.bottom&&(this.bottom=e+r,s=!0),s&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}t.Animate=c,t.Bounce=f,t.Clamp=_,t.ClampZoom=v,t.Decelerate=b,t.Drag=T,t.Follow=E,t.InputManager=M,t.MouseEdges=A,t.Pinch=O,t.Plugin=r,t.PluginManager=D,t.Snap=P,t.SnapZoom=R,t.Viewport=F,t.Wheel=C,Object.defineProperty(t,"__esModule",{value:!0})}),"undefined"!=typeof pixi_viewport&&Object.assign(this.PIXI,pixi_viewport),function(){"use strict";var u=new("undefined"==typeof WebKitCSSMatrix?DOMMatrix:WebKitCSSMatrix);function c(t,e,i){this.x=t,this.y=e,this.z=i}function r(t){for(var e=u,i=t;null!=i&&i!==i.ownerDocument.documentElement;)var r=window.getComputedStyle(i,void 0).transform||"none",e=("none"===r?u:function(e){try{return new("undefined"==typeof WebKitCSSMatrix?DOMMatrix:WebKitCSSMatrix)(e)}catch(t){return console.warn(e),console.warn(t.toString()),u}}(r)).multiply(e),i=i.parentNode;for(var n=t.offsetWidth,s=t.offsetHeight,o=4,a=1/0,l=1/0;0<=--o;){var h=new c(0===o||1===o?0:n,0===o||3===o?0:s,0).transformBy(e);h.xe&&(i[r]=this.hyphenate(i[r]).join("­"));return i.join("")},e.prototype.hyphenate=function(t){var e,i,r,n,s,o,a,l,h,u=[],c=[],p=t.toLowerCase(),d=Math.max,f=this.trie,m=[""];if(this.exceptions.hasOwnProperty(p))return t.match(this.exceptions[p]).slice(1);if(-1!==t.indexOf("­"))return[t];for(e=(t="_"+t+"_").toLowerCase().split(""),i=t.split(""),a=e.length,r=0;rthis.leftMin&&r