window.SpinePlugin=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t,e,n){var i=n?t[e]:Object.getOwnPropertyDescriptor(t,e);return!n&&i.value&&"object"==typeof i.value&&(i=i.value),!(!i||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(i))&&(void 0===i.enumerable&&(i.enumerable=!0),void 0===i.configurable&&(i.configurable=!0),i)}function i(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!n&&(n.value&&"object"==typeof n.value&&(n=n.value),!1===n.configurable)}function r(t,e,r,s){for(var a in e)if(e.hasOwnProperty(a)){var h=n(e,a,r);if(!1!==h){if(i((s||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var n=0;n0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this},transformMat3:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},transformMat4:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[4]*n+i[12],this.y=i[1]*e+i[5]*n+i[13],this},reset:function(){return this.x=0,this.y=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0),i.LEFT=new i(-1,0),i.UP=new i(0,-1),i.DOWN=new i(0,1),i.ONE=new i(1,1),t.exports=i},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,n){var i=n(1);t.exports=function(t){return t>Math.PI&&(t-=i.PI2),Math.abs(((t+i.TAU)%i.PI2-i.PI2)%i.PI2)}},function(t,e){t.exports=function(t,e,n){return Math.max(e,Math.min(n,t))}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.RAD_TO_DEG}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new i(this.x,this.y,this.z)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=i*a-r*o,this.y=r*s-n*a,this.z=n*o-i*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return Math.sqrt(e*e+n*n+i*i)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return e*e+n*n+i*i},length:function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},lengthSq:function(){var t=this.x,e=this.y,n=this.z;return t*t+e*e+n*n},normalize:function(){var t=this.x,e=this.y,n=this.z,i=t*t+e*e+n*n;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i,this.z=n*i),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z;return this.x=n*o-i*s,this.y=i*r-e*o,this.z=e*s-n*r,this},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this},transformMat3:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=e*r[0]+n*r[3]+i*r[6],this.y=e*r[1]+n*r[4]+i*r[7],this.z=e*r[2]+n*r[5]+i*r[8],this},transformMat4:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=r[0]*e+r[4]*n+r[8]*i+r[12],this.y=r[1]*e+r[5]*n+r[9]*i+r[13],this.z=r[2]*e+r[6]*n+r[10]*i+r[14],this},transformCoordinates:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=e*r[0]+n*r[4]+i*r[8]+r[12],o=e*r[1]+n*r[5]+i*r[9]+r[13],a=e*r[2]+n*r[6]+i*r[10]+r[14],h=e*r[3]+n*r[7]+i*r[11]+r[15];return this.x=s/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*i-o*n,l=a*n+o*e-r*i,u=a*i+r*n-s*e,c=-r*e-s*n-o*i;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-o+h*-s-l*-r,this},project:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=r[0],o=r[1],a=r[2],h=r[3],l=r[4],u=r[5],c=r[6],f=r[7],d=r[8],p=r[9],v=r[10],g=r[11],M=r[12],m=r[13],x=r[14],y=1/(e*h+n*f+i*g+r[15]);return this.x=(e*s+n*l+i*d+M)*y,this.y=(e*o+n*u+i*p+m)*y,this.z=(e*a+n*c+i*v+x)*y,this},unproject:function(t,e){var n=t.x,i=t.y,r=t.z,s=t.w,o=this.x-n,a=s-this.y-1-i,h=this.z;return this.x=2*o/r-1,this.y=2*a/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0,0),i.LEFT=new i(-1,0,0),i.UP=new i(0,-1,0),i.DOWN=new i(0,1,0),i.FORWARD=new i(0,0,1),i.BACK=new i(0,0,-1),i.ONE=new i(1,1,1),t.exports=i},function(t,e){t.exports=function(t,e,n){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var i=e.split("."),r=t,s=n,o=0;o=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,n=this.type;this.loader.emit(s.FILE_COMPLETE,e,n,t),this.loader.emit(s.FILE_KEY_COMPLETE+n+"-"+e,e,n,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,n){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var i=new FileReader;i.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||n)+";base64,"+i.result.split(",")[1]},i.onerror=t.onerror,i.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var n={},i={install:function(t){for(var e in n)t[e]=n[e]},register:function(t,e){n[t]=e},destroy:function(){n={}}};t.exports=i},function(t,e,n){var i=n(2),r=function(){var t,e,n,s,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=0?t:t+2*Math.PI}},function(t,e,n){var i=n(4);t.exports=function(t){return i(t,-Math.PI,Math.PI)}},function(t,e,n){var i=n(4);t.exports=function(t){return i(t,-180,180)}},function(t,e,n){var i=n(20);t.exports=function(t,e){return i(t)/i(e)/i(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,n,i,r){var s=.5*(i-e),o=.5*(r-n),a=t*t;return(2*n-2*i+s+o)*(t*a)+(-3*n+3*i-2*s-o)*a+s*t+n}},function(t,e){t.exports=function(t,e,n){return(e-t)*n+t}},function(t,e){t.exports=function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,n){return(t=Math.max(0,Math.min(1,(t-e)/(n-e))))*t*t*(t*(6*t-15)+10)}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.DEG_TO_RAD}},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},fromMat4:function(t){var e=t.val,n=this.val;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],n=t[2],i=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=n,t[7]=i,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*s-o*h,c=-l*r+o*a,f=h*r-s*a,d=e*u+n*c+i*f;return d?(d=1/d,t[0]=u*d,t[1]=(-l*n+i*h)*d,t[2]=(o*n-i*s)*d,t[3]=c*d,t[4]=(l*e-i*a)*d,t[5]=(-o*e+i*r)*d,t[6]=f*d,t[7]=(-h*e+n*a)*d,t[8]=(s*e-n*r)*d,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=s*l-o*h,t[1]=i*h-n*l,t[2]=n*o-i*s,t[3]=o*a-r*l,t[4]=e*l-i*a,t[5]=i*r-e*o,t[6]=r*h-s*a,t[7]=n*a-e*h,t[8]=e*s-n*r,this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*s-o*h)+n*(-l*r+o*a)+i*(h*r-s*a)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,f=c[0],d=c[1],p=c[2],v=c[3],g=c[4],M=c[5],m=c[6],x=c[7],y=c[8];return e[0]=f*n+d*s+p*h,e[1]=f*i+d*o+p*l,e[2]=f*r+d*a+p*u,e[3]=v*n+g*s+M*h,e[4]=v*i+g*o+M*l,e[5]=v*r+g*a+M*u,e[6]=m*n+x*s+y*h,e[7]=m*i+x*o+y*l,e[8]=m*r+x*a+y*u,this},translate:function(t){var e=this.val,n=t.x,i=t.y;return e[6]=n*e[0]+i*e[3]+e[6],e[7]=n*e[1]+i*e[4]+e[7],e[8]=n*e[2]+i*e[5]+e[8],this},rotate:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*n+h*s,e[1]=l*i+h*o,e[2]=l*r+h*a,e[3]=l*s-h*n,e[4]=l*o-h*i,e[5]=l*a-h*r,this},scale:function(t){var e=this.val,n=t.x,i=t.y;return e[0]=n*e[0],e[1]=n*e[1],e[2]=n*e[2],e[3]=i*e[3],e[4]=i*e[4],e[5]=i*e[5],this},fromQuat:function(t){var e=t.x,n=t.y,i=t.z,r=t.w,s=e+e,o=n+n,a=i+i,h=e*s,l=e*o,u=e*a,c=n*o,f=n*a,d=i*a,p=r*s,v=r*o,g=r*a,M=this.val;return M[0]=1-(c+d),M[3]=l+g,M[6]=u-v,M[1]=l-g,M[4]=1-(h+d),M[7]=f+p,M[2]=u+v,M[5]=f-p,M[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,n=this.val,i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],p=e[11],v=e[12],g=e[13],M=e[14],m=e[15],x=i*h-r*a,y=i*l-s*a,w=i*u-o*a,E=r*l-s*h,b=r*u-o*h,T=s*u-o*l,A=c*g-f*v,R=c*M-d*v,S=c*m-p*v,I=f*M-d*g,C=f*m-p*g,P=d*m-p*M,L=x*P-y*C+w*I+E*S-b*R+T*A;return L?(L=1/L,n[0]=(h*P-l*C+u*I)*L,n[1]=(l*S-a*P-u*R)*L,n[2]=(a*C-h*S+u*A)*L,n[3]=(s*C-r*P-o*I)*L,n[4]=(i*P-s*S+o*R)*L,n[5]=(r*S-i*C-o*A)*L,n[6]=(g*T-M*b+m*E)*L,n[7]=(M*w-v*T-m*y)*L,n[8]=(v*b-g*w+m*x)*L,this):null}});t.exports=i},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,n){this.identity();var i=this.val;return i[12]=t,i[13]=e,i[14]=n,this},scaling:function(t,e,n){this.zero();var i=this.val;return i[0]=t,i[5]=e,i[10]=n,i[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],n=t[2],i=t[3],r=t[6],s=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=n,t[9]=r,t[11]=t[14],t[12]=i,t[13]=s,t[14]=o,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],g=t[15],M=e*o-n*s,m=e*a-i*s,x=e*h-r*s,y=n*a-i*o,w=n*h-r*o,E=i*h-r*a,b=l*p-u*d,T=l*v-c*d,A=l*g-f*d,R=u*v-c*p,S=u*g-f*p,I=c*g-f*v,C=M*I-m*S+x*R+y*A-w*T+E*b;return C?(C=1/C,t[0]=(o*I-a*S+h*R)*C,t[1]=(i*S-n*I-r*R)*C,t[2]=(p*E-v*w+g*y)*C,t[3]=(c*w-u*E-f*y)*C,t[4]=(a*A-s*I-h*T)*C,t[5]=(e*I-i*A+r*T)*C,t[6]=(v*x-d*E-g*m)*C,t[7]=(l*E-c*x+f*m)*C,t[8]=(s*S-o*A+h*b)*C,t[9]=(n*A-e*S-r*b)*C,t[10]=(d*w-p*x+g*M)*C,t[11]=(u*x-l*w-f*M)*C,t[12]=(o*T-s*R-a*b)*C,t[13]=(e*R-n*T+i*b)*C,t[14]=(p*m-d*y-v*M)*C,t[15]=(l*y-u*m+c*M)*C,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],g=t[15];return t[0]=o*(c*g-f*v)-u*(a*g-h*v)+p*(a*f-h*c),t[1]=-(n*(c*g-f*v)-u*(i*g-r*v)+p*(i*f-r*c)),t[2]=n*(a*g-h*v)-o*(i*g-r*v)+p*(i*h-r*a),t[3]=-(n*(a*f-h*c)-o*(i*f-r*c)+u*(i*h-r*a)),t[4]=-(s*(c*g-f*v)-l*(a*g-h*v)+d*(a*f-h*c)),t[5]=e*(c*g-f*v)-l*(i*g-r*v)+d*(i*f-r*c),t[6]=-(e*(a*g-h*v)-s*(i*g-r*v)+d*(i*h-r*a)),t[7]=e*(a*f-h*c)-s*(i*f-r*c)+l*(i*h-r*a),t[8]=s*(u*g-f*p)-l*(o*g-h*p)+d*(o*f-h*u),t[9]=-(e*(u*g-f*p)-l*(n*g-r*p)+d*(n*f-r*u)),t[10]=e*(o*g-h*p)-s*(n*g-r*p)+d*(n*h-r*o),t[11]=-(e*(o*f-h*u)-s*(n*f-r*u)+l*(n*h-r*o)),t[12]=-(s*(u*v-c*p)-l*(o*v-a*p)+d*(o*c-a*u)),t[13]=e*(u*v-c*p)-l*(n*v-i*p)+d*(n*c-i*u),t[14]=-(e*(o*v-a*p)-s*(n*v-i*p)+d*(n*a-i*o)),t[15]=e*(o*c-a*u)-s*(n*c-i*u)+l*(n*a-i*o),this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],g=t[15];return(e*o-n*s)*(c*g-f*v)-(e*a-i*s)*(u*g-f*p)+(e*h-r*s)*(u*v-c*p)+(n*a-i*o)*(l*g-f*d)-(n*h-r*o)*(l*v-c*d)+(i*h-r*a)*(l*p-u*d)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],v=e[13],g=e[14],M=e[15],m=t.val,x=m[0],y=m[1],w=m[2],E=m[3];return e[0]=x*n+y*o+w*u+E*p,e[1]=x*i+y*a+w*c+E*v,e[2]=x*r+y*h+w*f+E*g,e[3]=x*s+y*l+w*d+E*M,x=m[4],y=m[5],w=m[6],E=m[7],e[4]=x*n+y*o+w*u+E*p,e[5]=x*i+y*a+w*c+E*v,e[6]=x*r+y*h+w*f+E*g,e[7]=x*s+y*l+w*d+E*M,x=m[8],y=m[9],w=m[10],E=m[11],e[8]=x*n+y*o+w*u+E*p,e[9]=x*i+y*a+w*c+E*v,e[10]=x*r+y*h+w*f+E*g,e[11]=x*s+y*l+w*d+E*M,x=m[12],y=m[13],w=m[14],E=m[15],e[12]=x*n+y*o+w*u+E*p,e[13]=x*i+y*a+w*c+E*v,e[14]=x*r+y*h+w*f+E*g,e[15]=x*s+y*l+w*d+E*M,this},multiplyLocal:function(t){var e=[],n=this.val,i=t.val;return e[0]=n[0]*i[0]+n[1]*i[4]+n[2]*i[8]+n[3]*i[12],e[1]=n[0]*i[1]+n[1]*i[5]+n[2]*i[9]+n[3]*i[13],e[2]=n[0]*i[2]+n[1]*i[6]+n[2]*i[10]+n[3]*i[14],e[3]=n[0]*i[3]+n[1]*i[7]+n[2]*i[11]+n[3]*i[15],e[4]=n[4]*i[0]+n[5]*i[4]+n[6]*i[8]+n[7]*i[12],e[5]=n[4]*i[1]+n[5]*i[5]+n[6]*i[9]+n[7]*i[13],e[6]=n[4]*i[2]+n[5]*i[6]+n[6]*i[10]+n[7]*i[14],e[7]=n[4]*i[3]+n[5]*i[7]+n[6]*i[11]+n[7]*i[15],e[8]=n[8]*i[0]+n[9]*i[4]+n[10]*i[8]+n[11]*i[12],e[9]=n[8]*i[1]+n[9]*i[5]+n[10]*i[9]+n[11]*i[13],e[10]=n[8]*i[2]+n[9]*i[6]+n[10]*i[10]+n[11]*i[14],e[11]=n[8]*i[3]+n[9]*i[7]+n[10]*i[11]+n[11]*i[15],e[12]=n[12]*i[0]+n[13]*i[4]+n[14]*i[8]+n[15]*i[12],e[13]=n[12]*i[1]+n[13]*i[5]+n[14]*i[9]+n[15]*i[13],e[14]=n[12]*i[2]+n[13]*i[6]+n[14]*i[10]+n[15]*i[14],e[15]=n[12]*i[3]+n[13]*i[7]+n[14]*i[11]+n[15]*i[15],this.fromArray(e)},translate:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[12]=r[0]*e+r[4]*n+r[8]*i+r[12],r[13]=r[1]*e+r[5]*n+r[9]*i+r[13],r[14]=r[2]*e+r[6]*n+r[10]*i+r[14],r[15]=r[3]*e+r[7]*n+r[11]*i+r[15],this},translateXYZ:function(t,e,n){var i=this.val;return i[12]=i[0]*t+i[4]*e+i[8]*n+i[12],i[13]=i[1]*t+i[5]*e+i[9]*n+i[13],i[14]=i[2]*t+i[6]*e+i[10]*n+i[14],i[15]=i[3]*t+i[7]*e+i[11]*n+i[15],this},scale:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[0]=r[0]*e,r[1]=r[1]*e,r[2]=r[2]*e,r[3]=r[3]*e,r[4]=r[4]*n,r[5]=r[5]*n,r[6]=r[6]*n,r[7]=r[7]*n,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},scaleXYZ:function(t,e,n){var i=this.val;return i[0]=i[0]*t,i[1]=i[1]*t,i[2]=i[2]*t,i[3]=i[3]*t,i[4]=i[4]*e,i[5]=i[5]*e,i[6]=i[6]*e,i[7]=i[7]*e,i[8]=i[8]*n,i[9]=i[9]*n,i[10]=i[10]*n,i[11]=i[11]*n,this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.fromArray([h*s+n,h*o-i*a,h*a+i*o,0,h*o+i*a,l*o+n,l*a-i*s,0,h*a-i*o,l*a+i*s,r*a*a+n,0,0,0,0,1]),this},rotate:function(t,e){var n=this.val,i=e.x,r=e.y,s=e.z,o=Math.sqrt(i*i+r*r+s*s);if(Math.abs(o)<1e-6)return null;i*=o=1/o,r*=o,s*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=n[0],c=n[1],f=n[2],d=n[3],p=n[4],v=n[5],g=n[6],M=n[7],m=n[8],x=n[9],y=n[10],w=n[11],E=i*i*l+h,b=r*i*l+s*a,T=s*i*l-r*a,A=i*r*l-s*a,R=r*r*l+h,S=s*r*l+i*a,I=i*s*l+r*a,C=r*s*l-i*a,P=s*s*l+h;return n[0]=u*E+p*b+m*T,n[1]=c*E+v*b+x*T,n[2]=f*E+g*b+y*T,n[3]=d*E+M*b+w*T,n[4]=u*A+p*R+m*S,n[5]=c*A+v*R+x*S,n[6]=f*A+g*R+y*S,n[7]=d*A+M*R+w*S,n[8]=u*I+p*C+m*P,n[9]=c*I+v*C+x*P,n[10]=f*I+g*C+y*P,n[11]=d*I+M*C+w*P,this},rotateX:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[4],s=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*i+h*n,e[5]=s*i+l*n,e[6]=o*i+u*n,e[7]=a*i+c*n,e[8]=h*i-r*n,e[9]=l*i-s*n,e[10]=u*i-o*n,e[11]=c*i-a*n,this},rotateY:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*i-h*n,e[1]=s*i-l*n,e[2]=o*i-u*n,e[3]=a*i-c*n,e[8]=r*n+h*i,e[9]=s*n+l*i,e[10]=o*n+u*i,e[11]=a*n+c*i,this},rotateZ:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*i+h*n,e[1]=s*i+l*n,e[2]=o*i+u*n,e[3]=a*i+c*n,e[4]=h*i-r*n,e[5]=l*i-s*n,e[6]=u*i-o*n,e[7]=c*i-a*n,this},fromRotationTranslation:function(t,e){var n=this.val,i=t.x,r=t.y,s=t.z,o=t.w,a=i+i,h=r+r,l=s+s,u=i*a,c=i*h,f=i*l,d=r*h,p=r*l,v=s*l,g=o*a,M=o*h,m=o*l;return n[0]=1-(d+v),n[1]=c+m,n[2]=f-M,n[3]=0,n[4]=c-m,n[5]=1-(u+v),n[6]=p+g,n[7]=0,n[8]=f+M,n[9]=p-g,n[10]=1-(u+d),n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},fromQuat:function(t){var e=this.val,n=t.x,i=t.y,r=t.z,s=t.w,o=n+n,a=i+i,h=r+r,l=n*o,u=n*a,c=n*h,f=i*a,d=i*h,p=r*h,v=s*o,g=s*a,M=s*h;return e[0]=1-(f+p),e[1]=u+M,e[2]=c-g,e[3]=0,e[4]=u-M,e[5]=1-(l+p),e[6]=d+v,e[7]=0,e[8]=c+g,e[9]=d-v,e[10]=1-(l+f),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,n,i,r,s){var o=this.val,a=1/(e-t),h=1/(i-n),l=1/(r-s);return o[0]=2*r*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*r*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(i+n)*h,o[10]=(s+r)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=s*r*2*l,o[15]=0,this},perspective:function(t,e,n,i){var r=this.val,s=1/Math.tan(t/2),o=1/(n-i);return r[0]=s/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(i+n)*o,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*i*n*o,r[15]=0,this},perspectiveLH:function(t,e,n,i){var r=this.val;return r[0]=2*n/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*n/e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i/(n-i),r[11]=1,r[12]=0,r[13]=0,r[14]=n*i/(n-i),r[15]=0,this},ortho:function(t,e,n,i,r,s){var o=this.val,a=t-e,h=n-i,l=r-s;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(i+n)*h,o[14]=(s+r)*l,o[15]=1,this},lookAt:function(t,e,n){var i=this.val,r=t.x,s=t.y,o=t.z,a=n.x,h=n.y,l=n.z,u=e.x,c=e.y,f=e.z;if(Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6&&Math.abs(o-f)<1e-6)return this.identity();var d=r-u,p=s-c,v=o-f,g=1/Math.sqrt(d*d+p*p+v*v),M=h*(v*=g)-l*(p*=g),m=l*(d*=g)-a*v,x=a*p-h*d;(g=Math.sqrt(M*M+m*m+x*x))?(M*=g=1/g,m*=g,x*=g):(M=0,m=0,x=0);var y=p*x-v*m,w=v*M-d*x,E=d*m-p*M;return(g=Math.sqrt(y*y+w*w+E*E))?(y*=g=1/g,w*=g,E*=g):(y=0,w=0,E=0),i[0]=M,i[1]=y,i[2]=d,i[3]=0,i[4]=m,i[5]=w,i[6]=p,i[7]=0,i[8]=x,i[9]=E,i[10]=v,i[11]=0,i[12]=-(M*r+m*s+x*o),i[13]=-(y*r+w*s+E*o),i[14]=-(d*r+p*s+v*o),i[15]=1,this},yawPitchRoll:function(t,e,n){this.zero(),r.zero(),s.zero();var i=this.val,o=r.val,a=s.val,h=Math.sin(n),l=Math.cos(n);return i[10]=1,i[15]=1,i[0]=l,i[1]=h,i[4]=-h,i[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(r),this.multiplyLocal(s),this},setWorldMatrix:function(t,e,n,i,o){return this.yawPitchRoll(t.y,t.x,t.z),r.scaling(n.x,n.y,n.z),s.xyz(e.x,e.y,e.z),this.multiplyLocal(r),this.multiplyLocal(s),void 0!==i&&this.multiplyLocal(i),void 0!==o&&this.multiplyLocal(o),this}}),r=new i,s=new i;t.exports=i},function(t,e,n){var i=n(0),r=n(10),s=n(26),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new r(1,0,0),l=new r(0,1,0),u=new r,c=new s,f=new i({initialize:function(t,e,n,i){"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,n,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},rotationTo:function(t,e){var n=t.x*e.x+t.y*e.y+t.z*e.z;return n<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):n>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+n,this.normalize())},setAxes:function(t,e,n){var i=c.val;return i[0]=e.x,i[3]=e.y,i[6]=e.z,i[1]=n.x,i[4]=n.y,i[7]=n.z,i[2]=-t.x,i[5]=-t.y,i[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var n=Math.sin(e);return this.x=n*t.x,this.y=n*t.y,this.z=n*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,s=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+r*s+n*a-i*o,this.y=n*h+r*o+i*s-e*a,this.z=i*h+r*a+e*o-n*s,this.w=r*h-e*s-n*o-i*a,this},slerp:function(t,e){var n=this.x,i=this.y,r=this.z,s=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=n*o+i*a+r*h+s*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,f=e;if(1-u>1e-6){var d=Math.acos(u),p=Math.sin(d);c=Math.sin((1-e)*d)/p,f=Math.sin(e*d)/p}return this.x=c*n+f*o,this.y=c*i+f*a,this.z=c*r+f*h,this.w=c*s+f*l,this},invert:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i,s=r?1/r:0;return this.x=-t*s,this.y=-e*s,this.z=-n*s,this.w=i*s,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o+r*s,this.y=n*o+i*s,this.z=i*o-n*s,this.w=r*o-e*s,this},rotateY:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o-i*s,this.y=n*o+r*s,this.z=i*o+e*s,this.w=r*o-n*s,this},rotateZ:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.x=e*o+n*s,this.y=n*o-e*s,this.z=i*o+r*s,this.w=r*o-i*s,this},calculateW:function(){var t=this.x,e=this.y,n=this.z;return this.w=-Math.sqrt(1-t*t-e*e-n*n),this},fromMat3:function(t){var e,n=t.val,i=n[0]+n[4]+n[8];if(i>0)e=Math.sqrt(i+1),this.w=.5*e,e=.5/e,this.x=(n[7]-n[5])*e,this.y=(n[2]-n[6])*e,this.z=(n[3]-n[1])*e;else{var r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);var s=o[r],h=o[s];e=Math.sqrt(n[3*r+r]-n[3*s+s]-n[3*h+h]+1),a[r]=.5*e,e=.5/e,a[s]=(n[3*s+r]+n[3*r+s])*e,a[h]=(n[3*h+r]+n[3*r+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(n[3*h+s]-n[3*s+h])*e}return this}});t.exports=f},function(t,e,n){var i=n(14),r=n(30);t.exports=function(t,e){var n=void 0===t?r():i({},t);if(e)for(var s in e)void 0!==e[s]&&(n[s]=e[s]);return n}},function(t,e){t.exports=function(t,e,n,i,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=0),{responseType:t,async:e,user:n,password:i,timeout:r,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e){t.exports=function(){}},function(t,e,n){var i=n(33),r=n(0),s=n(11),o=n(144),a=n(145),h=n(167),l=n(168),u=n(186),c=new r({Extends:a,initialize:function(t,e){a.call(this,t,e);var n=e.game;this.isWebGL=2===n.config.renderType,this.cache=n.cache.addCustom("spine"),this.spineTextures=n.cache.addCustom("spineTextures"),this.json=n.cache.json,this.textures=n.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=n.renderer,this.gl=n.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=n.renderer,this.getAtlas=this.getAtlasCanvas);var r=this;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",function(t,e,n,i,s){var o=new u(this.scene,r,t,e,n,i,s);return this.displayList.add(o),this.updateList.add(o),o},function(t,e){void 0===t&&(t={});var n=s(t,"key",null),o=s(t,"animationName",null),a=s(t,"loop",!1),h=new u(this.scene,r,0,0,n,o,a);void 0!==e&&(t.add=e),i(this.scene,h,t);var l=s(t,"skinName",!1);l&&h.setSkinByName(l);var c=s(t,"slotName",!1),f=s(t,"attachmentName",null);return c&&h.setAttachment(c,f),h.refresh()})},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(o,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){this.sceneRenderer=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0);var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))}};this.sceneRenderer.batcher.setBlendMode=t,this.sceneRenderer.shapes.setBlendMode=t,this.skeletonRenderer=this.sceneRenderer.skeletonRenderer,this.skeletonDebugRenderer=this.sceneRenderer.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var n,i=this.spineTextures;if(i.has(t))n=i.get(t);else{var r=this.textures;n=new h.TextureAtlas(e.data,function(t){return new h.canvas.CanvasTexture(r.get(t).getSourceImage())})}return n}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var n,i=this.spineTextures;if(i.has(t))n=i.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n=new h.TextureAtlas(e.data,function(t){return new h.webgl.GLTexture(s,r.get(t).getSourceImage(),!1)})}return n}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,n,i,r,s){var o;if(Array.isArray(t))for(var a=0;a=i.PI2-n?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=n:e=1?1:1/e*(1+(e*t|0))}},function(t,e,n){t.exports={Ceil:n(94),Equal:n(95),Floor:n(96),GreaterThan:n(97),LessThan:n(98)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),Math.abs(t-e)e-n}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),t1?t[n]-(i(r-n,t[n],t[n],t[n-1],t[n-1])-t[n]):i(r-s,t[s?s-1:0],t[s],t[n1?i(t[n],t[n-1],n-r):i(t[s],t[s+1>n?n:s+1],r-s)}},function(t,e){t.exports=function(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}},function(t,e,n){var i=n(23);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){var i=n(24);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){t.exports={GetNext:n(108),IsSize:n(109),IsValue:n(110)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,n){t.exports={Ceil:n(112),Floor:n(113),To:n(114)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.ceil(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.floor(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.round(t/e),i?(n+t)/e:n+t)}},function(t,e,n){var i=new(n(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,n=this.n;t=t.toString();for(var i=0;i>>0,n=(e*=n)>>>0,n+=4294967296*(e-=n);return this.n=n,2.3283064365386963e-10*(n>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var n=Math.floor(this.frac()*(e+1)),i=t[n];t[n]=t[e],t[e]=i}return t}});t.exports=i},function(t,e){t.exports=function(t){for(var e=0,n=0;n1?void 0!==i?(r=(i-t)/(i-n))<0&&(r=0):r=1:r<0&&(r=0),r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI;return t.x=Math.cos(n)*e,t.y=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI,i=2*Math.random()-1,r=Math.sqrt(1-i*i)*e;return t.x=Math.cos(n)*r,t.y=Math.sin(n)*r,t.z=i*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var n=t.x,i=t.y;return t.x=n*Math.cos(e)-i*Math.sin(e),t.y=n*Math.sin(e)+i*Math.cos(e),t}},function(t,e){t.exports=function(t,e,n,i){var r=Math.cos(i),s=Math.sin(i),o=t.x-e,a=t.y-n;return t.x=o*r-a*s+e,t.y=o*s+a*r+n,t}},function(t,e){t.exports=function(t,e,n,i,r){var s=i+Math.atan2(t.y-n,t.x-e);return t.x=e+r*Math.cos(s),t.y=n+r*Math.sin(s),t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=10);var i=Math.pow(n,-e);return Math.round(t*i)/i}},function(t,e){t.exports=function(t,e,n,i){void 0===e&&(e=1),void 0===n&&(n=1),void 0===i&&(i=1),i*=Math.PI/t;for(var r=[],s=[],o=0;o0&&t<=e*n&&(s=t>e-1?t-(o=Math.floor(t/e))*e:t,r.set(s,o)),r}},function(t,e,n){var i=n(5);t.exports=function(t,e,n,r,s,o,a,h){void 0===h&&(h=new i);var l=Math.sin(s),u=Math.cos(s),c=u*o,f=l*o,d=-l*a,p=u*a,v=1/(c*p+d*-f);return h.x=p*v*t+-d*v*e+(r*d-n*p)*v,h.y=c*v*e+-f*v*t+(-r*c+n*f)*v,h}},function(t,e){t.exports=function(t,e,n){return Math.abs(t-e)<=n}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n,i){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0)},clone:function(){return new i(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,n,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+n*n+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return e*e+n*n+i*i+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*i-o*n,l=a*n+o*e-r*i,u=a*i+r*n-s*e,c=-r*e-s*n-o*i;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-o+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.distSq=i.prototype.distanceSq,i.prototype.len=i.prototype.length,i.prototype.lenSq=i.prototype.lengthSq,t.exports=i},function(t,e,n){var i=n(10),r=n(27),s=n(28),o=new r,a=new s,h=new i;t.exports=function(t,e,n){return a.setAxisAngle(e,n),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e){t.exports="resize"},function(t,e,n){var i=n(146),r=n(0),s=n(147),o=new r({Extends:i,initialize:function(t,e){i.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){}});t.exports=o},function(t,e,n){var i=new(n(0))({initialize:function(t){this.pluginManager=t,this.game=t.game,this.scene,this.systems},init:function(){},start:function(){},stop:function(){},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=i},function(t,e,n){t.exports={BOOT:n(148),CREATE:n(149),DESTROY:n(150),PAUSE:n(151),POST_UPDATE:n(152),PRE_UPDATE:n(153),READY:n(154),RENDER:n(155),RESUME:n(156),SHUTDOWN:n(157),SLEEP:n(158),START:n(159),TRANSITION_COMPLETE:n(160),TRANSITION_INIT:n(161),TRANSITION_OUT:n(162),TRANSITION_START:n(163),TRANSITION_WAKE:n(164),UPDATE:n(165),WAKE:n(166)}},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e){(function(){var e,n,i,r=this&&this.__extends||(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)},function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)});!function(t){var e,n,i,s=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var i=0;i0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(s+1)*n]<=e?i=s+1:r=s,i==r)return(i+1)*n;s=i+r>>>1}},t.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(i=t.TimelineType||(t.TimelineType={}));var o=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var i=this.curves[n];return i==e.LINEAR?e.LINEAR:i==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,i,r,s){var o=.03*(2*-n+r),a=.03*(2*-i+s),h=.006*(3*(n-r)+1),l=.006*(3*(i-s)+1),u=2*o+h,c=2*a+l,f=.3*n+o+.16666667*h,d=.3*i+a+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var g=f,M=d,m=p+e.BEZIER_SIZE-1;p=i){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(i-u)/(a-u)}var f=r[s-1];return f+(1-f)*(i-a)/(1-a)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=o;var a=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e<<1),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},o.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+o.ROTATION]=n},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(i=u[u.length-o.ENTRIES]){var d=u[u.length+o.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+d*a;break;case e.first:case e.replace:d+=c.data.rotation-c.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:c.rotation+=d*a}}else{var p=s.binarySearch(u,i,o.ENTRIES),v=u[p+o.PREV_ROTATION],g=u[p],M=this.getCurvePercent((p>>1)-1,1-(i-g)/(u[p+o.PREV_TIME]-g)),m=u[p+o.ROTATION]-v;switch(m=v+(m-360*(16384-(16384.499999999996-m/360|0)))*M,h){case e.setup:c.rotation=c.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*a;break;case e.first:case e.replace:m+=c.data.rotation-c.rotation;case e.add:c.rotation+=(m-360*(16384-(16384.499999999996-m/360|0)))*a}}},o.ENTRIES=2,o.PREV_TIME=-2,o.PREV_ROTATION=-1,o.ROTATION=1,o}(o);t.RotateTimeline=a;var h=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},o.prototype.setFrame=function(t,e,n,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.X]=n,this.frames[t+o.Y]=i},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(i=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_X],d=u[u.length+o.PREV_Y];else{var p=s.binarySearch(u,i,o.ENTRIES);f=u[p+o.PREV_X],d=u[p+o.PREV_Y];var v=u[p],g=this.getCurvePercent(p/o.ENTRIES-1,1-(i-v)/(u[p+o.PREV_TIME]-v));f+=(u[p+o.X]-f)*g,d+=(u[p+o.Y]-d)*g}switch(h){case e.setup:c.x=c.data.x+f*a,c.y=c.data.y+d*a;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*a,c.y+=(c.data.y+d-c.y)*a;break;case e.add:c.x+=f*a,c.y+=d*a}}},o.ENTRIES=3,o.PREV_TIME=-3,o.PREV_X=-2,o.PREV_Y=-1,o.X=1,o.Y=2,o}(o);t.TranslateTimeline=h;var l=function(o){function a(t){return o.call(this,t)||this}return r(a,o),a.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},a.prototype.apply=function(i,r,o,h,l,u,c){var f=this.frames,d=i.bones[this.boneIndex];if(d.active)if(o=f[f.length-a.ENTRIES])p=f[f.length+a.PREV_X]*d.data.scaleX,v=f[f.length+a.PREV_Y]*d.data.scaleY;else{var g=s.binarySearch(f,o,a.ENTRIES);p=f[g+a.PREV_X],v=f[g+a.PREV_Y];var M=f[g],m=this.getCurvePercent(g/a.ENTRIES-1,1-(o-M)/(f[g+a.PREV_TIME]-M));p=(p+(f[g+a.X]-p)*m)*d.data.scaleX,v=(v+(f[g+a.Y]-v)*m)*d.data.scaleY}if(1==l)u==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=v-d.data.scaleY):(d.scaleX=p,d.scaleY=v);else{var x=0,y=0;if(c==n.mixOut)switch(u){case e.setup:x=d.data.scaleX,y=d.data.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.first:case e.replace:x=d.scaleX,y=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-y)*l;break;case e.add:x=d.scaleX,y=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-d.data.scaleX)*l,d.scaleY=y+(Math.abs(v)*t.MathUtils.signum(y)-d.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),y=Math.abs(d.data.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=y+(v-y)*l;break;case e.first:case e.replace:x=Math.abs(d.scaleX)*t.MathUtils.signum(p),y=Math.abs(d.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=y+(v-y)*l;break;case e.add:x=t.MathUtils.signum(p),y=t.MathUtils.signum(v),d.scaleX=Math.abs(d.scaleX)*x+(p-Math.abs(d.data.scaleX)*x)*l,d.scaleY=Math.abs(d.scaleY)*y+(v-Math.abs(d.data.scaleY)*y)*l}}}},a}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},n.prototype.apply=function(t,i,r,o,a,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],d=u[u.length+n.PREV_Y];else{var p=s.binarySearch(u,r,n.ENTRIES);f=u[p+n.PREV_X],d=u[p+n.PREV_Y];var v=u[p],g=this.getCurvePercent(p/n.ENTRIES-1,1-(r-v)/(u[p+n.PREV_TIME]-v));f+=(u[p+n.X]-f)*g,d+=(u[p+n.Y]-d)*g}switch(h){case e.setup:c.shearX=c.data.shearX+f*a,c.shearY=c.data.shearY+d*a;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*a,c.shearY+=(c.data.shearY+d-c.shearY)*a;break;case e.add:c.shearX+=f*a,c.shearY+=d*a}}},n}(h);t.ShearTimeline=u;var c=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},o.prototype.setFrame=function(t,e,n,i,r,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.R]=n,this.frames[t+o.G]=i,this.frames[t+o.B]=r,this.frames[t+o.A]=s},o.prototype.apply=function(t,n,i,r,a,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(i=c[c.length-o.ENTRIES]){var m=c.length;p=c[m+o.PREV_R],v=c[m+o.PREV_G],g=c[m+o.PREV_B],M=c[m+o.PREV_A]}else{var x=s.binarySearch(c,i,o.ENTRIES);p=c[x+o.PREV_R],v=c[x+o.PREV_G],g=c[x+o.PREV_B],M=c[x+o.PREV_A];var y=c[x],w=this.getCurvePercent(x/o.ENTRIES-1,1-(i-y)/(c[x+o.PREV_TIME]-y));p+=(c[x+o.R]-p)*w,v+=(c[x+o.G]-v)*w,g+=(c[x+o.B]-g)*w,M+=(c[x+o.A]-M)*w}if(1==a)u.color.set(p,v,g,M);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((p-f.r)*a,(v-f.g)*a,(g-f.b)*a,(M-f.a)*a)}}}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_R=-4,o.PREV_G=-3,o.PREV_B=-2,o.PREV_A=-1,o.R=1,o.G=2,o.B=3,o.A=4,o}(o);t.ColorTimeline=c;var f=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},o.prototype.setFrame=function(t,e,n,i,r,s,a,h,l){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.R]=n,this.frames[t+o.G]=i,this.frames[t+o.B]=r,this.frames[t+o.A]=s,this.frames[t+o.R2]=a,this.frames[t+o.G2]=h,this.frames[t+o.B2]=l},o.prototype.apply=function(t,n,i,r,a,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(i=c[c.length-o.ENTRIES]){var b=c.length;g=c[b+o.PREV_R],M=c[b+o.PREV_G],m=c[b+o.PREV_B],x=c[b+o.PREV_A],y=c[b+o.PREV_R2],w=c[b+o.PREV_G2],E=c[b+o.PREV_B2]}else{var T=s.binarySearch(c,i,o.ENTRIES);g=c[T+o.PREV_R],M=c[T+o.PREV_G],m=c[T+o.PREV_B],x=c[T+o.PREV_A],y=c[T+o.PREV_R2],w=c[T+o.PREV_G2],E=c[T+o.PREV_B2];var A=c[T],R=this.getCurvePercent(T/o.ENTRIES-1,1-(i-A)/(c[T+o.PREV_TIME]-A));g+=(c[T+o.R]-g)*R,M+=(c[T+o.G]-M)*R,m+=(c[T+o.B]-m)*R,x+=(c[T+o.A]-x)*R,y+=(c[T+o.R2]-y)*R,w+=(c[T+o.G2]-w)*R,E+=(c[T+o.B2]-E)*R}if(1==a)u.color.set(g,M,m,x),u.darkColor.set(y,w,E,1);else{f=u.color,d=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),d.setFromColor(u.data.darkColor)),f.add((g-f.r)*a,(M-f.g)*a,(m-f.b)*a,(x-f.a)*a),d.add((y-d.r)*a,(w-d.g)*a,(E-d.b)*a,0)}}}},o.ENTRIES=8,o.PREV_TIME=-8,o.PREV_R=-7,o.PREV_G=-6,o.PREV_B=-5,o.PREV_A=-4,o.PREV_R2=-3,o.PREV_G2=-2,o.PREV_B2=-1,o.R=1,o.G=2,o.B=3,o.A=4,o.R2=5,o.G2=6,o.B2=7,o}(o);t.TwoColorTimeline=f;var d=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},r.prototype.apply=function(t,i,r,o,a,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=n.mixOut||h!=e.setup){var c=this.frames;if(r=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var p=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}}else{var v=u.data.attachmentName;u.setAttachment(null==v?null:t.getAttachment(this.slotIndex,v))}},r}();t.AttachmentTimeline=d;var p=null,v=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e),i.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},o.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},o.prototype.apply=function(n,i,r,o,a,h,l){var u=n.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var f=u.deform;0==f.length&&(h=e.setup);var d=this.frameVertices,p=d[0].length,v=this.frames;if(r=v[v.length-1]){var w=d[v.length-1];if(1==a)if(h==e.add)if(null==(g=c).bones){m=g.vertices;for(var E=0;En)this.apply(t,e,Number.MAX_VALUE,i,r,o,a),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)i.push(this.events[u])}}},e}();t.EventTimeline=g;var M=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return i.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},r.prototype.apply=function(i,r,o,a,h,l,u){var c=i.drawOrder,f=i.slots;if(u!=n.mixOut||l!=e.setup){var d=this.frames;if(o=d[d.length-1]?d.length-1:s.binarySearch(d,o)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var g=0,M=v.length;g=c[c.length-a.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+a.PREV_MIX]-f.data.mix)*h,f.softness=f.data.softness+(c[c.length+a.PREV_SOFTNESS]-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+a.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+a.PREV_COMPRESS],f.stretch=0!=c[c.length+a.PREV_STRETCH])):(f.mix+=(c[c.length+a.PREV_MIX]-f.mix)*h,f.softness+=(c[c.length+a.PREV_SOFTNESS]-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[c.length+a.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+a.PREV_COMPRESS],f.stretch=0!=c[c.length+a.PREV_STRETCH]));else{var d=s.binarySearch(c,r,a.ENTRIES),p=c[d+a.PREV_MIX],v=c[d+a.PREV_SOFTNESS],g=c[d],M=this.getCurvePercent(d/a.ENTRIES-1,1-(r-g)/(c[d+a.PREV_TIME]-g));l==e.setup?(f.mix=f.data.mix+(p+(c[d+a.MIX]-p)*M-f.data.mix)*h,f.softness=f.data.softness+(v+(c[d+a.SOFTNESS]-v)*M-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[d+a.PREV_BEND_DIRECTION],f.compress=0!=c[d+a.PREV_COMPRESS],f.stretch=0!=c[d+a.PREV_STRETCH])):(f.mix+=(p+(c[d+a.MIX]-p)*M-f.mix)*h,f.softness+=(v+(c[d+a.SOFTNESS]-v)*M-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[d+a.PREV_BEND_DIRECTION],f.compress=0!=c[d+a.PREV_COMPRESS],f.stretch=0!=c[d+a.PREV_STRETCH]))}},a.ENTRIES=6,a.PREV_TIME=-6,a.PREV_MIX=-5,a.PREV_SOFTNESS=-4,a.PREV_BEND_DIRECTION=-3,a.PREV_COMPRESS=-2,a.PREV_STRETCH=-1,a.MIX=1,a.SOFTNESS=2,a.BEND_DIRECTION=3,a.COMPRESS=4,a.STRETCH=5,a}(o);t.IkConstraintTimeline=m;var x=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},o.prototype.setFrame=function(t,e,n,i,r,s){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.ROTATE]=n,this.frames[t+o.TRANSLATE]=i,this.frames[t+o.SCALE]=r,this.frames[t+o.SHEAR]=s},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(i=u[u.length-o.ENTRIES]){var M=u.length;d=u[M+o.PREV_ROTATE],p=u[M+o.PREV_TRANSLATE],v=u[M+o.PREV_SCALE],g=u[M+o.PREV_SHEAR]}else{var m=s.binarySearch(u,i,o.ENTRIES);d=u[m+o.PREV_ROTATE],p=u[m+o.PREV_TRANSLATE],v=u[m+o.PREV_SCALE],g=u[m+o.PREV_SHEAR];var x=u[m],y=this.getCurvePercent(m/o.ENTRIES-1,1-(i-x)/(u[m+o.PREV_TIME]-x));d+=(u[m+o.ROTATE]-d)*y,p+=(u[m+o.TRANSLATE]-p)*y,v+=(u[m+o.SCALE]-v)*y,g+=(u[m+o.SHEAR]-g)*y}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(d-f.rotateMix)*a,c.translateMix=f.translateMix+(p-f.translateMix)*a,c.scaleMix=f.scaleMix+(v-f.scaleMix)*a,c.shearMix=f.shearMix+(g-f.shearMix)*a}else c.rotateMix+=(d-c.rotateMix)*a,c.translateMix+=(p-c.translateMix)*a,c.scaleMix+=(v-c.scaleMix)*a,c.shearMix+=(g-c.shearMix)*a}},o.ENTRIES=5,o.PREV_TIME=-5,o.PREV_ROTATE=-4,o.PREV_TRANSLATE=-3,o.PREV_SCALE=-2,o.PREV_SHEAR=-1,o.ROTATE=1,o.TRANSLATE=2,o.SCALE=3,o.SHEAR=4,o}(o);t.TransformConstraintTimeline=x;var y=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},o.prototype.setFrame=function(t,e,n){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.VALUE]=n},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(i=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_VALUE];else{var d=s.binarySearch(u,i,o.ENTRIES);f=u[d+o.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/o.ENTRIES-1,1-(i-p)/(u[d+o.PREV_TIME]-p));f+=(u[d+o.VALUE]-f)*v}h==e.setup?c.position=c.data.position+(f-c.data.position)*a:c.position+=(f-c.position)*a}},o.ENTRIES=2,o.PREV_TIME=-2,o.PREV_VALUE=-1,o.VALUE=1,o}(o);t.PathConstraintPositionTimeline=y;var w=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,i,r,o,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var d=s.binarySearch(u,r,n.ENTRIES);f=u[d+n.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(r-p)/(u[d+n.PREV_TIME]-p));f+=(u[d+n.VALUE]-f)*v}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*a:c.spacing+=(f-c.spacing)*a}},n}(y);t.PathConstraintSpacingTimeline=w;var E=function(n){function o(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*o.ENTRIES),i}return r(o,n),o.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},o.prototype.setFrame=function(t,e,n,i){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.ROTATE]=n,this.frames[t+o.TRANSLATE]=i},o.prototype.apply=function(t,n,i,r,a,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(i=u[u.length-o.ENTRIES])f=u[u.length+o.PREV_ROTATE],d=u[u.length+o.PREV_TRANSLATE];else{var p=s.binarySearch(u,i,o.ENTRIES);f=u[p+o.PREV_ROTATE],d=u[p+o.PREV_TRANSLATE];var v=u[p],g=this.getCurvePercent(p/o.ENTRIES-1,1-(i-v)/(u[p+o.PREV_TIME]-v));f+=(u[p+o.ROTATE]-f)*g,d+=(u[p+o.TRANSLATE]-d)*g}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*a,c.translateMix=c.data.translateMix+(d-c.data.translateMix)*a):(c.rotateMix+=(f-c.rotateMix)*a,c.translateMix+=(d-c.translateMix)*a)}},o.ENTRIES=3,o.PREV_TIME=-3,o.PREV_ROTATE=-2,o.PREV_TRANSLATE=-1,o.ROTATE=1,o.TRANSLATE=2,o}(o);t.PathConstraintMixTimeline=E}(i||(i={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool(function(){return new n}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var o=r.next;if(null!=o){var a=r.trackLast-o.delay;if(a>=0){for(o.delay=0,o.trackTime+=0==r.timeScale?0:(a/r.timeScale+t)*o.timeScale,r.trackTime+=s,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var i=this.events,r=this.tracks,s=!1,o=0,a=r.length;o0)){s=!0;var l=0==o?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,p=h.animation.timelines;if(0==o&&1==u||l==t.MixBlend.add)for(var v=0;v1&&(o=1),r!=t.MixBlend.first&&(r=s.mixBlend));var a=o0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,i,r,s,o,a,h){if(h&&(o[a]=0),1!=r){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(c.active){var f=0,d=0;if(i=u[u.length-t.RotateTimeline.ENTRIES])d=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,i,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],g=u[p],M=l.getCurvePercent((p>>1)-1,1-(i-g)/(u[p+t.RotateTimeline.PREV_TIME]-g));d=u[p+t.RotateTimeline.ROTATION]-v,d=v+(d-=360*(16384-(16384.499999999996-d/360|0)))*M+c.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var m=0,x=d-f;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))m=o[a];else{var y=0,w=0;h?(y=0,w=x):(y=o[a],w=o[a+1]);var E=x>0,b=y>=0;t.MathUtils.signum(w)!=t.MathUtils.signum(x)&&Math.abs(w)<=90&&(Math.abs(y)>180&&(y+=360*t.MathUtils.signum(y)),b=E),m=x+y-y%360,b!=E&&(m+=360*t.MathUtils.signum(y)),o[a]=m}o[a+1]=x,f+=m*r,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(n,0,i,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,i=t.animationEnd,r=i-n,s=t.trackLast%r,o=this.events,a=0,h=o.length;ai||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=i&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var i=n.mixingFrom;if(null==i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,null!=i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var i=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,i=!1):this.disposeNext(r));var s=this.trackEntry(t,e,n,r);return this.setCurrent(t,s,i),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,n,i){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,i)},e.prototype.addAnimationWith=function(t,e,n,i){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,n,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,i<=0){var o=r.animationEnd-r.animationStart;0!=o?(r.loop?i+=o*(1+(r.trackTime/o|0)):i+=Math.max(o,r.trackTime),i-=this.data.getMix(r.animation,e)):i=r.trackTime}return s.delay=i,s},e.prototype.setEmptyAnimation=function(t,n){var i=this.setAnimationWith(t,e.emptyAnimation,!1);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.addEmptyAnimation=function(t,n,i){i<=0&&(i-=n);var r=this.addAnimationWith(t,e.emptyAnimation,!1,i);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,i=this.tracks.length;n=0;e--)for(var i=this.tracks[e];null!=i;)this.computeNotLast(i),i=i.mixingFrom},e.prototype.computeHold=function(n){var i=n.mixingTo,r=n.animation.timelines,s=n.animation.timelines.length,o=t.Utils.setArraySize(n.timelineMode,s);n.timelineHoldMix.length=0;var a=t.Utils.setArraySize(n.timelineHoldMix,s),h=this.propertyIDs;if(null!=i&&i.holdPrevious)for(var l=0;l0){o[l]=e.HOLD_MIX,a[l]=f;continue t}break}o[l]=e.HOLD}else o[l]=e.SUBSEQUENT}},e.prototype.computeNotLast=function(n){for(var i=n.animation.timelines,r=n.animation.timelines.length,s=n.timelineMode,o=this.propertyIDs,a=0;a=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD=2,e.HOLD_MIX=3,e.NOT_LAST=4,e}();t.AnimationState=e;var n=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=n;var i,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(i.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(i.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(i.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(i.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(i.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(i.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n=0?n.substring(0,n.lastIndexOf("/")):"";n=this.pathPrefix+n,this.toLoad++,e.downloadText(n,function(e){var a={count:0},h=new Array;try{new t.TextureAtlas(e,function(e){h.push(o+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)})}catch(t){var l=t;return s.errors[n]="Couldn't load texture atlas "+n+": "+l.message,r&&r(n,"Couldn't load texture atlas "+n+": "+l.message),s.toLoad--,void s.loaded++}for(var u=function(l){var u=!1;s.loadTexture(l,function(l,c){if(a.count++,a.count==h.length)if(u)s.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+l+" of atlas "+n),s.toLoad--,s.loaded++;else try{var f=new t.TextureAtlas(e,function(t){return s.get(o+"/"+t)});s.assets[n]=f,i&&i(n,f),s.toLoad--,s.loaded++}catch(t){var d=t;s.errors[n]="Couldn't load texture atlas "+n+": "+d.message,r&&r(n,"Couldn't load texture atlas "+n+": "+d.message),s.toLoad--,s.loaded++}},function(t,e){u=!0,a.count++,a.count==h.length&&(s.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+t+" of atlas "+n),s.toLoad--,s.loaded++)})},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(i||(i={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (region attachment: "+n+")");r.renderObject=r;var s=new t.RegionAttachment(n);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+n+")");r.renderObject=r;var s=new t.MeshAttachment(n);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(i||(i={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(i||(i={})),function(t){var e=function(){function e(t,e,n){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,i,r,s,o,a){this.ax=e,this.ay=n,this.arotation=i,this.ascaleX=r,this.ascaleY=s,this.ashearX=o,this.ashearY=a,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=i+90+a,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(i+o)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(i+o)*r*f,this.d=t.MathUtils.sinDeg(u)*s*f,this.worldX=e*c+l.x,void(this.worldY=n*f+l.y)}var d=h.a,p=h.b,v=h.c,g=h.d;switch(this.worldX=d*e+p*n+h.worldX,this.worldY=v*e+g*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=i+90+a;var M=t.MathUtils.cosDeg(i+o)*r,m=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(i+o)*r,y=t.MathUtils.sinDeg(u)*s;return this.a=d*M+p*x,this.b=d*m+p*y,this.c=v*M+g*x,void(this.d=v*m+g*y);case t.TransformMode.OnlyTranslation:u=i+90+a;this.a=t.MathUtils.cosDeg(i+o)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(i+o)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var w=0;(T=d*d+v*v)>1e-4?(p=v*(T=Math.abs(d*g-p*v)/T),g=d*T,w=Math.atan2(v,d)*t.MathUtils.radDeg):(d=0,v=0,w=90-Math.atan2(g,p)*t.MathUtils.radDeg);var E=i+o-w,b=i+a-w+90;M=t.MathUtils.cosDeg(E)*r,m=t.MathUtils.cosDeg(b)*s,x=t.MathUtils.sinDeg(E)*r,y=t.MathUtils.sinDeg(b)*s;this.a=d*M-p*x,this.b=d*m-p*y,this.c=v*M+g*x,this.d=v*m+g*y;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var T,A=t.MathUtils.cosDeg(i),R=t.MathUtils.sinDeg(i),S=(d*A+p*R)/this.skeleton.scaleX,I=(v*A+g*R)/this.skeleton.scaleY;(T=Math.sqrt(S*S+I*I))>1e-5&&(T=1/T),S*=T,I*=T,T=Math.sqrt(S*S+I*I),this.data.transformMode==t.TransformMode.NoScale&&d*g-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(T=-T);var C=Math.PI/2+Math.atan2(I,S),P=Math.cos(C)*T,L=Math.sin(C)*T;M=t.MathUtils.cosDeg(o)*r,m=t.MathUtils.cosDeg(90+a)*s,x=t.MathUtils.sinDeg(o)*r,y=t.MathUtils.sinDeg(90+a)*s;this.a=S*M+P*x,this.b=S*m+P*y,this.c=I*M+L*x,this.d=I*m+L*y}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var n=e.a,i=e.b,r=e.c,s=e.d,o=1/(n*s-i*r),a=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=a*s*o-h*i*o,this.ay=h*n*o-a*r*o;var l=o*s,u=o*n,c=o*i,f=o*r,d=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-f*this.a,g=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+v*v),this.ascaleX>1e-4){var M=d*g-p*v;this.ascaleY=M/this.ascaleX,this.ashearY=Math.atan2(d*p+v*g,M)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=1/(e*r-n*i),o=t.x-this.worldX,a=t.y-this.worldY;return t.x=o*r*s-a*n*s,t.y=a*e*s-o*i*s,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*i,this.d*i-this.b*n)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(i*this.c+n*this.d,i*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,i=this.b,r=this.c,s=this.d,o=t.MathUtils.cosDeg(e),a=t.MathUtils.sinDeg(e);this.a=o*n-a*r,this.b=o*i-a*s,this.c=a*n+o*r,this.d=a*i+o*s,this.appliedValid=!1},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(){return function(n,i,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,n<0)throw new Error("index must be >= 0.");if(null==i)throw new Error("name cannot be null.");this.index=n,this.name=i,this.parent=r}}();t.BoneData=n,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(i||(i={})),function(t){var e=function(){return function(t,e,n){this.name=t,this.order=e,this.skinRequired=n}}();t.ConstraintData=e}(i||(i={})),function(t){var e=function(){return function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}}();t.Event=e}(i||(i={})),function(t){var e=function(){return function(t){this.name=t}}();t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n180?p-=360:p<-180&&(p+=360);var v=e.ascaleX,g=e.ascaleY;if(r||s){var M=e.data.length*v,m=Math.sqrt(f*f+d*d);if(r&&mM&&M>1e-4){var x=(m/M-1)*a+1;v*=x,o&&(g*=x)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+p*a,v,g,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,i,r,s,o,a,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,f=c,d=e.ascaleY,p=n.ascaleX,v=0,g=0,M=0;c<0?(c=-c,v=180,M=-1):(v=0,M=1),d<0&&(d=-d,M=-M),p<0?(p=-p,g=180):g=0;var m=n.ax,x=0,y=0,w=0,E=e.a,b=e.b,T=e.c,A=e.d,R=Math.abs(c-d)<=1e-4;R?(y=E*m+b*(x=n.ay)+e.worldX,w=T*m+A*x+e.worldY):(x=0,y=E*m+e.worldX,w=T*m+e.worldY);var S=e.parent;E=S.a,b=S.b,T=S.c;var I,C,P=1/(E*(A=S.d)-b*T),L=y-S.worldX,k=w-S.worldY,_=(L*A-k*b)*P-l,F=(k*E-L*T)*P-u,V=Math.sqrt(_*_+F*F),O=n.data.length*p;if(V<1e-4)return this.apply1(e,i,r,!1,o,!1,h),void n.updateWorldTransformWith(m,x,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var D=((L=i-S.worldX)*A-(k=r-S.worldY)*b)*P-l,N=(k*E-L*T)*P-u,U=D*D+N*N;if(0!=a){a*=c*(p+1)/2;var B=Math.sqrt(U),X=B-V-O*c+a;if(X>0){var Y=Math.min(1,X/(2*a))-1;U=(D-=(Y=(X-a*(1-Y*Y))/B)*D)*D+(N-=Y*N)*N}}t:if(R){var z=(U-V*V-(O*=c)*O)/(2*V*O);z<-1?z=-1:z>1&&(z=1,o&&(f*=(Math.sqrt(U)/(V+O)-1)*h+1)),C=Math.acos(z)*s,E=V+O*z,b=O*Math.sin(C),I=Math.atan2(N*E-D*b,D*E+N*b)}else{var W=(E=c*O)*E,q=(b=d*O)*b,G=Math.atan2(N,D),H=-2*q*V,j=q-W;if((A=H*H-4*j*(T=q*V*V+W*U-W*q))>=0){var Z=Math.sqrt(A);H<0&&(Z=-Z);var Q=(Z=-(H+Z)/2)/j,K=T/Z,J=Math.abs(Q)=-1&&T<=1&&(T=Math.acos(T),(A=(L=E*Math.cos(T)+V)*L+(k=b*Math.sin(T))*k)st&&(it=T,st=A,rt=L,ot=k)),U<=(et+st)/2?(I=G-Math.atan2(nt*s,tt),C=$*s):(I=G-Math.atan2(ot*s,rt),C=it*s)}var at=Math.atan2(x,m)*M,ht=e.arotation;(I=(I-at)*t.MathUtils.radDeg+v-ht)>180?I-=360:I<-180&&(I+=360),e.updateWorldTransformWith(l,u,ht+I*h,f,e.ascaleY,0,0),ht=n.arotation,(C=((C+at)*t.MathUtils.radDeg-n.ashearX)*M+g-ht)>180?C-=360:C<-180&&(C+=360),n.updateWorldTransformWith(m,x,ht+C*h,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,i=t.bones.length;n0;if(r>0||s){var o=this.data,a=o.spacingMode==t.SpacingMode.Percent,h=o.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),v=null,g=this.spacing;if(u||!a){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var M=o.spacingMode==t.SpacingMode.Length,m=0,x=f-1;m0?t.MathUtils.degRad:-t.MathUtils.degRad;m=0;for(var P=3;mt.MathUtils.PI?B-=t.MathUtils.PI2:B<-t.MathUtils.PI&&(B+=t.MathUtils.PI2),B*=i,X=Math.cos(B),Y=Math.sin(B),L.a=X*O-Y*N,L.b=X*D-Y*U,L.c=Y*O+X*N,L.d=Y*D+X*U}L.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,i,r,s,o){var a=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*i+2),c=null,f=n.closed,d=n.worldVerticesLength,p=d/6,v=e.NONE;if(!n.constantSpeed){var g=n.lengths,M=g[p-=f?1:2];if(s&&(h*=M),o)for(var m=1;mM){v!=e.AFTER&&(v=e.AFTER,n.computeWorldVertices(a,d-6,4,c,0,2)),this.addAfterPosition(w-M,c,0,u,x);continue}}for(;;y++){var E=g[y];if(!(w>E)){if(0==y)w/=E;else w=(w-(Z=g[y-1]))/(E-Z);break}}y!=v&&(v=y,f&&y==p?(n.computeWorldVertices(a,d-4,4,c,0,2),n.computeWorldVertices(a,0,4,c,4,2)):n.computeWorldVertices(a,6*y+2,8,c,0,2)),this.addCurvePosition(w,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||m>0&&0==q)}return u}f?(d+=2,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(a,2,d-4,c,0,2),n.computeWorldVertices(a,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(a,2,d,c,0,2));for(var b=t.Utils.setArraySize(this.curves,p),T=0,A=c[0],R=c[1],S=0,I=0,C=0,P=0,L=0,k=0,_=0,F=0,V=0,O=0,D=0,N=0,U=0,B=0,X=(m=0,2);mT){this.addAfterPosition(w-T,c,d-4,u,x);continue}}for(;;y++){var G=b[y];if(!(w>G)){if(0==y)w/=G;else w=(w-(Z=b[y-1]))/(G-Z);break}}if(y!=v){v=y;var H=6*y;for(A=c[H],R=c[H+1],S=c[H+2],I=c[H+3],C=c[H+4],P=c[H+5],L=c[H+6],k=c[H+7],D=2*(_=.03*(A-2*S+C))+(V=.006*(3*(S-C)-A+L)),N=2*(F=.03*(R-2*I+P))+(O=.006*(3*(I-P)-R+k)),U=.3*(S-A)+_+.16666667*V,B=.3*(I-R)+F+.16666667*O,z=Math.sqrt(U*U+B*B),Y[0]=z,H=1;H<8;H++)U+=D,B+=N,D+=V,N+=O,z+=Math.sqrt(U*U+B*B),Y[H]=z;U+=D,B+=N,z+=Math.sqrt(U*U+B*B),Y[8]=z,U+=D+V,B+=N+O,z+=Math.sqrt(U*U+B*B),Y[9]=z,W=0}for(w*=z;;W++){var j=Y[W];if(!(w>j)){var Z;if(0==W)w/=j;else w=W+(w-(Z=Y[W-1]))/(j-Z);break}}this.addCurvePosition(.1*w,A,R,S,I,C,P,L,k,u,x,r||m>0&&0==q)}return u},e.prototype.addBeforePosition=function(t,e,n,i,r){var s=e[n],o=e[n+1],a=e[n+2]-s,h=e[n+3]-o,l=Math.atan2(h,a);i[r]=s+t*Math.cos(l),i[r+1]=o+t*Math.sin(l),i[r+2]=l},e.prototype.addAfterPosition=function(t,e,n,i,r){var s=e[n+2],o=e[n+3],a=s-e[n],h=o-e[n+1],l=Math.atan2(h,a);i[r]=s+t*Math.cos(l),i[r+1]=o+t*Math.sin(l),i[r+2]=l},e.prototype.addCurvePosition=function(t,e,n,i,r,s,o,a,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(r-n,i-e));var f=t*t,d=f*t,p=1-t,v=p*p,g=v*p,M=p*t,m=3*M,x=p*m,y=m*t,w=e*g+i*x+s*y+a*d,E=n*g+r*x+o*y+h*d;l[u]=w,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-n,i-e):Math.atan2(E-(n*v+r*M*2+o*f),w-(e*v+i*M*2+s*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(i||(i={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),n=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,n,i){var r=this.clientAssets[t];return null!==r&&void 0!==r||(r=new e(t),this.clientAssets[t]=r),null!==n&&(r.textureLoader=n),r.toLoad.push(i),this.queuedAssets[i]!==i&&(this.queuedAssets[i]=i,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=i.responseText:n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=JSON.parse(i.responseText):n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadTexture=function(t,e,n){var i=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var r=new Image;r.src=n,r.crossOrigin="anonymous",r.onload=function(t){i.rawAssets[n]=r},r.onerror=function(t){i.errors[n]="Couldn't load image "+n}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null===n||void 0===n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(i||(i={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var n=0;n1){var s=i[i.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),i[i.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var n=e.target,i=n.data.index,r=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,i,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,r);for(var s=0,o=this.data.skins.length;s-1||this.updateCacheReset.push(s)}else for(r=0;r0){y=new t.DrawOrderTimeline(O);var D=r.slots.length;for(u=0;u=0;d--)U[d]=-1;var B=t.Utils.newArray(D-N,0),X=0,Y=0;for(d=0;d=0;d--)-1==U[d]&&(U[d]=B[--Y]);y.setFrame(u,m,U)}s.push(y),a=Math.max(a,y.frames[O-1])}var z=n.readInt(!0);if(z>0){for(y=new t.EventTimeline(z),u=0;u>>1^-(1&n)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&i)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&i)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(i),n++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),i=function(){return function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritDeform=r}}(),r=function(){return function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}()}(i||(i={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool(function(){return t.Utils.newFloatArray(16)})}return e.prototype.update=function(e,n){if(null==e)throw new Error("skeleton cannot be null.");var i=this.boundingBoxes,r=this.polygons,s=this.polygonPool,o=e.slots,a=o.length;i.length=0,s.freeAll(r),r.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,s=this.minY,o=this.maxX,a=this.maxY;if(t<=r&&n<=r||e<=s&&i<=s||t>=o&&n>=o||e>=a&&i>=a)return!1;var h=(i-e)/(n-t),l=h*(r-t)+e;if(l>s&&ls&&lr&&ur&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,i=0,r=n.length;i=n||l=n){var u=i[a];u+(n-h)/(l-h)*(i[s]-u)=u&&x<=d||x>=d&&x<=u)&&(x>=e&&x<=i||x>=i&&x<=e)){var y=(l*M-h*v)/m;if((y>=c&&y<=p||y>=p&&y<=c)&&(y>=n&&y<=r||y>=r&&y<=n))return!0}u=d,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(i||(i={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(n,i){if(null!=this.clipAttachment)return 0;this.clipAttachment=i;var r=i.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);i.computeWorldVertices(n,0,r,s,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var a=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=a.length;h>1,U=this.clipOutput,B=t.Utils.setArraySize(u,L+N*p),X=0;X=2?(u=a,a=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(i),u.push(r),u.push(s),u.push(t),u.push(e),a.length=0;for(var c=o,f=o.length-4,d=0;;d+=2){for(var p=c[d],v=c[d+1],g=c[d+2],M=c[d+3],m=p-g,x=v-M,y=u,w=u.length-2,E=a.length,b=0;b0;if(m*(A-M)-x*(T-g)>0){if(I){a.push(R),a.push(S);continue}var C=(L=S-A)*(g-p)-(k=R-T)*(M-v);if(Math.abs(C)>1e-6){var P=(k*(v-A)-L*(p-T))/C;a.push(p+(g-p)*P),a.push(v+(M-v)*P)}else a.push(p),a.push(v)}else if(I){var L,k;C=(L=S-A)*(g-p)-(k=R-T)*(M-v);if(Math.abs(C)>1e-6){P=(k*(v-A)-L*(p-T))/C;a.push(p+(g-p)*P),a.push(v+(M-v)*P)}else a.push(p),a.push(v);a.push(R),a.push(S)}l=!0}if(E==a.length)return h.length=0,!0;if(a.push(a[0]),a.push(a[1]),d==f)break;var _=a;(a=u).length=0,u=_}if(h!=a){h.length=0;d=0;for(var F=a.length-2;d>1;a=0;f--)-1==q[f]&&(q[f]=H[--Z])}y.setFrame(c++,this.getValue(W,"time",0),q)}s.push(y),o=Math.max(o,y.frames[y.getFrameCount()-1])}if(e.events){for(y=new t.EventTimeline(e.events.length),c=0,f=0;f=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},n.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==n)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=i}}();t.SlotData=e}(i||(i={})),function(t){var e,n,i=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=i,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var s=function(){return function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}}();t.TextureRegion=s;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(i);t.FakeTexture=o}(i||(i={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var o=new n(e),a=new Array(4),h=null;;){var l=o.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=o.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,o.readTuple(a);var f=parseInt(a[0]),d=parseInt(a[1]);o.readTuple(a);var p=parseInt(a[0]),v=parseInt(a[1]);u.u=f/h.width,u.v=d/h.height,u.rotate?(u.u2=(f+v)/h.width,u.v2=(d+p)/h.height):(u.u2=(f+p)/h.width,u.v2=(d+v)/h.height),u.x=f,u.y=d,u.width=Math.abs(p),u.height=Math.abs(v),4==o.readTuple(a)&&4==o.readTuple(a)&&o.readTuple(a),u.originalWidth=parseInt(a[0]),u.originalHeight=parseInt(a[1]),o.readTuple(a),u.offsetX=parseInt(a[0]),u.offsetY=parseInt(a[1]),u.index=parseInt(o.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new i).name=l,2==o.readTuple(a)&&(h.width=parseInt(a[0]),h.height=parseInt(a[1]),o.readTuple(a)),o.readTuple(a),h.minFilter=t.Texture.filterFromString(a[0]),h.magFilter=t.Texture.filterFromString(a[1]);var g=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==g?h.uWrap=t.TextureWrap.Repeat:"y"==g?h.vWrap=t.TextureWrap.Repeat:"xy"==g&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var s=e.indexOf(",",r);if(-1==s)break;t[i]=e.substr(r,s-r).trim(),r=s+1}return t[i]=e.substring(r).trim(),i+1},t}(),i=function(){return function(){}}();t.TextureAtlasPage=i;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var i=0;i0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.length;pt.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S*=e;var E=Math.cos(S),b=Math.sin(S);g.a=E*m-b*y,g.b=E*x-b*w,g.c=b*m+E*y,g.d=b*x+E*w,M=!0}if(0!=n){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(T.x-g.worldX)*n,g.worldY+=(T.y-g.worldY)*n,M=!0}if(i>0){var A=Math.sqrt(g.a*g.a+g.c*g.c),R=Math.sqrt(o*o+h*h);A>1e-5&&(A=(A+(R-A+this.data.offsetScaleX)*i)/A),g.a*=A,g.c*=A,A=Math.sqrt(g.b*g.b+g.d*g.d),R=Math.sqrt(a*a+l*l),A>1e-5&&(A=(A+(R-A+this.data.offsetScaleY)*i)/A),g.b*=A,g.d*=A,M=!0}if(r>0){x=g.b,w=g.d;var S,I=Math.atan2(w,x);(S=Math.atan2(l,a)-Math.atan2(h,o)-(I-Math.atan2(g.c,g.a)))>t.MathUtils.PI?S-=t.MathUtils.PI2:S<-t.MathUtils.PI&&(S+=t.MathUtils.PI2),S=I+(S+f)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(S)*A,g.d=Math.sin(S)*A,M=!0}M&&(g.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,i=this.scaleMix,r=this.shearMix,s=this.target,o=s.a,a=s.b,h=s.c,l=s.d,u=o*l-a*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),b=Math.sin(R);g.a=E*m-b*y,g.b=E*x-b*w,g.c=b*m+E*y,g.d=b*x+E*w,M=!0}if(0!=n){var T=this.temp;s.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=T.x*n,g.worldY+=T.y*n,M=!0}if(i>0){var A=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*i+1;g.a*=A,g.c*=A,A=(Math.sqrt(a*a+l*l)-1+this.data.offsetScaleY)*i+1,g.b*=A,g.d*=A,M=!0}if(r>0){var R;(R=Math.atan2(l,a)-Math.atan2(h,o))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=g.b,w=g.d;R=Math.atan2(w,x)+(R-t.MathUtils.PI/2+f)*r;A=Math.sqrt(x*x+w*w);g.b=Math.cos(R)*A,g.d=Math.sin(R)*A,M=!0}M&&(g.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,o=0,a=s.length;o1e-5&&(d=(d+(r.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*n)/p));var v=h.ashearY;if(0!=i){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*i}h.updateWorldTransformWith(c,f,l,d,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,o=0,a=s.length;o1e-5&&(f*=(r.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(r.ascaleY-1+this.data.offsetScaleY)*n+1));var p=h.ashearY;0!=i&&(p+=(r.ashearY+this.data.offsetShearY)*i),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,p)}},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n.rotateMix=0,n.translateMix=0,n.scaleMix=0,n.shearMix=0,n.offsetRotation=0,n.offsetX=0,n.offsetY=0,n.offsetScaleX=0,n.offsetScaleY=0,n.offsetShearY=0,n.relative=!1,n.local=!1,n}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(i||(i={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool(function(){return new Array}),this.polygonIndicesPool=new t.Pool(function(){return new Array})}return e.prototype.triangulate=function(t){var n=t,i=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s3;){for(var l=i-1,u=(s=0,1);;){t:if(!o[s]){for(var c=r[l]<<1,f=r[s]<<1,d=r[u]<<1,p=n[c],v=n[c+1],g=n[f],M=n[f+1],m=n[d],x=n[d+1],y=(u+1)%i;y!=l;y=(y+1)%i)if(o[y]){var w=r[y]<<1,E=n[w],b=n[w+1];if(e.positiveArea(m,x,p,v,E,b)&&e.positiveArea(p,v,g,M,E,b)&&e.positiveArea(g,M,m,x,E,b))break t}break}if(0==u){do{if(!o[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%i}h.push(r[(i+s-1)%i]),h.push(r[s]),h.push(r[(s+1)%i]),r.splice(s,1),o.splice(s,1);var T=(--i+s-1)%i,A=s==i?0:s;o[T]=e.isConcave(T,i,n,r),o[A]=e.isConcave(A,i,n,r)}return 3==i&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,n){var i=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var a=this.polygonPool.obtain();a.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(r.push(a),s.push(o)):(this.polygonPool.free(a),this.polygonIndicesPool.free(o)),(a=this.polygonPool.obtain()).length=0,a.push(v),a.push(g),a.push(M),a.push(m),a.push(x),a.push(y),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(d),o.push(p),l=e.winding(v,g,M,m,x,y),h=f)}a.length>0&&(r.push(a),s.push(o));for(u=0,c=r.length;u=0;u--)0==(a=r[u]).length&&(r.splice(u,1),this.polygonPool.free(a),o=s[u],s.splice(u,1),this.polygonIndicesPool.free(o));return r},e.isConcave=function(t,e,n,i){var r=i[(e+t-1)%e]<<1,s=i[t]<<1,o=i[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[s],n[s+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,i,r,s){return t*(s-i)+n*(e-s)+r*(i-e)>=0},e.winding=function(t,e,n,i,r,s){var o=n-t,a=i-e;return r*a-s*o+o*e-t*a>=0?1:-1},e}();t.Triangulator=e}(i||(i={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return void 0!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}return t.prototype.set=function(t,e,n,i){return this.r=t,this.g=e,this.b=n,this.a=i,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,i){return this.r+=t,this.g+=e,this.b+=n,this.a+=i,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var i=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var i=Math.random(),r=e-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):e-Math.sqrt((1-i)*r*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=i;var s=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=s;var o=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=o;var a=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(o);t.PowOut=a;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,i,r){for(var s=e,o=i;s=n?e:t.setArraySize(e,n,i)},t.newArray=function(t,e){for(var n=new Array(t),i=0;i0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=f;var d=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var o=t.bone.skeleton,a=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=a);for(var y,w=(y=t.bone).worldX,E=y.worldY,b=y.a,T=y.b,A=y.c,R=y.d,S=e,I=r;Ithis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},e.prototype.drawWithOffset=function(t,e,n,i){var r=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(t),this.indicesLength>0?r.drawElements(e,i,r.UNSIGNED_SHORT,2*n):r.drawArrays(e,n,i),this.unbind(t)},e.prototype.bind=function(t){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer);for(var n=0,i=0;i0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.unbind=function(t){for(var e=this.context.gl,n=0;n0&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)},e.prototype.update=function(){var t=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=t.createBuffer()),t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),t.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),t.DYNAMIC_DRAW),this.dirtyIndices=!1)},e.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},e.prototype.dispose=function(){this.context.removeRestorable(this);var t=this.context.gl;t.deleteBuffer(this.verticesBuffer),t.deleteBuffer(this.indicesBuffer)},e}();t.Mesh=e;var n=function(){return function(t,e,n){this.name=t,this.type=e,this.numElements=n}}();t.VertexAttribute=n;var i=function(e){function n(){return e.call(this,t.Shader.POSITION,h.Float,2)||this}return r(n,e),n}(n);t.Position2Attribute=i;var s=function(e){function n(){return e.call(this,t.Shader.POSITION,h.Float,3)||this}return r(n,e),n}(n);t.Position3Attribute=s;var o=function(e){function n(n){return void 0===n&&(n=0),e.call(this,t.Shader.TEXCOORDS+(0==n?"":n),h.Float,2)||this}return r(n,e),n}(n);t.TexCoordAttribute=o;var a=function(e){function n(){return e.call(this,t.Shader.COLOR,h.Float,4)||this}return r(n,e),n}(n);t.ColorAttribute=a;var h,l=function(e){function n(){return e.call(this,t.Shader.COLOR2,h.Float,4)||this}return r(n,e),n}(n);t.Color2Attribute=l,function(t){t[t.Float=0]="Float"}(h=t.VertexAttributeType||(t.VertexAttributeType={}))}(t.webgl||(t.webgl={}))}(i||(i={})),function(t){!function(t){var e=function(){function e(e,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,i>10920)throw new Error("Can't have more than 10920 triangles per batch: "+i);this.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e);var r=n?[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute,new t.Color2Attribute]:[new t.Position2Attribute,new t.ColorAttribute,new t.TexCoordAttribute];this.mesh=new t.Mesh(e,r,i,3*i),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return e.prototype.begin=function(t){var e=this.context.gl;if(this.isDrawing)throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()");this.drawCalls=0,this.shader=t,this.lastTexture=null,this.isDrawing=!0,e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},e.prototype.setBlendMode=function(t,e){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))},e.prototype.draw=function(t,e,n){t!=this.lastTexture?(this.flush(),this.lastTexture=t):(this.verticesLength+e.length>this.mesh.getVertices().length||this.indicesLength+n.length>this.mesh.getIndices().length)&&this.flush();var i=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,o=0;o0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1,t.disable(t.BLEND)},e.prototype.getDrawCalls=function(){return this.drawCalls},e.prototype.dispose=function(){this.mesh.dispose()},e}();t.PolygonBatcher=e}(t.webgl||(t.webgl={}))}(i||(i={})),function(t){!function(e){var n,i=function(){function i(n,i,r){void 0===r&&(r=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new t.Color(1,1,1,1),this.canvas=n,this.context=i instanceof e.ManagedWebGLRenderingContext?i:new e.ManagedWebGLRenderingContext(i),this.twoColorTint=r,this.camera=new e.OrthoCamera(n.width,n.height),this.batcherShader=r?e.Shader.newTwoColoredTextured(this.context):e.Shader.newColoredTextured(this.context),this.batcher=new e.PolygonBatcher(this.context,r),this.shapesShader=e.Shader.newColored(this.context),this.shapes=new e.ShapeRenderer(this.context),this.skeletonRenderer=new e.SkeletonRenderer(this.context,r),this.skeletonDebugRenderer=new e.SkeletonDebugRenderer(this.context)}return i.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},i.prototype.drawSkeleton=function(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=-1),void 0===i&&(i=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=e,this.skeletonRenderer.draw(this.batcher,t,n,i)},i.prototype.drawSkeletonDebug=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=e,this.skeletonDebugRenderer.draw(this.shapes,t,n)},i.prototype.drawTexture=function(t,e,n,i,r,s){void 0===s&&(s=null),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var o=this.QUAD,a=0;o[a++]=e,o[a++]=n,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=0,o[a++]=1,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e+i,o[a++]=n,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=1,o[a++]=1,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e+i,o[a++]=n+r,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=1,o[a++]=0,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),o[a++]=e,o[a++]=n+r,o[a++]=s.r,o[a++]=s.g,o[a++]=s.b,o[a++]=s.a,o[a++]=0,o[a++]=0,this.twoColorTint&&(o[a++]=0,o[a++]=0,o[a++]=0,o[a++]=0),this.batcher.draw(t,o,this.QUAD_TRIANGLES)},i.prototype.drawTextureUV=function(t,e,n,i,r,s,o,a,h,l){void 0===l&&(l=null),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var u=this.QUAD,c=0;u[c++]=e,u[c++]=n,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=o,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+i,u[c++]=n,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=a,u[c++]=o,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e+i,u[c++]=n+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=a,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),u[c++]=e,u[c++]=n+r,u[c++]=l.r,u[c++]=l.g,u[c++]=l.b,u[c++]=l.a,u[c++]=s,u[c++]=h,this.twoColorTint&&(u[c++]=0,u[c++]=0,u[c++]=0,u[c++]=0),this.batcher.draw(t,u,this.QUAD_TRIANGLES)},i.prototype.drawTextureRotated=function(e,n,i,r,s,o,a,h,l,u){void 0===l&&(l=null),void 0===u&&(u=!1),this.enableRenderer(this.batcher),null===l&&(l=this.WHITE);var c=this.QUAD,f=n+o,d=i+a,p=-o,v=-a,g=r-o,M=s-a,m=p,x=v,y=p,w=M,E=g,b=M,T=g,A=v,R=0,S=0,I=0,C=0,P=0,L=0,k=0,_=0;if(0!=h){var F=t.MathUtils.cosDeg(h),V=t.MathUtils.sinDeg(h);I=(P=F*E-V*b)+((R=F*m-V*x)-(k=F*y-V*w)),C=(L=V*E+F*b)+((S=V*m+F*x)-(_=V*y+F*w))}else R=m,S=x,k=y,_=w,P=E,L=b,I=T,C=A;R+=f,S+=d,I+=f,C+=d,P+=f,L+=d,k+=f,_+=d;var O=0;c[O++]=R,c[O++]=S,c[O++]=l.r,c[O++]=l.g,c[O++]=l.b,c[O++]=l.a,c[O++]=0,c[O++]=1,this.twoColorTint&&(c[O++]=0,c[O++]=0,c[O++]=0,c[O++]=0),c[O++]=I,c[O++]=C,c[O++]=l.r,c[O++]=l.g,c[O++]=l.b,c[O++]=l.a,c[O++]=1,c[O++]=1,this.twoColorTint&&(c[O++]=0,c[O++]=0,c[O++]=0,c[O++]=0),c[O++]=P,c[O++]=L,c[O++]=l.r,c[O++]=l.g,c[O++]=l.b,c[O++]=l.a,c[O++]=1,c[O++]=0,this.twoColorTint&&(c[O++]=0,c[O++]=0,c[O++]=0,c[O++]=0),c[O++]=k,c[O++]=_,c[O++]=l.r,c[O++]=l.g,c[O++]=l.b,c[O++]=l.a,c[O++]=0,c[O++]=0,this.twoColorTint&&(c[O++]=0,c[O++]=0,c[O++]=0,c[O++]=0),this.batcher.draw(e,c,this.QUAD_TRIANGLES)},i.prototype.drawRegion=function(t,e,n,i,r,s,o){void 0===s&&(s=null),void 0===o&&(o=!1),this.enableRenderer(this.batcher),null===s&&(s=this.WHITE);var a=this.QUAD,h=0;a[h++]=e,a[h++]=n,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u,a[h++]=t.v2,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e+i,a[h++]=n,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u2,a[h++]=t.v2,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e+i,a[h++]=n+r,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u2,a[h++]=t.v,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),a[h++]=e,a[h++]=n+r,a[h++]=s.r,a[h++]=s.g,a[h++]=s.b,a[h++]=s.a,a[h++]=t.u,a[h++]=t.v,this.twoColorTint&&(a[h++]=0,a[h++]=0,a[h++]=0,a[h++]=0),this.batcher.draw(t.texture,a,this.QUAD_TRIANGLES)},i.prototype.line=function(t,e,n,i,r,s){void 0===r&&(r=null),void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.line(t,e,n,i,r)},i.prototype.triangle=function(t,e,n,i,r,s,o,a,h,l){void 0===a&&(a=null),void 0===h&&(h=null),void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(t,e,n,i,r,s,o,a,h,l)},i.prototype.quad=function(t,e,n,i,r,s,o,a,h,l,u,c,f){void 0===l&&(l=null),void 0===u&&(u=null),void 0===c&&(c=null),void 0===f&&(f=null),this.enableRenderer(this.shapes),this.shapes.quad(t,e,n,i,r,s,o,a,h,l,u,c,f)},i.prototype.rect=function(t,e,n,i,r,s){void 0===s&&(s=null),this.enableRenderer(this.shapes),this.shapes.rect(t,e,n,i,r,s)},i.prototype.rectLine=function(t,e,n,i,r,s,o){void 0===o&&(o=null),this.enableRenderer(this.shapes),this.shapes.rectLine(t,e,n,i,r,s,o)},i.prototype.polygon=function(t,e,n,i){void 0===i&&(i=null),this.enableRenderer(this.shapes),this.shapes.polygon(t,e,n,i)},i.prototype.circle=function(t,e,n,i,r,s){void 0===r&&(r=null),void 0===s&&(s=0),this.enableRenderer(this.shapes),this.shapes.circle(t,e,n,i,r,s)},i.prototype.curve=function(t,e,n,i,r,s,o,a,h,l){void 0===l&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(t,e,n,i,r,s,o,a,h,l)},i.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},i.prototype.resize=function(t){var e=this.canvas,i=e.clientWidth,r=e.clientHeight;if(e.width==i&&e.height==r||(e.width=i,e.height=r),this.context.gl.viewport(0,0,e.width,e.height),t===n.Stretch);else if(t===n.Expand)this.camera.setViewport(i,r);else if(t===n.Fit){var s=e.width,o=e.height,a=this.camera.viewportWidth,h=this.camera.viewportHeight,l=h/a10920)throw new Error("Can't have more than 10920 triangles per batch: "+r);this.context=i instanceof e.ManagedWebGLRenderingContext?i:new e.ManagedWebGLRenderingContext(i),this.mesh=new e.Mesh(i,[new e.Position2Attribute,new e.ColorAttribute],r,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return i.prototype.begin=function(t){if(this.isDrawing)throw new Error("ShapeRenderer.begin() has already been called");this.shader=t,this.vertexIndex=0,this.isDrawing=!0;var e=this.context.gl;e.enable(e.BLEND),e.blendFunc(this.srcBlend,this.dstBlend)},i.prototype.setBlendMode=function(t,e){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))},i.prototype.setColor=function(t){this.color.setFromColor(t)},i.prototype.setColorWith=function(t,e,n,i){this.color.set(t,e,n,i)},i.prototype.point=function(t,e,i){void 0===i&&(i=null),this.check(n.Point,1),null===i&&(i=this.color),this.vertex(t,e,i)},i.prototype.line=function(t,e,i,r,s){void 0===s&&(s=null),this.check(n.Line,2);this.mesh.getVertices(),this.vertexIndex;null===s&&(s=this.color),this.vertex(t,e,s),this.vertex(i,r,s)},i.prototype.triangle=function(t,e,i,r,s,o,a,h,l,u){void 0===h&&(h=null),void 0===l&&(l=null),void 0===u&&(u=null),this.check(t?n.Filled:n.Line,3);this.mesh.getVertices(),this.vertexIndex;null===h&&(h=this.color),null===l&&(l=this.color),null===u&&(u=this.color),t?(this.vertex(e,i,h),this.vertex(r,s,l),this.vertex(o,a,u)):(this.vertex(e,i,h),this.vertex(r,s,l),this.vertex(r,s,h),this.vertex(o,a,l),this.vertex(o,a,h),this.vertex(e,i,l))},i.prototype.quad=function(t,e,i,r,s,o,a,h,l,u,c,f,d){void 0===u&&(u=null),void 0===c&&(c=null),void 0===f&&(f=null),void 0===d&&(d=null),this.check(t?n.Filled:n.Line,3);this.mesh.getVertices(),this.vertexIndex;null===u&&(u=this.color),null===c&&(c=this.color),null===f&&(f=this.color),null===d&&(d=this.color),t?(this.vertex(e,i,u),this.vertex(r,s,c),this.vertex(o,a,f),this.vertex(o,a,f),this.vertex(h,l,d),this.vertex(e,i,u)):(this.vertex(e,i,u),this.vertex(r,s,c),this.vertex(r,s,c),this.vertex(o,a,f),this.vertex(o,a,f),this.vertex(h,l,d),this.vertex(h,l,d),this.vertex(e,i,u))},i.prototype.rect=function(t,e,n,i,r,s){void 0===s&&(s=null),this.quad(t,e,n,e+i,n,e+i,n+r,e,n+r,s,s,s,s)},i.prototype.rectLine=function(t,e,i,r,s,o,a){void 0===a&&(a=null),this.check(t?n.Filled:n.Line,8),null===a&&(a=this.color);var h=this.tmp.set(s-i,e-r);h.normalize(),o*=.5;var l=h.x*o,u=h.y*o;t?(this.vertex(e+l,i+u,a),this.vertex(e-l,i-u,a),this.vertex(r+l,s+u,a),this.vertex(r-l,s-u,a),this.vertex(r+l,s+u,a),this.vertex(e-l,i-u,a)):(this.vertex(e+l,i+u,a),this.vertex(e-l,i-u,a),this.vertex(r+l,s+u,a),this.vertex(r-l,s-u,a),this.vertex(r+l,s+u,a),this.vertex(e+l,i+u,a),this.vertex(r-l,s-u,a),this.vertex(e-l,i-u,a))},i.prototype.x=function(t,e,n){this.line(t-n,e-n,t+n,e+n),this.line(t-n,e+n,t+n,e-n)},i.prototype.polygon=function(t,e,i,r){if(void 0===r&&(r=null),i<3)throw new Error("Polygon must contain at least 3 vertices");this.check(n.Line,2*i),null===r&&(r=this.color);this.mesh.getVertices(),this.vertexIndex;i<<=1;for(var s=t[e<<=1],o=t[e+1],a=e+i,h=e,l=e+i-2;h=a?(f=s,d=o):(f=t[h+2],d=t[h+3]),this.vertex(u,c,r),this.vertex(f,d,r)}},i.prototype.circle=function(e,i,r,s,o,a){if(void 0===o&&(o=null),void 0===a&&(a=0),0===a&&(a=Math.max(1,6*t.MathUtils.cbrt(s)|0)),a<=0)throw new Error("segments must be > 0.");null===o&&(o=this.color);var h=2*t.MathUtils.PI/a,l=Math.cos(h),u=Math.sin(h),c=s,f=0;if(e){this.check(n.Filled,3*a+3),a--;for(p=0;p0;)this.vertex(E,b,u),E+=T,b+=A,T+=R,A+=S,R+=I,S+=C,this.vertex(E,b,u);this.vertex(E,b,u),this.vertex(a,h,u)},i.prototype.vertex=function(t,e,n){var i=this.vertexIndex,r=this.mesh.getVertices();r[i++]=t,r[i++]=e,r[i++]=n.r,r[i++]=n.g,r[i++]=n.b,r[i++]=n.a,this.vertexIndex=i},i.prototype.end=function(){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},i.prototype.flush=function(){0!=this.vertexIndex&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},i.prototype.check=function(t,e){if(!this.isDrawing)throw new Error("ShapeRenderer.begin() has not been called");if(this.shapeType==t){if(!(this.mesh.maxVertices()-this.mesh.numVertices()-1)&&null!=f.parent){var d=s+f.data.length*f.a+f.worldX,p=o+f.data.length*f.c+f.worldY;e.rectLine(!0,s+f.worldX,o+f.worldY,d,p,this.boneWidth*this.scale)}}this.drawSkeletonXY&&e.x(s,o,4*this.scale)}if(this.drawRegionAttachments){e.setColor(this.attachmentLineColor);for(u=0,c=(Y=i.slots).length;u0){e.setColor(this.attachmentLineColor);var A=g[(x=2*(x>>1))-2],R=g[x-1];for(y=0,w=x;y-1||e.circle(!0,s+f.worldX,o+f.worldY,3*this.scale,n.GREEN,8)}}if(this.drawClipping){var Y=i.slots;e.setColor(this.clipColor);for(u=0,c=Y.length;u=0&&s==R.data.index&&(E=!0),E){o>=0&&o==R.data.index&&(E=!1);var S=R.getAttachment(),I=null;if(S instanceof t.RegionAttachment){var C=S;v.vertices=this.vertices,v.numVertices=4,v.numFloats=A<<2,C.computeWorldVertices(R.bone,v.vertices,0,A),M=i.QUAD_TRIANGLES,g=C.uvs,I=C.region.renderObject.texture,x=C.color}else{if(!(S instanceof t.MeshAttachment)){if(S instanceof t.ClippingAttachment){var P=S;a.clipStart(R,P);continue}a.clipEndWithSlot(R);continue}var L=S;v.vertices=this.vertices,v.numVertices=L.worldVerticesLength>>1,v.numFloats=v.numVertices*A,v.numFloats>v.vertices.length&&(v.vertices=this.vertices=t.Utils.newFloatArray(v.numFloats)),L.computeWorldVertices(R,0,L.worldVerticesLength,v.vertices,0,A),M=L.triangles,I=L.region.renderObject.texture,g=L.uvs,x=L.color}if(null!=I){var k=R.color,_=this.tempColor;_.r=y.r*k.r*x.r,_.g=y.g*k.g*x.g,_.b=y.b*k.b*x.b,_.a=y.a*k.a*x.a,h&&(_.r*=_.a,_.g*=_.a,_.b*=_.a);var F=this.tempColor2;null==R.darkColor?F.set(0,0,0,1):(h?(F.r=R.darkColor.r*_.a,F.g=R.darkColor.g*_.a,F.b=R.darkColor.b*_.a):F.setFromColor(R.darkColor),F.a=h?1:0);var V=R.data.blendMode;if(V!=u&&(u=V,n.setBlendMode(e.WebGLBlendModeConverter.getSourceGLBlendMode(u,h),e.WebGLBlendModeConverter.getDestGLBlendMode(u))),a.isClipping()){a.clipTriangles(v.vertices,v.numFloats,M,M.length,g,_,F,l);var O=new Float32Array(a.clippedVertices),D=a.clippedTriangles;if(null!=this.vertexEffect){var N=this.vertexEffect,U=O;if(l){X=0;for(var B=O.length;X-1&&this.restorables.splice(e,1)},t}();e.ManagedWebGLRenderingContext=n;var i=function(){function e(){}return e.getDestGLBlendMode=function(n){switch(n){case t.BlendMode.Normal:return e.ONE_MINUS_SRC_ALPHA;case t.BlendMode.Additive:return e.ONE;case t.BlendMode.Multiply:case t.BlendMode.Screen:return e.ONE_MINUS_SRC_ALPHA;default:throw new Error("Unknown blend mode: "+n)}},e.getSourceGLBlendMode=function(n,i){switch(void 0===i&&(i=!1),n){case t.BlendMode.Normal:case t.BlendMode.Additive:return i?e.ONE:e.SRC_ALPHA;case t.BlendMode.Multiply:return e.DST_COLOR;case t.BlendMode.Screen:return e.ONE;default:throw new Error("Unknown blend mode: "+n)}},e.ZERO=0,e.ONE=1,e.SRC_COLOR=768,e.ONE_MINUS_SRC_COLOR=769,e.SRC_ALPHA=770,e.ONE_MINUS_SRC_ALPHA=771,e.DST_ALPHA=772,e.ONE_MINUS_DST_ALPHA=773,e.DST_COLOR=774,e}();e.WebGLBlendModeConverter=i}(t.webgl||(t.webgl={}))}(i||(i={})),t.exports=i}).call(window)},function(t,e,n){var i=n(0),r=n(3),s=n(169),o=n(2),a=n(183),h=n(184),l=n(185),u=new i({Extends:h,initialize:function(t,e,n,i,s,u,c){var f,d,p,v=[],g=t.cacheManager.custom.spine;if(o(e)){var M=e;for(e=r(M,"key"),d=new a(t,{key:e,url:r(M,"jsonURL"),extension:r(M,"jsonExtension","json"),xhrSettings:r(M,"jsonXhrSettings")}),i=r(M,"atlasURL"),s=r(M,"preMultipliedAlpha"),Array.isArray(i)||(i=[i]),f=0;f>16&255)/255,i=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,o=this.skeleton;if(e){var a=this.findSlot(e);a&&(o=a)}return o.color.r=n,o.color.g=i,o.color.b=r,null!==s&&(o.color.a=s),this},setSkeletonFromJSON:function(t,e,n,i){return this.setSkeleton(t,e,n,i)},setSkeleton:function(t,e,n,i){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,i);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,n),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,n,i){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===n&&(n=0),void 0===i&&(i=0),this.width=t,this.height=e,this.displayOriginX=r.x-n,this.displayOriginY=r.y-i,this},setOffset:function(t,e){var n=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=n.x-t,this.displayOriginY=n.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,n=this.scaleX,i=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=n,t.scaleY=i,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var n=0;n0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):i||s?r.TAU-(s>0?Math.acos(-i/this.scaleY):-Math.acos(i/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var n=this.matrix;return n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this},scale:function(t,e){var n=this.matrix;return n[0]*=t,n[1]*=t,n[2]*=e,n[3]*=e,this},rotate:function(t){var e=Math.sin(t),n=Math.cos(t),i=this.matrix,r=i[0],s=i[1],o=i[2],a=i[3];return i[0]=r*n+o*e,i[1]=s*n+a*e,i[2]=r*-e+o*n,i[3]=s*-e+a*n,this},multiply:function(t,e){var n=this.matrix,i=t.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=i[0],c=i[1],f=i[2],d=i[3],p=i[4],v=i[5],g=void 0===e?this:e;return g.a=u*r+c*o,g.b=u*s+c*a,g.c=f*r+d*o,g.d=f*s+d*a,g.e=p*r+v*o+h,g.f=p*s+v*a+l,g},multiplyWithOffset:function(t,e,n){var i=this.matrix,r=t.matrix,s=i[0],o=i[1],a=i[2],h=i[3],l=e*s+n*a+i[4],u=e*o+n*h+i[5],c=r[0],f=r[1],d=r[2],p=r[3],v=r[4],g=r[5];return i[0]=c*s+f*a,i[1]=c*o+f*h,i[2]=d*s+p*a,i[3]=d*o+p*h,i[4]=v*s+g*a+l,i[5]=v*o+g*h+u,this},transform:function(t,e,n,i,r,s){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],f=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=n*a+i*l,o[3]=n*h+i*u,o[4]=r*a+s*l+c,o[5]=r*h+s*u+f,this},transformPoint:function(t,e,n){void 0===n&&(n={x:0,y:0});var i=this.matrix,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5];return n.x=t*r+e*o+h,n.y=t*s+e*a+l,n},invert:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=e*r-n*i;return t[0]=r/a,t[1]=-n/a,t[2]=-i/a,t[3]=e/a,t[4]=(i*o-r*s)/a,t[5]=-(e*o-n*s)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,n,i,r,s){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=r,o[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,n=e[0],i=e[1],r=e[2],s=e[3],o=n*s-i*r;if(t.translateX=e[4],t.translateY=e[5],n||i){var a=Math.sqrt(n*n+i*i);t.rotation=i>0?Math.acos(n/a):-Math.acos(n/a),t.scaleX=a,t.scaleY=o/a}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,n,i,r){var s=this.matrix,o=Math.sin(n),a=Math.cos(n);return s[4]=t,s[5]=e,s[0]=a*i,s[1]=o*i,s[2]=-o*r,s[3]=a*r,this},applyInverse:function(t,e,n){void 0===n&&(n=new s);var i=this.matrix,r=i[0],o=i[1],a=i[2],h=i[3],l=i[4],u=i[5],c=1/(r*h+a*-o);return n.x=h*c*t+-a*c*e+(u*a-l*h)*c,n.y=r*c*e+-o*c*t+(-u*r+l*o)*c,n},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},function(t,e){var n={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=n},function(t,e,n){var i=n(0),r=n(195),s=n(196),o=n(202),a=n(203),h=new i({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,n){return this.scene.sys.input.enable(this,t,e,n),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,n=[];e&&(n.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return n.unshift(this.scene.sys.displayList.getIndex(t)),n},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,scaleMode:t.scaleMode,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,n){var i=n(0),r=n(197),s=new i({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var n=[],i=0;i