!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OptimalSelect=t():e.OptimalSelect=t()}(this,function(){return i=[function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertNodeList=function(e){for(var t=e.length,i=new Array(t),r=0;r@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){for(var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(r.length<2)return c("",e,"",t);var n=[r.pop()];for(;1/g,"> ").trim()};var r=i(3),u=(r=r)&&r.__esModule?r:{default:r},h=i(0);function c(i,r,n,s){if(i.length&&(i+=" "),n.length&&(n=" "+n),/\[*\]/.test(r)){var e=r.replace(/=.*$/,"]"),o=""+i+e+n;if(p(document.querySelectorAll(o),s))r=e;else for(var a=document.querySelectorAll(""+i+e),l=0,t=a.length;l/.test(r)&&(e=r.replace(/>/,""),o=""+i+e+n,p(document.querySelectorAll(o),s)&&(r=e)),/:nth-child/.test(r)&&(e=r.replace(/nth-child/g,"nth-of-type"),o=""+i+e+n,p(document.querySelectorAll(o),s)&&(r=e)),/\.\S+\.\S+/.test(r)){for(var u=r.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});u.length;){var h=r.replace(u.shift(),"").trim();if(!(o=(""+i+h+n).trim()).length||">"===o.charAt(0)||">"===o.charAt(o.length-1))break;p(document.querySelectorAll(o),s)&&(r=h)}if((u=r&&r.match(/\./g))&&2)(\S)/g,"$1 $2").trim()).split(" ").reverse().map(function(e,t){var i,r,n,s=0===t,t=e.split(":"),e=m(t,2),o=e[0],t=e[1],a=null,l=null;switch(!0){case/>/.test(o):l=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(o):var u=o.substr(1).split(".");a=function(e){var t=e.attribs.class;return t&&u.every(function(e){return-1 "+l+":nth-child("+(o+1)+")",r.unshift(u)):console.warn("\n Element couldn't be matched through strict ignore pattern!\n ",h,i,l)}}(s,l,o,a)}l=l.parentNode,u=a.length}l===r&&(t=m(s,l,o),a.unshift(t));return a.join(" ")};var p=i(0),c={attribute:function(e){return-1<["style","data-reactid","data-react-checksum"].indexOf(e)}};function d(e,t,i,r,n){n=4\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",t=n.console&&(n.console.warn||n.console.log);return t&&t.call(n.console,r,e),i.apply(this,arguments)}}var a="function"!=typeof Object.assign?function(e){if(e===h||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;it[i]}):r.sort():r}function f(e,t){for(var i,r=t[0].toUpperCase()+t.slice(1),n=0;nc(o.y)?o.x:o.y,r.scale=a?function(e,t){return P(t[0],t[1],A)/P(e[0],e[1],A)}(a.pointers,t):1,r.rotation=a?function(e,t){return he(t[1],t[0],A)+he(e[1],e[0],A)}(a.pointers,t):0,r.maxPointers=!s.prevInput||r.pointers.length>s.prevInput.maxPointers?r.pointers.length:s.prevInput.maxPointers,function(e,t){var i,r,n,s=e.lastInterval||t,o=t.timeStamp-s.timeStamp;{var a,l;t.eventType!=v&&(iec(o.y)?o.x:o.y,a=ue(a,l),e.lastInterval=t):(i=s.velocity,r=s.velocityX,n=s.velocityY,a=s.direction)}t.velocity=i,t.velocityX=r,t.velocityY=n,t.direction=a}(s,r),n.element);q(r.srcEvent.target,l)&&(l=r.srcEvent.target),r.target=l,e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function oe(e){for(var t=[],i=0;i=c(t)?e<0?b:x:t<0?T:w}function P(e,t,i){var r=t[(i=i||ne)[0]]-e[i[0]],t=t[i[1]]-e[i[1]];return Math.sqrt(r*r+t*t)}function he(e,t,i){var r=t[(i=i||ne)[0]]-e[i[0]],t=t[i[1]]-e[i[1]];return 180*Math.atan2(t,r)/Math.PI}k.prototype={handler:function(){},init:function(){this.evEl&&t(this.element,this.evEl,this.domHandler),this.evTarget&&t(this.target,this.evTarget,this.domHandler),this.evWin&&t(J(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(J(this.element),this.evWin,this.domHandler)}};var ce={mousedown:_,mousemove:2,mouseup:g};function O(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,k.apply(this,arguments)}e(O,k,{handler:function(e){var t=ce[e.type];t&_&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=g),this.pressed&&(t&g&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:te,srcEvent:e}))}});var pe={pointerdown:_,pointermove:2,pointerup:g,pointercancel:v,pointerout:v},de={2:m,3:"pen",4:te,5:"kinect"},fe="pointerdown",me="pointermove pointerup pointercancel";function _e(){this.evEl=fe,this.evWin=me,k.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(fe="MSPointerDown",me="MSPointerMove MSPointerUp MSPointerCancel"),e(_e,k,{handler:function(e){var t=this.store,i=!1,r=e.type.toLowerCase().replace("ms",""),r=pe[r],n=de[e.pointerType]||e.pointerType,s=n==m,o=p(t,e.pointerId,"pointerId");r&_&&(0===e.button||s)?o<0&&(t.push(e),o=t.length-1):r&(g|v)&&(i=!0),o<0||(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:n,srcEvent:e}),i&&t.splice(o,1))}});var ge={touchstart:_,touchmove:2,touchend:g,touchcancel:v};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,k.apply(this,arguments)}e(ve,k,{handler:function(e){var t,i=ge[e.type];i===_&&(this.started=!0),this.started&&(t=function(e,t){var i=d(e.touches),e=d(e.changedTouches);t&(g|v)&&(i=K(i.concat(e),"identifier",!0));return[i,e]}.call(this,e,i),i&(g|v)&&t[0].length-t[1].length==0&&(this.started=!1),this.callback(this.manager,i,{pointers:t[0],changedPointers:t[1],pointerType:m,srcEvent:e}))}});var ye={touchstart:_,touchmove:2,touchend:g,touchcancel:v};function be(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},k.apply(this,arguments)}e(be,k,{handler:function(e){var t=ye[e.type],i=function(e,t){var i=d(e.touches),r=this.targetIds;if(t&(2|_)&&1===i.length)return r[i[0].identifier]=!0,[i,i];var n,s,o=d(e.changedTouches),a=[],l=this.target;if(s=i.filter(function(e){return q(e.target,l)}),t===_)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return D.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ie(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),e(Fe,D,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[R]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){var t;1!==e.scale&&(t=e.scale<1?"in":"out",e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),e(Ne,I,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!i||e.eventType&(g|v)&&!n)this.reset();else if(e.eventType&_)this.reset(),this._timer=j(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&g)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&g?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=U(),this.manager.emit(this.options.event,this._input)))}}),e(ze,D,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[R]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),e(Be,D,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:E|S,pointers:1},getTouchAction:function(){return Le.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return i&(E|S)?t=e.overallVelocity:i&E?t=e.overallVelocityX:i&S&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&e.eventType&g},emit:function(e){var t=Ie(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),e(Ue,I,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Oe]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,r=e.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>=h&&n!==r.x&&be(si.x||r.x===i.x&&function(e,t){return xe(e.prev,e,t.prev)<0&&xe(t.next,e,e.next)<0}(i,r)))&&(i=r,p=l)),r=r.next,r!==u;);return i}(e,t);return i?(_e(e=ke(i,e),e.next),_e(i,i.next)):t}(l[n],i);return i}(e,t,h,i)),e.length>80*i){for(var p=r=e[0],d=n=e[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&&be(a,h,l,c,u,p,y.x,y.y)&&0<=xe(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&&be(a,h,l,c,u,p,b.x,b.y)&&0<=xe(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&&be(a,h,l,c,u,p,y.x,y.y)&&0<=xe(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&&be(a,h,l,c,u,p,b.x,b.y)&&0<=xe(b.prev,b,b.next))return;b=b.nextZ}return 1}(e,r,n,s):function(e){var t=e.prev,i=e,e=e.next;if(0<=xe(t,i,e))return;var r=t.x,n=i.x,s=e.x,o=t.y,a=i.y,l=e.y,u=r=u&&d.x<=c&&d.y>=h&&d.y<=p&&be(r,o,n,a,s,l,d.x,d.y)&&0<=xe(d.prev,d,d.next))return;d=d.next}return 1}(e))t.push(T.i/i|0),t.push(e.i/i|0),t.push(w.i/i|0),Oe(e),e=w.next,E=w.next;else if((e=w)===E){o?1===o?ge(e=function(e,t,i){var r=e;do{var n=r.prev,s=r.next.next}while(!Te(n,s)&&we(n,r,r.next,s)&&Ae(n,s)&&Ae(s,n)&&(t.push(n.i/i|0),t.push(r.i/i|0),t.push(s.i/i|0),Oe(r),Oe(r.next),r=e=s),r=r.next,r!==e);return _e(r)}(_e(e),t,i),t,i,r,n,s,2):2===o&&function(e,t,i,r,n,s){var o=e;do{for(var a,l=o.next.next;l!==o.prev;){if(o.i!==l.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&we(i,i.next,e,t))return 1}while(i=i.next,i!==e);return}(e,t)&&(Ae(e,t)&&Ae(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.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!==e;);return r}(e,t)&&(xe(e.prev,e,t.prev)||xe(e,t.prev,t))||Te(e,t)&&0=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function Se(e){return 0= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=g-1,y=Math.floor,b=String.fromCharCode;function x(e){throw RangeError(p[e])}function f(e,t){for(var i=e.length,r=[];i--;)r[i]=t(e[i]);return r}function m(e,t){var i=e.split("@"),r="",i=(1>>10&1023|55296),e=56320|1023&e),t+=b(e)}).join("")}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,i){var r=0;for(e=i?y(e/l):e>>1,e+=y(e/t);d*v>>1y((_-h)/s))&&x("overflow"),h+=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(h-n,t=l.length+1,0==n),y(h/t)>_-c&&x("overflow"),c+=y(h/t),h%=t,l.splice(h++,0,c)}return w(l)}function k(e){for(var t,i,r,n,s,o,a,l,u,h,c=[],p=(e=T(e)).length,d=128,f=72,m=t=0;my((_-t)/(l=i+1))&&x("overflow"),t+=(n-d)*l,d=n,m=0;m_&&x("overflow"),a==d){for(s=t,o=g;!(s<(u=o<=f?1:f+v<=o?v:o-f));o+=g)c.push(b(E(u+(h=s-u)%(u=g-u),0))),s=y(h/u);c.push(b(E(s,0))),f=S(t,l,i==r),t=0,++i}++t,++d}return c.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:w},decode:A,encode:k,toASCII:function(e){return m(e,function(e){return h.test(e)?"xn--"+k(e):e})},toUnicode:function(e){return m(e,function(e){return u.test(e)?A(e.slice(4).toLowerCase()):e})}},r&&t)if(e.exports==r)t.exports=s;else for(o in s)s.hasOwnProperty(o)&&(r[o]=s[o]);else i.punycode=s}),Ie=function(e){return"string"==typeof e},De=function(e){return"object"==typeof e&&null!==e},Le=function(e){return null===e},Fe=function(e){return null==e};function Ne(e,t,i,r){t=t||"&",i=i||"=";var n={};if("string"==typeof e&&0!==e.length){var s=/\+/g,t=(e=e.split(t),1e3),o=(r&&"number"==typeof r.maxKeys&&(t=r.maxKeys),e.length);0",'"',"`"," ","\r","\n","\t"]),qe=["'"].concat(i),Ke=["%","/","?",";","#"].concat(qe),Ze=["/","?","#"],Je=/^[+a-z0-9A-Z_-]{0,63}$/,Qe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$e={javascript:!0,"javascript:":!0},et={javascript:!0,"javascript:":!0},tt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function it(e,t,i){var r;return e&&De(e)&&e instanceof He?e:((r=new He).parse(e,t,i),r)}He.prototype.parse=function(e,t,i){if(!Ie(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),r=-1!==r&&r]*?)$/i.test(e)},hasProtocol:function(e){return/^[^/:]+:\//.test(this.toPosix(e))},getProtocol:function(e){st(e),e=this.toPosix(e);var t="",i=/^file:\/\/\//.exec(e),r=/^[^/:]+:\/\//.exec(e),n=/^[^/:]+:\//.exec(e);return(i||r||n)&&(i=(null==i?void 0:i[0])||(null==r?void 0:r[0])||(null==n?void 0:n[0]),e=e.slice((t=i).length)),t},toAbsolute:function(e,t,i){return this.isDataUrl(e)?e:(t=ot(this.toPosix(null!=t?t:R.ADAPTER.getBaseUrl())),i=ot(this.toPosix(null!=i?i:this.rootname(t))),st(e),(e=this.toPosix(e)).startsWith("/")?lt.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(t,e))},normalize:function(e){var t,i,r;return st(e=this.toPosix(e)),0===e.length?".":(t="",i=e.startsWith("/"),this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length)),r=e.endsWith("/"),0<(e=function(e,t){for(var i,r="",n=0,s=-1,o=0,a=0;a<=e.length;++a){if(a>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function ft(e){e=e.toString(16);return"#"+("000000".substring(0,6-e.length)+e)}function mt(e){return"string"==typeof e&&"#"===(e=pt[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}var _t=function(){for(var e=[],t=[],i=0;i<32;i++)t[e[i]=i]=i;e[$.BLEND_MODES.NORMAL_NPM]=$.BLEND_MODES.NORMAL,e[$.BLEND_MODES.ADD_NPM]=$.BLEND_MODES.ADD,e[$.BLEND_MODES.SCREEN_NPM]=$.BLEND_MODES.SCREEN,t[$.BLEND_MODES.NORMAL]=$.BLEND_MODES.NORMAL_NPM,t[$.BLEND_MODES.ADD]=$.BLEND_MODES.ADD_NPM,t[$.BLEND_MODES.SCREEN]=$.BLEND_MODES.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}();function gt(e,t){return _t[t?1:0][e]}function vt(e,t,i,r){return i=i||new Float32Array(4),r||void 0===r?(i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t):(i[0]=e[0],i[1]=e[1],i[2]=e[2]),i[3]=t,i}function yt(e,t){return 1===t?(255*t<<24)+e:0===t?0:(255*t<<24)+(((e>>16&255)*t+.5|0)<<16)+(((e>>8&255)*t+.5|0)<<8)+((255&e)*t+.5|0)}function bt(e,t,i,r){return(i=i||new Float32Array(4))[0]=(e>>16&255)/255,i[1]=(e>>8&255)/255,i[2]=(255&e)/255,!r&&void 0!==r||(i[0]*=t,i[1]*=t,i[2]*=t),i[3]=t,i}function xt(e,t){var i=6*e;if((t=(t=void 0===t?null:t)||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+i);for(var r=0,n=0;r>>1)|e>>>2)|e>>>4)|e>>>8)|e>>>16)+1}function St(e){return!(e&e-1||!e)}function At(e){var t=(65535>>=t)?1:0)<<3;return(t|=i)|(i=(15<(e>>>=i)?1:0)<<2)|(i=(3<(e>>>=i)?1:0)<<1)|(e>>>=i)>>1}function kt(e,t,i){var r=e.length;if(!(r<=t||0===i)){for(var n=r-(i=r=this.x&&e=this.y&&t=r||Math.max(o.y,f.y,a.y,l.y)<=n||Math.min(o.y,f.y,a.y,l.y)>=s)&&(h=(t=u*(f.y-o.y))*i+(f=u*(o.x-f.x))*n,c=t*r+f*n,p=t*i+f*s,d=t*r+f*s,!(Math.max(h,c,p,d)<=t*o.x+f*o.y||Math.min(h,c,p,d)>=t*l.x+f*l.y)&&(p=(h=u*(o.y-a.y))*i+(c=u*(a.x-o.x))*n,d=h*r+c*n,t=h*i+c*s,f=h*r+c*s,!(Math.max(p,d,t,f)<=h*o.x+c*o.y||Math.min(p,d,t,f)>=h*l.x+c*l.y))))))):(u=(this.xe.right?e:this).right<=u)&&(this.ye.bottom?e:this).bottom)},Kt.prototype.pad=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this.x-=e,this.y-=t,this.width+=2*e,this.height+=2*t,this},Kt.prototype.fit=function(e){var t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),e=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=r,this.height=Math.max(e-r,0),this},Kt.prototype.ceil=function(e,t){void 0===e&&(e=1),void 0===t&&(t=.001);var i=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=r-this.y,this},Kt.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),e=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=r,this.height=e-r,this},Kt.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},Kt);function Kt(e,t,i,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(r),this.type=$.SHAPES.RECT}Jt.prototype.clone=function(){return new Jt(this.x,this.y,this.radius)},Jt.prototype.contains=function(e,t){var i;return!(this.radius<=0)&&(i=this.radius*this.radius,e=this.x-e,t=this.y-t,(e*=e)+(t*=t)<=i)},Jt.prototype.getBounds=function(){return new w(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},Jt.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"};var Zt=Jt;function Jt(e,t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=e=void 0===e?0:e,this.y=t,this.radius=i,this.type=$.SHAPES.CIRC}$t.prototype.clone=function(){return new $t(this.x,this.y,this.width,this.height)},$t.prototype.contains=function(e,t){return!(this.width<=0||this.height<=0)&&(e=(e-this.x)/this.width,t=(t-this.y)/this.height,(e*=e)+(t*=t)<=1)},$t.prototype.getBounds=function(){return new w(this.x-this.width,this.y-this.height,this.width,this.height)},$t.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"};var Qt=$t;function $t(e,t,i,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=e=void 0===e?0:e,this.y=t,this.width=i,this.height=r,this.type=$.SHAPES.ELIP}ti.prototype.clone=function(){var e=new ti(this.points.slice());return e.closeStroke=this.closeStroke,e},ti.prototype.contains=function(e,t){for(var i=!1,r=this.points.length/2,n=0,s=r-1;n=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;var r=e-(this.x+i),n=t-(this.y+i),s=i*i;if(r*r+n*n<=s)return!0;if((r=e-(this.x+this.width-i))*r+n*n<=s)return!0;if(r*r+(n=t-(this.y+this.height-i))*n<=s)return!0;if((r=e-(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(e,t,i,r,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=e=void 0===e?0:e,this.y=t,this.width=i,this.height=r,this.radius=n,this.type=$.SHAPES.RREC}si.prototype.clone=function(e,t){return new si(e=void 0===e?this.cb:e,t=void 0===t?this.scope:t,this._x,this._y)},si.prototype.set=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=e),this._x===e&&this._y===t||(this._x=e,this._y=t,this.cb.call(this.scope)),this},si.prototype.copyFrom=function(e){return this._x===e.x&&this._y===e.y||(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},si.prototype.copyTo=function(e){return e.set(this._x,this._y),e},si.prototype.equals=function(e){return e.x===this._x&&e.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(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(si.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0});var ni=si;function si(e,t,i,r){void 0===r&&(r=0),this._x=i=void 0===i?0:i,this._y=r,this.cb=e,this.scope=t}ai.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},ai.prototype.set=function(e,t,i,r,n,s){return this.a=e,this.b=t,this.c=i,this.d=r,this.tx=n,this.ty=s,this},ai.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));t=t||this.array;return e?(t[0]=this.a,t[1]=this.b,t[2]=0,t[3]=this.c,t[4]=this.d,t[5]=0,t[6]=this.tx,t[7]=this.ty):(t[0]=this.a,t[1]=this.c,t[2]=this.tx,t[3]=this.b,t[4]=this.d,t[5]=this.ty,t[6]=0,t[7]=0),t[8]=1,t},ai.prototype.apply=function(e,t){t=t||new ee;var i=e.x,e=e.y;return t.x=this.a*i+this.c*e+this.tx,t.y=this.b*i+this.d*e+this.ty,t},ai.prototype.applyInverse=function(e,t){t=t||new ee;var i=1/(this.a*this.d+this.c*-this.b),r=e.x,e=e.y;return t.x=this.d*i*r+-this.c*i*e+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*e+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,t},ai.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},ai.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},ai.prototype.rotate=function(e){var t=Math.cos(e),e=Math.sin(e),i=this.a,r=this.c,n=this.tx;return this.a=i*t-this.b*e,this.b=i*e+this.b*t,this.c=r*t-this.d*e,this.d=r*e+this.d*t,this.tx=n*t-this.ty*e,this.ty=n*e+this.ty*t,this},ai.prototype.append=function(e){var t=this.a,i=this.b,r=this.c,n=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*n,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*n,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*n+this.ty,this},ai.prototype.setTransform=function(e,t,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=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d),this},ai.prototype.prepend=function(e){var t,i,r=this.tx;return 1===e.a&&0===e.b&&0===e.c&&1===e.d||(t=this.a,i=this.c,this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d),this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this},ai.prototype.decompose=function(e){var t=this.a,i=this.b,r=this.c,n=this.d,s=e.pivot,o=-Math.atan2(-r,n),a=Math.atan2(i,t),l=Math.abs(o+a);return l<1e-5||Math.abs(Ht-l)<1e-5?(e.rotation=a,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=a),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(r*r+n*n),e.position.x=this.tx+(s.x*t+s.y*r),e.position.y=this.ty+(s.x*i+s.y*n),e},ai.prototype.invert=function(){var e=this.a,t=this.b,i=this.c,r=this.d,n=this.tx,s=e*r-t*i;return this.a=r/s,this.b=-t/s,this.c=-i/s,this.d=e/s,this.tx=(i*this.ty-r*n)/s,this.ty=-(e*this.ty-t*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 e=new ai;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},ai.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},ai.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.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(e,t,i,r,n,s){void 0===e&&(e=1),void 0===t&&(t=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=e,this.b=t,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],ui=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],hi=[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]+hi[mi]*ui[gi]),yi=fi(ui[mi]*li[gi]+ci[mi]*ui[gi]),bi=fi(li[mi]*hi[gi]+hi[mi]*ci[gi]),xi=fi(ui[mi]*hi[gi]+ci[mi]*ci[gi]),Ti=0;Ti<16;Ti++)if(li[Ti]===vi&&ui[Ti]===yi&&hi[Ti]===bi&&ci[Ti]===xi){_i.push(Ti);break}}for(mi=0;mi<16;mi++){var wi=new oi;wi.set(li[mi],ui[mi],hi[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(e){return li[e]},uY:function(e){return ui[e]},vX:function(e){return hi[e]},vY:function(e){return ci[e]},inv:function(e){return 8&e?15&e:7&-e},add:function(e,t){return pi[e][t]},sub:function(e,t){return pi[e][Ei.inv(t)]},rotate180:function(e){return 4^e},isVertical:function(e){return 2==(3&e)},byDirection:function(e,t){return 2*Math.abs(e)<=Math.abs(t)?0<=t?Ei.S:Ei.N:2*Math.abs(t)<=Math.abs(e)?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(e){return this.minX>this.maxX||this.minY>this.maxY?w.EMPTY:((e=e||new w(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},Pi.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},Pi.prototype.addPointMatrix=function(e,t){var i=e.a,r=e.b,n=e.c,s=e.d,o=e.tx,e=e.ty,i=i*t.x+n*t.y+o,n=r*t.x+s*t.y+e;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(e){var t=this.minX,i=this.minY,r=this.maxX,n=this.maxY,s=e[0],o=e[1],t=sr?e.maxX:r,this.maxY=e.maxY>n?e.maxY:n},Pi.prototype.addBoundsMask=function(e,t){var i,r,n,s=(e.minX>t.minX?e:t).minX,o=(e.minY>t.minY?e:t).minY,a=(e.maxXt.x?e.minX:t.x,o=e.minY>t.y?e.minY:t.y,a=e.maxXi?this.maxX:i,this.minY=this.minYr?this.maxY:r};var ki=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 Oi=function(e,t){return(Oi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function Ri(e,t){function i(){this.constructor=e}Oi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}Ri(l,Ci=ie),l.mixin=function(e){for(var t=Object.keys(e),i=0;ithis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),(e.parent=this).sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},u.prototype.swapChildren=function(e,t){var i,r;e!==t&&(i=this.getChildIndex(e),r=this.getChildIndex(t),this.children[i]=t,this.children[r]=e,this.onChildrenChange(i=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(e);kt(this.children,i,1),this.children.splice(t,0,e),this.onChildrenChange(t)},u.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},u.prototype.removeChild=function(){for(var e=arguments,t=[],i=0;it.priority){e.connect(i);break}t=(i=t).next}e.previous||e.connect(i)}else e.connect(i);return this._startIfPossible(),this},h.prototype.remove=function(e,t){for(var i=this._head.next;i;)i=i.match(e,t)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(h.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),h.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},h.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},h.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},h.prototype.update=function(e){var t;if((e=void 0===e?performance.now():e)>this.lastTime){if((t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var i=e-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(e,t){var i=this;return t=t||{},(i=yr.call(this,R.ADAPTER.createCanvas())||this)._width=0,i._height=0,i.svg=e,i.scale=t.scale||1,i._overrideWidth=t.width,i._overrideHeight=t.height,i._resolve=null,i._crossorigin=t.crossorigin,i._load=null,!1!==t.autoLoad&&i.load(),i}c(wr,xr=hr),wr.prototype.update=function(e){var t;this.destroyed||(t=Wi.shared.elapsedMS*this.source.playbackRate,this._msToNextUpdate=Math.floor(this._msToNextUpdate-t),(!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 t,i=this;return this._load||(((t=this.source).readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(function(e){i.valid?e(i):(i._resolve=e,t.load())})),this._load},wr.prototype._onError=function(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e)},wr.prototype._isSourcePlaying=function(){var e=this.source;return 0this.baseTexture.width,o=i+n>this.baseTexture.height;if(s||o)throw t="X: "+t+" + "+r+" = "+(t+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: "+t+" "+(s&&o?"and":"or")+" "+i);this.valid=r&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,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 C)),Br(m._EMPTY.baseTexture)),m._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(m,"WHITE",{get:function(){var e,t;return m._WHITE||(t=(e=R.ADAPTER.createCanvas(16,16)).getContext("2d"),e.width=16,e.height=16,t.fillStyle="white",t.fillRect(0,0,16,16),Br(m._WHITE=new m(C.from(e))),Br(m._WHITE.baseTexture)),m._WHITE},enumerable:!1,configurable:!0});var Ur,te=m;function m(e,t,i,r,n,s){var o=Ur.call(this)||this;if(o.noFrame=!1,t||(o.noFrame=!0,t=new w(0,0,1,1)),e instanceof m&&(e=e.baseTexture),o.baseTexture=e,o._frame=t,o.trim=r,o.valid=!1,o._uvs=zr,o.uvMatrix=null,o.orig=i||t,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 ee(s.x,s.y):new ee(0,0),o._updateID=0,o.textureCacheIds=[],e.valid?o.noFrame?e.valid&&o.onBaseTextureUpdated(e):o.frame=t:e.once("loaded",o.onBaseTextureUpdated,o),o.noFrame&&e.on("update",o.onBaseTextureUpdated,o),o}c(Xr,jr=te),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(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),Xr.prototype.resize=function(e,t,i){void 0===i&&(i=!0);var r=this.baseTexture.resolution,e=Math.round(e*r)/r,t=Math.round(t*r)/r;this.valid=0>>0,1=$.ENV.WEBGL2?e.getContext("webgl2",t):i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t)))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 e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},Sn.prototype.handleContextLost=function(e){e.preventDefault()},Sn.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},Sn.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.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(e){var t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext,t=(i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly"),i||!!e.getExtension("OES_element_index_uint"));(this.supports.uint32Indices=t)||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},Sn);function Sn(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}var An=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=$.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},kn=new w,Pn=(On.prototype.contextChange=function(){var t,e,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?(t=this.renderer.context.extensions.drawBuffers,e=this.renderer.context.extensions.depthTexture,R.PREFER_ENV===$.ENV.WEBGL_LEGACY&&(e=t=null),t?i.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,i.drawBuffers=function(){}),e||(this.writeDepthTexture=!1)):this.msaaSamples=i.getInternalformatParameter(i.RENDERBUFFER,i.RGBA8,i.SAMPLES)},On.prototype.bind=function(e,t,i){void 0===i&&(i=0);var r=this.gl;if(e){var n=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,n.mipLevel=i),n.dirtyId!==e.dirtyId&&(n.dirtyId=e.dirtyId,n.dirtyFormat!==e.dirtyFormat?(n.dirtyFormat=e.dirtyFormat,n.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):n.dirtySize!==e.dirtySize&&(n.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var s,o,a=0;a>i,o=t.height>>i,n=s/t.width,this.setViewport(t.x*n,t.y*n,s,o)):(s=e.width>>i,o=e.height>>i,this.setViewport(0,0,s,o))}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},On.prototype.setViewport=function(e,t,i,r){var n=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),r=Math.round(r),n.width===i&&n.height===r&&n.x===e&&n.y===t||(n.x=e,n.y=t,n.width=i,n.height=r,this.gl.viewport(e,t,i,r))},Object.defineProperty(On.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}),On.prototype.clear=function(e,t,i,r,n){void 0===n&&(n=$.BUFFER_BITS.COLOR|$.BUFFER_BITS.DEPTH);var s=this.gl;s.clearColor(e,t,i,r),s.clear(n)},On.prototype.initFramebuffer=function(e){var t=this.gl,t=new An(t.createFramebuffer());return t.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=t,this.managedFramebuffers.push(e),e.disposeRunner.add(this),t},On.prototype.resizeFramebuffer=function(e){var t=this.gl,i=e.glFramebuffers[this.CONTEXT_UID],r=(i.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,i.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,t.RGBA8,e.width,e.height)),i.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,i.stencil),i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height)),e.colorTextures),n=r.length;t.drawBuffers||(n=Math.min(n,1));for(var s=0;s=$.ENV.WEBGL2?e.getContext("webgl2",{}):t)||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),jn=t),jn}function Xn(e,t,i){return"precision"!==e.substring(0,9)?"precision "+(t===$.PRECISION.HIGH&&i!==$.PRECISION.HIGH?$.PRECISION.MEDIUM:t)+" float;\n"+e:i!==$.PRECISION.HIGH&&"precision highp"===e.substring(0,15)?e.replace("precision highp","precision mediump"):e}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(e){return Hn[e]}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(e,t){if(!Wn){var i=Object.keys(Vn);Wn={};for(var r=0;r>=1,i++;this.stateId=e.data}for(i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},Js.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,i=!1,r=0;rthis.maxIdle&&(e.destroyTexture(n,!0),i=!(t[r]=null))}if(i){for(var s=0,r=0;r=e.data.byteLength?i.bufferSubData(e.type,0,e.data):(t=e.static?i.STATIC_DRAW:i.DYNAMIC_DRAW,r.byteLength=e.data.byteLength,i.bufferData(e.type,e.data,t)))},lo.prototype.dispose=function(e,t){var i,r;this.managedBuffers[e.id]&&(delete this.managedBuffers[e.id],i=e._glBuffers[this.CONTEXT_UID],r=this.gl,e.disposeRunner.remove(this),i&&(t||r.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID]))},lo.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),i=0;i=$.MSAA_QUALITY.HIGH?this.multisample=$.MSAA_QUALITY.HIGH:e>=$.MSAA_QUALITY.MEDIUM?this.multisample=$.MSAA_QUALITY.MEDIUM:e>=$.MSAA_QUALITY.LOW?this.multisample=$.MSAA_QUALITY.LOW:this.multisample=$.MSAA_QUALITY.NONE},co.prototype.addSystem=function(e,t){var i,r=new e(this);if(this[t])throw new Error('Whoops! The name "'+t+'" is already in use');for(i in this[t]=r,this.runners)this.runners[i].add(r);return this},co.prototype.render=function(e,t){var i,r,n,s;t&&(s=t instanceof Gr?(Mt("6.0.0","Renderer#render arguments changed, use options instead."),i=t,r=arguments[2],n=arguments[3],arguments[4]):(i=t.renderTexture,r=t.clear,n=t.transform,t.skipUpdateTransform)),this.renderingToScreen=!i,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,this.context.isLost||(i||(this._lastObjectRendered=e),s||(t=e.enableTempParent(),e.updateTransform(),e.disableTempParent(t)),this.renderTexture.bind(i),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),e.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(e,t,i,r){e=uo.prototype.generateTexture.call(this,e,t=void 0===t?{}:t,i,r);return this.framebuffer.blit(),e},co.prototype.resize=function(e,t){uo.prototype.resize.call(this,e,t),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(e){for(var t in this.runners.destroy.emit(),this.runners)this.runners[t].destroy();uo.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(co.prototype,"extract",{get:function(){return Mt("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),co.registerPlugin=function(e,t){Mt("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),ji.add({name:e,type:$.ExtensionType.RendererPlugin,ref:t})},co.__plugins={};var uo,ho=co;function co(e){var t=uo.call(this,$.RENDERER_TYPE.WEBGL,e)||this;return e=t.options,t.gl=null,t.CONTEXT_UID=0,t.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")},t.runners.contextChange.add(t),t.globalUniforms=new cn({projectionMatrix:new oi},!0),t.addSystem(gs,"mask").addSystem(En,"context").addSystem(qs,"state").addSystem(Ws,"shader").addSystem($s,"texture").addSystem(ao,"buffer").addSystem(Cn,"geometry").addSystem(Pn,"framebuffer").addSystem(ws,"scissor").addSystem(As,"stencil").addSystem(Ps,"projection").addSystem(Zs,"textureGC").addSystem(gn,"filter").addSystem(Ms,"renderTexture").addSystem(xn,"batch"),t.initPlugins(co.__plugins),t.multisample=void 0,e.context?t.context.initFromContext(e.context):t.context.initFromOptions({alpha:!!t.useContextAlpha,antialias:e.antialias,premultipliedAlpha:t.useContextAlpha&&"notMultiplied"!==t.useContextAlpha,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:t.options.powerPreference}),t.renderingToScreen=!0,ht(2===t.context.webGLVersion?"WebGL 2":"WebGL 1"),t.resize(t.options.width,t.options.height),t}function po(e){return ho.create(e)}ji.handleByMap($.ExtensionType.RendererPlugin,ho.__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(e){Mt("6.1.0","System class is deprecated, implemement ISystem interface instead."),this.renderer=e}var vo=function(){this.texArray=null,this.blend=0,this.type=$.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null},yo=(bo.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},So.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,t=this.MAX_TEXTURES,i=So._textureArrayPool,r=this.renderer.batch,n=this._tempBoundTextures,s=this.renderer.textureGC.count,o=++C._globalBatch,a=0,l=i[0],u=0;r.copyBoundTextures(n,t);for(var h=0;h=t&&(r.boundArray(l,n,o,t),this.buildDrawCalls(l,u,h),u=h,l=i[++a],++o),c._batchEnabled=o,c.touched=s,l.elements[l.count++]=c)}0 title : "+e.title+"
tabIndex: "+e.tabIndex},zo.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,t=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>t&&(e.height=t-e.y)},zo.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2..toString(),t.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-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(s=0;sa[0]&&t[1]>1||1)+r-1&~(r-1))*(p=(h=h>>1||1)+n-1&~(n-1))*wa[t];return a};var Ra,Ca=Ma;function Ma(e,t){var i=Ra.call(this,e,t)||this;return i.format=t.format,i.levels=t.levels||1,i._width=t.width,i._height=t.height,i._extension=Ma._formatToExtension(i.format),(t.levelBuffers||i.buffer)&&(i._levelBuffers=t.levelBuffers||Ma._createLevelBuffers(e instanceof Uint8Array?e:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}Ia.use=function(i,r){var e=i.data;if(i.type===$.LoaderResource.TYPE.JSON&&e&&e.cacheID&&e.textures){for(var t,n,s=e.textures,o=void 0,a=void 0,l=0,u=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(e){var t=e[0].levelBuffer,i=!1;return s===$.TYPES.FLOAT?t=new Float32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4):s===$.TYPES.UNSIGNED_INT?(i=!0,t=new Uint32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)):s===$.TYPES.INT&&(i=!0,t=new Int32Array(e[0].levelBuffer.buffer,e[0].levelBuffer.byteOffset,e[0].levelBuffer.byteLength/4)),{resource:new tr(t,{width:e[0].levelWidth,height:e[0].levelHeight}),type:s,format:i?function(e){switch(e){case $.FORMATS.RGBA:return $.FORMATS.RGBA_INTEGER;case $.FORMATS.RGB:return $.FORMATS.RGB_INTEGER;case $.FORMATS.RG:return $.FORMATS.RG_INTEGER;case $.FORMATS.RED:return $.FORMATS.RED_INTEGER;default:return e}}(o):o}}),kvData:i}:{compressed:f.map(function(e){return new Ca(null,{format:a,width:l,height:u,levels:p,levelBuffers:e})}),kvData:i}}$.LoaderResource.setExtensionXhrType("dds",$.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);cl.use=function(e,t){if("dds"===e.extension&&e.data)try{Object.assign(e,Da(e.name||e.url,Va(e.data),e.metadata))}catch(e){return void t(e)}t()},cl.extension=$.ExtensionType.Loader;var v=cl;function cl(){}$.LoaderResource.setExtensionXhrType("ktx",$.LoaderResource.XHR_RESPONSE_TYPE.BUFFER);dl.use=function(e,t){if("ktx"===e.extension&&e.data)try{var r,n=e.name||e.url,i=hl(n,e.data,this.loadKeyValueData),s=i.compressed,o=i.uncompressed,a=i.kvData;if(s){var l=Da(n,s,e.metadata);if(a&&l.textures)for(var u in l.textures)l.textures[u].baseTexture.ktxKeyValueData=a;Object.assign(e,l)}else o&&(r={},o.forEach(function(e,t){var e=new te(new C(e.resource,{mipmap:$.MIPMAP_MODES.OFF,alphaMode:$.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,type:e.type,format:e.format})),i=n+"-"+(t+1);a&&(e.baseTexture.ktxKeyValueData=a),C.addToCache(e.baseTexture,i),te.addToCache(e,i),0===t&&(r[n]=e,C.addToCache(e.baseTexture,n),te.addToCache(e,n)),r[i]=e}),Object.assign(e,{textures:r}))}catch(e){return void t(e)}t()},dl.extension=$.ExtensionType.Loader,dl.loadKeyValueData=!1;var pl=dl;function dl(){}var fl=function(e,t){return(fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function ml(e,t){function i(){this.constructor=e}fl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}ml(vl,_l=zi),vl.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},vl.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(vl.prototype,"tint",{get:function(){return this._tint},set:function(e){dt(this._tint=e,this.tintRgb)},enumerable:!1,configurable:!0}),vl.prototype.render=function(e){var t=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 t.onChildrenChange(0)})),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},vl.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.length=o.length&&o.push(this._generateOneMoreBuffer(e)),o[p]),m=(f.uploadDynamic(t,c,d),e._bufferUpdateIDs[p]||0);(h=h||f._updateIDthis.maxSegments&&(e=this.maxSegments),e):t}},Sl=(Al.prototype.clone=function(){var e=new Al;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},Al.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=te.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=te.WHITE,this.matrix=null,this.visible=!1,this.reset()}var kl=function(e,t){return(kl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function Pl(e,t){function i(){this.constructor=e}kl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function Ol(e,t){void 0===t&&(t=!1);var i=e.length;if(!(i<6)){for(var r=0,n=0,s=e[i-2],o=e[i-1];n>0),m=c/f;if(p+=m,a){o.push(e,t),o.push(i,r);for(var _=1,g=p;_>16)+(65280&t)+((255&t)<<16),i);e.length=Math.max(e.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,e.shader.bind(t),e.geometry.bind(i,t),e.state.set(this.state);for(var a=0,l=o.length;a>16)+(65280&r)+((255&r)<<16)}}},b.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var e=this.transform.worldTransform,t=e.a,i=e.b,r=e.c,n=e.d,s=e.tx,o=e.ty,a=this._geometry.points,l=this.vertexData,u=0,h=0;h=i&&pu.x=i&&pu.y>16)+(65280&e)+((255&e)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(_u.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||te.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),_u);function mu(){this.constructor=cu}function _u(e){var t=hu.call(this)||this;return t._anchor=new ni(t._onAnchorUpdate,t,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),t._texture=null,t._width=0,t._height=0,t._tint=null,t._tintRGB=null,t.tint=16777215,t.blendMode=$.BLEND_MODES.NORMAL,t._cachedTint=16777215,t.uvs=null,t.texture=e||te.EMPTY,t.vertexData=new Float32Array(8),t.vertexTrimmedData=null,t._transformID=-1,t._textureID=-1,t._transformTrimmedID=-1,t._textureTrimmedID=-1,t.indices=du,t.pluginName="batch",t.isSprite=!0,t._roundPixels=R.ROUND_PIXELS,t}var gu=function(e,t){return(gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};$.TEXT_GRADIENT=void 0,(Ll=$.TEXT_GRADIENT||($.TEXT_GRADIENT={}))[Ll.LINEAR_VERTICAL=0]="LINEAR_VERTICAL";var vu={align:"left",breakWords:!(Ll[Ll.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"),dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:$.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},yu=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],bu=(x.prototype.clone=function(){var e={};return wu(e,this,vu),new x(e)},x.prototype.reset=function(){wu(this,vu,vu)},Object.defineProperty(x.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){e=Tu(e);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"fill",{get:function(){return this._fill},set:function(e){e=Tu(e);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){!function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return;if(e.length!==t.length)return;for(var i=0;i=i&&nh.x=i&&nh.y>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),wh.prototype.update=function(){var e;this._colorDirty&&(this._colorDirty=!1,e=this.texture.baseTexture,bt(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)),this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)};var xh,Th=wh;function wh(e,t){var i=this,r={uSampler:e,alpha:1,uTextureMatrix:oi.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(t=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},t)).uniforms&&Object.assign(r,t.uniforms),(i=xh.call(this,t.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(e),i.batchable=void 0===t.program,i.pluginName=t.pluginName,i.tint=t.tint,i.alpha=t.alpha,i}dh(Ah,Eh=tn),Object.defineProperty(Ah.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0});var Eh,Sh=Ah;function Ah(e,t,i){var r=Eh.call(this)||this,e=new Kr(e),t=new Kr(t,!0),i=new Kr(i,!0,!0);return r.addAttribute("aVertexPosition",e,2,!1,$.TYPES.FLOAT).addAttribute("aTextureCoord",t,2,!1,$.TYPES.FLOAT).addIndex(i),r._updateId=-1,r}var kh=function(e,t){return(kh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};var Ph=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},Oh=(Rh.test=function(e){return"string"==typeof e&&0===e.indexOf("info face=")},Rh.parse=function(e){var t,i=e.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(t in i){var n,s=i[t].match(/^[a-z]+/gm)[0],o=i[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(n in o){var l=o[n].split("="),u=l[0],l=l[1].replace(/"/gm,""),h=parseFloat(l),l=isNaN(h)?l:h;a[u]=l}r[s].push(a)}var c=new Ph;return r.info.forEach(function(e){return c.info.push({face:e.face,size:parseInt(e.size,10)})}),r.common.forEach(function(e){return c.common.push({lineHeight:parseInt(e.lineHeight,10)})}),r.page.forEach(function(e){return c.page.push({id:parseInt(e.id,10),file:e.file})}),r.char.forEach(function(e){return c.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})}),r.kerning.forEach(function(e){return c.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})}),r.distanceField.forEach(function(e){return c.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})}),c},Rh);function Rh(){}Mh.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},Mh.parse=function(e){for(var t=new Ph,i=e.getElementsByTagName("info"),r=e.getElementsByTagName("common"),n=e.getElementsByTagName("page"),s=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),a=e.getElementsByTagName("distanceField"),l=0;l")&&(e=(new globalThis.DOMParser).parseFromString(e,"text/xml"),Ch.test(e))},Dh.parse=function(e){e=(new globalThis.DOMParser).parseFromString(e,"text/xml");return Ch.parse(e)};var Ih=Dh;function Dh(){}var Lh=[Oh,Ch,Ih];function Fh(e){for(var t=0;tF&&(kt(r,1+c-++z,1+f-c),f=c,c=-1,n.push(p),s.push(06*E)||I.vertices.length<2*yh.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,(e>>8&255)/255,0,0,0,0,0,(255&e)/255,0,0,0,0,0,1,0],t)},E.prototype.greyscale=function(e,t){this._loadMatrix([e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0],t)},E.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},E.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var i=Math.cos(e),e=Math.sin(e),r=(0,Math.sqrt)(1/3);this._loadMatrix([i+1/3*(1-i),1/3*(1-i)-r*e,1/3*(1-i)+r*e,0,0,1/3*(1-i)+r*e,i+1/3*(1-i),1/3*(1-i)-r*e,0,0,1/3*(1-i)-r*e,1/3*(1-i)+r*e,i+1/3*(1-i),0,0,0,0,0,1,0],t)},E.prototype.contrast=function(e,t){var e=(e||0)+1,i=-.5*(e-1);this._loadMatrix([e,0,0,0,i,0,e,0,0,i,0,0,e,0,i,0,0,0,1,0],t)},E.prototype.saturate=function(e,t){var e=2*(e=void 0===e?0:e)/3+1,i=-.5*(e-1);this._loadMatrix([e,i,i,0,0,i,e,i,0,0,i,i,e,0,0,0,0,0,1,0],t)},E.prototype.desaturate=function(){this.saturate(-1)},E.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},E.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},E.prototype.technicolor=function(e){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],e)},E.prototype.polaroid=function(e){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],e)},E.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},E.prototype.kodachrome=function(e){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],e)},E.prototype.browni=function(e){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],e)},E.prototype.vintage=function(e){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],e)},E.prototype.colorTone=function(e,t,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,e=e||.2,0,a,l,r,t=t||.15,0,s-a,o-l,i-r,0,0],n)},E.prototype.night=function(e,t){this._loadMatrix([-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0],t)},E.prototype.predator=function(e,t){this._loadMatrix([11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0],t)},E.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},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(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0});var _c,gc,vc=E;function yc(){this.constructor=gc}function E(){var e=this,t={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(e=_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",t)||this).alpha=1,e}vc.prototype.grayscale=vc.prototype.greyscale;var bc=function(e,t){return(bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};bc(Tc=Sc,wc=xc=Q),Tc.prototype=null===wc?Object.create(wc):(Ec.prototype=wc.prototype,new Ec),Sc.prototype.apply=function(e,t,i,r){this.uniforms.filterMatrix=e.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),e.applyFilter(this,t,i,r)},Object.defineProperty(Sc.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(e){this.uniforms.mapSampler=e},enumerable:!1,configurable:!0});var xc,Tc,wc=Sc;function Ec(){this.constructor=Tc}function Sc(e,t){var i=this,r=new oi;return e.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:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,i.maskMatrix=r,i.scale=new ee(t=null==t?20:t,t),i}var Ac=function(e,t){return(Ac=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};Ac(Pc=Cc,Oc=kc=Q),Pc.prototype=null===Oc?Object.create(Oc):(Rc.prototype=Oc.prototype,new Rc);var kc,Pc,Oc=Cc;function Rc(){this.constructor=Pc}function Cc(){return kc.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 Mc=function(e,t){return(Mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};Mc(Dc=Nc,Lc=Ic=Q),Dc.prototype=null===Lc?Object.create(Lc):(Fc.prototype=Lc.prototype,new Fc),Object.defineProperty(Nc.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(Nc.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0});var Ic,Dc,Lc=Nc;function Fc(){this.constructor=Dc}function Nc(e,t){void 0===e&&(e=.5),void 0===t&&(t=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=e,i.seed=t,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=k=k||{})[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=k.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(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&((this._cacheAsBitmap=e)?(this._cacheData||(this._cacheData=new Yc),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),i.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},i.prototype._initCachedDisplayObject=function(e){var t,i,r,n,s,o,a,l;this._cacheData&&this._cacheData.sprite||(t=this.alpha,this.alpha=1,e.batch.flush(),i=this.getLocalBounds(null,!0).clone(),this.filters&&this.filters.length&&(r=this.filters[0].padding,i.pad(r)),i.ceil(R.RESOLUTION),r=e.renderTexture.current,n=e.renderTexture.sourceFrame.clone(),s=e.renderTexture.destinationFrame.clone(),o=e.projection.transform,a=Gr.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:null!=(a=this.cacheAsBitmapMultisample)?a:e.multisample}),l="cacheAsBitmap_"+ ++Ot,this._cacheData.textureCacheId=l,C.addToCache(a.baseTexture,l),te.addToCache(a,l),l=this.transform.localTransform.copyTo(Hc).invert().translate(-i.x,-i.y),this.render=this._cacheData.originalRender,e.render(this,{renderTexture:a,clear:!0,transform:l,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=o,e.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=t,(l=new fu(a)).transform.worldTransform=this.transform.worldTransform,l.anchor.x=-(i.x/i.width),l.anchor.y=-(i.y/i.height),l.alpha=t,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(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},i.prototype._initCachedDisplayObjectCanvas=function(e){var t,i,r,n,s,o;this._cacheData&&this._cacheData.sprite||(t=this.getLocalBounds(null,!0),i=this.alpha,this.alpha=1,r=e.context,n=e._projTransform,t.ceil(R.RESOLUTION),s=Gr.create({width:t.width,height:t.height}),o="cacheAsBitmap_"+ ++Ot,this._cacheData.textureCacheId=o,C.addToCache(s.baseTexture,o),te.addToCache(s,o),this.transform.localTransform.copyTo(o=Hc),o.invert(),o.tx-=t.x,o.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:s,clear:!0,transform:o,skipUpdateTransform:!1}),e.context=r,e._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 fu(s)).transform.worldTransform=this.transform.worldTransform,o.anchor.x=-(t.x/t.width),o.anchor.y=-(t.y/t.height),o.alpha=i,o._bounds=this._bounds,this._cacheData.sprite=o,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._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,C.removeFromCache(this._cacheData.textureCacheId),te.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},i.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},i.prototype.name=null,zi.prototype.getChildByName=function(e,t){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(e){throw RangeError(p[e])}function f(e,t){for(var i=e.length,r=[];i--;)r[i]=t(e[i]);return r}function m(e,t){var i=e.split("@"),r="",i=(1>>10&1023|55296),e=56320|1023&e),t+=b(e)}).join("")}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,i){var r=0;for(e=i?y(e/l):e>>1,e+=y(e/t);d*v>>1y((_-h)/s))&&x("overflow"),h+=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(h-n,t=l.length+1,0==n),y(h/t)>_-c&&x("overflow"),c+=y(h/t),h%=t,l.splice(h++,0,c)}return w(l)}function k(e){for(var t,i,r,n,s,o,a,l,u,h,c=[],p=(e=T(e)).length,d=128,f=72,m=t=0;my((_-t)/(l=i+1))&&x("overflow"),t+=(n-d)*l,d=n,m=0;m_&&x("overflow"),a==d){for(s=t,o=g;!(s<(u=o<=f?1:f+v<=o?v:o-f));o+=g)c.push(b(E(u+(h=s-u)%(u=g-u),0))),s=y(h/u);c.push(b(E(s,0))),f=S(t,l,i==r),t=0,++i}++t,++d}return c.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:w},decode:A,encode:k,toASCII:function(e){return m(e,function(e){return h.test(e)?"xn--"+k(e):e})},toUnicode:function(e){return m(e,function(e){return u.test(e)?A(e.slice(4).toLowerCase()):e})}},r&&t)if(e.exports==r)t.exports=s;else for(o in s)s.hasOwnProperty(o)&&(r[o]=s[o]);else i.punycode=s});function d0(e,t,i,r){t=t||"&",i=i||"=";var n={};if("string"==typeof e&&0!==e.length){var s=/\+/g,t=(e=e.split(t),1e3),o=(r&&"number"==typeof r.maxKeys&&(t=r.maxKeys),e.length);0e?1:this._width/e,t=this._topHeight+this._bottomHeight,t=this._height>t?1:this._height/t;return Math.min(e,t)},Object.defineProperty(B0.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(B0.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),B0.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data,e=(this._origWidth=e.orig.width,this._origHeight=e.orig.height,1/this._origWidth),i=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=e*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-e*this._rightWidth,t[9]=t[11]=t[13]=t[15]=i*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()};var z0,r0=B0;function B0(e,t,i,r,n){void 0===t&&(t=10),void 0===i&&(i=10),void 0===r&&(r=10),void 0===n&&(n=10);var s=z0.call(this,te.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=t,s._rightWidth=r,s._topHeight=i,s._bottomHeight=n,s.texture=e,s}var U0=function(e,t){return(U0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};U0(G0=H0,n0=j0=fu),G0.prototype=null===n0?Object.create(n0):(X0.prototype=n0.prototype,new X0),H0.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Wi.shared.remove(this.update,this),this._isConnectedToTicker=!1))},H0.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Wi.shared.add(this.update,this,$.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))},H0.prototype.gotoAndStop=function(e){this.stop();var t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this.updateTexture()},H0.prototype.gotoAndPlay=function(e){var t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this.updateTexture(),this.play()},H0.prototype.update=function(e){if(this._playing){var t=this.animationSpeed*e,i=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=t/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var n=Math.sign(this.animationSpeed*e);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+=t;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())}},H0.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],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))},H0.prototype.destroy=function(e){this.stop(),j0.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},H0.fromFrames=function(e){for(var t=[],i=0;i 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,i){return i||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,i,r){return r&&r.length?((r=r.splice?r:Array.prototype.slice.call(r)).splice(0,0,i),e["dynCall_"+t].apply(null,r)):e["dynCall_"+t].call(null,i)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*(t>>>0):(e>>>0)+4294967296*(0|t)},Ua:8,J:4,vd:0},na=(e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb,!1),oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(c){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,i){switch(i="*"===(i=i||"i8").charAt(i.length-1)?"i32":i){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,1<=+xa(oa=t)?0>>0:~~+Aa((oa-(~~oa>>>0))/4294967296)>>>0:0],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+i)}}function Da(e,t){switch(t="*"===(t=t||"i8").charAt(t.length-1)?"i32":t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,i,r){var s,o,a,l="number"==typeof e?(s=!0,e):(s=!1,e.length),u="string"==typeof t?t:null;if(i=4==i?r:[Ea,n.aa,n.Ra,n.R][void 0===i?2:i](Math.max(l,u?1:t.length)),s){for(assert(0==(3&(r=i))),e=i+(-4&l);r>2]=0;for(e=i+l;r>0]=0}else if("i8"===u)e.subarray||e.slice?E.set(e,i):E.set(new Uint8Array(e),i);else{r=0;for(;r>0],0!=r||i)&&(s++,!i||s!=i););if(i=i||s,r="",n<128){for(;0>10,56320|1023&i)))):a+=String.fromCharCode(i)}}function Ka(e,t,i,r){if(!(0>6}else{if(o<=65535){if(r<=i+2)break;t[i++]=224|o>>12}else{if(o<=2097151){if(r<=i+3)break;t[i++]=240|o>>18}else{if(o<=67108863){if(r<=i+4)break;t[i++]=248|o>>24}else{if(r<=i+5)break;t[i++]=252|o>>30,t[i++]=128|o>>24&63}t[i++]=128|o>>18&63}t[i++]=128|o>>12&63}t[i++]=128|o>>6&63}t[i++]=128|63&o}}return t[i]=0,i-n}function La(e){for(var t=0,i=0;i"):s=n;e:for(;c>0];if(!i)return t;t+=String.fromCharCode(i)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,i){return Ka(e,E,t,i)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,i="";;){var r=z[e+2*t>>1];if(0==r)return i;++t,i+=String.fromCharCode(r)}},e.stringToUTF16=function(e,t,i){if((i=void 0===i?2147483647:i)<2)return 0;var r=t;i=(i-=2)<2*e.length?i/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-r},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,i="";;){var r=C[e+4*t>>2];if(0==r)return i;++t,65536<=r?(r-=65536,i+=String.fromCharCode(55296|r>>10,56320|1023&r)):i+=String.fromCharCode(r)}},e.stringToUTF32=function(e,t,i){if((i=void 0===i?2147483647:i)<4)return 0;var r=t;i=r+i-4;for(var n=0;n>2]=s,i<(t+=4)+4)break}return C[t>>2]=0,t-r},e.lengthBytesUTF32=function(e){for(var t=0,i=0;i>0]=e[i],i+=1}function ta(e,t){for(var i=0;i>0]=e[i]}function Ia(e,t,i){for(var r=0;r>0]=e.charCodeAt(r);i||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],i=0;i>>16)*r+i*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){var t;I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)&&(t=jb,jb=null,t())}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var i=0,r=e.length-1;0<=r;r--){var n=e[r];"."===n?e.splice(r,1):".."===n?(e.splice(r,1),i++):i&&(e.splice(r,1),i--)}if(t)for(;i--;)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),i="/"===e.substr(-1);return(e=(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t?e:".")&&i&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?e+(t=t&&t.substr(0,t.length-1)):"."}function Bb(e){var t;return"/"===e?"/":-1===(t=e.lastIndexOf("/"))?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,i=arguments.length-1;-1<=i&&!t;i--){if("string"!=typeof(t=0<=i?arguments[i]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,i,r){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n,s=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var i=e.e?e.e.buffer.byteLength:0;t<=i||(t=Math.max(t,i*(i<1048576?2:1.125)|0),0!=i&&(t=Math.max(t,256)),i=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,r))),8>1)}catch(e){if(e.code)throw new L(J[e.code]);throw e}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(e.code)throw new L(J[e.code]);throw e}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var i=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(i,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(i,t.size)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},lookup:function(e,t){var i=K(P.B(e),t),i=P.Ja(i);return P.createNode(e,t,i)},T:function(e,t,i,r){e=P.createNode(e,t,i,r),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(e.code)throw new L(J[e.code]);throw e}return e},rename:function(e,t,i){e=P.B(e),t=K(P.B(t),i);try{fs.renameSync(e,t)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},unlink:function(e,t){e=K(P.B(e),t);try{fs.unlinkSync(e)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},rmdir:function(e,t){e=K(P.B(e),t);try{fs.rmdirSync(e)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},symlink:function(e,t,i){e=K(P.B(e),t);try{fs.symlinkSync(i,e)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(e.code)throw new L(J[e.code]);throw e}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(e.code)throw new L(J[e.code]);throw e}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(e.code)throw new L(J[e.code]);throw e}},read:function(e,t,i,r,n){if(0===r)return 0;var s,o=new Buffer(r);try{s=fs.readSync(e.V,o,0,r,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var i;if(i=(i=Yb(e,"x"))?i:e.k.lookup?0:J.da)throw new L(i,e);for(i=Q[Wb(e.id,t)];i;i=i.M){var r=i.name;if(i.parent.id===e.id&&r===t)return i}return e.k.lookup(e,t)}function Lb(e,t,i,r){return Zb||((Zb=function(e,t,i,r){this.parent=e=e||this,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=i,this.k={},this.n={},this.rdev=r}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,i,r)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,i=new dc;for(t in e)i[t]=e[t];return e=i,i=bc(),e.fd=i,Rb[i]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var i,r="/"===t,n=!t;if(r&&Pb)throw new L(J.fa);if(!r&&!n){if(t=(i=S(t,{Ia:!1})).path,(i=i.g).U)throw new L(J.fa);if(!N(i.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]},t=e.A(n);(t.A=n).root=t,r?Pb=t:i&&(i.U=n,i.A&&i.A.lb.push(n))}function fc(e,t,i){var r=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(r,e);if(n)throw new L(n);if(r.k.T)return r.k.T(r,e,t,i);throw new L(J.I)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,i){return void 0===i&&(i=t,t=438),fc(e,8192|t,i)}function ic(e,t){if(!Db(e))throw new L(J.F);var i=S(t,{parent:!0}).g;if(!i)throw new L(J.F);var t=Bb(t),r=ac(i,t);if(r)throw new L(r);if(i.k.symlink)return i.k.symlink(i,t,e);throw new L(J.I)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(e.k.readlink)return Db(T(e.parent),e.k.readlink(e));throw new L(J.q)}function jc(e,t){e="string"==typeof e?S(e,{la:!0}).g:e;if(!e.k.u)throw new L(J.I);e.k.u(e,{mode:4095&t|-4096&e.mode,timestamp:Date.now()})}function kc(t,i){var r,n;if(""===t)throw new L(J.F);if("string"==typeof i){if(void 0===(r=$b[i]))throw Error("Unknown file open mode: "+i)}else r=i;if(s=64&(i=r)?4095&(void 0===s?438:s)|32768:0,"object"==typeof t)n=t;else{t=zb(t);try{n=S(t,{la:!(131072&i)}).g}catch(e){}}if(r=!1,64&i)if(n){if(128&i)throw new L(J.wa)}else n=fc(t,s,0),r=!0;if(!n)throw new L(J.F);if(8192==(61440&n.mode)&&(i&=-513),65536&i&&!N(n.mode))throw new L(J.ya);if(!r&&(s=n?40960==(61440&n.mode)?J.ga:N(n.mode)&&(0!=(2097155&i)||512&i)?J.P:(s=["r","w","rw"][3&i],512&i&&(s+="w"),Yb(n,s)):J.F))throw new L(s);if(512&i){var s,o="string"==typeof(s=n)?S(s,{la:!0}).g:s;if(!o.k.u)throw new L(J.I);if(N(o.mode))throw new L(J.P);if(32768!=(61440&o.mode))throw new L(J.q);if(s=Yb(o,"w"))throw new L(s);o.k.u(o,{size:0,timestamp:Date.now()})}i&=-641,(n=cc({g:n,path:T(n),flags:i,seekable:!0,position:0,n:n.n,tb:[],error:!1})).n.open&&n.n.open(n),!e.logReadFiles||1&i||(t in(lc=lc||{})||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(o=0,1!=(2097155&i)&&(o|=1),0!=(2097155&i)&&(o|=2),R.onOpenFile(t,o))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return n}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,i){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,i),e.tb=[]}function oc(e,t,i,r,n,s){if(r<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var o=!0;if(void 0===n)n=e.position,o=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,i,r,n,s),o||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var i=0;return e&&(i|=365),t&&(i|=146),i}function sc(e,t,i,r){return gc(e=K("string"==typeof e?e:T(e),t),rc(i,r))}function tc(e,t,i,r,n,s){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,r=rc(r,n)),i){if("string"==typeof i){e=Array(i.length),t=0;for(var o=i.length;t>2]}function xc(){var e=X();if(e=Rb[e])return e;throw new L(J.ea)}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){var i;return Dc=e,Ec=t,Fc?(0==e?(Y=function(){setTimeout(Gc,t)},Hc="timeout"):1==e?(Y=function(){Ic(Gc)},Hc="rAF"):2==e&&(window.setImmediate||(i=[],window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),i.shift()())},!0),window.setImmediate=function(e){i.push(e),window.postMessage("__emcc","*")}),Y=function(){window.setImmediate(Gc)},Hc="immediate"),0):1}function Jc(o,t,i,a,r){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=o,Kc=a;var l=Lc;if(Gc=function(){var t,i,r,s;na||(0>i-6&63,i=i-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n];2==i?e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4]+"==":4==i&&(e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2]+"="),u.src="data:audio/x-"+o.substr(-3)+";base64,"+e,a(u)}},u.src=n,ad(function(){a(u)})}});var i=e.canvas;i&&(i.sa=i.requestPointerLock||i.mozRequestPointerLock||i.webkitRequestPointerLock||i.msRequestPointerLock||function(){},i.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},i.Fa=i.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&i.addEventListener("click",function(e){!Tc&&i.sa&&(i.sa(),e.preventDefault())},!1))}}function bd(t,i,r,n){if(i&&e.ka&&t==e.canvas)return e.ka;var s,o;if(i){if(o={antialias:!1,alpha:!1},n)for(var a in n)o[a]=n[a];(o=GL.createContext(t,o))&&(s=GL.getContext(o).td),t.style.backgroundColor="black"}else s=t.getContext("2d");return s?(r&&(i||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=s,i&&GL.Od(o),e.Td=i,Uc.forEach(function(e){e()}),Vc()),s):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,i,r){function n(){Sc=!1;var t=s.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(s.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},s.Da=s.Da.bind(document),dd&&s.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(s,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(s)}void 0===(dd=t)&&(dd=!0),void 0===(ed=i)&&(ed=!1),void 0===(jd=r)&&(jd=null);var s=e.canvas,o=(cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1)),document.createElement("div"));s.parentNode.insertBefore(o,s),o.appendChild(s),o.p=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?o.p({Ud:r}):o.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,i){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)}function nd(t,i,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),i(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd,fs,Ob;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){var e;"undefined"!=typeof SDL&&(e=Sa[SDL.screen+0*n.J>>2],C[SDL.screen+0*n.J>>2]=8388608|e),pd()}function hd(){var e;"undefined"!=typeof SDL&&(e=Sa[SDL.screen+0*n.J>>2],C[SDL.screen+0*n.J>>2]=-8388609&e),pd()}function id(t,i,r){i&&r?(t.ub=i,t.hb=r):(i=t.ub,r=t.hb);var n,s=i,o=r;e.forcedAspectRatio&&0this.length-1||e<0))return t=e%this.chunkSize,this.gb(e/this.chunkSize|0)[t]},o.prototype.pb=function(e){this.gb=e},o.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",l,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+l+". Status: "+e.status);var s=Number(e.getResponseHeader("Content-length")),o=1048576,a=((e=e.getResponseHeader("Accept-Ranges"))&&"bytes"===e||(o=s),this);a.pb(function(e){var t=e*o,i=(e+1)*o-1,i=Math.min(i,s-1);if(void 0===a.Y[e]){var r=a.Y;if(i=(e=e.g.e).length)return 0;if(assert(0<=(r=Math.min(e.length-n,r))),e.slice)for(var s=0;s>2]=0):-J.Q;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(i=X(),r.n.ib)return r.n.ib(r,n,i);throw new L(J.Q);default:x("bad ioctl syscall "+n)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){tb.p--,ub.push(e);e:{if(e&&!vb[e])for(var t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,i){return E.set(E.subarray(t,t+i),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var i=xc(),r=X(),n=X(),s=X(),o=X();return assert(0===r),nc(i,n,o),C[s>>2]=i.position,i.na&&0===n&&0===o&&(i.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var i,r=xc(),n=X();e:{for(var s=X(),o=0,a=0;a>2],C[n+(8*a+4)>>2],void 0);if(l<0){i=-1;break e}o+=l}i=o}return i}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd},function(e,t,i){"use asm";var r=e.Int8Array;var n=e.Int16Array;var s=e.Int32Array;var a=e.Uint8Array;var u=e.Uint16Array;var h=e.Uint32Array;var c=e.Float32Array;var p=e.Float64Array;var de=new r(i);var $=new n(i);var fe=new s(i);var me=new a(i);var _e=new u(i);var d=new h(i);var f=new c(i);var ee=new p(i);var y=e.byteLength;var ge=t.STACKTOP|0;var x=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var T=t.ABORT|0;var w=t.cttz_i8|0;var E=0;var S=0;var A=0;var k=0;var P=e.NaN,O=e.Infinity;var R=0,C=0,M=0,I=0,D=0.0,L=0,H=0,Y=0,W=0.0;var ie=0;var V=0;var q=0;var K=0;var Z=0;var J=0;var Q=0;var le=0;var ue=0;var he=0;var ce=e.Math.floor;var pe=e.Math.abs;var Te=e.Math.sqrt;var we=e.Math.pow;var Ee=e.Math.cos;var Se=e.Math.sin;var Ae=e.Math.tan;var ke=e.Math.acos;var Pe=e.Math.asin;var Oe=e.Math.atan;var Re=e.Math.atan2;var Ce=e.Math.exp;var Me=e.Math.log;var Ie=e.Math.ceil;var ve=e.Math.imul;var De=e.Math.min;var m=e.Math.clz32;var o=t.abort;var Le=t.assert;var Fe=t.invoke_iiii;var Ne=t.invoke_viiiii;var ze=t.invoke_vi;var Be=t.invoke_ii;var Ue=t.invoke_viii;var je=t.invoke_v;var Ge=t.invoke_viiiiii;var Xe=t.invoke_iiiiii;var He=t.invoke_viiii;var Ye=t._pthread_cleanup_pop;var We=t.___syscall54;var Ve=t.___syscall6;var qe=t._emscripten_set_main_loop_timing;var Ke=t.__ZSt18uncaught_exceptionv;var Ze=t.___setErrNo;var z=t._sbrk;var Je=t.___cxa_begin_catch;var Qe=t._emscripten_memcpy_big;var $e=t._sysconf;var et=t._pthread_getspecific;var tt=t._pthread_self;var it=t._pthread_once;var rt=t._pthread_key_create;var nt=t.___unlock;var st=t._emscripten_set_main_loop;var ot=t._pthread_setspecific;var at=t.___lock;var B=t._abort;var lt=t._pthread_cleanup_push;var ut=t._time;var ht=t.___syscall140;var ct=t.___syscall146;var pt=0.0;function dt(e){if(y(e)&16777215||y(e)<=16777215||y(e)>2147483648)return false;de=new r(e);$=new n(e);fe=new s(e);me=new a(e);_e=new u(e);d=new h(e);f=new c(e);ee=new p(e);i=e;return true}function ft(e){e=e|0;var t=0;t=ge;ge=ge+e|0;ge=ge+15&-16;return t|0}function mt(){return ge|0}function _t(e){e=e|0;ge=e}function gt(e,t){e=e|0;t=t|0;ge=e;x=t}function vt(e,t){e=e|0;t=t|0;if(!E){E=e;S=t}}function yt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function bt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function xt(e){e=e|0;ie=e}function Tt(){return ie|0}function F(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0;m=ge;ge=ge+608|0;p=m+88|0;c=m+72|0;l=m+64|0;a=m+48|0;o=m+24|0;s=m;h=m+96|0;d=m+92|0;u=e+4|0;f=e+8|0;if((fe[u>>2]|0)>>>0>(fe[f>>2]|0)>>>0){fe[s>>2]=1154;fe[s+4>>2]=2120;fe[s+8>>2]=1133;xe(h,1100,s)|0;be(h,m+16|0)|0}if((2147418112/(r>>>0)|0)>>>0<=t>>>0){fe[o>>2]=1154;fe[o+4>>2]=2121;fe[o+8>>2]=1169;xe(h,1100,o)|0;be(h,m+40|0)|0}o=fe[f>>2]|0;if(o>>>0>=t>>>0){f=1;ge=m;return f|0}do{if(i){if(t){s=t+-1|0;if(!(s&t)){s=11;break}else t=s}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;s=10}else s=10}while(0);if((s|0)==10)if(!t){t=0;s=12}else s=11;if((s|0)==11)if(t>>>0<=o>>>0)s=12;if((s|0)==12){fe[a>>2]=1154;fe[a+4>>2]=2130;fe[a+8>>2]=1217;xe(h,1100,a)|0;be(h,l)|0}i=ve(t,r)|0;do{if(!n){s=wt(fe[e>>2]|0,i,d,1)|0;if(!s){f=0;ge=m;return f|0}else{fe[e>>2]=s;break}}else{o=U(i,d)|0;if(!o){f=0;ge=m;return f|0}Cr[n&0](o,fe[e>>2]|0,fe[u>>2]|0);s=fe[e>>2]|0;do{if(s)if(!(s&7)){X[fe[104>>2]&1](s,0,0,1,fe[27]|0)|0;break}else{fe[c>>2]=1154;fe[c+4>>2]=2499;fe[c+8>>2]=1516;xe(h,1100,c)|0;be(h,p)|0;break}}while(0);fe[e>>2]=o}}while(0);s=fe[d>>2]|0;if(s>>>0>i>>>0)t=(s>>>0)/(r>>>0)|0;fe[f>>2]=t;f=1;ge=m;return f|0}function wt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0,o=0,a=0,l=0,u=0;u=ge;ge=ge+592|0;l=u+48|0;s=u+24|0;n=u;a=u+72|0;o=u+68|0;if(e&7){fe[n>>2]=1154;fe[n+4>>2]=2499;fe[n+8>>2]=1494;xe(a,1100,n)|0;be(a,u+16|0)|0;l=0;ge=u;return l|0}if(t>>>0>2147418112){fe[s>>2]=1154;fe[s+4>>2]=2499;fe[s+8>>2]=1387;xe(a,1100,s)|0;be(a,u+40|0)|0;l=0;ge=u;return l|0}fe[o>>2]=t;r=X[fe[104>>2]&1](e,t,o,r,fe[27]|0)|0;if(i)fe[i>>2]=fe[o>>2];if(!(r&7)){l=r;ge=u;return l|0}fe[l>>2]=1154;fe[l+4>>2]=2551;fe[l+8>>2]=1440;xe(a,1100,l)|0;be(a,u+64|0)|0;l=r;ge=u;return l|0}function U(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0;l=ge;ge=ge+592|0;o=l+48|0;a=l+24|0;i=l;s=l+72|0;n=l+68|0;r=e+3&-4;r=(r|0)!=0?r:4;if(r>>>0>2147418112){fe[i>>2]=1154;fe[i+4>>2]=2499;fe[i+8>>2]=1387;xe(s,1100,i)|0;be(s,l+16|0)|0;a=0;ge=l;return a|0}fe[n>>2]=r;i=X[fe[104>>2]&1](0,r,n,1,fe[27]|0)|0;e=fe[n>>2]|0;if(t)fe[t>>2]=e;if((i|0)==0|e>>>0>>0){fe[a>>2]=1154;fe[a+4>>2]=2499;fe[a+8>>2]=1413;xe(s,1100,a)|0;be(s,l+40|0)|0;a=0;ge=l;return a|0}if(!(i&7)){a=i;ge=l;return a|0}fe[o>>2]=1154;fe[o+4>>2]=2526;fe[o+8>>2]=1440;xe(s,1100,o)|0;be(s,l+64|0)|0;a=i;ge=l;return a|0}function Et(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0,b=0,x=0,T=0,w=0,E=0,S=0,A=0,k=0,P=0,O=0,R=0,F=0,C=0,N=0,M=0,z=0,I=0,D=0,L=0;L=ge;ge=ge+960|0;z=L+232|0;M=L+216|0;N=L+208|0;C=L+192|0;F=L+184|0;R=L+168|0;O=L+160|0;P=L+144|0;S=L+136|0;E=L+120|0;w=L+112|0;T=L+96|0;y=L+88|0;v=L+72|0;g=L+64|0;_=L+48|0;c=L+40|0;d=L+24|0;p=L+16|0;h=L;k=L+440|0;I=L+376|0;D=L+304|0;m=L+236|0;if((t|0)==0|r>>>0>11){e=0;ge=L;return e|0}fe[e>>2]=t;n=D;s=n+68|0;do{fe[n>>2]=0;n=n+4|0}while((n|0)<(s|0));s=0;do{n=de[i+s>>0]|0;if(n<<24>>24){A=D+((n&255)<<2)|0;fe[A>>2]=(fe[A>>2]|0)+1}s=s+1|0}while((s|0)!=(t|0));s=0;u=1;o=0;a=-1;l=0;while(1){n=fe[D+(u<<2)>>2]|0;if(!n)fe[e+28+(u+-1<<2)>>2]=0;else{A=u+-1|0;fe[I+(A<<2)>>2]=s;s=n+s|0;x=16-u|0;fe[e+28+(A<<2)>>2]=(s+-1<>2]=l;fe[m+(u<<2)>>2]=l;o=o>>>0>u>>>0?o:u;a=a>>>0
>>0?a:u;l=n+l|0}u=u+1|0;if((u|0)==17){A=o;break}else s=s<<1}fe[e+4>>2]=l;s=e+172|0;do{if(l>>>0>(fe[s>>2]|0)>>>0){fe[s>>2]=l;if(l){n=l+-1|0;if(n&l)f=14}else{n=-1;f=14}if((f|0)==14){x=n>>>16|n;x=x>>>8|x;x=x>>>4|x;x=x>>>2|x;x=(x>>>1|x)+1|0;fe[s>>2]=x>>>0>t>>>0?t:x}o=e+176|0;n=fe[o>>2]|0;do{if(n){x=fe[n+-4>>2]|0;n=n+-8|0;if(!((x|0)!=0?(x|0)==(~fe[n>>2]|0):0)){fe[h>>2]=1154;fe[h+4>>2]=644;fe[h+8>>2]=1863;xe(k,1100,h)|0;be(k,p)|0}if(!(n&7)){X[fe[104>>2]&1](n,0,0,1,fe[27]|0)|0;break}else{fe[d>>2]=1154;fe[d+4>>2]=2499;fe[d+8>>2]=1516;xe(k,1100,d)|0;be(k,c)|0;break}}}while(0);s=fe[s>>2]|0;s=(s|0)!=0?s:1;n=U((s<<1)+8|0,0)|0;if(!n){fe[o>>2]=0;n=0;break}else{fe[n+4>>2]=s;fe[n>>2]=~s;fe[o>>2]=n+8;f=25;break}}else f=25}while(0);e:do{if((f|0)==25){x=e+24|0;de[x>>0]=a;de[e+25>>0]=A;s=e+176|0;o=0;do{b=de[i+o>>0]|0;n=b&255;if(b<<24>>24){if(!(fe[D+(n<<2)>>2]|0)){fe[_>>2]=1154;fe[_+4>>2]=2273;fe[_+8>>2]=1261;xe(k,1100,_)|0;be(k,g)|0}b=m+(n<<2)|0;n=fe[b>>2]|0;fe[b>>2]=n+1;if(n>>>0>=l>>>0){fe[v>>2]=1154;fe[v+4>>2]=2277;fe[v+8>>2]=1274;xe(k,1100,v)|0;be(k,y)|0}$[(fe[s>>2]|0)+(n<<1)>>1]=o}o=o+1|0}while((o|0)!=(t|0));n=de[x>>0]|0;y=(n&255)>>>0>>0?r:0;b=e+8|0;fe[b>>2]=y;v=(y|0)!=0;if(v){g=1<>>0>(fe[n>>2]|0)>>>0){fe[n>>2]=g;o=e+168|0;n=fe[o>>2]|0;do{if(n){_=fe[n+-4>>2]|0;n=n+-8|0;if(!((_|0)!=0?(_|0)==(~fe[n>>2]|0):0)){fe[T>>2]=1154;fe[T+4>>2]=644;fe[T+8>>2]=1863;xe(k,1100,T)|0;be(k,w)|0}if(!(n&7)){X[fe[104>>2]&1](n,0,0,1,fe[27]|0)|0;break}else{fe[E>>2]=1154;fe[E+4>>2]=2499;fe[E+8>>2]=1516;xe(k,1100,E)|0;be(k,S)|0;break}}}while(0);n=g<<2;s=U(n+8|0,0)|0;if(!s){fe[o>>2]=0;n=0;break e}else{S=s+8|0;fe[s+4>>2]=g;fe[s>>2]=~g;fe[o>>2]=S;s=S;break}}else{s=e+168|0;n=g<<2;o=s;s=fe[s>>2]|0}}while(0);G(s|0,-1,n|0)|0;f=e+176|0;_=1;do{if(fe[D+(_<<2)>>2]|0){t=y-_|0;m=1<>2]|0;if(s>>>0>=16){fe[P>>2]=1154;fe[P+4>>2]=1953;fe[P+8>>2]=1737;xe(k,1100,P)|0;be(k,O)|0}n=fe[e+28+(s<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-_|0);if(a>>>0<=d>>>0){c=(fe[e+96+(s<<2)>>2]|0)-a|0;p=_<<16;do{n=_e[(fe[f>>2]|0)+(c+a<<1)>>1]|0;if((me[i+n>>0]|0|0)!=(_|0)){fe[R>>2]=1154;fe[R+4>>2]=2319;fe[R+8>>2]=1303;xe(k,1100,R)|0;be(k,F)|0}h=a<>>0>=g>>>0){fe[C>>2]=1154;fe[C+4>>2]=2325;fe[C+8>>2]=1337;xe(k,1100,C)|0;be(k,N)|0}n=fe[o>>2]|0;if((fe[n+(l<<2)>>2]|0)!=-1){fe[M>>2]=1154;fe[M+4>>2]=2327;fe[M+8>>2]=1360;xe(k,1100,M)|0;be(k,z)|0;n=fe[o>>2]|0}fe[n+(l<<2)>>2]=s;u=u+1|0}while(u>>>0>>0);a=a+1|0}while(a>>>0<=d>>>0)}}_=_+1|0}while(y>>>0>=_>>>0);n=de[x>>0]|0}s=e+96|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I>>2]|0);s=e+100|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+4>>2]|0);s=e+104|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+8>>2]|0);s=e+108|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+12>>2]|0);s=e+112|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+16>>2]|0);s=e+116|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+20>>2]|0);s=e+120|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+24>>2]|0);s=e+124|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+28>>2]|0);s=e+128|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+32>>2]|0);s=e+132|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+36>>2]|0);s=e+136|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+40>>2]|0);s=e+140|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+44>>2]|0);s=e+144|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+48>>2]|0);s=e+148|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+52>>2]|0);s=e+152|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+56>>2]|0);s=e+156|0;fe[s>>2]=(fe[s>>2]|0)-(fe[I+60>>2]|0);s=e+16|0;fe[s>>2]=0;o=e+20|0;fe[o>>2]=n&255;t:do{if(v){while(1){if(!r)break t;n=r+-1|0;if(!(fe[D+(r<<2)>>2]|0))r=n;else break}fe[s>>2]=fe[e+28+(n<<2)>>2];n=y+1|0;fe[o>>2]=n;if(n>>>0<=A>>>0){while(1){if(fe[D+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>A>>>0)break t}fe[o>>2]=n}}}while(0);fe[e+92>>2]=-1;fe[e+160>>2]=1048575;fe[e+12>>2]=32-(fe[b>>2]|0);n=1}}while(0);e=n;ge=L;return e|0}function St(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0;if(!e){n=Yi(t)|0;if(!i){i=n;return i|0}if(!n)s=0;else s=Vi(n)|0;fe[i>>2]=s;i=n;return i|0}if(!t){b(e);if(!i){i=0;return i|0}fe[i>>2]=0;i=0;return i|0}n=Wi(e,t)|0;s=(n|0)!=0;if(s|r^1)s=s?n:e;else{n=Wi(e,t)|0;s=(n|0)==0?e:n}if(!i){i=n;return i|0}t=Vi(s)|0;fe[i>>2]=t;i=n;return i|0}function _(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if(!((e|0)!=0&t>>>0>73&(i|0)!=0)){i=0;return i|0}if((fe[i>>2]|0)!=40|t>>>0<74){i=0;return i|0}if(((me[e>>0]|0)<<8|(me[e+1>>0]|0)|0)!=18552){i=0;return i|0}if(((me[e+2>>0]|0)<<8|(me[e+3>>0]|0))>>>0<74){i=0;return i|0}if(((me[e+7>>0]|0)<<16|(me[e+6>>0]|0)<<24|(me[e+8>>0]|0)<<8|(me[e+9>>0]|0))>>>0>t>>>0){i=0;return i|0}fe[i+4>>2]=(me[e+12>>0]|0)<<8|(me[e+13>>0]|0);fe[i+8>>2]=(me[e+14>>0]|0)<<8|(me[e+15>>0]|0);fe[i+12>>2]=me[e+16>>0];fe[i+16>>2]=me[e+17>>0];t=e+18|0;r=i+32|0;fe[r>>2]=me[t>>0];fe[r+4>>2]=0;t=de[t>>0]|0;fe[i+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;fe[i+24>>2]=(me[e+26>>0]|0)<<16|(me[e+25>>0]|0)<<24|(me[e+27>>0]|0)<<8|(me[e+28>>0]|0);fe[i+28>>2]=(me[e+30>>0]|0)<<16|(me[e+29>>0]|0)<<24|(me[e+31>>0]|0)<<8|(me[e+32>>0]|0);i=1;return i|0}function At(e){e=e|0;Je(e|0)|0;$t()}function N(e){e=e|0;var t=0,i=0,r=0,n=0,s=0;s=ge;ge=ge+544|0;n=s;r=s+24|0;t=fe[e+20>>2]|0;if(t)kt(t);t=e+4|0;i=fe[t>>2]|0;if(!i){n=e+16|0;de[n>>0]=0;ge=s;return}if(!(i&7))X[fe[104>>2]&1](i,0,0,1,fe[27]|0)|0;else{fe[n>>2]=1154;fe[n+4>>2]=2499;fe[n+8>>2]=1516;xe(r,1100,n)|0;be(r,s+16|0)|0}fe[t>>2]=0;fe[e+8>>2]=0;fe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;ge=s}function kt(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0;d=ge;ge=ge+640|0;p=d+112|0;c=d+96|0;h=d+88|0;u=d+72|0;l=d+64|0;a=d+48|0;r=d+40|0;s=d+24|0;n=d+16|0;i=d;o=d+120|0;if(!e){ge=d;return}t=fe[e+168>>2]|0;do{if(t){f=fe[t+-4>>2]|0;t=t+-8|0;if(!((f|0)!=0?(f|0)==(~fe[t>>2]|0):0)){fe[i>>2]=1154;fe[i+4>>2]=644;fe[i+8>>2]=1863;xe(o,1100,i)|0;be(o,n)|0}if(!(t&7)){X[fe[104>>2]&1](t,0,0,1,fe[27]|0)|0;break}else{fe[s>>2]=1154;fe[s+4>>2]=2499;fe[s+8>>2]=1516;xe(o,1100,s)|0;be(o,r)|0;break}}}while(0);t=fe[e+176>>2]|0;do{if(t){f=fe[t+-4>>2]|0;t=t+-8|0;if(!((f|0)!=0?(f|0)==(~fe[t>>2]|0):0)){fe[a>>2]=1154;fe[a+4>>2]=644;fe[a+8>>2]=1863;xe(o,1100,a)|0;be(o,l)|0}if(!(t&7)){X[fe[104>>2]&1](t,0,0,1,fe[27]|0)|0;break}else{fe[u>>2]=1154;fe[u+4>>2]=2499;fe[u+8>>2]=1516;xe(o,1100,u)|0;be(o,h)|0;break}}}while(0);if(!(e&7)){X[fe[104>>2]&1](e,0,0,1,fe[27]|0)|0;ge=d}else{fe[c>>2]=1154;fe[c+4>>2]=2499;fe[c+8>>2]=1516;xe(o,1100,c)|0;be(o,p)|0;ge=d}}function Pt(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0;h=ge;ge=ge+560|0;o=h+40|0;a=h+24|0;t=h;s=h+48|0;n=e+8|0;i=fe[n>>2]|0;if((i+-1|0)>>>0>=8192){fe[t>>2]=1154;fe[t+4>>2]=2997;fe[t+8>>2]=1541;xe(s,1100,t)|0;be(s,h+16|0)|0}fe[e>>2]=i;r=e+20|0;t=fe[r>>2]|0;if(!t){t=U(180,0)|0;if(!t)t=0;else{u=t+164|0;fe[u>>2]=0;fe[u+4>>2]=0;fe[u+8>>2]=0;fe[u+12>>2]=0}fe[r>>2]=t;u=t;l=fe[e>>2]|0}else{u=t;l=i}if(!(fe[n>>2]|0)){fe[a>>2]=1154;fe[a+4>>2]=903;fe[a+8>>2]=1781;xe(s,1100,a)|0;be(s,o)|0;s=fe[e>>2]|0}else s=l;n=fe[e+4>>2]|0;if(s>>>0>16){i=s;t=0}else{e=0;u=Et(u,l,n,e)|0;ge=h;return u|0}while(1){r=t+1|0;if(i>>>0>3){i=i>>>1;t=r}else{i=r;break}}e=t+2+((i|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;u=Et(u,l,n,e)|0;ge=h;return u|0}function j(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0,b=0,x=0,T=0,w=0,E=0,S=0,A=0,k=0,P=0,O=0,R=0,C=0,M=0,I=0,D=0,L=0;L=ge;ge=ge+800|0;R=L+256|0;O=L+240|0;P=L+232|0;k=L+216|0;A=L+208|0;S=L+192|0;E=L+184|0;w=L+168|0;T=L+160|0;x=L+144|0;b=L+136|0;y=L+120|0;v=L+112|0;g=L+96|0;_=L+88|0;m=L+72|0;c=L+64|0;h=L+48|0;a=L+40|0;l=L+24|0;s=L+16|0;n=L;I=L+288|0;D=L+264|0;C=Ot(e,14)|0;if(!C){fe[t>>2]=0;i=t+4|0;r=fe[i>>2]|0;if(r){if(!(r&7))X[fe[104>>2]&1](r,0,0,1,fe[27]|0)|0;else{fe[n>>2]=1154;fe[n+4>>2]=2499;fe[n+8>>2]=1516;xe(I,1100,n)|0;be(I,s)|0}fe[i>>2]=0;fe[t+8>>2]=0;fe[t+12>>2]=0}de[t+16>>0]=0;i=t+20|0;r=fe[i>>2]|0;if(!r){t=1;ge=L;return t|0}kt(r);fe[i>>2]=0;t=1;ge=L;return t|0}d=t+4|0;f=t+8|0;i=fe[f>>2]|0;if((i|0)!=(C|0)){if(i>>>0<=C>>>0){do{if((fe[t+12>>2]|0)>>>0>>0){if(F(d,C,(i+1|0)==(C|0),1,0)|0){i=fe[f>>2]|0;break}de[t+16>>0]=1;t=0;ge=L;return t|0}}while(0);G((fe[d>>2]|0)+i|0,0,C-i|0)|0}fe[f>>2]=C}G(fe[d>>2]|0,0,C|0)|0;p=e+20|0;i=fe[p>>2]|0;if((i|0)<5){s=e+4|0;o=e+8|0;n=e+16|0;do{r=fe[s>>2]|0;if((r|0)==(fe[o>>2]|0))r=0;else{fe[s>>2]=r+1;r=me[r>>0]|0}i=i+8|0;fe[p>>2]=i;if((i|0)>=33){fe[l>>2]=1154;fe[l+4>>2]=3199;fe[l+8>>2]=1650;xe(I,1100,l)|0;be(I,a)|0;i=fe[p>>2]|0}r=r<<32-i|fe[n>>2];fe[n>>2]=r}while((i|0)<5)}else{r=e+16|0;n=r;r=fe[r>>2]|0}u=r>>>27;fe[n>>2]=r<<5;fe[p>>2]=i+-5;if((u+-1|0)>>>0>20){t=0;ge=L;return t|0}fe[D+20>>2]=0;fe[D>>2]=0;fe[D+4>>2]=0;fe[D+8>>2]=0;fe[D+12>>2]=0;de[D+16>>0]=0;i=D+4|0;r=D+8|0;e:do{if(F(i,21,0,1,0)|0){a=fe[r>>2]|0;l=fe[i>>2]|0;G(l+a|0,0,21-a|0)|0;fe[r>>2]=21;if(u){n=e+4|0;s=e+8|0;o=e+16|0;a=0;do{i=fe[p>>2]|0;if((i|0)<3)do{r=fe[n>>2]|0;if((r|0)==(fe[s>>2]|0))r=0;else{fe[n>>2]=r+1;r=me[r>>0]|0}i=i+8|0;fe[p>>2]=i;if((i|0)>=33){fe[h>>2]=1154;fe[h+4>>2]=3199;fe[h+8>>2]=1650;xe(I,1100,h)|0;be(I,c)|0;i=fe[p>>2]|0}r=r<<32-i|fe[o>>2];fe[o>>2]=r}while((i|0)<3);else r=fe[o>>2]|0;fe[o>>2]=r<<3;fe[p>>2]=i+-3;de[l+(me[1611+a>>0]|0)>>0]=r>>>29;a=a+1|0}while((a|0)!=(u|0))}if(Pt(D)|0){a=e+4|0;l=e+8|0;u=e+16|0;r=0;t:while(1){o=C-r|0;i=ye(e,D)|0;i:do{if(i>>>0<17){if((fe[f>>2]|0)>>>0<=r>>>0){fe[m>>2]=1154;fe[m+4>>2]=903;fe[m+8>>2]=1781;xe(I,1100,m)|0;be(I,_)|0}de[(fe[d>>2]|0)+r>>0]=i;i=r+1|0}else switch(i|0){case 17:{i=fe[p>>2]|0;if((i|0)<3)do{n=fe[a>>2]|0;if((n|0)==(fe[l>>2]|0))n=0;else{fe[a>>2]=n+1;n=me[n>>0]|0}i=i+8|0;fe[p>>2]=i;if((i|0)>=33){fe[g>>2]=1154;fe[g+4>>2]=3199;fe[g+8>>2]=1650;xe(I,1100,g)|0;be(I,v)|0;i=fe[p>>2]|0}n=n<<32-i|fe[u>>2];fe[u>>2]=n}while((i|0)<3);else n=fe[u>>2]|0;fe[u>>2]=n<<3;fe[p>>2]=i+-3;i=(n>>>29)+3|0;if(i>>>0>o>>>0){i=0;break e}i=i+r|0;break i}case 18:{i=fe[p>>2]|0;if((i|0)<7)do{n=fe[a>>2]|0;if((n|0)==(fe[l>>2]|0))n=0;else{fe[a>>2]=n+1;n=me[n>>0]|0}i=i+8|0;fe[p>>2]=i;if((i|0)>=33){fe[y>>2]=1154;fe[y+4>>2]=3199;fe[y+8>>2]=1650;xe(I,1100,y)|0;be(I,b)|0;i=fe[p>>2]|0}n=n<<32-i|fe[u>>2];fe[u>>2]=n}while((i|0)<7);else n=fe[u>>2]|0;fe[u>>2]=n<<7;fe[p>>2]=i+-7;i=(n>>>25)+11|0;if(i>>>0>o>>>0){i=0;break e}i=i+r|0;break i}default:{if((i+-19|0)>>>0>=2){M=90;break t}s=fe[p>>2]|0;if((i|0)==19){if((s|0)<2){n=s;while(1){i=fe[a>>2]|0;if((i|0)==(fe[l>>2]|0))s=0;else{fe[a>>2]=i+1;s=me[i>>0]|0}i=n+8|0;fe[p>>2]=i;if((i|0)>=33){fe[x>>2]=1154;fe[x+4>>2]=3199;fe[x+8>>2]=1650;xe(I,1100,x)|0;be(I,T)|0;i=fe[p>>2]|0}n=s<<32-i|fe[u>>2];fe[u>>2]=n;if((i|0)<2)n=i;else break}}else{n=fe[u>>2]|0;i=s}fe[u>>2]=n<<2;fe[p>>2]=i+-2;s=(n>>>30)+3|0}else{if((s|0)<6){n=s;while(1){i=fe[a>>2]|0;if((i|0)==(fe[l>>2]|0))s=0;else{fe[a>>2]=i+1;s=me[i>>0]|0}i=n+8|0;fe[p>>2]=i;if((i|0)>=33){fe[w>>2]=1154;fe[w+4>>2]=3199;fe[w+8>>2]=1650;xe(I,1100,w)|0;be(I,E)|0;i=fe[p>>2]|0}n=s<<32-i|fe[u>>2];fe[u>>2]=n;if((i|0)<6)n=i;else break}}else{n=fe[u>>2]|0;i=s}fe[u>>2]=n<<6;fe[p>>2]=i+-6;s=(n>>>26)+7|0}if((r|0)==0|s>>>0>o>>>0){i=0;break e}i=r+-1|0;if((fe[f>>2]|0)>>>0<=i>>>0){fe[S>>2]=1154;fe[S+4>>2]=903;fe[S+8>>2]=1781;xe(I,1100,S)|0;be(I,A)|0}n=de[(fe[d>>2]|0)+i>>0]|0;if(!(n<<24>>24)){i=0;break e}i=s+r|0;if(r>>>0>=i>>>0){i=r;break i}do{if((fe[f>>2]|0)>>>0<=r>>>0){fe[k>>2]=1154;fe[k+4>>2]=903;fe[k+8>>2]=1781;xe(I,1100,k)|0;be(I,P)|0}de[(fe[d>>2]|0)+r>>0]=n;r=r+1|0}while((r|0)!=(i|0))}}}while(0);if(C>>>0>i>>>0)r=i;else break}if((M|0)==90){fe[O>>2]=1154;fe[O+4>>2]=3140;fe[O+8>>2]=1632;xe(I,1100,O)|0;be(I,R)|0;i=0;break}if((C|0)==(i|0))i=Pt(t)|0;else i=0}else i=0}else{de[D+16>>0]=1;i=0}}while(0);N(D);t=i;ge=L;return t|0}function Ot(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0;h=ge;ge=ge+544|0;a=h+16|0;o=h;s=h+24|0;if(!t){u=0;ge=h;return u|0}if(t>>>0<=16){u=Rt(e,t)|0;ge=h;return u|0}l=Rt(e,t+-16|0)|0;u=e+20|0;t=fe[u>>2]|0;if((t|0)<16){r=e+4|0;n=e+8|0;i=e+16|0;do{e=fe[r>>2]|0;if((e|0)==(fe[n>>2]|0))e=0;else{fe[r>>2]=e+1;e=me[e>>0]|0}t=t+8|0;fe[u>>2]=t;if((t|0)>=33){fe[o>>2]=1154;fe[o+4>>2]=3199;fe[o+8>>2]=1650;xe(s,1100,o)|0;be(s,a)|0;t=fe[u>>2]|0}e=e<<32-t|fe[i>>2];fe[i>>2]=e}while((t|0)<16)}else{e=e+16|0;i=e;e=fe[e>>2]|0}fe[i>>2]=e<<16;fe[u>>2]=t+-16;u=e>>>16|l<<16;ge=h;return u|0}function ye(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0;y=ge;ge=ge+608|0;m=y+88|0;f=y+72|0;p=y+64|0;c=y+48|0;h=y+40|0;d=y+24|0;u=y+16|0;l=y;g=y+96|0;_=fe[t+20>>2]|0;v=e+20|0;a=fe[v>>2]|0;do{if((a|0)<24){o=e+4|0;r=fe[o>>2]|0;n=fe[e+8>>2]|0;i=r>>>0>>0;if((a|0)>=16){if(i){fe[o>>2]=r+1;i=me[r>>0]|0}else i=0;fe[v>>2]=a+8;o=e+16|0;s=i<<24-a|fe[o>>2];fe[o>>2]=s;break}if(i){s=(me[r>>0]|0)<<8;i=r+1|0}else{s=0;i=r}if(i>>>0>>0){r=me[i>>0]|0;i=i+1|0}else r=0;fe[o>>2]=i;fe[v>>2]=a+16;o=e+16|0;s=(r|s)<<16-a|fe[o>>2];fe[o>>2]=s}else{s=e+16|0;o=s;s=fe[s>>2]|0}}while(0);n=(s>>>16)+1|0;do{if(n>>>0<=(fe[_+16>>2]|0)>>>0){r=fe[(fe[_+168>>2]|0)+(s>>>(32-(fe[_+8>>2]|0)|0)<<2)>>2]|0;if((r|0)==-1){fe[l>>2]=1154;fe[l+4>>2]=3244;fe[l+8>>2]=1677;xe(g,1100,l)|0;be(g,u)|0}i=r&65535;r=r>>>16;if((fe[t+8>>2]|0)>>>0<=i>>>0){fe[d>>2]=1154;fe[d+4>>2]=902;fe[d+8>>2]=1781;xe(g,1100,d)|0;be(g,h)|0}if((me[(fe[t+4>>2]|0)+i>>0]|0|0)!=(r|0)){fe[c>>2]=1154;fe[c+4>>2]=3248;fe[c+8>>2]=1694;xe(g,1100,c)|0;be(g,p)|0}}else{r=fe[_+20>>2]|0;while(1){i=r+-1|0;if(n>>>0>(fe[_+28+(i<<2)>>2]|0)>>>0)r=r+1|0;else break}i=(s>>>(32-r|0))+(fe[_+96+(i<<2)>>2]|0)|0;if(i>>>0<(fe[t>>2]|0)>>>0){i=_e[(fe[_+176>>2]|0)+(i<<1)>>1]|0;break}fe[f>>2]=1154;fe[f+4>>2]=3266;fe[f+8>>2]=1632;xe(g,1100,f)|0;be(g,m)|0;v=0;ge=y;return v|0}}while(0);fe[o>>2]=fe[o>>2]<>2]=(fe[v>>2]|0)-r;v=i;ge=y;return v|0}function Rt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0;h=ge;ge=ge+560|0;a=h+40|0;l=h+24|0;i=h;o=h+48|0;if(t>>>0>=33){fe[i>>2]=1154;fe[i+4>>2]=3190;fe[i+8>>2]=1634;xe(o,1100,i)|0;be(o,h+16|0)|0}u=e+20|0;i=fe[u>>2]|0;if((i|0)>=(t|0)){s=e+16|0;o=s;s=fe[s>>2]|0;a=i;l=32-t|0;l=s>>>l;s=s<>2]=s;t=a-t|0;fe[u>>2]=t;ge=h;return l|0}n=e+4|0;s=e+8|0;r=e+16|0;do{e=fe[n>>2]|0;if((e|0)==(fe[s>>2]|0))e=0;else{fe[n>>2]=e+1;e=me[e>>0]|0}i=i+8|0;fe[u>>2]=i;if((i|0)>=33){fe[l>>2]=1154;fe[l+4>>2]=3199;fe[l+8>>2]=1650;xe(o,1100,l)|0;be(o,a)|0;i=fe[u>>2]|0}e=e<<32-i|fe[r>>2];fe[r>>2]=e}while((i|0)<(t|0));l=32-t|0;l=e>>>l;a=e<>2]=a;t=i-t|0;fe[u>>2]=t;ge=h;return l|0}function Ct(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0;f=ge;ge=ge+544|0;p=f+16|0;c=f;h=f+24|0;if((e|0)==0|t>>>0<62){d=0;ge=f;return d|0}u=U(300,0)|0;if(!u){d=0;ge=f;return d|0}fe[u>>2]=519686845;i=u+4|0;fe[i>>2]=0;r=u+8|0;fe[r>>2]=0;l=u+88|0;n=u+136|0;s=u+160|0;o=l;a=o+44|0;do{fe[o>>2]=0;o=o+4|0}while((o|0)<(a|0));de[l+44>>0]=0;m=u+184|0;o=u+208|0;a=u+232|0;_=u+252|0;fe[_>>2]=0;fe[_+4>>2]=0;fe[_+8>>2]=0;de[_+12>>0]=0;_=u+268|0;fe[_>>2]=0;fe[_+4>>2]=0;fe[_+8>>2]=0;de[_+12>>0]=0;_=u+284|0;fe[_>>2]=0;fe[_+4>>2]=0;fe[_+8>>2]=0;de[_+12>>0]=0;fe[n>>2]=0;fe[n+4>>2]=0;fe[n+8>>2]=0;fe[n+12>>2]=0;fe[n+16>>2]=0;de[n+20>>0]=0;fe[s>>2]=0;fe[s+4>>2]=0;fe[s+8>>2]=0;fe[s+12>>2]=0;fe[s+16>>2]=0;de[s+20>>0]=0;fe[m>>2]=0;fe[m+4>>2]=0;fe[m+8>>2]=0;fe[m+12>>2]=0;fe[m+16>>2]=0;de[m+20>>0]=0;fe[o>>2]=0;fe[o+4>>2]=0;fe[o+8>>2]=0;fe[o+12>>2]=0;fe[o+16>>2]=0;de[o+20>>0]=0;fe[a>>2]=0;fe[a+4>>2]=0;fe[a+8>>2]=0;fe[a+12>>2]=0;de[a+16>>0]=0;do{if(((t>>>0>=74?((me[e>>0]|0)<<8|(me[e+1>>0]|0)|0)==18552:0)?((me[e+2>>0]|0)<<8|(me[e+3>>0]|0))>>>0>=74:0)?((me[e+7>>0]|0)<<16|(me[e+6>>0]|0)<<24|(me[e+8>>0]|0)<<8|(me[e+9>>0]|0))>>>0<=t>>>0:0){fe[l>>2]=e;fe[i>>2]=e;fe[r>>2]=t;if(Ut(u)|0){i=fe[l>>2]|0;if((me[i+39>>0]|0)<<8|(me[i+40>>0]|0)){if(!(jt(u)|0))break;if(!(Gt(u)|0))break;i=fe[l>>2]|0}if(!((me[i+55>>0]|0)<<8|(me[i+56>>0]|0))){_=u;ge=f;return _|0}if(Xt(u)|0?Ht(u)|0:0){_=u;ge=f;return _|0}}}else d=7}while(0);if((d|0)==7)fe[l>>2]=0;Kt(u);if(!(u&7)){X[fe[104>>2]&1](u,0,0,1,fe[27]|0)|0;_=0;ge=f;return _|0}else{fe[c>>2]=1154;fe[c+4>>2]=2499;fe[c+8>>2]=1516;xe(h,1100,c)|0;be(h,p)|0;_=0;ge=f;return _|0}return 0}function Mt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0,l=0,u=0,h=0;h=ge;ge=ge+544|0;u=h;l=h+24|0;s=fe[e+88>>2]|0;a=(me[s+70+(n<<2)+1>>0]|0)<<16|(me[s+70+(n<<2)>>0]|0)<<24|(me[s+70+(n<<2)+2>>0]|0)<<8|(me[s+70+(n<<2)+3>>0]|0);o=n+1|0;if(o>>>0<(me[s+16>>0]|0)>>>0)s=(me[s+70+(o<<2)+1>>0]|0)<<16|(me[s+70+(o<<2)>>0]|0)<<24|(me[s+70+(o<<2)+2>>0]|0)<<8|(me[s+70+(o<<2)+3>>0]|0);else s=fe[e+8>>2]|0;if(s>>>0>a>>>0){l=e+4|0;l=fe[l>>2]|0;l=l+a|0;u=s-a|0;u=It(e,l,u,t,i,r,n)|0;ge=h;return u|0}fe[u>>2]=1154;fe[u+4>>2]=3704;fe[u+8>>2]=1792;xe(l,1100,u)|0;be(l,h+16|0)|0;l=e+4|0;l=fe[l>>2]|0;l=l+a|0;u=s-a|0;u=It(e,l,u,t,i,r,n)|0;ge=h;return u|0}function It(e,t,i,r,n,s,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;o=o|0;var a=0,l=0,u=0,h=0;h=fe[e+88>>2]|0;l=((me[h+12>>0]|0)<<8|(me[h+13>>0]|0))>>>o;u=((me[h+14>>0]|0)<<8|(me[h+15>>0]|0))>>>o;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;h=h+18|0;o=de[h>>0]|0;o=ve(o<<24>>24==0|o<<24>>24==9?8:16,l)|0;if(s)if((s&3|0)==0&o>>>0<=s>>>0)o=s;else{e=0;return e|0}if((ve(o,u)|0)>>>0>n>>>0){e=0;return e|0}s=(l+1|0)>>>1;a=(u+1|0)>>>1;if(!i){e=0;return e|0}fe[e+92>>2]=t;fe[e+96>>2]=t;fe[e+104>>2]=i;fe[e+100>>2]=t+i;fe[e+108>>2]=0;fe[e+112>>2]=0;switch(me[h>>0]|0|0){case 0:{Yt(e,r,n,o,l,u,s,a)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Wt(e,r,n,o,l,u,s,a)|0;e=1;return e|0}case 9:{Vt(e,r,n,o,l,u,s,a)|0;e=1;return e|0}case 8:case 7:{qt(e,r,n,o,l,u,s,a)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function Dt(e,t){e=e|0;t=t|0;var i=0,r=0;r=ge;ge=ge+48|0;i=r;fe[i>>2]=40;_(e,t,i)|0;ge=r;return fe[i+4>>2]|0}function Lt(e,t){e=e|0;t=t|0;var i=0,r=0;r=ge;ge=ge+48|0;i=r;fe[i>>2]=40;_(e,t,i)|0;ge=r;return fe[i+8>>2]|0}function Ft(e,t){e=e|0;t=t|0;var i=0,r=0;r=ge;ge=ge+48|0;i=r;fe[i>>2]=40;_(e,t,i)|0;ge=r;return fe[i+12>>2]|0}function Nt(e,t){e=e|0;t=t|0;var i=0,r=0;r=ge;ge=ge+48|0;i=r;fe[i>>2]=40;_(e,t,i)|0;ge=r;return fe[i+32>>2]|0}function zt(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0,a=0,l=0,u=0;l=ge;ge=ge+576|0;o=l+56|0;s=l+40|0;n=l+64|0;u=l;fe[u>>2]=40;_(e,t,u)|0;r=(((fe[u+4>>2]|0)>>>i)+3|0)>>>2;t=(((fe[u+8>>2]|0)>>>i)+3|0)>>>2;i=u+32|0;e=fe[i+4>>2]|0;do{switch(fe[i>>2]|0){case 0:{if(!e)e=8;else a=13;break}case 1:{if(!e)a=12;else a=13;break}case 2:{if(!e)a=12;else a=13;break}case 3:{if(!e)a=12;else a=13;break}case 4:{if(!e)a=12;else a=13;break}case 5:{if(!e)a=12;else a=13;break}case 6:{if(!e)a=12;else a=13;break}case 7:{if(!e)a=12;else a=13;break}case 8:{if(!e)a=12;else a=13;break}case 9:{if(!e)e=8;else a=13;break}default:a=13}}while(0);if((a|0)==12)e=16;else if((a|0)==13){fe[s>>2]=1154;fe[s+4>>2]=2663;fe[s+8>>2]=1535;xe(n,1100,s)|0;be(n,o)|0;e=0}u=ve(ve(t,r)|0,e)|0;ge=l;return u|0}function Bt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0;f=ge;ge=ge+608|0;p=f+80|0;d=f+64|0;a=f+56|0;o=f+40|0;h=f+88|0;m=f;c=f+84|0;fe[m>>2]=40;_(e,t,m)|0;l=(((fe[m+4>>2]|0)>>>n)+3|0)>>>2;m=m+32|0;s=fe[m+4>>2]|0;do{switch(fe[m>>2]|0){case 0:{if(!s)s=8;else u=13;break}case 1:{if(!s)u=12;else u=13;break}case 2:{if(!s)u=12;else u=13;break}case 3:{if(!s)u=12;else u=13;break}case 4:{if(!s)u=12;else u=13;break}case 5:{if(!s)u=12;else u=13;break}case 6:{if(!s)u=12;else u=13;break}case 7:{if(!s)u=12;else u=13;break}case 8:{if(!s)u=12;else u=13;break}case 9:{if(!s)s=8;else u=13;break}default:u=13}}while(0);if((u|0)==12)s=16;else if((u|0)==13){fe[o>>2]=1154;fe[o+4>>2]=2663;fe[o+8>>2]=1535;xe(h,1100,o)|0;be(h,a)|0;s=0}a=ve(s,l)|0;o=Ct(e,t)|0;fe[c>>2]=i;s=(o|0)==0;if(!(n>>>0>15|(r>>>0<8|s))?(fe[o>>2]|0)==519686845:0)Mt(o,c,r,a,n)|0;if(s){ge=f;return}if((fe[o>>2]|0)!=519686845){ge=f;return}Kt(o);if(!(o&7)){X[fe[104>>2]&1](o,0,0,1,fe[27]|0)|0;ge=f;return}else{fe[d>>2]=1154;fe[d+4>>2]=2499;fe[d+8>>2]=1516;xe(h,1100,d)|0;be(h,p)|0;ge=f;return}}function Ut(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0;o=e+92|0;r=fe[e+4>>2]|0;s=e+88|0;n=fe[s>>2]|0;t=(me[n+68>>0]|0)<<8|(me[n+67>>0]|0)<<16|(me[n+69>>0]|0);i=r+t|0;n=(me[n+65>>0]|0)<<8|(me[n+66>>0]|0);if(!n){e=0;return e|0}fe[o>>2]=i;fe[e+96>>2]=i;fe[e+104>>2]=n;fe[e+100>>2]=r+(n+t);fe[e+108>>2]=0;fe[e+112>>2]=0;if(!(j(o,e+116|0)|0)){e=0;return e|0}t=fe[s>>2]|0;do{if(!((me[t+39>>0]|0)<<8|(me[t+40>>0]|0))){if(!((me[t+55>>0]|0)<<8|(me[t+56>>0]|0))){e=0;return e|0}}else{if(!(j(o,e+140|0)|0)){e=0;return e|0}if(j(o,e+188|0)|0){t=fe[s>>2]|0;break}else{e=0;return e|0}}}while(0);if((me[t+55>>0]|0)<<8|(me[t+56>>0]|0)){if(!(j(o,e+164|0)|0)){e=0;return e|0}if(!(j(o,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function jt(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0;f=ge;ge=ge+592|0;l=f+16|0;a=f;o=f+72|0;d=f+24|0;r=e+88|0;t=fe[r>>2]|0;p=(me[t+39>>0]|0)<<8|(me[t+40>>0]|0);h=e+236|0;s=e+240|0;i=fe[s>>2]|0;if((i|0)!=(p|0)){if(i>>>0<=p>>>0){do{if((fe[e+244>>2]|0)>>>0

>>0){if(F(h,p,(i+1|0)==(p|0),4,0)|0){t=fe[s>>2]|0;break}de[e+248>>0]=1;d=0;ge=f;return d|0}else t=i}while(0);G((fe[h>>2]|0)+(t<<2)|0,0,p-t<<2|0)|0;t=fe[r>>2]|0}fe[s>>2]=p}u=e+92|0;i=fe[e+4>>2]|0;r=(me[t+34>>0]|0)<<8|(me[t+33>>0]|0)<<16|(me[t+35>>0]|0);n=i+r|0;t=(me[t+37>>0]|0)<<8|(me[t+36>>0]|0)<<16|(me[t+38>>0]|0);if(!t){d=0;ge=f;return d|0}fe[u>>2]=n;fe[e+96>>2]=n;fe[e+104>>2]=t;fe[e+100>>2]=i+(t+r);fe[e+108>>2]=0;fe[e+112>>2]=0;fe[d+20>>2]=0;fe[d>>2]=0;fe[d+4>>2]=0;fe[d+8>>2]=0;fe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;fe[d+44>>2]=0;fe[e>>2]=0;fe[e+4>>2]=0;fe[e+8>>2]=0;fe[e+12>>2]=0;de[e+16>>0]=0;if(j(u,d)|0?(c=d+24|0,j(u,c)|0):0){if(!(fe[s>>2]|0)){fe[a>>2]=1154;fe[a+4>>2]=903;fe[a+8>>2]=1781;xe(o,1100,a)|0;be(o,l)|0}if(!p)t=1;else{r=0;n=0;s=0;t=0;o=0;e=0;a=0;i=fe[h>>2]|0;while(1){r=(ye(u,d)|0)+r&31;n=(ye(u,c)|0)+n&63;s=(ye(u,d)|0)+s&31;t=(ye(u,d)|0)+t|0;o=(ye(u,c)|0)+o&63;e=(ye(u,d)|0)+e&31;fe[i>>2]=n<<5|r<<11|s|t<<27|o<<21|e<<16;a=a+1|0;if((a|0)==(p|0)){t=1;break}else{t=t&31;i=i+4|0}}}}else t=0;N(d+24|0);N(d);d=t;ge=f;return d|0}function Gt(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0,b=0,x=0,T=0,w=0,E=0,S=0,A=0,k=0;S=ge;ge=ge+1024|0;a=S+16|0;o=S;s=S+504|0;E=S+480|0;T=S+284|0;w=S+88|0;x=S+24|0;n=fe[e+88>>2]|0;b=(me[n+47>>0]|0)<<8|(me[n+48>>0]|0);y=e+92|0;t=fe[e+4>>2]|0;i=(me[n+42>>0]|0)<<8|(me[n+41>>0]|0)<<16|(me[n+43>>0]|0);r=t+i|0;n=(me[n+45>>0]|0)<<8|(me[n+44>>0]|0)<<16|(me[n+46>>0]|0);if(!n){E=0;ge=S;return E|0}fe[y>>2]=r;fe[e+96>>2]=r;fe[e+104>>2]=n;fe[e+100>>2]=t+(n+i);fe[e+108>>2]=0;fe[e+112>>2]=0;fe[E+20>>2]=0;fe[E>>2]=0;fe[E+4>>2]=0;fe[E+8>>2]=0;fe[E+12>>2]=0;de[E+16>>0]=0;if(j(y,E)|0){i=0;r=-3;n=-3;while(1){fe[T+(i<<2)>>2]=r;fe[w+(i<<2)>>2]=n;t=(r|0)>2;i=i+1|0;if((i|0)==49)break;else{r=t?-3:r+1|0;n=(t&1)+n|0}}t=x;i=t+64|0;do{fe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));v=e+252|0;i=e+256|0;t=fe[i>>2]|0;e:do{if((t|0)==(b|0))l=13;else{if(t>>>0<=b>>>0){do{if((fe[e+260>>2]|0)>>>0>>0)if(F(v,b,(t+1|0)==(b|0),4,0)|0){t=fe[i>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);G((fe[v>>2]|0)+(t<<2)|0,0,b-t<<2|0)|0}fe[i>>2]=b;l=13}}while(0);do{if((l|0)==13){if(!b){fe[o>>2]=1154;fe[o+4>>2]=903;fe[o+8>>2]=1781;xe(s,1100,o)|0;be(s,a)|0;t=1;break}r=x+4|0;n=x+8|0;e=x+12|0;s=x+16|0;o=x+20|0;a=x+24|0;l=x+28|0;u=x+32|0;h=x+36|0;c=x+40|0;p=x+44|0;d=x+48|0;f=x+52|0;m=x+56|0;_=x+60|0;g=0;i=fe[v>>2]|0;while(1){t=0;do{A=ye(y,E)|0;v=t<<1;k=x+(v<<2)|0;fe[k>>2]=(fe[k>>2]|0)+(fe[T+(A<<2)>>2]|0)&3;v=x+((v|1)<<2)|0;fe[v>>2]=(fe[v>>2]|0)+(fe[w+(A<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);fe[i>>2]=(me[1725+(fe[r>>2]|0)>>0]|0)<<2|(me[1725+(fe[x>>2]|0)>>0]|0)|(me[1725+(fe[n>>2]|0)>>0]|0)<<4|(me[1725+(fe[e>>2]|0)>>0]|0)<<6|(me[1725+(fe[s>>2]|0)>>0]|0)<<8|(me[1725+(fe[o>>2]|0)>>0]|0)<<10|(me[1725+(fe[a>>2]|0)>>0]|0)<<12|(me[1725+(fe[l>>2]|0)>>0]|0)<<14|(me[1725+(fe[u>>2]|0)>>0]|0)<<16|(me[1725+(fe[h>>2]|0)>>0]|0)<<18|(me[1725+(fe[c>>2]|0)>>0]|0)<<20|(me[1725+(fe[p>>2]|0)>>0]|0)<<22|(me[1725+(fe[d>>2]|0)>>0]|0)<<24|(me[1725+(fe[f>>2]|0)>>0]|0)<<26|(me[1725+(fe[m>>2]|0)>>0]|0)<<28|(me[1725+(fe[_>>2]|0)>>0]|0)<<30;g=g+1|0;if((g|0)==(b|0)){t=1;break}else i=i+4|0}}}while(0)}else t=0;N(E);k=t;ge=S;return k|0}function Xt(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0;p=ge;ge=ge+560|0;l=p+16|0;a=p;o=p+48|0;c=p+24|0;n=fe[e+88>>2]|0;h=(me[n+55>>0]|0)<<8|(me[n+56>>0]|0);u=e+92|0;t=fe[e+4>>2]|0;i=(me[n+50>>0]|0)<<8|(me[n+49>>0]|0)<<16|(me[n+51>>0]|0);r=t+i|0;n=(me[n+53>>0]|0)<<8|(me[n+52>>0]|0)<<16|(me[n+54>>0]|0);if(!n){c=0;ge=p;return c|0}fe[u>>2]=r;fe[e+96>>2]=r;fe[e+104>>2]=n;fe[e+100>>2]=t+(n+i);fe[e+108>>2]=0;fe[e+112>>2]=0;fe[c+20>>2]=0;fe[c>>2]=0;fe[c+4>>2]=0;fe[c+8>>2]=0;fe[c+12>>2]=0;de[c+16>>0]=0;e:do{if(j(u,c)|0){s=e+268|0;i=e+272|0;t=fe[i>>2]|0;if((t|0)!=(h|0)){if(t>>>0<=h>>>0){do{if((fe[e+276>>2]|0)>>>0>>0)if(F(s,h,(t+1|0)==(h|0),2,0)|0){t=fe[i>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);G((fe[s>>2]|0)+(t<<1)|0,0,h-t<<1|0)|0}fe[i>>2]=h}if(!h){fe[a>>2]=1154;fe[a+4>>2]=903;fe[a+8>>2]=1781;xe(o,1100,a)|0;be(o,l)|0;t=1;break}i=0;r=0;n=0;t=fe[s>>2]|0;while(1){l=ye(u,c)|0;i=l+i&255;r=(ye(u,c)|0)+r&255;$[t>>1]=r<<8|i;n=n+1|0;if((n|0)==(h|0)){t=1;break}else t=t+2|0}}else t=0}while(0);N(c);c=t;ge=p;return c|0}function Ht(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0,b=0,x=0,T=0,w=0,E=0,S=0,A=0,k=0;S=ge;ge=ge+2432|0;a=S+16|0;o=S;s=S+1912|0;E=S+1888|0;T=S+988|0;w=S+88|0;x=S+24|0;n=fe[e+88>>2]|0;b=(me[n+63>>0]|0)<<8|(me[n+64>>0]|0);y=e+92|0;t=fe[e+4>>2]|0;i=(me[n+58>>0]|0)<<8|(me[n+57>>0]|0)<<16|(me[n+59>>0]|0);r=t+i|0;n=(me[n+61>>0]|0)<<8|(me[n+60>>0]|0)<<16|(me[n+62>>0]|0);if(!n){E=0;ge=S;return E|0}fe[y>>2]=r;fe[e+96>>2]=r;fe[e+104>>2]=n;fe[e+100>>2]=t+(n+i);fe[e+108>>2]=0;fe[e+112>>2]=0;fe[E+20>>2]=0;fe[E>>2]=0;fe[E+4>>2]=0;fe[E+8>>2]=0;fe[E+12>>2]=0;de[E+16>>0]=0;if(j(y,E)|0){i=0;r=-7;n=-7;while(1){fe[T+(i<<2)>>2]=r;fe[w+(i<<2)>>2]=n;t=(r|0)>6;i=i+1|0;if((i|0)==225)break;else{r=t?-7:r+1|0;n=(t&1)+n|0}}t=x;i=t+64|0;do{fe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));v=e+284|0;i=b*3|0;r=e+288|0;t=fe[r>>2]|0;e:do{if((t|0)==(i|0))l=13;else{if(t>>>0<=i>>>0){do{if((fe[e+292>>2]|0)>>>0>>0)if(F(v,i,(t+1|0)==(i|0),2,0)|0){t=fe[r>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);G((fe[v>>2]|0)+(t<<1)|0,0,i-t<<1|0)|0}fe[r>>2]=i;l=13}}while(0);do{if((l|0)==13){if(!b){fe[o>>2]=1154;fe[o+4>>2]=903;fe[o+8>>2]=1781;xe(s,1100,o)|0;be(s,a)|0;t=1;break}r=x+4|0;n=x+8|0;e=x+12|0;s=x+16|0;o=x+20|0;a=x+24|0;l=x+28|0;u=x+32|0;h=x+36|0;c=x+40|0;p=x+44|0;d=x+48|0;f=x+52|0;m=x+56|0;_=x+60|0;g=0;i=fe[v>>2]|0;while(1){t=0;do{A=ye(y,E)|0;v=t<<1;k=x+(v<<2)|0;fe[k>>2]=(fe[k>>2]|0)+(fe[T+(A<<2)>>2]|0)&7;v=x+((v|1)<<2)|0;fe[v>>2]=(fe[v>>2]|0)+(fe[w+(A<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);A=me[1729+(fe[o>>2]|0)>>0]|0;$[i>>1]=(me[1729+(fe[r>>2]|0)>>0]|0)<<3|(me[1729+(fe[x>>2]|0)>>0]|0)|(me[1729+(fe[n>>2]|0)>>0]|0)<<6|(me[1729+(fe[e>>2]|0)>>0]|0)<<9|(me[1729+(fe[s>>2]|0)>>0]|0)<<12|A<<15;k=me[1729+(fe[c>>2]|0)>>0]|0;$[i+2>>1]=(me[1729+(fe[a>>2]|0)>>0]|0)<<2|A>>>1|(me[1729+(fe[l>>2]|0)>>0]|0)<<5|(me[1729+(fe[u>>2]|0)>>0]|0)<<8|(me[1729+(fe[h>>2]|0)>>0]|0)<<11|k<<14;$[i+4>>1]=(me[1729+(fe[p>>2]|0)>>0]|0)<<1|k>>>2|(me[1729+(fe[d>>2]|0)>>0]|0)<<4|(me[1729+(fe[f>>2]|0)>>0]|0)<<7|(me[1729+(fe[m>>2]|0)>>0]|0)<<10|(me[1729+(fe[_>>2]|0)>>0]|0)<<13;g=g+1|0;if((g|0)==(b|0)){t=1;break}else i=i+6|0}}}while(0)}else t=0;N(E);k=t;ge=S;return k|0}function Yt(e,F,t,i,r,n,N,s){e=e|0;F=F|0;t=t|0;i=i|0;r=r|0;n=n|0;N=N|0;s=s|0;var o=0,a=0,l=0,z=0,u=0,h=0,c=0,p=0,B=0,U=0,d=0,j=0,G=0,f=0,m=0,X=0,_=0,g=0,H=0,Y=0,W=0,V=0,v=0,q=0,K=0,Z=0,y=0,J=0,Q=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,b=0,x=0,T=0,w=0,E=0,S=0,se=0,A=0,oe=0,k=0,ae=0,P=0,le=0,ue=0,O=0,he=0,R=0,ce=0,C=0,M=0,pe=0,I=0,D=0,L=0;I=ge;ge=ge+720|0;pe=I+184|0;C=I+168|0;ce=I+160|0;R=I+144|0;he=I+136|0;O=I+120|0;ue=I+112|0;P=I+96|0;ae=I+88|0;k=I+72|0;oe=I+64|0;A=I+48|0;se=I+40|0;M=I+24|0;le=I+16|0;S=I;w=I+208|0;E=I+192|0;te=e+240|0;ie=fe[te>>2]|0;b=e+256|0;x=fe[b>>2]|0;t=de[(fe[e+88>>2]|0)+17>>0]|0;T=i>>>2;if(!(t<<24>>24)){ge=I;return 1}re=(s|0)==0;ne=s+-1|0;K=(n&1|0)!=0;Z=i<<1;y=e+92|0;J=e+116|0;Q=e+140|0;$=e+236|0;ee=N+-1|0;q=(r&1|0)!=0;v=e+188|0;g=e+252|0;H=T+1|0;Y=T+2|0;W=T+3|0;V=ee<<4;X=t&255;t=0;n=0;r=1;_=0;do{if(!re){f=fe[F+(_<<2)>>2]|0;m=0;while(1){d=m&1;o=(d|0)==0;U=(d<<5^32)+-16|0;d=(d<<1^2)+-1|0;G=o?N:-1;a=o?0:ee;e=(m|0)==(ne|0);j=K&e;if((a|0)!=(G|0)){B=K&e^1;p=o?f:f+V|0;while(1){if((r|0)==1)r=ye(y,J)|0|512;c=r&7;r=r>>>3;o=me[1823+c>>0]|0;e=0;do{u=(ye(y,Q)|0)+n|0;h=u-ie|0;n=h>>31;n=n&u|h&~n;if((fe[te>>2]|0)>>>0<=n>>>0){fe[S>>2]=1154;fe[S+4>>2]=903;fe[S+8>>2]=1781;xe(w,1100,S)|0;be(w,le)|0}fe[E+(e<<2)>>2]=fe[(fe[$>>2]|0)+(n<<2)>>2];e=e+1|0}while(e>>>0>>0);h=q&(a|0)==(ee|0);if(j|h){u=0;do{l=ve(u,i)|0;e=p+l|0;o=(u|0)==0|B;z=u<<1;L=(ye(y,v)|0)+t|0;D=L-x|0;t=D>>31;t=t&L|D&~t;do{if(h){if(!o){D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;break}fe[e>>2]=fe[E+((me[1831+(c<<2)+z>>0]|0)<<2)>>2];if((fe[b>>2]|0)>>>0<=t>>>0){fe[R>>2]=1154;fe[R+4>>2]=903;fe[R+8>>2]=1781;xe(w,1100,R)|0;be(w,ce)|0}fe[p+(l+4)>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2];D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t}else{if(!o){D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;break}fe[e>>2]=fe[E+((me[1831+(c<<2)+z>>0]|0)<<2)>>2];if((fe[b>>2]|0)>>>0<=t>>>0){fe[O>>2]=1154;fe[O+4>>2]=903;fe[O+8>>2]=1781;xe(w,1100,O)|0;be(w,he)|0}fe[p+(l+4)>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2];D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;fe[p+(l+8)>>2]=fe[E+((me[(z|1)+(1831+(c<<2))>>0]|0)<<2)>>2];if((fe[b>>2]|0)>>>0<=t>>>0){fe[C>>2]=1154;fe[C+4>>2]=903;fe[C+8>>2]=1781;xe(w,1100,C)|0;be(w,pe)|0}fe[p+(l+12)>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2]}}while(0);u=u+1|0}while((u|0)!=2)}else{fe[p>>2]=fe[E+((me[1831+(c<<2)>>0]|0)<<2)>>2];D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;if((fe[b>>2]|0)>>>0<=t>>>0){fe[M>>2]=1154;fe[M+4>>2]=903;fe[M+8>>2]=1781;xe(w,1100,M)|0;be(w,se)|0}fe[p+4>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2];fe[p+8>>2]=fe[E+((me[1831+(c<<2)+1>>0]|0)<<2)>>2];D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;if((fe[b>>2]|0)>>>0<=t>>>0){fe[A>>2]=1154;fe[A+4>>2]=903;fe[A+8>>2]=1781;xe(w,1100,A)|0;be(w,oe)|0}fe[p+12>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2];fe[p+(T<<2)>>2]=fe[E+((me[1831+(c<<2)+2>>0]|0)<<2)>>2];D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;if((fe[b>>2]|0)>>>0<=t>>>0){fe[k>>2]=1154;fe[k+4>>2]=903;fe[k+8>>2]=1781;xe(w,1100,k)|0;be(w,ae)|0}fe[p+(H<<2)>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2];fe[p+(Y<<2)>>2]=fe[E+((me[1831+(c<<2)+3>>0]|0)<<2)>>2];D=(ye(y,v)|0)+t|0;L=D-x|0;t=L>>31;t=t&D|L&~t;if((fe[b>>2]|0)>>>0<=t>>>0){fe[P>>2]=1154;fe[P+4>>2]=903;fe[P+8>>2]=1781;xe(w,1100,P)|0;be(w,ue)|0}fe[p+(W<<2)>>2]=fe[(fe[g>>2]|0)+(t<<2)>>2]}a=a+d|0;if((a|0)==(G|0))break;else p=p+U|0}}m=m+1|0;if((m|0)==(s|0))break;else f=f+Z|0}}_=_+1|0}while((_|0)!=(X|0));ge=I;return 1}function Wt(e,t,i,r,n,s,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;o=o|0;a=a|0;var l=0,u=0,h=0,c=0,p=0,d=0,F=0,N=0,f=0,m=0,_=0,g=0,v=0,z=0,B=0,y=0,b=0,x=0,T=0,U=0,w=0,j=0,G=0,X=0,H=0,Y=0,W=0,V=0,q=0,K=0,Z=0,E=0,J=0,Q=0,$=0,S=0,ee=0,te=0,A=0,ie=0,k=0,re=0,ne=0,se=0,P=0,oe=0,ae=0,O=0,le=0,R=0,ue=0,C=0,he=0,M=0,ce=0,pe=0,I=0,D=0,L=0;D=ge;ge=ge+640|0;ce=D+88|0;M=D+72|0;he=D+64|0;C=D+48|0;ue=D+40|0;I=D+24|0;pe=D+16|0;R=D;O=D+128|0;le=D+112|0;ae=D+96|0;E=e+240|0;J=fe[E>>2]|0;S=e+256|0;se=fe[S>>2]|0;P=e+272|0;oe=fe[P>>2]|0;i=fe[e+88>>2]|0;Q=(me[i+63>>0]|0)<<8|(me[i+64>>0]|0);i=de[i+17>>0]|0;if(!(i<<24>>24)){ge=D;return 1}$=(a|0)==0;ee=a+-1|0;te=r<<1;A=e+92|0;ie=e+116|0;k=o+-1|0;re=e+212|0;ne=e+188|0;Z=(n&1|0)==0;K=(s&1|0)==0;X=e+288|0;H=e+284|0;Y=e+252|0;W=e+140|0;V=e+236|0;q=e+164|0;j=e+268|0;G=k<<5;U=i&255;i=0;n=0;s=0;e=0;l=1;w=0;do{if(!$){x=fe[t+(w<<2)>>2]|0;T=0;while(1){y=T&1;u=(y|0)==0;B=(y<<6^64)+-32|0;y=(y<<1^2)+-1|0;b=u?o:-1;h=u?0:k;if((h|0)!=(b|0)){z=K|(T|0)!=(ee|0);v=u?x:x+G|0;while(1){if((l|0)==1)l=ye(A,ie)|0|512;g=l&7;l=l>>>3;c=me[1823+g>>0]|0;u=0;do{m=(ye(A,q)|0)+n|0;_=m-oe|0;n=_>>31;n=n&m|_&~n;if((fe[P>>2]|0)>>>0<=n>>>0){fe[R>>2]=1154;fe[R+4>>2]=903;fe[R+8>>2]=1781;xe(O,1100,R)|0;be(O,pe)|0}fe[ae+(u<<2)>>2]=_e[(fe[j>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0>>0);u=0;do{m=(ye(A,W)|0)+e|0;_=m-J|0;e=_>>31;e=e&m|_&~e;if((fe[E>>2]|0)>>>0<=e>>>0){fe[I>>2]=1154;fe[I+4>>2]=903;fe[I+8>>2]=1781;xe(O,1100,I)|0;be(O,ue)|0}fe[le+(u<<2)>>2]=fe[(fe[V>>2]|0)+(e<<2)>>2];u=u+1|0}while(u>>>0>>0);_=Z|(h|0)!=(k|0);f=0;m=v;while(1){N=z|(f|0)==0;F=f<<1;p=0;d=m;while(1){c=(ye(A,re)|0)+i|0;u=c-Q|0;i=u>>31;i=i&c|u&~i;u=(ye(A,ne)|0)+s|0;c=u-se|0;s=c>>31;s=s&u|c&~s;if((_|(p|0)==0)&N){u=me[p+F+(1831+(g<<2))>>0]|0;c=i*3|0;if((fe[X>>2]|0)>>>0<=c>>>0){fe[C>>2]=1154;fe[C+4>>2]=903;fe[C+8>>2]=1781;xe(O,1100,C)|0;be(O,he)|0}L=fe[H>>2]|0;fe[d>>2]=(_e[L+(c<<1)>>1]|0)<<16|fe[ae+(u<<2)>>2];fe[d+4>>2]=(_e[L+(c+2<<1)>>1]|0)<<16|(_e[L+(c+1<<1)>>1]|0);fe[d+8>>2]=fe[le+(u<<2)>>2];if((fe[S>>2]|0)>>>0<=s>>>0){fe[M>>2]=1154;fe[M+4>>2]=903;fe[M+8>>2]=1781;xe(O,1100,M)|0;be(O,ce)|0}fe[d+12>>2]=fe[(fe[Y>>2]|0)+(s<<2)>>2]}p=p+1|0;if((p|0)==2)break;else d=d+16|0}f=f+1|0;if((f|0)==2)break;else m=m+r|0}h=h+y|0;if((h|0)==(b|0))break;else v=v+B|0}}T=T+1|0;if((T|0)==(a|0))break;else x=x+te|0}}w=w+1|0}while((w|0)!=(U|0));ge=D;return 1}function Vt(e,t,i,r,n,s,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;o=o|0;a=a|0;var l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,F=0,N=0,v=0,y=0,b=0,x=0,T=0,z=0,B=0,U=0,j=0,w=0,E=0,G=0,X=0,S=0,H=0,A=0,Y=0,W=0,V=0,k=0,q=0,P=0,O=0,R=0,C=0,M=0,K=0,I=0,Z=0,J=0,D=0,L=0;L=ge;ge=ge+608|0;Z=L+64|0;I=L+48|0;K=L+40|0;D=L+24|0;J=L+16|0;M=L;C=L+88|0;R=L+72|0;S=e+272|0;H=fe[S>>2]|0;i=fe[e+88>>2]|0;A=(me[i+63>>0]|0)<<8|(me[i+64>>0]|0);i=de[i+17>>0]|0;if(!(i<<24>>24)){ge=L;return 1}Y=(a|0)==0;W=a+-1|0;V=r<<1;k=e+92|0;q=e+116|0;P=o+-1|0;O=e+212|0;X=(s&1|0)==0;w=e+288|0;E=e+284|0;G=e+164|0;U=e+268|0;j=P<<4;B=i&255;z=(n&1|0)!=0;i=0;s=0;e=1;T=0;do{if(!Y){b=fe[t+(T<<2)>>2]|0;x=0;while(1){v=x&1;n=(v|0)==0;N=(v<<5^32)+-16|0;v=(v<<1^2)+-1|0;y=n?o:-1;l=n?0:P;if((l|0)!=(y|0)){F=X|(x|0)!=(W|0);g=n?b:b+j|0;while(1){if((e|0)==1)e=ye(k,q)|0|512;_=e&7;e=e>>>3;u=me[1823+_>>0]|0;n=0;do{f=(ye(k,G)|0)+s|0;m=f-H|0;s=m>>31;s=s&f|m&~s;if((fe[S>>2]|0)>>>0<=s>>>0){fe[M>>2]=1154;fe[M+4>>2]=903;fe[M+8>>2]=1781;xe(C,1100,M)|0;be(C,J)|0}fe[R+(n<<2)>>2]=_e[(fe[U>>2]|0)+(s<<1)>>1];n=n+1|0}while(n>>>0>>0);m=(l|0)==(P|0)&z;d=0;f=g;while(1){p=F|(d|0)==0;c=d<<1;n=(ye(k,O)|0)+i|0;h=n-A|0;u=h>>31;u=u&n|h&~u;if(p){i=me[1831+(_<<2)+c>>0]|0;n=u*3|0;if((fe[w>>2]|0)>>>0<=n>>>0){fe[D>>2]=1154;fe[D+4>>2]=903;fe[D+8>>2]=1781;xe(C,1100,D)|0;be(C,K)|0}h=fe[E>>2]|0;fe[f>>2]=(_e[h+(n<<1)>>1]|0)<<16|fe[R+(i<<2)>>2];fe[f+4>>2]=(_e[h+(n+2<<1)>>1]|0)<<16|(_e[h+(n+1<<1)>>1]|0)}h=f+8|0;n=(ye(k,O)|0)+u|0;u=n-A|0;i=u>>31;i=i&n|u&~i;if(!(m|p^1)){n=me[(c|1)+(1831+(_<<2))>>0]|0;u=i*3|0;if((fe[w>>2]|0)>>>0<=u>>>0){fe[I>>2]=1154;fe[I+4>>2]=903;fe[I+8>>2]=1781;xe(C,1100,I)|0;be(C,Z)|0}p=fe[E>>2]|0;fe[h>>2]=(_e[p+(u<<1)>>1]|0)<<16|fe[R+(n<<2)>>2];fe[f+12>>2]=(_e[p+(u+2<<1)>>1]|0)<<16|(_e[p+(u+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else f=f+r|0}l=l+v|0;if((l|0)==(y|0))break;else g=g+N|0}}x=x+1|0;if((x|0)==(a|0))break;else b=b+V|0}}T=T+1|0}while((T|0)!=(B|0));ge=L;return 1}function qt(e,t,i,r,n,s,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;o=o|0;a=a|0;var l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,F=0,N=0,g=0,v=0,y=0,b=0,x=0,z=0,B=0,T=0,w=0,E=0,S=0,U=0,A=0,j=0,G=0,X=0,H=0,Y=0,W=0,V=0,k=0,q=0,K=0,Z=0,J=0,Q=0,P=0,$=0,O=0,ee=0,te=0,ie=0,R=0,C=0,re=0,M=0,ne=0,I=0,se=0,oe=0,D=0,L=0;L=ge;ge=ge+640|0;se=L+88|0;I=L+72|0;ne=L+64|0;M=L+48|0;re=L+40|0;D=L+24|0;oe=L+16|0;C=L;R=L+128|0;te=L+112|0;ie=L+96|0;k=e+272|0;q=fe[k>>2]|0;i=fe[e+88>>2]|0;K=(me[i+63>>0]|0)<<8|(me[i+64>>0]|0);i=de[i+17>>0]|0;if(!(i<<24>>24)){ge=L;return 1}Z=(a|0)==0;J=a+-1|0;Q=r<<1;P=e+92|0;$=e+116|0;O=o+-1|0;ee=e+212|0;V=(n&1|0)==0;W=(s&1|0)==0;X=e+288|0;H=e+284|0;Y=e+164|0;j=e+268|0;G=O<<5;U=i&255;i=0;n=0;s=0;e=0;l=1;A=0;do{if(!Z){E=fe[t+(A<<2)>>2]|0;S=0;while(1){T=S&1;u=(T|0)==0;B=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;w=u?o:-1;h=u?0:O;if((h|0)!=(w|0)){z=W|(S|0)!=(J|0);x=u?E:E+G|0;while(1){if((l|0)==1)l=ye(P,$)|0|512;b=l&7;l=l>>>3;c=me[1823+b>>0]|0;u=0;do{v=(ye(P,Y)|0)+e|0;y=v-q|0;e=y>>31;e=e&v|y&~e;if((fe[k>>2]|0)>>>0<=e>>>0){fe[C>>2]=1154;fe[C+4>>2]=903;fe[C+8>>2]=1781;xe(R,1100,C)|0;be(R,oe)|0}fe[te+(u<<2)>>2]=_e[(fe[j>>2]|0)+(e<<1)>>1];u=u+1|0}while(u>>>0>>0);u=0;do{v=(ye(P,Y)|0)+n|0;y=v-q|0;n=y>>31;n=n&v|y&~n;if((fe[k>>2]|0)>>>0<=n>>>0){fe[D>>2]=1154;fe[D+4>>2]=903;fe[D+8>>2]=1781;xe(R,1100,D)|0;be(R,re)|0}fe[ie+(u<<2)>>2]=_e[(fe[j>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0>>0);y=V|(h|0)!=(O|0);g=0;v=x;while(1){N=z|(g|0)==0;F=g<<1;m=0;_=v;while(1){f=(ye(P,ee)|0)+s|0;d=f-K|0;s=d>>31;s=s&f|d&~s;d=(ye(P,ee)|0)+i|0;f=d-K|0;i=f>>31;i=i&d|f&~i;if((y|(m|0)==0)&N){d=me[m+F+(1831+(b<<2))>>0]|0;f=s*3|0;u=fe[X>>2]|0;if(u>>>0<=f>>>0){fe[M>>2]=1154;fe[M+4>>2]=903;fe[M+8>>2]=1781;xe(R,1100,M)|0;be(R,ne)|0;u=fe[X>>2]|0}c=fe[H>>2]|0;p=i*3|0;if(u>>>0>p>>>0)u=c;else{fe[I>>2]=1154;fe[I+4>>2]=903;fe[I+8>>2]=1781;xe(R,1100,I)|0;be(R,se)|0;u=fe[H>>2]|0}fe[_>>2]=(_e[c+(f<<1)>>1]|0)<<16|fe[te+(d<<2)>>2];fe[_+4>>2]=(_e[c+(f+2<<1)>>1]|0)<<16|(_e[c+(f+1<<1)>>1]|0);fe[_+8>>2]=(_e[u+(p<<1)>>1]|0)<<16|fe[ie+(d<<2)>>2];fe[_+12>>2]=(_e[u+(p+2<<1)>>1]|0)<<16|(_e[u+(p+1<<1)>>1]|0)}m=m+1|0;if((m|0)==2)break;else _=_+16|0}g=g+1|0;if((g|0)==2)break;else v=v+r|0}h=h+T|0;if((h|0)==(w|0))break;else x=x+B|0}}S=S+1|0;if((S|0)==(a|0))break;else E=E+Q|0}}A=A+1|0}while((A|0)!=(U|0));ge=L;return 1}function Kt(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0;p=ge;ge=ge+608|0;c=p+88|0;h=p+72|0;l=p+64|0;a=p+48|0;s=p+40|0;o=p+24|0;n=p+16|0;r=p;u=p+96|0;fe[e>>2]=0;t=e+284|0;i=fe[t>>2]|0;if(i){if(!(i&7))X[fe[104>>2]&1](i,0,0,1,fe[27]|0)|0;else{fe[r>>2]=1154;fe[r+4>>2]=2499;fe[r+8>>2]=1516;xe(u,1100,r)|0;be(u,n)|0}fe[t>>2]=0;fe[e+288>>2]=0;fe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;i=fe[t>>2]|0;if(i){if(!(i&7))X[fe[104>>2]&1](i,0,0,1,fe[27]|0)|0;else{fe[o>>2]=1154;fe[o+4>>2]=2499;fe[o+8>>2]=1516;xe(u,1100,o)|0;be(u,s)|0}fe[t>>2]=0;fe[e+272>>2]=0;fe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;i=fe[t>>2]|0;if(i){if(!(i&7))X[fe[104>>2]&1](i,0,0,1,fe[27]|0)|0;else{fe[a>>2]=1154;fe[a+4>>2]=2499;fe[a+8>>2]=1516;xe(u,1100,a)|0;be(u,l)|0}fe[t>>2]=0;fe[e+256>>2]=0;fe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;i=fe[t>>2]|0;if(!i){c=e+248|0;de[c>>0]=0;c=e+212|0;N(c);c=e+188|0;N(c);c=e+164|0;N(c);c=e+140|0;N(c);c=e+116|0;N(c);ge=p;return}if(!(i&7))X[fe[104>>2]&1](i,0,0,1,fe[27]|0)|0;else{fe[h>>2]=1154;fe[h+4>>2]=2499;fe[h+8>>2]=1516;xe(u,1100,h)|0;be(u,c)|0}fe[t>>2]=0;fe[e+240>>2]=0;fe[e+244>>2]=0;c=e+248|0;de[c>>0]=0;c=e+212|0;N(c);c=e+188|0;N(c);c=e+164|0;N(c);c=e+140|0;N(c);c=e+116|0;N(c);ge=p}function l(e,t){e=e|0;t=t|0;var i=0;i=ge;ge=ge+16|0;fe[i>>2]=t;t=fe[63]|0;Oi(t,e,i)|0;Pi(10,t)|0;B()}function Zt(){var e=0,t=0;e=ge;ge=ge+16|0;if(!(it(200,2)|0)){t=et(fe[49]|0)|0;ge=e;return t|0}else l(2090,e);return 0}function Jt(e){e=e|0;b(e)}function Qt(e){e=e|0;var t=0;t=ge;ge=ge+16|0;Mr[e&3]();l(2139,t)}function $t(){var e=0,t=0;e=Zt()|0;if(((e|0)!=0?(t=fe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(fe[e>>2]&-256|0)==1126902528?(fe[e+4>>2]|0)==1129074247:0):0)Qt(fe[t+12>>2]|0);t=fe[28]|0;fe[28]=t+0;Qt(t)}function ei(e){e=e|0}function ti(e){e=e|0;return}function ii(e){e=e|0;return}function ri(e){e=e|0;return}function ni(e){e=e|0;Jt(e);return}function si(e){e=e|0;Jt(e);return}function oi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0;o=ge;ge=ge+64|0;s=o;if((e|0)!=(t|0))if((t|0)!=0?(n=hi(t,24,40,0)|0,(n|0)!=0):0){t=s;r=t+56|0;do{fe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));fe[s>>2]=n;fe[s+8>>2]=e;fe[s+12>>2]=-1;fe[s+48>>2]=1;Dr[fe[(fe[n>>2]|0)+28>>2]&3](n,s,fe[i>>2]|0,1);if((fe[s+24>>2]|0)==1){fe[i>>2]=fe[s+16>>2];t=1}else t=0}else t=0;else t=1;ge=o;return t|0}function ai(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0;e=t+16|0;n=fe[e>>2]|0;do{if(n){if((n|0)!=(i|0)){r=t+36|0;fe[r>>2]=(fe[r>>2]|0)+1;fe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((fe[e>>2]|0)==2)fe[e>>2]=r}else{fe[e>>2]=i;fe[t+24>>2]=r;fe[t+36>>2]=1}}while(0)}function li(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;if((e|0)==(fe[t+8>>2]|0))ai(0,t,i,r);return}function ui(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;if((e|0)==(fe[t+8>>2]|0))ai(0,t,i,r);else{e=fe[e+8>>2]|0;Dr[fe[(fe[e>>2]|0)+28>>2]&3](e,t,i,r)}return}function hi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0;d=ge;ge=ge+64|0;p=d;c=fe[e>>2]|0;h=e+(fe[c+-8>>2]|0)|0;c=fe[c+-4>>2]|0;fe[p>>2]=i;fe[p+4>>2]=e;fe[p+8>>2]=t;fe[p+12>>2]=r;r=p+16|0;e=p+20|0;t=p+24|0;n=p+28|0;s=p+32|0;o=p+40|0;a=(c|0)==(i|0);l=r;u=l+36|0;do{fe[l>>2]=0;l=l+4|0}while((l|0)<(u|0));$[r+36>>1]=0;de[r+38>>0]=0;e:do{if(a){fe[p+48>>2]=1;Ir[fe[(fe[i>>2]|0)+20>>2]&3](i,p,h,h,1,0);r=(fe[t>>2]|0)==1?h:0}else{Pr[fe[(fe[c>>2]|0)+24>>2]&3](c,p,h,1,0);switch(fe[p+36>>2]|0){case 0:{r=(fe[o>>2]|0)==1&(fe[n>>2]|0)==1&(fe[s>>2]|0)==1?fe[e>>2]|0:0;break e}case 1:break;default:{r=0;break e}}if((fe[t>>2]|0)!=1?!((fe[o>>2]|0)==0&(fe[n>>2]|0)==1&(fe[s>>2]|0)==1):0){r=0;break}r=fe[r>>2]|0}}while(0);ge=d;return r|0}function ci(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;de[t+53>>0]=1;do{if((fe[t+4>>2]|0)==(r|0)){de[t+52>>0]=1;r=t+16|0;e=fe[r>>2]|0;if(!e){fe[r>>2]=i;fe[t+24>>2]=n;fe[t+36>>2]=1;if(!((n|0)==1?(fe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(i|0)){n=t+36|0;fe[n>>2]=(fe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;r=fe[e>>2]|0;if((r|0)==2){fe[e>>2]=n;r=n}if((r|0)==1?(fe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0)}function pi(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0,l=0;e:do{if((e|0)==(fe[t+8>>2]|0)){if((fe[t+4>>2]|0)==(i|0)?(s=t+28|0,(fe[s>>2]|0)!=1):0)fe[s>>2]=r}else{if((e|0)!=(fe[t>>2]|0)){a=fe[e+8>>2]|0;Pr[fe[(fe[a>>2]|0)+24>>2]&3](a,t,i,r,n);break}if((fe[t+16>>2]|0)!=(i|0)?(o=t+20|0,(fe[o>>2]|0)!=(i|0)):0){fe[t+32>>2]=r;r=t+44|0;if((fe[r>>2]|0)==4)break;s=t+52|0;de[s>>0]=0;l=t+53|0;de[l>>0]=0;e=fe[e+8>>2]|0;Ir[fe[(fe[e>>2]|0)+20>>2]&3](e,t,i,i,1,n);if(de[l>>0]|0){if(!(de[s>>0]|0)){s=1;a=13}}else{s=0;a=13}do{if((a|0)==13){fe[o>>2]=i;l=t+40|0;fe[l>>2]=(fe[l>>2]|0)+1;if((fe[t+36>>2]|0)==1?(fe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(s)break}else a=16;if((a|0)==16?s:0)break;fe[r>>2]=4;break e}}while(0);fe[r>>2]=3;break}if((r|0)==1)fe[t+32>>2]=1}}while(0);return}function di(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0;do{if((e|0)==(fe[t+8>>2]|0)){if((fe[t+4>>2]|0)==(i|0)?(o=t+28|0,(fe[o>>2]|0)!=1):0)fe[o>>2]=r}else if((e|0)==(fe[t>>2]|0)){if((fe[t+16>>2]|0)!=(i|0)?(s=t+20|0,(fe[s>>2]|0)!=(i|0)):0){fe[t+32>>2]=r;fe[s>>2]=i;n=t+40|0;fe[n>>2]=(fe[n>>2]|0)+1;if((fe[t+36>>2]|0)==1?(fe[t+24>>2]|0)==2:0)de[t+54>>0]=1;fe[t+44>>2]=4;break}if((r|0)==1)fe[t+32>>2]=1}}while(0);return}function fi(e,t,i,r,n,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;if((e|0)==(fe[t+8>>2]|0))ci(0,t,i,r,n);else{e=fe[e+8>>2]|0;Ir[fe[(fe[e>>2]|0)+20>>2]&3](e,t,i,r,n,s)}return}function mi(e,t,i,r,n,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;if((e|0)==(fe[t+8>>2]|0))ci(0,t,i,r,n);return}function _i(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;n=ge;ge=ge+16|0;r=n;fe[r>>2]=fe[i>>2];e=v[fe[(fe[e>>2]|0)+16>>2]&7](e,t,r)|0;if(e)fe[i>>2]=fe[r>>2];ge=n;return e&1|0}function gi(e){e=e|0;if(!e)e=0;else e=(hi(e,24,72,0)|0)!=0;return e&1|0}function vi(){var e=0,t=0,i=0,r=0,n=0,s=0,o=0,a=0;n=ge;ge=ge+48|0;o=n+32|0;i=n+24|0;a=n+16|0;s=n;n=n+36|0;e=Zt()|0;if((e|0)!=0?(r=fe[e>>2]|0,(r|0)!=0):0){e=r+48|0;t=fe[e>>2]|0;e=fe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){fe[i>>2]=fe[51];l(2368,i)}if((t|0)==1126902529&(e|0)==1129074247)e=fe[r+44>>2]|0;else e=r+80|0;fe[n>>2]=e;r=fe[r>>2]|0;e=fe[r+4>>2]|0;if(v[fe[(fe[8>>2]|0)+16>>2]&7](8,r,n)|0){a=fe[n>>2]|0;n=fe[51]|0;a=Rr[fe[(fe[a>>2]|0)+8>>2]&1](a)|0;fe[s>>2]=n;fe[s+4>>2]=e;fe[s+8>>2]=a;l(2282,s)}else{fe[a>>2]=fe[51];fe[a+4>>2]=e;l(2327,a)}}l(2406,o)}function yi(){var e=0;e=ge;ge=ge+16|0;if(!(rt(196,6)|0)){ge=e;return}else l(2179,e)}function bi(e){e=e|0;var t=0;t=ge;ge=ge+16|0;b(e);if(!(ot(fe[49]|0,0)|0)){ge=t;return}else l(2229,t)}function xi(e){e=e|0;var t=0,i=0;t=0;while(1){if((me[2427+t>>0]|0)==(e|0)){i=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;i=5;break}}if((i|0)==2)if(!t)e=2515;else{e=2515;i=5}if((i|0)==5)while(1){i=e;while(1){e=i+1|0;if(!(de[i>>0]|0))break;else i=e}t=t+-1|0;if(!t)break;else i=5}return e|0}function re(){var e=0;if(!(fe[52]|0))e=264;else{e=(tt()|0)+60|0;e=fe[e>>2]|0}return e|0}function Ti(e){e=e|0;var t=0;if(e>>>0>4294963200){t=re()|0;fe[t>>2]=0-e;e=-1}return e|0}function wi(e,t){e=+e;t=t|0;var i=0,r=0,n=0;ee[te>>3]=e;i=fe[te>>2]|0;r=fe[te+4>>2]|0;n=Ji(i|0,r|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+wi(e*18446744073709552.0e3,t);i=(fe[t>>2]|0)+-64|0}else i=0;fe[t>>2]=i;break}case 2047:break;default:{fe[t>>2]=n+-1022;fe[te>>2]=i;fe[te+4>>2]=r&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function Ei(e,t){e=+e;t=t|0;return+ +wi(e,t)}function Si(e,t,i){e=e|0;t=t|0;i=i|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=re()|0;fe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function Ai(e,t){e=e|0;t=t|0;if(!e)e=0;else e=Si(e,t,0)|0;return e|0}function ki(e){e=e|0;var t=0,i=0;do{if(e){if((fe[e+76>>2]|0)<=-1){t=Ui(e)|0;break}i=(Mi(e)|0)==0;t=Ui(e)|0;if(!i)g(e)}else{if(!(fe[65]|0))t=0;else t=ki(fe[65]|0)|0;at(236);e=fe[58]|0;if(e)do{if((fe[e+76>>2]|0)>-1)i=Mi(e)|0;else i=0;if((fe[e+20>>2]|0)>>>0>(fe[e+28>>2]|0)>>>0)t=Ui(e)|0|t;if(i)g(e);e=fe[e+56>>2]|0}while((e|0)!=0);nt(236)}}while(0);return t|0}function Pi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0;if((fe[t+76>>2]|0)>=0?(Mi(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(r=t+20|0,n=fe[r>>2]|0,n>>>0<(fe[t+16>>2]|0)>>>0):0){fe[r>>2]=n+1;de[n>>0]=e;i=e&255}else i=Ii(t,e)|0;g(t)}else o=3;do{if((o|0)==3){if((de[t+75>>0]|0)!=(e|0)?(s=t+20|0,i=fe[s>>2]|0,i>>>0<(fe[t+16>>2]|0)>>>0):0){fe[s>>2]=i+1;de[i>>0]=e;i=e&255;break}i=Ii(t,e)|0}}while(0);return i|0}function ne(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0;r=i+16|0;n=fe[r>>2]|0;if(!n)if(!(zi(i)|0)){n=fe[r>>2]|0;s=4}else r=0;else s=4;e:do{if((s|0)==4){o=i+20|0;s=fe[o>>2]|0;if((n-s|0)>>>0>>0){r=v[fe[i+36>>2]&7](i,e,t)|0;break}t:do{if((de[i+75>>0]|0)>-1){r=t;while(1){if(!r){n=s;r=0;break t}n=r+-1|0;if((de[e+n>>0]|0)==10)break;else r=n}if((v[fe[i+36>>2]&7](i,e,r)|0)>>>0>>0)break e;t=t-r|0;e=e+r|0;n=fe[o>>2]|0}else{n=s;r=0}}while(0);er(n|0,e|0,t|0)|0;fe[o>>2]=(fe[o>>2]|0)+t;r=r+t|0}}while(0);return r|0}function be(e,t){e=e|0;t=t|0;var i=0,r=0;i=ge;ge=ge+16|0;r=i;fe[r>>2]=t;t=Oi(fe[64]|0,e,r)|0;ge=i;return t|0}function xe(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;r=ge;ge=ge+16|0;n=r;fe[n>>2]=i;i=Ci(e,t,n)|0;ge=r;return i|0}function Oi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0;m=ge;ge=ge+224|0;c=m+120|0;f=m+80|0;d=m;p=m+136|0;r=f;n=r+40|0;do{fe[r>>2]=0;r=r+4|0}while((r|0)<(n|0));fe[c>>2]=fe[i>>2];if((ji(0,t,c,d,f)|0)<0)i=-1;else{if((fe[e+76>>2]|0)>-1)u=Mi(e)|0;else u=0;i=fe[e>>2]|0;h=i&32;if((de[e+74>>0]|0)<1)fe[e>>2]=i&-33;i=e+48|0;if(!(fe[i>>2]|0)){n=e+44|0;s=fe[n>>2]|0;fe[n>>2]=p;o=e+28|0;fe[o>>2]=p;a=e+20|0;fe[a>>2]=p;fe[i>>2]=80;l=e+16|0;fe[l>>2]=p+80;r=ji(e,t,c,d,f)|0;if(s){v[fe[e+36>>2]&7](e,0,0)|0;r=(fe[a>>2]|0)==0?-1:r;fe[n>>2]=s;fe[i>>2]=0;fe[l>>2]=0;fe[o>>2]=0;fe[a>>2]=0}}else r=ji(e,t,c,d,f)|0;i=fe[e>>2]|0;fe[e>>2]=i|h;if(u)g(e);i=(i&32|0)==0?r:-1}ge=m;return i|0}function Ri(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0,o=0,a=0,l=0,u=0,h=0;h=ge;ge=ge+128|0;n=h+112|0;u=h;s=u;o=268;a=s+112|0;do{fe[s>>2]=fe[o>>2];s=s+4|0;o=o+4|0}while((s|0)<(a|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;l=4}else{t=re()|0;fe[t>>2]=75;t=-1}else{n=e;l=4}if((l|0)==4){l=-2-n|0;l=t>>>0>l>>>0?l:t;fe[u+48>>2]=l;e=u+20|0;fe[e>>2]=n;fe[u+44>>2]=n;t=n+l|0;n=u+16|0;fe[n>>2]=t;fe[u+28>>2]=t;t=Oi(u,i,r)|0;if(l){i=fe[e>>2]|0;de[i+(((i|0)==(fe[n>>2]|0))<<31>>31)>>0]=0}}ge=h;return t|0}function Ci(e,t,i){e=e|0;t=t|0;i=i|0;return Ri(e,2147483647,t,i)|0}function Mi(e){e=e|0;return 0}function g(e){e=e|0}function Ii(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0;l=ge;ge=ge+16|0;a=l;o=t&255;de[a>>0]=o;r=e+16|0;n=fe[r>>2]|0;if(!n)if(!(zi(e)|0)){n=fe[r>>2]|0;s=4}else i=-1;else s=4;do{if((s|0)==4){r=e+20|0;s=fe[r>>2]|0;if(s>>>0>>0?(i=t&255,(i|0)!=(de[e+75>>0]|0)):0){fe[r>>2]=s+1;de[s>>0]=o;break}if((v[fe[e+36>>2]&7](e,a,1)|0)==1)i=me[a>>0]|0;else i=-1}}while(0);ge=l;return i|0}function Di(e){e=e|0;var t=0,i=0;t=ge;ge=ge+16|0;i=t;fe[i>>2]=fe[e+60>>2];e=Ti(Ve(6,i|0)|0)|0;ge=t;return e|0}function Li(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0;n=ge;ge=ge+32|0;s=n;r=n+20|0;fe[s>>2]=fe[e+60>>2];fe[s+4>>2]=0;fe[s+8>>2]=t;fe[s+12>>2]=r;fe[s+16>>2]=i;if((Ti(ht(140,s|0)|0)|0)<0){fe[r>>2]=-1;e=-1}else e=fe[r>>2]|0;ge=n;return e|0}function Fi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0;f=ge;ge=ge+48|0;c=f+16|0;h=f;r=f+32|0;p=e+28|0;n=fe[p>>2]|0;fe[r>>2]=n;d=e+20|0;n=(fe[d>>2]|0)-n|0;fe[r+4>>2]=n;fe[r+8>>2]=t;fe[r+12>>2]=i;l=e+60|0;u=e+44|0;t=2;n=n+i|0;while(1){if(!(fe[52]|0)){fe[c>>2]=fe[l>>2];fe[c+4>>2]=r;fe[c+8>>2]=t;o=Ti(ct(146,c|0)|0)|0}else{lt(7,e|0);fe[h>>2]=fe[l>>2];fe[h+4>>2]=r;fe[h+8>>2]=t;o=Ti(ct(146,h|0)|0)|0;Ye(0)}if((n|0)==(o|0)){n=6;break}if((o|0)<0){n=8;break}n=n-o|0;s=fe[r+4>>2]|0;if(o>>>0<=s>>>0)if((t|0)==2){fe[p>>2]=(fe[p>>2]|0)+o;a=s;t=2}else a=s;else{a=fe[u>>2]|0;fe[p>>2]=a;fe[d>>2]=a;a=fe[r+12>>2]|0;o=o-s|0;r=r+8|0;t=t+-1|0}fe[r>>2]=(fe[r>>2]|0)+o;fe[r+4>>2]=a-o}if((n|0)==6){c=fe[u>>2]|0;fe[e+16>>2]=c+(fe[e+48>>2]|0);e=c;fe[p>>2]=e;fe[d>>2]=e}else if((n|0)==8){fe[e+16>>2]=0;fe[p>>2]=0;fe[d>>2]=0;fe[e>>2]=fe[e>>2]|32;if((t|0)==2)i=0;else i=i-(fe[r+4>>2]|0)|0}ge=f;return i|0}function Ni(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;n=ge;ge=ge+80|0;r=n;fe[e+36>>2]=3;if((fe[e>>2]&64|0)==0?(fe[r>>2]=fe[e+60>>2],fe[r+4>>2]=21505,fe[r+8>>2]=n+12,(We(54,r|0)|0)!=0):0)de[e+75>>0]=-1;r=Fi(e,t,i)|0;ge=n;return r|0}function zi(e){e=e|0;var t=0,i=0;t=e+74|0;i=de[t>>0]|0;de[t>>0]=i+255|i;t=fe[e>>2]|0;if(!(t&8)){fe[e+8>>2]=0;fe[e+4>>2]=0;t=fe[e+44>>2]|0;fe[e+28>>2]=t;fe[e+20>>2]=t;fe[e+16>>2]=t+(fe[e+48>>2]|0);t=0}else{fe[e>>2]=t|32;t=-1}return t|0}function Bi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0;s=t&255;r=(i|0)!=0;e:do{if(r&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){o=6;break e}e=e+1|0;i=i+-1|0;r=(i|0)!=0;if(!(r&(e&3|0)!=0)){o=5;break}}}else o=5}while(0);if((o|0)==5)if(r)o=6;else i=0;e:do{if((o|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){r=ve(s,16843009)|0;t:do{if(i>>>0>3)while(1){s=fe[e>>2]^r;if((s&-2139062144^-2139062144)&s+-16843009)break;e=e+4|0;i=i+-4|0;if(i>>>0<=3){o=11;break t}}else o=11}while(0);if((o|0)==11)if(!i){i=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;i=i+-1|0;if(!i){i=0;break}}}}}while(0);return((i|0)!=0?e:0)|0}function Ui(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0;t=e+20|0;s=e+28|0;if((fe[t>>2]|0)>>>0>(fe[s>>2]|0)>>>0?(v[fe[e+36>>2]&7](e,0,0)|0,(fe[t>>2]|0)==0):0)t=-1;else{o=e+4|0;i=fe[o>>2]|0;r=e+8|0;n=fe[r>>2]|0;if(i>>>0>>0)v[fe[e+40>>2]&7](e,i-n|0,1)|0;fe[e+16>>2]=0;fe[s>>2]=0;fe[t>>2]=0;fe[r>>2]=0;fe[o>>2]=0;t=0}return t|0}function ji(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0,l=0,u=0.0,h=0,c=0,p=0,d=0,f=0.0,m=0,_=0,g=0,v=0,F=0,y=0,b=0,x=0,T=0,w=0,E=0,S=0,A=0,k=0,P=0,N=0,O=0,z=0,B=0,U=0,R=0,j=0,G=0,X=0,H=0,Y=0,W=0,V=0,q=0,C=0,K=0,M=0,Z=0,I=0,D=0,J=0,Q=0,L=0;L=ge;ge=ge+624|0;Z=L+24|0;D=L+16|0;I=L+588|0;V=L+576|0;M=L;H=L+536|0;Q=L+8|0;J=L+528|0;N=(e|0)!=0;O=H+40|0;X=O;H=H+39|0;Y=Q+4|0;W=V+12|0;V=V+11|0;q=I;C=W;K=C-q|0;z=-2-q|0;B=C+2|0;U=Z+288|0;R=I+9|0;j=R;G=I+8|0;s=0;m=t;o=0;t=0;e:while(1){do{if((s|0)>-1)if((o|0)>(2147483647-s|0)){s=re()|0;fe[s>>2]=75;s=-1;break}else{s=o+s|0;break}}while(0);o=de[m>>0]|0;if(!(o<<24>>24)){P=245;break}else a=m;t:while(1){switch(o<<24>>24){case 37:{o=a;P=9;break t}case 0:{o=a;break t}default:{}}k=a+1|0;o=de[k>>0]|0;a=k}t:do{if((P|0)==9)while(1){P=0;if((de[o+1>>0]|0)!=37)break t;a=a+1|0;o=o+2|0;if((de[o>>0]|0)==37)P=9;else break}}while(0);g=a-m|0;if(N?(fe[e>>2]&32|0)==0:0)ne(m,g,e)|0;if((a|0)!=(m|0)){m=o;o=g;continue}h=o+1|0;a=de[h>>0]|0;l=(a<<24>>24)+-48|0;if(l>>>0<10){k=(de[o+2>>0]|0)==36;h=k?o+3|0:h;a=de[h>>0]|0;d=k?l:-1;t=k?1:t}else d=-1;o=a<<24>>24;t:do{if((o&-32|0)==32){l=0;while(1){if(!(1<>24)+-32|l;h=h+1|0;a=de[h>>0]|0;o=a<<24>>24;if((o&-32|0)!=32){c=l;o=h;break}}}else{c=0;o=h}}while(0);do{if(a<<24>>24==42){l=o+1|0;a=(de[l>>0]|0)+-48|0;if(a>>>0<10?(de[o+2>>0]|0)==36:0){fe[n+(a<<2)>>2]=10;t=1;o=o+3|0;a=fe[r+((de[l>>0]|0)+-48<<3)>>2]|0}else{if(t){s=-1;break e}if(!N){_=c;o=l;t=0;k=0;break}t=(fe[i>>2]|0)+(4-1)&~(4-1);a=fe[t>>2]|0;fe[i>>2]=t+4;t=0;o=l}if((a|0)<0){_=c|8192;k=0-a|0}else{_=c;k=a}}else{l=(a<<24>>24)+-48|0;if(l>>>0<10){a=0;do{a=(a*10|0)+l|0;o=o+1|0;l=(de[o>>0]|0)+-48|0}while(l>>>0<10);if((a|0)<0){s=-1;break e}else{_=c;k=a}}else{_=c;k=0}}}while(0);t:do{if((de[o>>0]|0)==46){l=o+1|0;a=de[l>>0]|0;if(a<<24>>24!=42){h=(a<<24>>24)+-48|0;if(h>>>0<10){o=l;a=0}else{o=l;h=0;break}while(1){a=(a*10|0)+h|0;o=o+1|0;h=(de[o>>0]|0)+-48|0;if(h>>>0>=10){h=a;break t}}}l=o+2|0;a=(de[l>>0]|0)+-48|0;if(a>>>0<10?(de[o+3>>0]|0)==36:0){fe[n+(a<<2)>>2]=10;o=o+4|0;h=fe[r+((de[l>>0]|0)+-48<<3)>>2]|0;break}if(t){s=-1;break e}if(N){o=(fe[i>>2]|0)+(4-1)&~(4-1);h=fe[o>>2]|0;fe[i>>2]=o+4;o=l}else{o=l;h=0}}else h=-1}while(0);p=0;while(1){a=(de[o>>0]|0)+-65|0;if(a>>>0>57){s=-1;break e}l=o+1|0;a=de[5359+(p*58|0)+a>>0]|0;c=a&255;if((c+-1|0)>>>0<8){o=l;p=c}else{A=l;break}}if(!(a<<24>>24)){s=-1;break}l=(d|0)>-1;do{if(a<<24>>24==19)if(l){s=-1;break e}else P=52;else{if(l){fe[n+(d<<2)>>2]=c;E=r+(d<<3)|0;S=fe[E+4>>2]|0;P=M;fe[P>>2]=fe[E>>2];fe[P+4>>2]=S;P=52;break}if(!N){s=0;break e}Hi(M,c,i)}}while(0);if((P|0)==52?(P=0,!N):0){m=A;o=g;continue}d=de[o>>0]|0;d=(p|0)!=0&(d&15|0)==3?d&-33:d;l=_&-65537;S=(_&8192|0)==0?_:l;t:do{switch(d|0){case 110:switch(p|0){case 0:{fe[fe[M>>2]>>2]=s;m=A;o=g;continue e}case 1:{fe[fe[M>>2]>>2]=s;m=A;o=g;continue e}case 2:{m=fe[M>>2]|0;fe[m>>2]=s;fe[m+4>>2]=((s|0)<0)<<31>>31;m=A;o=g;continue e}case 3:{$[fe[M>>2]>>1]=s;m=A;o=g;continue e}case 4:{de[fe[M>>2]>>0]=s;m=A;o=g;continue e}case 6:{fe[fe[M>>2]>>2]=s;m=A;o=g;continue e}case 7:{m=fe[M>>2]|0;fe[m>>2]=s;fe[m+4>>2]=((s|0)<0)<<31>>31;m=A;o=g;continue e}default:{m=A;o=g;continue e}}case 112:{p=S|8;h=h>>>0>8?h:8;d=120;P=64;break}case 88:case 120:{p=S;P=64;break}case 111:{l=M;a=fe[l>>2]|0;l=fe[l+4>>2]|0;if((a|0)==0&(l|0)==0)o=O;else{o=O;do{o=o+-1|0;de[o>>0]=a&7|48;a=Ji(a|0,l|0,3)|0;l=ie}while(!((a|0)==0&(l|0)==0))}if(!(S&8)){a=S;p=0;c=5839;P=77}else{p=X-o+1|0;a=S;h=(h|0)<(p|0)?p:h;p=0;c=5839;P=77}break}case 105:case 100:{a=M;o=fe[a>>2]|0;a=fe[a+4>>2]|0;if((a|0)<0){o=ae(0,0,o|0,a|0)|0;a=ie;l=M;fe[l>>2]=o;fe[l+4>>2]=a;l=1;c=5839;P=76;break t}if(!(S&2048)){c=S&1;l=c;c=(c|0)==0?5839:5841;P=76}else{l=1;c=5840;P=76}break}case 117:{a=M;o=fe[a>>2]|0;a=fe[a+4>>2]|0;l=0;c=5839;P=76;break}case 99:{de[H>>0]=fe[M>>2];m=H;a=1;p=0;d=5839;o=O;break}case 109:{o=re()|0;o=xi(fe[o>>2]|0)|0;P=82;break}case 115:{o=fe[M>>2]|0;o=(o|0)!=0?o:5849;P=82;break}case 67:{fe[Q>>2]=fe[M>>2];fe[Y>>2]=0;fe[M>>2]=Q;h=-1;P=86;break}case 83:{if(!h){oe(e,32,k,0,S);o=0;P=98}else P=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+ee[M>>3];fe[D>>2]=0;ee[te>>3]=u;if((fe[te+4>>2]|0)>=0)if(!(S&2048)){E=S&1;w=E;E=(E|0)==0?5857:5862}else{w=1;E=5859}else{u=-u;w=1;E=5856}ee[te>>3]=u;T=fe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){f=+Ei(u,D)*2.0;a=f!=0.0;if(a)fe[D>>2]=(fe[D>>2]|0)+-1;b=d|32;if((b|0)==97){m=d&32;g=(m|0)==0?E:E+9|0;_=w|2;o=12-h|0;do{if(!(h>>>0>11|(o|0)==0)){u=8.0;do{o=o+-1|0;u=u*16.0}while((o|0)!=0);if((de[g>>0]|0)==45){u=-(u+(-f-u));break}else{u=f+u-u;break}}else u=f}while(0);a=fe[D>>2]|0;o=(a|0)<0?0-a|0:a;o=se(o,((o|0)<0)<<31>>31,W)|0;if((o|0)==(W|0)){de[V>>0]=48;o=V}de[o+-1>>0]=(a>>31&2)+43;p=o+-2|0;de[p>>0]=d+15;c=(h|0)<1;l=(S&8|0)==0;a=I;while(1){E=~~u;o=a+1|0;de[a>>0]=me[5823+E>>0]|m;u=(u-+(E|0))*16.0;do{if((o-q|0)==1){if(l&(c&u==0.0))break;de[o>>0]=46;o=a+2|0}}while(0);if(!(u!=0.0))break;else a=o}h=(h|0)!=0&(z+o|0)<(h|0)?B+h-p|0:K-p+o|0;l=h+_|0;oe(e,32,k,l,S);if(!(fe[e>>2]&32))ne(g,_,e)|0;oe(e,48,k,l,S^65536);o=o-q|0;if(!(fe[e>>2]&32))ne(I,o,e)|0;a=C-p|0;oe(e,48,h-(o+a)|0,0,0);if(!(fe[e>>2]&32))ne(p,a,e)|0;oe(e,32,k,l,S^8192);o=(l|0)<(k|0)?k:l;break}o=(h|0)<0?6:h;if(a){a=(fe[D>>2]|0)+-28|0;fe[D>>2]=a;u=f*268435456.0}else{u=f;a=fe[D>>2]|0}T=(a|0)<0?Z:U;x=T;a=T;do{y=~~u>>>0;fe[a>>2]=y;a=a+4|0;u=(u-+(y>>>0))*1.0e9}while(u!=0.0);l=a;a=fe[D>>2]|0;if((a|0)>0){c=T;while(1){p=(a|0)>29?29:a;h=l+-4|0;do{if(h>>>0>>0)h=c;else{a=0;do{y=Qi(fe[h>>2]|0,0,p|0)|0;y=$i(y|0,ie|0,a|0,0)|0;a=ie;F=lr(y|0,a|0,1e9,0)|0;fe[h>>2]=F;a=ar(y|0,a|0,1e9,0)|0;h=h+-4|0}while(h>>>0>=c>>>0);if(!a){h=c;break}h=c+-4|0;fe[h>>2]=a}}while(0);while(1){if(l>>>0<=h>>>0)break;a=l+-4|0;if(!(fe[a>>2]|0))l=a;else break}a=(fe[D>>2]|0)-p|0;fe[D>>2]=a;if((a|0)>0)c=h;else break}}else h=T;if((a|0)<0){g=((o+25|0)/9|0)+1|0;v=(b|0)==102;m=h;while(1){_=0-a|0;_=(_|0)>9?9:_;do{if(m>>>0>>0){a=(1<<_)+-1|0;c=1e9>>>_;h=0;p=m;do{y=fe[p>>2]|0;fe[p>>2]=(y>>>_)+h;h=ve(y&a,c)|0;p=p+4|0}while(p>>>0>>0);a=(fe[m>>2]|0)==0?m+4|0:m;if(!h){h=a;break}fe[l>>2]=h;h=a;l=l+4|0}else h=(fe[m>>2]|0)==0?m+4|0:m}while(0);a=v?T:h;l=(l-a>>2|0)>(g|0)?a+(g<<2)|0:l;a=(fe[D>>2]|0)+_|0;fe[D>>2]=a;if((a|0)>=0){m=h;break}else m=h}}else m=h;do{if(m>>>0>>0){a=(x-m>>2)*9|0;c=fe[m>>2]|0;if(c>>>0<10)break;else h=10;do{h=h*10|0;a=a+1|0}while(c>>>0>=h>>>0)}else a=0}while(0);F=(b|0)==103;y=(o|0)!=0;h=o-((b|0)!=102?a:0)+((y&F)<<31>>31)|0;if((h|0)<(((l-x>>2)*9|0)+-9|0)){p=h+9216|0;v=(p|0)/9|0;h=T+(v+-1023<<2)|0;p=((p|0)%9|0)+1|0;if((p|0)<9){c=10;do{c=c*10|0;p=p+1|0}while((p|0)!=9)}else c=10;_=fe[h>>2]|0;g=(_>>>0)%(c>>>0)|0;if((g|0)==0?(T+(v+-1022<<2)|0)==(l|0):0)c=m;else P=163;do{if((P|0)==163){P=0;f=(((_>>>0)/(c>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;p=(c|0)/2|0;do{if(g>>>0

>>0)u=.5;else{if((g|0)==(p|0)?(T+(v+-1022<<2)|0)==(l|0):0){u=1.0;break}u=1.5}}while(0);do{if(w){if((de[E>>0]|0)!=45)break;f=-f;u=-u}}while(0);p=_-g|0;fe[h>>2]=p;if(!(f+u!=f)){c=m;break}b=p+c|0;fe[h>>2]=b;if(b>>>0>999999999){a=m;while(1){c=h+-4|0;fe[h>>2]=0;if(c>>>0>>0){a=a+-4|0;fe[a>>2]=0}b=(fe[c>>2]|0)+1|0;fe[c>>2]=b;if(b>>>0>999999999)h=c;else{m=a;h=c;break}}}a=(x-m>>2)*9|0;p=fe[m>>2]|0;if(p>>>0<10){c=m;break}else c=10;do{c=c*10|0;a=a+1|0}while(p>>>0>=c>>>0);c=m}}while(0);b=h+4|0;m=c;l=l>>>0>b>>>0?b:l}g=0-a|0;while(1){if(l>>>0<=m>>>0){v=0;b=l;break}h=l+-4|0;if(!(fe[h>>2]|0))l=h;else{v=1;b=l;break}}do{if(F){o=(y&1^1)+o|0;if((o|0)>(a|0)&(a|0)>-5){d=d+-1|0;o=o+-1-a|0}else{d=d+-2|0;o=o+-1|0}l=S&8;if(l)break;do{if(v){l=fe[b+-4>>2]|0;if(!l){h=9;break}if(!((l>>>0)%10|0)){c=10;h=0}else{h=0;break}do{c=c*10|0;h=h+1|0}while(((l>>>0)%(c>>>0)|0|0)==0)}else h=9}while(0);l=((b-x>>2)*9|0)+-9|0;if((d|32|0)==102){l=l-h|0;l=(l|0)<0?0:l;o=(o|0)<(l|0)?o:l;l=0;break}else{l=l+a-h|0;l=(l|0)<0?0:l;o=(o|0)<(l|0)?o:l;l=0;break}}else l=S&8}while(0);_=o|l;c=(_|0)!=0&1;p=(d|32|0)==102;if(p){a=(a|0)>0?a:0;d=0}else{h=(a|0)<0?g:a;h=se(h,((h|0)<0)<<31>>31,W)|0;if((C-h|0)<2)do{h=h+-1|0;de[h>>0]=48}while((C-h|0)<2);de[h+-1>>0]=(a>>31&2)+43;x=h+-2|0;de[x>>0]=d;a=C-x|0;d=x}g=w+1+o+c+a|0;oe(e,32,k,g,S);if(!(fe[e>>2]&32))ne(E,w,e)|0;oe(e,48,k,g,S^65536);do{if(p){h=m>>>0>T>>>0?T:m;a=h;do{l=se(fe[a>>2]|0,0,R)|0;do{if((a|0)==(h|0)){if((l|0)!=(R|0))break;de[G>>0]=48;l=G}else{if(l>>>0<=I>>>0)break;do{l=l+-1|0;de[l>>0]=48}while(l>>>0>I>>>0)}}while(0);if(!(fe[e>>2]&32))ne(l,j-l|0,e)|0;a=a+4|0}while(a>>>0<=T>>>0);do{if(_){if(fe[e>>2]&32)break;ne(5891,1,e)|0}}while(0);if((o|0)>0&a>>>0>>0){l=a;while(1){a=se(fe[l>>2]|0,0,R)|0;if(a>>>0>I>>>0)do{a=a+-1|0;de[a>>0]=48}while(a>>>0>I>>>0);if(!(fe[e>>2]&32))ne(a,(o|0)>9?9:o,e)|0;l=l+4|0;a=o+-9|0;if(!((o|0)>9&l>>>0>>0)){o=a;break}else o=a}}oe(e,48,o+9|0,9,0)}else{p=v?b:m+4|0;if((o|0)>-1){c=(l|0)==0;h=m;do{a=se(fe[h>>2]|0,0,R)|0;if((a|0)==(R|0)){de[G>>0]=48;a=G}do{if((h|0)==(m|0)){l=a+1|0;if(!(fe[e>>2]&32))ne(a,1,e)|0;if(c&(o|0)<1){a=l;break}if(fe[e>>2]&32){a=l;break}ne(5891,1,e)|0;a=l}else{if(a>>>0<=I>>>0)break;do{a=a+-1|0;de[a>>0]=48}while(a>>>0>I>>>0)}}while(0);l=j-a|0;if(!(fe[e>>2]&32))ne(a,(o|0)>(l|0)?l:o,e)|0;o=o-l|0;h=h+4|0}while(h>>>0

>>0&(o|0)>-1)}oe(e,48,o+18|0,18,0);if(fe[e>>2]&32)break;ne(d,C-d|0,e)|0}}while(0);oe(e,32,k,g,S^8192);o=(g|0)<(k|0)?k:g}else{p=(d&32|0)!=0;c=u!=u|0.0!=0.0;a=c?0:w;h=a+3|0;oe(e,32,k,h,l);o=fe[e>>2]|0;if(!(o&32)){ne(E,a,e)|0;o=fe[e>>2]|0}if(!(o&32))ne(c?p?5883:5887:p?5875:5879,3,e)|0;oe(e,32,k,h,S^8192);o=(h|0)<(k|0)?k:h}}while(0);m=A;continue e}default:{l=S;a=h;p=0;d=5839;o=O}}}while(0);t:do{if((P|0)==64){l=M;a=fe[l>>2]|0;l=fe[l+4>>2]|0;c=d&32;if(!((a|0)==0&(l|0)==0)){o=O;do{o=o+-1|0;de[o>>0]=me[5823+(a&15)>>0]|c;a=Ji(a|0,l|0,4)|0;l=ie}while(!((a|0)==0&(l|0)==0));P=M;if((p&8|0)==0|(fe[P>>2]|0)==0&(fe[P+4>>2]|0)==0){a=p;p=0;c=5839;P=77}else{a=p;p=2;c=5839+(d>>4)|0;P=77}}else{o=O;a=p;p=0;c=5839;P=77}}else if((P|0)==76){o=se(o,a,O)|0;a=S;p=l;P=77}else if((P|0)==82){P=0;S=Bi(o,0,h)|0;E=(S|0)==0;m=o;a=E?h:S-o|0;p=0;d=5839;o=E?o+h|0:S}else if((P|0)==86){P=0;a=0;o=0;c=fe[M>>2]|0;while(1){l=fe[c>>2]|0;if(!l)break;o=Ai(J,l)|0;if((o|0)<0|o>>>0>(h-a|0)>>>0)break;a=o+a|0;if(h>>>0>a>>>0)c=c+4|0;else break}if((o|0)<0){s=-1;break e}oe(e,32,k,a,S);if(!a){o=0;P=98}else{l=0;h=fe[M>>2]|0;while(1){o=fe[h>>2]|0;if(!o){o=a;P=98;break t}o=Ai(J,o)|0;l=o+l|0;if((l|0)>(a|0)){o=a;P=98;break t}if(!(fe[e>>2]&32))ne(J,o,e)|0;if(l>>>0>=a>>>0){o=a;P=98;break}else h=h+4|0}}}}while(0);if((P|0)==98){P=0;oe(e,32,k,o,S^8192);m=A;o=(k|0)>(o|0)?k:o;continue}if((P|0)==77){P=0;l=(h|0)>-1?a&-65537:a;a=M;a=(fe[a>>2]|0)!=0|(fe[a+4>>2]|0)!=0;if((h|0)!=0|a){a=(a&1^1)+(X-o)|0;m=o;a=(h|0)>(a|0)?h:a;d=c;o=O}else{m=O;a=0;d=c;o=O}}c=o-m|0;a=(a|0)<(c|0)?c:a;h=p+a|0;o=(k|0)<(h|0)?h:k;oe(e,32,o,h,l);if(!(fe[e>>2]&32))ne(d,p,e)|0;oe(e,48,o,h,l^65536);oe(e,48,a,c,0);if(!(fe[e>>2]&32))ne(m,c,e)|0;oe(e,32,o,h,l^8192);m=A}e:do{if((P|0)==245)if(!e)if(t){s=1;while(1){t=fe[n+(s<<2)>>2]|0;if(!t)break;Hi(r+(s<<3)|0,t,i);s=s+1|0;if((s|0)>=10){s=1;break e}}if((s|0)<10)while(1){if(fe[n+(s<<2)>>2]|0){s=-1;break e}s=s+1|0;if((s|0)>=10){s=1;break}}else s=1}else s=0}while(0);ge=L;return s|0}function Gi(e){e=e|0;if(!(fe[e+68>>2]|0))g(e);return}function Xi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;r=e+20|0;n=fe[r>>2]|0;e=(fe[e+16>>2]|0)-n|0;e=e>>>0>i>>>0?i:e;er(n|0,t|0,e|0)|0;fe[r>>2]=(fe[r>>2]|0)+e;return i|0}function Hi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{r=(fe[i>>2]|0)+(4-1)&~(4-1);t=fe[r>>2]|0;fe[i>>2]=r+4;fe[e>>2]=t;break e}case 10:{r=(fe[i>>2]|0)+(4-1)&~(4-1);t=fe[r>>2]|0;fe[i>>2]=r+4;r=e;fe[r>>2]=t;fe[r+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{r=(fe[i>>2]|0)+(4-1)&~(4-1);t=fe[r>>2]|0;fe[i>>2]=r+4;r=e;fe[r>>2]=t;fe[r+4>>2]=0;break e}case 12:{r=(fe[i>>2]|0)+(8-1)&~(8-1);t=r;n=fe[t>>2]|0;t=fe[t+4>>2]|0;fe[i>>2]=r+8;r=e;fe[r>>2]=n;fe[r+4>>2]=t;break e}case 13:{n=(fe[i>>2]|0)+(4-1)&~(4-1);r=fe[n>>2]|0;fe[i>>2]=n+4;r=(r&65535)<<16>>16;n=e;fe[n>>2]=r;fe[n+4>>2]=((r|0)<0)<<31>>31;break e}case 14:{n=(fe[i>>2]|0)+(4-1)&~(4-1);r=fe[n>>2]|0;fe[i>>2]=n+4;n=e;fe[n>>2]=r&65535;fe[n+4>>2]=0;break e}case 15:{n=(fe[i>>2]|0)+(4-1)&~(4-1);r=fe[n>>2]|0;fe[i>>2]=n+4;r=(r&255)<<24>>24;n=e;fe[n>>2]=r;fe[n+4>>2]=((r|0)<0)<<31>>31;break e}case 16:{n=(fe[i>>2]|0)+(4-1)&~(4-1);r=fe[n>>2]|0;fe[i>>2]=n+4;n=e;fe[n>>2]=r&255;fe[n+4>>2]=0;break e}case 17:{n=(fe[i>>2]|0)+(8-1)&~(8-1);s=+ee[n>>3];fe[i>>2]=n+8;ee[e>>3]=s;break e}case 18:{n=(fe[i>>2]|0)+(8-1)&~(8-1);s=+ee[n>>3];fe[i>>2]=n+8;ee[e>>3]=s;break e}default:break e}}while(0)}while(0)}function se(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){r=lr(e|0,t|0,10,0)|0;i=i+-1|0;de[i>>0]=r|48;r=ar(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=r;t=ie}else{e=r;break}}if(e)while(1){i=i+-1|0;de[i>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return i|0}function oe(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0;a=ge;ge=ge+256|0;o=a;do{if((i|0)>(r|0)&(n&73728|0)==0){n=i-r|0;G(o|0,t|0,(n>>>0>256?256:n)|0)|0;t=fe[e>>2]|0;s=(t&32|0)==0;if(n>>>0>255){r=i-r|0;do{if(s){ne(o,256,e)|0;t=fe[e>>2]|0}n=n+-256|0;s=(t&32|0)==0}while(n>>>0>255);if(s)n=r&255;else break}else if(!s)break;ne(o,n,e)|0}}while(0);ge=a}function Yi(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0,b=0,x=0,T=0,w=0,E=0,S=0,A=0,k=0,F=0,N=0,P=0,O=0,R=0,C=0,M=0,I=0,D=0,L=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;a=fe[151]|0;i=a>>>e;if(i&3){e=(i&1^1)+e|0;r=e<<1;i=644+(r<<2)|0;r=644+(r+2<<2)|0;n=fe[r>>2]|0;s=n+8|0;o=fe[s>>2]|0;do{if((i|0)!=(o|0)){if(o>>>0<(fe[155]|0)>>>0)B();t=o+12|0;if((fe[t>>2]|0)==(n|0)){fe[t>>2]=i;fe[r>>2]=o;break}else B()}else fe[151]=a&~(1<>2]=L|3;L=n+(L|4)|0;fe[L>>2]=fe[L>>2]|1;L=s;return L|0}o=fe[153]|0;if(d>>>0>o>>>0){if(i){r=2<>>12&16;r=r>>>l;n=r>>>5&8;r=r>>>n;s=r>>>2&4;r=r>>>s;i=r>>>1&2;r=r>>>i;e=r>>>1&1;e=(n|l|s|i|e)+(r>>>e)|0;r=e<<1;i=644+(r<<2)|0;r=644+(r+2<<2)|0;s=fe[r>>2]|0;l=s+8|0;n=fe[l>>2]|0;do{if((i|0)!=(n|0)){if(n>>>0<(fe[155]|0)>>>0)B();t=n+12|0;if((fe[t>>2]|0)==(s|0)){fe[t>>2]=i;fe[r>>2]=n;u=fe[153]|0;break}else B()}else{fe[151]=a&~(1<>2]=d|3;a=s+d|0;fe[s+(d|4)>>2]=o|1;fe[s+L>>2]=o;if(u){n=fe[156]|0;i=u>>>3;t=i<<1;r=644+(t<<2)|0;e=fe[151]|0;i=1<>2]|0;if(t>>>0<(fe[155]|0)>>>0)B();else{h=e;c=t}}else{fe[151]=e|i;h=644+(t+2<<2)|0;c=r}fe[h>>2]=n;fe[c+12>>2]=n;fe[n+8>>2]=c;fe[n+12>>2]=r}fe[153]=o;fe[156]=a;L=l;return L|0}e=fe[152]|0;if(e){i=(e&0-e)+-1|0;D=i>>>12&16;i=i>>>D;I=i>>>5&8;i=i>>>I;L=i>>>2&4;i=i>>>L;e=i>>>1&2;i=i>>>e;r=i>>>1&1;r=fe[908+((I|D|L|e|r)+(i>>>r)<<2)>>2]|0;i=(fe[r+4>>2]&-8)-d|0;e=r;while(1){t=fe[e+16>>2]|0;if(!t){t=fe[e+20>>2]|0;if(!t){l=i;break}}e=(fe[t+4>>2]&-8)-d|0;L=e>>>0>>0;i=L?e:i;e=t;r=L?t:r}s=fe[155]|0;if(r>>>0>>0)B();a=r+d|0;if(r>>>0>=a>>>0)B();o=fe[r+24>>2]|0;i=fe[r+12>>2]|0;do{if((i|0)==(r|0)){e=r+20|0;t=fe[e>>2]|0;if(!t){e=r+16|0;t=fe[e>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=fe[i>>2]|0;if(n){t=n;e=i;continue}i=t+16|0;n=fe[i>>2]|0;if(!n)break;else{t=n;e=i}}if(e>>>0>>0)B();else{fe[e>>2]=0;p=t;break}}else{n=fe[r+8>>2]|0;if(n>>>0>>0)B();t=n+12|0;if((fe[t>>2]|0)!=(r|0))B();e=i+8|0;if((fe[e>>2]|0)==(r|0)){fe[t>>2]=i;fe[e>>2]=n;p=i;break}else B()}}while(0);do{if(o){t=fe[r+28>>2]|0;e=908+(t<<2)|0;if((r|0)==(fe[e>>2]|0)){fe[e>>2]=p;if(!p){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();t=o+16|0;if((fe[t>>2]|0)==(r|0))fe[t>>2]=p;else fe[o+20>>2]=p;if(!p)break}e=fe[155]|0;if(p>>>0>>0)B();fe[p+24>>2]=o;t=fe[r+16>>2]|0;do{if(t)if(t>>>0>>0)B();else{fe[p+16>>2]=t;fe[t+24>>2]=p;break}}while(0);t=fe[r+20>>2]|0;if(t)if(t>>>0<(fe[155]|0)>>>0)B();else{fe[p+20>>2]=t;fe[t+24>>2]=p;break}}}while(0);if(l>>>0<16){L=l+d|0;fe[r+4>>2]=L|3;L=r+(L+4)|0;fe[L>>2]=fe[L>>2]|1}else{fe[r+4>>2]=d|3;fe[r+(d|4)>>2]=l|1;fe[r+(l+d)>>2]=l;t=fe[153]|0;if(t){s=fe[156]|0;i=t>>>3;t=i<<1;n=644+(t<<2)|0;e=fe[151]|0;i=1<>2]|0;if(e>>>0<(fe[155]|0)>>>0)B();else{f=t;m=e}}else{fe[151]=e|i;f=644+(t+2<<2)|0;m=n}fe[f>>2]=s;fe[m+12>>2]=s;fe[s+8>>2]=m;fe[s+12>>2]=n}fe[153]=l;fe[156]=a}L=r+8|0;return L|0}else m=d}else m=d}else if(e>>>0<=4294967231){e=e+11|0;c=e&-8;h=fe[152]|0;if(h){i=0-c|0;e=e>>>8;if(e)if(c>>>0>16777215)u=31;else{m=(e+1048320|0)>>>16&8;b=e<>>16&4;b=b<>>16&2;u=14-(f|m|u)+(b<>>15)|0;u=c>>>(u+7|0)&1|u<<1}else u=0;e=fe[908+(u<<2)>>2]|0;e:do{if(!e){n=0;e=0;b=86}else{o=i;n=0;a=c<<((u|0)==31?0:25-(u>>>1)|0);l=e;e=0;while(1){s=fe[l+4>>2]&-8;i=s-c|0;if(i>>>0>>0)if((s|0)==(c|0)){s=l;e=l;b=90;break e}else e=l;else i=o;b=fe[l+20>>2]|0;l=fe[l+16+(a>>>31<<2)>>2]|0;n=(b|0)==0|(b|0)==(l|0)?n:b;if(!l){b=86;break}else{o=i;a=a<<1}}}}while(0);if((b|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>p;h=e>>>5&8;e=e>>>h;f=e>>>2&4;e=e>>>f;m=e>>>1&2;e=e>>>m;n=e>>>1&1;n=fe[908+((h|p|f|m|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){a=i;l=e}else{s=n;b=90}}if((b|0)==90)while(1){b=0;m=(fe[s+4>>2]&-8)-c|0;n=m>>>0>>0;i=n?m:i;e=n?s:e;n=fe[s+16>>2]|0;if(n){s=n;b=90;continue}s=fe[s+20>>2]|0;if(!s){a=i;l=e;break}else b=90}if((l|0)!=0?a>>>0<((fe[153]|0)-c|0)>>>0:0){n=fe[155]|0;if(l>>>0>>0)B();o=l+c|0;if(l>>>0>=o>>>0)B();s=fe[l+24>>2]|0;i=fe[l+12>>2]|0;do{if((i|0)==(l|0)){e=l+20|0;t=fe[e>>2]|0;if(!t){e=l+16|0;t=fe[e>>2]|0;if(!t){d=0;break}}while(1){i=t+20|0;r=fe[i>>2]|0;if(r){t=r;e=i;continue}i=t+16|0;r=fe[i>>2]|0;if(!r)break;else{t=r;e=i}}if(e>>>0>>0)B();else{fe[e>>2]=0;d=t;break}}else{r=fe[l+8>>2]|0;if(r>>>0>>0)B();t=r+12|0;if((fe[t>>2]|0)!=(l|0))B();e=i+8|0;if((fe[e>>2]|0)==(l|0)){fe[t>>2]=i;fe[e>>2]=r;d=i;break}else B()}}while(0);do{if(s){t=fe[l+28>>2]|0;e=908+(t<<2)|0;if((l|0)==(fe[e>>2]|0)){fe[e>>2]=d;if(!d){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();t=s+16|0;if((fe[t>>2]|0)==(l|0))fe[t>>2]=d;else fe[s+20>>2]=d;if(!d)break}e=fe[155]|0;if(d>>>0>>0)B();fe[d+24>>2]=s;t=fe[l+16>>2]|0;do{if(t)if(t>>>0>>0)B();else{fe[d+16>>2]=t;fe[t+24>>2]=d;break}}while(0);t=fe[l+20>>2]|0;if(t)if(t>>>0<(fe[155]|0)>>>0)B();else{fe[d+20>>2]=t;fe[t+24>>2]=d;break}}}while(0);e:do{if(a>>>0>=16){fe[l+4>>2]=c|3;fe[l+(c|4)>>2]=a|1;fe[l+(a+c)>>2]=a;t=a>>>3;if(a>>>0<256){e=t<<1;r=644+(e<<2)|0;i=fe[151]|0;t=1<>2]|0;if(e>>>0<(fe[155]|0)>>>0)B();else{g=t;v=e}}else{fe[151]=i|t;g=644+(e+2<<2)|0;v=r}fe[g>>2]=o;fe[v+12>>2]=o;fe[l+(c+8)>>2]=v;fe[l+(c+12)>>2]=r;break}t=a>>>8;if(t)if(a>>>0>16777215)r=31;else{D=(t+1048320|0)>>>16&8;L=t<>>16&4;L=L<>>16&2;r=14-(I|D|r)+(L<>>15)|0;r=a>>>(r+7|0)&1|r<<1}else r=0;t=908+(r<<2)|0;fe[l+(c+28)>>2]=r;fe[l+(c+20)>>2]=0;fe[l+(c+16)>>2]=0;e=fe[152]|0;i=1<>2]=o;fe[l+(c+24)>>2]=t;fe[l+(c+12)>>2]=o;fe[l+(c+8)>>2]=o;break}t=fe[t>>2]|0;t:do{if((fe[t+4>>2]&-8|0)!=(a|0)){r=a<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=fe[e>>2]|0;if(!i)break;if((fe[i+4>>2]&-8|0)==(a|0)){w=i;break t}else{r=r<<1;t=i}}if(e>>>0<(fe[155]|0)>>>0)B();else{fe[e>>2]=o;fe[l+(c+24)>>2]=t;fe[l+(c+12)>>2]=o;fe[l+(c+8)>>2]=o;break e}}else w=t}while(0);t=w+8|0;e=fe[t>>2]|0;L=fe[155]|0;if(e>>>0>=L>>>0&w>>>0>=L>>>0){fe[e+12>>2]=o;fe[t>>2]=o;fe[l+(c+8)>>2]=e;fe[l+(c+12)>>2]=w;fe[l+(c+24)>>2]=0;break}else B()}else{L=a+c|0;fe[l+4>>2]=L|3;L=l+(L+4)|0;fe[L>>2]=fe[L>>2]|1}}while(0);L=l+8|0;return L|0}else m=c}else m=c}else m=-1}while(0);i=fe[153]|0;if(i>>>0>=m>>>0){t=i-m|0;e=fe[156]|0;if(t>>>0>15){fe[156]=e+m;fe[153]=t;fe[e+(m+4)>>2]=t|1;fe[e+i>>2]=t;fe[e+4>>2]=m|3}else{fe[153]=0;fe[156]=0;fe[e+4>>2]=i|3;L=e+(i+4)|0;fe[L>>2]=fe[L>>2]|1}L=e+8|0;return L|0}e=fe[154]|0;if(e>>>0>m>>>0){D=e-m|0;fe[154]=D;L=fe[157]|0;fe[157]=L+m;fe[L+(m+4)>>2]=D|1;fe[L+4>>2]=m|3;L=L+8|0;return L|0}do{if(!(fe[269]|0)){e=$e(30)|0;if(!(e+-1&e)){fe[271]=e;fe[270]=e;fe[272]=-1;fe[273]=-1;fe[274]=0;fe[262]=0;w=(ut(0)|0)&-16^1431655768;fe[269]=w;break}else B()}}while(0);l=m+48|0;a=fe[271]|0;u=m+47|0;o=a+u|0;a=0-a|0;h=o&a;if(h>>>0<=m>>>0){L=0;return L|0}e=fe[261]|0;if((e|0)!=0?(v=fe[259]|0,w=v+h|0,w>>>0<=v>>>0|w>>>0>e>>>0):0){L=0;return L|0}e:do{if(!(fe[262]&4)){e=fe[157]|0;t:do{if(e){n=1052;while(1){i=fe[n>>2]|0;if(i>>>0<=e>>>0?(_=n+4|0,(i+(fe[_>>2]|0)|0)>>>0>e>>>0):0){s=n;e=_;break}n=fe[n+8>>2]|0;if(!n){b=174;break t}}i=o-(fe[154]|0)&a;if(i>>>0<2147483647){n=z(i|0)|0;w=(n|0)==((fe[s>>2]|0)+(fe[e>>2]|0)|0);e=w?i:0;if(w){if((n|0)!=(-1|0)){x=n;f=e;b=194;break e}}else b=184}else e=0}else b=174}while(0);do{if((b|0)==174){s=z(0)|0;if((s|0)!=(-1|0)){e=s;i=fe[270]|0;n=i+-1|0;if(!(n&e))i=h;else i=h-e+(n+e&0-i)|0;e=fe[259]|0;n=e+i|0;if(i>>>0>m>>>0&i>>>0<2147483647){w=fe[261]|0;if((w|0)!=0?n>>>0<=e>>>0|n>>>0>w>>>0:0){e=0;break}n=z(i|0)|0;w=(n|0)==(s|0);e=w?i:0;if(w){x=s;f=e;b=194;break e}else b=184}else e=0}else e=0}}while(0);t:do{if((b|0)==184){s=0-i|0;do{if(l>>>0>i>>>0&(i>>>0<2147483647&(n|0)!=(-1|0))?(y=fe[271]|0,y=u-i+y&0-y,y>>>0<2147483647):0)if((z(y|0)|0)==(-1|0)){z(s|0)|0;break t}else{i=y+i|0;break}}while(0);if((n|0)!=(-1|0)){x=n;f=i;b=194;break e}}}while(0);fe[262]=fe[262]|4;b=191}else{e=0;b=191}}while(0);if((((b|0)==191?h>>>0<2147483647:0)?(x=z(h|0)|0,T=z(0)|0,x>>>0>>0&((x|0)!=(-1|0)&(T|0)!=(-1|0))):0)?(E=T-x|0,S=E>>>0>(m+40|0)>>>0,S):0){f=S?E:e;b=194}if((b|0)==194){e=(fe[259]|0)+f|0;fe[259]=e;if(e>>>0>(fe[260]|0)>>>0)fe[260]=e;o=fe[157]|0;e:do{if(o){s=1052;do{e=fe[s>>2]|0;i=s+4|0;n=fe[i>>2]|0;if((x|0)==(e+n|0)){A=e;k=i;F=n;N=s;b=204;break}s=fe[s+8>>2]|0}while((s|0)!=0);if(((b|0)==204?(fe[N+12>>2]&8|0)==0:0)?o>>>0>>0&o>>>0>=A>>>0:0){fe[k>>2]=F+f;L=(fe[154]|0)+f|0;D=o+8|0;D=(D&7|0)==0?0:0-D&7;I=L-D|0;fe[157]=o+D;fe[154]=I;fe[o+(D+4)>>2]=I|1;fe[o+(L+4)>>2]=40;fe[158]=fe[273];break}e=fe[155]|0;if(x>>>0>>0){fe[155]=x;e=x}i=x+f|0;s=1052;while(1){if((fe[s>>2]|0)==(i|0)){n=s;i=s;b=212;break}s=fe[s+8>>2]|0;if(!s){i=1052;break}}if((b|0)==212)if(!(fe[i+12>>2]&8)){fe[n>>2]=x;p=i+4|0;fe[p>>2]=(fe[p>>2]|0)+f;p=x+8|0;p=(p&7|0)==0?0:0-p&7;u=x+(f+8)|0;u=(u&7|0)==0?0:0-u&7;t=x+(u+f)|0;c=p+m|0;d=x+c|0;h=t-(x+p)-m|0;fe[x+(p+4)>>2]=m|3;t:do{if((t|0)!=(o|0)){if((t|0)==(fe[156]|0)){L=(fe[153]|0)+h|0;fe[153]=L;fe[156]=d;fe[x+(c+4)>>2]=L|1;fe[x+(L+c)>>2]=L;break}a=f+4|0;i=fe[x+(a+u)>>2]|0;if((i&3|0)==1){l=i&-8;s=i>>>3;i:do{if(i>>>0>=256){o=fe[x+((u|24)+f)>>2]|0;r=fe[x+(f+12+u)>>2]|0;do{if((r|0)==(t|0)){n=u|16;r=x+(a+n)|0;i=fe[r>>2]|0;if(!i){r=x+(n+f)|0;i=fe[r>>2]|0;if(!i){M=0;break}}while(1){n=i+20|0;s=fe[n>>2]|0;if(s){i=s;r=n;continue}n=i+16|0;s=fe[n>>2]|0;if(!s)break;else{i=s;r=n}}if(r>>>0>>0)B();else{fe[r>>2]=0;M=i;break}}else{n=fe[x+((u|8)+f)>>2]|0;if(n>>>0>>0)B();e=n+12|0;if((fe[e>>2]|0)!=(t|0))B();i=r+8|0;if((fe[i>>2]|0)==(t|0)){fe[e>>2]=r;fe[i>>2]=n;M=r;break}else B()}}while(0);if(!o)break;e=fe[x+(f+28+u)>>2]|0;i=908+(e<<2)|0;do{if((t|0)!=(fe[i>>2]|0)){if(o>>>0<(fe[155]|0)>>>0)B();e=o+16|0;if((fe[e>>2]|0)==(t|0))fe[e>>2]=M;else fe[o+20>>2]=M;if(!M)break i}else{fe[i>>2]=M;if(M)break;fe[152]=fe[152]&~(1<>>0>>0)B();fe[M+24>>2]=o;t=u|16;e=fe[x+(t+f)>>2]|0;do{if(e)if(e>>>0>>0)B();else{fe[M+16>>2]=e;fe[e+24>>2]=M;break}}while(0);t=fe[x+(a+t)>>2]|0;if(!t)break;if(t>>>0<(fe[155]|0)>>>0)B();else{fe[M+20>>2]=t;fe[t+24>>2]=M;break}}else{r=fe[x+((u|8)+f)>>2]|0;n=fe[x+(f+12+u)>>2]|0;i=644+(s<<1<<2)|0;do{if((r|0)!=(i|0)){if(r>>>0>>0)B();if((fe[r+12>>2]|0)==(t|0))break;B()}}while(0);if((n|0)==(r|0)){fe[151]=fe[151]&~(1<>>0>>0)B();e=n+8|0;if((fe[e>>2]|0)==(t|0)){P=e;break}B()}}while(0);fe[r+12>>2]=n;fe[P>>2]=r}}while(0);t=x+((l|u)+f)|0;n=l+h|0}else n=h;t=t+4|0;fe[t>>2]=fe[t>>2]&-2;fe[x+(c+4)>>2]=n|1;fe[x+(n+c)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;r=644+(e<<2)|0;i=fe[151]|0;t=1<>2]|0;if(e>>>0>=(fe[155]|0)>>>0){I=t;D=e;break}B()}}while(0);fe[I>>2]=d;fe[D+12>>2]=d;fe[x+(c+8)>>2]=D;fe[x+(c+12)>>2]=r;break}t=n>>>8;do{if(!t)r=0;else{if(n>>>0>16777215){r=31;break}I=(t+1048320|0)>>>16&8;D=t<>>16&4;D=D<>>16&2;r=14-(M|I|r)+(D<>>15)|0;r=n>>>(r+7|0)&1|r<<1}}while(0);t=908+(r<<2)|0;fe[x+(c+28)>>2]=r;fe[x+(c+20)>>2]=0;fe[x+(c+16)>>2]=0;e=fe[152]|0;i=1<>2]=d;fe[x+(c+24)>>2]=t;fe[x+(c+12)>>2]=d;fe[x+(c+8)>>2]=d;break}t=fe[t>>2]|0;i:do{if((fe[t+4>>2]&-8|0)!=(n|0)){r=n<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=fe[e>>2]|0;if(!i)break;if((fe[i+4>>2]&-8|0)==(n|0)){L=i;break i}else{r=r<<1;t=i}}if(e>>>0<(fe[155]|0)>>>0)B();else{fe[e>>2]=d;fe[x+(c+24)>>2]=t;fe[x+(c+12)>>2]=d;fe[x+(c+8)>>2]=d;break t}}else L=t}while(0);t=L+8|0;e=fe[t>>2]|0;D=fe[155]|0;if(e>>>0>=D>>>0&L>>>0>=D>>>0){fe[e+12>>2]=d;fe[t>>2]=d;fe[x+(c+8)>>2]=e;fe[x+(c+12)>>2]=L;fe[x+(c+24)>>2]=0;break}else B()}else{L=(fe[154]|0)+h|0;fe[154]=L;fe[157]=d;fe[x+(c+4)>>2]=L|1}}while(0);L=x+(p|8)|0;return L|0}else i=1052;while(1){e=fe[i>>2]|0;if(e>>>0<=o>>>0?(t=fe[i+4>>2]|0,r=e+t|0,r>>>0>o>>>0):0)break;i=fe[i+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=o+16|0;e=e>>>0>>0?o:e;t=e+8|0;i=x+8|0;i=(i&7|0)==0?0:0-i&7;L=f+-40-i|0;fe[157]=x+i;fe[154]=L;fe[x+(i+4)>>2]=L|1;fe[x+(f+-36)>>2]=40;fe[158]=fe[273];i=e+4|0;fe[i>>2]=27;fe[t>>2]=fe[263];fe[t+4>>2]=fe[264];fe[t+8>>2]=fe[265];fe[t+12>>2]=fe[266];fe[263]=x;fe[264]=f;fe[266]=0;fe[265]=t;t=e+28|0;fe[t>>2]=7;if((e+32|0)>>>0>>0)do{L=t;t=t+4|0;fe[t>>2]=7}while((L+8|0)>>>0>>0);if((e|0)!=(o|0)){s=e-o|0;fe[i>>2]=fe[i>>2]&-2;fe[o+4>>2]=s|1;fe[e>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;r=644+(e<<2)|0;i=fe[151]|0;t=1<>2]|0;if(e>>>0<(fe[155]|0)>>>0)B();else{O=t;R=e}}else{fe[151]=i|t;O=644+(e+2<<2)|0;R=r}fe[O>>2]=o;fe[R+12>>2]=o;fe[o+8>>2]=R;fe[o+12>>2]=r;break}t=s>>>8;if(t)if(s>>>0>16777215)r=31;else{D=(t+1048320|0)>>>16&8;L=t<>>16&4;L=L<>>16&2;r=14-(I|D|r)+(L<>>15)|0;r=s>>>(r+7|0)&1|r<<1}else r=0;i=908+(r<<2)|0;fe[o+28>>2]=r;fe[o+20>>2]=0;fe[n>>2]=0;t=fe[152]|0;e=1<>2]=o;fe[o+24>>2]=i;fe[o+12>>2]=o;fe[o+8>>2]=o;break}t=fe[i>>2]|0;t:do{if((fe[t+4>>2]&-8|0)!=(s|0)){r=s<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=fe[e>>2]|0;if(!i)break;if((fe[i+4>>2]&-8|0)==(s|0)){C=i;break t}else{r=r<<1;t=i}}if(e>>>0<(fe[155]|0)>>>0)B();else{fe[e>>2]=o;fe[o+24>>2]=t;fe[o+12>>2]=o;fe[o+8>>2]=o;break e}}else C=t}while(0);t=C+8|0;e=fe[t>>2]|0;L=fe[155]|0;if(e>>>0>=L>>>0&C>>>0>=L>>>0){fe[e+12>>2]=o;fe[t>>2]=o;fe[o+8>>2]=e;fe[o+12>>2]=C;fe[o+24>>2]=0;break}else B()}}else{L=fe[155]|0;if((L|0)==0|x>>>0>>0)fe[155]=x;fe[263]=x;fe[264]=f;fe[266]=0;fe[160]=fe[269];fe[159]=-1;t=0;do{L=t<<1;D=644+(L<<2)|0;fe[644+(L+3<<2)>>2]=D;fe[644+(L+2<<2)>>2]=D;t=t+1|0}while((t|0)!=32);L=x+8|0;L=(L&7|0)==0?0:0-L&7;D=f+-40-L|0;fe[157]=x+L;fe[154]=D;fe[x+(L+4)>>2]=D|1;fe[x+(f+-36)>>2]=40;fe[158]=fe[273]}}while(0);t=fe[154]|0;if(t>>>0>m>>>0){D=t-m|0;fe[154]=D;L=fe[157]|0;fe[157]=L+m;fe[L+(m+4)>>2]=D|1;fe[L+4>>2]=m|3;L=L+8|0;return L|0}}L=re()|0;fe[L>>2]=12;L=0;return L|0}function b(e){e=e|0;var t=0,i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0,y=0;if(!e)return;t=e+-8|0;a=fe[155]|0;if(t>>>0>>0)B();i=fe[e+-4>>2]|0;r=i&3;if((r|0)==1)B();d=i&-8;m=e+(d+-8)|0;do{if(!(i&1)){t=fe[t>>2]|0;if(!r)return;l=-8-t|0;h=e+l|0;c=t+d|0;if(h>>>0>>0)B();if((h|0)==(fe[156]|0)){t=e+(d+-4)|0;i=fe[t>>2]|0;if((i&3|0)!=3){y=h;s=c;break}fe[153]=c;fe[t>>2]=i&-2;fe[e+(l+4)>>2]=c|1;fe[m>>2]=c;return}n=t>>>3;if(t>>>0<256){r=fe[e+(l+8)>>2]|0;i=fe[e+(l+12)>>2]|0;t=644+(n<<1<<2)|0;if((r|0)!=(t|0)){if(r>>>0>>0)B();if((fe[r+12>>2]|0)!=(h|0))B()}if((i|0)==(r|0)){fe[151]=fe[151]&~(1<>>0>>0)B();t=i+8|0;if((fe[t>>2]|0)==(h|0))o=t;else B()}else o=i+8|0;fe[r+12>>2]=i;fe[o>>2]=r;y=h;s=c;break}o=fe[e+(l+24)>>2]|0;r=fe[e+(l+12)>>2]|0;do{if((r|0)==(h|0)){i=e+(l+20)|0;t=fe[i>>2]|0;if(!t){i=e+(l+16)|0;t=fe[i>>2]|0;if(!t){u=0;break}}while(1){r=t+20|0;n=fe[r>>2]|0;if(n){t=n;i=r;continue}r=t+16|0;n=fe[r>>2]|0;if(!n)break;else{t=n;i=r}}if(i>>>0>>0)B();else{fe[i>>2]=0;u=t;break}}else{n=fe[e+(l+8)>>2]|0;if(n>>>0>>0)B();t=n+12|0;if((fe[t>>2]|0)!=(h|0))B();i=r+8|0;if((fe[i>>2]|0)==(h|0)){fe[t>>2]=r;fe[i>>2]=n;u=r;break}else B()}}while(0);if(o){t=fe[e+(l+28)>>2]|0;i=908+(t<<2)|0;if((h|0)==(fe[i>>2]|0)){fe[i>>2]=u;if(!u){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();t=o+16|0;if((fe[t>>2]|0)==(h|0))fe[t>>2]=u;else fe[o+20>>2]=u;if(!u){y=h;s=c;break}}i=fe[155]|0;if(u>>>0>>0)B();fe[u+24>>2]=o;t=fe[e+(l+16)>>2]|0;do{if(t)if(t>>>0>>0)B();else{fe[u+16>>2]=t;fe[t+24>>2]=u;break}}while(0);t=fe[e+(l+20)>>2]|0;if(t)if(t>>>0<(fe[155]|0)>>>0)B();else{fe[u+20>>2]=t;fe[t+24>>2]=u;y=h;s=c;break}else{y=h;s=c}}else{y=h;s=c}}else{y=t;s=d}}while(0);if(y>>>0>=m>>>0)B();t=e+(d+-4)|0;i=fe[t>>2]|0;if(!(i&1))B();if(!(i&2)){if((m|0)==(fe[157]|0)){v=(fe[154]|0)+s|0;fe[154]=v;fe[157]=y;fe[y+4>>2]=v|1;if((y|0)!=(fe[156]|0))return;fe[156]=0;fe[153]=0;return}if((m|0)==(fe[156]|0)){v=(fe[153]|0)+s|0;fe[153]=v;fe[156]=y;fe[y+4>>2]=v|1;fe[y+v>>2]=v;return}s=(i&-8)+s|0;n=i>>>3;do{if(i>>>0>=256){o=fe[e+(d+16)>>2]|0;t=fe[e+(d|4)>>2]|0;do{if((t|0)==(m|0)){i=e+(d+12)|0;t=fe[i>>2]|0;if(!t){i=e+(d+8)|0;t=fe[i>>2]|0;if(!t){f=0;break}}while(1){r=t+20|0;n=fe[r>>2]|0;if(n){t=n;i=r;continue}r=t+16|0;n=fe[r>>2]|0;if(!n)break;else{t=n;i=r}}if(i>>>0<(fe[155]|0)>>>0)B();else{fe[i>>2]=0;f=t;break}}else{i=fe[e+d>>2]|0;if(i>>>0<(fe[155]|0)>>>0)B();r=i+12|0;if((fe[r>>2]|0)!=(m|0))B();n=t+8|0;if((fe[n>>2]|0)==(m|0)){fe[r>>2]=t;fe[n>>2]=i;f=t;break}else B()}}while(0);if(o){t=fe[e+(d+20)>>2]|0;i=908+(t<<2)|0;if((m|0)==(fe[i>>2]|0)){fe[i>>2]=f;if(!f){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();t=o+16|0;if((fe[t>>2]|0)==(m|0))fe[t>>2]=f;else fe[o+20>>2]=f;if(!f)break}i=fe[155]|0;if(f>>>0>>0)B();fe[f+24>>2]=o;t=fe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)B();else{fe[f+16>>2]=t;fe[t+24>>2]=f;break}}while(0);t=fe[e+(d+12)>>2]|0;if(t)if(t>>>0<(fe[155]|0)>>>0)B();else{fe[f+20>>2]=t;fe[t+24>>2]=f;break}}}else{r=fe[e+d>>2]|0;i=fe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((r|0)!=(t|0)){if(r>>>0<(fe[155]|0)>>>0)B();if((fe[r+12>>2]|0)!=(m|0))B()}if((i|0)==(r|0)){fe[151]=fe[151]&~(1<>>0<(fe[155]|0)>>>0)B();t=i+8|0;if((fe[t>>2]|0)==(m|0))p=t;else B()}else p=i+8|0;fe[r+12>>2]=i;fe[p>>2]=r}}while(0);fe[y+4>>2]=s|1;fe[y+s>>2]=s;if((y|0)==(fe[156]|0)){fe[153]=s;return}}else{fe[t>>2]=i&-2;fe[y+4>>2]=s|1;fe[y+s>>2]=s}t=s>>>3;if(s>>>0<256){i=t<<1;n=644+(i<<2)|0;r=fe[151]|0;t=1<>2]|0;if(i>>>0<(fe[155]|0)>>>0)B();else{_=t;g=i}}else{fe[151]=r|t;_=644+(i+2<<2)|0;g=n}fe[_>>2]=y;fe[g+12>>2]=y;fe[y+8>>2]=g;fe[y+12>>2]=n;return}t=s>>>8;if(t)if(s>>>0>16777215)n=31;else{_=(t+1048320|0)>>>16&8;g=t<<_;m=(g+520192|0)>>>16&4;g=g<>>16&2;n=14-(m|_|n)+(g<>>15)|0;n=s>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;fe[y+28>>2]=n;fe[y+20>>2]=0;fe[y+16>>2]=0;i=fe[152]|0;r=1<>2]|0;t:do{if((fe[t+4>>2]&-8|0)!=(s|0)){n=s<<((n|0)==31?0:25-(n>>>1)|0);while(1){i=t+16+(n>>>31<<2)|0;r=fe[i>>2]|0;if(!r)break;if((fe[r+4>>2]&-8|0)==(s|0)){v=r;break t}else{n=n<<1;t=r}}if(i>>>0<(fe[155]|0)>>>0)B();else{fe[i>>2]=y;fe[y+24>>2]=t;fe[y+12>>2]=y;fe[y+8>>2]=y;break e}}else v=t}while(0);t=v+8|0;i=fe[t>>2]|0;g=fe[155]|0;if(i>>>0>=g>>>0&v>>>0>=g>>>0){fe[i+12>>2]=y;fe[t>>2]=y;fe[y+8>>2]=i;fe[y+12>>2]=v;fe[y+24>>2]=0;break}else B()}else{fe[152]=i|r;fe[t>>2]=y;fe[y+24>>2]=t;fe[y+12>>2]=y;fe[y+8>>2]=y}}while(0);y=(fe[159]|0)+-1|0;fe[159]=y;if(!y)t=1060;else return;while(1){t=fe[t>>2]|0;if(!t)break;else t=t+8|0}fe[159]=-1;return}function Wi(e,t){e=e|0;t=t|0;var i=0,r=0;if(!e){e=Yi(t)|0;return e|0}if(t>>>0>4294967231){e=re()|0;fe[e>>2]=12;e=0;return e|0}i=qi(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(i){e=i+8|0;return e|0}i=Yi(t)|0;if(!i){e=0;return e|0}r=fe[e+-4>>2]|0;r=(r&-8)-((r&3|0)==0?8:4)|0;er(i|0,e|0,(r>>>0>>0?r:t)|0)|0;b(e);e=i;return e|0}function Vi(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=fe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0;d=e+4|0;f=fe[d>>2]|0;l=f&-8;h=e+l|0;a=fe[155]|0;i=f&3;if(!((i|0)!=1&e>>>0>=a>>>0&e>>>0>>0))B();r=e+(l|4)|0;n=fe[r>>2]|0;if(!(n&1))B();if(!i){if(t>>>0<256){e=0;return e|0}if(l>>>0>=(t+4|0)>>>0?(l-t|0)>>>0<=fe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(l>>>0>=t>>>0){i=l-t|0;if(i>>>0<=15)return e|0;fe[d>>2]=f&1|t|2;fe[e+(t+4)>>2]=i|3;fe[r>>2]=fe[r>>2]|1;Ki(e+t|0,i);return e|0}if((h|0)==(fe[157]|0)){i=(fe[154]|0)+l|0;if(i>>>0<=t>>>0){e=0;return e|0}p=i-t|0;fe[d>>2]=f&1|t|2;fe[e+(t+4)>>2]=p|1;fe[157]=e+t;fe[154]=p;return e|0}if((h|0)==(fe[156]|0)){r=(fe[153]|0)+l|0;if(r>>>0>>0){e=0;return e|0}i=r-t|0;if(i>>>0>15){fe[d>>2]=f&1|t|2;fe[e+(t+4)>>2]=i|1;fe[e+r>>2]=i;r=e+(r+4)|0;fe[r>>2]=fe[r>>2]&-2;r=e+t|0}else{fe[d>>2]=f&1|r|2;r=e+(r+4)|0;fe[r>>2]=fe[r>>2]|1;r=0;i=0}fe[153]=i;fe[156]=r;return e|0}if(n&2){e=0;return e|0}c=(n&-8)+l|0;if(c>>>0>>0){e=0;return e|0}p=c-t|0;s=n>>>3;do{if(n>>>0>=256){o=fe[e+(l+24)>>2]|0;s=fe[e+(l+12)>>2]|0;do{if((s|0)==(h|0)){r=e+(l+20)|0;i=fe[r>>2]|0;if(!i){r=e+(l+16)|0;i=fe[r>>2]|0;if(!i){u=0;break}}while(1){n=i+20|0;s=fe[n>>2]|0;if(s){i=s;r=n;continue}n=i+16|0;s=fe[n>>2]|0;if(!s)break;else{i=s;r=n}}if(r>>>0>>0)B();else{fe[r>>2]=0;u=i;break}}else{n=fe[e+(l+8)>>2]|0;if(n>>>0>>0)B();i=n+12|0;if((fe[i>>2]|0)!=(h|0))B();r=s+8|0;if((fe[r>>2]|0)==(h|0)){fe[i>>2]=s;fe[r>>2]=n;u=s;break}else B()}}while(0);if(o){i=fe[e+(l+28)>>2]|0;r=908+(i<<2)|0;if((h|0)==(fe[r>>2]|0)){fe[r>>2]=u;if(!u){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();i=o+16|0;if((fe[i>>2]|0)==(h|0))fe[i>>2]=u;else fe[o+20>>2]=u;if(!u)break}r=fe[155]|0;if(u>>>0>>0)B();fe[u+24>>2]=o;i=fe[e+(l+16)>>2]|0;do{if(i)if(i>>>0>>0)B();else{fe[u+16>>2]=i;fe[i+24>>2]=u;break}}while(0);i=fe[e+(l+20)>>2]|0;if(i)if(i>>>0<(fe[155]|0)>>>0)B();else{fe[u+20>>2]=i;fe[i+24>>2]=u;break}}}else{n=fe[e+(l+8)>>2]|0;r=fe[e+(l+12)>>2]|0;i=644+(s<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0>>0)B();if((fe[n+12>>2]|0)!=(h|0))B()}if((r|0)==(n|0)){fe[151]=fe[151]&~(1<>>0>>0)B();i=r+8|0;if((fe[i>>2]|0)==(h|0))o=i;else B()}else o=r+8|0;fe[n+12>>2]=r;fe[o>>2]=n}}while(0);if(p>>>0<16){fe[d>>2]=c|f&1|2;t=e+(c|4)|0;fe[t>>2]=fe[t>>2]|1;return e|0}else{fe[d>>2]=f&1|t|2;fe[e+(t+4)>>2]=p|3;f=e+(c|4)|0;fe[f>>2]=fe[f>>2]|1;Ki(e+t|0,p);return e|0}return 0}function Ki(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0,m=0,_=0,g=0,v=0;m=e+t|0;i=fe[e+4>>2]|0;do{if(!(i&1)){u=fe[e>>2]|0;if(!(i&3))return;p=e+(0-u)|0;c=u+t|0;l=fe[155]|0;if(p>>>0>>0)B();if((p|0)==(fe[156]|0)){r=e+(t+4)|0;i=fe[r>>2]|0;if((i&3|0)!=3){v=p;o=c;break}fe[153]=c;fe[r>>2]=i&-2;fe[e+(4-u)>>2]=c|1;fe[m>>2]=c;return}s=u>>>3;if(u>>>0<256){n=fe[e+(8-u)>>2]|0;r=fe[e+(12-u)>>2]|0;i=644+(s<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0>>0)B();if((fe[n+12>>2]|0)!=(p|0))B()}if((r|0)==(n|0)){fe[151]=fe[151]&~(1<>>0>>0)B();i=r+8|0;if((fe[i>>2]|0)==(p|0))a=i;else B()}else a=r+8|0;fe[n+12>>2]=r;fe[a>>2]=n;v=p;o=c;break}a=fe[e+(24-u)>>2]|0;n=fe[e+(12-u)>>2]|0;do{if((n|0)==(p|0)){n=16-u|0;r=e+(n+4)|0;i=fe[r>>2]|0;if(!i){r=e+n|0;i=fe[r>>2]|0;if(!i){h=0;break}}while(1){n=i+20|0;s=fe[n>>2]|0;if(s){i=s;r=n;continue}n=i+16|0;s=fe[n>>2]|0;if(!s)break;else{i=s;r=n}}if(r>>>0>>0)B();else{fe[r>>2]=0;h=i;break}}else{s=fe[e+(8-u)>>2]|0;if(s>>>0>>0)B();i=s+12|0;if((fe[i>>2]|0)!=(p|0))B();r=n+8|0;if((fe[r>>2]|0)==(p|0)){fe[i>>2]=n;fe[r>>2]=s;h=n;break}else B()}}while(0);if(a){i=fe[e+(28-u)>>2]|0;r=908+(i<<2)|0;if((p|0)==(fe[r>>2]|0)){fe[r>>2]=h;if(!h){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();i=a+16|0;if((fe[i>>2]|0)==(p|0))fe[i>>2]=h;else fe[a+20>>2]=h;if(!h){v=p;o=c;break}}n=fe[155]|0;if(h>>>0>>0)B();fe[h+24>>2]=a;i=16-u|0;r=fe[e+i>>2]|0;do{if(r)if(r>>>0>>0)B();else{fe[h+16>>2]=r;fe[r+24>>2]=h;break}}while(0);i=fe[e+(i+4)>>2]|0;if(i)if(i>>>0<(fe[155]|0)>>>0)B();else{fe[h+20>>2]=i;fe[i+24>>2]=h;v=p;o=c;break}else{v=p;o=c}}else{v=p;o=c}}else{v=e;o=t}}while(0);l=fe[155]|0;if(m>>>0>>0)B();i=e+(t+4)|0;r=fe[i>>2]|0;if(!(r&2)){if((m|0)==(fe[157]|0)){g=(fe[154]|0)+o|0;fe[154]=g;fe[157]=v;fe[v+4>>2]=g|1;if((v|0)!=(fe[156]|0))return;fe[156]=0;fe[153]=0;return}if((m|0)==(fe[156]|0)){g=(fe[153]|0)+o|0;fe[153]=g;fe[156]=v;fe[v+4>>2]=g|1;fe[v+g>>2]=g;return}o=(r&-8)+o|0;s=r>>>3;do{if(r>>>0>=256){a=fe[e+(t+24)>>2]|0;n=fe[e+(t+12)>>2]|0;do{if((n|0)==(m|0)){r=e+(t+20)|0;i=fe[r>>2]|0;if(!i){r=e+(t+16)|0;i=fe[r>>2]|0;if(!i){f=0;break}}while(1){n=i+20|0;s=fe[n>>2]|0;if(s){i=s;r=n;continue}n=i+16|0;s=fe[n>>2]|0;if(!s)break;else{i=s;r=n}}if(r>>>0>>0)B();else{fe[r>>2]=0;f=i;break}}else{s=fe[e+(t+8)>>2]|0;if(s>>>0>>0)B();i=s+12|0;if((fe[i>>2]|0)!=(m|0))B();r=n+8|0;if((fe[r>>2]|0)==(m|0)){fe[i>>2]=n;fe[r>>2]=s;f=n;break}else B()}}while(0);if(a){i=fe[e+(t+28)>>2]|0;r=908+(i<<2)|0;if((m|0)==(fe[r>>2]|0)){fe[r>>2]=f;if(!f){fe[152]=fe[152]&~(1<>>0<(fe[155]|0)>>>0)B();i=a+16|0;if((fe[i>>2]|0)==(m|0))fe[i>>2]=f;else fe[a+20>>2]=f;if(!f)break}r=fe[155]|0;if(f>>>0>>0)B();fe[f+24>>2]=a;i=fe[e+(t+16)>>2]|0;do{if(i)if(i>>>0>>0)B();else{fe[f+16>>2]=i;fe[i+24>>2]=f;break}}while(0);i=fe[e+(t+20)>>2]|0;if(i)if(i>>>0<(fe[155]|0)>>>0)B();else{fe[f+20>>2]=i;fe[i+24>>2]=f;break}}}else{n=fe[e+(t+8)>>2]|0;r=fe[e+(t+12)>>2]|0;i=644+(s<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0>>0)B();if((fe[n+12>>2]|0)!=(m|0))B()}if((r|0)==(n|0)){fe[151]=fe[151]&~(1<>>0>>0)B();i=r+8|0;if((fe[i>>2]|0)==(m|0))d=i;else B()}else d=r+8|0;fe[n+12>>2]=r;fe[d>>2]=n}}while(0);fe[v+4>>2]=o|1;fe[v+o>>2]=o;if((v|0)==(fe[156]|0)){fe[153]=o;return}}else{fe[i>>2]=r&-2;fe[v+4>>2]=o|1;fe[v+o>>2]=o}i=o>>>3;if(o>>>0<256){r=i<<1;s=644+(r<<2)|0;n=fe[151]|0;i=1<>2]|0;if(r>>>0<(fe[155]|0)>>>0)B();else{_=i;g=r}}else{fe[151]=n|i;_=644+(r+2<<2)|0;g=s}fe[_>>2]=v;fe[g+12>>2]=v;fe[v+8>>2]=g;fe[v+12>>2]=s;return}i=o>>>8;if(i)if(o>>>0>16777215)s=31;else{_=(i+1048320|0)>>>16&8;g=i<<_;m=(g+520192|0)>>>16&4;g=g<>>16&2;s=14-(m|_|s)+(g<>>15)|0;s=o>>>(s+7|0)&1|s<<1}else s=0;i=908+(s<<2)|0;fe[v+28>>2]=s;fe[v+20>>2]=0;fe[v+16>>2]=0;r=fe[152]|0;n=1<>2]=v;fe[v+24>>2]=i;fe[v+12>>2]=v;fe[v+8>>2]=v;return}i=fe[i>>2]|0;e:do{if((fe[i+4>>2]&-8|0)!=(o|0)){s=o<<((s|0)==31?0:25-(s>>>1)|0);while(1){r=i+16+(s>>>31<<2)|0;n=fe[r>>2]|0;if(!n)break;if((fe[n+4>>2]&-8|0)==(o|0)){i=n;break e}else{s=s<<1;i=n}}if(r>>>0<(fe[155]|0)>>>0)B();fe[r>>2]=v;fe[v+24>>2]=i;fe[v+12>>2]=v;fe[v+8>>2]=v;return}}while(0);r=i+8|0;n=fe[r>>2]|0;g=fe[155]|0;if(!(n>>>0>=g>>>0&i>>>0>=g>>>0))B();fe[n+12>>2]=v;fe[r>>2]=v;fe[v+8>>2]=n;fe[v+12>>2]=i;fe[v+24>>2]=0}function Zi(){}function ae(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;r=t-r-(i>>>0>e>>>0|0)>>>0;return(ie=r,e-i>>>0|0)|0}function G(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,s=0,o=0;r=e+i|0;if((i|0)>=20){t=t&255;s=e&3;o=t|t<<8|t<<16|t<<24;n=r&~3;if(s){s=e+4-s|0;while((e|0)<(s|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){fe[e>>2]=o;e=e+4|0}}while((e|0)<(r|0)){de[e>>0]=t;e=e+1|0}return e-i|0}function Ji(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){ie=t>>>i;return e>>>i|(t&(1<>>i-32|0}function Qi(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){ie=t<>>32-i;return e<>>0;return(ie=t+r+(i>>>0>>0|0)>>>0,i|0)|0}function er(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if((i|0)>=4096)return Qe(e|0,t|0,i|0)|0;r=e|0;if((e&3)==(t&3)){while(e&3){if(!i)return r|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;i=i-1|0}while((i|0)>=4){fe[e>>2]=fe[t>>2];e=e+4|0;t=t+4|0;i=i-4|0}}while((i|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;i=i-1|0}return r|0}function tr(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){ie=t>>i;return}ie=(t|0)<0?-1:0}function ir(e){e=e|0;var t=0;t=de[w+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[w+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[w+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[w+(e>>>24)>>0]|0)+24|0}function rr(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,s=0;s=e&65535;n=t&65535;i=ve(n,s)|0;r=e>>>16;e=(i>>>16)+(ve(n,r)|0)|0;n=t>>>16;t=ve(n,s)|0;return(ie=(e>>>16)+(ve(n,r)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|i&65535|0)|0}function nr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0,o=0,a=0,l=0,u=0;u=t>>31|((t|0)<0?-1:0)<<1;l=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;s=r>>31|((r|0)<0?-1:0)<<1;n=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;a=ae(u^e,l^t,u,l)|0;o=ie;e=s^u;t=n^l;ae((ur(a,o,ae(s^i,n^r,s,n)|0,ie,0)|0)^e,ie^t,e,t)}function sr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0,o=0,a=0,l=0,u=0;n=ge;ge=ge+16|0;a=n|0;o=t>>31|((t|0)<0?-1:0)<<1;s=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=r>>31|((r|0)<0?-1:0)<<1;l=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;e=ae(o^e,s^t,o,s)|0;t=ie;ur(e,t,ae(u^i,l^r,u,l)|0,ie,a)|0;r=ae(fe[a>>2]^o,fe[a+4>>2]^s,o,s)|0;i=ie;ge=n;ie=i}function or(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0;n=e;s=i;i=rr(n,s)|0;e=ie;ie=(ve(t,s)|0)+(ve(r,n)|0)+e|e&0}function ar(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;return ur(e,t,i,r,0)|0}function lr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,s=0;s=ge;ge=ge+16|0;n=s|0;ur(e,t,i,r,n)|0;ge=s;return(ie=fe[n+4>>2]|0,fe[n>>2]|0)|0}function ur(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var s=0,o=0,a=0,l=0,u=0,h=0,c=0,p=0,d=0,f=0;h=e;l=t;u=l;o=i;p=r;a=p;if(!u){s=(n|0)!=0;if(!a){if(s){fe[n>>2]=(h>>>0)%(o>>>0);fe[n+4>>2]=0}p=0;n=(h>>>0)/(o>>>0)>>>0;return(ie=p,n)|0}else{if(!s){p=0;n=0;return(ie=p,n)|0}fe[n>>2]=e|0;fe[n+4>>2]=t&0;p=0;n=0;return(ie=p,n)|0}}s=(a|0)==0;do{if(o){if(!s){s=(m(a|0)|0)-(m(u|0)|0)|0;if(s>>>0<=31){c=s+1|0;a=31-s|0;t=s-31>>31;o=c;e=h>>>(c>>>0)&t|u<>>(c>>>0)&t;s=0;a=h<>2]=e|0;fe[n+4>>2]=l|t&0;p=0;n=0;return(ie=p,n)|0}s=o-1|0;if(s&o){a=(m(o|0)|0)+33-(m(u|0)|0)|0;f=64-a|0;c=32-a|0;l=c>>31;d=a-32|0;t=d>>31;o=a;e=c-1>>31&u>>>(d>>>0)|(u<>>(a>>>0))&t;t=t&u>>>(a>>>0);s=h<>>(d>>>0))&l|h<>31;break}if(n){fe[n>>2]=s&h;fe[n+4>>2]=0}if((o|0)==1){d=l|t&0;f=e|0|0;return(ie=d,f)|0}else{f=ir(o|0)|0;d=u>>>(f>>>0)|0;f=u<<32-f|h>>>(f>>>0)|0;return(ie=d,f)|0}}else{if(s){if(n){fe[n>>2]=(u>>>0)%(o>>>0);fe[n+4>>2]=0}d=0;f=(u>>>0)/(o>>>0)>>>0;return(ie=d,f)|0}if(!h){if(n){fe[n>>2]=0;fe[n+4>>2]=(u>>>0)%(a>>>0)}d=0;f=(u>>>0)/(a>>>0)>>>0;return(ie=d,f)|0}s=a-1|0;if(!(s&a)){if(n){fe[n>>2]=e|0;fe[n+4>>2]=s&u|t&0}d=0;f=u>>>((ir(a|0)|0)>>>0);return(ie=d,f)|0}s=(m(a|0)|0)-(m(u|0)|0)|0;if(s>>>0<=30){t=s+1|0;a=31-s|0;o=t;e=u<>>(t>>>0);t=u>>>(t>>>0);s=0;a=h<>2]=e|0;fe[n+4>>2]=l|t&0;d=0;f=0;return(ie=d,f)|0}}while(0);if(!o){u=a;l=0;a=0}else{c=i|0|0;h=p|r&0;u=$i(c|0,h|0,-1,-1)|0;i=ie;l=a;a=0;do{r=l;l=s>>>31|l<<1;s=a|s<<1;r=e<<1|r>>>31|0;p=e>>>31|t<<1|0;ae(u,i,r,p)|0;f=ie;d=f>>31|((f|0)<0?-1:0)<<1;a=d&1;e=ae(r,p,d&c,(((f|0)<0?-1:0)>>31|((f|0)<0?-1:0)<<1)&h)|0;t=ie;o=o-1|0}while((o|0)!=0);u=l;l=0}o=0;if(n){fe[n>>2]=e;fe[n+4>>2]=t}d=(s|0)>>>31|(u|o)<<1|(o<<1|s>>>31)&0|l;f=(s<<1|0>>>31)&-2|a;return(ie=d,f)|0}function hr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;return v[e&7](t|0,i|0,r|0)|0}function cr(e,t,i,r,n,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;Pr[e&3](t|0,i|0,r|0,n|0,s|0)}function pr(e,t){e=e|0;t=t|0;Or[e&7](t|0)}function dr(e,t){e=e|0;t=t|0;return Rr[e&1](t|0)|0}function fr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;Cr[e&0](t|0,i|0,r|0)}function mr(e){e=e|0;Mr[e&3]()}function _r(e,t,i,r,n,s,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;o=o|0;Ir[e&3](t|0,i|0,r|0,n|0,s|0,o|0)}function gr(e,t,i,r,n,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;return X[e&1](t|0,i|0,r|0,n|0,s|0)|0}function vr(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;Dr[e&3](t|0,i|0,r|0,n|0)}function yr(e,t,i){e=e|0;t=t|0;i=i|0;o(0);return 0}function br(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o(1)}function xr(e){e=e|0;o(2)}function Tr(e){e=e|0;o(3);return 0}function wr(e,t,i){e=e|0;t=t|0;i=i|0;o(4)}function Er(){o(5)}function Sr(e,t,i,r,n,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;s=s|0;o(6)}function Ar(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o(7);return 0}function kr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;o(8)}var v=[yr,oi,Xi,Fi,Li,Ni,yr,yr];var Pr=[br,di,pi,br];var Or=[xr,ti,ni,ii,ri,si,bi,Gi];var Rr=[Tr,Di];var Cr=[wr];var Mr=[Er,vi,yi,Er];var Ir=[Sr,mi,fi,Sr];var X=[Ar,St];var Dr=[kr,li,ui,kr];return{___cxa_can_catch:_i,_crn_get_levels:Ft,_crn_get_uncompressed_size:zt,_crn_decompress:Bt,_i64Add:$i,_crn_get_width:Dt,___cxa_is_pointer_type:gi,_i64Subtract:ae,_memset:G,_malloc:Yi,_free:b,_memcpy:er,_bitshift64Lshr:Ji,_fflush:ki,_bitshift64Shl:Qi,_crn_get_height:Lt,___errno_location:re,_crn_get_dxt_format:Nt,runPostSets:Zi,_emscripten_replace_memory:dt,stackAlloc:ft,stackSave:mt,stackRestore:_t,establishStackSpace:gt,setThrew:vt,setTempRet0:xt,getTempRet0:Tt,dynCall_iiii:hr,dynCall_viiiii:cr,dynCall_vi:pr,dynCall_ii:dr,dynCall_viii:fr,dynCall_v:mr,dynCall_viiiiii:_r,dynCall_iiiiii:gr,dynCall_viiii:vr}}(e.Ya,e.Za,buffer)),zc=(e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress,e._i64Add=Z._i64Add),nb=(e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type,e._i64Subtract=Z._i64Subtract),qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory,rb=(e._crn_get_dxt_format=Z._crn_get_dxt_format,e._bitshift64Lshr=Z._bitshift64Lshr),Na=e._free=Z._free,sb=(e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location,e._bitshift64Shl=Z._bitshift64Shl);function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function i(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>8&255,e>>16&255,e>>24&255)}!function(a){a.loadFromArrayBuffer=function(e,t,i){return new r(t).loadFromArrayBuffer(e,i)};l=PIXI.resources.Resource,__extends(e,l),e.prototype.init=function(e,t,i,r,n,s,o){void 0===r&&(r=-1),void 0===n&&(n=-1),this.src=e,this.resize(r,n),this._width=r,this._height=n,this.data=t,this.type=i,this.levels=s,this.internalFormat=o;e=this.complete;return this.complete=!!t,!e&&this.complete&&this.onload&&this.onload({target:this}),this.update(),this},e.prototype.dispose=function(){this.data=null},e.prototype.bind=function(e){void 0!==e.alphaMode?e.alphaMode=PIXI.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA:e.premultiplyAlpha=!1,l.prototype.bind.call(this,e)},e.prototype.upload=function(e,t,i){var r=e.state.gl;if(i.compressed=!1,e.texture.initCompressed(),null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var n=this.levels,s=this.width,o=this.height,a=0,l=0;l>=1)<1&&(s=1),(o>>=1)<1&&(o=1),a+=u}return this._internalLoader.free(),this.preserveSource||(this.data=null),!0},e.prototype.style=function(e,t,i){var e=e.state.gl,r=this.levels;return t.scaleMode===PIXI.SCALE_MODES.LINEAR?1>2)*(t+3>>2)*8;case 33778:case 33779:case 35987:case 34798:return(e+3>>2)*(t+3>>2)*16;default:return 0}},h.type="DDS",h);function h(e){return i.call(this,e)||this}e.DDSLoader=r}(pixi_compressed_textures=pixi_compressed_textures||{}),!function(e){(i={})[0]=35841,i[1]=35843,i[2]=35840,i[3]=35842,i[6]=36196,i[7]=33776,i[9]=33778,i[5]=33779;var t,o=i,i=(t=e.AbstractInternalLoader,__extends(a,t),a.prototype.load=function(e){var t,i,r,n,s;if(a.test(e))return t=(s=new Int32Array(e,0,13))[2],t=o[t]||-1,i=s[7],r=s[6],n=s[11],s=s[12]+52,e=new Uint8Array(e,s),s=this._image,this._format=t,s.init(s.src,e,"PVR",i,r,n,t),s;throw"Invalid magic number in PVR header"},a.test=function(e){return 55727696===new Int32Array(e,0,1)[0]},a.prototype.levelBufferSize=function(e,t,i){switch(void 0===i&&(i=0),this._format){case 33776:case 36196:return(e+3>>2)*(t+3>>2)*8;case 33778:case 33779:return(e+3>>2)*(t+3>>2)*16;case 35840:case 35842:return Math.floor((Math.max(e,8)*Math.max(t,8)*4+7)/8);case 35841:case 35843:return Math.floor((Math.max(e,16)*Math.max(t,8)*2+7)/8);default:return 0}},a.type="PVR",a);function a(e){return t.call(this,e)||this}e.PVRTCLoader=i}(pixi_compressed_textures=pixi_compressed_textures||{}),!function(l){var e,t,i=0,r=2,n=3,s=8,o=9,a=10,u=11,h=((e={})[3]=!0,e[9]=!0,e[10]=!0,e[11]=!0,e),c=((e={})[u]=-1,e[i]=36196,e[r]=33776,e[n]=33779,e[s]=35840,e[o]=35842,e[a]=37808,e),p=Object.keys(c).reduce(function(e,t){return e[c[+t]]=+t,e},{}),u=(t=l.AbstractInternalLoader,__extends(d,t),d.test=function(e){var e=1262195===new Uint32Array(e,0,1)[0]&&!!d.BASIS_BINDING,t=d.RGB_FORMAT&&d.RGBA_FORMAT;return!e&&t&&console.warn("[BASIS LOADER] Is Supported, but transcoder not binded or file is not BASIS file!"),t&&e},d.bindTranscoder=function(e,i){if(!e||!i)throw"Invalid state! undef fileCtr or ext invalid!";var t,r=Object.keys(i).reduce(function(e,t){t=i[t];return t?Object.assign(e,t.__proto__):e},{}),n=void 0,s=void 0;for(t in r){var o,a=r[t];void 0!==p[a]&&(o=p[a],h[o]?s={native:a,name:t,basis:o}:n={native:a,name:t,basis:o})}d.RGB_FORMAT=n||s,d.RGBA_FORMAT=s||n,d.BASIS_BINDING=e,console.log("[BASISLoader] Supported formats:","\nRGB:"+d.RGB_FORMAT.name+"\nRGBA:"+d.RGBA_FORMAT.name),l.RegisterCompressedLoader(d),l.RegisterCompressedExtensions("basis")},d.prototype.load=function(e){if(d.test(e))return this._loadAsync(e),this._image;throw"BASIS Transcoder not binded or transcoding not supported =(!"},d.prototype._loadAsync=function(e){var t=performance.now(),e=new d.BASIS_BINDING(new Uint8Array(e)),i=e.getImageWidth(0,0),r=e.getImageHeight(0,0),n=e.getHasAlpha(),s=this._image;if(!e.startTranscoding())throw"Transcoding error!";var n=n?d.RGBA_FORMAT:d.RGB_FORMAT,o=(console.log("Grats! BASIS will be transcoded to:",n),new Uint8Array(e.getImageTranscodedSizeInBytes(0,0,n.basis)));if(!e.transcodeImage(o,0,0,n.basis,!1,!1))throw"Transcoding error!";console.log("[BASISLoader] Totla transcoding time:",performance.now()-t),this._format=n.native,this._file=e;t=n.name.replace("COMPRESSED_","");return Promise.resolve(s.init(s.src,o,"BASIS|"+t,i,r,1,n.native))},d.prototype.levelBufferSize=function(e,t,i){return this._file?this._file.getImageTranscodedSizeInBytes(0,i,p[this._format]):void 0},d.BASIS_BINDING=void 0,d);function d(e){e=t.call(this,e)||this;return e.type="BASIS",e._file=void 0,e}l.BASISLoader=u}(pixi_compressed_textures=pixi_compressed_textures||{}),!function(r){var g=window.CRN_Module;var t,v=[33776,33778,33779],e=(t=r.AbstractInternalLoader,__extends(i,t),i.prototype.load=function(e){for(var t=e.byteLength,e=new Uint8Array(e),i=g._malloc(t),r=e,n=g.HEAPU8,s=i,o=t,a=s/4,e=o%4,l=new Uint32Array(r.buffer,0,(o-e)/4),u=new Uint32Array(n.buffer),h=0;hn.count))return e=new o,n.workers.push(e),e.init(t,i).then(function(){i=e.binary,r()})}var n=this,s=0;return r().then(function(){return n})},i.prototype.transcode=function(t,i){var n,s,o,a;if(this.workers&&this.workers.length)return n=this.workers,s=void 0,o=0,a=function(e){for(var t=0,i=n;t>0,r=e[t];e[t]=e[i],e[i]=r}},E.prototype._randomizeOffsets=function(){for(var e=0;e>0,e,1+o>>0),r+=o}t.baseTexture.update(),this.uniforms.displacementMap=t},Object.defineProperty(E.prototype,"sizes",{get:function(){return this._sizes},set:function(e){for(var t=Math.min(this._slices,e.length),i=0;i>0)},Object.defineProperty(x.prototype,"offset",{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),x),Ge=(t(b,$=a.Filter),Object.defineProperty(b.prototype,"replacements",{get:function(){return this._replacements},set:function(e){var t=this.uniforms.originalColors,i=this.uniforms.targetColors,r=e.length;if(r>this._maxColors)throw new Error("Length of replacements ("+r+") exceeds the maximum colors length ("+this._maxColors+")");t[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}",t.toFixed(1)))||this;return Object.assign(t,e),t}function r(e){var t=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(t,r.defaults,e),t}function n(e,t,i,r){void 0===e&&(e=100),void 0===t&&(t=600);var n=j.call(this)||this;return n.tiltShiftXFilter=new Qe(e,t,i,r),n.tiltShiftYFilter=new $e(e,t,i,r),n}function rt(){return null!==G&&G.apply(this,arguments)||this}function nt(){return null!==X&&X.apply(this,arguments)||this}function s(e,t,i,r){void 0===e&&(e=100),void 0===t&&(t=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=e,n.uniforms.gradientBlur=t,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(e,t,i){void 0===t&&(t=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=e,r.color=t,r}function f(e,t,i){void 0===e&&(e=[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=e,Object.assign(r,f.defaults,t),r.time=i,r}function m(e,t,i){void 0===e&&(e=[-10,0]),void 0===t&&(t=[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=e,r.green=t,r.blue=i,r}function _(e){var t=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 t.time=0,t.uniforms.amplitude=new Float32Array(2),t.uniforms.waveLength=new Float32Array(2),t.uniforms.alpha=new Float32Array(2),t.uniforms.dimensions=new Float32Array(2),Object.assign(t,_.defaults,e),t}function g(e,t,i,r){void 0===e&&(e=0),void 0===t&&(t=[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=e,n.center=t,n.kernelSize=i,n.radius=r,n}function st(e){void 0===e&&(e=10);var t=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 t.size=e,t}function v(e,t,i){void 0===e&&(e=1),void 0===t&&(t=0);var r=J.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:e,color:t,quality:i}),r}function y(e,t){void 0===t&&(t=0);var i=Q.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 e?(i.seed=e,e=void 0):i.seed=t,Object.assign(i,y.defaults,e),i}function b(e,t,i){void 0===t&&(t=.05),void 0===i&&(i=e.length);var r=$.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=t,r._maxColors=i,r.uniforms.originalColors=new Float32Array(3*i),r.uniforms.targetColors=new Float32Array(3*i),r.replacements=e,r}function x(e,t,i){void 0===e&&(e=[0,0]),void 0===t&&(t=5),void 0===i&&(i=0);var r=ee.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(e),r.kernelSize=t,r.offset=i,r}function T(e){var t=te.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,e=(t.parallel=!0,t.time=0,t._angle=0,t.uniforms.dimensions=new Float32Array(2),Object.assign(T.defaults,e));return t._angleLight=new l.Point,t.angle=e.angle,t.gain=e.gain,t.lacunarity=e.lacunarity,t.alpha=e.alpha,t.parallel=e.parallel,t.center=e.center,t.time=e.time,t}function w(e){var t=this,e=Object.assign({},w.defaults,e),i=e.outerStrength,r=e.innerStrength,n=e.color,s=e.knockout,o=e.quality,e=Math.round(e.distance);return(t=ie.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/e).toFixed(7)).replace(/__DIST__/gi,e.toFixed(0)+".0"))||this).uniforms.glowColor=new Float32Array([0,0,0,1]),Object.assign(t,{color:n,outerStrength:i,innerStrength:r,padding:e,knockout:s}),t}function E(e){var t=re.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 t.offset=100,t.fillMode=E.TRANSPARENT,t.average=!1,t.seed=0,t.minSize=8,t.sampleSize=512,t._slices=0,t._offsets=new Float32Array(1),t._sizes=new Float32Array(1),t._direction=-1,t.uniforms.dimensions=new Float32Array(2),t._canvas=document.createElement("canvas"),t._canvas.width=4,t._canvas.height=t.sampleSize,t.texture=a.Texture.from(t._canvas,{scaleMode:c.SCALE_MODES.NEAREST}),Object.assign(t,E.defaults,e),t}function ot(e){void 0===e&&(e=5);var t=ne.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 t.strength=e,t}function S(e){var t=se.call(this)||this,e=(t.angle=45,t._distance=5,t._resolution=u.settings.FILTER_RESOLUTION,e?xe(xe({},S.defaults),e):S.defaults),i=e.kernels,r=e.blur,n=e.quality,s=e.pixelSize,o=e.resolution,i=(t._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}"),t._tintFilter.uniforms.color=new Float32Array(4),t._tintFilter.uniforms.shift=new l.Point,t._tintFilter.resolution=o,t._blurFilter=i?new d(i):new d(r,n),t.pixelSize=s,t.resolution=o,e.shadowOnly),r=e.rotation,n=e.distance,s=e.alpha,o=e.color;return t.shadowOnly=i,t.rotation=r,t.distance=n,t.alpha=s,t.color=o,t._updatePadding(),t}function A(e,t){void 0===e&&(e=1),void 0===t&&(t=5);var i=oe.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=e,i.angle=t,i}function k(e){var t=ae.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 t.time=0,t.seed=0,t.uniforms.dimensions=new Float32Array(2),Object.assign(t,k.defaults,e),t}function at(){return le.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(e,t,i){void 0===t&&(t=200),void 0===i&&(i=200);var r=ue.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!==e&&(r.matrix=e),r.width=t,r.height=i,r}function O(e,t,i){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===i&&(i=.4);var r=he.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=e,r.newColor=t,r.epsilon=i,r}function lt(e,t){void 0===e&&(e=0),void 0===t&&(t=1);var i=ce.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=e,i.alpha=t,i}function R(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=1);var r=pe.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=t,r.mix=i,r.colorMap=e,r}function C(e){var t=de.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 t.uniforms.dimensions=new Float32Array(2),Object.assign(t,C.defaults,e),t}function M(e,t,i,r){void 0===e&&(e=2),void 0===t&&(t=4),void 0===i&&(i=u.settings.FILTER_RESOLUTION),void 0===r&&(r=5);var n,s,o=fe.call(this)||this;return"number"==typeof e?s=n=e:e instanceof l.Point?(n=e.x,s=e.y):Array.isArray(e)&&(n=e[0],s=e[1]),o.blurXFilter=new N.BlurFilterPass(!0,n,t,i,r),o.blurYFilter=new N.BlurFilterPass(!1,s,t,i,r),o.blurYFilter.blendMode=c.BLEND_MODES.SCREEN,o.defaultFilter=new F.AlphaFilter,o}function I(e){var t=me.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 t._thickness=2,t._angle=0,t.uniforms.lightColor=new Float32Array(3),t.uniforms.shadowColor=new Float32Array(3),Object.assign(t,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),t.padding=1,t}function ut(e){void 0===e&&(e=8);var t=_e.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 t.size=e,t}function D(e){var t=ge.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,e=(t.bloomScale=1,t.brightness=1,t._resolution=u.settings.FILTER_RESOLUTION,"number"==typeof e&&(e={threshold:e}),Object.assign(D.defaults,e)),i=(t.bloomScale=e.bloomScale,t.brightness=e.brightness,e.kernels),r=e.blur,n=e.quality,s=e.pixelSize,o=e.resolution;return t._extractFilter=new we(e.threshold),t._extractFilter.resolution=o,t._blurFilter=i?new d(i):new d(r,n),t.pixelSize=s,t.resolution=o,t}function L(e,t,i){void 0===e&&(e=4),void 0===t&&(t=3);var r=ve.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(e)?r.kernels=e:(r._blur=e,r.quality=t),r}function ht(e){void 0===e&&(e=.5);var t=ye.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 t.threshold=e,t}function ct(e){var t=be.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 t.gamma=1,t.saturation=1,t.contrast=1,t.brightness=1,t.red=1,t.green=1,t.blue=1,t.alpha=1,Object.assign(t,e),t}return e.AdjustmentFilter=Te,e.AdvancedBloomFilter=Ee,e.AsciiFilter=Se,e.BevelFilter=Ae,e.BloomFilter=ke,e.BulgePinchFilter=Pe,e.CRTFilter=De,e.ColorMapFilter=Oe,e.ColorOverlayFilter=Re,e.ColorReplaceFilter=Ce,e.ConvolutionFilter=Me,e.CrossHatchFilter=Ie,e.DotFilter=Le,e.DropShadowFilter=Fe,e.EmbossFilter=Ne,e.GlitchFilter=ze,e.GlowFilter=Be,e.GodrayFilter=Ue,e.KawaseBlurFilter=d,e.MotionBlurFilter=je,e.MultiColorReplaceFilter=Ge,e.OldFilmFilter=Xe,e.OutlineFilter=He,e.PixelateFilter=Ye,e.RGBSplitFilter=qe,e.RadialBlurFilter=We,e.ReflectionFilter=Ve,e.ShockwaveFilter=Ke,e.SimpleLightmapFilter=Ze,e.TiltShiftAxisFilter=Je,e.TiltShiftFilter=et,e.TiltShiftXFilter=Qe,e.TiltShiftYFilter=$e,e.TwistFilter=tt,e.ZoomBlurFilter=it,Object.defineProperty(e,"__esModule",{value:!0}),e}({},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";u.createList=function(e){if("list"in e){var t=e.list,i=void 0,r=t[0],n=r.value,r=r.time,r=i=new u("string"==typeof n?l.ParticleUtils.hexToRGB(n):n,r,e.ease);if(2o.time;)n=o,o=e[++s];var l=(l-n.time)/(o.time-n.time),u=p.hexToRGB(n.value),h=p.hexToRGB(o.value),h={r:(h.r-u.r)*l+u.r,g:(h.g-u.g)*l+u.g,b:(h.b-u.b)*l+u.b};r.next=new c(h,a/t),r=r.next}return i};var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function i(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function n(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function s(e){this.ease&&(e=this.ease(e));var t=this.current.value,i=this.next.value,r=(i.r-t.r)*e+t.r,n=(i.g-t.g)*e+t.g,i=(i.b-t.b)*e+t.b;return l.ParticleUtils.combineRGBComponents(r,n,i)}function o(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,i=this.next.value,r=(i.r-t.r)*e+t.r,n=(i.g-t.g)*e+t.g,i=(i.b-t.b)*e+t.b;return l.ParticleUtils.combineRGBComponents(r,n,i)}function d(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function f(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return l.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}g.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?s:n:e.isStepped?this.interpolate=this.isColor?f:d:this.interpolate=this.isColor?a:o,this.ease=this.current.ease};var _=g;function g(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,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 e=this.colorList.current.value;this.tint=l.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},b.prototype.applyArt=function(e){this.texture=e||m.Texture.EMPTY},b.prototype.update=function(e){var t,i,r,n,s,o;return this.age+=e,this.age>=this.maxLife||this.age<0?(this.kill(),-1):(t=this.age*this._oneOverLife,this.ease&&(t=4===this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale&&(i=this.scaleList.interpolate(t)*this.scaleMultiplier,this.scale.x=this.scale.y=i),this._doNormalMovement&&(s=i=void 0,s=this._doSpeed?(r=this.speedList.interpolate(t)*this.speedMultiplier,l.ParticleUtils.normalize(this.velocity),l.ParticleUtils.scaleBy(this.velocity,r),i=this.velocity.x*e,this.velocity.y*e):this._doAcceleration?(r=this.velocity.x,n=this.velocity.y,this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed&&(o=l.ParticleUtils.length(this.velocity))>this.maxSpeed&&l.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/o),i=(r+this.velocity.x)/2*e,(n+this.velocity.y)/2*e):(i=this.velocity.x*e,this.velocity.y*e),this.position.x+=i,this.position.y+=s),this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration?(o=this.rotationSpeed+this.rotationAcceleration*e,this.rotation+=(this.rotationSpeed+o)/2*e,this.rotationSpeed=o):0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x)),t)},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(e){for(var t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=h(e[t]));if(l.ParticleUtils.verbose)for(t=e.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,h,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(e){},S.prototype._spawnPoint=function(e,t,i){this.minStartRotation===this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,e.position.x=t,e.position.y=i},S.prototype._spawnRect=function(e,t,i){this.minStartRotation===this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.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),e.position.x=t+E.x,e.position.y=i+E.y},S.prototype._spawnCircle=function(e,t,i){this.minStartRotation===this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.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),e.position.x=t+E.x,e.position.y=i+E.y},S.prototype._spawnRing=function(e,t,i){var r=this.spawnCircle,r=(this.minStartRotation===this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.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());e.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),e.position.x=t+E.x,e.position.y=i+E.y},S.prototype._spawnPolygonalChain=function(e,t,i){this.minStartRotation===this.maxStartRotation?e.rotation=this.minStartRotation+this.rotation:e.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,this.spawnPolygonalChain.getRandomPoint(E),0!==this.rotation&&l.ParticleUtils.rotatePoint(this.rotation,E),e.position.x=t+E.x,e.position.y=i+E.y},S.prototype._spawnBurst=function(e,t,i,r){0===this.particleSpacing?e.rotation=360*Math.random():e.rotation=this.angleStart+this.particleSpacing*r+this.rotation,e.position.x=t,e.position.y=i},S.prototype.cleanup=function(){for(var e,t=this._activeParticlesFirst;t;t=e)e=t.next,this.recycle(t),t.parent&&t.parent.removeChild(t);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0},S.prototype.destroy=function(){var e;this.autoUpdate=!1,this.cleanup();for(var t=this._poolFirst;t;t=e)e=t.next,t.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(e,t,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=e,t&&i&&this.init(t,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,k=["pow","sqrt","abs","floor","round","ceil","E","PI","sin","cos","tan","asin","acos","atan","atan2","log"],P=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(k).join("|"),"g");i(C,O=y),C.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},C.prototype.update=function(e){var t,i=this.Particle_update(e);return 0<=i&&this.path&&(t=this._doSpeed?this.speedList.interpolate(i)*this.speedMultiplier:this.speedList.current.value*this.speedMultiplier,this.movement+=t*e,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},C.prototype.destroy=function(){this.Particle_destroy(),this.path=this.initialPosition=null},C.parseArt=function(e){return y.parseArt(e)},C.parseData=function(e){var t={};if(e&&e.path)try{t.path=function(e){for(var t=e.match(P),i=t.length-1;0<=i;--i)0<=k.indexOf(t[i])&&(t[i]="Math."+t[i]);return e=t.join(""),new Function("x","return "+e+";")}(e.path)}catch(e){l.ParticleUtils.verbose&&console.error("PathParticle: error in parsing path expression"),t.path=null}else l.ParticleUtils.verbose&&console.error("PathParticle requires a path string in extraData!"),t.path=null;return t};var O,R=C;function C(e){e=O.call(this,e)||this;return e.path=null,e.initialRotation=0,e.initialPosition=new m.Point,e.movement=0,e}i(I,M=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(e){this.textures=e.textures,this.framerate=e.framerate,this.duration=e.duration,this.loop=e.loop},I.prototype.update=function(e){var t=this.Particle_update(e);return 0<=t&&(this.elapsed+=e,this.elapsed>=this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6),e=this.elapsed*this.framerate+1e-7|0,this.texture=this.textures[e]||this.textures[this.textures.length-1]||m.Texture.EMPTY),t},I.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},I.parseArt=function(e){for(var t=[],i=0;ithis._childCount)throw new Error("addChildAt: The index "+t+" supplied is out of bounds "+this._childCount);e.parent&&e.parent.removeChild(e),(e.parent=this).sortDirty=!0,e.transform._parentID=-1;var i=e;if(this._firstChild)if(0===t)(this._firstChild.prevChild=i).nextChild=this._firstChild,this._firstChild=i;else if(t===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 "+t+" supplied is out of bounds "+this._childCount);if(e.parent!==this)throw new Error("The supplied DisplayObject must be a child of the caller");if(e.nextChild&&(e.nextChild.prevChild=e.prevChild),e.prevChild&&(e.prevChild.nextChild=e.nextChild),this._firstChild===e&&(this._firstChild=e.nextChild),this._lastChild===e&&(this._lastChild=e.prevChild),e.nextChild=null,e.prevChild=null,this._firstChild)if(0===t)(this._firstChild.prevChild=e).nextChild=this._firstChild,this._firstChild=e;else if(t===this._childCount)(this._lastChild.nextChild=e).prevChild=this._lastChild,this._lastChild=e;else{for(var i=0,r=this._firstChild;i=this._childCount)throw new Error("getChildAt: Index ("+e+") does not exist.");if(0===e)return this._firstChild;if(e===this._childCount)return this._lastChild;for(var t=0,i=this._firstChild;t=a.TRANSFORM_STEP.PROJ?(r||this.displayObjectUpdateTransform(),(this.proj.affine?this.transform.worldTransform:this.proj.world).applyInverse(e,i)):(this.parent?i=this.parent.worldTransform.applyInverse(e,i):(i.x=e.x,i.y=e.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 $=Q.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(e,t,i,r){super(e,t,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 e=this.geometry,t=e.buffers[0].data;if(e.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==t.length&&(this.vertexData=new Float32Array(t.length)),this.vertexData2d&&this.vertexData2d.length===3*t.length/2||(this.vertexData2d=new Float32Array(3*t.length));var i=this.proj.world.mat3,r=this.vertexData2d,n=this.vertexData;for(let e=0;ei.call(t,...e)),t=void 0)}return i}([t,"access",e=>e.program,"access",e=>e.uniformData,"optionalAccess",e=>e.translationMatrix])&&(t.uniforms.translationMatrix=this.worldTransform.toArray(!0)),e.shader.bind(t,!1),e.state.set(this.state),e.geometry.bind(this.geometry,t),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}toLocal(e,t,i,r,n=a.TRANSFORM_STEP.ALL){return $.call(this,e,t,i,r,n)}get worldTransform(){return this.proj.affine?this.transform.worldTransform:this.proj.world}}f.__initStatic(),f.__initStatic2();class ee extends f{constructor(e,t,i,r,n){super(new s.MeshGeometry(t,i,r),new s.MeshMaterial(e,{program:_.Program.from(f.defaultVertexShader,f.defaultFragmentShader),pluginName:"batch2d"}),null,n),ee.prototype.__init2.call(this),this.geometry.getBuffer("aVertexPosition").static=!1}__init2(){this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(e){this.geometry.getBuffer("aVertexPosition").data=e}_render(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(e)}}class m extends t.Sprite{constructor(e){super(e),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,u=this._anchor;let e,t,i,r;i=l?(t=l.x-u._x*n.width,e=t+l.width,(r=l.y-u._y*n.height)+l.height):(t=-u._x*n.width,e=t+n.width,(r=-u._y*n.height)+n.height),o[0]=s[0]*t+s[3]*r+s[6],o[1]=s[1]*t+s[4]*r+s[7],o[2]=s[2]*t+s[5]*r+s[8],o[3]=s[0]*e+s[3]*r+s[6],o[4]=s[1]*e+s[4]*r+s[7],o[5]=s[2]*e+s[5]*r+s[8],o[6]=s[0]*e+s[3]*i+s[6],o[7]=s[1]*e+s[4]*i+s[7],o[8]=s[2]*e+s[5]*i+s[8],o[9]=s[0]*t+s[3]*i+s[6],o[10]=s[1]*t+s[4]*i+s[7],o[11]=s[2]*t+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 e=this.transform._worldID,t=this._texture._updateID;if(this.vertexTrimmedData){if(this._transformTrimmedID===e&&this._textureTrimmedID===t)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=e,this._textureTrimmedID=t;var e=this._texture,t=this.vertexTrimmedData,e=e.orig,i=this.tileProj?this._width:e.width,e=this.tileProj?this._height:e.height,r=this._anchor,n=this.proj.world.mat3,s=-r._x*i,i=s+i,r=-r._y*e,e=r+e,o=1/(n[2]*s+n[5]*r+n[8]);t[0]=o*(n[0]*s+n[3]*r+n[6]),t[1]=o*(n[1]*s+n[4]*r+n[7]),o=1/(n[2]*i+n[5]*r+n[8]),t[2]=o*(n[0]*i+n[3]*r+n[6]),t[3]=o*(n[1]*i+n[4]*r+n[7]),o=1/(n[2]*i+n[5]*e+n[8]),t[4]=o*(n[0]*i+n[3]*e+n[6]),t[5]=o*(n[1]*i+n[4]*e+n[7]),o=1/(n[2]*s+n[5]*e+n[8]),t[6]=o*(n[0]*s+n[3]*e+n[6]),t[7]=o*(n[1]*s+n[4]*e+n[7])}}toLocal(e,t,i,r,n=a.TRANSFORM_STEP.ALL){return $.call(this,e,t,i,r,n)}get worldTransform(){return this.proj.affine?this.transform.worldTransform:this.proj.world}}const te=new d.Transform;class ie extends F.TilingSprite{constructor(e,t,i){super(e,t,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(e,t,i,r,n=a.TRANSFORM_STEP.ALL){return $.call(this,e,t,i,r,n)}_render(e){var t=this._texture;t&&t.valid&&(this.tileTransform.updateTransform(te),this.uvMatrix.update(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))}}function re(){this.proj||(this.proj=new l(this.transform),this.toLocal=Q.prototype.toLocal,Object.defineProperty(this,"worldTransform",{get:J,enumerable:!0,configurable:!0}))}e.Container.prototype.convertTo2d=re,t.Sprite.prototype.convertTo2d=function(){this.proj||(this.calculateVertices=m.prototype.calculateVertices,this.calculateTrimmedVertices=m.prototype.calculateTrimmedVertices,this._calculateBounds=m.prototype._calculateBounds,this.pluginName="batch2d",re.call(this))},e.Container.prototype.convertSubtreeTo2d=function(){this.convertTo2d();for(let e=0;e 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:_e,vertexSize:16},e);return X=class extends Y{constructor(e){super(e),X.prototype.__init.call(this),X.prototype.__init2.call(this),X.prototype.__init3.call(this),this.shaderGenerator=new _.BatchShaderGenerator(t,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(e){e=e.proj;return null!==e.surface?e.uniforms:null!==e._activeProjection?e._activeProjection.uniforms:this.defUniforms}packInterleavedGeometry(e,t,i,r,n){var{uint32View:s,float32View:o}=t,a=r/this.vertexSize,l=e.indices,u=e.vertexData,h=e._texture._frame,c=e.aTrans,{_batchLocation:p,realWidth:d,realHeight:f,resolution:m}=e._texture.baseTexture,t=Math.min(e.worldAlpha,1),_=t<1&&e._texture.baseTexture.alphaMode?g.premultiplyTint(e._tintRGB,t):e._tintRGB+(255*t<<24);for(let e=0;et[e]&&(r=t[e]),st[e+1]&&(n=t[e+1]),oR[e]&&(l=O[t],O[t]=O[e],O[e]=l,l=R[t],R[t]=R[e],R[e]=l)}t[0]=O[0].x,t[1]=O[0].y,t[2]=O[1].x,t[3]=O[1].y,t[4]=O[2].x,t[5]=O[2].y,t[6]=O[3].x,t[7]=O[3].y,(O[3].x-O[2].x)*(O[1].y-O[2].y)-(O[1].x-O[2].x)*(O[3].y-O[2].y)<0&&(t[4]=O[3].x,t[5]=O[3].y)}}}const ve=new d.Matrix,M=new d.Rectangle,I=new d.Point;class ye extends C{constructor(...e){super(...e),ye.prototype.__init.call(this)}__init(){this.distortion=new d.Point}clear(){this.distortion.set(0,0)}apply(e,t){t=t||new d.Point;var i=this.distortion,r=e.x*e.y;return t.x=e.x+i.x*r,t.y=e.y+i.y*r,t}applyInverse(e,t){t=t||new d.Point;var i=e.x,e=e.y,r=this.distortion.x,n=this.distortion.y;if(0===r)t.x=i,t.y=e/(1+n*i);else if(0===n)t.y=e,t.x=i/(1+r*e);else{var e=.5*(e*r-i*n+1)/n,s=e*e+i/n;if(s<=1e-5)return t.set(NaN,NaN),t;t.x=0>0,0!==h._cycle&&h._cycle===h._totalTime/c&&d<=e&&h._cycle--,h._time=h._totalTime-h._cycle*c,h._yoyo&&0!=(1&h._cycle)&&(h._time=m-h._time,(u=h._yoyoEase||h.vars.yoyoEase)&&(h._yoyoEase||(!0!==u||h._initted?h._yoyoEase=u=!0===u?h._ease:u instanceof Ease?u:Ease.map[u]:(u=h.vars.ease,h._yoyoEase=u=u?u instanceof Ease?u:"function"==typeof u?new Ease(u,h.vars.easeParams):Ease.map[u]||g.defaultEase:g.defaultEase)),h.ratio=u?1-u.getRatio((m-h._time)/m):0)),h._time>m?h._time=m:h._time<0&&(h._time=0)),h._easeType&&!u?(c=h._time/m,(1===(o=h._easeType)||3===o&&.5<=c)&&(c=1-c),3===o&&(c*=2),1===(a=h._easePower)?c*=c:2===a?c*=c*c:3===a?c*=c*c*c:4===a&&(c*=c*c*c*c),h.ratio=1===o?1-c:2===o?c:h._time/m<.5?c/2:1-c/2):u||(h.ratio=h._ease.getRatio(h._time/m))),p!==h._time||i||f!==h._cycle){if(!h._initted){if(h._init(),!h._initted||h._gc)return;if(!i&&h._firstPT&&(!1!==h.vars.lazy&&h._duration||h.vars.lazy&&!h._duration))return h._time=p,h._totalTime=d,h._rawPrevTime=_,h._cycle=f,x.lazyTweens.push(h),void(h._lazy=[e,t]);!h._time||r||u?r&&this._ease._calcEnd&&!u&&(h.ratio=h._ease.getRatio(0===h._time?0:1)):h.ratio=h._ease.getRatio(h._time/m)}for(!1!==h._lazy&&(h._lazy=!1),h._active||!h._paused&&h._time!==p&&0<=e&&(h._active=!0),0===d&&(2===h._initted&&0e._startTime;l._timeline;)u&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return h},e.remove=function(e){var t;if(e instanceof c)return this._remove(e,!1),t=e._timeline=e.vars.useFrames?c._rootFramesTimeline:c._rootTimeline,e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this;if(e instanceof Array||e&&e.push&&d(e)){for(var i=e.length;-1<--i;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},e._remove=function(e,t){return p.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},e.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},e.insert=e.insertMultiple=function(e,t,i,r){return this.add(e,t||0,i,r)},e.appendMultiple=function(e,t,i,r){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),i,r)},e.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},e.addPause=function(e,t,i,r){i=f.delayedCall(0,n,i,r||this);return i.vars.onComplete=i.vars.onReverseComplete=t,i.data="isPause",this._hasPause=!0,this.add(i,e)},e.removeLabel=function(e){return delete this._labels[e],this},e.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},e._parseTimeOrLabel=function(e,t,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 e||t?99999999999=e&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(e-l._startTime)*l._timeScale:(e-l._startTime)*l._timeScale,t,i),l=l._prev;l=null,c.pause(),c._pauseTime=h}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(e-r._startTime)*r._timeScale,t,i):r.render((e-r._startTime)*r._timeScale,t,i)}r=s}!c._onUpdate||t||(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),!t&&c.vars[o]&&c._callback(o))}},e._hasPausedChild=function(){for(var e=this._first;e;){if(e._paused||e instanceof m&&e._hasPausedChild())return!0;e=e._next}return!1},e.getChildren=function(e,t,i,r){r=r||-9999999999;for(var n=[],s=this._first,o=0;s;)s._startTime=i&&(n._startTime+=e),n=n._next;if(t)for(r in s)s[r]>=i&&(s[r]+=e);return this._uncache(!0)},e._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var i=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(e,t)&&(n=!0);return n},e.clear=function(e){var t=this.getChildren(!1,!0,!0),i=t.length;for(this._time=this._totalTime=0;-1<--i;)t[i]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},e.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return c.prototype.invalidate.call(this)},e._enabled=function(e,t){if(e===this._gc)for(var i=this._first;i;)i._enabled(e,!0),i=i._next;return p.prototype._enabled.call(this,e,t)},e.totalTime=function(e,t,i){this._forcingPlayhead=!0;var r=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},e.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},e.totalDuration=function(e){if(arguments.length)return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this;if(this._dirty){for(var t,i,r=0,n=this,s=n._last,o=999999999999;s;)t=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=t;n._duration=n._totalDuration=r,n._dirty=!1}return this._totalDuration},e.paused=function(e){if(!1===e&&this._paused)for(var t=this._first;t;)t._startTime===this._time&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return c.prototype.paused.apply(this,arguments)},e.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===c._rootFramesTimeline},e.rawTime=function(e){return e&&(this._paused||this._repeat&&0>0,c._cycle&&c._cycle===c._totalTime/x&&m<=e&&c._cycle--,c._time=c._totalTime-c._cycle*x,c._yoyo&&1&c._cycle&&(c._time=f-c._time),c._time>f?e=(c._time=f)+1e-4:c._time<0?c._time=e=0:e=c._time));if(c._hasPause&&!c._forcingPlayhead&&!t){if(p<(e=c._time)||c._repeat&&b!==c._cycle)for(r=c._first;r&&r._startTime<=e&&!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>=e&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(e-l._startTime)*l._timeScale:(e-l._startTime)*l._timeScale,t,i),l=l._prev;l=null,c.pause(),c._pauseTime=h}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(e-r._startTime)*r._timeScale,t,i):r.render((e-r._startTime)*r._timeScale,t,i)}r=s}!c._onUpdate||t||(P.length&&O(),c._callback("onUpdate")),!o||c._locked||c._gc||_!==c._startTime&&g===c._timeScale||(0===c._time||d>=c.totalDuration())&&(n&&(P.length&&O(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!t&&c.vars[o]&&c._callback(o))}else m!==c._totalTime&&c._onUpdate&&!t&&c._callback("onUpdate")},r.getActive=function(e,t,i){for(var r,n=[],s=this.getChildren(e||null==e,t||null==e,!!i),o=0,a=s.length,l=0;le)return t[r].name;return null},r.getLabelBefore=function(e){null==e&&(e=this._time);for(var t=this.getLabelsArray(),i=t.length;-1<--i;)if(t[i].time>0||6)-1,c=[],p=[];for(i in e){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=e[i],w=o,E=t,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]=u,l=0,p=[]);return{length:u,lengths:a,segments:c}}(this._beziers,this._timeRes),this._length=h.length,this._lengths=h.lengths,this._segments=h.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 e[r]&&e[r.indexOf("set")||"function"!=typeof e["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(e){var t,i,r,n,s,o,a,l,u,h,c=this._segCount,p=this._func,d=this._target,f=e!==this._startRatio;if(this._timeRes){if(l=this._lengths,u=this._curSeg,h=e*this._length,w=this._li,h>this._l2&&w=h;);0===w&&hthis._s2&&w=h;);0===w&&h>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][t]).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[t],m=m[t],_=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)}}),e=_.prototype,_.bezierThrough=p,_.cubicToQuadratic=U,_._autoCSS=!0,_.quadraticToCubic=function(e,t,i){return new B(e,(2*t+e)/3,(2*t+i)/3,i)},_._cssRegister=function(){var d,f,m,e=t.CSSPlugin;e&&(e=e._internals,d=e._parseToProxy,f=e._setPluginRatio,m=e.CSSPropTween,e._registerComplexSpecialProp("bezier",{parser:function(e,t,i,r,n,s){t instanceof Array&&(t={values:t}),s=new _;var o,a,l,u=t.values,h=u.length-1,c=[],p={};if(!(h<0)){for(o=0;o<=h;o++)l=d(e,u[o],r,n,s,h!==o),c[o]=l.end;for(a in t)p[a]=t[a];p.values=c,(n=new m(e,"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}}))},e._mod=function(e){for(var t,i=this._overwriteProps,r=i.length;-1<--r;)(t=e[i[r]])&&"function"==typeof t&&(this._mod[i[r]]=t)},e._kill=function(e){var t,i,r=this._props;for(t in this._beziers)if(t in e)for(delete this._beziers[t],delete this._func[t],i=r.length;-1<--i;)r[i]===t&&r.splice(i,1);if(r=this._autoRotate)for(i=r.length;-1<--i;)e[r[i][2]]&&r.splice(i,1);return this._super._kill.call(this,e)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(o,R){function C(){o.call(this,"css"),this._overwriteProps.length=0,this.setRatio=C.prototype.setRatio}function a(e,t){return t.toUpperCase()}function l(e,t){return(t=L.createElementNS?L.createElementNS(t||"http://www.w3.org/1999/xhtml",e):L.createElement(e)).style?t:L.createElement(e)}function u(e){return ne.test("string"==typeof e?e:(e.currentStyle||e.style).filter||"")?parseFloat(RegExp.$1)/100:1}function _(e){_gsScope.console&&console.log(e)}function T(e,t){var i,r,n=(t=t||F).style;if(void 0!==n[e])return e;for(e=e.charAt(0).toUpperCase()+e.substr(1),i=["O","Moz","ms","Ms","Webkit"],r=5;-1<--r&&void 0===n[i[r]+e];);return 0<=r?(ve="-"+(ye=3===r?"ms":i[r]).toLowerCase()+"-",ye+e):null}function f(e){return be.getComputedStyle(e)}function p(e,t){var i,r,n={};if(t=t||f(e))if(i=t.length)for(;-1<--i;)-1!==(r=t[i]).indexOf("-transform")&&Ge!==r||(n[r.replace(ue,a)]=t.getPropertyValue(r));else for(i in t)-1!==i.indexOf("Transform")&&H!==i||(n[i]=t[i]);else if(t=e.currentStyle||e.style)for(i in t)"string"==typeof i&&void 0===n[i]&&(n[i.replace(ue,a)]=t[i]);return N||(n.opacity=u(e)),e=Ze(e,t,!1),n.rotation=e.rotation,n.skewX=e.skewX,n.scaleX=e.scaleX,n.scaleY=e.scaleY,n.x=e.x,n.y=e.y,Y&&(n.z=e.z,n.rotationX=e.rotationX,n.rotationY=e.rotationY,n.scaleZ=e.scaleZ),n.filters&&delete n.filters,n}function g(e,t,i,r,n){var s,o,a,l={},u=e.style;for(o in i)"cssText"===o||"length"!==o&&isNaN(o)&&(t[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 t[o]||""===t[o].replace(ie,"")?s:0:xe(e,o),void 0!==u[o]&&(a=new Pe(u,o,u[o],a)));if(r)for(o in r)"className"!==o&&(l[o]=r[o]);return{difs:l,firstMPT:a}}function A(e,t){return"string"==typeof(e="function"==typeof e?e(O,P):e)&&"="===e.charAt(1)?parseInt(e.charAt(0)+"1",10)*parseFloat(e.substr(2)):parseFloat(e)-parseFloat(t)||0}function E(e,t){var i="string"==typeof(e="function"==typeof e?e(O,P):e)&&"="===e.charAt(1);return null==(e="string"==typeof e&&"v"===e.charAt(e.length-2)?(i?e.substr(0,2):0)+window["inner"+("vh"===e.substr(-2)?"Height":"Width")]*(parseFloat(i?e.substr(2):e)/100):e)?t:i?parseInt(e.charAt(0)+"1",10)*parseFloat(e.substr(2))+t:parseFloat(e)||0}function S(e,t,i,r){var n,s;return n=(n=null==(e="function"==typeof e?e(O,P):e)?t:"number"==typeof e?e:(n=e.split("_"),s=((s="="===e.charAt(1))?parseInt(e.charAt(0)+"1",10)*parseFloat(n[0].substr(2)):parseFloat(n[0]))*(-1===e.indexOf("rad")?1:D)-(s?0:t),n.length&&(r&&(r[i]=t+s),-1!==e.indexOf("short")&&(s%=360)!==s%180&&(s=s<0?s+360:s-360),-1!==e.indexOf("_cw")&&s<0?s=(s+3599999999640)%360-360*(s/360|0):-1!==e.indexOf("ccw")&&0>16,e>>8&255,255&e];else{if(","===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1)),Ee[e])i=Ee[e];else if("#"===e.charAt(0))4===e.length&&(e="#"+(r=e.charAt(1))+r+(n=e.charAt(2))+n+(s=e.charAt(3))+s),i=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e];else if("hsl"===e.substr(0,3))if(i=u=e.match(Q),t){if(-1!==e.indexOf("="))return e.match($)}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(e,o,n,s)}}function Pe(e,t,i,r,n){this.t=e,this.p=t,this.v=i,this.r=n,r&&((r._prev=this)._next=r)}t._setPluginRatio=function(e){this.plugin.setRatio(e);for(var t,i,r,n,s,o=this.data,a=o.proxy,l=o.firstMPT;l;)t=a[l.v],l.r?t=l.r(t):t<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},e.parse=function(e,t,i,r){var n,s,o,a,l,u,h,c,p=e.style;for(n in t){if(l=t[n],a=m[n],"function"!=typeof l||a&&a.allowFunc||(l=l(O,P)),a)i=a.parse(e,l,n,this,i,r,t);else{if("--"===n.substr(0,2)){this._tween._propLookup[n]=this._addTween.call(this._tween,e.style,"setProperty",f(e).getPropertyValue(n)+"",l+"",n,!1,n);continue}a=z(e,n,k)+"",h="string"==typeof l,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||h&&ae.test(l)?(h||(l=(3<(l=Se(l)).length?"rgba(":"rgb(")+l.join(",")+")"),i=Re(p,n,a,l,!0,"transparent",i,0,r)):h&&fe.test(l)?i=Re(p,n,a,l,!0,null,i,0,r):(u=(s=parseFloat(a))||0===s?a.substr((s+"").length):"",""!==a&&"auto"!==a||(u="width"===n||"height"===n?(s=function(e,t,i){if("svg"===(e.nodeName+"").toLowerCase())return(i||f(e))[t]||0;if(e.getCTM&&qe(e))return e.getBBox()[t]||0;var r=parseFloat("width"===t?e.offsetWidth:e.offsetHeight),n=Te[t],s=n.length;for(i=i||f(e);-1<--s;)r=(r-=parseFloat(z(e,"padding"+n[s],i,!0))||0)-(parseFloat(z(e,"border"+n[s]+"Width",i,!0))||0);return r}(e,n,k),"px"):"left"===n||"top"===n?(s=xe(e,n,k),"px"):(s="opacity"!==n?0:1,"")),""===(h=(c=h&&"="===l.charAt(1))?(o=parseInt(l.charAt(0)+"1",10),l=l.substr(2),o*=parseFloat(l),l.replace(re,"")):(o=parseFloat(l),h?l.replace(re,""):""))&&(h=n in W?W[n]:u),l=o||0===o?(c?o+s:o)+h:t[n],u===h||""===h&&"lineHeight"!==n||(o||0===o)&&s&&(s=w(e,n,s,u),"%"===h?(s/=w(e,n,100,"%")/100,!0!==t.strictUnits&&(a=s+"%")):"em"===h||"rem"===h||"vw"===h||"vh"===h?s/=w(e,n,1,h):"px"!==h&&(o=w(e,n,o,h),h="px"),c&&(o||0===o)&&(l=o+s+h)),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: "+t[n]):(i=new j(p,n,s,o-s,i,0,n,!1!==V&&("px"===h||"zIndex"===n),0,a,l)).xs0=h)}r&&i&&!i.plugin&&(i.plugin=r)}return i},e.setRatio=function(e){var t,i,r,n=this._firstPT;if(1!==e||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(e||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(t=n.c*e+n.s,n.r?t=n.r(t):t<1e-6&&-1e-6this._p3?this._calcEnd?1===e?0:1-(e=(e-this._p3)/this._p1)*e:t+(e-t)*(e=(e-this._p3)/this._p1)*e*e*e:this._calcEnd?1:t},p.ease=new p(.7,.7),d.config=p.config=function(e,t,i){return new p(e,t,i)},(d=(r=h("easing.SteppedEase",function(e,t){this._p1=1/(e=e||1),this._p2=e+(t?0:1),this._p3=t?1:0},!0)).prototype=new _).constructor=r,d.getRatio=function(e){return e<0?e=0:1<=e&&(e=.999999999),((this._p2*e|0)+this._p3)*this._p1},d.config=r.config=function(e,t){return new r(e,t)},(d=(n=h("easing.ExpoScaleEase",function(e,t,i){this._p1=Math.log(t/e),this._p2=t-e,this._p3=e,this._ease=i},!0)).prototype=new _).constructor=n,d.getRatio=function(e){return this._ease&&(e=this._ease.getRatio(e)),(this._p3*Math.exp(this._p1*e)-this._p3)/this._p2},d.config=n.config=function(e,t,i){return new n(e,t,i)},(d=(s=h("easing.RoughEase",function(e){for(var t,i,r,n,s,o,a=(e=e||{}).taper||"none",l=[],u=0,h=0|(e.points||20),c=h,p=!1!==e.randomize,d=!0===e.clamp,f=e.template instanceof _?e.template:null,m="number"==typeof e.strength?.4*e.strength:.4;-1<--c;)t=p?Math.random():1/h*c,i=f?f.getRatio(t):t,r="none"===a?m:"out"===a?(n=1-t)*n*m:"in"===a?t*t*m:t<.5?(n=2*t)*n*.5*m:(n=2*(1-t))*n*.5*m,p?i+=Math.random()*r-.5*r:c%2?i+=.5*r:i-=.5*r,d&&(1t.t){for(;t.next&&e>=t.t;)t=t.next;t=t.prev}else for(;t.prev&&e<=t.t;)t=t.prev;return(this._prev=t).v+(e-t.t)/t.gap*t.c},d.config=function(e){return new s(e)},s.ease=new s,t("Bounce",e("BounceOut",function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}),e("BounceIn",function(e){return(e=1-e)<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?1-(7.5625*(e-=2.25/2.75)*e+.9375):1-(7.5625*(e-=2.625/2.75)*e+.984375)}),e("BounceInOut",function(e){var t=e<.5;return(e=t?1-2*e:2*e-1)<1/2.75?e*=7.5625*e:e=e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,t?.5*(1-e):.5*e+.5})),t("Circ",e("CircOut",function(e){return Math.sqrt(1-(e-=1)*e)}),e("CircIn",function(e){return-(Math.sqrt(1-e*e)-1)}),e("CircInOut",function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)})),t("Elastic",(d=function(e,t,i){var r=h("easing."+e,function(e,t){this._p1=1<=e?e:1,this._p2=(t||i)/(e<1?e:1),this._p3=this._p2/l*(Math.asin(1/this._p1)||0),this._p2=l/this._p2},!0),e=r.prototype=new _;return e.constructor=r,e.getRatio=t,e.config=function(e,t){return new r(e,t)},r})("ElasticOut",function(e){return this._p1*Math.pow(2,-10*e)*Math.sin((e-this._p3)*this._p2)+1},.3),d("ElasticIn",function(e){return-(this._p1*Math.pow(2,10*--e)*Math.sin((e-this._p3)*this._p2))},.3),d("ElasticInOut",function(e){return(e*=2)<1?this._p1*Math.pow(2,10*--e)*Math.sin((e-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*--e)*Math.sin((e-this._p3)*this._p2)*.5+1},.45)),t("Expo",e("ExpoOut",function(e){return 1-Math.pow(2,-10*e)}),e("ExpoIn",function(e){return Math.pow(2,10*(e-1))-.001}),e("ExpoInOut",function(e){return(e*=2)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*(e-1)))})),t("Sine",e("SineOut",function(e){return Math.sin(e*u)}),e("SineIn",function(e){return 1-Math.cos(e*u)}),e("SineInOut",function(e){return-.5*(Math.cos(Math.PI*e)-1)})),h("easing.EaseLookup",{find:function(e){return _.map[e]}},!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,e=_[p];if(e)"undefined"!=typeof module&&module.exports&&(module.exports=e);else{var g,t,F,N=function(e){for(var t=e.split("."),i=_,r=0;r=t&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,i){if(g||P.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!i&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var r=this._totalDuration,n=this._timeline;if(rs;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,i){var r,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)r=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,i):n.render((e-n._startTime)*n._timeScale,t,i)),n=r},n.rawTime=function(){return g||P.wake(),this._totalTime},x("TweenLite",function(e,t,i){if(a.call(this,t,i),this.render=O.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"==typeof e&&O.selector(e)||e;var r,n,s,i=e.jquery||e.length&&e!==m&&e[0]&&(e[0]===m||e[0].nodeType&&e[0].style&&!e.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?ee[O.defaultOverwrite]:"number"==typeof o?o>>0:ee[o],(i||e instanceof Array||e.push&&y(e))&&"number"!=typeof e[0])for(this._targets=s=z(e),this._propLookup=[],this._siblings=[],r=0;r=te){for(i in te=P.frame+(parseInt(O.autoSleep,10)||120),l){for(e=(t=l[i].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete l[i]}if((!(i=h._first)||i._paused)&&O.autoSleep&&!u._first&&1===P._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||P.sleep()}}},P.addEventListener("tick",a._updateRoot),function(e,t,i){var r,n,s=e._gsTweenID;if(l[s||(e._gsTweenID=s="t"+Q++)]||(l[s]={target:e,tweens:[]}),t&&((r=l[s].tweens)[n=r.length]=t,i))for(;-1<--n;)r[n]===t&&r.splice(n,1);return l[s].tweens}),ie=function(e,t,i,r){var n,s,o=e.vars.onOverwrite;return o&&(n=o(e,t,i,r)),(o=O.onOverwrite)&&(s=o(e,t,i,r)),!1!==n&&!1!==s},re=function(e,t,i,r,n){var s,o,a;if(1===r||4<=r){for(a=n.length,d=0;du&&((p||!o._initted)&&u-o._startTime<=2e-8||(h[c++]=o)));for(d=c;-1<--d;)a=(o=h[d])._firstPT,2===r&&o._kill(i,e,t)&&(s=!0),(2!==r||!o._firstPT&&o._initted&&a)&&(2===r||ie(o,t))&&o._enabled(!1,!1)&&(s=!0)}return s},ne=function(e,t,i){for(var r=e._timeline,n=r._timeScale,s=e._startTime;r._timeline;){if(s+=r._startTime,n*=r._timeScale,r._paused)return-100;r=r._timeline}return t<(s/=n)?s-t:i&&s===t||!e._initted&&s-t<2e-8?v:(s+=e.totalDuration()/e._timeScale/n)>t+v?0:s-t-v},L=(n._init=function(){var e,t,i,r,n,s,o=this.vars,a=this._overwrittenProps,l=this._duration,u=!!o.immediateRender,h=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=u&&!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=O.to(this.target||{},0,n),u)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=t._firstPT=n}for(;a;)a.pg&&"function"==typeof a.t[e]&&a.t[e]()&&(i=!0),a=a._next;return i},L.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===L.API&&(M[(new e[t])._propName]=e[t]);return!0},r.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,i=e.propName,r=e.priority||0,n=e.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(){L.call(this,i,r),this._overwriteProps=n||[]},!0===e.global),a=o.prototype=new L(i);for(t in(a.constructor=o).API=e.API,s)"function"==typeof e[t]&&(a[s[t]]=e[t]);return o.version=e.version,L.activate([o]),o},s=m._gsQueue){for(o=0;o>0,c._cycle&&c._cycle===c._totalTime/x&&m<=e&&c._cycle--,c._time=c._totalTime-c._cycle*x,c._yoyo&&1&c._cycle&&(c._time=f-c._time),c._time>f?e=(c._time=f)+1e-4:c._time<0?c._time=e=0:e=c._time));if(c._hasPause&&!c._forcingPlayhead&&!t){if(p<(e=c._time)||c._repeat&&b!==c._cycle)for(r=c._first;r&&r._startTime<=e&&!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>=e&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(e-l._startTime)*l._timeScale:(e-l._startTime)*l._timeScale,t,i),l=l._prev;l=null,c.pause(),c._pauseTime=h}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(e-r._startTime)*r._timeScale,t,i):r.render((e-r._startTime)*r._timeScale,t,i)}r=s}!c._onUpdate||t||(P.length&&O(),c._callback("onUpdate")),!o||c._locked||c._gc||_!==c._startTime&&g===c._timeScale||(0===c._time||d>=c.totalDuration())&&(n&&(P.length&&O(),c._timeline.autoRemoveChildren&&c._enabled(!1,!1),c._active=!1),!t&&c.vars[o]&&c._callback(o))}else m!==c._totalTime&&c._onUpdate&&!t&&c._callback("onUpdate")},r.getActive=function(e,t,i){for(var r,n=[],s=this.getChildren(e||null==e,t||null==e,!!i),o=0,a=s.length,l=0;le)return t[r].name;return null},r.getLabelBefore=function(e){null==e&&(e=this._time);for(var t=this.getLabelsArray(),i=t.length;-1<--i;)if(t[i].timee._startTime;l._timeline;)u&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return h},e.remove=function(e){var t;if(e instanceof c)return this._remove(e,!1),t=e._timeline=e.vars.useFrames?c._rootFramesTimeline:c._rootTimeline,e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this;if(e instanceof Array||e&&e.push&&d(e)){for(var i=e.length;-1<--i;)this.remove(e[i]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},e._remove=function(e,t){return p.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},e.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},e.insert=e.insertMultiple=function(e,t,i,r){return this.add(e,t||0,i,r)},e.appendMultiple=function(e,t,i,r){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),i,r)},e.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},e.addPause=function(e,t,i,r){i=f.delayedCall(0,n,i,r||this);return i.vars.onComplete=i.vars.onReverseComplete=t,i.data="isPause",this._hasPause=!0,this.add(i,e)},e.removeLabel=function(e){return delete this._labels[e],this},e.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},e._parseTimeOrLabel=function(e,t,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 e||t?99999999999=e&&!l;)r._duration||"isPause"===r.data&&0c._time;)l.render(l._reversed?l.totalDuration()-(e-l._startTime)*l._timeScale:(e-l._startTime)*l._timeScale,t,i),l=l._prev;l=null,c.pause(),c._pauseTime=h}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(e-r._startTime)*r._timeScale,t,i):r.render((e-r._startTime)*r._timeScale,t,i)}r=s}!c._onUpdate||t||(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),!t&&c.vars[o]&&c._callback(o))}},e._hasPausedChild=function(){for(var e=this._first;e;){if(e._paused||e instanceof m&&e._hasPausedChild())return!0;e=e._next}return!1},e.getChildren=function(e,t,i,r){r=r||-9999999999;for(var n=[],s=this._first,o=0;s;)s._startTime=i&&(n._startTime+=e),n=n._next;if(t)for(r in s)s[r]>=i&&(s[r]+=e);return this._uncache(!0)},e._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var i=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(e,t)&&(n=!0);return n},e.clear=function(e){var t=this.getChildren(!1,!0,!0),i=t.length;for(this._time=this._totalTime=0;-1<--i;)t[i]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},e.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return c.prototype.invalidate.call(this)},e._enabled=function(e,t){if(e===this._gc)for(var i=this._first;i;)i._enabled(e,!0),i=i._next;return p.prototype._enabled.call(this,e,t)},e.totalTime=function(e,t,i){this._forcingPlayhead=!0;var r=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},e.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},e.totalDuration=function(e){if(arguments.length)return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this;if(this._dirty){for(var t,i,r=0,n=this,s=n._last,o=999999999999;s;)t=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=t;n._duration=n._totalDuration=r,n._dirty=!1}return this._totalDuration},e.paused=function(e){if(!1===e&&this._paused)for(var t=this._first;t;)t._startTime===this._time&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return c.prototype.paused.apply(this,arguments)},e.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===c._rootFramesTimeline},e.rawTime=function(e){return e&&(this._paused||this._repeat&&0>10|55296,1023&r|56320)}function N(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}function z(){T()}var e,d,b,s,B,f,U,j,x,l,u,T,w,i,E,m,r,n,_,S="sizzle"+ +new Date,g=F.document,A=0,G=0,X=ce(),H=ce(),v=ce(),Y=function(e,t){return e===t&&(u=!0),0},W={}.hasOwnProperty,t=[],V=t.pop,q=t.push,k=t.push,K=t.slice,y=function(e,t){for(var i=0,r=e.length;i+~]|"+o+")"+o+"*"),ie=new RegExp("="+o+"*([^\\]'\"]*?)"+o+"*\\]","g"),re=new RegExp(Q),ne=new RegExp("^"+a+"$"),p={ID:new RegExp("^#("+a+")"),CLASS:new RegExp("^\\.("+a+")"),TAG:new RegExp("^("+a+"|[*])"),ATTR:new RegExp("^"+J),PSEUDO:new RegExp("^"+Q),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")},se=/^(?:input|select|textarea|button)$/i,oe=/^h\d$/i,h=/^[^{]+\{\s*\[native \w/,ae=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,le=/[+~]/,O=new RegExp("\\\\([\\da-f]{1,6}"+o+"?|("+o+")|.)","ig"),ue=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,he=L(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{k.apply(t=K.call(g.childNodes),g.childNodes),t[g.childNodes.length].nodeType}catch(e){k={apply:t.length?function(e,t){q.apply(e,K.call(t))}:function(e,t){for(var i=e.length,r=0;e[i++]=t[r++];);e.length=i-1}}}function R(e,t,i,r){var n,s,o,a,l,u,h,c=t&&t.ownerDocument,p=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return i;if(!r&&((t?t.ownerDocument||t:g)!==w&&T(t),t=t||w,E)){if(11!==p&&(l=ae.exec(e)))if(n=l[1]){if(9===p){if(!(o=t.getElementById(n)))return i;if(o.id===n)return i.push(o),i}else if(c&&(o=c.getElementById(n))&&_(t,o)&&o.id===n)return i.push(o),i}else{if(l[2])return k.apply(i,t.getElementsByTagName(e)),i;if((n=l[3])&&d.getElementsByClassName&&t.getElementsByClassName)return k.apply(i,t.getElementsByClassName(n)),i}if(d.qsa&&!v[e+" "]&&(!m||!m.test(e))){if(1!==p)c=t,h=e;else if("object"!==t.nodeName.toLowerCase()){for((a=t.getAttribute("id"))?a=a.replace(ue,N):t.setAttribute("id",a=S),s=(u=f(e)).length;s--;)u[s]="#"+a+" "+D(u[s]);h=u.join(","),c=le.test(e)&&me(t.parentNode)||t}if(h)try{return k.apply(i,c.querySelectorAll(h)),i}catch(e){}finally{a===S&&t.removeAttribute("id")}}}return j(e.replace(P,"$1"),t,i,r)}function ce(){var i=[];function r(e,t){return i.push(e+" ")>b.cacheLength&&delete r[i.shift()],r[e+" "]=t}return r}function C(e){return e[S]=!0,e}function M(e){var t=w.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t)}}function pe(e,t){for(var i=e.split("|"),r=i.length;r--;)b.attrHandle[i[r]]=t}function de(e,t){var i=t&&e,r=i&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function fe(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&he(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function I(o){return C(function(s){return s=+s,C(function(e,t){for(var i,r=o([],e.length,s),n=r.length;n--;)e[i=r[n]]&&(e[i]=!(t[i]=e[i]))})})}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in d=R.support={},B=R.isXML=function(e){e=e&&(e.ownerDocument||e).documentElement;return!!e&&"HTML"!==e.nodeName},T=R.setDocument=function(e){var e=e?e.ownerDocument||e:g;return e!==w&&9===e.nodeType&&e.documentElement&&(i=(w=e).documentElement,E=!B(w),g!==w&&(e=w.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",z,!1):e.attachEvent&&e.attachEvent("onunload",z)),d.attributes=M(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=M(function(e){return e.appendChild(w.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=h.test(w.getElementsByClassName),d.getById=M(function(e){return i.appendChild(e).id=S,!w.getElementsByName||!w.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(O,c);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&E)return(t=t.getElementById(e))?[t]:[]}):(b.filter.ID=function(e){var t=e.replace(O,c);return function(e){e=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return e&&e.value===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&E){var i,r,n,s=t.getElementById(e);if(s){if((i=s.getAttributeNode("id"))&&i.value===e)return[s];for(n=t.getElementsByName(e),r=0;s=n[r++];)if((i=s.getAttributeNode("id"))&&i.value===e)return[s]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,r=[],n=0,s=t.getElementsByTagName(e);if("*"!==e)return s;for(;i=s[n++];)1===i.nodeType&&r.push(i);return r},b.find.CLASS=d.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&E)return t.getElementsByClassName(e)},r=[],m=[],(d.qsa=h.test(w.querySelectorAll))&&(M(function(e){i.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+o+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+o+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+S+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||m.push(".#.+[+~]")}),M(function(e){e.innerHTML="";var t=w.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+o+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),i.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(d.matchesSelector=h.test(n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.oMatchesSelector||i.msMatchesSelector))&&M(function(e){d.disconnectedMatch=n.call(e,"*"),n.call(e,"[s!='']:x"),r.push("!=",Q)}),m=m.length&&new RegExp(m.join("|")),r=r.length&&new RegExp(r.join("|")),e=h.test(i.compareDocumentPosition),_=e||h.test(i.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(i.contains?i.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Y=e?function(e,t){var i;return e===t?(u=!0,0):(i=!e.compareDocumentPosition-!t.compareDocumentPosition)||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===i?e===w||e.ownerDocument===g&&_(g,e)?-1:t===w||t.ownerDocument===g&&_(g,t)?1:l?y(l,e)-y(l,t):0:4&i?-1:1)}:function(e,t){if(e===t)return u=!0,0;var i,r=0,n=e.parentNode,s=t.parentNode,o=[e],a=[t];if(!n||!s)return e===w?-1:t===w?1:n?-1:s?1:l?y(l,e)-y(l,t):0;if(n===s)return de(e,t);for(i=e;i=i.parentNode;)o.unshift(i);for(i=t;i=i.parentNode;)a.unshift(i);for(;o[r]===a[r];)r++;return r?de(o[r],a[r]):o[r]===g?-1:a[r]===g?1:0}),w},R.matches=function(e,t){return R(e,null,null,t)},R.matchesSelector=function(e,t){if((e.ownerDocument||e)!==w&&T(e),t=t.replace(ie,"='$1']"),d.matchesSelector&&E&&!v[t+" "]&&(!r||!r.test(t))&&(!m||!m.test(t)))try{var i=n.call(e,t);if(i||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,c),e[3]=(e[3]||e[4]||e[5]||"").replace(O,c),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||R.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&R.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return p.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&re.test(i)&&(t=f(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,c).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=X[e+" "];return t||(t=new RegExp("(^|"+o+")"+e+"("+o+"|$)"))&&X(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(t,i,r){return function(e){e=R.attr(e,t);return null==e?"!="===i:!i||(e+="","="===i?e===r:"!="===i?e!==r:"^="===i?r&&0===e.indexOf(r):"*="===i?r&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function $(e,i,r){return v(i)?w.grep(e,function(e,t){return!!i.call(e,t,e)!==r}):i.nodeType?w.grep(e,function(e){return e===i!==r}):"string"!=typeof i?w.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/,ie=((w.fn.init=function(e,t,i){if(e){if(i=i||ee,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==i.ready?i.ready(e):e(w):w.makeArray(e,this);if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:te.exec(e))||!r[1]&&t)return(!t||t.jquery?t||i:this.constructor(t)).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:T,!0)),Q.test(r[1])&&w.isPlainObject(t))for(var r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r])}else(i=T.getElementById(r[2]))&&(this[0]=i,this.length=1)}return this}).prototype=w.fn,ee=w(T),/^(?:parents|prev(?:Until|All))/),re={children:!0,contents:!0,next:!0,prev:!0};function ne(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),i=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]+)/i,we=/^$|^module$|\/(?:java|ecma)script/i,S={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function A(e,t){var i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&l(e,t)?w.merge([e],i):i}function Ee(e,t){for(var i=0,r=e.length;ix",_.noCloneChecked=!!C.cloneNode(!0).lastChild.defaultValue;var ke=T.documentElement,Pe=/^key/,Oe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Re=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function k(){return!1}function Me(){try{return T.activeElement}catch(e){}}function Ie(e,t,i,r,n,s){var o,a;if("object"==typeof t){for(a in"string"!=typeof i&&(r=r||i,i=void 0),t)Ie(e,a,i,r,t[a],s);return e}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=k;else if(!n)return e;return 1===s&&(o=n,(n=function(e){return w().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=w.guid++)),e.each(function(){w.event.add(this,t,n,r,i)})}w.event={global:{},add:function(t,e,i,r,n){var s,o,a,l,u,h,c,p,d,f=g.get(t);if(f)for(i.handler&&(i=(s=i).handler,n=s.selector),n&&w.find.matchesSelector(ke,n),i.guid||(i.guid=w.guid++),(a=f.events)||(a=f.events={}),(o=f.handle)||(o=f.handle=function(e){return void 0!==w&&w.event.triggered!==e.type?w.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(E)||[""]).length;l--;)c=d=(p=Re.exec(e[l])||[])[1],p=(p[2]||"").split(".").sort(),c&&(u=w.event.special[c]||{},c=(n?u.delegateType:u.bindType)||c,u=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),(h=a[c])||((h=a[c]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,r,p,o)||t.addEventListener&&t.addEventListener(c,o)),u.add&&(u.add.call(t,d),d.handler.guid||(d.handler.guid=i.guid)),n?h.splice(h.delegateCount++,0,d):h.push(d),w.event.global[c]=!0)},remove:function(e,t,i,r,n){var s,o,a,l,u,h,c,p,d,f,m,_=g.hasData(e)&&g.get(e);if(_&&(l=_.events)){for(u=(t=(t||"").match(E)||[""]).length;u--;)if(d=m=(a=Re.exec(t[u])||[])[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--;)h=p[s],!n&&m!==h.origType||i&&i.guid!==h.guid||a&&!a.test(h.namespace)||r&&r!==h.selector&&("**"!==r||!h.selector)||(p.splice(s,1),h.selector&&p.delegateCount--,c.remove&&c.remove.call(e,h));o&&!p.length&&(c.teardown&&!1!==c.teardown.call(e,f,_.handle)||w.removeEvent(e,d,_.handle),delete l[d])}else for(d in l)w.event.remove(e,d+t[u],i,r,!0);w.isEmptyObject(l)&&g.remove(e,"handle events")}},dispatch:function(e){var t,i,r,n,s,o=w.event.fix(e),a=new Array(arguments.length),e=(g.get(this,"events")||{})[o.type]||[],l=w.event.special[o.type]||{};for(a[0]=o,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,Le=/\s*$/g;function ze(e,t){return l(e,"table")&&l(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function Be(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ue(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function je(e,t){var i,r,n,s,o,a;if(1===t.nodeType){if(g.hasData(e)&&(s=g.access(e),o=g.set(t,s),a=s.events))for(n in delete o.handle,o.events={},a)for(i=0,r=a[n].length;i")},clone:function(e,t,i){var r,n,s,o,a,l,u,h=e.cloneNode(!0),c=w.contains(e.ownerDocument,e);if(!(_.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(o=A(h),r=0,n=(s=A(e)).length;r").prop({charset:i.scriptCharset,src:i.url}).on("load error",n=function(e){r.remove(),n=null,e&&t("error"===e.type?404:200,e.type)}),T.head.appendChild(r[0])},abort:function(){n&&n()}}}),[]),Vt=/(=)\?(?=&|$)|\?\?/,qt=(w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Wt.pop()||w.expando+"_"+St++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(e,t,i){var r,n,s,o=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return s||w.error(r+" was not called"),s[0]},e.dataTypes[0]="json",n=x[r],x[r]=function(){s=arguments},i.always(function(){void 0===n?w(x).removeProp(r):x[r]=n,e[r]&&(e.jsonpCallback=t.jsonpCallback,Wt.push(r)),s&&v(n)&&n(s[0]),s=n=void 0}),"script"}),_.createHTMLDocument=((e=T.implementation.createHTMLDocument("").body).innerHTML="

",2===e.childNodes.length),w.parseHTML=function(e,t,i){var r;return"string"!=typeof e?[]:("boolean"==typeof t&&(i=t,t=!1),t||(_.createHTMLDocument?((r=(t=T.implementation.createHTMLDocument("")).createElement("base")).href=T.location.href,t.head.appendChild(r)):t=T),r=!i&&[],(i=Q.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,r),r&&r.length&&w(r).remove(),w.merge([],i.childNodes)))},w.fn.load=function(e,t,i){var r,n,s,o=this,a=e.indexOf(" ");return-1").append(w.parseHTML(e)).find(r):e)}).always(i&&function(e,t){o.each(function(){i.apply(this,s||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(t){return w.grep(w.timers,function(e){return t===e.elem}).length},w.offset={setOffset:function(e,t,i){var r,n,s,o,a=w.css(e,"position"),l=w(e),u={};"static"===a&&(e.style.position="relative"),s=l.offset(),r=w.css(e,"top"),o=w.css(e,"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!=(t=v(t)?t.call(e,i,w.extend({},s)):t).top&&(u.top=t.top-s.top+n),null!=t.left&&(u.left=t.left-s.left+a),"using"in t?t.using.call(e,u):l.css(u)}},w.fn.extend({offset:function(t){var e,i;return arguments.length?void 0===t?this:this.each(function(e){w.offset.setOffset(this,t,e)}):(i=this[0])?i.getClientRects().length?(e=i.getBoundingClientRect(),i=i.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,i,r=this[0],n={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),i=r.ownerDocument,e=r.offsetParent||i.documentElement;e&&(e===i.body||e===i.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((n=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),n.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-n.top-w.css(r,"marginTop",!0),left:t.left-n.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||ke})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var s="pageYOffset"===n;w.fn[t]=function(e){return c(this,function(e,t,i){var r;if(m(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===i)return r?r[n]:e[t];r?r.scrollTo(s?r.pageXOffset:i,s?i:r.pageYOffset):e[t]=i},t,e,arguments.length)}}),w.each(["top","left"],function(e,i){w.cssHooks[i]=$e(_.pixelPosition,function(e,t){if(t)return t=O(e,i),Ze.test(t)?w(e).position()[i]+"px":t})}),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(e,t){var i=arguments.length&&(r||"boolean"!=typeof e),n=r||(!0===e||!0===t?"margin":"border");return c(this,function(e,t,i){var r;return m(e)?0===s.indexOf("outer")?e["inner"+o]:e.document.documentElement["client"+o]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+o],r["scroll"+o],e.body["offset"+o],r["offset"+o],r["client"+o])):void 0===i?w.css(e,t,n):w.style(e,t,i,n)},a,i?e: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(e,i){w.fn[i]=function(e,t){return 0this.updateCoord(e,a,"x");break;case"scaleY":case"skewY":n=i,s=i-(r=e[a=t.substr(0,t.length-1)].y),o=e=>this.updateCoord(e,a,"y");break;case"tint":case"blend":const l=Array.isArray(i)?i:[e.tint,i];r=0,s=n=l.length,o="tint"===t?e=>this.updateTint(e,l):e=>this.updateBlend(e,l);break;case"shake":r={x:e.x,y:e.y},n=i,o=e=>this.updateShake(e);break;case"position":r={x:e.x,y:e.y},s={x:(n={x:i.x,y:i.y}).x-r.x,y:n.y-r.y},o=e=>this.updatePosition(e);break;case"skew":case"scale":n=i,s=i-(r=e[t].x),o=e=>this.updatePoint(e,t);break;case"face":r=e.rotation,s=(n=u.shortestAngle(r,Math.atan2(i.y-e.y,i.x-e.x)))-r,o=e=>this.updateOne(e,"rotation");break;default:n=i,s=i-(r=e[t]),o=e=>this.updateOne(e,t)}this.eases.push({element:e,entry:t,update:o,start:r,to:n,delta:s})}static shortestAngle(e,t){var i=2*Math.PI,r=Math.abs(e-t)%i;return(r>Math.PI?i-r:r)*(0<((t-e+Math.PI)%i+i)%i-Math.PI?1:-1)}remove(t,i){if(0===arguments.length)this.eases=[];else{"string"==typeof i&&(i=[i]);for(let e=0;e>16)+i*(t>>16)<<16|o*(s>>8&255)+i*(t>>8&255)<<8|o*(255&s)+i*(255&t)}updateShake(e){function t(e){return Math.floor(Math.random()*e)-Math.floor(e/2)}e.element.x=e.start.x+t(e.to),e.element.y=e.start.y+t(e.to)}complete(e){"shake"===e.entry&&(e.element.x=e.start.x,e.element.y=e.start.y)}reverse(e){var t,i;"position"===e.entry?(i=e.to.x,t=e.to.y,e.to.x=e.start.x,e.to.y=e.start.y,e.start.x=i,e.start.y=t,e.delta.x=-e.delta.x,e.delta.y=-e.delta.y):(i=e.to,e.to=e.start,e.start=i,e.delta=-e.delta)}repeat(e){switch(e.entry){case"skewX":e.element.skew.x=e.start;break;case"skewY":e.element.skew.y=e.start;break;case"skew":e.element.skew.x=e.start,e.element.skew.y=e.start;break;case"scaleX":e.element.scale.x=e.start;break;case"scaleY":e.element.scale.y=e.start;break;case"scale":e.element.scale.x=e.start,e.element.scale.y=e.start;break;case"position":e.element.x=e.start.x,e.element.y=e.start.y;break;default:e.element[e.entry]=e.start}}update(e){if(0===this.eases.length)return!0;if(this.options.wait){if(this.options.wait-=e,0=this.options.duration&&(t=this.time-this.options.duration,this.time=this.options.duration);for(let e=0;e=this.options.duration)if(this.options.reverse)this.eases.forEach(e=>this.reverse(e)),(this.time=t)&&this.eases.forEach(e=>e.update(e)),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(e=>this.complete(e)),this.emit("complete",this),!0;this.eases.forEach(e=>this.repeat(e)),(this.time=t)&&this.eases.forEach(e=>e.update(e)),!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(e){super(),this.options=Object.assign({},s,e),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(e,t,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]);e=new u(e,t,i);return this.easings.push(e),this.empty&&this.options.useRAF&&(this.handleRAF=requestAnimationFrame(()=>this.update()),this.lastTime=Date.now()),this.empty=!1,e}target(e,t,i,r){i=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/i;return(r=r||{}).duration=i,this.add(e,{x:t.x,y:t.y},r)}face(e,t,i,r){t=u.shortestAngle(e.rotation,Math.atan2(t.y-e.y,t.x-e.x)),i=Math.abs(t-e.rotation)/i;return(r=r||{}).duration=i,this.add(e,{rotation:t},r)}removeEase(t,i){for(let e=0;ethis.update()):this.handleRAF=null}get count(){return this.easings.length}countRunning(){let e=0;for(var t of this.easings)e+=t.count;return e}set duration(e){this.options.duration=e}get duration(){return this.options.duration}set ease(e){this.options.ease=e}get ease(){return this.options.ease}}o.id=0;n=new o;o.ease=n,e.Ease=o,e.List=class{constructor(){console.warn("Ease.List was deprecated. Use new Ease() instead.")}},e.ease=n,Object.defineProperty(e,"__esModule",{value:!0})}),this.PIXI=this.PIXI||{},!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pixi/math"),require("@pixi/display"),require("@pixi/ticker")):"function"==typeof define&&define.amd?define(["exports","@pixi/math","@pixi/display","@pixi/ticker"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).pixi_viewport={},e.PIXI,e.PIXI,e.PIXI)}(this,function(e,a,t,i){"use strict";class r{constructor(e){this.parent=e,this.paused=!1}destroy(){}down(e){return!1}move(e){return!1}up(e){return!1}wheel(e){return!1}update(e){}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(t){!function(){var n={linear:function(e,t,i,r){return i*e/r+t},easeInQuad:function(e,t,i,r){return i*(e/=r)*e+t},easeOutQuad:function(e,t,i,r){return-i*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,i,r){return i*(e/=r)*e*e+t},easeOutCubic:function(e,t,i,r){return i*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,i,r){return i*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,i,r){return-i*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,i,r){return i*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,i,r){return i*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,i,r){return-i*Math.cos(e/r*(Math.PI/2))+i+t},easeOutSine:function(e,t,i,r){return i*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,i,r){return-i/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,i,r){return 0===e?t:i*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,i,r){return e===r?t+i:i*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,i,r){return(e/=r/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,i,r){return-i*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,i,r){return i*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,i,r){return(e/=r/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,i,r){var n=1.70158,s=0,o=i;return 0!==e&&(e/=r),s=s||.3*r,n=o=this.options.time?(t=this.parent.width,i=this.parent.height,this.complete(),t===this.parent.width&&i===this.parent.height||this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})):(t=this.options.ease(this.time,0,1,this.options.time),null!==this.width&&(i=this.startWidth,r=this.deltaWidth,this.parent.fitWidth(i+r*t,this.keepCenter,null===this.height)),null!==this.height&&(i=this.startHeight,r=this.deltaHeight,this.parent.fitHeight(i+r*t,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*t,r+s*t),this.parent.emit("moved",{viewport:this.parent,original:o,type:"animate"})),(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})))}}function p(e){let t=void 0,i=e[0],r=1;for(;ri.call(t,...e)),t=void 0)}return i}const d={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class f extends r{constructor(e,t={}){super(e),this.options=Object.assign({},d,t),this.ease=u(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;e=this.options.underflow.toLowerCase();"center"===e?(this.underflowX=0,this.underflowY=0):(this.underflowX=-1!==e.indexOf("left")?-1:-1!==e.indexOf("right")?1:0,this.underflowY=-1!==e.indexOf("top")?-1:-1!==e.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(e){var t;this.paused||(this.bounce(),this.toX&&((t=this.toX).time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),t.time>=this.options.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.options.time)),this.toY&&((t=this.toY).time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),t.time>=this.options.time?(this.parent.y=t.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(t.time,t.start,t.delta,this.options.time)))}calcUnderflowX(){let e;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}calcUnderflowY(){let e;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}oob(){var e,t,i,r=this.options.bounceBox;return r?(e=void 0===r.x?0:r.x,t=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(e*this.parent.scale.x,t*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 t,e=this.parent.plugins.get("decelerate",!0);e&&(e.x||e.y)&&(e.x&&e.percentChangeX===p([e,"access",e=>e.options,"optionalAccess",e=>e.friction])||e.y&&e.percentChangeY===p([e,"access",e=>e.options,"optionalAccess",e=>e.friction]))&&(((t=this.oob()).left&&this.left||t.right&&this.right)&&(e.percentChangeX=this.options.friction),(t.top&&this.top||t.bottom&&this.bottom)&&(e.percentChangeY=this.options.friction));var i=this.parent.plugins.get("drag",!0)||{},r=this.parent.plugins.get("pinch",!0)||{};if(e=e||{},!(p([i,"optionalAccess",e=>e.active])||p([r,"optionalAccess",e=>e.active])||this.toX&&this.toY||e.x&&e.y)){i=(t=t||this.oob()).topLeft,r=t.bottomRight;if(!this.toX&&!e.x){let e=null;t.left&&this.left?e=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,e=!0);e&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-x"})}if(null!==this.options.top||null!==this.options.bottom){let e=!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,e=!0);e&&this.parent.emit("moved",{viewport:this.parent,original:t,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(e,t={}){super(e),this.options=Object.assign({},g,t),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused)if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight;null!==this.options.minWidth&&ethis.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,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),null!==this.options.minHeight&&tthis.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 e=this.parent.scale.x,t=this.parent.scale.y;null!==r.x&&en.x&&(e=n.x),null!==r.y&&tn.y&&(t=n.y),e===this.parent.scale.x&&t===this.parent.scale.y||(this.parent.scale.set(e,t),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(e,t={}){super(e),this.options=Object.assign({},y,t),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",e=>this.moved(e))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!(!this.x&&!this.y)}move(){var e;return this.paused||(1===(e=this.parent.input.count())||1=e-100){var t=e-i.time;this.x=(this.parent.x-i.x)/t,this.y=(this.parent.y-i.y)/t,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(e){void 0!==(e=e||{}).x&&(this.x=e.x,this.percentChangeX=this.options.friction),void 0!==e.y&&(this.y=e.y,this.percentChangeY=this.options.friction)}update(e){var t,i,r,n,s;this.paused||(t=this.x||this.y,i=this.timeSinceRelease,r=this.timeSinceRelease+e,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,e/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,e/16)),this.timeSinceRelease+=e,this.x&&this.y?Math.abs(this.x){t.includes(e.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",e=>{t.includes(e.code)&&(this.keyIsPressed=!1)})}mouseButtons(e){this.mouse=e&&"all"!==e?[-1!==e.indexOf("left"),-1!==e.indexOf("middle"),-1!==e.indexOf("right")]:[!0,!0,!0]}parseUnderflow(){var e=this.options.underflow.toLowerCase();"center"===e?(this.underflowX=0,this.underflowY=0):(e.includes("left")?this.underflowX=-1:e.includes("right")?this.underflowX=1:this.underflowX=0,e.includes("top")?this.underflowY=-1:e.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(e){var t="mouse"===e.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,e.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,e.y=0)}}const w={speed:0,acceleration:null,radius:null};class E extends r{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},w,i),this.velocity={x:0,y:0}}update(i){if(!this.paused){var r=this.parent.center;let e=this.target.x,t=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);e=this.target.x-Math.cos(n)*this.options.radius,t=this.target.y-Math.sin(n)*this.options.radius}var s,o,a,n=e-r.x,l=t-r.y;(n||l)&&(this.options.speed?this.options.acceleration?(o=Math.atan2(t-r.y,e-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)?e:r.x+a,o=Math.abs(s)>Math.abs(l)?t:r.y+s,this.parent.moveCenter(i,o),this.parent.emit("moved",{viewport:this.parent,type:"follow"}))):(a=Math.atan2(t-r.y,e-r.x),s=Math.cos(a)*this.options.speed,i=Math.sin(a)*this.options.speed,o=Math.abs(s)>Math.abs(n)?e:r.x+s,a=Math.abs(i)>Math.abs(l)?t:r.y+i,this.parent.moveCenter(o,a),this.parent.emit("moved",{viewport:this.parent,type:"follow"})):(this.parent.moveCenter(e,t),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(e,t={}){super(e),this.options=Object.assign({},S,t),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 e=this.options.distance;null!==e?(this.left=e,this.top=e,this.right=this.parent.screenWidth-e,this.bottom=this.parent.screenHeight-e):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(e){var t,i;return this.paused||"mouse"!==e.data.pointerType&&1!==e.data.identifier||!this.options.allowButtons&&0!==e.data.buttons||(t=e.data.global.x,e=e.data.global.y,this.radiusSquared?(i=this.parent.toScreen(this.parent.center),Math.pow(i.x-t,2)+Math.pow(i.y-e,2)>=this.radiusSquared?(i=Math.atan2(i.y-e,i.x-t),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&&tthis.right?this.horizontal=-1*this.reverse*this.options.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),null!==this.top&&ethis.bottom?this.vertical=-1*this.reverse*this.options.speed*.06:(this.decelerateVertical(),this.vertical=0))),!1}decelerateHorizontal(){var e=this.parent.plugins.get("decelerate",!0);this.horizontal&&e&&!this.options.noDecelerate&&e.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){var e=this.parent.plugins.get("decelerate",!0);this.vertical&&e&&!this.options.noDecelerate&&e.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 e;this.paused||(this.horizontal||this.vertical)&&(e=this.parent.center,this.horizontal&&(e.x+=this.horizontal*this.options.speed),this.vertical&&(e.y+=this.vertical*this.options.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"}))}}const F={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class k extends r{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),k.prototype.__init.call(this),k.prototype.__init2.call(this),k.prototype.__init3.call(this),this.options=Object.assign({},F,t)}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 e;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||(e=this.parent.toLocal(r));let t=Math.sqrt(Math.pow(s.last.x-o.last.x,2)+Math.pow(s.last.y-o.last.y,2));n=(1-a/(t=0===t?t=1e-10:t))*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(e),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(e,t,i,r={}){super(e),this.options=Object.assign({},N,r),this.ease=u(r.ease,"easeInOutSine"),this.x=t,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};var e=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-e.x,this.deltaY=this.y-e.y,this.startX=e.x,this.startY=e.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 e;return 0===this.parent.input.count()&&(e=this.parent.plugins.get("decelerate",!0))&&(e.x||e.y)&&(e.percentChangeX=e.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 e,t,i;var r=this.startX,s=this.startY,o=this.deltaX,a=this.deltaY;i=n.time>this.options.time?(e=!0,t=r+o,s+a):(n=this.ease(n.time,0,1,this.options.time),t=r+o*n,s+a*n),this.options.topLeft?this.parent.moveCorner(t,i):this.parent.moveCenter(t,i),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),e&&(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 O extends r{constructor(e,t={}){super(e),this.options=Object.assign({},z,t),this.ease=u(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):(t=this.snapping,i=this.ease(t.time,t.startX,t.deltaX,this.options.time),t=this.ease(t.time,t.startY,t.deltaY,this.options.time),this.parent.scale.x=this.parent.screenWidth/i,this.parent.scale.y=this.parent.screenHeight/t),(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(e))):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 R extends r{constructor(e,t={}){super(e),this.options=Object.assign({},B,t),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){window.addEventListener("keydown",e=>{t.includes(e.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",e=>{t.includes(e.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 t=this.smoothingCenter,i=this.smoothing;let e;this.options.center||(e=this.parent.toLocal(t)),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(e),this.parent.x+=t.x-i.x,this.parent.y+=t.y-i.y),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(t){if(!this.paused){var i=this.parent.input.getPointerPosition(t),r=-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/200,r=Math.pow(2,(1+this.options.percent)*r);let e;this.options.center||(e=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(e),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:t.deltaX,dy:t.deltaY,dz:t.deltaZ},event:t,viewport:this.parent})}}wheel(e){if(this.paused)return!1;if(!this.checkKeyPress())return!1;if(e.ctrlKey&&this.options.trackpadPinch)this.pinch(e);else if(this.options.wheelZoom){var t=this.parent.input.getPointerPosition(e),i=(this.options.reverse?-1:1)*-e.deltaY*(e.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=t}else{let e;this.options.center||(e=this.parent.toLocal(t)),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(e),this.parent.x+=t.x-i.x,this.parent.y+=t.y-i.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})}return!this.parent.options.passiveWheel}}class C{constructor(e){this.viewport=e,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=e=>this.handleWheel(e),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(e){var t,i;!this.viewport.pause&&this.viewport.worldVisible&&("mouse"===e.data.pointerType?this.isMouseDown=!0:this.get(e.data.pointerId)||this.touches.push({id:e.data.pointerId,last:null}),1!==this.count()||(this.last=e.data.global.clone(),t=this.viewport.plugins.get("decelerate",!0),i=this.viewport.plugins.get("bounce",!0),t&&t.isActive()||i&&i.isActive())?this.clickedAvailable=!1:this.clickedAvailable=!0,this.viewport.plugins.down(e)&&this.viewport.options.stopPropagation&&e.stopPropagation())}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(e){return Math.abs(e)>=this.viewport.threshold}move(e){var t,i,r;!this.viewport.pause&&this.viewport.worldVisible&&(t=this.viewport.plugins.move(e),this.clickedAvailable&&this.last&&(i=e.data.global.x-this.last.x,r=e.data.global.y-this.last.y,(this.checkThreshold(i)||this.checkThreshold(r))&&(this.clickedAvailable=!1)),t&&this.viewport.options.stopPropagation&&e.stopPropagation())}up(e){var t;!this.viewport.pause&&this.viewport.worldVisible&&("mouse"===e.data.pointerType&&(this.isMouseDown=!1),"mouse"!==e.data.pointerType&&this.remove(e.data.pointerId),t=this.viewport.plugins.up(e),this.clickedAvailable&&0===this.count()&&this.last&&(this.viewport.emit("clicked",{event:e,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this}),this.clickedAvailable=!1),t&&this.viewport.options.stopPropagation&&e.stopPropagation())}getPointerPosition(e){var t,i=new a.Point;return this.viewport.options.interaction?this.viewport.options.interaction.mapPositionToPoint(i,e.clientX,e.clientY):this.viewport.options.useDivWheelForInputManager&&this.viewport.options.divWheel?(t=this.viewport.options.divWheel.getBoundingClientRect(),i.x=e.clientX-t.left,i.y=e.clientY-t.top):(i.x=e.clientX,i.y=e.clientY),i}handleWheel(e){var t;this.viewport.pause||!this.viewport.worldVisible||this.viewport.options.interaction&&this.viewport.options.interaction.interactionDOMElement!==e.target||(t=this.viewport.toLocal(this.getPointerPosition(e)),this.viewport.left<=t.x&&t.x<=this.viewport.right&&this.viewport.top<=t.y&&t.y<=this.viewport.bottom&&this.viewport.plugins.wheel(e)&&!this.viewport.options.passiveWheel&&e.preventDefault())}pause(){this.touches=[],this.isMouseDown=!1}get(e){for(const t of this.touches)if(t.id===e)return t;return null}remove(t){for(let e=0;ei.call(t,...e)),t=void 0)}return i}const I=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class D{constructor(e){this.viewport=e,this.list=[],this.plugins={}}add(e,t,i=I.length){this.plugins[e]=t;t=I.indexOf(e);-1!==t&&I.splice(t,1),I.splice(i,0,e),this.sort()}get(t,e){return e&&M([this,"access",e=>e.plugins,"access",e=>e[t],"optionalAccess",e=>e.paused])?null:this.plugins[t]}update(e){for(const t of this.list)t.update(e)}resize(){for(const e of this.list)e.resize()}reset(){for(const e of this.list)e.reset()}removeAll(){this.plugins={},this.sort()}remove(e){this.plugins[e]&&(delete this.plugins[e],this.viewport.emit(e+"-remove"),this.sort())}pause(t){M([this,"access",e=>e.plugins,"access",e=>e[t],"optionalAccess",e=>e.pause,"call",e=>e()])}resume(t){M([this,"access",e=>e.plugins,"access",e=>e[t],"optionalAccess",e=>e.resume,"call",e=>e()])}sort(){this.list=[];for(const e of I)this.plugins[e]&&this.list.push(this.plugins[e])}down(e){let t=!1;for(const i of this.list)i.down(e)&&(t=!0);return t}move(e){let t=!1;for(const i of this.viewport.plugins.list)i.move(e)&&(t=!0);return t}up(e){let t=!1;for(const i of this.list)i.up(e)&&(t=!0);return t}wheel(e){let t=!1;for(const i of this.list)i.wheel(e)&&(t=!0);return t}}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 L extends t.Container{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),L.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},U,e),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 C(this),this.plugins=new D(this)}destroy(e){!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(e)}update(e){this.pause||(this.plugins.update(e),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(e=window.innerWidth,t=window.innerHeight,i,r){this.screenWidth=e,this.screenHeight=t,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(e){this._worldWidth=e,this.plugins.resize()}get worldHeight(){return this._worldHeight||this.height/this.scale.y}set worldHeight(e){this._worldHeight=e,this.plugins.resize()}getVisibleBounds(){return new a.Rectangle(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(e,t){return 2===arguments.length?this.toLocal(new a.Point(e,t)):this.toLocal(e)}toScreen(e,t){return 2===arguments.length?this.toGlobal(new a.Point(e,t)):this.toGlobal(e)}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(e){this.moveCenter(e)}moveCenter(...e){let t,i;i="number"==typeof e[0]?(t=e[0],e[1]):(t=e[0].x,e[0].y);var e=(this.worldScreenWidth/2-t)*this.scale.x,r=(this.worldScreenHeight/2-i)*this.scale.y;return this.x===e&&this.y===r||(this.position.set(e,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(e){this.moveCorner(e)}moveCorner(...e){let t,i;return i=1===e.length?(t=-e[0].x*this.scale.x,-e[0].y*this.scale.y):(t=-e[0]*this.scale.x,-e[1]*this.scale.y),t===this.x&&i===this.y||(this.position.set(t,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(e){return this.screenWidth/e}findFitHeight(e){return this.screenHeight/e}findFit(e,t){e=this.screenWidth/e,t=this.screenHeight/t;return Math.min(e,t)}findCover(e,t){e=this.screenWidth/e,t=this.screenHeight/t;return Math.max(e,t)}fitWidth(e=this.worldWidth,t,i=!0,r){let n;t&&(n=this.center),this.scale.x=this.screenWidth/e,i&&(this.scale.y=this.scale.x);e=this.plugins.get("clamp-zoom",!0);return!r&&e&&e.clamp(),t&&n&&this.moveCenter(n),this}fitHeight(e=this.worldHeight,t,i=!0,r){let n;t&&(n=this.center),this.scale.y=this.screenHeight/e,i&&(this.scale.x=this.scale.y);e=this.plugins.get("clamp-zoom",!0);return!r&&e&&e.clamp(),t&&n&&this.moveCenter(n),this}fitWorld(e){let t;e&&(t=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(e){this.x=-e*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(e){this.x=-e*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(e){this.y=-e*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(e){this.y=-e*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(e){this._dirty=e}get forceHitArea(){return this._forceHitArea}set forceHitArea(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=null,this.hitArea=new a.Rectangle(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new T(this,e)),this}clamp(e){return this.plugins.add("clamp",new _(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new b(this,e)),this}bounce(e){return this.plugins.add("bounce",new f(this,e)),this}pinch(e){return this.plugins.add("pinch",new k(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new P(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new E(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new R(this,e)),this}animate(e){return this.plugins.add("animate",new c(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new v(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new A(this,e)),this}get pause(){return!!this._pause}set pause(e){this._pause=e,this.lastViewport=null,this.moving=!1,this.zooming=!1,e&&this.input.pause()}ensureVisible(e,t,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;ethis.right&&(this.right=e+i,s=!0),tthis.bottom&&(this.bottom=t+r,s=!0),s&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}e.Animate=c,e.Bounce=f,e.Clamp=_,e.ClampZoom=v,e.Decelerate=b,e.Drag=T,e.Follow=E,e.InputManager=C,e.MouseEdges=A,e.Pinch=k,e.Plugin=r,e.PluginManager=D,e.Snap=P,e.SnapZoom=O,e.Viewport=L,e.Wheel=R,Object.defineProperty(e,"__esModule",{value:!0})}),"undefined"!=typeof pixi_viewport&&Object.assign(this.PIXI,pixi_viewport),!function(){"use strict";var h=new("undefined"==typeof WebKitCSSMatrix?DOMMatrix:WebKitCSSMatrix);function c(e,t,i){this.x=e,this.y=t,this.z=i}function r(e){for(var t=h,i=e;null!=i&&i!==i.ownerDocument.documentElement;)var r=window.getComputedStyle(i,void 0).transform||"none",t=("none"===r?h:function(t){try{return new("undefined"==typeof WebKitCSSMatrix?DOMMatrix:WebKitCSSMatrix)(t)}catch(e){return console.warn(t),console.warn(e.toString()),h}}(r)).multiply(t),i=i.parentNode;for(var n=e.offsetWidth,s=e.offsetHeight,o=4,a=1/0,l=1/0;0<=--o;){var u=new c(0===o||1===o?0:n,0===o||3===o?0:s,0).transformBy(t);u.xt&&(i[r]=this.hyphenate(i[r]).join("­"));return i.join("")},t.prototype.hyphenate=function(e){var t,i,r,n,s,o,a,l,u,h=[],c=[],p=e.toLowerCase(),d=Math.max,f=this.trie,m=[""];if(this.exceptions.hasOwnProperty(p))return e.match(this.exceptions[p]).slice(1);if(-1!==e.indexOf("­"))return[e];for(t=(e="_"+e+"_").toLowerCase().split(""),i=e.split(""),a=t.length,r=0;rthis.leftMin&&r