From b33d41ea8d62f06244100d9b72c44226539de84a Mon Sep 17 00:00:00 2001 From: Martin Valigursky Date: Fri, 28 Jun 2024 09:42:28 +0100 Subject: [PATCH] Updated emissive tint handling to be compatible with engine 2.0.0 changes --- build/playcanvas-spine.3.6.js | 1 + build/playcanvas-spine.3.6.min.js | 2 +- build/playcanvas-spine.3.8.js | 1 + build/playcanvas-spine.3.8.min.js | 2 +- build/playcanvas-spine.4.0.js | 1 + build/playcanvas-spine.4.0.min.js | 2 +- build/playcanvas-spine.4.1.js | 1 + build/playcanvas-spine.4.1.min.js | 2 +- src/component/Spine.js | 1 + 9 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build/playcanvas-spine.3.6.js b/build/playcanvas-spine.3.6.js index 7bd9961..e003062 100644 --- a/build/playcanvas-spine.3.6.js +++ b/build/playcanvas-spine.3.6.js @@ -7930,6 +7930,7 @@ var spine = (function (pc) { var material = new pc__namespace.StandardMaterial(); material.emissiveMap = texture; material.emissiveVertexColor = true; + material.emissive = pc__namespace.Color.WHITE; material.opacityMap = texture; material.opacityVertexColor = true; material.depthWrite = false; diff --git a/build/playcanvas-spine.3.6.min.js b/build/playcanvas-spine.3.6.min.js index 888052a..2c94b88 100644 --- a/build/playcanvas-spine.3.6.min.js +++ b/build/playcanvas-spine.3.6.min.js @@ -1 +1 @@ -var spine=function(t){"use strict";function e(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n,r,i,a=e(t),o=this&&this.__extends||(n=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])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,i=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.duration=n}return t.prototype.apply=function(t,e,n,r,i,a,o,s){if(null==t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(a+1)*n]<=e?r=a+1:i=a,r==i)return(r+1)*n;a=r+i>>>1}},t.linearSearch=function(t,e,n){for(var r=0,i=t.length-n;r<=i;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=i,function(t){t[t.setup=0]="setup",t[t.current=1]="current",t[t.currentLayered=2]="currentLayered"}(e=t.MixPose||(t.MixPose={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(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"}(r=t.TimelineType||(t.TimelineType={}));var a=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 r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,i,a){var o=.03*(2*-n+i),s=.03*(2*-r+a),h=.006*(3*(n-i)+1),l=.006*(3*(r-a)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,p=.3*r+s+.16666667*l,d=t*e.BEZIER_SIZE,m=this.curves;m[d++]=e.BEZIER;for(var v=f,g=p,y=d+e.BEZIER_SIZE-1;d=r){var u=void 0,c=void 0;return a==h?(u=0,c=0):(u=i[a-2],c=i[a-1]),c+(i[a+1]-c)*(r-u)/(s-u)}var f=i[a-1];return f+(1-f)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var s=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])if(h==e.setup)c.rotation=c.data.rotation+u[u.length+a.PREV_ROTATION]*s;else{var p=c.data.rotation+u[u.length+a.PREV_ROTATION]-c.rotation;p-=360*(16384-(16384.499999999996-p/360|0)),c.rotation+=p*s}else{var d=i.binarySearch(u,r,a.ENTRIES),m=u[d+a.PREV_ROTATION],v=u[d],g=this.getCurvePercent((d>>1)-1,1-(r-v)/(u[d+a.PREV_TIME]-v)),y=u[d+a.ROTATION]-m;y=m+(y-=360*(16384-(16384.499999999996-y/360|0)))*g,h==e.setup?(y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation=c.data.rotation+y*s):(y=c.data.rotation+y-c.rotation,y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation+=y*s)}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=s;var h=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=n,this.frames[t+a.Y]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],p=u[u.length+a.PREV_Y];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_X],p=u[d+a.PREV_Y];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.X]-f)*v,p+=(u[d+a.Y]-p)*v}h==e.setup?(c.x=c.data.x+f*s,c.y=c.data.y+p*s):(c.x+=(c.data.x+f-c.x)*s,c.y+=(c.data.y+p-c.y)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function s(t){return a.call(this,t)||this}return o(s,a),s.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},s.prototype.apply=function(r,a,o,h,l,u,c){var f=this.frames,p=r.bones[this.boneIndex];if(o=f[f.length-s.ENTRIES])d=f[f.length+s.PREV_X]*p.data.scaleX,m=f[f.length+s.PREV_Y]*p.data.scaleY;else{var v=i.binarySearch(f,o,s.ENTRIES);d=f[v+s.PREV_X],m=f[v+s.PREV_Y];var g=f[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(o-g)/(f[v+s.PREV_TIME]-g));d=(d+(f[v+s.X]-d)*y)*p.data.scaleX,m=(m+(f[v+s.Y]-m)*y)*p.data.scaleY}if(1==l)p.scaleX=d,p.scaleY=m;else{var E=0,w=0;u==e.setup?(E=p.data.scaleX,w=p.data.scaleY):(E=p.scaleX,w=p.scaleY),c==n.out?(d=Math.abs(d)*t.MathUtils.signum(E),m=Math.abs(m)*t.MathUtils.signum(w)):(E=Math.abs(E)*t.MathUtils.signum(d),w=Math.abs(w)*t.MathUtils.signum(m)),p.scaleX=E+(d-E)*l,p.scaleY=w+(m-w)*l}}},s}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],p=u[u.length+n.PREV_Y];else{var d=i.binarySearch(u,a,n.ENTRIES);f=u[d+n.PREV_X],p=u[d+n.PREV_Y];var m=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(a-m)/(u[d+n.PREV_TIME]-m));f+=(u[d+n.X]-f)*v,p+=(u[d+n.Y]-p)*v}h==e.setup?(c.shearX=c.data.shearX+f*s,c.shearY=c.data.shearY+p*s):(c.shearX+=(c.data.shearX+f-c.shearX)*s,c.shearY+=(c.data.shearY+p-c.shearY)*s)}},n}(h);t.ShearTimeline=u;var c=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var y=c.length;d=c[y+a.PREV_R],m=c[y+a.PREV_G],v=c[y+a.PREV_B],g=c[y+a.PREV_A]}else{var E=i.binarySearch(c,r,a.ENTRIES);d=c[E+a.PREV_R],m=c[E+a.PREV_G],v=c[E+a.PREV_B],g=c[E+a.PREV_A];var w=c[E],x=this.getCurvePercent(E/a.ENTRIES-1,1-(r-w)/(c[E+a.PREV_TIME]-w));d+=(c[E+a.R]-d)*x,m+=(c[E+a.G]-m)*x,v+=(c[E+a.B]-v)*x,g+=(c[E+a.A]-g)*x}if(1==s)u.color.set(d,m,v,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((d-f.r)*s,(m-f.g)*s,(v-f.b)*s,(g-f.a)*s)}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var f=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o,s,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o,this.frames[t+a.R2]=s,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var T=c.length;v=c[T+a.PREV_R],g=c[T+a.PREV_G],y=c[T+a.PREV_B],E=c[T+a.PREV_A],w=c[T+a.PREV_R2],x=c[T+a.PREV_G2],A=c[T+a.PREV_B2]}else{var M=i.binarySearch(c,r,a.ENTRIES);v=c[M+a.PREV_R],g=c[M+a.PREV_G],y=c[M+a.PREV_B],E=c[M+a.PREV_A],w=c[M+a.PREV_R2],x=c[M+a.PREV_G2],A=c[M+a.PREV_B2];var R=c[M],I=this.getCurvePercent(M/a.ENTRIES-1,1-(r-R)/(c[M+a.PREV_TIME]-R));v+=(c[M+a.R]-v)*I,g+=(c[M+a.G]-g)*I,y+=(c[M+a.B]-y)*I,E+=(c[M+a.A]-E)*I,w+=(c[M+a.R2]-w)*I,x+=(c[M+a.G2]-x)*I,A+=(c[M+a.B2]-A)*I}if(1==s)u.color.set(v,g,y,E),u.darkColor.set(w,x,A,1);else{f=u.color,p=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),p.setFromColor(u.data.darkColor)),f.add((v-f.r)*s,(g-f.g)*s,(y-f.b)*s,(E-f.a)*s),p.add((w-p.r)*s,(x-p.g)*s,(A-p.b)*s,0)}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=f;var p=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return a.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},a.prototype.apply=function(t,r,a,o,s,h,l){var u=t.slots[this.slotIndex];if(l!=n.out||h!=e.setup){var c=this.frames;if(a=c[c.length-1]?c.length-1:i.binarySearch(c,a,1)-1;var d=this.attachmentNames[p];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var m=u.data.attachmentName;u.setAttachment(null==m?null:t.getAttachment(this.slotIndex,m))}},a}();t.AttachmentTimeline=p;var d=null,m=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==d&&(d=t.Utils.newFloatArray(64)),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},a.prototype.apply=function(n,r,a,o,s,h,l){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(s=1);var p=this.frameVertices,d=p[0].length,m=this.frames;if(a=m[m.length-1]){var x=p[m.length-1];if(1==s)t.Utils.arrayCopy(x,0,w,0,d);else if(h==e.setup){if(null==(v=c).bones)for(var A=v.vertices,T=0;Tn)this.apply(t,e,Number.MAX_VALUE,r,a,o,s),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=v;var g=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return a.prototype.getPropertyId=function(){return r.drawOrder<<24},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},a.prototype.apply=function(r,a,o,s,h,l,u){var c=r.drawOrder,f=r.slots;if(u!=n.out||l!=e.setup){var p=this.frames;if(o=p[p.length-1]?p.length-1:i.binarySearch(p,o)-1;var m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var v=0,g=m.length;v=c[c.length-s.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+s.PREV_MIX]-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[c.length+s.PREV_BEND_DIRECTION]):(f.mix+=(c[c.length+s.PREV_MIX]-f.mix)*h,u==n.in&&(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION]));else{var p=i.binarySearch(c,a,s.ENTRIES),d=c[p+s.PREV_MIX],m=c[p],v=this.getCurvePercent(p/s.ENTRIES-1,1-(a-m)/(c[p+s.PREV_TIME]-m));l==e.setup?(f.mix=f.data.mix+(d+(c[p+s.MIX]-d)*v-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[p+s.PREV_BEND_DIRECTION]):(f.mix+=(d+(c[p+s.MIX]-d)*v-f.mix)*h,u==n.in&&(f.bendDirection=c[p+s.PREV_BEND_DIRECTION]))}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_MIX=-2,s.PREV_BEND_DIRECTION=-1,s.MIX=1,s.BEND_DIRECTION=2,s}(a);t.IkConstraintTimeline=y;var E=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r,this.frames[t+a.SCALE]=i,this.frames[t+a.SHEAR]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(r=u[u.length-a.ENTRIES]){var g=u.length;p=u[g+a.PREV_ROTATE],d=u[g+a.PREV_TRANSLATE],m=u[g+a.PREV_SCALE],v=u[g+a.PREV_SHEAR]}else{var y=i.binarySearch(u,r,a.ENTRIES);p=u[y+a.PREV_ROTATE],d=u[y+a.PREV_TRANSLATE],m=u[y+a.PREV_SCALE],v=u[y+a.PREV_SHEAR];var E=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(r-E)/(u[y+a.PREV_TIME]-E));p+=(u[y+a.ROTATE]-p)*w,d+=(u[y+a.TRANSLATE]-d)*w,m+=(u[y+a.SCALE]-m)*w,v+=(u[y+a.SHEAR]-v)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(p-f.rotateMix)*s,c.translateMix=f.translateMix+(d-f.translateMix)*s,c.scaleMix=f.scaleMix+(m-f.scaleMix)*s,c.shearMix=f.shearMix+(v-f.shearMix)*s}else c.rotateMix+=(p-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(v-c.shearMix)*s}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=E;var w=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var p=i.binarySearch(u,r,a.ENTRIES);f=u[p+a.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/a.ENTRIES-1,1-(r-d)/(u[p+a.PREV_TIME]-d));f+=(u[p+a.VALUE]-f)*m}h==e.setup?c.position=c.data.position+(f-c.data.position)*s:c.position+=(f-c.position)*s}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var x=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var p=i.binarySearch(u,a,n.ENTRIES);f=u[p+n.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/n.ENTRIES-1,1-(a-d)/(u[p+n.PREV_TIME]-d));f+=(u[p+n.VALUE]-f)*m}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*s:c.spacing+=(f-c.spacing)*s}},n}(w);t.PathConstraintSpacingTimeline=x;var A=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],p=u[u.length+a.PREV_TRANSLATE];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_ROTATE],p=u[d+a.PREV_TRANSLATE];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.ROTATE]-f)*v,p+=(u[d+a.TRANSLATE]-p)*v}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(p-c.data.translateMix)*s):(c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(p-c.translateMix)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=A}(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 i(this),this.propertyIDs=new t.IntSet,this.mixingTo=new Array,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,r=e.length;n0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}var o=i.next;if(null!=o){var s=i.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime=s+t*o.timeScale,i.trackTime+=a,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=a,o=o.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&null==i.mixingFrom){e[n]=null,this.queue.end(i),this.disposeNext(i);continue}if(null!=i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null;null!=h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&(t.mixTime>=t.mixDuration||0==t.timeScale)?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e*t.timeScale,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,i=this.tracks,a=!1,o=0,s=i.length;o0)){a=!0;var l=0==o?t.MixPose.current:t.MixPose.currentLayered,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(),p=h.animation.timelines.length,d=h.animation.timelines;if(1==u)for(var m=0;m=e.FIRST?t.MixPose.setup:l;E instanceof t.RotateTimeline?this.applyRotateTimeline(E,n,f,u,w,y,m<<1,g):(t.Utils.webkit602BugfixHelper(u,w),E.apply(n,c,f,r,u,w,t.MixDirection.in))}}this.queueEvents(h,f),r.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}return this.queue.drain(),a},e.prototype.applyMixingFrom=function(n,r,i){var a=n.mixingFrom;null!=a.mixingFrom&&this.applyMixingFrom(a,r,i);var o=0;0==n.mixDuration?(o=1,i=t.MixPose.setup):(o=n.mixTime/n.mixDuration)>1&&(o=1);var s=o0&&this.queueEvents(a,c),this.events.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,r,i,a,o,s,h){if(h&&(o[s]=0),1!=i){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(r=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),d=u[p+t.RotateTimeline.PREV_ROTATION],m=u[p],v=l.getCurvePercent((p>>1)-1,1-(r-m)/(u[p+t.RotateTimeline.PREV_TIME]-m));f=u[p+t.RotateTimeline.ROTATION]-d,f=d+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var g=a==t.MixPose.setup?c.data.rotation:c.rotation,y=0,E=f-g;if(0==E)y=o[s];else{E-=360*(16384-(16384.499999999996-E/360|0));var w=0,x=0;h?(w=0,x=E):(w=o[s],x=o[s+1]);var A=E>0,T=w>=0;t.MathUtils.signum(x)!=t.MathUtils.signum(E)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=A),y=E+w-w%360,T!=A&&(y+=360*t.MathUtils.signum(w)),o[s]=y}o[s+1]=E,g+=y*i,c.rotation=g-360*(16384-(16384.499999999996-g/360|0))}}else e.apply(n,0,r,null,1,a,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,i=r-n,a=t.trackLast%i,o=this.events,s=0,h=o.length;sr||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=r&&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 r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,i=this.expandToIndex(t);null!=i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.disposeNext(i),i=i.mixingFrom,r=!1):this.disposeNext(i));var a=this.trackEntry(t,e,n,i);return this.setCurrent(t,a,r),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,r){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(null!=i)for(;null!=i.next;)i=i.next;var a=this.trackEntry(t,e,n,i);if(null==i)this.setCurrent(t,a,!0),this.queue.drain();else if(i.next=a,r<=0){var o=i.animationEnd-i.animationStart;0!=o?(i.loop?r+=o*(1+(i.trackTime/o|0)):r+=o,r-=this.data.getMix(i.animation,e)):r=0}return a.delay=r,a},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var i=this.addAnimationWith(t,e.emptyAnimation,!1,r);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n=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.DIP=2,e.DIP_MIX=3,e}();t.AnimationState=e;var n=function(){function n(){this.timelineData=new Array,this.timelineDipMix=new Array,this.timelinesRotation=new Array}return n.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.animation=null,this.listener=null,this.timelineData.length=0,this.timelineDipMix.length=0,this.timelinesRotation.length=0},n.prototype.setTimelineData=function(n,r,i){null!=n&&r.push(n);var a=null!=this.mixingFrom?this.mixingFrom.setTimelineData(this,r,i):this;null!=n&&r.pop();var o=r,s=r.length-1,h=this.animation.timelines,l=this.animation.timelines.length,u=t.Utils.setArraySize(this.timelineData,l);this.timelineDipMix.length=0;var c=t.Utils.setArraySize(this.timelineDipMix,l);t:for(var f=0;f=0;d--){var m=o[d];if(!m.hasTimeline(p)&&m.mixDuration>0){u[f]=e.DIP_MIX,c[f]=m;continue t}}u[f]=e.DIP}else u[f]=e.FIRST;else u[f]=e.SUBSEQUENT}return a},n.prototype.hasTimeline=function(t){for(var e=this.animation.timelines,n=0,r=e.length;n=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n}();t.TrackEntry=n;var r,i=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.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 s={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 a.errors[n]="Couldn't load texture atlas "+n+": "+l.message,i&&i(n,"Couldn't load texture atlas "+n+": "+l.message),a.toLoad--,void a.loaded++}for(var u=function(l){var u=!1;a.loadTexture(l,(function(l,c){if(s.count++,s.count==h.length)if(u)a.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+l+" of atlas "+n),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(e,(function(t){return a.get(o+"/"+t)}));a.assets[n]=f,r&&r(n,f),a.toLoad--,a.loaded++}catch(t){var p=t;a.errors[n]="Couldn't load texture atlas "+n+": "+p.message,i&&i(n,"Couldn't load texture atlas "+n+": "+p.message),a.toLoad--,a.loaded++}}),(function(t,e){u=!0,s.count++,s.count==h.length&&(a.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+t+" of atlas "+n),a.toLoad--,a.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,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");i.renderObject=i;var a=new t.RegionAttachment(n);return a.setRegion(i),a},e.prototype.newMeshAttachment=function(e,n,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");i.renderObject=i;var a=new t.MeshAttachment(n);return a.region=i,a},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){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(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,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.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,r,i,a,o,s){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var h=this.parent;if(null==h){var l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a,d=this.skeleton;return d.flipX&&(e=-e,u=-u,c=-c),d.flipY&&(n=-n,f=-f,p=-p),this.a=u,this.b=c,this.c=f,this.d=p,this.worldX=e+d.x,void(this.worldY=n+d.y)}var m=h.a,v=h.b,g=h.c,y=h.d;switch(this.worldX=m*e+v*n+h.worldX,this.worldY=g*e+y*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a;return this.a=m*u+v*f,this.b=m*c+v*p,this.c=g*u+y*f,void(this.d=g*c+y*p);case t.TransformMode.OnlyTranslation:l=r+90+s;this.a=t.MathUtils.cosDeg(r+o)*i,this.b=t.MathUtils.cosDeg(l)*a,this.c=t.MathUtils.sinDeg(r+o)*i,this.d=t.MathUtils.sinDeg(l)*a;break;case t.TransformMode.NoRotationOrReflection:var E=0;(A=m*m+g*g)>1e-4?(v=g*(A=Math.abs(m*y-v*g)/A),y=m*A,E=Math.atan2(g,m)*t.MathUtils.radDeg):(m=0,g=0,E=90-Math.atan2(y,v)*t.MathUtils.radDeg);var w=r+o-E,x=r+s-E+90;u=t.MathUtils.cosDeg(w)*i,c=t.MathUtils.cosDeg(x)*a,f=t.MathUtils.sinDeg(w)*i,p=t.MathUtils.sinDeg(x)*a;this.a=m*u-v*f,this.b=m*c-v*p,this.c=g*u+y*f,this.d=g*c+y*p;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,T=t.MathUtils.cosDeg(r),M=t.MathUtils.sinDeg(r),R=m*T+v*M,I=g*T+y*M;(A=Math.sqrt(R*R+I*I))>1e-5&&(A=1/A),R*=A,I*=A,A=Math.sqrt(R*R+I*I);var b=Math.PI/2+Math.atan2(I,R),S=Math.cos(b)*A,C=Math.sin(b)*A;u=t.MathUtils.cosDeg(o)*i,c=t.MathUtils.cosDeg(90+s)*a,f=t.MathUtils.sinDeg(o)*i,p=t.MathUtils.sinDeg(90+s)*a;return(this.data.transformMode!=t.TransformMode.NoScaleOrReflection?m*y-v*g<0:this.skeleton.flipX!=this.skeleton.flipY)&&(S=-S,C=-C),this.a=R*u+S*f,this.b=R*c+S*p,this.c=I*u+C*f,void(this.d=I*c+C*p)}this.skeleton.flipX&&(this.a=-this.a,this.b=-this.b),this.skeleton.flipY&&(this.c=-this.c,this.d=-this.d)},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,r=e.b,i=e.c,a=e.d,o=1/(n*a-r*i),s=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=s*a*o-h*r*o,this.ay=h*n*o-s*i*o;var l=o*a,u=o*n,c=o*r,f=o*i,p=l*this.a-c*this.c,d=l*this.b-c*this.d,m=u*this.c-f*this.a,v=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(p*p+m*m),this.ascaleX>1e-4){var g=p*v-d*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(p*d+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,p)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,i=this.d,a=1/(e*i-n*r),o=t.x-this.worldX,s=t.y-this.worldY;return t.x=o*i*a-s*n*a,t.y=s*e*a-o*r*a,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),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*t.MathUtils.radDeg},e.prototype.localToWorldRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,i=this.c,a=this.d,o=t.MathUtils.cosDeg(e),s=t.MathUtils.sinDeg(e);this.a=o*n-s*i,this.b=o*r-s*a,this.c=s*n+o*i,this.d=s*r+o*a,this.appliedValid=!1},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(t,n,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,t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=t,this.name=n,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(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(t){this.name=t};t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.mix=1,this.bendDirection=0,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.bendDirection=t.bendDirection,this.bones=new Array;for(var n=0;n180?c-=360:c<-180&&(c+=360),e.updateWorldTransformWith(e.ax,e.ay,e.arotation+c*i,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,i,a,o){if(0!=o){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var s=e.ax,h=e.ay,l=e.ascaleX,u=e.ascaleY,c=n.ascaleX,f=0,p=0,d=0;l<0?(l=-l,f=180,d=-1):(f=0,d=1),u<0&&(u=-u,d=-d),c<0?(c=-c,p=180):p=0;var m=n.ax,v=0,g=0,y=0,E=e.a,w=e.b,x=e.c,A=e.d,T=Math.abs(l-u)<=1e-4;T?(g=E*m+w*(v=n.ay)+e.worldX,y=x*m+A*v+e.worldY):(v=0,g=E*m+e.worldX,y=x*m+e.worldY);var M=e.parent;E=M.a,w=M.b,x=M.c;var R=1/(E*(A=M.d)-w*x),I=r-M.worldX,b=i-M.worldY,S=(I*A-b*w)*R-s,C=(b*E-I*x)*R-h,P=((I=g-M.worldX)*A-(b=y-M.worldY)*w)*R-s,N=(b*E-I*x)*R-h,_=Math.sqrt(P*P+N*N),L=n.data.length*c,k=0,V=0;t:if(T){var O=(S*S+C*C-_*_-(L*=l)*L)/(2*_*L);O<-1?O=-1:O>1&&(O=1),V=Math.acos(O)*a,E=_+L*O,w=L*Math.sin(V),k=Math.atan2(C*E-S*w,S*E+C*w)}else{var D=(E=l*L)*E,F=(w=u*L)*w,U=S*S+C*C,X=Math.atan2(C,S),Y=-2*F*_,B=F-D;if((A=Y*Y-4*B*(x=F*_*_+D*U-D*F))>=0){var W=Math.sqrt(A);Y<0&&(W=-W);var j=(W=-(Y+W)/2)/B,G=x/W,q=Math.abs(j)=-1&&x<=1&&(x=Math.acos(x),(A=(I=E*Math.cos(x)+_)*I+(b=w*Math.sin(x))*b)<$&&(z=x,$=A,H=I,Z=b),A>K&&(J=x,K=A,Q=I,tt=b)),U<=($+K)/2?(k=X-Math.atan2(Z*a,H),V=z*a):(k=X-Math.atan2(tt*a,Q),V=J*a)}var et=Math.atan2(v,m)*d,nt=e.arotation;(k=(k-et)*t.MathUtils.radDeg+f-nt)>180?k-=360:k<-180&&(k+=360),e.updateWorldTransformWith(s,h,nt+k*o,e.ascaleX,e.ascaleY,0,0),nt=n.arotation,(V=((V+et)*t.MathUtils.radDeg-n.ashearX)*d+p-nt)>180?V-=360:V<-180&&(V+=360),n.updateWorldTransformWith(m,v,nt+V*o,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t};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,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,r=t.bones.length;n0;if(i>0||a){var o=this.data,s=o.spacingMode,h=s==t.SpacingMode.Length,l=o.rotateMode,u=l==t.RotateMode.Tangent,c=l==t.RotateMode.ChainScale,f=this.bones.length,p=u?f:f+1,d=this.bones,m=t.Utils.setArraySize(this.spaces,p),v=null,g=this.spacing;if(c||h){c&&(v=t.Utils.setArraySize(this.lengths,f));for(var y=0,E=p-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var C=3;yt.MathUtils.PI?U-=t.MathUtils.PI2:U<-t.MathUtils.PI&&(U+=t.MathUtils.PI2),U*=r,X=Math.cos(U),Y=Math.sin(U),P.a=X*V-Y*D,P.b=X*O-Y*F,P.c=Y*V+X*D,P.d=Y*O+X*F}P.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,i,a,o){var s=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*r+2),c=null,f=n.closed,p=n.worldVerticesLength,d=p/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[d-=f?1:2];if(a&&(h*=g),o)for(var y=0;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(s,p-6,4,c,0,2)),this.addAfterPosition(x-g,c,0,u,E);continue}}for(;;w++){var A=v[w];if(!(x>A)){if(0==w)x/=A;else x=(x-($=v[w-1]))/(A-$);break}}w!=m&&(m=w,f&&w==d?(n.computeWorldVertices(s,p-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*w+2,8,c,0,2)),this.addCurvePosition(x,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,E,i||y>0&&0==G)}return u}f?(p+=2,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p-4,c,0,2),n.computeWorldVertices(s,0,2,c,p-4,2),c[p-2]=c[0],c[p-1]=c[1]):(d--,p-=4,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p,c,0,2));for(var T=t.Utils.setArraySize(this.curves,d),M=0,R=c[0],I=c[1],b=0,S=0,C=0,P=0,N=0,_=0,L=0,k=0,V=0,O=0,D=0,F=0,U=0,X=0,Y=(y=0,2);yM){this.addAfterPosition(x-M,c,p-4,u,E);continue}}for(;;w++){var q=T[w];if(!(x>q)){if(0==w)x/=q;else x=(x-($=T[w-1]))/(q-$);break}}if(w!=m){m=w;var z=6*w;for(R=c[z],I=c[z+1],b=c[z+2],S=c[z+3],C=c[z+4],P=c[z+5],D=2*(L=.03*(R-2*b+C))+(V=.006*(3*(b-C)-R+(N=c[z+6]))),F=2*(k=.03*(I-2*S+P))+(O=.006*(3*(S-P)-I+(_=c[z+7]))),U=.3*(b-R)+L+.16666667*V,X=.3*(S-I)+k+.16666667*O,W=Math.sqrt(U*U+X*X),B[0]=W,z=1;z<8;z++)U+=D,X+=F,D+=V,F+=O,W+=Math.sqrt(U*U+X*X),B[z]=W;U+=D,X+=F,W+=Math.sqrt(U*U+X*X),B[8]=W,U+=D+V,X+=F+O,W+=Math.sqrt(U*U+X*X),B[9]=W,j=0}for(x*=W;;j++){var H=B[j];if(!(x>H)){var $;if(0==j)x/=H;else x=j+(x-($=B[j-1]))/(H-$);break}}this.addCurvePosition(.1*x,R,I,b,S,C,P,N,_,u,E,i||y>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,n,r,i){var a=e[n],o=e[n+1],s=e[n+2]-a,h=e[n+3]-o,l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,i){var a=e[n+2],o=e[n+3],s=a-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,i,a,o,s,h,l,u,c){(0==t||isNaN(t))&&(t=1e-4);var f=t*t,p=f*t,d=1-t,m=d*d,v=m*d,g=d*t,y=3*g,E=d*y,w=y*t,x=e*v+r*E+a*w+s*p,A=n*v+i*E+o*w+h*p;l[u]=x,l[u+1]=A,c&&(l[u+2]=Math.atan2(A-(n*m+i*g*2+o*f),x-(e*m+r*g*2+a*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e,n,r,i=function(t){this.order=0,this.bones=new Array,this.name=t};t.PathConstraintData=i,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(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,r){var i=this.clientAssets[t];return null==i&&(i=new e(t),this.clientAssets[t]=i),null!==n&&(i.textureLoader=n),i.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var i=new Image;i.src=n,i.crossOrigin="anonymous",i.onload=function(t){r.rawAssets[n]=i},i.onerror=function(t){r.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||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.flipX=!1,this.flipY=!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 i=n[n.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var n=e.target,r=n.data.index,i=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,i),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(var a=0,o=this.data.skins.length;a-1||this.updateCacheReset.push(i)}else for(r=0;r=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;if(t<=i&&n<=i||e<=a&&r<=a||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(i-t)+e;if(l>a&&la&&li&&ui&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,i=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[a]-u)=u&&E<=p||E>=p&&E<=u)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(l*g-h*m)/y;if((w>=c&&w<=d||w>=d&&w<=c)&&(w>=n&&w<=i||w>=i&&w<=n))return!0}u=p,c=d}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,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var i=r.worldVerticesLength,a=t.Utils.setArraySize(this.clippingPolygon,i);r.computeWorldVertices(n,0,i,a,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=s.length;h>1,U=this.clipOutput,X=t.Utils.setArraySize(u,N+F*d),Y=0;Y<_;Y+=2){var B=U[Y],W=U[Y+1];X[N]=B,X[N+1]=W,X[N+2]=o.r,X[N+3]=o.g,X[N+4]=o.b,X[N+5]=o.a;var j=B-I,G=W-b,q=(L*j+k*G)*D,z=(O*j+V*G)*D,H=1-q-z;X[N+6]=w*q+M*z+S*H,X[N+7]=x*q+R*z+C*H,h&&(X[N+8]=s.r,X[N+9]=s.g,X[N+10]=s.b,X[N+11]=s.a),N+=d}N=c.length;var $=t.Utils.setArraySize(c,N+3*(F-2));F--;for(Y=1;Y=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(i),u.push(a),u.push(t),u.push(e),s.length=0;for(var c=o,f=o.length-4,p=0;;p+=2){for(var d=c[p],m=c[p+1],v=c[p+2],g=c[p+3],y=d-v,E=m-g,w=u,x=u.length-2,A=s.length,T=0;T0;if(y*(R-g)-E*(M-v)>0){if(S){s.push(I),s.push(b);continue}var C=((N=I-M)*(m-R)-(P=b-R)*(d-M))/(P*(v-d)-N*(g-m));s.push(d+(v-d)*C),s.push(m+(g-m)*C)}else if(S){var P,N;C=((N=I-M)*(m-R)-(P=b-R)*(d-M))/(P*(v-d)-N*(g-m));s.push(d+(v-d)*C),s.push(m+(g-m)*C),s.push(I),s.push(b)}l=!0}if(A==s.length)return h.length=0,!0;if(s.push(s[0]),s.push(s[1]),p==f)break;var _=s;(s=u).length=0,u=_}if(h!=s){h.length=0;p=0;for(var L=s.length-2;p>1;s=0;f--)-1==j[f]&&(j[f]=q[--H])}w.setFrame(c++,W.time,j)}a.push(w),o=Math.max(o,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(i||(i={})),function(t){var e,n,r=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=r,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 i=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=i;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(t.Texture);t.FakeTexture=a}(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,a){if(null==a)throw new Error("textureLoader cannot be null.");for(var o=new n(e),s=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 i;u.name=l,u.page=h,u.rotate="true"==o.readValue(),o.readTuple(s);var c=parseInt(s[0]),f=parseInt(s[1]);o.readTuple(s);var p=parseInt(s[0]),d=parseInt(s[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height):(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height),u.x=c,u.y=f,u.width=Math.abs(p),u.height=Math.abs(d),4==o.readTuple(s)&&4==o.readTuple(s)&&o.readTuple(s),u.originalWidth=parseInt(s[0]),u.originalHeight=parseInt(s[1]),o.readTuple(s),u.offsetX=parseInt(s[0]),u.offsetY=parseInt(s[1]),u.index=parseInt(o.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new r).name=l,2==o.readTuple(s)&&(h.width=parseInt(s[0]),h.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),h.minFilter=t.Texture.filterFromString(s[0]),h.magFilter=t.Texture.filterFromString(s[1]);var m=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==m?h.uWrap=t.TextureWrap.Repeat:"y"==m?h.vWrap=t.TextureWrap.Repeat:"xy"==m&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=a(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 r=0,i=n+1;r<3;r++){var a=e.indexOf(",",i);if(-1==a)break;t[r]=e.substr(i,a-i).trim(),i=a+1}return t[r]=e.substring(i).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=i}(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,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 r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var A=Math.cos(b),T=Math.sin(b);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var R=Math.sqrt(v.a*v.a+v.c*v.c),I=Math.sqrt(o*o+h*h);R>1e-5&&(R=(R+(I-R+this.data.offsetScaleX)*r)/R),v.a*=R,v.c*=R,R=Math.sqrt(v.b*v.b+v.d*v.d),I=Math.sqrt(s*s+l*l),R>1e-5&&(R=(R+(I-R+this.data.offsetScaleY)*r)/R),v.b*=R,v.d*=R,g=!0}if(i>0){E=v.b,x=v.d;var b,S=Math.atan2(x,E);(b=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b=S+(b+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(b)*R,v.d=Math.sin(b)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,i=this.shearMix,a=this.target,o=a.a,s=a.b,h=a.c,l=a.d,u=o*l-s*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I*=e;var A=Math.cos(I),T=Math.sin(I);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var R=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*r+1;v.a*=R,v.c*=R,R=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,v.b*=R,v.d*=R,g=!0}if(i>0){var I;(I=Math.atan2(l,s)-Math.atan2(h,o))>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2);E=v.b,x=v.d;I=Math.atan2(x,E)+(I-t.MathUtils.PI/2+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(I)*R,v.d=Math.sin(I)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,o=0,s=a.length;o0&&(p>1e-5&&(p=(p+(i.ascaleX-p+this.data.offsetScaleX)*n)/p),d>1e-5&&(d=(d+(i.ascaleY-d+this.data.offsetScaleY)*n)/d));var m=h.ashearY;if(r>0){u=i.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*r}h.updateWorldTransformWith(c,f,l,p,d,h.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,o=0,s=a.length;o0&&(f>1e-5&&(f*=(i.ascaleX-1+this.data.offsetScaleX)*n+1),p>1e-5&&(p*=(i.ascaleY-1+this.data.offsetScaleY)*n+1));var d=h.ashearY;r>0&&(d+=(i.ashearY+this.data.offsetShearY)*r),h.updateWorldTransformWith(u,c,l,f,p,h.ashearX,d)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name cannot be null.");this.name=t};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,r=t.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a3;){for(var l=r-1,u=(a=0,1);;){t:if(!o[a]){for(var c=i[l]<<1,f=i[a]<<1,p=i[u]<<1,d=n[c],m=n[c+1],v=n[f],g=n[f+1],y=n[p],E=n[p+1],w=(u+1)%r;w!=l;w=(w+1)%r)if(o[w]){var x=i[w]<<1,A=n[x],T=n[x+1];if(e.positiveArea(y,E,d,m,A,T)&&e.positiveArea(d,m,v,g,A,T)&&e.positiveArea(v,g,y,E,A,T))break t}break}if(0==u){do{if(!o[a])break;a--}while(a>0);break}l=a,a=u,u=(u+1)%r}h.push(i[(r+a-1)%r]),h.push(i[a]),h.push(i[(a+1)%r]),i.splice(a,1),o.splice(a,1);var M=(--r+a-1)%r,R=a==r?0:a;o[M]=e.isConcave(M,r,n,i),o[R]=e.isConcave(R,r,n,i)}return 3==r&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},e.prototype.decompose=function(t,n){var r=t,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;var a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(i.push(s),a.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(v),s.push(g),s.push(y),s.push(E),s.push(w),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(p),o.push(d),l=e.winding(m,v,g,y,E,w),h=f)}s.length>0&&(i.push(s),a.push(o));for(u=0,c=i.length;u=0;u--)0==(s=i[u]).length&&(i.splice(u,1),this.polygonPool.free(s),o=a[u],a.splice(u,1),this.polygonIndicesPool.free(o));return i},e.isConcave=function(t,e,n,r){var i=r[(e+t-1)%e]<<1,a=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,r,i,a){return t*(a-r)+n*(e-a)+i*(r-e)>=0},e.winding=function(t,e,n,r,i,a){var o=n-t,s=r-e;return i*s-a*o+o*e-t*s>=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 null!=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,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,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,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,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.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 r=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 r=Math.random(),i=e-t;return r<=(n-t)/i?t+Math.sqrt(r*i*(n-t)):e-Math.sqrt((1-r)*i*(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=r;var i=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=i;var a=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return o(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}(i);t.Pow=a;var s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=s;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,r,i){for(var a=e,o=r;a=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?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 p=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)*a;var o=t.bone.skeleton,s=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=s);for(var w,x=(w=t.bone).worldX,A=w.worldY,T=w.a,M=w.b,R=w.c,I=w.d,b=e,S=i;S)?=?)"),p("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),p("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),p("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),p("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),p("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),p("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),p("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),p("COERCERTL",h[l.COERCE],!0),p("COERCERTLFULL",h[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",p("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),p("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("LONECARET","(?:\\^)"),p("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",p("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),p("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),p("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),p("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),p("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(N,N.exports);var _=N.exports;I(_);var L=Object.freeze({loose:!0}),k=Object.freeze({}),V=function(t){return t?"object"!==s(t)?L:t:k};I(V);var O=/^[0-9]+$/,D=function(t,e){var n=O.test(t),r=O.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tX)throw new TypeError("version is longer than ".concat(X," characters"));U("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?B[W.LOOSE]:B[W.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Y||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Y||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Y||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var a=[e,r];!1===n&&(a=[e]),0===G(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),z=q;I(z);var H=z,$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof H)return t;try{return new H(t,e)}catch(t){if(!n)return null;throw t}};I($);var Z=$,J=I((function(t,e){var n=Z(t,e);return n?n.version:null})),Q=z,K=$,tt=_.safeRe,et=_.t,nt=I((function(t,e){if(t instanceof Q)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r,i=e.includePrerelease?tt[et.COERCERTLFULL]:tt[et.COERCERTL];(r=i.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),i.lastIndex=r.index+r[1].length+r[2].length;i.lastIndex=-1}else n=t.match(e.includePrerelease?tt[et.COERCEFULL]:tt[et.COERCE]);if(null===n)return null;var a=n[2],o=n[3]||"0",s=n[4]||"0",h=e.includePrerelease&&n[5]?"-".concat(n[5]):"",l=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return K("".concat(a,".").concat(o,".").concat(s).concat(h).concat(l),e)})),rt=u((function t(){h(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);I(rt);var it=z,at=function(t,e,n){return new it(t,n).compare(new it(e,n))};I(at);var ot=at,st=function(t,e,n){return 0===ot(t,e,n)};I(st);var ht=at,lt=function(t,e,n){return 0!==ht(t,e,n)};I(lt);var ut=at,ct=function(t,e,n){return ut(t,e,n)>0};I(ct);var ft=at,pt=function(t,e,n){return ft(t,e,n)>=0};I(pt);var dt=at,mt=function(t,e,n){return dt(t,e,n)<0};I(mt);var vt=at,gt=function(t,e,n){return vt(t,e,n)<=0};I(gt);var yt,Et,wt,xt,At=st,Tt=lt,Mt=ct,Rt=pt,It=mt,bt=gt,St=function(t,e,n,r){switch(e){case"===":return"object"===s(t)&&(t=t.version),"object"===s(n)&&(n=n.version),t===n;case"!==":return"object"===s(t)&&(t=t.version),"object"===s(n)&&(n=n.version),t!==n;case"":case"=":case"==":return At(t,n,r);case"!=":return Tt(t,n,r);case">":return Mt(t,n,r);case">=":return Rt(t,n,r);case"<":return It(t,n,r);case"<=":return bt(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Ct(){if(xt)return wt;xt=1;var t=function(){function t(e,i){var a=this;if(h(this,t),i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return a.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,l=x(this.set);try{for(l.s();!(s=l.n()).done;){var u=s.value;if(1===u.length&&v(u[0])){this.set=[u];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return u(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,a=((this.options.includePrerelease&&p)|(this.options.loose&&d))+":"+t,h=e.get(a);if(h)return h;var u=this.options.loose,v=u?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(v,L(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],l),i("comparator trim",t),t=t.replace(o[s.TILDETRIM],c),i("tilde trim",t),t=t.replace(o[s.CARETTRIM],f),i("caret trim",t);var g=t.split(" ").map((function(t){return E(t,n.options)})).join(" ").split(/\s+/).map((function(t){return N(t,n.options)}));u&&(g=g.filter((function(t){return i("loose invalid filter",t,n.options),!!t.match(o[s.COMPARATORLOOSE])}))),i("range list",g);var w,A=new Map,T=g.map((function(t){return new r(t,n.options)})),M=x(T);try{for(M.s();!(w=M.n()).done;){var R=w.value;if(m(R))return[R];A.set(R.value,R)}}catch(t){M.e(t)}finally{M.f()}A.size>1&&A.has("")&&A.delete("");var I=y(A.values());return e.set(a,I),I}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new a(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(a(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(a(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();yt=e;var n=V,r=_.safeRe,i=_.t,a=St,o=P,s=z,l=Ct();return yt}(),i=P,a=z,o=_.safeRe,s=_.t,l=_.comparatorTrimReplace,c=_.tildeTrimReplace,f=_.caretTrimReplace,p=b.FLAG_INCLUDE_PRERELEASE,d=b.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),i=r.pop();n&&r.length;)n=r.every((function(t){return i.intersects(t,e)})),i=r.pop();return n},E=function(t,e){return i("comp",t,e),t=M(t,e),i("caret",t),t=A(t,e),i("tildes",t),t=I(t,e),i("xrange",t),t=C(t,e),i("stars",t),t},w=function(t){return!t||"x"===t.toLowerCase()||"*"===t},A=function(t,e){return t.trim().split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){var n=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(n,(function(e,n,r,a,o){var s;return i("tilde",t,e,n,r,a,o),w(n)?s="":w(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):w(a)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(i("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(a,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(a," <").concat(n,".").concat(+r+1,".0-0"),i("tilde return",s),s}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){i("caret",t,e);var n=e.loose?o[s.CARETLOOSE]:o[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,a,o,s){var h;return i("caret",t,e,n,a,o,s),w(n)?h="":w(a)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):w(o)?h="0"===n?">=".concat(n,".").concat(a,".0").concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(i("replaceCaret pr",s),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(i("no pr"),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o," <").concat(+n+1,".0.0-0")),i("caret return",h),h}))},I=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return S(t,e)})).join(" ")},S=function(t,e){t=t.trim();var n=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(n,(function(n,r,a,o,s,h){i("xRange",t,n,r,a,o,s,h);var l=w(a),u=l||w(o),c=u||w(s),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(a=+a+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?a=+a+1:o=+o+1),"<"===r&&(h="-0"),n="".concat(r+a,".").concat(o,".").concat(s).concat(h)):u?n=">=".concat(a,".0.0").concat(h," <").concat(+a+1,".0.0-0"):c&&(n=">=".concat(a,".").concat(o,".0").concat(h," <").concat(a,".").concat(+o+1,".0-0")),i("xRange return",n),n}))},C=function(t,e){return i("replaceStars",t,e),t.trim().replace(o[s.STAR],"")},N=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?s.GTE0PRE:s.GTE0],"")},L=function(t){return function(e,n,r,i,a,o,s,h,l,u,c,f){return n=w(r)?"":w(i)?">=".concat(r,".0.0").concat(t?"-0":""):w(a)?">=".concat(r,".").concat(i,".0").concat(t?"-0":""):o?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=w(l)?"":w(u)?"<".concat(+l+1,".0.0-0"):w(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},k=function(t,e,n){for(var a=0;a0){var s=t[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0};return wt}I(St);var Pt=Ct(),Nt=function(t,e,n){try{e=new Pt(e,n)}catch(t){return!1}return e.test(t)},_t={valid:J,coerce:nt,satisfies:I(Nt),SEMVER_SPEC_VERSION:S.SEMVER_SPEC_VERSION},Lt=0,kt=1,Vt=2,Ot=[0,1,2,2,3,0],Dt=u((function t(e,n,r,o){var s;if(h(this,t),c(this,"autoUpdate",!0),c(this,"skeleton",void 0),c(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===i.TextureAtlas.length){var l,u=x((s=new i.TextureAtlas(n)).pages);try{for(u.s();!(l=u.n()).done;){var f=l.value;f.setTexture(new R(o[f.name]))}}catch(t){u.e(t)}finally{u.f()}}else s=new i.TextureAtlas(n,(function(t){return new R(o[t])}));var p=new i.SkeletonJson(new i.AtlasAttachmentLoader(s));p.scale*=.01;var d=p.readSkeletonData(r);this.skeletonVersion=_t.valid(_t.coerce(d.version)),this._spine_3_6_0=_t.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=_t.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=_t.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=_t.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new i.Skeleton(d),this.skeleton.updateWorldTransform(),this.stateData=new i.AnimationStateData(this.skeleton.data),this.states=[new i.AnimationState(this.stateData)],this.clipper=new i.SkeletonClipping,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=o,n=0),t=c.material;var f=c.positions,p=c.vertexColor.r,d=c.vertexColor.g,m=c.vertexColor.b,v=c.vertexColor.a,g=c.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,i=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.duration=n}return t.prototype.apply=function(t,e,n,r,i,a,o,s){if(null==t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(a+1)*n]<=e?r=a+1:i=a,r==i)return(r+1)*n;a=r+i>>>1}},t.linearSearch=function(t,e,n){for(var r=0,i=t.length-n;r<=i;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=i,function(t){t[t.setup=0]="setup",t[t.current=1]="current",t[t.currentLayered=2]="currentLayered"}(e=t.MixPose||(t.MixPose={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(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"}(r=t.TimelineType||(t.TimelineType={}));var a=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 r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,i,a){var o=.03*(2*-n+i),s=.03*(2*-r+a),h=.006*(3*(n-i)+1),l=.006*(3*(r-a)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,p=.3*r+s+.16666667*l,d=t*e.BEZIER_SIZE,m=this.curves;m[d++]=e.BEZIER;for(var v=f,g=p,y=d+e.BEZIER_SIZE-1;d=r){var u=void 0,c=void 0;return a==h?(u=0,c=0):(u=i[a-2],c=i[a-1]),c+(i[a+1]-c)*(r-u)/(s-u)}var f=i[a-1];return f+(1-f)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var s=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])if(h==e.setup)c.rotation=c.data.rotation+u[u.length+a.PREV_ROTATION]*s;else{var p=c.data.rotation+u[u.length+a.PREV_ROTATION]-c.rotation;p-=360*(16384-(16384.499999999996-p/360|0)),c.rotation+=p*s}else{var d=i.binarySearch(u,r,a.ENTRIES),m=u[d+a.PREV_ROTATION],v=u[d],g=this.getCurvePercent((d>>1)-1,1-(r-v)/(u[d+a.PREV_TIME]-v)),y=u[d+a.ROTATION]-m;y=m+(y-=360*(16384-(16384.499999999996-y/360|0)))*g,h==e.setup?(y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation=c.data.rotation+y*s):(y=c.data.rotation+y-c.rotation,y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation+=y*s)}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=s;var h=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=n,this.frames[t+a.Y]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],p=u[u.length+a.PREV_Y];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_X],p=u[d+a.PREV_Y];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.X]-f)*v,p+=(u[d+a.Y]-p)*v}h==e.setup?(c.x=c.data.x+f*s,c.y=c.data.y+p*s):(c.x+=(c.data.x+f-c.x)*s,c.y+=(c.data.y+p-c.y)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function s(t){return a.call(this,t)||this}return o(s,a),s.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},s.prototype.apply=function(r,a,o,h,l,u,c){var f=this.frames,p=r.bones[this.boneIndex];if(o=f[f.length-s.ENTRIES])d=f[f.length+s.PREV_X]*p.data.scaleX,m=f[f.length+s.PREV_Y]*p.data.scaleY;else{var v=i.binarySearch(f,o,s.ENTRIES);d=f[v+s.PREV_X],m=f[v+s.PREV_Y];var g=f[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(o-g)/(f[v+s.PREV_TIME]-g));d=(d+(f[v+s.X]-d)*y)*p.data.scaleX,m=(m+(f[v+s.Y]-m)*y)*p.data.scaleY}if(1==l)p.scaleX=d,p.scaleY=m;else{var E=0,w=0;u==e.setup?(E=p.data.scaleX,w=p.data.scaleY):(E=p.scaleX,w=p.scaleY),c==n.out?(d=Math.abs(d)*t.MathUtils.signum(E),m=Math.abs(m)*t.MathUtils.signum(w)):(E=Math.abs(E)*t.MathUtils.signum(d),w=Math.abs(w)*t.MathUtils.signum(m)),p.scaleX=E+(d-E)*l,p.scaleY=w+(m-w)*l}}},s}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],p=u[u.length+n.PREV_Y];else{var d=i.binarySearch(u,a,n.ENTRIES);f=u[d+n.PREV_X],p=u[d+n.PREV_Y];var m=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(a-m)/(u[d+n.PREV_TIME]-m));f+=(u[d+n.X]-f)*v,p+=(u[d+n.Y]-p)*v}h==e.setup?(c.shearX=c.data.shearX+f*s,c.shearY=c.data.shearY+p*s):(c.shearX+=(c.data.shearX+f-c.shearX)*s,c.shearY+=(c.data.shearY+p-c.shearY)*s)}},n}(h);t.ShearTimeline=u;var c=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var y=c.length;d=c[y+a.PREV_R],m=c[y+a.PREV_G],v=c[y+a.PREV_B],g=c[y+a.PREV_A]}else{var E=i.binarySearch(c,r,a.ENTRIES);d=c[E+a.PREV_R],m=c[E+a.PREV_G],v=c[E+a.PREV_B],g=c[E+a.PREV_A];var w=c[E],x=this.getCurvePercent(E/a.ENTRIES-1,1-(r-w)/(c[E+a.PREV_TIME]-w));d+=(c[E+a.R]-d)*x,m+=(c[E+a.G]-m)*x,v+=(c[E+a.B]-v)*x,g+=(c[E+a.A]-g)*x}if(1==s)u.color.set(d,m,v,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((d-f.r)*s,(m-f.g)*s,(v-f.b)*s,(g-f.a)*s)}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var f=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o,s,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o,this.frames[t+a.R2]=s,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var T=c.length;v=c[T+a.PREV_R],g=c[T+a.PREV_G],y=c[T+a.PREV_B],E=c[T+a.PREV_A],w=c[T+a.PREV_R2],x=c[T+a.PREV_G2],A=c[T+a.PREV_B2]}else{var M=i.binarySearch(c,r,a.ENTRIES);v=c[M+a.PREV_R],g=c[M+a.PREV_G],y=c[M+a.PREV_B],E=c[M+a.PREV_A],w=c[M+a.PREV_R2],x=c[M+a.PREV_G2],A=c[M+a.PREV_B2];var R=c[M],I=this.getCurvePercent(M/a.ENTRIES-1,1-(r-R)/(c[M+a.PREV_TIME]-R));v+=(c[M+a.R]-v)*I,g+=(c[M+a.G]-g)*I,y+=(c[M+a.B]-y)*I,E+=(c[M+a.A]-E)*I,w+=(c[M+a.R2]-w)*I,x+=(c[M+a.G2]-x)*I,A+=(c[M+a.B2]-A)*I}if(1==s)u.color.set(v,g,y,E),u.darkColor.set(w,x,A,1);else{f=u.color,p=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),p.setFromColor(u.data.darkColor)),f.add((v-f.r)*s,(g-f.g)*s,(y-f.b)*s,(E-f.a)*s),p.add((w-p.r)*s,(x-p.g)*s,(A-p.b)*s,0)}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=f;var p=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return a.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},a.prototype.apply=function(t,r,a,o,s,h,l){var u=t.slots[this.slotIndex];if(l!=n.out||h!=e.setup){var c=this.frames;if(a=c[c.length-1]?c.length-1:i.binarySearch(c,a,1)-1;var d=this.attachmentNames[p];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var m=u.data.attachmentName;u.setAttachment(null==m?null:t.getAttachment(this.slotIndex,m))}},a}();t.AttachmentTimeline=p;var d=null,m=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==d&&(d=t.Utils.newFloatArray(64)),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},a.prototype.apply=function(n,r,a,o,s,h,l){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(s=1);var p=this.frameVertices,d=p[0].length,m=this.frames;if(a=m[m.length-1]){var x=p[m.length-1];if(1==s)t.Utils.arrayCopy(x,0,w,0,d);else if(h==e.setup){if(null==(v=c).bones)for(var A=v.vertices,T=0;Tn)this.apply(t,e,Number.MAX_VALUE,r,a,o,s),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=v;var g=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return a.prototype.getPropertyId=function(){return r.drawOrder<<24},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},a.prototype.apply=function(r,a,o,s,h,l,u){var c=r.drawOrder,f=r.slots;if(u!=n.out||l!=e.setup){var p=this.frames;if(o=p[p.length-1]?p.length-1:i.binarySearch(p,o)-1;var m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var v=0,g=m.length;v=c[c.length-s.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+s.PREV_MIX]-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[c.length+s.PREV_BEND_DIRECTION]):(f.mix+=(c[c.length+s.PREV_MIX]-f.mix)*h,u==n.in&&(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION]));else{var p=i.binarySearch(c,a,s.ENTRIES),d=c[p+s.PREV_MIX],m=c[p],v=this.getCurvePercent(p/s.ENTRIES-1,1-(a-m)/(c[p+s.PREV_TIME]-m));l==e.setup?(f.mix=f.data.mix+(d+(c[p+s.MIX]-d)*v-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[p+s.PREV_BEND_DIRECTION]):(f.mix+=(d+(c[p+s.MIX]-d)*v-f.mix)*h,u==n.in&&(f.bendDirection=c[p+s.PREV_BEND_DIRECTION]))}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_MIX=-2,s.PREV_BEND_DIRECTION=-1,s.MIX=1,s.BEND_DIRECTION=2,s}(a);t.IkConstraintTimeline=y;var E=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r,this.frames[t+a.SCALE]=i,this.frames[t+a.SHEAR]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(r=u[u.length-a.ENTRIES]){var g=u.length;p=u[g+a.PREV_ROTATE],d=u[g+a.PREV_TRANSLATE],m=u[g+a.PREV_SCALE],v=u[g+a.PREV_SHEAR]}else{var y=i.binarySearch(u,r,a.ENTRIES);p=u[y+a.PREV_ROTATE],d=u[y+a.PREV_TRANSLATE],m=u[y+a.PREV_SCALE],v=u[y+a.PREV_SHEAR];var E=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(r-E)/(u[y+a.PREV_TIME]-E));p+=(u[y+a.ROTATE]-p)*w,d+=(u[y+a.TRANSLATE]-d)*w,m+=(u[y+a.SCALE]-m)*w,v+=(u[y+a.SHEAR]-v)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(p-f.rotateMix)*s,c.translateMix=f.translateMix+(d-f.translateMix)*s,c.scaleMix=f.scaleMix+(m-f.scaleMix)*s,c.shearMix=f.shearMix+(v-f.shearMix)*s}else c.rotateMix+=(p-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(v-c.shearMix)*s}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=E;var w=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var p=i.binarySearch(u,r,a.ENTRIES);f=u[p+a.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/a.ENTRIES-1,1-(r-d)/(u[p+a.PREV_TIME]-d));f+=(u[p+a.VALUE]-f)*m}h==e.setup?c.position=c.data.position+(f-c.data.position)*s:c.position+=(f-c.position)*s}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var x=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var p=i.binarySearch(u,a,n.ENTRIES);f=u[p+n.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/n.ENTRIES-1,1-(a-d)/(u[p+n.PREV_TIME]-d));f+=(u[p+n.VALUE]-f)*m}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*s:c.spacing+=(f-c.spacing)*s}},n}(w);t.PathConstraintSpacingTimeline=x;var A=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],p=u[u.length+a.PREV_TRANSLATE];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_ROTATE],p=u[d+a.PREV_TRANSLATE];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.ROTATE]-f)*v,p+=(u[d+a.TRANSLATE]-p)*v}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(p-c.data.translateMix)*s):(c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(p-c.translateMix)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=A}(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 i(this),this.propertyIDs=new t.IntSet,this.mixingTo=new Array,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,r=e.length;n0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}var o=i.next;if(null!=o){var s=i.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime=s+t*o.timeScale,i.trackTime+=a,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=a,o=o.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&null==i.mixingFrom){e[n]=null,this.queue.end(i),this.disposeNext(i);continue}if(null!=i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null;null!=h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&(t.mixTime>=t.mixDuration||0==t.timeScale)?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e*t.timeScale,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,i=this.tracks,a=!1,o=0,s=i.length;o0)){a=!0;var l=0==o?t.MixPose.current:t.MixPose.currentLayered,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(),p=h.animation.timelines.length,d=h.animation.timelines;if(1==u)for(var m=0;m=e.FIRST?t.MixPose.setup:l;E instanceof t.RotateTimeline?this.applyRotateTimeline(E,n,f,u,w,y,m<<1,g):(t.Utils.webkit602BugfixHelper(u,w),E.apply(n,c,f,r,u,w,t.MixDirection.in))}}this.queueEvents(h,f),r.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}return this.queue.drain(),a},e.prototype.applyMixingFrom=function(n,r,i){var a=n.mixingFrom;null!=a.mixingFrom&&this.applyMixingFrom(a,r,i);var o=0;0==n.mixDuration?(o=1,i=t.MixPose.setup):(o=n.mixTime/n.mixDuration)>1&&(o=1);var s=o0&&this.queueEvents(a,c),this.events.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,r,i,a,o,s,h){if(h&&(o[s]=0),1!=i){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(r=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),d=u[p+t.RotateTimeline.PREV_ROTATION],m=u[p],v=l.getCurvePercent((p>>1)-1,1-(r-m)/(u[p+t.RotateTimeline.PREV_TIME]-m));f=u[p+t.RotateTimeline.ROTATION]-d,f=d+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var g=a==t.MixPose.setup?c.data.rotation:c.rotation,y=0,E=f-g;if(0==E)y=o[s];else{E-=360*(16384-(16384.499999999996-E/360|0));var w=0,x=0;h?(w=0,x=E):(w=o[s],x=o[s+1]);var A=E>0,T=w>=0;t.MathUtils.signum(x)!=t.MathUtils.signum(E)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=A),y=E+w-w%360,T!=A&&(y+=360*t.MathUtils.signum(w)),o[s]=y}o[s+1]=E,g+=y*i,c.rotation=g-360*(16384-(16384.499999999996-g/360|0))}}else e.apply(n,0,r,null,1,a,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,i=r-n,a=t.trackLast%i,o=this.events,s=0,h=o.length;sr||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=r&&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 r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,i=this.expandToIndex(t);null!=i&&(-1==i.nextTrackLast?(this.tracks[t]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.disposeNext(i),i=i.mixingFrom,r=!1):this.disposeNext(i));var a=this.trackEntry(t,e,n,i);return this.setCurrent(t,a,r),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,r){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(null!=i)for(;null!=i.next;)i=i.next;var a=this.trackEntry(t,e,n,i);if(null==i)this.setCurrent(t,a,!0),this.queue.drain();else if(i.next=a,r<=0){var o=i.animationEnd-i.animationStart;0!=o?(i.loop?r+=o*(1+(i.trackTime/o|0)):r+=o,r-=this.data.getMix(i.animation,e)):r=0}return a.delay=r,a},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var i=this.addAnimationWith(t,e.emptyAnimation,!1,r);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n=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.DIP=2,e.DIP_MIX=3,e}();t.AnimationState=e;var n=function(){function n(){this.timelineData=new Array,this.timelineDipMix=new Array,this.timelinesRotation=new Array}return n.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.animation=null,this.listener=null,this.timelineData.length=0,this.timelineDipMix.length=0,this.timelinesRotation.length=0},n.prototype.setTimelineData=function(n,r,i){null!=n&&r.push(n);var a=null!=this.mixingFrom?this.mixingFrom.setTimelineData(this,r,i):this;null!=n&&r.pop();var o=r,s=r.length-1,h=this.animation.timelines,l=this.animation.timelines.length,u=t.Utils.setArraySize(this.timelineData,l);this.timelineDipMix.length=0;var c=t.Utils.setArraySize(this.timelineDipMix,l);t:for(var f=0;f=0;d--){var m=o[d];if(!m.hasTimeline(p)&&m.mixDuration>0){u[f]=e.DIP_MIX,c[f]=m;continue t}}u[f]=e.DIP}else u[f]=e.FIRST;else u[f]=e.SUBSEQUENT}return a},n.prototype.hasTimeline=function(t){for(var e=this.animation.timelines,n=0,r=e.length;n=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n}();t.TrackEntry=n;var r,i=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.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 s={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 a.errors[n]="Couldn't load texture atlas "+n+": "+l.message,i&&i(n,"Couldn't load texture atlas "+n+": "+l.message),a.toLoad--,void a.loaded++}for(var u=function(l){var u=!1;a.loadTexture(l,(function(l,c){if(s.count++,s.count==h.length)if(u)a.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+l+" of atlas "+n),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(e,(function(t){return a.get(o+"/"+t)}));a.assets[n]=f,r&&r(n,f),a.toLoad--,a.loaded++}catch(t){var p=t;a.errors[n]="Couldn't load texture atlas "+n+": "+p.message,i&&i(n,"Couldn't load texture atlas "+n+": "+p.message),a.toLoad--,a.loaded++}}),(function(t,e){u=!0,s.count++,s.count==h.length&&(a.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+t+" of atlas "+n),a.toLoad--,a.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,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");i.renderObject=i;var a=new t.RegionAttachment(n);return a.setRegion(i),a},e.prototype.newMeshAttachment=function(e,n,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");i.renderObject=i;var a=new t.MeshAttachment(n);return a.region=i,a},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){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(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,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.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,r,i,a,o,s){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var h=this.parent;if(null==h){var l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a,d=this.skeleton;return d.flipX&&(e=-e,u=-u,c=-c),d.flipY&&(n=-n,f=-f,p=-p),this.a=u,this.b=c,this.c=f,this.d=p,this.worldX=e+d.x,void(this.worldY=n+d.y)}var m=h.a,v=h.b,g=h.c,y=h.d;switch(this.worldX=m*e+v*n+h.worldX,this.worldY=g*e+y*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a;return this.a=m*u+v*f,this.b=m*c+v*p,this.c=g*u+y*f,void(this.d=g*c+y*p);case t.TransformMode.OnlyTranslation:l=r+90+s;this.a=t.MathUtils.cosDeg(r+o)*i,this.b=t.MathUtils.cosDeg(l)*a,this.c=t.MathUtils.sinDeg(r+o)*i,this.d=t.MathUtils.sinDeg(l)*a;break;case t.TransformMode.NoRotationOrReflection:var E=0;(A=m*m+g*g)>1e-4?(v=g*(A=Math.abs(m*y-v*g)/A),y=m*A,E=Math.atan2(g,m)*t.MathUtils.radDeg):(m=0,g=0,E=90-Math.atan2(y,v)*t.MathUtils.radDeg);var w=r+o-E,x=r+s-E+90;u=t.MathUtils.cosDeg(w)*i,c=t.MathUtils.cosDeg(x)*a,f=t.MathUtils.sinDeg(w)*i,p=t.MathUtils.sinDeg(x)*a;this.a=m*u-v*f,this.b=m*c-v*p,this.c=g*u+y*f,this.d=g*c+y*p;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,T=t.MathUtils.cosDeg(r),M=t.MathUtils.sinDeg(r),R=m*T+v*M,I=g*T+y*M;(A=Math.sqrt(R*R+I*I))>1e-5&&(A=1/A),R*=A,I*=A,A=Math.sqrt(R*R+I*I);var b=Math.PI/2+Math.atan2(I,R),S=Math.cos(b)*A,C=Math.sin(b)*A;u=t.MathUtils.cosDeg(o)*i,c=t.MathUtils.cosDeg(90+s)*a,f=t.MathUtils.sinDeg(o)*i,p=t.MathUtils.sinDeg(90+s)*a;return(this.data.transformMode!=t.TransformMode.NoScaleOrReflection?m*y-v*g<0:this.skeleton.flipX!=this.skeleton.flipY)&&(S=-S,C=-C),this.a=R*u+S*f,this.b=R*c+S*p,this.c=I*u+C*f,void(this.d=I*c+C*p)}this.skeleton.flipX&&(this.a=-this.a,this.b=-this.b),this.skeleton.flipY&&(this.c=-this.c,this.d=-this.d)},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,r=e.b,i=e.c,a=e.d,o=1/(n*a-r*i),s=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=s*a*o-h*r*o,this.ay=h*n*o-s*i*o;var l=o*a,u=o*n,c=o*r,f=o*i,p=l*this.a-c*this.c,d=l*this.b-c*this.d,m=u*this.c-f*this.a,v=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(p*p+m*m),this.ascaleX>1e-4){var g=p*v-d*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(p*d+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,p)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,i=this.d,a=1/(e*i-n*r),o=t.x-this.worldX,s=t.y-this.worldY;return t.x=o*i*a-s*n*a,t.y=s*e*a-o*r*a,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),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*t.MathUtils.radDeg},e.prototype.localToWorldRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,i=this.c,a=this.d,o=t.MathUtils.cosDeg(e),s=t.MathUtils.sinDeg(e);this.a=o*n-s*i,this.b=o*r-s*a,this.c=s*n+o*i,this.d=s*r+o*a,this.appliedValid=!1},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(t,n,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,t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=t,this.name=n,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(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(t){this.name=t};t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.mix=1,this.bendDirection=0,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.bendDirection=t.bendDirection,this.bones=new Array;for(var n=0;n180?c-=360:c<-180&&(c+=360),e.updateWorldTransformWith(e.ax,e.ay,e.arotation+c*i,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,i,a,o){if(0!=o){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var s=e.ax,h=e.ay,l=e.ascaleX,u=e.ascaleY,c=n.ascaleX,f=0,p=0,d=0;l<0?(l=-l,f=180,d=-1):(f=0,d=1),u<0&&(u=-u,d=-d),c<0?(c=-c,p=180):p=0;var m=n.ax,v=0,g=0,y=0,E=e.a,w=e.b,x=e.c,A=e.d,T=Math.abs(l-u)<=1e-4;T?(g=E*m+w*(v=n.ay)+e.worldX,y=x*m+A*v+e.worldY):(v=0,g=E*m+e.worldX,y=x*m+e.worldY);var M=e.parent;E=M.a,w=M.b,x=M.c;var R=1/(E*(A=M.d)-w*x),I=r-M.worldX,b=i-M.worldY,S=(I*A-b*w)*R-s,C=(b*E-I*x)*R-h,P=((I=g-M.worldX)*A-(b=y-M.worldY)*w)*R-s,N=(b*E-I*x)*R-h,_=Math.sqrt(P*P+N*N),L=n.data.length*c,k=0,V=0;t:if(T){var O=(S*S+C*C-_*_-(L*=l)*L)/(2*_*L);O<-1?O=-1:O>1&&(O=1),V=Math.acos(O)*a,E=_+L*O,w=L*Math.sin(V),k=Math.atan2(C*E-S*w,S*E+C*w)}else{var D=(E=l*L)*E,F=(w=u*L)*w,U=S*S+C*C,X=Math.atan2(C,S),Y=-2*F*_,B=F-D;if((A=Y*Y-4*B*(x=F*_*_+D*U-D*F))>=0){var W=Math.sqrt(A);Y<0&&(W=-W);var j=(W=-(Y+W)/2)/B,G=x/W,q=Math.abs(j)=-1&&x<=1&&(x=Math.acos(x),(A=(I=E*Math.cos(x)+_)*I+(b=w*Math.sin(x))*b)<$&&(z=x,$=A,H=I,Z=b),A>K&&(J=x,K=A,Q=I,tt=b)),U<=($+K)/2?(k=X-Math.atan2(Z*a,H),V=z*a):(k=X-Math.atan2(tt*a,Q),V=J*a)}var et=Math.atan2(v,m)*d,nt=e.arotation;(k=(k-et)*t.MathUtils.radDeg+f-nt)>180?k-=360:k<-180&&(k+=360),e.updateWorldTransformWith(s,h,nt+k*o,e.ascaleX,e.ascaleY,0,0),nt=n.arotation,(V=((V+et)*t.MathUtils.radDeg-n.ashearX)*d+p-nt)>180?V-=360:V<-180&&(V+=360),n.updateWorldTransformWith(m,v,nt+V*o,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t};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,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,r=t.bones.length;n0;if(i>0||a){var o=this.data,s=o.spacingMode,h=s==t.SpacingMode.Length,l=o.rotateMode,u=l==t.RotateMode.Tangent,c=l==t.RotateMode.ChainScale,f=this.bones.length,p=u?f:f+1,d=this.bones,m=t.Utils.setArraySize(this.spaces,p),v=null,g=this.spacing;if(c||h){c&&(v=t.Utils.setArraySize(this.lengths,f));for(var y=0,E=p-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var C=3;yt.MathUtils.PI?U-=t.MathUtils.PI2:U<-t.MathUtils.PI&&(U+=t.MathUtils.PI2),U*=r,X=Math.cos(U),Y=Math.sin(U),P.a=X*V-Y*D,P.b=X*O-Y*F,P.c=Y*V+X*D,P.d=Y*O+X*F}P.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,i,a,o){var s=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*r+2),c=null,f=n.closed,p=n.worldVerticesLength,d=p/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[d-=f?1:2];if(a&&(h*=g),o)for(var y=0;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(s,p-6,4,c,0,2)),this.addAfterPosition(x-g,c,0,u,E);continue}}for(;;w++){var A=v[w];if(!(x>A)){if(0==w)x/=A;else x=(x-($=v[w-1]))/(A-$);break}}w!=m&&(m=w,f&&w==d?(n.computeWorldVertices(s,p-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*w+2,8,c,0,2)),this.addCurvePosition(x,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,E,i||y>0&&0==G)}return u}f?(p+=2,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p-4,c,0,2),n.computeWorldVertices(s,0,2,c,p-4,2),c[p-2]=c[0],c[p-1]=c[1]):(d--,p-=4,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p,c,0,2));for(var T=t.Utils.setArraySize(this.curves,d),M=0,R=c[0],I=c[1],b=0,S=0,C=0,P=0,N=0,_=0,L=0,k=0,V=0,O=0,D=0,F=0,U=0,X=0,Y=(y=0,2);yM){this.addAfterPosition(x-M,c,p-4,u,E);continue}}for(;;w++){var q=T[w];if(!(x>q)){if(0==w)x/=q;else x=(x-($=T[w-1]))/(q-$);break}}if(w!=m){m=w;var z=6*w;for(R=c[z],I=c[z+1],b=c[z+2],S=c[z+3],C=c[z+4],P=c[z+5],D=2*(L=.03*(R-2*b+C))+(V=.006*(3*(b-C)-R+(N=c[z+6]))),F=2*(k=.03*(I-2*S+P))+(O=.006*(3*(S-P)-I+(_=c[z+7]))),U=.3*(b-R)+L+.16666667*V,X=.3*(S-I)+k+.16666667*O,W=Math.sqrt(U*U+X*X),B[0]=W,z=1;z<8;z++)U+=D,X+=F,D+=V,F+=O,W+=Math.sqrt(U*U+X*X),B[z]=W;U+=D,X+=F,W+=Math.sqrt(U*U+X*X),B[8]=W,U+=D+V,X+=F+O,W+=Math.sqrt(U*U+X*X),B[9]=W,j=0}for(x*=W;;j++){var H=B[j];if(!(x>H)){var $;if(0==j)x/=H;else x=j+(x-($=B[j-1]))/(H-$);break}}this.addCurvePosition(.1*x,R,I,b,S,C,P,N,_,u,E,i||y>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,n,r,i){var a=e[n],o=e[n+1],s=e[n+2]-a,h=e[n+3]-o,l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,i){var a=e[n+2],o=e[n+3],s=a-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,i,a,o,s,h,l,u,c){(0==t||isNaN(t))&&(t=1e-4);var f=t*t,p=f*t,d=1-t,m=d*d,v=m*d,g=d*t,y=3*g,E=d*y,w=y*t,x=e*v+r*E+a*w+s*p,A=n*v+i*E+o*w+h*p;l[u]=x,l[u+1]=A,c&&(l[u+2]=Math.atan2(A-(n*m+i*g*2+o*f),x-(e*m+r*g*2+a*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e,n,r,i=function(t){this.order=0,this.bones=new Array,this.name=t};t.PathConstraintData=i,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(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,r){var i=this.clientAssets[t];return null==i&&(i=new e(t),this.clientAssets[t]=i),null!==n&&(i.textureLoader=n),i.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var i=new Image;i.src=n,i.crossOrigin="anonymous",i.onload=function(t){r.rawAssets[n]=i},i.onerror=function(t){r.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||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.flipX=!1,this.flipY=!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 i=n[n.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var n=e.target,r=n.data.index,i=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,i),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(var a=0,o=this.data.skins.length;a-1||this.updateCacheReset.push(i)}else for(r=0;r=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;if(t<=i&&n<=i||e<=a&&r<=a||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(i-t)+e;if(l>a&&la&&li&&ui&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,i=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[a]-u)=u&&E<=p||E>=p&&E<=u)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(l*g-h*m)/y;if((w>=c&&w<=d||w>=d&&w<=c)&&(w>=n&&w<=i||w>=i&&w<=n))return!0}u=p,c=d}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,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var i=r.worldVerticesLength,a=t.Utils.setArraySize(this.clippingPolygon,i);r.computeWorldVertices(n,0,i,a,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=s.length;h>1,U=this.clipOutput,X=t.Utils.setArraySize(u,N+F*d),Y=0;Y<_;Y+=2){var B=U[Y],W=U[Y+1];X[N]=B,X[N+1]=W,X[N+2]=o.r,X[N+3]=o.g,X[N+4]=o.b,X[N+5]=o.a;var j=B-I,G=W-b,q=(L*j+k*G)*D,z=(O*j+V*G)*D,H=1-q-z;X[N+6]=w*q+M*z+S*H,X[N+7]=x*q+R*z+C*H,h&&(X[N+8]=s.r,X[N+9]=s.g,X[N+10]=s.b,X[N+11]=s.a),N+=d}N=c.length;var $=t.Utils.setArraySize(c,N+3*(F-2));F--;for(Y=1;Y=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(i),u.push(a),u.push(t),u.push(e),s.length=0;for(var c=o,f=o.length-4,p=0;;p+=2){for(var d=c[p],m=c[p+1],v=c[p+2],g=c[p+3],y=d-v,E=m-g,w=u,x=u.length-2,A=s.length,T=0;T0;if(y*(R-g)-E*(M-v)>0){if(S){s.push(I),s.push(b);continue}var C=((N=I-M)*(m-R)-(P=b-R)*(d-M))/(P*(v-d)-N*(g-m));s.push(d+(v-d)*C),s.push(m+(g-m)*C)}else if(S){var P,N;C=((N=I-M)*(m-R)-(P=b-R)*(d-M))/(P*(v-d)-N*(g-m));s.push(d+(v-d)*C),s.push(m+(g-m)*C),s.push(I),s.push(b)}l=!0}if(A==s.length)return h.length=0,!0;if(s.push(s[0]),s.push(s[1]),p==f)break;var _=s;(s=u).length=0,u=_}if(h!=s){h.length=0;p=0;for(var L=s.length-2;p>1;s=0;f--)-1==j[f]&&(j[f]=q[--H])}w.setFrame(c++,W.time,j)}a.push(w),o=Math.max(o,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(i||(i={})),function(t){var e,n,r=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=r,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 i=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=i;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(t.Texture);t.FakeTexture=a}(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,a){if(null==a)throw new Error("textureLoader cannot be null.");for(var o=new n(e),s=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 i;u.name=l,u.page=h,u.rotate="true"==o.readValue(),o.readTuple(s);var c=parseInt(s[0]),f=parseInt(s[1]);o.readTuple(s);var p=parseInt(s[0]),d=parseInt(s[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height):(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height),u.x=c,u.y=f,u.width=Math.abs(p),u.height=Math.abs(d),4==o.readTuple(s)&&4==o.readTuple(s)&&o.readTuple(s),u.originalWidth=parseInt(s[0]),u.originalHeight=parseInt(s[1]),o.readTuple(s),u.offsetX=parseInt(s[0]),u.offsetY=parseInt(s[1]),u.index=parseInt(o.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new r).name=l,2==o.readTuple(s)&&(h.width=parseInt(s[0]),h.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),h.minFilter=t.Texture.filterFromString(s[0]),h.magFilter=t.Texture.filterFromString(s[1]);var m=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==m?h.uWrap=t.TextureWrap.Repeat:"y"==m?h.vWrap=t.TextureWrap.Repeat:"xy"==m&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=a(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 r=0,i=n+1;r<3;r++){var a=e.indexOf(",",i);if(-1==a)break;t[r]=e.substr(i,a-i).trim(),i=a+1}return t[r]=e.substring(i).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=i}(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,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 r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var A=Math.cos(b),T=Math.sin(b);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var R=Math.sqrt(v.a*v.a+v.c*v.c),I=Math.sqrt(o*o+h*h);R>1e-5&&(R=(R+(I-R+this.data.offsetScaleX)*r)/R),v.a*=R,v.c*=R,R=Math.sqrt(v.b*v.b+v.d*v.d),I=Math.sqrt(s*s+l*l),R>1e-5&&(R=(R+(I-R+this.data.offsetScaleY)*r)/R),v.b*=R,v.d*=R,g=!0}if(i>0){E=v.b,x=v.d;var b,S=Math.atan2(x,E);(b=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b=S+(b+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(b)*R,v.d=Math.sin(b)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,i=this.shearMix,a=this.target,o=a.a,s=a.b,h=a.c,l=a.d,u=o*l-s*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I*=e;var A=Math.cos(I),T=Math.sin(I);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var R=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*r+1;v.a*=R,v.c*=R,R=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,v.b*=R,v.d*=R,g=!0}if(i>0){var I;(I=Math.atan2(l,s)-Math.atan2(h,o))>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2);E=v.b,x=v.d;I=Math.atan2(x,E)+(I-t.MathUtils.PI/2+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(I)*R,v.d=Math.sin(I)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,o=0,s=a.length;o0&&(p>1e-5&&(p=(p+(i.ascaleX-p+this.data.offsetScaleX)*n)/p),d>1e-5&&(d=(d+(i.ascaleY-d+this.data.offsetScaleY)*n)/d));var m=h.ashearY;if(r>0){u=i.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*r}h.updateWorldTransformWith(c,f,l,p,d,h.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,o=0,s=a.length;o0&&(f>1e-5&&(f*=(i.ascaleX-1+this.data.offsetScaleX)*n+1),p>1e-5&&(p*=(i.ascaleY-1+this.data.offsetScaleY)*n+1));var d=h.ashearY;r>0&&(d+=(i.ashearY+this.data.offsetShearY)*r),h.updateWorldTransformWith(u,c,l,f,p,h.ashearX,d)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name cannot be null.");this.name=t};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,r=t.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a3;){for(var l=r-1,u=(a=0,1);;){t:if(!o[a]){for(var c=i[l]<<1,f=i[a]<<1,p=i[u]<<1,d=n[c],m=n[c+1],v=n[f],g=n[f+1],y=n[p],E=n[p+1],w=(u+1)%r;w!=l;w=(w+1)%r)if(o[w]){var x=i[w]<<1,A=n[x],T=n[x+1];if(e.positiveArea(y,E,d,m,A,T)&&e.positiveArea(d,m,v,g,A,T)&&e.positiveArea(v,g,y,E,A,T))break t}break}if(0==u){do{if(!o[a])break;a--}while(a>0);break}l=a,a=u,u=(u+1)%r}h.push(i[(r+a-1)%r]),h.push(i[a]),h.push(i[(a+1)%r]),i.splice(a,1),o.splice(a,1);var M=(--r+a-1)%r,R=a==r?0:a;o[M]=e.isConcave(M,r,n,i),o[R]=e.isConcave(R,r,n,i)}return 3==r&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},e.prototype.decompose=function(t,n){var r=t,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;var a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(i.push(s),a.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(v),s.push(g),s.push(y),s.push(E),s.push(w),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(p),o.push(d),l=e.winding(m,v,g,y,E,w),h=f)}s.length>0&&(i.push(s),a.push(o));for(u=0,c=i.length;u=0;u--)0==(s=i[u]).length&&(i.splice(u,1),this.polygonPool.free(s),o=a[u],a.splice(u,1),this.polygonIndicesPool.free(o));return i},e.isConcave=function(t,e,n,r){var i=r[(e+t-1)%e]<<1,a=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,r,i,a){return t*(a-r)+n*(e-a)+i*(r-e)>=0},e.winding=function(t,e,n,r,i,a){var o=n-t,s=r-e;return i*s-a*o+o*e-t*s>=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 null!=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,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,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,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,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.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 r=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 r=Math.random(),i=e-t;return r<=(n-t)/i?t+Math.sqrt(r*i*(n-t)):e-Math.sqrt((1-r)*i*(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=r;var i=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=i;var a=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return o(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}(i);t.Pow=a;var s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=s;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,r,i){for(var a=e,o=r;a=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?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 p=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)*a;var o=t.bone.skeleton,s=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=s);for(var w,x=(w=t.bone).worldX,A=w.worldY,T=w.a,M=w.b,R=w.c,I=w.d,b=e,S=i;S)?=?)"),p("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),p("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),p("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),p("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),p("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),p("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),p("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),p("COERCERTL",h[l.COERCE],!0),p("COERCERTLFULL",h[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",p("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),p("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("LONECARET","(?:\\^)"),p("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",p("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),p("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),p("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),p("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),p("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(N,N.exports);var _=N.exports;I(_);var L=Object.freeze({loose:!0}),k=Object.freeze({}),V=function(t){return t?"object"!==s(t)?L:t:k};I(V);var O=/^[0-9]+$/,D=function(t,e){var n=O.test(t),r=O.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tX)throw new TypeError("version is longer than ".concat(X," characters"));U("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?B[W.LOOSE]:B[W.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Y||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Y||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Y||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var a=[e,r];!1===n&&(a=[e]),0===G(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),z=q;I(z);var H=z,$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof H)return t;try{return new H(t,e)}catch(t){if(!n)return null;throw t}};I($);var Z=$,J=I((function(t,e){var n=Z(t,e);return n?n.version:null})),Q=z,K=$,tt=_.safeRe,et=_.t,nt=I((function(t,e){if(t instanceof Q)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r,i=e.includePrerelease?tt[et.COERCERTLFULL]:tt[et.COERCERTL];(r=i.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),i.lastIndex=r.index+r[1].length+r[2].length;i.lastIndex=-1}else n=t.match(e.includePrerelease?tt[et.COERCEFULL]:tt[et.COERCE]);if(null===n)return null;var a=n[2],o=n[3]||"0",s=n[4]||"0",h=e.includePrerelease&&n[5]?"-".concat(n[5]):"",l=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return K("".concat(a,".").concat(o,".").concat(s).concat(h).concat(l),e)})),rt=u((function t(){h(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);I(rt);var it=z,at=function(t,e,n){return new it(t,n).compare(new it(e,n))};I(at);var ot=at,st=function(t,e,n){return 0===ot(t,e,n)};I(st);var ht=at,lt=function(t,e,n){return 0!==ht(t,e,n)};I(lt);var ut=at,ct=function(t,e,n){return ut(t,e,n)>0};I(ct);var ft=at,pt=function(t,e,n){return ft(t,e,n)>=0};I(pt);var dt=at,mt=function(t,e,n){return dt(t,e,n)<0};I(mt);var vt=at,gt=function(t,e,n){return vt(t,e,n)<=0};I(gt);var yt,Et,wt,xt,At=st,Tt=lt,Mt=ct,Rt=pt,It=mt,bt=gt,St=function(t,e,n,r){switch(e){case"===":return"object"===s(t)&&(t=t.version),"object"===s(n)&&(n=n.version),t===n;case"!==":return"object"===s(t)&&(t=t.version),"object"===s(n)&&(n=n.version),t!==n;case"":case"=":case"==":return At(t,n,r);case"!=":return Tt(t,n,r);case">":return Mt(t,n,r);case">=":return Rt(t,n,r);case"<":return It(t,n,r);case"<=":return bt(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Ct(){if(xt)return wt;xt=1;var t=function(){function t(e,i){var a=this;if(h(this,t),i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return a.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,l=x(this.set);try{for(l.s();!(s=l.n()).done;){var u=s.value;if(1===u.length&&v(u[0])){this.set=[u];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return u(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,a=((this.options.includePrerelease&&p)|(this.options.loose&&d))+":"+t,h=e.get(a);if(h)return h;var u=this.options.loose,v=u?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(v,L(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],l),i("comparator trim",t),t=t.replace(o[s.TILDETRIM],c),i("tilde trim",t),t=t.replace(o[s.CARETTRIM],f),i("caret trim",t);var g=t.split(" ").map((function(t){return E(t,n.options)})).join(" ").split(/\s+/).map((function(t){return N(t,n.options)}));u&&(g=g.filter((function(t){return i("loose invalid filter",t,n.options),!!t.match(o[s.COMPARATORLOOSE])}))),i("range list",g);var w,A=new Map,T=g.map((function(t){return new r(t,n.options)})),M=x(T);try{for(M.s();!(w=M.n()).done;){var R=w.value;if(m(R))return[R];A.set(R.value,R)}}catch(t){M.e(t)}finally{M.f()}A.size>1&&A.has("")&&A.delete("");var I=y(A.values());return e.set(a,I),I}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new a(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(a(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(a(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();yt=e;var n=V,r=_.safeRe,i=_.t,a=St,o=P,s=z,l=Ct();return yt}(),i=P,a=z,o=_.safeRe,s=_.t,l=_.comparatorTrimReplace,c=_.tildeTrimReplace,f=_.caretTrimReplace,p=b.FLAG_INCLUDE_PRERELEASE,d=b.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),i=r.pop();n&&r.length;)n=r.every((function(t){return i.intersects(t,e)})),i=r.pop();return n},E=function(t,e){return i("comp",t,e),t=M(t,e),i("caret",t),t=A(t,e),i("tildes",t),t=I(t,e),i("xrange",t),t=C(t,e),i("stars",t),t},w=function(t){return!t||"x"===t.toLowerCase()||"*"===t},A=function(t,e){return t.trim().split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){var n=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(n,(function(e,n,r,a,o){var s;return i("tilde",t,e,n,r,a,o),w(n)?s="":w(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):w(a)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(i("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(a,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(a," <").concat(n,".").concat(+r+1,".0-0"),i("tilde return",s),s}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){i("caret",t,e);var n=e.loose?o[s.CARETLOOSE]:o[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,a,o,s){var h;return i("caret",t,e,n,a,o,s),w(n)?h="":w(a)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):w(o)?h="0"===n?">=".concat(n,".").concat(a,".0").concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(i("replaceCaret pr",s),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(i("no pr"),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o," <").concat(+n+1,".0.0-0")),i("caret return",h),h}))},I=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return S(t,e)})).join(" ")},S=function(t,e){t=t.trim();var n=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(n,(function(n,r,a,o,s,h){i("xRange",t,n,r,a,o,s,h);var l=w(a),u=l||w(o),c=u||w(s),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(a=+a+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?a=+a+1:o=+o+1),"<"===r&&(h="-0"),n="".concat(r+a,".").concat(o,".").concat(s).concat(h)):u?n=">=".concat(a,".0.0").concat(h," <").concat(+a+1,".0.0-0"):c&&(n=">=".concat(a,".").concat(o,".0").concat(h," <").concat(a,".").concat(+o+1,".0-0")),i("xRange return",n),n}))},C=function(t,e){return i("replaceStars",t,e),t.trim().replace(o[s.STAR],"")},N=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?s.GTE0PRE:s.GTE0],"")},L=function(t){return function(e,n,r,i,a,o,s,h,l,u,c,f){return n=w(r)?"":w(i)?">=".concat(r,".0.0").concat(t?"-0":""):w(a)?">=".concat(r,".").concat(i,".0").concat(t?"-0":""):o?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=w(l)?"":w(u)?"<".concat(+l+1,".0.0-0"):w(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},k=function(t,e,n){for(var a=0;a0){var s=t[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0};return wt}I(St);var Pt=Ct(),Nt=function(t,e,n){try{e=new Pt(e,n)}catch(t){return!1}return e.test(t)},_t={valid:J,coerce:nt,satisfies:I(Nt),SEMVER_SPEC_VERSION:S.SEMVER_SPEC_VERSION},Lt=0,kt=1,Vt=2,Ot=[0,1,2,2,3,0],Dt=u((function t(e,n,r,o){var s;if(h(this,t),c(this,"autoUpdate",!0),c(this,"skeleton",void 0),c(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===i.TextureAtlas.length){var l,u=x((s=new i.TextureAtlas(n)).pages);try{for(u.s();!(l=u.n()).done;){var f=l.value;f.setTexture(new R(o[f.name]))}}catch(t){u.e(t)}finally{u.f()}}else s=new i.TextureAtlas(n,(function(t){return new R(o[t])}));var p=new i.SkeletonJson(new i.AtlasAttachmentLoader(s));p.scale*=.01;var d=p.readSkeletonData(r);this.skeletonVersion=_t.valid(_t.coerce(d.version)),this._spine_3_6_0=_t.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=_t.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=_t.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=_t.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new i.Skeleton(d),this.skeleton.updateWorldTransform(),this.stateData=new i.AnimationStateData(this.skeleton.data),this.states=[new i.AnimationState(this.stateData)],this.clipper=new i.SkeletonClipping,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=o,n=0),t=c.material;var f=c.positions,p=c.vertexColor.r,d=c.vertexColor.g,m=c.vertexColor.b,v=c.vertexColor.a,g=c.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function A(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,a=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 r=0;r0&&(e%=this.duration));for(var l=this.timelines,h=0,c=l.length;h>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=a,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"}(r=t.TimelineType||(t.TimelineType={}));var i=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 r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,a,i){var s=.03*(2*-n+a),o=.03*(2*-r+i),l=.006*(3*(n-a)+1),h=.006*(3*(r-i)+1),c=2*s+l,u=2*o+h,f=.3*n+s+.16666667*l,d=.3*r+o+.16666667*h,p=t*e.BEZIER_SIZE,m=this.curves;m[p++]=e.BEZIER;for(var v=f,g=d,y=p+e.BEZIER_SIZE-1;p=r){var c=void 0,u=void 0;return i==l?(c=0,u=0):(c=a[i-2],u=a[i-1]),u+(a[i+1]-u)*(r-c)/(o-c)}var f=a[i-1];return f+(1-f)*(r-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=i;var o=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+i.ROTATION]=n},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(u.active)if(r=c[c.length-i.ENTRIES]){var d=c[c.length+i.PREV_ROTATION];switch(l){case e.setup:u.rotation=u.data.rotation+d*o;break;case e.first:case e.replace:d+=u.data.rotation-u.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:u.rotation+=d*o}}else{var p=a.binarySearch(c,r,i.ENTRIES),m=c[p+i.PREV_ROTATION],v=c[p],g=this.getCurvePercent((p>>1)-1,1-(r-v)/(c[p+i.PREV_TIME]-v)),y=c[p+i.ROTATION]-m;switch(y=m+(y-360*(16384-(16384.499999999996-y/360|0)))*g,l){case e.setup:u.rotation=u.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*o;break;case e.first:case e.replace:y+=u.data.rotation-u.rotation;case e.add:u.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*o}}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_ROTATION=-1,i.ROTATION=1,i}(i);t.RotateTimeline=o;var l=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.X]=n,this.frames[t+i.Y]=r},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(u.active)if(r=c[c.length-i.ENTRIES])f=c[c.length+i.PREV_X],d=c[c.length+i.PREV_Y];else{var p=a.binarySearch(c,r,i.ENTRIES);f=c[p+i.PREV_X],d=c[p+i.PREV_Y];var m=c[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(c[p+i.PREV_TIME]-m));f+=(c[p+i.X]-f)*v,d+=(c[p+i.Y]-d)*v}switch(l){case e.setup:u.x=u.data.x+f*o,u.y=u.data.y+d*o;break;case e.first:case e.replace:u.x+=(u.data.x+f-u.x)*o,u.y+=(u.data.y+d-u.y)*o;break;case e.add:u.x+=f*o,u.y+=d*o}}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_X=-2,i.PREV_Y=-1,i.X=1,i.Y=2,i}(i);t.TranslateTimeline=l;var h=function(i){function o(t){return i.call(this,t)||this}return s(o,i),o.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},o.prototype.apply=function(r,i,s,l,h,c,u){var f=this.frames,d=r.bones[this.boneIndex];if(d.active)if(s=f[f.length-o.ENTRIES])p=f[f.length+o.PREV_X]*d.data.scaleX,m=f[f.length+o.PREV_Y]*d.data.scaleY;else{var v=a.binarySearch(f,s,o.ENTRIES);p=f[v+o.PREV_X],m=f[v+o.PREV_Y];var g=f[v],y=this.getCurvePercent(v/o.ENTRIES-1,1-(s-g)/(f[v+o.PREV_TIME]-g));p=(p+(f[v+o.X]-p)*y)*d.data.scaleX,m=(m+(f[v+o.Y]-m)*y)*d.data.scaleY}if(1==h)c==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=m-d.data.scaleY):(d.scaleX=p,d.scaleY=m);else{var E=0,w=0;if(u==n.mixOut)switch(c){case e.setup:E=d.data.scaleX,w=d.data.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*h,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*h;break;case e.first:case e.replace:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*h,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*h;break;case e.add:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-d.data.scaleX)*h,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-d.data.scaleY)*h}else switch(c){case e.setup:E=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.data.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*h,d.scaleY=w+(m-w)*h;break;case e.first:case e.replace:E=Math.abs(d.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*h,d.scaleY=w+(m-w)*h;break;case e.add:E=t.MathUtils.signum(p),w=t.MathUtils.signum(m),d.scaleX=Math.abs(d.scaleX)*E+(p-Math.abs(d.data.scaleX)*E)*h,d.scaleY=Math.abs(d.scaleY)*w+(m-Math.abs(d.data.scaleY)*w)*h}}}},o}(l);t.ScaleTimeline=h;var c=function(t){function n(e){return t.call(this,e)||this}return s(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,i,s,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(u.active)if(i=c[c.length-n.ENTRIES])f=c[c.length+n.PREV_X],d=c[c.length+n.PREV_Y];else{var p=a.binarySearch(c,i,n.ENTRIES);f=c[p+n.PREV_X],d=c[p+n.PREV_Y];var m=c[p],v=this.getCurvePercent(p/n.ENTRIES-1,1-(i-m)/(c[p+n.PREV_TIME]-m));f+=(c[p+n.X]-f)*v,d+=(c[p+n.Y]-d)*v}switch(l){case e.setup:u.shearX=u.data.shearX+f*o,u.shearY=u.data.shearY+d*o;break;case e.first:case e.replace:u.shearX+=(u.data.shearX+f-u.shearX)*o,u.shearY+=(u.data.shearY+d-u.shearY)*o;break;case e.add:u.shearX+=f*o,u.shearY+=d*o}}},n}(l);t.ShearTimeline=c;var u=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,s){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=s},i.prototype.apply=function(t,n,r,s,o,l,h){var c=t.slots[this.slotIndex];if(c.bone.active){var u=this.frames;if(r=u[u.length-i.ENTRIES]){var y=u.length;p=u[y+i.PREV_R],m=u[y+i.PREV_G],v=u[y+i.PREV_B],g=u[y+i.PREV_A]}else{var E=a.binarySearch(u,r,i.ENTRIES);p=u[E+i.PREV_R],m=u[E+i.PREV_G],v=u[E+i.PREV_B],g=u[E+i.PREV_A];var w=u[E],T=this.getCurvePercent(E/i.ENTRIES-1,1-(r-w)/(u[E+i.PREV_TIME]-w));p+=(u[E+i.R]-p)*T,m+=(u[E+i.G]-m)*T,v+=(u[E+i.B]-v)*T,g+=(u[E+i.A]-g)*T}if(1==o)c.color.set(p,m,v,g);else{f=c.color;l==e.setup&&f.setFromColor(c.data.color),f.add((p-f.r)*o,(m-f.g)*o,(v-f.b)*o,(g-f.a)*o)}}}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_R=-4,i.PREV_G=-3,i.PREV_B=-2,i.PREV_A=-1,i.R=1,i.G=2,i.B=3,i.A=4,i}(i);t.ColorTimeline=u;var f=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,s,o,l,h){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=s,this.frames[t+i.R2]=o,this.frames[t+i.G2]=l,this.frames[t+i.B2]=h},i.prototype.apply=function(t,n,r,s,o,l,h){var c=t.slots[this.slotIndex];if(c.bone.active){var u=this.frames;if(r=u[u.length-i.ENTRIES]){var x=u.length;v=u[x+i.PREV_R],g=u[x+i.PREV_G],y=u[x+i.PREV_B],E=u[x+i.PREV_A],w=u[x+i.PREV_R2],T=u[x+i.PREV_G2],A=u[x+i.PREV_B2]}else{var M=a.binarySearch(u,r,i.ENTRIES);v=u[M+i.PREV_R],g=u[M+i.PREV_G],y=u[M+i.PREV_B],E=u[M+i.PREV_A],w=u[M+i.PREV_R2],T=u[M+i.PREV_G2],A=u[M+i.PREV_B2];var I=u[M],R=this.getCurvePercent(M/i.ENTRIES-1,1-(r-I)/(u[M+i.PREV_TIME]-I));v+=(u[M+i.R]-v)*R,g+=(u[M+i.G]-g)*R,y+=(u[M+i.B]-y)*R,E+=(u[M+i.A]-E)*R,w+=(u[M+i.R2]-w)*R,T+=(u[M+i.G2]-T)*R,A+=(u[M+i.B2]-A)*R}if(1==o)c.color.set(v,g,y,E),c.darkColor.set(w,T,A,1);else{f=c.color,d=c.darkColor;l==e.setup&&(f.setFromColor(c.data.color),d.setFromColor(c.data.darkColor)),f.add((v-f.r)*o,(g-f.g)*o,(y-f.b)*o,(E-f.a)*o),d.add((w-d.r)*o,(T-d.g)*o,(A-d.b)*o,0)}}}},i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,i}(i);t.TwoColorTimeline=f;var d=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return i.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},i.prototype.apply=function(t,r,i,s,o,l,h){var c=t.slots[this.slotIndex];if(c.bone.active)if(h!=n.mixOut){var u=this.frames;if(i=u[u.length-1]?u.length-1:a.binarySearch(u,i,1)-1;var d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else l==e.setup&&this.setAttachment(t,c,c.data.attachmentName)},i.prototype.setAttachment=function(t,e,n){e.setAttachment(null==n?null:t.getAttachment(this.slotIndex,n))},i}();t.AttachmentTimeline=d;var p=null,m=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},i.prototype.apply=function(n,r,i,s,o,l,h){var c=n.slots[this.slotIndex];if(c.bone.active){var u=c.getAttachment();if(u instanceof t.VertexAttachment&&u.deformAttachment==this.attachment){var f=c.deform;0==f.length&&(l=e.setup);var d=this.frameVertices,p=d[0].length,m=this.frames;if(i=m[m.length-1]){var T=d[m.length-1];if(1==o)if(l==e.add)if(null==(v=u).bones){y=v.vertices;for(var A=0;An)this.apply(t,e,Number.MAX_VALUE,r,i,s,o),e=-1;else if(e>=l[h-1])return;if(!(n0&&l[c-1]==u;)c--;for(;c=l[c];c++)r.push(this.events[c])}}},e}();t.EventTimeline=v;var g=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return i.prototype.getPropertyId=function(){return r.drawOrder<<24},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},i.prototype.apply=function(r,i,s,o,l,h,c){var u=r.drawOrder,f=r.slots;if(c!=n.mixOut){var d=this.frames;if(s=d[d.length-1]?d.length-1:a.binarySearch(d,s)-1;var m=this.drawOrders[p];if(null==m)t.Utils.arrayCopy(f,0,u,0,f.length);else for(var v=0,g=m.length;v=u[u.length-o.ENTRIES])h==e.setup?(f.mix=f.data.mix+(u[u.length+o.PREV_MIX]-f.data.mix)*l,f.softness=f.data.softness+(u[u.length+o.PREV_SOFTNESS]-f.data.softness)*l,c==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=u[u.length+o.PREV_BEND_DIRECTION],f.compress=0!=u[u.length+o.PREV_COMPRESS],f.stretch=0!=u[u.length+o.PREV_STRETCH])):(f.mix+=(u[u.length+o.PREV_MIX]-f.mix)*l,f.softness+=(u[u.length+o.PREV_SOFTNESS]-f.softness)*l,c==n.mixIn&&(f.bendDirection=u[u.length+o.PREV_BEND_DIRECTION],f.compress=0!=u[u.length+o.PREV_COMPRESS],f.stretch=0!=u[u.length+o.PREV_STRETCH]));else{var d=a.binarySearch(u,i,o.ENTRIES),p=u[d+o.PREV_MIX],m=u[d+o.PREV_SOFTNESS],v=u[d],g=this.getCurvePercent(d/o.ENTRIES-1,1-(i-v)/(u[d+o.PREV_TIME]-v));h==e.setup?(f.mix=f.data.mix+(p+(u[d+o.MIX]-p)*g-f.data.mix)*l,f.softness=f.data.softness+(m+(u[d+o.SOFTNESS]-m)*g-f.data.softness)*l,c==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=u[d+o.PREV_BEND_DIRECTION],f.compress=0!=u[d+o.PREV_COMPRESS],f.stretch=0!=u[d+o.PREV_STRETCH])):(f.mix+=(p+(u[d+o.MIX]-p)*g-f.mix)*l,f.softness+=(m+(u[d+o.SOFTNESS]-m)*g-f.softness)*l,c==n.mixIn&&(f.bendDirection=u[d+o.PREV_BEND_DIRECTION],f.compress=0!=u[d+o.PREV_COMPRESS],f.stretch=0!=u[d+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(i);t.IkConstraintTimeline=y;var E=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},i.prototype.setFrame=function(t,e,n,r,a,s){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r,this.frames[t+i.SCALE]=a,this.frames[t+i.SHEAR]=s},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.transformConstraints[this.transformConstraintIndex];if(u.active)if(r=c[c.length-i.ENTRIES]){var g=c.length;d=c[g+i.PREV_ROTATE],p=c[g+i.PREV_TRANSLATE],m=c[g+i.PREV_SCALE],v=c[g+i.PREV_SHEAR]}else{var y=a.binarySearch(c,r,i.ENTRIES);d=c[y+i.PREV_ROTATE],p=c[y+i.PREV_TRANSLATE],m=c[y+i.PREV_SCALE],v=c[y+i.PREV_SHEAR];var E=c[y],w=this.getCurvePercent(y/i.ENTRIES-1,1-(r-E)/(c[y+i.PREV_TIME]-E));d+=(c[y+i.ROTATE]-d)*w,p+=(c[y+i.TRANSLATE]-p)*w,m+=(c[y+i.SCALE]-m)*w,v+=(c[y+i.SHEAR]-v)*w}if(l==e.setup){f=u.data;u.rotateMix=f.rotateMix+(d-f.rotateMix)*o,u.translateMix=f.translateMix+(p-f.translateMix)*o,u.scaleMix=f.scaleMix+(m-f.scaleMix)*o,u.shearMix=f.shearMix+(v-f.shearMix)*o}else u.rotateMix+=(d-u.rotateMix)*o,u.translateMix+=(p-u.translateMix)*o,u.scaleMix+=(m-u.scaleMix)*o,u.shearMix+=(v-u.shearMix)*o}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_ROTATE=-4,i.PREV_TRANSLATE=-3,i.PREV_SCALE=-2,i.PREV_SHEAR=-1,i.ROTATE=1,i.TRANSLATE=2,i.SCALE=3,i.SHEAR=4,i}(i);t.TransformConstraintTimeline=E;var w=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.VALUE]=n},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(u.active)if(r=c[c.length-i.ENTRIES])f=c[c.length+i.PREV_VALUE];else{var d=a.binarySearch(c,r,i.ENTRIES);f=c[d+i.PREV_VALUE];var p=c[d],m=this.getCurvePercent(d/i.ENTRIES-1,1-(r-p)/(c[d+i.PREV_TIME]-p));f+=(c[d+i.VALUE]-f)*m}l==e.setup?u.position=u.data.position+(f-u.data.position)*o:u.position+=(f-u.position)*o}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_VALUE=-1,i.VALUE=1,i}(i);t.PathConstraintPositionTimeline=w;var T=function(t){function n(e){return t.call(this,e)||this}return s(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,i,s,o,l,h){var c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(u.active)if(i=c[c.length-n.ENTRIES])f=c[c.length+n.PREV_VALUE];else{var d=a.binarySearch(c,i,n.ENTRIES);f=c[d+n.PREV_VALUE];var p=c[d],m=this.getCurvePercent(d/n.ENTRIES-1,1-(i-p)/(c[d+n.PREV_TIME]-p));f+=(c[d+n.VALUE]-f)*m}l==e.setup?u.spacing=u.data.spacing+(f-u.data.spacing)*o:u.spacing+=(f-u.spacing)*o}},n}(w);t.PathConstraintSpacingTimeline=T;var A=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(u.active)if(r=c[c.length-i.ENTRIES])f=c[c.length+i.PREV_ROTATE],d=c[c.length+i.PREV_TRANSLATE];else{var p=a.binarySearch(c,r,i.ENTRIES);f=c[p+i.PREV_ROTATE],d=c[p+i.PREV_TRANSLATE];var m=c[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(c[p+i.PREV_TIME]-m));f+=(c[p+i.ROTATE]-f)*v,d+=(c[p+i.TRANSLATE]-d)*v}l==e.setup?(u.rotateMix=u.data.rotateMix+(f-u.data.rotateMix)*o,u.translateMix=u.data.translateMix+(d-u.data.translateMix)*o):(u.rotateMix+=(f-u.rotateMix)*o,u.translateMix+=(d-u.translateMix)*o)}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_ROTATE=-2,i.PREV_TRANSLATE=-1,i.ROTATE=1,i.TRANSLATE=2,i}(i);t.PathConstraintMixTimeline=A}(a||(a={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!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,r=e.length;n0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var s=a.next;if(null!=s){var o=a.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==a.timeScale?0:(o/a.timeScale+t)*s.timeScale,a.trackTime+=i,this.setCurrent(n,s,!0);null!=s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&null==a.mixingFrom){e[n]=null,this.queue.end(a),this.disposeNext(a);continue}if(null!=a.mixingFrom&&this.updateMixingFrom(a,t)){var l=a.mixingFrom;for(a.mixingFrom=null,null!=l&&(l.mixingTo=null);null!=l;)this.queue.end(l),l=l.mixingFrom}a.trackTime+=i}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=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)),r):(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 r=this.events,a=this.tracks,i=!1,s=0,o=a.length;s0)){i=!0;var h=0==s?t.MixBlend.first:l.mixBlend,c=l.alpha;null!=l.mixingFrom?c*=this.applyMixingFrom(l,n,h):l.trackTime>=l.trackEnd&&null==l.next&&(c=0);var u=l.animationLast,f=l.getAnimationTime(),d=l.animation.timelines.length,p=l.animation.timelines;if(0==s&&1==c||h==t.MixBlend.add)for(var m=0;m1&&(s=1),a!=t.MixBlend.first&&(a=i.mixBlend));var o=s0&&this.queueEvents(i,u),this.events.length=0,i.nextAnimationLast=u,i.nextTrackLast=i.trackTime,s},e.prototype.applyAttachmentTimeline=function(n,r,a,i,s){var o=r.slots[n.slotIndex];if(o.bone.active){var l,h=n.frames;if(a=h[h.length-1]?h.length-1:t.Animation.binarySearch(h,a)-1,this.setAttachment(r,o,n.attachmentNames[l],s);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,n,r,a){n.setAttachment(null==r?null:t.getAttachment(n.data.index,r)),a&&(n.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,n,r,a,i,s,o,l){if(l&&(s[o]=0),1!=a){var h=e,c=h.frames,u=n.bones[h.boneIndex];if(u.active){var f=0,d=0;if(r=c[c.length-t.RotateTimeline.ENTRIES])d=u.data.rotation+c[c.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(c,r,t.RotateTimeline.ENTRIES),m=c[p+t.RotateTimeline.PREV_ROTATION],v=c[p],g=h.getCurvePercent((p>>1)-1,1-(r-v)/(c[p+t.RotateTimeline.PREV_TIME]-v));d=c[p+t.RotateTimeline.ROTATION]-m,d=m+(d-=360*(16384-(16384.499999999996-d/360|0)))*g+u.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var y=0,E=d-f;if(0==(E-=360*(16384-(16384.499999999996-E/360|0))))y=s[o];else{var w=0,T=0;l?(w=0,T=E):(w=s[o],T=s[o+1]);var A=E>0,x=w>=0;t.MathUtils.signum(T)!=t.MathUtils.signum(E)&&Math.abs(T)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),x=A),y=E+w-w%360,x!=A&&(y+=360*t.MathUtils.signum(w)),s[o]=y}s[o+1]=E,f+=y*a,u.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(n,0,r,null,1,i,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,s=this.events,o=0,l=s.length;or||this.queue.event(t,h)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&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 r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,r=!1):this.disposeNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i},e.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,i,!0),this.queue.drain();else if(a.next=i,r<=0){var s=a.animationEnd-a.animationStart;0!=s?(a.loop?r+=s*(1+(a.trackTime/s|0)):r+=Math.max(s,a.trackTime),r-=this.data.getMix(a.animation,e)):r=a.trackTime}return i.delay=r,i},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var a=this.addAnimationWith(t,e.emptyAnimation,!1,r);return a.mixDuration=n,a.trackEnd=n,a},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n0){s[h]=e.HOLD_MIX,o[h]=f;continue t}break}s[h]=e.HOLD_FIRST}else s[h]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=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_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,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 r,a=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.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?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(s){var o={count:0},l=new Array;try{new t.TextureAtlas(s,(function(e){l.push(""==i?e:i+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)}))}catch(t){var h=t;return a.errors[e]="Couldn't load texture atlas "+e+": "+h.message,r&&r(e,"Couldn't load texture atlas "+e+": "+h.message),a.toLoad--,void a.loaded++}for(var c=function(h){var c=!1;a.loadTexture(h,(function(h,u){if(o.count++,o.count==l.length)if(c)a.errors[e]="Couldn't load texture atlas page "+h+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+h+" of atlas "+e),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(s,(function(t){return a.get(""==i?t:i+"/"+t)}));a.assets[e]=f,n&&n(e,f),a.toLoad--,a.loaded++}catch(t){var d=t;a.errors[e]="Couldn't load texture atlas "+e+": "+d.message,r&&r(e,"Couldn't load texture atlas "+e+": "+d.message),a.toLoad--,a.loaded++}}),(function(t,n){c=!0,o.count++,o.count==l.length&&(a.errors[e]="Couldn't load texture atlas page "+t+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+t+" of atlas "+e),a.toLoad--,a.loaded++)}))},u=0,f=l;u0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(a||(a={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");a.renderObject=a;var i=new t.RegionAttachment(n);return i.setRegion(a),i},e.prototype.newMeshAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");a.renderObject=a;var i=new t.MeshAttachment(n);return i.region=a,i},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}(a||(a={})),function(t){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(a||(a={})),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.c=0,this.d=0,this.worldY=0,this.worldX=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,r,a,i,s,o){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=a,this.ascaleY=i,this.ashearX=s,this.ashearY=o,this.appliedValid=!0;var l=this.parent;if(null==l){var h=this.skeleton,c=r+90+o,u=h.scaleX,f=h.scaleY;return this.a=t.MathUtils.cosDeg(r+s)*a*u,this.b=t.MathUtils.cosDeg(c)*i*u,this.c=t.MathUtils.sinDeg(r+s)*a*f,this.d=t.MathUtils.sinDeg(c)*i*f,this.worldX=e*u+h.x,void(this.worldY=n*f+h.y)}var d=l.a,p=l.b,m=l.c,v=l.d;switch(this.worldX=d*e+p*n+l.worldX,this.worldY=m*e+v*n+l.worldY,this.data.transformMode){case t.TransformMode.Normal:c=r+90+o;var g=t.MathUtils.cosDeg(r+s)*a,y=t.MathUtils.cosDeg(c)*i,E=t.MathUtils.sinDeg(r+s)*a,w=t.MathUtils.sinDeg(c)*i;return this.a=d*g+p*E,this.b=d*y+p*w,this.c=m*g+v*E,void(this.d=m*y+v*w);case t.TransformMode.OnlyTranslation:c=r+90+o;this.a=t.MathUtils.cosDeg(r+s)*a,this.b=t.MathUtils.cosDeg(c)*i,this.c=t.MathUtils.sinDeg(r+s)*a,this.d=t.MathUtils.sinDeg(c)*i;break;case t.TransformMode.NoRotationOrReflection:var T=0;(M=d*d+m*m)>1e-4?(M=Math.abs(d*v-p*m)/M,d/=this.skeleton.scaleX,p=(m/=this.skeleton.scaleY)*M,v=d*M,T=Math.atan2(m,d)*t.MathUtils.radDeg):(d=0,m=0,T=90-Math.atan2(v,p)*t.MathUtils.radDeg);var A=r+s-T,x=r+o-T+90;g=t.MathUtils.cosDeg(A)*a,y=t.MathUtils.cosDeg(x)*i,E=t.MathUtils.sinDeg(A)*a,w=t.MathUtils.sinDeg(x)*i;this.a=d*g-p*E,this.b=d*y-p*w,this.c=m*g+v*E,this.d=m*y+v*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var M,I=t.MathUtils.cosDeg(r),R=t.MathUtils.sinDeg(r),b=(d*I+p*R)/this.skeleton.scaleX,S=(m*I+v*R)/this.skeleton.scaleY;(M=Math.sqrt(b*b+S*S))>1e-5&&(M=1/M),b*=M,S*=M,M=Math.sqrt(b*b+S*S),this.data.transformMode==t.TransformMode.NoScale&&d*v-p*m<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(M=-M);var C=Math.PI/2+Math.atan2(S,b),P=Math.cos(C)*M,k=Math.sin(C)*M;g=t.MathUtils.cosDeg(s)*a,y=t.MathUtils.cosDeg(90+o)*i,E=t.MathUtils.sinDeg(s)*a,w=t.MathUtils.sinDeg(90+o)*i;this.a=b*g+P*E,this.b=b*y+P*w,this.c=S*g+k*E,this.d=S*y+k*w}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,r=e.b,a=e.c,i=e.d,s=1/(n*i-r*a),o=this.worldX-e.worldX,l=this.worldY-e.worldY;this.ax=o*i*s-l*r*s,this.ay=l*n*s-o*a*s;var h=s*i,c=s*n,u=s*r,f=s*a,d=h*this.a-u*this.c,p=h*this.b-u*this.d,m=c*this.c-f*this.a,v=c*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+m*m),this.ascaleX>1e-4){var g=d*v-p*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*p+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,a=this.d,i=1/(e*a-n*r),s=t.x-this.worldX,o=t.y-this.worldY;return t.x=s*a*i-o*n*i,t.y=o*e*i-s*r*i,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),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-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),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,a=this.c,i=this.d,s=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=s*n-o*a,this.b=s*r-o*i,this.c=o*n+s*a,this.d=o*r+s*i,this.appliedValid=!1},e}();t.Bone=e}(a||(a={})),function(t){var e,n=function(n,r,a){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==r)throw new Error("name cannot be null.");this.index=n,this.name=r,this.parent=a};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={}))}(a||(a={})),function(t){var e=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n};t.ConstraintData=e}(a||(a={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(a||(a={})),function(t){var e=function(t){this.name=t};t.EventData=e}(a||(a={})),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?d-=360:d<-180&&(d+=360);var A=e.ascaleX,x=e.ascaleY;if(a||i){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=n-e.worldX,m=r-e.worldY}var M=e.data.length*A,I=Math.sqrt(p*p+m*m);if(a&&IM&&M>1e-4)A*=v=(I/M-1)*o+1,s&&(x*=v)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*o,A,x,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,a,i,s,o,l){if(0!=l){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var h=e.ax,c=e.ay,u=e.ascaleX,f=u,d=e.ascaleY,p=n.ascaleX,m=0,v=0,g=0;u<0?(u=-u,m=180,g=-1):(m=0,g=1),d<0&&(d=-d,g=-g),p<0?(p=-p,v=180):v=0;var y=n.ax,E=0,w=0,T=0,A=e.a,x=e.b,M=e.c,I=e.d,R=Math.abs(u-d)<=1e-4;R?(w=A*y+x*(E=n.ay)+e.worldX,T=M*y+I*E+e.worldY):(E=0,w=A*y+e.worldX,T=M*y+e.worldY);var b=e.parent;A=b.a,x=b.b,M=b.c;var S,C,P=1/(A*(I=b.d)-x*M),k=w-b.worldX,N=T-b.worldY,_=(k*I-N*x)*P-h,V=(N*A-k*M)*P-c,O=Math.sqrt(_*_+V*V),L=n.data.length*p;if(O<1e-4)return this.apply1(e,r,a,!1,s,!1,l),void n.updateWorldTransformWith(y,E,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var F=((k=r-b.worldX)*I-(N=a-b.worldY)*x)*P-h,D=(N*A-k*M)*P-c,U=F*F+D*D;if(0!=o){o*=u*(p+1)/2;var B=Math.sqrt(U),X=B-O-L*u+o;if(X>0){var Y=Math.min(1,X/(2*o))-1;U=(F-=(Y=(X-o*(1-Y*Y))/B)*F)*F+(D-=Y*D)*D}}t:if(R){var W=(U-O*O-(L*=u)*L)/(2*O*L);W<-1?W=-1:W>1&&(W=1,s&&(f*=(Math.sqrt(U)/(O+L)-1)*l+1)),C=Math.acos(W)*i,A=O+L*W,x=L*Math.sin(C),S=Math.atan2(D*A-F*x,F*A+D*x)}else{var j=(A=u*L)*A,q=(x=d*L)*x,G=Math.atan2(D,F),H=-2*q*O,z=q-j;if((I=H*H-4*z*(M=q*O*O+j*U-j*q))>=0){var Z=Math.sqrt(I);H<0&&(Z=-Z);var $=(Z=-(H+Z)/2)/z,Q=M/Z,J=Math.abs($)=-1&&M<=1&&(M=Math.acos(M),(I=(k=A*Math.cos(M)+O)*k+(N=x*Math.sin(M))*N)it&&(rt=M,it=I,at=k,st=N)),U<=(et+it)/2?(S=G-Math.atan2(nt*i,tt),C=K*i):(S=G-Math.atan2(st*i,at),C=rt*i)}var ot=Math.atan2(E,y)*g,lt=e.arotation;(S=(S-ot)*t.MathUtils.radDeg+m-lt)>180?S-=360:S<-180&&(S+=360),e.updateWorldTransformWith(h,c,lt+S*l,f,e.ascaleY,0,0),lt=n.arotation,(C=((C+ot)*t.MathUtils.radDeg-n.ashearX)*g+v-lt)>180?C-=360:C<-180&&(C+=360),n.updateWorldTransformWith(y,E,lt+C*l,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(a||(a={})),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 s(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(a||(a={})),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,r=t.bones.length;n0;if(a>0||i){var s=this.data,o=s.spacingMode==t.SpacingMode.Percent,l=s.rotateMode,h=l==t.RotateMode.Tangent,c=l==t.RotateMode.ChainScale,u=this.bones.length,f=h?u:u+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),m=null,v=this.spacing;if(c||!o){c&&(m=t.Utils.setArraySize(this.lengths,u));for(var g=s.spacingMode==t.SpacingMode.Length,y=0,E=f-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?B-=t.MathUtils.PI2:B<-t.MathUtils.PI&&(B+=t.MathUtils.PI2),B*=r,X=Math.cos(B),Y=Math.sin(B),k.a=X*L-Y*D,k.b=X*F-Y*U,k.c=Y*L+X*D,k.d=Y*F+X*U}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,a,i,s){var o=this.target,l=this.position,h=this.spaces,c=t.Utils.setArraySize(this.positions,3*r+2),u=null,f=n.closed,d=n.worldVerticesLength,p=d/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[p-=f?1:2];if(i&&(l*=g),s)for(var y=1;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(o,d-6,4,u,0,2)),this.addAfterPosition(T-g,u,0,c,E);continue}}for(;;w++){var A=v[w];if(!(T>A)){if(0==w)T/=A;else T=(T-(Z=v[w-1]))/(A-Z);break}}w!=m&&(m=w,f&&w==p?(n.computeWorldVertices(o,d-4,4,u,0,2),n.computeWorldVertices(o,0,4,u,4,2)):n.computeWorldVertices(o,6*w+2,8,u,0,2)),this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],c,E,a||y>0&&0==q)}return c}f?(d+=2,u=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(o,2,d-4,u,0,2),n.computeWorldVertices(o,0,2,u,d-4,2),u[d-2]=u[0],u[d-1]=u[1]):(p--,d-=4,u=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(o,2,d,u,0,2));for(var x=t.Utils.setArraySize(this.curves,p),M=0,I=u[0],R=u[1],b=0,S=0,C=0,P=0,k=0,N=0,_=0,V=0,O=0,L=0,F=0,D=0,U=0,B=0,X=(y=0,2);yM){this.addAfterPosition(T-M,u,d-4,c,E);continue}}for(;;w++){var G=x[w];if(!(T>G)){if(0==w)T/=G;else T=(T-(Z=x[w-1]))/(G-Z);break}}if(w!=m){m=w;var H=6*w;for(I=u[H],R=u[H+1],b=u[H+2],S=u[H+3],C=u[H+4],P=u[H+5],F=2*(_=.03*(I-2*b+C))+(O=.006*(3*(b-C)-I+(k=u[H+6]))),D=2*(V=.03*(R-2*S+P))+(L=.006*(3*(S-P)-R+(N=u[H+7]))),U=.3*(b-I)+_+.16666667*O,B=.3*(S-R)+V+.16666667*L,W=Math.sqrt(U*U+B*B),Y[0]=W,H=1;H<8;H++)U+=F,B+=D,F+=O,D+=L,W+=Math.sqrt(U*U+B*B),Y[H]=W;U+=F,B+=D,W+=Math.sqrt(U*U+B*B),Y[8]=W,U+=F+O,B+=D+L,W+=Math.sqrt(U*U+B*B),Y[9]=W,j=0}for(T*=W;;j++){var z=Y[j];if(!(T>z)){var Z;if(0==j)T/=z;else T=j+(T-(Z=Y[j-1]))/(z-Z);break}}this.addCurvePosition(.1*T,I,R,b,S,C,P,k,N,c,E,a||y>0&&0==q)}return c},e.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],s=e[n+1],o=e[n+2]-i,l=e[n+3]-s,h=Math.atan2(l,o);r[a]=i+t*Math.cos(h),r[a+1]=s+t*Math.sin(h),r[a+2]=h},e.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],s=e[n+3],o=i-e[n],l=s-e[n+1],h=Math.atan2(l,o);r[a]=i+t*Math.cos(h),r[a+1]=s+t*Math.sin(h),r[a+2]=h},e.prototype.addCurvePosition=function(t,e,n,r,a,i,s,o,l,h,c,u){if(0==t||isNaN(t))return h[c]=e,h[c+1]=n,void(h[c+2]=Math.atan2(a-n,r-e));var f=t*t,d=f*t,p=1-t,m=p*p,v=m*p,g=p*t,y=3*g,E=p*y,w=y*t,T=e*v+r*E+i*w+o*d,A=n*v+a*E+s*w+l*d;h[c]=T,h[c+1]=A,u&&(h[c+2]=t<.001?Math.atan2(a-n,r-e):Math.atan2(A-(n*m+a*g*2+s*f),T-(e*m+r*g*2+i*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(a||(a={})),function(t){var e,n,r,a=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n}return s(e,t),e}(t.ConstraintData);t.PathConstraintData=a,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(a||(a={})),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,r){var a=this.clientAssets[t];return null==a&&(a=new e(t),this.clientAssets[t]=a),null!==n&&(a.textureLoader=n),a.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(n,{mode:"cors"}).then((function(t){return t.ok||(r.errors[n]="Couldn't load image "+n),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){r.rawAssets[n]=t}))}else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(t){r.rawAssets[n]=a},a.onerror=function(t){r.errors[n]="Couldn't load image "+n},a.src=n}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null==n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,n=0;n0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(a||(a={})),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 i=r[r.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(e),this.sortReset(a.children),r[r.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,r=n.data.index,a=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(var i=0,s=this.data.skins.length;i-1||this.updateCacheReset.push(i)}else for(a=0;a0){w=new t.DrawOrderTimeline(L);var F=a.slots.length;for(c=0;c=0;d--)U[d]=-1;var B=t.Utils.newArray(F-D,0),X=0,Y=0;for(d=0;d=0;d--)-1==U[d]&&(U[d]=B[--Y]);w.setFrame(c,y,U)}i.push(w),o=Math.max(o,w.frames[L-1])}var W=n.readInt(!0);if(W>0){for(w=new t.EventTimeline(W),c=0;c>>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&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),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}(),r=function(t,e,n,r,a){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r,this.inheritDeform=a},a=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(a||(a={})),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 r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,s=e.slots,o=s.length;r.length=0,i.freeAll(a),a.length=0;for(var l=0;l=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=s&&n>=s||e>=o&&r>=o)return!1;var l=(r-e)/(n-t),h=l*(a-t)+e;if(h>i&&hi&&ha&&ca&&ct.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||h=n){var c=r[o];c+(n-l)/(h-l)*(r[i]-c)=c&&E<=d||E>=d&&E<=c)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(h*g-l*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=n&&w<=a||w>=a&&w<=n))return!0}c=d,u=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}(a||(a={})),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,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,i=t.Utils.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(n,0,a,i,0,2);var s=this.clippingPolygon;e.makeClockwise(s);for(var o=this.clippingPolygons=this.triangulator.decompose(s,this.triangulator.triangulate(s)),l=0,h=o.length;l>1,U=this.clipOutput,B=t.Utils.setArraySize(c,k+D*p),X=0;X=2?(c=o,o=this.scratch):c=this.scratch,c.length=0,c.push(t),c.push(e),c.push(n),c.push(r),c.push(a),c.push(i),c.push(t),c.push(e),o.length=0;for(var u=s,f=s.length-4,d=0;;d+=2){for(var p=u[d],m=u[d+1],v=u[d+2],g=u[d+3],y=p-v,E=m-g,w=c,T=c.length-2,A=o.length,x=0;x0;if(y*(I-g)-E*(M-v)>0){if(S){o.push(R),o.push(b);continue}var C=(k=b-I)*(v-p)-(N=R-M)*(g-m);if(Math.abs(C)>1e-6){var P=(N*(m-I)-k*(p-M))/C;o.push(p+(v-p)*P),o.push(m+(g-m)*P)}else o.push(p),o.push(m)}else if(S){var k,N;C=(k=b-I)*(v-p)-(N=R-M)*(g-m);if(Math.abs(C)>1e-6){P=(N*(m-I)-k*(p-M))/C;o.push(p+(v-p)*P),o.push(m+(g-m)*P)}else o.push(p),o.push(m);o.push(R),o.push(b)}h=!0}if(A==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var _=o;(o=c).length=0,c=_}if(l!=o){l.length=0;d=0;for(var V=o.length-2;d>1;o=0;f--)-1==q[f]&&(q[f]=H[--Z])}w.setFrame(u++,this.getValue(j,"time",0),q)}i.push(w),s=Math.max(s,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),u=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[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==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(a||(a={})),function(t){var e,n,r=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=r,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 a=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=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(r);t.FakeTexture=i}(a||(a={})),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,i){if(null==i)throw new Error("textureLoader cannot be null.");for(var s=new n(e),o=new Array(4),l=null;;){var h=s.readLine();if(null==h)break;if(0==(h=h.trim()).length)l=null;else if(l){var c=new a;c.name=h,c.page=l;var u=s.readValue();"true"==u.toLocaleLowerCase()?c.degrees=90:"false"==u.toLocaleLowerCase()?c.degrees=0:c.degrees=parseFloat(u),c.rotate=90==c.degrees,s.readTuple(o);var f=parseInt(o[0]),d=parseInt(o[1]);s.readTuple(o);var p=parseInt(o[0]),m=parseInt(o[1]);c.u=f/l.width,c.v=d/l.height,c.rotate?(c.u2=(f+m)/l.width,c.v2=(d+p)/l.height):(c.u2=(f+p)/l.width,c.v2=(d+m)/l.height),c.x=f,c.y=d,c.width=Math.abs(p),c.height=Math.abs(m),4==s.readTuple(o)&&4==s.readTuple(o)&&s.readTuple(o),c.originalWidth=parseInt(o[0]),c.originalHeight=parseInt(o[1]),s.readTuple(o),c.offsetX=parseInt(o[0]),c.offsetY=parseInt(o[1]),c.index=parseInt(s.readValue()),c.texture=l.texture,this.regions.push(c)}else{(l=new r).name=h,2==s.readTuple(o)&&(l.width=parseInt(o[0]),l.height=parseInt(o[1]),s.readTuple(o)),s.readTuple(o),l.minFilter=t.Texture.filterFromString(o[0]),l.magFilter=t.Texture.filterFromString(o[1]);var v=s.readValue();l.uWrap=t.TextureWrap.ClampToEdge,l.vWrap=t.TextureWrap.ClampToEdge,"x"==v?l.uWrap=t.TextureWrap.Repeat:"y"==v?l.vWrap=t.TextureWrap.Repeat:"xy"==v&&(l.uWrap=l.vWrap=t.TextureWrap.Repeat),l.texture=i(h),l.texture.setFilters(l.minFilter,l.magFilter),l.texture.setWraps(l.uWrap,l.vWrap),l.width=l.texture.getImage().width,l.height=l.texture.getImage().height,this.pages.push(l)}}},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 r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(-1==i)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=a}(a||(a={})),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 r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var A=Math.cos(b),x=Math.sin(b);v.a=A*y-x*w,v.b=A*E-x*T,v.c=x*y+A*w,v.d=x*E+A*T,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var I=Math.sqrt(v.a*v.a+v.c*v.c),R=Math.sqrt(s*s+l*l);I>1e-5&&(I=(I+(R-I+this.data.offsetScaleX)*r)/I),v.a*=I,v.c*=I,I=Math.sqrt(v.b*v.b+v.d*v.d),R=Math.sqrt(o*o+h*h),I>1e-5&&(I=(I+(R-I+this.data.offsetScaleY)*r)/I),v.b*=I,v.d*=I,g=!0}if(a>0){E=v.b,T=v.d;var b,S=Math.atan2(T,E);(b=Math.atan2(h,o)-Math.atan2(l,s)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b=S+(b+f)*a;I=Math.sqrt(E*E+T*T);v.b=Math.cos(b)*I,v.d=Math.sin(b)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,s=i.a,o=i.b,l=i.c,h=i.d,c=s*h-o*l>0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var A=Math.cos(R),x=Math.sin(R);v.a=A*y-x*w,v.b=A*E-x*T,v.c=x*y+A*w,v.d=x*E+A*T,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var I=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleX)*r+1;v.a*=I,v.c*=I,I=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleY)*r+1,v.b*=I,v.d*=I,g=!0}if(a>0){var R;(R=Math.atan2(h,o)-Math.atan2(l,s))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);E=v.b,T=v.d;R=Math.atan2(T,E)+(R-t.MathUtils.PI/2+f)*a;I=Math.sqrt(E*E+T*T);v.b=Math.cos(R)*I,v.d=Math.sin(R)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p));var m=l.ashearY;if(0!=r){c=a.ashearY-m+this.data.offsetShearY;c-=360*(16384-(16384.499999999996-c/360|0)),l.shearY+=c*r}l.updateWorldTransformWith(u,f,h,d,p,l.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s1e-5&&(f*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));var p=l.ashearY;0!=r&&(p+=(a.ashearY+this.data.offsetShearY)*r),l.updateWorldTransformWith(c,u,h,f,d,l.ashearX,p)}},e}();t.TransformConstraint=e}(a||(a={})),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 s(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(a||(a={})),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,r=t.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i3;){for(var h=r-1,c=(i=0,1);;){t:if(!s[i]){for(var u=a[h]<<1,f=a[i]<<1,d=a[c]<<1,p=n[u],m=n[u+1],v=n[f],g=n[f+1],y=n[d],E=n[d+1],w=(c+1)%r;w!=h;w=(w+1)%r)if(s[w]){var T=a[w]<<1,A=n[T],x=n[T+1];if(e.positiveArea(y,E,p,m,A,x)&&e.positiveArea(p,m,v,g,A,x)&&e.positiveArea(v,g,y,E,A,x))break t}break}if(0==c){do{if(!s[i])break;i--}while(i>0);break}h=i,i=c,c=(c+1)%r}l.push(a[(r+i-1)%r]),l.push(a[i]),l.push(a[(i+1)%r]),a.splice(i,1),s.splice(i,1);var M=(--r+i-1)%r,I=i==r?0:i;s[M]=e.isConcave(M,r,n,a),s[I]=e.isConcave(I,r,n,a)}return 3==r&&(l.push(a[2]),l.push(a[0]),l.push(a[1])),l},e.prototype.decompose=function(t,n){var r=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var l=-1,h=0,c=0,u=n.length;c0?(a.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(v),o.push(g),o.push(y),o.push(E),o.push(w),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(p),h=e.winding(m,v,g,y,E,w),l=f)}o.length>0&&(a.push(o),i.push(s));for(c=0,u=a.length;c=0;c--)0==(o=a[c]).length&&(a.splice(c,1),this.polygonPool.free(o),s=i[c],i.splice(c,1),this.polygonIndicesPool.free(s));return a},e.isConcave=function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,s=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[s],n[s+1])},e.positiveArea=function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0},e.winding=function(t,e,n,r,a,i){var s=n-t,o=r-e;return a*o-i*s+s*e-t*o>=0?1:-1},e}();t.Triangulator=e}(a||(a={})),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 null!=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,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,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,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,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 r=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 r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(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=r;var a=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=a;var i=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return s(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}(a);t.Pow=i;var o=function(t){function e(e){return t.call(this,e)||this}return s(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(i);t.PowOut=o;var l=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,s=r;i=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?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)*i;var s=t.bone.skeleton,o=t.deform,l=this.vertices,h=this.bones;if(null!=h){for(var c=0,u=0,f=0;f0&&(l=o);for(var w,T=(w=t.bone).worldX,A=w.worldY,x=w.a,M=w.b,I=w.c,R=w.d,b=e,S=a;S)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(l[h.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(l[h.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(l[h.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIER],")")+"(?:".concat(l[h.PRERELEASE],")?").concat(l[h.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(l[h.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(l[h.PRERELEASELOOSE],")?").concat(l[h.BUILD],"?")+")?)?"),d("XRANGE","^".concat(l[h.GTLT],"\\s*").concat(l[h.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(l[h.GTLT],"\\s*").concat(l[h.XRANGEPLAINLOOSE],"$")),d("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),d("COERCE","".concat(l[h.COERCEPLAIN],"(?:$|[^\\d])")),d("COERCEFULL",l[h.COERCEPLAIN]+"(?:".concat(l[h.PRERELEASE],")?")+"(?:".concat(l[h.BUILD],")?")+"(?:$|[^\\d])"),d("COERCERTL",l[h.COERCE],!0),d("COERCERTLFULL",l[h.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(l[h.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(l[h.LONETILDE]).concat(l[h.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(l[h.LONETILDE]).concat(l[h.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(l[h.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(l[h.LONECARET]).concat(l[h.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(l[h.LONECARET]).concat(l[h.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(l[h.GTLT],"\\s*(").concat(l[h.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(l[h.GTLT],"\\s*(").concat(l[h.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(l[h.GTLT],"\\s*(").concat(l[h.LOOSEPLAIN],"|").concat(l[h.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(l[h.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(l[h.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(l[h.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(l[h.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(k,k.exports);var N=k.exports;R(N);var _=Object.freeze({loose:!0}),V=Object.freeze({}),O=function(t){return t?"object"!==o(t)?_:t:V};R(O);var L=/^[0-9]+$/,F=function(t,e){var n=L.test(t),r=L.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tB)throw new TypeError("version is longer than ".concat(B," characters"));U("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?Y[W.LOOSE]:Y[W.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>X||this.major<0)throw new TypeError("Invalid major version");if(this.minor>X||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>X||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var i=[e,r];!1===n&&(i=[e]),0===q(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),H=G;R(H);var z=H,Z=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof z)return t;try{return new z(t,e)}catch(t){if(!n)return null;throw t}};R(Z);var $=Z,Q=R((function(t,e){var n=$(t,e);return n?n.version:null})),J=H,K=Z,tt=N.safeRe,et=N.t,nt=R((function(t,e){if(t instanceof J)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r,a=e.includePrerelease?tt[et.COERCERTLFULL]:tt[et.COERCERTL];(r=a.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=t.match(e.includePrerelease?tt[et.COERCEFULL]:tt[et.COERCE]);if(null===n)return null;var i=n[2],s=n[3]||"0",o=n[4]||"0",l=e.includePrerelease&&n[5]?"-".concat(n[5]):"",h=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return K("".concat(i,".").concat(s,".").concat(o).concat(l).concat(h),e)})),rt=c((function t(){l(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);R(rt);var at=H,it=function(t,e,n){return new at(t,n).compare(new at(e,n))};R(it);var st=it,ot=function(t,e,n){return 0===st(t,e,n)};R(ot);var lt=it,ht=function(t,e,n){return 0!==lt(t,e,n)};R(ht);var ct=it,ut=function(t,e,n){return ct(t,e,n)>0};R(ut);var ft=it,dt=function(t,e,n){return ft(t,e,n)>=0};R(dt);var pt=it,mt=function(t,e,n){return pt(t,e,n)<0};R(mt);var vt=it,gt=function(t,e,n){return vt(t,e,n)<=0};R(gt);var yt,Et,wt,Tt,At=ot,xt=ht,Mt=ut,It=dt,Rt=mt,bt=gt,St=function(t,e,n,r){switch(e){case"===":return"object"===o(t)&&(t=t.version),"object"===o(n)&&(n=n.version),t===n;case"!==":return"object"===o(t)&&(t=t.version),"object"===o(n)&&(n=n.version),t!==n;case"":case"=":case"==":return At(t,n,r);case"!=":return xt(t,n,r);case">":return Mt(t,n,r);case">=":return It(t,n,r);case"<":return Rt(t,n,r);case"<=":return bt(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Ct(){if(Tt)return wt;Tt=1;var t=function(){function t(e,a){var i=this;if(l(this,t),a=n(a),e instanceof t)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new t(e.raw,a);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var s=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[s];else if(this.set.length>1){var o,h=T(this.set);try{for(h.s();!(o=h.n()).done;){var c=o.value;if(1===c.length&&v(c[0])){this.set=[c];break}}}catch(t){h.e(t)}finally{h.f()}}}this.format()}return c(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+t,l=e.get(i);if(l)return l;var c=this.options.loose,v=c?s[o.HYPHENRANGELOOSE]:s[o.HYPHENRANGE];t=t.replace(v,_(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(s[o.COMPARATORTRIM],h),a("comparator trim",t),t=t.replace(s[o.TILDETRIM],u),a("tilde trim",t),t=t.replace(s[o.CARETTRIM],f),a("caret trim",t);var g=t.split(" ").map((function(t){return E(t,n.options)})).join(" ").split(/\s+/).map((function(t){return k(t,n.options)}));c&&(g=g.filter((function(t){return a("loose invalid filter",t,n.options),!!t.match(s[o.COMPARATORLOOSE])}))),a("range list",g);var w,A=new Map,x=g.map((function(t){return new r(t,n.options)})),M=T(x);try{for(M.s();!(w=M.n()).done;){var I=w.value;if(m(I))return[I];A.set(I.value,I)}}catch(t){M.e(t)}finally{M.f()}A.size>1&&A.has("")&&A.delete("");var R=y(A.values());return e.set(i,R),R}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new i(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(i(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(i(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();yt=e;var n=O,r=N.safeRe,a=N.t,i=St,s=P,o=H,h=Ct();return yt}(),a=P,i=H,s=N.safeRe,o=N.t,h=N.comparatorTrimReplace,u=N.tildeTrimReplace,f=N.caretTrimReplace,d=b.FLAG_INCLUDE_PRERELEASE,p=b.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),a=r.pop();n&&r.length;)n=r.every((function(t){return a.intersects(t,e)})),a=r.pop();return n},E=function(t,e){return a("comp",t,e),t=M(t,e),a("caret",t),t=A(t,e),a("tildes",t),t=R(t,e),a("xrange",t),t=C(t,e),a("stars",t),t},w=function(t){return!t||"x"===t.toLowerCase()||"*"===t},A=function(t,e){return t.trim().split(/\s+/).map((function(t){return x(t,e)})).join(" ")},x=function(t,e){var n=e.loose?s[o.TILDELOOSE]:s[o.TILDE];return t.replace(n,(function(e,n,r,i,s){var o;return a("tilde",t,e,n,r,i,s),w(n)?o="":w(r)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):w(i)?o=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):s?(a("replaceTilde pr",s),o=">=".concat(n,".").concat(r,".").concat(i,"-").concat(s," <").concat(n,".").concat(+r+1,".0-0")):o=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",o),o}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){a("caret",t,e);var n=e.loose?s[o.CARETLOOSE]:s[o.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,s,o){var l;return a("caret",t,e,n,i,s,o),w(n)?l="":w(i)?l=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):w(s)?l="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):o?(a("replaceCaret pr",o),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(a("no pr"),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s," <").concat(+n+1,".0.0-0")),a("caret return",l),l}))},R=function(t,e){return a("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return S(t,e)})).join(" ")},S=function(t,e){t=t.trim();var n=e.loose?s[o.XRANGELOOSE]:s[o.XRANGE];return t.replace(n,(function(n,r,i,s,o,l){a("xRange",t,n,r,i,s,o,l);var h=w(i),c=h||w(s),u=c||w(o),f=u;return"="===r&&f&&(r=""),l=e.includePrerelease?"-0":"",h?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(c&&(s=0),o=0,">"===r?(r=">=",c?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===r&&(r="<",c?i=+i+1:s=+s+1),"<"===r&&(l="-0"),n="".concat(r+i,".").concat(s,".").concat(o).concat(l)):c?n=">=".concat(i,".0.0").concat(l," <").concat(+i+1,".0.0-0"):u&&(n=">=".concat(i,".").concat(s,".0").concat(l," <").concat(i,".").concat(+s+1,".0-0")),a("xRange return",n),n}))},C=function(t,e){return a("replaceStars",t,e),t.trim().replace(s[o.STAR],"")},k=function(t,e){return a("replaceGTE0",t,e),t.trim().replace(s[e.includePrerelease?o.GTE0PRE:o.GTE0],"")},_=function(t){return function(e,n,r,a,i,s,o,l,h,c,u,f){return n=w(r)?"":w(a)?">=".concat(r,".0.0").concat(t?"-0":""):w(i)?">=".concat(r,".").concat(a,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),l=w(h)?"":w(c)?"<".concat(+h+1,".0.0-0"):w(u)?"<".concat(h,".").concat(+c+1,".0-0"):f?"<=".concat(h,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(h,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(l),"".concat(n," ").concat(l).trim()}},V=function(t,e,n){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return wt}R(St);var Pt=Ct(),kt=function(t,e,n){try{e=new Pt(e,n)}catch(t){return!1}return e.test(t)},Nt={valid:Q,coerce:nt,satisfies:R(kt),SEMVER_SPEC_VERSION:S.SEMVER_SPEC_VERSION},_t=0,Vt=1,Ot=2,Lt=[0,1,2,2,3,0],Ft=c((function t(e,n,r,s){var o;if(l(this,t),u(this,"autoUpdate",!0),u(this,"skeleton",void 0),u(this,"states",void 0),this._app=e,this._position=new i.Vec3,1===a.TextureAtlas.length){var h,c=T((o=new a.TextureAtlas(n)).pages);try{for(c.s();!(h=c.n()).done;){var f=h.value;f.setTexture(new I(s[f.name]))}}catch(t){c.e(t)}finally{c.f()}}else o=new a.TextureAtlas(n,(function(t){return new I(s[t])}));var d=new a.SkeletonJson(new a.AtlasAttachmentLoader(o));d.scale*=.01;var p=d.readSkeletonData(r);this.skeletonVersion=Nt.valid(Nt.coerce(p.version)),this._spine_3_6_0=Nt.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Nt.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Nt.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Nt.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new a.Skeleton(p),this.skeleton.updateWorldTransform(),this.stateData=new a.AnimationStateData(this.skeleton.data),this.states=[new a.AnimationState(this.stateData)],this.clipper=new a.SkeletonClipping,this._node=new i.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new i.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new i.Vec2,this._aabbTempSize=new i.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[i.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new i.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new i.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,n,t),t=u.material,e=s,n=0),t=u.material;var f=u.positions,d=u.vertexColor.r,p=u.vertexColor.g,m=u.vertexColor.b,v=u.vertexColor.a,g=u.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new i.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=i.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var a=new i.MeshInstance(r,this._materials[n],this._node);a.drawOrder=this.priority+this._meshInstances.length,a.visible=!this._hidden,this._meshInstances.push(a)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function A(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,a=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 r=0;r0&&(e%=this.duration));for(var l=this.timelines,h=0,c=l.length;h>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=a,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"}(r=t.TimelineType||(t.TimelineType={}));var i=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 r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,a,i){var s=.03*(2*-n+a),o=.03*(2*-r+i),l=.006*(3*(n-a)+1),h=.006*(3*(r-i)+1),c=2*s+l,u=2*o+h,f=.3*n+s+.16666667*l,d=.3*r+o+.16666667*h,p=t*e.BEZIER_SIZE,m=this.curves;m[p++]=e.BEZIER;for(var v=f,g=d,y=p+e.BEZIER_SIZE-1;p=r){var c=void 0,u=void 0;return i==l?(c=0,u=0):(c=a[i-2],u=a[i-1]),u+(a[i+1]-u)*(r-c)/(o-c)}var f=a[i-1];return f+(1-f)*(r-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=i;var o=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+i.ROTATION]=n},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(u.active)if(r=c[c.length-i.ENTRIES]){var d=c[c.length+i.PREV_ROTATION];switch(l){case e.setup:u.rotation=u.data.rotation+d*o;break;case e.first:case e.replace:d+=u.data.rotation-u.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:u.rotation+=d*o}}else{var p=a.binarySearch(c,r,i.ENTRIES),m=c[p+i.PREV_ROTATION],v=c[p],g=this.getCurvePercent((p>>1)-1,1-(r-v)/(c[p+i.PREV_TIME]-v)),y=c[p+i.ROTATION]-m;switch(y=m+(y-360*(16384-(16384.499999999996-y/360|0)))*g,l){case e.setup:u.rotation=u.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*o;break;case e.first:case e.replace:y+=u.data.rotation-u.rotation;case e.add:u.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*o}}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_ROTATION=-1,i.ROTATION=1,i}(i);t.RotateTimeline=o;var l=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.X]=n,this.frames[t+i.Y]=r},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(u.active)if(r=c[c.length-i.ENTRIES])f=c[c.length+i.PREV_X],d=c[c.length+i.PREV_Y];else{var p=a.binarySearch(c,r,i.ENTRIES);f=c[p+i.PREV_X],d=c[p+i.PREV_Y];var m=c[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(c[p+i.PREV_TIME]-m));f+=(c[p+i.X]-f)*v,d+=(c[p+i.Y]-d)*v}switch(l){case e.setup:u.x=u.data.x+f*o,u.y=u.data.y+d*o;break;case e.first:case e.replace:u.x+=(u.data.x+f-u.x)*o,u.y+=(u.data.y+d-u.y)*o;break;case e.add:u.x+=f*o,u.y+=d*o}}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_X=-2,i.PREV_Y=-1,i.X=1,i.Y=2,i}(i);t.TranslateTimeline=l;var h=function(i){function o(t){return i.call(this,t)||this}return s(o,i),o.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},o.prototype.apply=function(r,i,s,l,h,c,u){var f=this.frames,d=r.bones[this.boneIndex];if(d.active)if(s=f[f.length-o.ENTRIES])p=f[f.length+o.PREV_X]*d.data.scaleX,m=f[f.length+o.PREV_Y]*d.data.scaleY;else{var v=a.binarySearch(f,s,o.ENTRIES);p=f[v+o.PREV_X],m=f[v+o.PREV_Y];var g=f[v],y=this.getCurvePercent(v/o.ENTRIES-1,1-(s-g)/(f[v+o.PREV_TIME]-g));p=(p+(f[v+o.X]-p)*y)*d.data.scaleX,m=(m+(f[v+o.Y]-m)*y)*d.data.scaleY}if(1==h)c==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=m-d.data.scaleY):(d.scaleX=p,d.scaleY=m);else{var E=0,w=0;if(u==n.mixOut)switch(c){case e.setup:E=d.data.scaleX,w=d.data.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*h,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*h;break;case e.first:case e.replace:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*h,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*h;break;case e.add:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-d.data.scaleX)*h,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-d.data.scaleY)*h}else switch(c){case e.setup:E=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.data.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*h,d.scaleY=w+(m-w)*h;break;case e.first:case e.replace:E=Math.abs(d.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*h,d.scaleY=w+(m-w)*h;break;case e.add:E=t.MathUtils.signum(p),w=t.MathUtils.signum(m),d.scaleX=Math.abs(d.scaleX)*E+(p-Math.abs(d.data.scaleX)*E)*h,d.scaleY=Math.abs(d.scaleY)*w+(m-Math.abs(d.data.scaleY)*w)*h}}}},o}(l);t.ScaleTimeline=h;var c=function(t){function n(e){return t.call(this,e)||this}return s(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,i,s,o,l,h){var c=this.frames,u=t.bones[this.boneIndex];if(u.active)if(i=c[c.length-n.ENTRIES])f=c[c.length+n.PREV_X],d=c[c.length+n.PREV_Y];else{var p=a.binarySearch(c,i,n.ENTRIES);f=c[p+n.PREV_X],d=c[p+n.PREV_Y];var m=c[p],v=this.getCurvePercent(p/n.ENTRIES-1,1-(i-m)/(c[p+n.PREV_TIME]-m));f+=(c[p+n.X]-f)*v,d+=(c[p+n.Y]-d)*v}switch(l){case e.setup:u.shearX=u.data.shearX+f*o,u.shearY=u.data.shearY+d*o;break;case e.first:case e.replace:u.shearX+=(u.data.shearX+f-u.shearX)*o,u.shearY+=(u.data.shearY+d-u.shearY)*o;break;case e.add:u.shearX+=f*o,u.shearY+=d*o}}},n}(l);t.ShearTimeline=c;var u=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,s){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=s},i.prototype.apply=function(t,n,r,s,o,l,h){var c=t.slots[this.slotIndex];if(c.bone.active){var u=this.frames;if(r=u[u.length-i.ENTRIES]){var y=u.length;p=u[y+i.PREV_R],m=u[y+i.PREV_G],v=u[y+i.PREV_B],g=u[y+i.PREV_A]}else{var E=a.binarySearch(u,r,i.ENTRIES);p=u[E+i.PREV_R],m=u[E+i.PREV_G],v=u[E+i.PREV_B],g=u[E+i.PREV_A];var w=u[E],T=this.getCurvePercent(E/i.ENTRIES-1,1-(r-w)/(u[E+i.PREV_TIME]-w));p+=(u[E+i.R]-p)*T,m+=(u[E+i.G]-m)*T,v+=(u[E+i.B]-v)*T,g+=(u[E+i.A]-g)*T}if(1==o)c.color.set(p,m,v,g);else{f=c.color;l==e.setup&&f.setFromColor(c.data.color),f.add((p-f.r)*o,(m-f.g)*o,(v-f.b)*o,(g-f.a)*o)}}}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_R=-4,i.PREV_G=-3,i.PREV_B=-2,i.PREV_A=-1,i.R=1,i.G=2,i.B=3,i.A=4,i}(i);t.ColorTimeline=u;var f=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,s,o,l,h){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=s,this.frames[t+i.R2]=o,this.frames[t+i.G2]=l,this.frames[t+i.B2]=h},i.prototype.apply=function(t,n,r,s,o,l,h){var c=t.slots[this.slotIndex];if(c.bone.active){var u=this.frames;if(r=u[u.length-i.ENTRIES]){var x=u.length;v=u[x+i.PREV_R],g=u[x+i.PREV_G],y=u[x+i.PREV_B],E=u[x+i.PREV_A],w=u[x+i.PREV_R2],T=u[x+i.PREV_G2],A=u[x+i.PREV_B2]}else{var M=a.binarySearch(u,r,i.ENTRIES);v=u[M+i.PREV_R],g=u[M+i.PREV_G],y=u[M+i.PREV_B],E=u[M+i.PREV_A],w=u[M+i.PREV_R2],T=u[M+i.PREV_G2],A=u[M+i.PREV_B2];var I=u[M],R=this.getCurvePercent(M/i.ENTRIES-1,1-(r-I)/(u[M+i.PREV_TIME]-I));v+=(u[M+i.R]-v)*R,g+=(u[M+i.G]-g)*R,y+=(u[M+i.B]-y)*R,E+=(u[M+i.A]-E)*R,w+=(u[M+i.R2]-w)*R,T+=(u[M+i.G2]-T)*R,A+=(u[M+i.B2]-A)*R}if(1==o)c.color.set(v,g,y,E),c.darkColor.set(w,T,A,1);else{f=c.color,d=c.darkColor;l==e.setup&&(f.setFromColor(c.data.color),d.setFromColor(c.data.darkColor)),f.add((v-f.r)*o,(g-f.g)*o,(y-f.b)*o,(E-f.a)*o),d.add((w-d.r)*o,(T-d.g)*o,(A-d.b)*o,0)}}}},i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,i}(i);t.TwoColorTimeline=f;var d=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return i.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},i.prototype.apply=function(t,r,i,s,o,l,h){var c=t.slots[this.slotIndex];if(c.bone.active)if(h!=n.mixOut){var u=this.frames;if(i=u[u.length-1]?u.length-1:a.binarySearch(u,i,1)-1;var d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else l==e.setup&&this.setAttachment(t,c,c.data.attachmentName)},i.prototype.setAttachment=function(t,e,n){e.setAttachment(null==n?null:t.getAttachment(this.slotIndex,n))},i}();t.AttachmentTimeline=d;var p=null,m=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},i.prototype.apply=function(n,r,i,s,o,l,h){var c=n.slots[this.slotIndex];if(c.bone.active){var u=c.getAttachment();if(u instanceof t.VertexAttachment&&u.deformAttachment==this.attachment){var f=c.deform;0==f.length&&(l=e.setup);var d=this.frameVertices,p=d[0].length,m=this.frames;if(i=m[m.length-1]){var T=d[m.length-1];if(1==o)if(l==e.add)if(null==(v=u).bones){y=v.vertices;for(var A=0;An)this.apply(t,e,Number.MAX_VALUE,r,i,s,o),e=-1;else if(e>=l[h-1])return;if(!(n0&&l[c-1]==u;)c--;for(;c=l[c];c++)r.push(this.events[c])}}},e}();t.EventTimeline=v;var g=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return i.prototype.getPropertyId=function(){return r.drawOrder<<24},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},i.prototype.apply=function(r,i,s,o,l,h,c){var u=r.drawOrder,f=r.slots;if(c!=n.mixOut){var d=this.frames;if(s=d[d.length-1]?d.length-1:a.binarySearch(d,s)-1;var m=this.drawOrders[p];if(null==m)t.Utils.arrayCopy(f,0,u,0,f.length);else for(var v=0,g=m.length;v=u[u.length-o.ENTRIES])h==e.setup?(f.mix=f.data.mix+(u[u.length+o.PREV_MIX]-f.data.mix)*l,f.softness=f.data.softness+(u[u.length+o.PREV_SOFTNESS]-f.data.softness)*l,c==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=u[u.length+o.PREV_BEND_DIRECTION],f.compress=0!=u[u.length+o.PREV_COMPRESS],f.stretch=0!=u[u.length+o.PREV_STRETCH])):(f.mix+=(u[u.length+o.PREV_MIX]-f.mix)*l,f.softness+=(u[u.length+o.PREV_SOFTNESS]-f.softness)*l,c==n.mixIn&&(f.bendDirection=u[u.length+o.PREV_BEND_DIRECTION],f.compress=0!=u[u.length+o.PREV_COMPRESS],f.stretch=0!=u[u.length+o.PREV_STRETCH]));else{var d=a.binarySearch(u,i,o.ENTRIES),p=u[d+o.PREV_MIX],m=u[d+o.PREV_SOFTNESS],v=u[d],g=this.getCurvePercent(d/o.ENTRIES-1,1-(i-v)/(u[d+o.PREV_TIME]-v));h==e.setup?(f.mix=f.data.mix+(p+(u[d+o.MIX]-p)*g-f.data.mix)*l,f.softness=f.data.softness+(m+(u[d+o.SOFTNESS]-m)*g-f.data.softness)*l,c==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=u[d+o.PREV_BEND_DIRECTION],f.compress=0!=u[d+o.PREV_COMPRESS],f.stretch=0!=u[d+o.PREV_STRETCH])):(f.mix+=(p+(u[d+o.MIX]-p)*g-f.mix)*l,f.softness+=(m+(u[d+o.SOFTNESS]-m)*g-f.softness)*l,c==n.mixIn&&(f.bendDirection=u[d+o.PREV_BEND_DIRECTION],f.compress=0!=u[d+o.PREV_COMPRESS],f.stretch=0!=u[d+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(i);t.IkConstraintTimeline=y;var E=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},i.prototype.setFrame=function(t,e,n,r,a,s){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r,this.frames[t+i.SCALE]=a,this.frames[t+i.SHEAR]=s},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.transformConstraints[this.transformConstraintIndex];if(u.active)if(r=c[c.length-i.ENTRIES]){var g=c.length;d=c[g+i.PREV_ROTATE],p=c[g+i.PREV_TRANSLATE],m=c[g+i.PREV_SCALE],v=c[g+i.PREV_SHEAR]}else{var y=a.binarySearch(c,r,i.ENTRIES);d=c[y+i.PREV_ROTATE],p=c[y+i.PREV_TRANSLATE],m=c[y+i.PREV_SCALE],v=c[y+i.PREV_SHEAR];var E=c[y],w=this.getCurvePercent(y/i.ENTRIES-1,1-(r-E)/(c[y+i.PREV_TIME]-E));d+=(c[y+i.ROTATE]-d)*w,p+=(c[y+i.TRANSLATE]-p)*w,m+=(c[y+i.SCALE]-m)*w,v+=(c[y+i.SHEAR]-v)*w}if(l==e.setup){f=u.data;u.rotateMix=f.rotateMix+(d-f.rotateMix)*o,u.translateMix=f.translateMix+(p-f.translateMix)*o,u.scaleMix=f.scaleMix+(m-f.scaleMix)*o,u.shearMix=f.shearMix+(v-f.shearMix)*o}else u.rotateMix+=(d-u.rotateMix)*o,u.translateMix+=(p-u.translateMix)*o,u.scaleMix+=(m-u.scaleMix)*o,u.shearMix+=(v-u.shearMix)*o}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_ROTATE=-4,i.PREV_TRANSLATE=-3,i.PREV_SCALE=-2,i.PREV_SHEAR=-1,i.ROTATE=1,i.TRANSLATE=2,i.SCALE=3,i.SHEAR=4,i}(i);t.TransformConstraintTimeline=E;var w=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.VALUE]=n},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(u.active)if(r=c[c.length-i.ENTRIES])f=c[c.length+i.PREV_VALUE];else{var d=a.binarySearch(c,r,i.ENTRIES);f=c[d+i.PREV_VALUE];var p=c[d],m=this.getCurvePercent(d/i.ENTRIES-1,1-(r-p)/(c[d+i.PREV_TIME]-p));f+=(c[d+i.VALUE]-f)*m}l==e.setup?u.position=u.data.position+(f-u.data.position)*o:u.position+=(f-u.position)*o}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_VALUE=-1,i.VALUE=1,i}(i);t.PathConstraintPositionTimeline=w;var T=function(t){function n(e){return t.call(this,e)||this}return s(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,i,s,o,l,h){var c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(u.active)if(i=c[c.length-n.ENTRIES])f=c[c.length+n.PREV_VALUE];else{var d=a.binarySearch(c,i,n.ENTRIES);f=c[d+n.PREV_VALUE];var p=c[d],m=this.getCurvePercent(d/n.ENTRIES-1,1-(i-p)/(c[d+n.PREV_TIME]-p));f+=(c[d+n.VALUE]-f)*m}l==e.setup?u.spacing=u.data.spacing+(f-u.data.spacing)*o:u.spacing+=(f-u.spacing)*o}},n}(w);t.PathConstraintSpacingTimeline=T;var A=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return s(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r},i.prototype.apply=function(t,n,r,s,o,l,h){var c=this.frames,u=t.pathConstraints[this.pathConstraintIndex];if(u.active)if(r=c[c.length-i.ENTRIES])f=c[c.length+i.PREV_ROTATE],d=c[c.length+i.PREV_TRANSLATE];else{var p=a.binarySearch(c,r,i.ENTRIES);f=c[p+i.PREV_ROTATE],d=c[p+i.PREV_TRANSLATE];var m=c[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(c[p+i.PREV_TIME]-m));f+=(c[p+i.ROTATE]-f)*v,d+=(c[p+i.TRANSLATE]-d)*v}l==e.setup?(u.rotateMix=u.data.rotateMix+(f-u.data.rotateMix)*o,u.translateMix=u.data.translateMix+(d-u.data.translateMix)*o):(u.rotateMix+=(f-u.rotateMix)*o,u.translateMix+=(d-u.translateMix)*o)}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_ROTATE=-2,i.PREV_TRANSLATE=-1,i.ROTATE=1,i.TRANSLATE=2,i}(i);t.PathConstraintMixTimeline=A}(a||(a={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!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,r=e.length;n0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var s=a.next;if(null!=s){var o=a.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==a.timeScale?0:(o/a.timeScale+t)*s.timeScale,a.trackTime+=i,this.setCurrent(n,s,!0);null!=s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&null==a.mixingFrom){e[n]=null,this.queue.end(a),this.disposeNext(a);continue}if(null!=a.mixingFrom&&this.updateMixingFrom(a,t)){var l=a.mixingFrom;for(a.mixingFrom=null,null!=l&&(l.mixingTo=null);null!=l;)this.queue.end(l),l=l.mixingFrom}a.trackTime+=i}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=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)),r):(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 r=this.events,a=this.tracks,i=!1,s=0,o=a.length;s0)){i=!0;var h=0==s?t.MixBlend.first:l.mixBlend,c=l.alpha;null!=l.mixingFrom?c*=this.applyMixingFrom(l,n,h):l.trackTime>=l.trackEnd&&null==l.next&&(c=0);var u=l.animationLast,f=l.getAnimationTime(),d=l.animation.timelines.length,p=l.animation.timelines;if(0==s&&1==c||h==t.MixBlend.add)for(var m=0;m1&&(s=1),a!=t.MixBlend.first&&(a=i.mixBlend));var o=s0&&this.queueEvents(i,u),this.events.length=0,i.nextAnimationLast=u,i.nextTrackLast=i.trackTime,s},e.prototype.applyAttachmentTimeline=function(n,r,a,i,s){var o=r.slots[n.slotIndex];if(o.bone.active){var l,h=n.frames;if(a=h[h.length-1]?h.length-1:t.Animation.binarySearch(h,a)-1,this.setAttachment(r,o,n.attachmentNames[l],s);o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,n,r,a){n.setAttachment(null==r?null:t.getAttachment(n.data.index,r)),a&&(n.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,n,r,a,i,s,o,l){if(l&&(s[o]=0),1!=a){var h=e,c=h.frames,u=n.bones[h.boneIndex];if(u.active){var f=0,d=0;if(r=c[c.length-t.RotateTimeline.ENTRIES])d=u.data.rotation+c[c.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(c,r,t.RotateTimeline.ENTRIES),m=c[p+t.RotateTimeline.PREV_ROTATION],v=c[p],g=h.getCurvePercent((p>>1)-1,1-(r-v)/(c[p+t.RotateTimeline.PREV_TIME]-v));d=c[p+t.RotateTimeline.ROTATION]-m,d=m+(d-=360*(16384-(16384.499999999996-d/360|0)))*g+u.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var y=0,E=d-f;if(0==(E-=360*(16384-(16384.499999999996-E/360|0))))y=s[o];else{var w=0,T=0;l?(w=0,T=E):(w=s[o],T=s[o+1]);var A=E>0,x=w>=0;t.MathUtils.signum(T)!=t.MathUtils.signum(E)&&Math.abs(T)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),x=A),y=E+w-w%360,x!=A&&(y+=360*t.MathUtils.signum(w)),s[o]=y}s[o+1]=E,f+=y*a,u.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(n,0,r,null,1,i,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,s=this.events,o=0,l=s.length;or||this.queue.event(t,h)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&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 r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,r=!1):this.disposeNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i},e.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,i,!0),this.queue.drain();else if(a.next=i,r<=0){var s=a.animationEnd-a.animationStart;0!=s?(a.loop?r+=s*(1+(a.trackTime/s|0)):r+=Math.max(s,a.trackTime),r-=this.data.getMix(a.animation,e)):r=a.trackTime}return i.delay=r,i},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var a=this.addAnimationWith(t,e.emptyAnimation,!1,r);return a.mixDuration=n,a.trackEnd=n,a},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n0){s[h]=e.HOLD_MIX,o[h]=f;continue t}break}s[h]=e.HOLD_FIRST}else s[h]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=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_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,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 r,a=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.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?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(s){var o={count:0},l=new Array;try{new t.TextureAtlas(s,(function(e){l.push(""==i?e:i+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)}))}catch(t){var h=t;return a.errors[e]="Couldn't load texture atlas "+e+": "+h.message,r&&r(e,"Couldn't load texture atlas "+e+": "+h.message),a.toLoad--,void a.loaded++}for(var c=function(h){var c=!1;a.loadTexture(h,(function(h,u){if(o.count++,o.count==l.length)if(c)a.errors[e]="Couldn't load texture atlas page "+h+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+h+" of atlas "+e),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(s,(function(t){return a.get(""==i?t:i+"/"+t)}));a.assets[e]=f,n&&n(e,f),a.toLoad--,a.loaded++}catch(t){var d=t;a.errors[e]="Couldn't load texture atlas "+e+": "+d.message,r&&r(e,"Couldn't load texture atlas "+e+": "+d.message),a.toLoad--,a.loaded++}}),(function(t,n){c=!0,o.count++,o.count==l.length&&(a.errors[e]="Couldn't load texture atlas page "+t+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+t+" of atlas "+e),a.toLoad--,a.loaded++)}))},u=0,f=l;u0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(a||(a={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");a.renderObject=a;var i=new t.RegionAttachment(n);return i.setRegion(a),i},e.prototype.newMeshAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");a.renderObject=a;var i=new t.MeshAttachment(n);return i.region=a,i},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}(a||(a={})),function(t){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(a||(a={})),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.c=0,this.d=0,this.worldY=0,this.worldX=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,r,a,i,s,o){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=a,this.ascaleY=i,this.ashearX=s,this.ashearY=o,this.appliedValid=!0;var l=this.parent;if(null==l){var h=this.skeleton,c=r+90+o,u=h.scaleX,f=h.scaleY;return this.a=t.MathUtils.cosDeg(r+s)*a*u,this.b=t.MathUtils.cosDeg(c)*i*u,this.c=t.MathUtils.sinDeg(r+s)*a*f,this.d=t.MathUtils.sinDeg(c)*i*f,this.worldX=e*u+h.x,void(this.worldY=n*f+h.y)}var d=l.a,p=l.b,m=l.c,v=l.d;switch(this.worldX=d*e+p*n+l.worldX,this.worldY=m*e+v*n+l.worldY,this.data.transformMode){case t.TransformMode.Normal:c=r+90+o;var g=t.MathUtils.cosDeg(r+s)*a,y=t.MathUtils.cosDeg(c)*i,E=t.MathUtils.sinDeg(r+s)*a,w=t.MathUtils.sinDeg(c)*i;return this.a=d*g+p*E,this.b=d*y+p*w,this.c=m*g+v*E,void(this.d=m*y+v*w);case t.TransformMode.OnlyTranslation:c=r+90+o;this.a=t.MathUtils.cosDeg(r+s)*a,this.b=t.MathUtils.cosDeg(c)*i,this.c=t.MathUtils.sinDeg(r+s)*a,this.d=t.MathUtils.sinDeg(c)*i;break;case t.TransformMode.NoRotationOrReflection:var T=0;(M=d*d+m*m)>1e-4?(M=Math.abs(d*v-p*m)/M,d/=this.skeleton.scaleX,p=(m/=this.skeleton.scaleY)*M,v=d*M,T=Math.atan2(m,d)*t.MathUtils.radDeg):(d=0,m=0,T=90-Math.atan2(v,p)*t.MathUtils.radDeg);var A=r+s-T,x=r+o-T+90;g=t.MathUtils.cosDeg(A)*a,y=t.MathUtils.cosDeg(x)*i,E=t.MathUtils.sinDeg(A)*a,w=t.MathUtils.sinDeg(x)*i;this.a=d*g-p*E,this.b=d*y-p*w,this.c=m*g+v*E,this.d=m*y+v*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var M,I=t.MathUtils.cosDeg(r),R=t.MathUtils.sinDeg(r),b=(d*I+p*R)/this.skeleton.scaleX,S=(m*I+v*R)/this.skeleton.scaleY;(M=Math.sqrt(b*b+S*S))>1e-5&&(M=1/M),b*=M,S*=M,M=Math.sqrt(b*b+S*S),this.data.transformMode==t.TransformMode.NoScale&&d*v-p*m<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(M=-M);var C=Math.PI/2+Math.atan2(S,b),P=Math.cos(C)*M,k=Math.sin(C)*M;g=t.MathUtils.cosDeg(s)*a,y=t.MathUtils.cosDeg(90+o)*i,E=t.MathUtils.sinDeg(s)*a,w=t.MathUtils.sinDeg(90+o)*i;this.a=b*g+P*E,this.b=b*y+P*w,this.c=S*g+k*E,this.d=S*y+k*w}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,r=e.b,a=e.c,i=e.d,s=1/(n*i-r*a),o=this.worldX-e.worldX,l=this.worldY-e.worldY;this.ax=o*i*s-l*r*s,this.ay=l*n*s-o*a*s;var h=s*i,c=s*n,u=s*r,f=s*a,d=h*this.a-u*this.c,p=h*this.b-u*this.d,m=c*this.c-f*this.a,v=c*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+m*m),this.ascaleX>1e-4){var g=d*v-p*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*p+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,a=this.d,i=1/(e*a-n*r),s=t.x-this.worldX,o=t.y-this.worldY;return t.x=s*a*i-o*n*i,t.y=o*e*i-s*r*i,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),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-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),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,a=this.c,i=this.d,s=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=s*n-o*a,this.b=s*r-o*i,this.c=o*n+s*a,this.d=o*r+s*i,this.appliedValid=!1},e}();t.Bone=e}(a||(a={})),function(t){var e,n=function(n,r,a){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==r)throw new Error("name cannot be null.");this.index=n,this.name=r,this.parent=a};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={}))}(a||(a={})),function(t){var e=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n};t.ConstraintData=e}(a||(a={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(a||(a={})),function(t){var e=function(t){this.name=t};t.EventData=e}(a||(a={})),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?d-=360:d<-180&&(d+=360);var A=e.ascaleX,x=e.ascaleY;if(a||i){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=n-e.worldX,m=r-e.worldY}var M=e.data.length*A,I=Math.sqrt(p*p+m*m);if(a&&IM&&M>1e-4)A*=v=(I/M-1)*o+1,s&&(x*=v)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*o,A,x,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,a,i,s,o,l){if(0!=l){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var h=e.ax,c=e.ay,u=e.ascaleX,f=u,d=e.ascaleY,p=n.ascaleX,m=0,v=0,g=0;u<0?(u=-u,m=180,g=-1):(m=0,g=1),d<0&&(d=-d,g=-g),p<0?(p=-p,v=180):v=0;var y=n.ax,E=0,w=0,T=0,A=e.a,x=e.b,M=e.c,I=e.d,R=Math.abs(u-d)<=1e-4;R?(w=A*y+x*(E=n.ay)+e.worldX,T=M*y+I*E+e.worldY):(E=0,w=A*y+e.worldX,T=M*y+e.worldY);var b=e.parent;A=b.a,x=b.b,M=b.c;var S,C,P=1/(A*(I=b.d)-x*M),k=w-b.worldX,N=T-b.worldY,_=(k*I-N*x)*P-h,V=(N*A-k*M)*P-c,O=Math.sqrt(_*_+V*V),L=n.data.length*p;if(O<1e-4)return this.apply1(e,r,a,!1,s,!1,l),void n.updateWorldTransformWith(y,E,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var F=((k=r-b.worldX)*I-(N=a-b.worldY)*x)*P-h,D=(N*A-k*M)*P-c,U=F*F+D*D;if(0!=o){o*=u*(p+1)/2;var B=Math.sqrt(U),X=B-O-L*u+o;if(X>0){var Y=Math.min(1,X/(2*o))-1;U=(F-=(Y=(X-o*(1-Y*Y))/B)*F)*F+(D-=Y*D)*D}}t:if(R){var W=(U-O*O-(L*=u)*L)/(2*O*L);W<-1?W=-1:W>1&&(W=1,s&&(f*=(Math.sqrt(U)/(O+L)-1)*l+1)),C=Math.acos(W)*i,A=O+L*W,x=L*Math.sin(C),S=Math.atan2(D*A-F*x,F*A+D*x)}else{var j=(A=u*L)*A,q=(x=d*L)*x,G=Math.atan2(D,F),H=-2*q*O,z=q-j;if((I=H*H-4*z*(M=q*O*O+j*U-j*q))>=0){var Z=Math.sqrt(I);H<0&&(Z=-Z);var $=(Z=-(H+Z)/2)/z,Q=M/Z,J=Math.abs($)=-1&&M<=1&&(M=Math.acos(M),(I=(k=A*Math.cos(M)+O)*k+(N=x*Math.sin(M))*N)it&&(rt=M,it=I,at=k,st=N)),U<=(et+it)/2?(S=G-Math.atan2(nt*i,tt),C=K*i):(S=G-Math.atan2(st*i,at),C=rt*i)}var ot=Math.atan2(E,y)*g,lt=e.arotation;(S=(S-ot)*t.MathUtils.radDeg+m-lt)>180?S-=360:S<-180&&(S+=360),e.updateWorldTransformWith(h,c,lt+S*l,f,e.ascaleY,0,0),lt=n.arotation,(C=((C+ot)*t.MathUtils.radDeg-n.ashearX)*g+v-lt)>180?C-=360:C<-180&&(C+=360),n.updateWorldTransformWith(y,E,lt+C*l,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(a||(a={})),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 s(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(a||(a={})),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,r=t.bones.length;n0;if(a>0||i){var s=this.data,o=s.spacingMode==t.SpacingMode.Percent,l=s.rotateMode,h=l==t.RotateMode.Tangent,c=l==t.RotateMode.ChainScale,u=this.bones.length,f=h?u:u+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),m=null,v=this.spacing;if(c||!o){c&&(m=t.Utils.setArraySize(this.lengths,u));for(var g=s.spacingMode==t.SpacingMode.Length,y=0,E=f-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?B-=t.MathUtils.PI2:B<-t.MathUtils.PI&&(B+=t.MathUtils.PI2),B*=r,X=Math.cos(B),Y=Math.sin(B),k.a=X*L-Y*D,k.b=X*F-Y*U,k.c=Y*L+X*D,k.d=Y*F+X*U}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,a,i,s){var o=this.target,l=this.position,h=this.spaces,c=t.Utils.setArraySize(this.positions,3*r+2),u=null,f=n.closed,d=n.worldVerticesLength,p=d/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[p-=f?1:2];if(i&&(l*=g),s)for(var y=1;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(o,d-6,4,u,0,2)),this.addAfterPosition(T-g,u,0,c,E);continue}}for(;;w++){var A=v[w];if(!(T>A)){if(0==w)T/=A;else T=(T-(Z=v[w-1]))/(A-Z);break}}w!=m&&(m=w,f&&w==p?(n.computeWorldVertices(o,d-4,4,u,0,2),n.computeWorldVertices(o,0,4,u,4,2)):n.computeWorldVertices(o,6*w+2,8,u,0,2)),this.addCurvePosition(T,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],c,E,a||y>0&&0==q)}return c}f?(d+=2,u=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(o,2,d-4,u,0,2),n.computeWorldVertices(o,0,2,u,d-4,2),u[d-2]=u[0],u[d-1]=u[1]):(p--,d-=4,u=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(o,2,d,u,0,2));for(var x=t.Utils.setArraySize(this.curves,p),M=0,I=u[0],R=u[1],b=0,S=0,C=0,P=0,k=0,N=0,_=0,V=0,O=0,L=0,F=0,D=0,U=0,B=0,X=(y=0,2);yM){this.addAfterPosition(T-M,u,d-4,c,E);continue}}for(;;w++){var G=x[w];if(!(T>G)){if(0==w)T/=G;else T=(T-(Z=x[w-1]))/(G-Z);break}}if(w!=m){m=w;var H=6*w;for(I=u[H],R=u[H+1],b=u[H+2],S=u[H+3],C=u[H+4],P=u[H+5],F=2*(_=.03*(I-2*b+C))+(O=.006*(3*(b-C)-I+(k=u[H+6]))),D=2*(V=.03*(R-2*S+P))+(L=.006*(3*(S-P)-R+(N=u[H+7]))),U=.3*(b-I)+_+.16666667*O,B=.3*(S-R)+V+.16666667*L,W=Math.sqrt(U*U+B*B),Y[0]=W,H=1;H<8;H++)U+=F,B+=D,F+=O,D+=L,W+=Math.sqrt(U*U+B*B),Y[H]=W;U+=F,B+=D,W+=Math.sqrt(U*U+B*B),Y[8]=W,U+=F+O,B+=D+L,W+=Math.sqrt(U*U+B*B),Y[9]=W,j=0}for(T*=W;;j++){var z=Y[j];if(!(T>z)){var Z;if(0==j)T/=z;else T=j+(T-(Z=Y[j-1]))/(z-Z);break}}this.addCurvePosition(.1*T,I,R,b,S,C,P,k,N,c,E,a||y>0&&0==q)}return c},e.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],s=e[n+1],o=e[n+2]-i,l=e[n+3]-s,h=Math.atan2(l,o);r[a]=i+t*Math.cos(h),r[a+1]=s+t*Math.sin(h),r[a+2]=h},e.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],s=e[n+3],o=i-e[n],l=s-e[n+1],h=Math.atan2(l,o);r[a]=i+t*Math.cos(h),r[a+1]=s+t*Math.sin(h),r[a+2]=h},e.prototype.addCurvePosition=function(t,e,n,r,a,i,s,o,l,h,c,u){if(0==t||isNaN(t))return h[c]=e,h[c+1]=n,void(h[c+2]=Math.atan2(a-n,r-e));var f=t*t,d=f*t,p=1-t,m=p*p,v=m*p,g=p*t,y=3*g,E=p*y,w=y*t,T=e*v+r*E+i*w+o*d,A=n*v+a*E+s*w+l*d;h[c]=T,h[c+1]=A,u&&(h[c+2]=t<.001?Math.atan2(a-n,r-e):Math.atan2(A-(n*m+a*g*2+s*f),T-(e*m+r*g*2+i*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(a||(a={})),function(t){var e,n,r,a=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n}return s(e,t),e}(t.ConstraintData);t.PathConstraintData=a,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(a||(a={})),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,r){var a=this.clientAssets[t];return null==a&&(a=new e(t),this.clientAssets[t]=a),null!==n&&(a.textureLoader=n),a.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(n,{mode:"cors"}).then((function(t){return t.ok||(r.errors[n]="Couldn't load image "+n),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){r.rawAssets[n]=t}))}else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(t){r.rawAssets[n]=a},a.onerror=function(t){r.errors[n]="Couldn't load image "+n},a.src=n}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null==n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,n=0;n0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(a||(a={})),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 i=r[r.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(e),this.sortReset(a.children),r[r.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,r=n.data.index,a=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(var i=0,s=this.data.skins.length;i-1||this.updateCacheReset.push(i)}else for(a=0;a0){w=new t.DrawOrderTimeline(L);var F=a.slots.length;for(c=0;c=0;d--)U[d]=-1;var B=t.Utils.newArray(F-D,0),X=0,Y=0;for(d=0;d=0;d--)-1==U[d]&&(U[d]=B[--Y]);w.setFrame(c,y,U)}i.push(w),o=Math.max(o,w.frames[L-1])}var W=n.readInt(!0);if(W>0){for(w=new t.EventTimeline(W),c=0;c>>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&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),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}(),r=function(t,e,n,r,a){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r,this.inheritDeform=a},a=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(a||(a={})),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 r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,s=e.slots,o=s.length;r.length=0,i.freeAll(a),a.length=0;for(var l=0;l=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=s&&n>=s||e>=o&&r>=o)return!1;var l=(r-e)/(n-t),h=l*(a-t)+e;if(h>i&&hi&&ha&&ca&&ct.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||h=n){var c=r[o];c+(n-l)/(h-l)*(r[i]-c)=c&&E<=d||E>=d&&E<=c)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(h*g-l*m)/y;if((w>=u&&w<=p||w>=p&&w<=u)&&(w>=n&&w<=a||w>=a&&w<=n))return!0}c=d,u=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}(a||(a={})),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,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,i=t.Utils.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(n,0,a,i,0,2);var s=this.clippingPolygon;e.makeClockwise(s);for(var o=this.clippingPolygons=this.triangulator.decompose(s,this.triangulator.triangulate(s)),l=0,h=o.length;l>1,U=this.clipOutput,B=t.Utils.setArraySize(c,k+D*p),X=0;X=2?(c=o,o=this.scratch):c=this.scratch,c.length=0,c.push(t),c.push(e),c.push(n),c.push(r),c.push(a),c.push(i),c.push(t),c.push(e),o.length=0;for(var u=s,f=s.length-4,d=0;;d+=2){for(var p=u[d],m=u[d+1],v=u[d+2],g=u[d+3],y=p-v,E=m-g,w=c,T=c.length-2,A=o.length,x=0;x0;if(y*(I-g)-E*(M-v)>0){if(S){o.push(R),o.push(b);continue}var C=(k=b-I)*(v-p)-(N=R-M)*(g-m);if(Math.abs(C)>1e-6){var P=(N*(m-I)-k*(p-M))/C;o.push(p+(v-p)*P),o.push(m+(g-m)*P)}else o.push(p),o.push(m)}else if(S){var k,N;C=(k=b-I)*(v-p)-(N=R-M)*(g-m);if(Math.abs(C)>1e-6){P=(N*(m-I)-k*(p-M))/C;o.push(p+(v-p)*P),o.push(m+(g-m)*P)}else o.push(p),o.push(m);o.push(R),o.push(b)}h=!0}if(A==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var _=o;(o=c).length=0,c=_}if(l!=o){l.length=0;d=0;for(var V=o.length-2;d>1;o=0;f--)-1==q[f]&&(q[f]=H[--Z])}w.setFrame(u++,this.getValue(j,"time",0),q)}i.push(w),s=Math.max(s,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),u=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[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==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(a||(a={})),function(t){var e,n,r=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=r,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 a=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=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(r);t.FakeTexture=i}(a||(a={})),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,i){if(null==i)throw new Error("textureLoader cannot be null.");for(var s=new n(e),o=new Array(4),l=null;;){var h=s.readLine();if(null==h)break;if(0==(h=h.trim()).length)l=null;else if(l){var c=new a;c.name=h,c.page=l;var u=s.readValue();"true"==u.toLocaleLowerCase()?c.degrees=90:"false"==u.toLocaleLowerCase()?c.degrees=0:c.degrees=parseFloat(u),c.rotate=90==c.degrees,s.readTuple(o);var f=parseInt(o[0]),d=parseInt(o[1]);s.readTuple(o);var p=parseInt(o[0]),m=parseInt(o[1]);c.u=f/l.width,c.v=d/l.height,c.rotate?(c.u2=(f+m)/l.width,c.v2=(d+p)/l.height):(c.u2=(f+p)/l.width,c.v2=(d+m)/l.height),c.x=f,c.y=d,c.width=Math.abs(p),c.height=Math.abs(m),4==s.readTuple(o)&&4==s.readTuple(o)&&s.readTuple(o),c.originalWidth=parseInt(o[0]),c.originalHeight=parseInt(o[1]),s.readTuple(o),c.offsetX=parseInt(o[0]),c.offsetY=parseInt(o[1]),c.index=parseInt(s.readValue()),c.texture=l.texture,this.regions.push(c)}else{(l=new r).name=h,2==s.readTuple(o)&&(l.width=parseInt(o[0]),l.height=parseInt(o[1]),s.readTuple(o)),s.readTuple(o),l.minFilter=t.Texture.filterFromString(o[0]),l.magFilter=t.Texture.filterFromString(o[1]);var v=s.readValue();l.uWrap=t.TextureWrap.ClampToEdge,l.vWrap=t.TextureWrap.ClampToEdge,"x"==v?l.uWrap=t.TextureWrap.Repeat:"y"==v?l.vWrap=t.TextureWrap.Repeat:"xy"==v&&(l.uWrap=l.vWrap=t.TextureWrap.Repeat),l.texture=i(h),l.texture.setFilters(l.minFilter,l.magFilter),l.texture.setWraps(l.uWrap,l.vWrap),l.width=l.texture.getImage().width,l.height=l.texture.getImage().height,this.pages.push(l)}}},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 r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(-1==i)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=a}(a||(a={})),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 r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var A=Math.cos(b),x=Math.sin(b);v.a=A*y-x*w,v.b=A*E-x*T,v.c=x*y+A*w,v.d=x*E+A*T,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var I=Math.sqrt(v.a*v.a+v.c*v.c),R=Math.sqrt(s*s+l*l);I>1e-5&&(I=(I+(R-I+this.data.offsetScaleX)*r)/I),v.a*=I,v.c*=I,I=Math.sqrt(v.b*v.b+v.d*v.d),R=Math.sqrt(o*o+h*h),I>1e-5&&(I=(I+(R-I+this.data.offsetScaleY)*r)/I),v.b*=I,v.d*=I,g=!0}if(a>0){E=v.b,T=v.d;var b,S=Math.atan2(T,E);(b=Math.atan2(h,o)-Math.atan2(l,s)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b=S+(b+f)*a;I=Math.sqrt(E*E+T*T);v.b=Math.cos(b)*I,v.d=Math.sin(b)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,s=i.a,o=i.b,l=i.c,h=i.d,c=s*h-o*l>0?t.MathUtils.degRad:-t.MathUtils.degRad,u=this.data.offsetRotation*c,f=this.data.offsetShearY*c,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var A=Math.cos(R),x=Math.sin(R);v.a=A*y-x*w,v.b=A*E-x*T,v.c=x*y+A*w,v.d=x*E+A*T,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var I=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleX)*r+1;v.a*=I,v.c*=I,I=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleY)*r+1,v.b*=I,v.d*=I,g=!0}if(a>0){var R;(R=Math.atan2(h,o)-Math.atan2(l,s))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);E=v.b,T=v.d;R=Math.atan2(T,E)+(R-t.MathUtils.PI/2+f)*a;I=Math.sqrt(E*E+T*T);v.b=Math.cos(R)*I,v.d=Math.sin(R)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p));var m=l.ashearY;if(0!=r){c=a.ashearY-m+this.data.offsetShearY;c-=360*(16384-(16384.499999999996-c/360|0)),l.shearY+=c*r}l.updateWorldTransformWith(u,f,h,d,p,l.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s1e-5&&(f*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));var p=l.ashearY;0!=r&&(p+=(a.ashearY+this.data.offsetShearY)*r),l.updateWorldTransformWith(c,u,h,f,d,l.ashearX,p)}},e}();t.TransformConstraint=e}(a||(a={})),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 s(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(a||(a={})),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,r=t.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i3;){for(var h=r-1,c=(i=0,1);;){t:if(!s[i]){for(var u=a[h]<<1,f=a[i]<<1,d=a[c]<<1,p=n[u],m=n[u+1],v=n[f],g=n[f+1],y=n[d],E=n[d+1],w=(c+1)%r;w!=h;w=(w+1)%r)if(s[w]){var T=a[w]<<1,A=n[T],x=n[T+1];if(e.positiveArea(y,E,p,m,A,x)&&e.positiveArea(p,m,v,g,A,x)&&e.positiveArea(v,g,y,E,A,x))break t}break}if(0==c){do{if(!s[i])break;i--}while(i>0);break}h=i,i=c,c=(c+1)%r}l.push(a[(r+i-1)%r]),l.push(a[i]),l.push(a[(i+1)%r]),a.splice(i,1),s.splice(i,1);var M=(--r+i-1)%r,I=i==r?0:i;s[M]=e.isConcave(M,r,n,a),s[I]=e.isConcave(I,r,n,a)}return 3==r&&(l.push(a[2]),l.push(a[0]),l.push(a[1])),l},e.prototype.decompose=function(t,n){var r=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var l=-1,h=0,c=0,u=n.length;c0?(a.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(v),o.push(g),o.push(y),o.push(E),o.push(w),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(p),h=e.winding(m,v,g,y,E,w),l=f)}o.length>0&&(a.push(o),i.push(s));for(c=0,u=a.length;c=0;c--)0==(o=a[c]).length&&(a.splice(c,1),this.polygonPool.free(o),s=i[c],i.splice(c,1),this.polygonIndicesPool.free(s));return a},e.isConcave=function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,s=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[s],n[s+1])},e.positiveArea=function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0},e.winding=function(t,e,n,r,a,i){var s=n-t,o=r-e;return a*o-i*s+s*e-t*o>=0?1:-1},e}();t.Triangulator=e}(a||(a={})),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 null!=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,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,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,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,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 r=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 r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(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=r;var a=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=a;var i=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return s(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}(a);t.Pow=i;var o=function(t){function e(e){return t.call(this,e)||this}return s(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(i);t.PowOut=o;var l=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,s=r;i=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?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)*i;var s=t.bone.skeleton,o=t.deform,l=this.vertices,h=this.bones;if(null!=h){for(var c=0,u=0,f=0;f0&&(l=o);for(var w,T=(w=t.bone).worldX,A=w.worldY,x=w.a,M=w.b,I=w.c,R=w.d,b=e,S=a;S)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(l[h.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(l[h.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(l[h.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIER],")")+"(?:".concat(l[h.PRERELEASE],")?").concat(l[h.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(l[h.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(l[h.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(l[h.PRERELEASELOOSE],")?").concat(l[h.BUILD],"?")+")?)?"),d("XRANGE","^".concat(l[h.GTLT],"\\s*").concat(l[h.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(l[h.GTLT],"\\s*").concat(l[h.XRANGEPLAINLOOSE],"$")),d("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),d("COERCE","".concat(l[h.COERCEPLAIN],"(?:$|[^\\d])")),d("COERCEFULL",l[h.COERCEPLAIN]+"(?:".concat(l[h.PRERELEASE],")?")+"(?:".concat(l[h.BUILD],")?")+"(?:$|[^\\d])"),d("COERCERTL",l[h.COERCE],!0),d("COERCERTLFULL",l[h.COERCEFULL],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(l[h.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(l[h.LONETILDE]).concat(l[h.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(l[h.LONETILDE]).concat(l[h.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(l[h.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(l[h.LONECARET]).concat(l[h.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(l[h.LONECARET]).concat(l[h.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(l[h.GTLT],"\\s*(").concat(l[h.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(l[h.GTLT],"\\s*(").concat(l[h.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(l[h.GTLT],"\\s*(").concat(l[h.LOOSEPLAIN],"|").concat(l[h.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(l[h.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(l[h.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(l[h.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(l[h.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(k,k.exports);var N=k.exports;R(N);var _=Object.freeze({loose:!0}),V=Object.freeze({}),O=function(t){return t?"object"!==o(t)?_:t:V};R(O);var L=/^[0-9]+$/,F=function(t,e){var n=L.test(t),r=L.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tB)throw new TypeError("version is longer than ".concat(B," characters"));U("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?Y[W.LOOSE]:Y[W.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>X||this.major<0)throw new TypeError("Invalid major version");if(this.minor>X||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>X||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var i=[e,r];!1===n&&(i=[e]),0===q(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),H=G;R(H);var z=H,Z=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof z)return t;try{return new z(t,e)}catch(t){if(!n)return null;throw t}};R(Z);var $=Z,Q=R((function(t,e){var n=$(t,e);return n?n.version:null})),J=H,K=Z,tt=N.safeRe,et=N.t,nt=R((function(t,e){if(t instanceof J)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r,a=e.includePrerelease?tt[et.COERCERTLFULL]:tt[et.COERCERTL];(r=a.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),a.lastIndex=r.index+r[1].length+r[2].length;a.lastIndex=-1}else n=t.match(e.includePrerelease?tt[et.COERCEFULL]:tt[et.COERCE]);if(null===n)return null;var i=n[2],s=n[3]||"0",o=n[4]||"0",l=e.includePrerelease&&n[5]?"-".concat(n[5]):"",h=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return K("".concat(i,".").concat(s,".").concat(o).concat(l).concat(h),e)})),rt=c((function t(){l(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);R(rt);var at=H,it=function(t,e,n){return new at(t,n).compare(new at(e,n))};R(it);var st=it,ot=function(t,e,n){return 0===st(t,e,n)};R(ot);var lt=it,ht=function(t,e,n){return 0!==lt(t,e,n)};R(ht);var ct=it,ut=function(t,e,n){return ct(t,e,n)>0};R(ut);var ft=it,dt=function(t,e,n){return ft(t,e,n)>=0};R(dt);var pt=it,mt=function(t,e,n){return pt(t,e,n)<0};R(mt);var vt=it,gt=function(t,e,n){return vt(t,e,n)<=0};R(gt);var yt,Et,wt,Tt,At=ot,xt=ht,Mt=ut,It=dt,Rt=mt,bt=gt,St=function(t,e,n,r){switch(e){case"===":return"object"===o(t)&&(t=t.version),"object"===o(n)&&(n=n.version),t===n;case"!==":return"object"===o(t)&&(t=t.version),"object"===o(n)&&(n=n.version),t!==n;case"":case"=":case"==":return At(t,n,r);case"!=":return xt(t,n,r);case">":return Mt(t,n,r);case">=":return It(t,n,r);case"<":return Rt(t,n,r);case"<=":return bt(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Ct(){if(Tt)return wt;Tt=1;var t=function(){function t(e,a){var i=this;if(l(this,t),a=n(a),e instanceof t)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new t(e.raw,a);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var s=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[s];else if(this.set.length>1){var o,h=T(this.set);try{for(h.s();!(o=h.n()).done;){var c=o.value;if(1===c.length&&v(c[0])){this.set=[c];break}}}catch(t){h.e(t)}finally{h.f()}}}this.format()}return c(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+t,l=e.get(i);if(l)return l;var c=this.options.loose,v=c?s[o.HYPHENRANGELOOSE]:s[o.HYPHENRANGE];t=t.replace(v,_(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(s[o.COMPARATORTRIM],h),a("comparator trim",t),t=t.replace(s[o.TILDETRIM],u),a("tilde trim",t),t=t.replace(s[o.CARETTRIM],f),a("caret trim",t);var g=t.split(" ").map((function(t){return E(t,n.options)})).join(" ").split(/\s+/).map((function(t){return k(t,n.options)}));c&&(g=g.filter((function(t){return a("loose invalid filter",t,n.options),!!t.match(s[o.COMPARATORLOOSE])}))),a("range list",g);var w,A=new Map,x=g.map((function(t){return new r(t,n.options)})),M=T(x);try{for(M.s();!(w=M.n()).done;){var I=w.value;if(m(I))return[I];A.set(I.value,I)}}catch(t){M.e(t)}finally{M.f()}A.size>1&&A.has("")&&A.delete("");var R=y(A.values());return e.set(i,R),R}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new i(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(i(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(i(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();yt=e;var n=O,r=N.safeRe,a=N.t,i=St,s=P,o=H,h=Ct();return yt}(),a=P,i=H,s=N.safeRe,o=N.t,h=N.comparatorTrimReplace,u=N.tildeTrimReplace,f=N.caretTrimReplace,d=b.FLAG_INCLUDE_PRERELEASE,p=b.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),a=r.pop();n&&r.length;)n=r.every((function(t){return a.intersects(t,e)})),a=r.pop();return n},E=function(t,e){return a("comp",t,e),t=M(t,e),a("caret",t),t=A(t,e),a("tildes",t),t=R(t,e),a("xrange",t),t=C(t,e),a("stars",t),t},w=function(t){return!t||"x"===t.toLowerCase()||"*"===t},A=function(t,e){return t.trim().split(/\s+/).map((function(t){return x(t,e)})).join(" ")},x=function(t,e){var n=e.loose?s[o.TILDELOOSE]:s[o.TILDE];return t.replace(n,(function(e,n,r,i,s){var o;return a("tilde",t,e,n,r,i,s),w(n)?o="":w(r)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):w(i)?o=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):s?(a("replaceTilde pr",s),o=">=".concat(n,".").concat(r,".").concat(i,"-").concat(s," <").concat(n,".").concat(+r+1,".0-0")):o=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",o),o}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){a("caret",t,e);var n=e.loose?s[o.CARETLOOSE]:s[o.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,s,o){var l;return a("caret",t,e,n,i,s,o),w(n)?l="":w(i)?l=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):w(s)?l="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):o?(a("replaceCaret pr",o),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(a("no pr"),l="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s," <").concat(+n+1,".0.0-0")),a("caret return",l),l}))},R=function(t,e){return a("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return S(t,e)})).join(" ")},S=function(t,e){t=t.trim();var n=e.loose?s[o.XRANGELOOSE]:s[o.XRANGE];return t.replace(n,(function(n,r,i,s,o,l){a("xRange",t,n,r,i,s,o,l);var h=w(i),c=h||w(s),u=c||w(o),f=u;return"="===r&&f&&(r=""),l=e.includePrerelease?"-0":"",h?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(c&&(s=0),o=0,">"===r?(r=">=",c?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===r&&(r="<",c?i=+i+1:s=+s+1),"<"===r&&(l="-0"),n="".concat(r+i,".").concat(s,".").concat(o).concat(l)):c?n=">=".concat(i,".0.0").concat(l," <").concat(+i+1,".0.0-0"):u&&(n=">=".concat(i,".").concat(s,".0").concat(l," <").concat(i,".").concat(+s+1,".0-0")),a("xRange return",n),n}))},C=function(t,e){return a("replaceStars",t,e),t.trim().replace(s[o.STAR],"")},k=function(t,e){return a("replaceGTE0",t,e),t.trim().replace(s[e.includePrerelease?o.GTE0PRE:o.GTE0],"")},_=function(t){return function(e,n,r,a,i,s,o,l,h,c,u,f){return n=w(r)?"":w(a)?">=".concat(r,".0.0").concat(t?"-0":""):w(i)?">=".concat(r,".").concat(a,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),l=w(h)?"":w(c)?"<".concat(+h+1,".0.0-0"):w(u)?"<".concat(h,".").concat(+c+1,".0-0"):f?"<=".concat(h,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(h,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(l),"".concat(n," ").concat(l).trim()}},V=function(t,e,n){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return wt}R(St);var Pt=Ct(),kt=function(t,e,n){try{e=new Pt(e,n)}catch(t){return!1}return e.test(t)},Nt={valid:Q,coerce:nt,satisfies:R(kt),SEMVER_SPEC_VERSION:S.SEMVER_SPEC_VERSION},_t=0,Vt=1,Ot=2,Lt=[0,1,2,2,3,0],Ft=c((function t(e,n,r,s){var o;if(l(this,t),u(this,"autoUpdate",!0),u(this,"skeleton",void 0),u(this,"states",void 0),this._app=e,this._position=new i.Vec3,1===a.TextureAtlas.length){var h,c=T((o=new a.TextureAtlas(n)).pages);try{for(c.s();!(h=c.n()).done;){var f=h.value;f.setTexture(new I(s[f.name]))}}catch(t){c.e(t)}finally{c.f()}}else o=new a.TextureAtlas(n,(function(t){return new I(s[t])}));var d=new a.SkeletonJson(new a.AtlasAttachmentLoader(o));d.scale*=.01;var p=d.readSkeletonData(r);this.skeletonVersion=Nt.valid(Nt.coerce(p.version)),this._spine_3_6_0=Nt.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Nt.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Nt.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Nt.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new a.Skeleton(p),this.skeleton.updateWorldTransform(),this.stateData=new a.AnimationStateData(this.skeleton.data),this.states=[new a.AnimationState(this.stateData)],this.clipper=new a.SkeletonClipping,this._node=new i.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new i.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new i.Vec2,this._aabbTempSize=new i.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[i.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new i.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new i.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,n,t),t=u.material,e=s,n=0),t=u.material;var f=u.positions,d=u.vertexColor.r,p=u.vertexColor.g,m=u.vertexColor.b,v=u.vertexColor.a,g=u.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new i.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=i.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var a=new i.MeshInstance(r,this._materials[n],this._node);a.drawOrder=this.priority+this._meshInstances.length,a.visible=!this._hidden,this._meshInstances.push(a)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;et.length)&&(e=t.length);for(var a=0,n=new Array(e);a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function y(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var n=a.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function k(t,e,a){return e=l(e),u(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,a||[],l(t).constructor):e.apply(t,a))}var b=s((function t(){r(this,t),this.array=new Array}),[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),x=s((function t(){r(this,t),this.entries={},this.size=0}),[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,a=0,n=t.length;a0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;r(this,t),this.r=e,this.g=a,this.b=n,this.a=i}return s(t,[{key:"set",value:function(t,e,a,n){return this.r=t,this.g=e,this.b=a,this.a=n,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value: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?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,a,n){return this.r+=t,this.g+=e,this.b+=a,this.a+=n,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value: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}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}])}();w.WHITE=new w(1,1,1,1),w.RED=new w(1,0,0,1),w.GREEN=new w(0,1,0,1),w.BLUE=new w(0,0,1,1),w.MAGENTA=new w(1,0,1,1);var I=function(){function t(){r(this,t)}return s(t,null,[{key:"clamp",value:function(t,e,a){return ta?a:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,a){return t.randomTriangularWith(e,a,.5*(e+a))}},{key:"randomTriangularWith",value:function(t,e,a){var n=Math.random(),r=e-t;return n<=(a-t)/r?t+Math.sqrt(n*r*(a-t)):e-Math.sqrt((1-n)*r*(e-a))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}])}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var A=s((function t(){r(this,t)}),[{key:"apply",value:function(t,e,a){return t+(e-t)*this.applyInternal(a)}}]),E=function(t){function e(t){var a;return r(this,e),(a=k(this,e)).power=2,a.power=t,a}return h(e,t),s(e,[{key:"applyInternal",value: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}}])}(A),S=function(t){function e(t){return r(this,e),k(this,e,[t])}return h(e,t),s(e,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}])}(E),R=function(){function t(){r(this,t)}return s(t,null,[{key:"arrayCopy",value:function(t,e,a,n,r){for(var i=e,s=n;i2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;if(n==e)return t;if(t.length=e,n2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=a?e:t.setArraySize(e,a,n)}},{key:"newArray",value:function(t,e){for(var a=new Array(t),n=0;n0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;r(this,t),this.x=e,this.y=a}),[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),F=s((function t(){r(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}),[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.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)}}]),Y=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;r(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}),[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,f=0;f0&&(h=o);for(var L=t.bone,N=L.worldX,B=L.worldY,O=L.a,_=L.b,D=L.c,V=L.d,U=e,W=r;W0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;le)return n-1;return a-1}},{key:"search",value:function(t,e,a){for(var n=t.length,r=a;re)return r-a;return n-a}}]),it=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,n])).curves=null,i.curves=R.newFloatArray(t+18*a),i.curves[t-1]=1,i}return h(e,t),s(e,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var a=R.newFloatArray(e);R.arrayCopy(this.curves,0,a,0,e),this.curves=a}}},{key:"setBezier",value:function(t,e,a,n,r,i,s,o,h,l,c){var u=this.curves,f=this.getFrameCount()+18*t;0==a&&(u[e]=2+f);for(var d=.03*(n-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-n+l),p=.006*(3*(s-h)-r+c),g=2*d+m,y=2*v+p,k=.3*(i-n)+d+.16666667*m,b=.3*(s-r)+v+.16666667*p,x=n+k,w=r+b,I=f+18;ft){var i=this.frames[e],s=this.frames[e+a];return s+(t-i)/(r[n]-i)*(r[n+1]-s)}var o=n+18;for(n+=2;n=t){var h=r[n-2],l=r[n-1];return l+(t-h)/(r[n]-h)*(r[n+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+a]-u)}}])}(rt),st=function(t){function e(t,a,n){return r(this,e),L(this,e,[t,a,[n]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,a){t<<=1,this.frames[t]=e,this.frames[t+1]=a}},{key:"getCurveValue",value:function(t){for(var e=this.frames,a=e.length-2,n=2;n<=a;n+=2)if(e[n]>t){a=n-2;break}var r=this.curves[a>>1];switch(r){case 0:var i=e[a],s=e[a+1];return s+(t-i)/(e[a+2]-i)*(e[a+2+1]-s);case 1:return e[a+1]}return this.getBezierValue(t,a,1,r-2)}}])}(it),ot=function(t){function e(t,a,n,i){return r(this,e),L(this,e,[t,a,[n,i]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,a,n){t*=3,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n}}])}(it),ht=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,a,_+"|"+n])).boneIndex=0,i.boneIndex=n,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.bones[this.boneIndex];if(o.active)if(a>2];switch(m){case 0:var p=h[v];u=h[v+1],f=h[v+2],d=h[v+3];var g=(a-p)/(h[v+4]-p);u+=(h[v+4+1]-u)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:u=h[v+1],f=h[v+2],d=h[v+3];break;default:u=this.getBezierValue(a,v,1,m-2),f=this.getBezierValue(a,v,2,m+18-2),d=this.getBezierValue(a,v,3,m+36-2)}if(1==r)l.r=u,l.g=f,l.b=d;else{if(i==N.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(u-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}])}(it),bt=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,a,G+"|"+n])).slotIndex=0,i.slotIndex=n,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(a>3];switch(x){case 0:var w=h[b];d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];var I=(a-w)/(h[b+8]-w);d+=(h[b+8+1]-d)*I,v+=(h[b+8+2]-v)*I,m+=(h[b+8+3]-m)*I,p+=(h[b+8+4]-p)*I,g+=(h[b+8+5]-g)*I,y+=(h[b+8+6]-y)*I,k+=(h[b+8+7]-k)*I;break;case 1:d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];break;default:d=this.getBezierValue(a,b,1,x-2),v=this.getBezierValue(a,b,2,x+18-2),m=this.getBezierValue(a,b,3,x+36-2),p=this.getBezierValue(a,b,4,x+54-2),g=this.getBezierValue(a,b,5,x+72-2),y=this.getBezierValue(a,b,6,x+90-2),k=this.getBezierValue(a,b,7,x+108-2)}if(1==r)l.set(d,v,m,p),c.r=g,c.g=y,c.b=k;else{if(i==N.setup){l.setFromColor(o.data.color);var A=o.data.darkColor;c.r=A.r,c.g=A.g,c.b=A.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(y-c.g)*r,c.b+=(k-c.b)*r}}}}}])}(it),wt=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,a,[z+"|"+n,H+"|"+n]])).slotIndex=0,i.slotIndex=n,i}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,a,n,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,c=o.darkColor;if(at){var i=this.frames[e];return a[n+1]*(t-i)/(a[n]-i)}var s=n+18;for(n+=2;n=t){var o=a[n-2],h=a[n-1];return h+(t-o)/(a[n]-o)*(a[n+1]-h)}var l=a[s-2],c=a[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof P&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(i=N.setup);var c=this.vertices,u=c[0].length,f=this.frames;if(a=f[f.length-1]){var p=c[f.length-1];if(1==r)if(i==N.add){var g=h;if(g.bones)for(var y=0;ya)this.apply(t,e,Number.MAX_VALUE,n,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(a0&&o[l-1]==c;)l--;for(;l=o[l];l++)n.push(this.events[l])}}}}])}(rt);Et.propertyIds=[""+Q];var St=function(t){function e(t){var a;return r(this,e),(a=L(this,e,[t,e.propertyIds])).drawOrders=null,a.drawOrders=new Array(t),a}return h(e,t),s(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,a){this.frames[t]=e,this.drawOrders[t]=a}},{key:"apply",value:function(t,e,a,n,r,i,s){if(s!=B.mixOut)if(a>2];switch(d){case 0:var v=h[f];l=h[f+1],c=h[f+2],u=h[f+3];var m=(a-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,c+=(h[f+4+2]-c)*m,u+=(h[f+4+3]-u)*m;break;case 1:l=h[f+1],c=h[f+2],u=h[f+3];break;default:l=this.getBezierValue(a,f,1,d-2),c=this.getBezierValue(a,f,2,d+18-2),u=this.getBezierValue(a,f,3,d+36-2)}if(i==N.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(c-p.mixX)*r,o.mixY=p.mixY+(u-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(c-o.mixX)*r,o.mixY+=(u-o.mixY)*r}}}}])}(it),Xt=function(){function t(e){r(this,t),this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Lt(this),this.propertyIDs=new x,this.animationsChanged=!1,this.trackEntryPool=new C((function(){return new Pt})),this.data=e}return s(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,a=0,n=e.length;a0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(a,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[a]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var a=t.mixingFrom;if(!a)return!0;var n=this.updateMixingFrom(a,e);return a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=a.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=a.mixingFrom,a.mixingFrom&&(a.mixingFrom.mixingTo=t),t.interruptAlpha=a.interruptAlpha,this.queue.end(a)),n):(a.trackTime+=e*a.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,a=this.tracks,n=!1,r=0,i=a.length;r0)){n=!0;var o=0==r?N.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,c=s.getAnimationTime(),u=c,f=e;s.reverse&&(u=s.animation.duration-u,f=null);var d=s.animation.timelines,v=d.length;if(0==r&&1==h||o==N.add)for(var m=0;m1&&(r=1),a!=N.first&&(a=n.mixBlend));var i=r0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,a,n,r){var i=e.slots[t.slotIndex];i.bone.active&&(a0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),u=f+d-d%360,p!=m&&(u+=360*I.signum(d)),i[s]=u}i[s+1]=f,h.rotation=l+u*n}}else t.apply(e,0,a,null,1,r,B.mixIn)}},{key:"queueEvents",value:function(t,e){for(var a=t.animationStart,n=t.animationEnd,r=n-a,i=t.trackLast%r,s=this.events,o=0,h=s.length;on||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var a=e;;){var n=a.mixingFrom;if(!n)break;this.queue.end(n),a.mixingFrom=null,a.mixingTo=null,a=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,a){var n=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,n&&(a&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,a)}},{key:"setAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));var i=this.trackEntry(t,e,a,r);return this.setCurrent(t,i,n),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,a,n)}},{key:"addAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,a,r);return r?(r.next=i,i.previous=r,n<=0&&(n+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=n,i}},{key:"setEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.setAnimationWith(e,t.emptyAnimation(),!1);return n.mixDuration=a,n.trackEnd=a,n}},{key:"addEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,n);return n<=0&&(r.delay+=r.mixDuration-a),r.mixDuration=a,r.trackEnd=a,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var a=0,n=this.tracks.length;a0){r[h]=Vt,i[h]=u;continue t}break}r[h]=Dt}else r[h]=Bt}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return jt||(jt=new O("",[],0)),jt}}])}(),Pt=s((function t(){r(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=N.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}),[{key:"reset",value:function(){this.next=null,this.previous=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}},{key:"getAnimationTime",value: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)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&(s.names=c,s.values=u,c=null,u=null),s.u=s.x/i.width,s.v=s.y/i.height,90==s.degrees?(s.u2=(s.x+s.height)/i.width,s.v2=(s.y+s.width)/i.height):(s.u2=(s.x+s.width)/i.width,s.v2=(s.y+s.height)/i.height),this.regions.push(s)}else{for((i=new ee).name=l.trim();0!=a.readEntry(n,l=a.readLine());){var p=o[n[0]];p&&p()}this.pages.push(i)}}),[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",n=g(this.pages);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.setTexture(t.get(a+r.name))}}catch(t){n.e(t)}finally{n.f()}}},{key:"dispose",value:function(){for(var t=0;t=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var a=e.indexOf(":");if(-1==a)return 0;t[0]=e.substr(0,a).trim();for(var n=1,r=a+1;;n++){var i=e.indexOf(",",r);if(-1==i)return t[n]=e.substr(r).trim(),n;if(t[n]=e.substr(r,i-r).trim(),r=i+1,4==n)return 4}}}]),ee=s((function t(){r(this,t),this.name=null,this.minFilter=Ht.Nearest,this.magFilter=Ht.Nearest,this.uWrap=$t.ClampToEdge,this.vWrap=$t.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}),[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}}]),ae=function(t){function e(){var t,a,n,i;return r(this,e),a=this,i=arguments,n=l(n=e),(t=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(n,i||[],l(a).constructor):n.apply(a,i))).page=null,t.name=null,t.x=0,t.y=0,t.offsetX=0,t.offsetY=0,t.originalWidth=0,t.originalHeight=0,t.index=0,t.degrees=0,t.names=null,t.values=null,t}return h(e,t),s(e)}(Qt);var ne=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).region=null,a.path=null,a.regionUVs=null,a.uvs=null,a.triangles=null,a.color=new w(1,1,1,1),a.width=0,a.height=0,a.hullLength=0,a.edges=null,a.parentMesh=null,a.tempColor=new w(0,0,0,0),a}return h(e,t),s(e,[{key:"updateUVs",value:function(){var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,a=this.uvs.length,n=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof ae){var o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:n-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,i=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u= 0.");if(!a)throw new Error("name cannot be null.");this.index=e,this.name=a,this.parent=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"}(oe||(oe={}));var ce=s((function t(e,a,n){if(r(this,t),this.data=null,this.skeleton=null,this.parent=null,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.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=a,this.parent=n,this.setToSetupPose()}),[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,a,n,r,i,s){this.ax=t,this.ay=e,this.arotation=a,this.ascaleX=n,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=a+90+s,c=h.scaleX,u=h.scaleY;return this.a=I.cosDeg(a+i)*n*c,this.b=I.cosDeg(l)*r*c,this.c=I.sinDeg(a+i)*n*u,this.d=I.sinDeg(l)*r*u,this.worldX=t*c+h.x,void(this.worldY=e*u+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case oe.Normal:var p=a+90+s,g=I.cosDeg(a+i)*n,y=I.cosDeg(p)*r,k=I.sinDeg(a+i)*n,b=I.sinDeg(p)*r;return this.a=f*g+d*k,this.b=f*y+d*b,this.c=v*g+m*k,void(this.d=v*y+m*b);case oe.OnlyTranslation:var x=a+90+s;this.a=I.cosDeg(a+i)*n,this.b=I.cosDeg(x)*r,this.c=I.sinDeg(a+i)*n,this.d=I.sinDeg(x)*r;break;case oe.NoRotationOrReflection:var w=f*f+v*v,A=0;w>1e-4?(w=Math.abs(f*m-d*v)/w,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*w,m=f*w,A=Math.atan2(v,f)*I.radDeg):(f=0,v=0,A=90-Math.atan2(m,d)*I.radDeg);var E=a+i-A,S=a+s-A+90,R=I.cosDeg(E)*n,T=I.cosDeg(S)*r,C=I.sinDeg(E)*n,M=I.sinDeg(S)*r;this.a=f*R-d*C,this.b=f*T-d*M,this.c=v*R+m*C,this.d=v*T+m*M;break;case oe.NoScale:case oe.NoScaleOrReflection:var F=I.cosDeg(a),Y=I.sinDeg(a),X=(f*F+d*Y)/this.skeleton.scaleX,P=(v*F+m*Y)/this.skeleton.scaleY,L=Math.sqrt(X*X+P*P);L>1e-5&&(L=1/L),X*=L,P*=L,L=Math.sqrt(X*X+P*P),this.data.transformMode==oe.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(L=-L);var N=Math.PI/2+Math.atan2(P,X),B=Math.cos(N)*L,O=Math.sin(N)*L,_=I.cosDeg(i)*n,D=I.cosDeg(90+s)*r,V=I.sinDeg(i)*n,U=I.sinDeg(90+s)*r;this.a=X*_+B*V,this.b=X*D+B*U,this.c=P*_+O*V,this.d=P*D+O*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value: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}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.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)*I.radDeg);var e=t.a,a=t.b,n=t.c,r=t.d,i=1/(e*r-a*n),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*r*i-o*a*i,this.ay=o*e*i-s*n*i;var h=i*r,l=i*e,c=i*a,u=i*n,f=h*this.a-c*this.c,d=h*this.b-c*this.d,v=l*this.c-u*this.a,m=l*this.d-u*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),a=t.x-this.worldX,n=t.y-this.worldY;return t.x=a*this.d*e-n*this.b*e,t.y=n*this.a*e-a*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,a=t.y;return t.x=e*this.a+a*this.b+this.worldX,t.y=e*this.c+a*this.d+this.worldY,t}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(this.a*e-this.c*a,this.d*a-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(a*this.c+e*this.d,a*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,a=this.b,n=this.c,r=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*n,this.b=i*a-s*r,this.c=s*e+i*n,this.d=s*a+i*r}}]),ue=s((function t(e,a,n){r(this,t),this.name=e,this.order=a,this.skinRequired=n})),fe=s((function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,t),this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=a,this.downloader=n||new de}),[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,a){this.toLoad--,this.loaded++,this.assets[e]=a,t&&t(e,a)}},{key:"error",value:function(t,e,a){this.toLoad--,this.loaded++,this.errors[e]=a,t&&t(e,a)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,a){requestAnimationFrame((function n(){t.isLoadingComplete()?t.hasErrors()?a(t.errors):e(t):requestAnimationFrame(n)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadBinary(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadText(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load text ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadJson(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(a,t,e.textureLoader(r))},r.onerror=function(){e.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}else fetch(t,{mode:"cors"}).then((function(a){return a.ok?a.blob():(e.error(n,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(n){n&&e.success(a,t,e.textureLoader(n))}))}},{key:"loadTextureAtlas",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new Kt(i),l=h.pages.length,c=!1,u=g(h.pages);try{var f=function(){var i=o.value;e.loadTexture(null==r?s+i.name:r[i.name],(function(n,r){c||(i.setTexture(r),0==--l&&e.success(a,t,h))}),(function(a,r){c||e.error(n,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(a)),c=!0}))};for(u.s();!(o=u.n()).done;)f()}catch(t){u.e(t)}finally{u.f()}}catch(a){e.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(a.message))}}),(function(a,r){e.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var a=this.errors[t];throw Error("Asset not found: "+t+(a?"\n"+a:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),de=s((function t(){r(this,t),this.callbacks={},this.rawDataUris={}}),[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),a=e.length,n=new Uint8Array(a),r=0;r180?f-=360:f<-180&&(f+=360);var x=t.ascaleX,w=t.ascaleY;if(n||r){switch(t.data.transformMode){case oe.NoScale:case oe.NoScaleOrReflection:d=e-t.worldX,v=a-t.worldY}var A=t.data.length*x,E=Math.sqrt(d*d+v*v);if(n&&EA&&A>1e-4){var S=(E/A-1)*s+1;x*=S,i&&(w*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,x,w,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,a,n,r,i,s,o,h){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,d=u,v=f,m=e.ascaleX,p=0,g=0,y=0;u<0?(u=-u,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var k=e.ax,b=0,x=0,w=0,A=t.a,E=t.b,S=t.c,R=t.d,T=Math.abs(u-f)<=1e-4;!T||i?(b=0,x=A*k+t.worldX,w=S*k+t.worldY):(x=A*k+E*(b=e.ay)+t.worldX,w=S*k+R*b+t.worldY);var C=t.parent;A=C.a,E=C.b,S=C.c;var M,F,Y=1/(A*(R=C.d)-E*S),X=x-C.worldX,P=w-C.worldY,L=(X*R-P*E)*Y-l,N=(P*A-X*S)*Y-c,B=Math.sqrt(L*L+N*N),O=e.data.length*m;if(B<1e-4)return this.apply1(t,a,n,!1,i,!1,h),void e.updateWorldTransformWith(k,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var _=((X=a-C.worldX)*R-(P=n-C.worldY)*E)*Y-l,D=(P*A-X*S)*Y-c,V=_*_+D*D;if(0!=o){o*=u*(m+1)*.5;var U=Math.sqrt(V),W=U-B-O*u+o;if(W>0){var j=Math.min(1,W/(2*o))-1;V=(_-=(j=(W-o*(1-j*j))/U)*_)*_+(D-=j*D)*D}}t:if(T){var q=(V-B*B-(O*=u)*O)/(2*B*O);q<-1?(q=-1,F=Math.PI*r):q>1?(q=1,F=0,i&&(d*=A=(Math.sqrt(V)/(B+O)-1)*h+1,s&&(v*=A))):F=Math.acos(q)*r,A=B+O*q,E=O*Math.sin(F),M=Math.atan2(D*A-_*E,_*A+D*E)}else{var z=(A=u*O)*A,G=(E=f*O)*E,H=Math.atan2(D,_),$=-2*G*B,J=G-z;if((R=$*$-4*J*(S=G*B*B+z*V-z*G))>=0){var Q=Math.sqrt(R);$<0&&(Q=-Q);var Z=(Q=.5*-($+Q))/J,K=S/Q,tt=Math.abs(Z)=-1&&S<=1&&(S=Math.acos(S),(R=(X=A*Math.cos(S)+B)*X+(P=E*Math.sin(S))*P)ot&&(it=S,ot=R,st=X,ht=P)),V<=.5*(nt+ot)?(M=H-Math.atan2(rt*r,at),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(b,k)*y,ct=t.arotation;(M=(M-lt)*I.radDeg+p-ct)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,c,ct+M*h,d,v,0,0),ct=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ct)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(k,b,ct+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]);var ge=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t,0,!1],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).bones=new Array,a.target=null,a.bendDirection=1,a.compress=!1,a.stretch=!1,a.uniform=!1,a.mix=1,a.softness=0,a}return h(e,t),s(e)}(ue);var ye,ke,be,xe=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t,0,!1],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).bones=new Array,a.target=null,a.positionMode=null,a.spacingMode=null,a.rotateMode=null,a.offsetRotation=0,a.position=0,a.spacing=0,a.mixRotate=0,a.mixX=0,a.mixY=0,a}return h(e,t),s(e)}(ue);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(ye||(ye={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(ke||(ke={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(be||(be={}));var we=function(){function t(e,a){if(r(this,t),this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=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,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var n=0,i=e.bones.length;n0){b=c/b*d;for(var M=1;M0?I.degRad:-I.degRad}for(var q=0,z=3;q0){var tt=G.a,et=G.b,at=G.c,nt=G.d,rt=0,it=0,st=0;if(rt=s?_[z-1]:0==u[q+1]?_[z+2]:Math.atan2(Q,J),rt-=Math.atan2(at,tt),W){it=Math.cos(rt),st=Math.sin(rt);var ot=G.data.length;D+=(ot*(it*tt-st*at)-J)*a,V+=(ot*(st*tt+it*at)-Q)*a}else rt+=U;rt>I.PI?rt-=I.PI2:rt<-I.PI&&(rt+=I.PI2),rt*=a,it=Math.cos(rt),st=Math.sin(rt),G.a=it*tt-st*at,G.b=it*et-st*nt,G.c=st*tt+it*at,G.d=st*et+it*nt}G.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,a,n){var r=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*a+2),h=null,l=e.closed,c=e.worldVerticesLength,u=c/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[u-=l?1:2];switch(this.data.positionMode==ye.Percent&&(i*=m),this.data.spacingMode){case ke.Percent:d=m;break;case ke.Proportional:d=m/a;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(b-m,h,0,o,g);continue}}for(;;y++){var x=v[y];if(!(b>x)){if(0==y)b/=x;else{var w=v[y-1];b=(b-w)/(x-w)}break}}y!=f&&(f=y,l&&y==u?(e.computeWorldVertices(r,c-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(b,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,n||p>0&&0==k)}return o}l?(c+=2,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c-4,h,0,2),e.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c,h,0,2));for(var I,A=R.setArraySize(this.curves,u),E=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,X=0,P=0,L=0,N=0,B=0,O=0,_=0,D=0,V=0,U=0,W=0,j=2;WE){this.addAfterPosition(Z-E,h,c-4,o,H);continue}}for(;;$++){var K=A[$];if(!(Z>K)){if(0==$)Z/=K;else{var tt=A[$-1];Z=(Z-tt)/(K-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],_=2*(L=.03*(S-2*C+F))+(B=.006*(3*(C-F)-S+(X=h[et+6]))),D=2*(N=.03*(T-2*M+Y))+(O=.006*(3*(M-Y)-T+(P=h[et+7]))),V=.3*(C-S)+L+.16666667*B,U=.3*(M-T)+N+.16666667*O,z=Math.sqrt(V*V+U*U),q[0]=z,et=1;et<8;et++)V+=_,U+=D,_+=B,D+=O,z+=Math.sqrt(V*V+U*U),q[et]=z;V+=_,U+=D,z+=Math.sqrt(V*V+U*U),q[8]=z,V+=_+B,U+=D+O,z+=Math.sqrt(V*V+U*U),q[9]=z,J=0}for(Z*=z;;J++){var at=q[J];if(!(Z>at)){if(0==J)Z/=at;else{var nt=q[J-1];Z=J+(Z-nt)/(at-nt)}break}}this.addCurvePosition(.1*Z,S,T,C,M,F,Y,X,P,o,H,n||G>0&&0==Q)}return o}},{key:"addBeforePosition",value:function(t,e,a,n,r){var i=e[a],s=e[a+1],o=e[a+2]-i,h=e[a+3]-s,l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addAfterPosition",value:function(t,e,a,n,r){var i=e[a+2],s=e[a+3],o=i-e[a],h=s-e[a+1],l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addCurvePosition",value:function(t,e,a,n,r,i,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=a,void(l[c+2]=Math.atan2(r-a,n-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,k=v*y,b=y*t,x=e*p+n*k+i*b+o*d,w=a*p+r*k+s*b+h*d;l[c]=x,l[c+1]=w,u&&(l[c+2]=t<.001?Math.atan2(r-a,n-e):Math.atan2(w-(a*m+r*g*2+s*f),x-(e*m+n*g*2+i*f)))}}])}();we.NONE=-1,we.BEFORE=-2,we.AFTER=-3,we.epsilon=1e-5;var Ie,Ae=s((function t(e,a){if(r(this,t),this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentTime=0,this.attachmentState=0,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!a)throw new Error("bone cannot be null.");this.data=e,this.bone=a,this.color=new w,this.darkColor=e.darkColor?new w:null,this.setToSetupPose()}),[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof P&&this.attachment instanceof P&&t.deformAttachment==this.attachment.deformAttachment||(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}},{key:"setAttachmentTime",value:function(t){this.attachmentTime=this.bone.skeleton.time-t}},{key:"getAttachmentTime",value:function(){return this.bone.skeleton.time-this.attachmentTime}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),Ee=s((function t(e,a){if(r(this,t),this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new M,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var n=0;n0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(R.x-y.worldX)*e,y.worldY+=(R.y-y.worldY)*a}if(0!=n){var T=Math.sqrt(y.a*y.a+y.c*y.c);0!=T&&(T=(T+(Math.sqrt(h*h+c*c)-T+this.data.offsetScaleX)*n)/T),y.a*=T,y.c*=T}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+u*u)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),X=Math.atan2(u,l)-Math.atan2(c,h)-(Y-Math.atan2(y.c,y.a));X>I.PI?X-=I.PI2:X<-I.PI&&(X+=I.PI2),X=Y+(X+v)*i;var P=Math.sqrt(M*M+F*F);y.b=Math.cos(X)*P,y.d=Math.sin(X)*P}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=a,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=R.x*e,y.worldY+=R.y*a}if(0!=n){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*n+1;y.a*=T,y.c*=T}if(0!=r){var C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(u,l)-Math.atan2(c,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var X=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*X,y.d=Math.sin(M)*X}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var n=this.drawOrder,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=n.length;h0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,t),this.slotIndex=e,this.name=a,this.attachment=n})),Ce=s((function t(e){if(r(this,t),this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}),[{key:"setAttachment",value:function(t,e,a){if(!a)throw new Error("attachment cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=a}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!a)throw new Error("name cannot be null.");if(!n)throw new Error("boneData cannot be null.");this.index=e,this.name=a,this.boneData=n}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Ie||(Ie={}));var Fe,Ye=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t,0,!1],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).bones=new Array,a.target=null,a.mixRotate=0,a.mixX=0,a.mixY=0,a.mixScaleX=0,a.mixScaleY=0,a.mixShearY=0,a.offsetRotation=0,a.offsetX=0,a.offsetY=0,a.offsetScaleX=0,a.offsetScaleY=0,a.offsetShearY=0,a.relative=!1,a.local=!1,a}return h(e,t),s(e)}(ue),Xe=s((function t(e){r(this,t),this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=e}),[{key:"readSkeletonData",value:function(t){var e=this.scale,a=new Re;a.name="";var n=new Pe(t),r=n.readInt32(),i=n.readInt32();a.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),a.version=n.readString(),a.x=n.readFloat(),a.y=n.readFloat(),a.width=n.readFloat(),a.height=n.readFloat();var s=n.readBoolean();s&&(a.fps=n.readFloat(),a.imagesPath=n.readString(),a.audioPath=n.readString());var o=0;o=n.readInt(!0);for(var h=0;h0){for(var pn=new St(mn),gn=a.slots.length,yn=0;yn=0;wn--)xn[wn]=-1;for(var In=R.newArray(gn-bn,0),An=0,En=0,Sn=0;Sn=0;Tn--)-1==xn[Tn]&&(xn[Tn]=In[--En]);pn.setFrame(yn,kn,xn)}n.push(pn)}var Cn=t.readInt(!0);if(Cn>0){for(var Mn=new Et(Cn),Fn=0;Fn1&&void 0!==arguments[1]?arguments[1]:new Array,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);r(this,t),this.strings=a,this.index=n,this.buffer=i}),[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),a=127&e;return 0!=(128&e)&&(a|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<28)))),t?a:a>>>1^-(1&a)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",a=0;a>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),a+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),a+=3;break;default:e+=String.fromCharCode(n),a++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),Le=s((function t(e,a,n,i,s){r(this,t),this.mesh=e,this.skin=a,this.slotIndex=n,this.parent=i,this.inheritDeform=s})),Ne=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this.bones=e,this.vertices=a}));function Be(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,n,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(i);break;case oa:_e(t,e,s++,i,0,n,h,r,l,a)}n=h,r=l}return e}function Oe(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=t.readFloat()*a,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,n,r,i),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*a,u=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(s);break;case oa:_e(t,e,o++,s,0,n,l,r,c,a),_e(t,e,o++,s,1,n,l,i,u,a)}n=l,r=c,i=u}return e}function _e(t,e,a,n,r,i,s,o,h,l){e.setBezier(a,n,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Fe||(Fe={}));var De,Ve=0,Ue=1,We=2,je=3,qe=4,ze=5,Ge=6,He=7,$e=8,Je=9,Qe=0,Ze=1,Ke=2,ta=3,ea=4,aa=5,na=0,ra=1,ia=2,sa=1,oa=2,ha=s((function t(){r(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new C((function(){return R.newFloatArray(16)}))}),[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var a=this.boundingBoxes,n=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;a.length=0,r.freeAll(n),n.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,a,n){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&a<=r||e<=i&&n<=i||t>=s&&a>=s||e>=o&&n>=o)return!1;var h=(n-e)/(a-t),l=h*(r-t)+e;if(l>i&&li&&lr&&cr&&ct.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var a=this.polygons,n=0,r=a.length;n=a||l=a){var c=n[o];c+(a-h)/(l-h)*(n[i]-c)=c&&k<=d||k>=d&&k<=c)&&(k>=e&&k<=n||k>=n&&k<=e)){var b=(l*g-h*m)/y;if((b>=u&&b<=v||b>=v&&b<=u)&&(b>=a&&b<=r||b>=r&&b<=a))return!0}c=d,u=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),la=function(){function t(){r(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new C((function(){return new Array})),this.polygonIndicesPool=new C((function(){return new Array}))}return s(t,[{key:"triangulate",value:function(e){var a=e,n=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var c=n-1,u=0,f=1;;){t:if(!s[u]){for(var d=r[c]<<1,v=r[u]<<1,m=r[f]<<1,p=a[d],g=a[d+1],y=a[v],k=a[v+1],b=a[m],x=a[m+1],w=(f+1)%n;w!=c;w=(w+1)%n)if(s[w]){var I=r[w]<<1,A=a[I],E=a[I+1];if(t.positiveArea(b,x,p,g,A,E)&&t.positiveArea(p,g,y,k,A,E)&&t.positiveArea(y,k,b,x,A,E))break t}break}if(0==f){do{if(!s[u])break;u--}while(u>0);break}c=u,u=f,f=(f+1)%n}l.push(r[(n+u-1)%n]),l.push(r[u]),l.push(r[(u+1)%n]),r.splice(u,1),s.splice(u,1);var S=(--n+u-1)%n,R=u==n?0:u;s[S]=t.isConcave(S,n,a,r),s[R]=t.isConcave(R,n,a,r)}return 3==n&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,a){var n=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,c=0,u=a.length;c0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(k),o.push(b),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,k,b),h=f)}o.length>0&&(r.push(o),i.push(s));for(var E=0,S=r.length;E=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,a,n){var r=n[(e+t-1)%e]<<1,i=n[t]<<1,s=n[(t+1)%e]<<1;return!this.positiveArea(a[r],a[r+1],a[i],a[i+1],a[s],a[s+1])}},{key:"positiveArea",value:function(t,e,a,n,r,i){return t*(i-n)+a*(e-i)+r*(n-e)>=0}},{key:"winding",value:function(t,e,a,n,r,i){var s=a-t,o=n-e;return r*o-i*s+s*e-t*o>=0?1:-1}}])}(),ca=function(){function t(){r(this,t),this.triangulator=new la,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return s(t,[{key:"clipStart",value:function(e,a){if(this.clipAttachment)return 0;this.clipAttachment=a;var n=a.worldVerticesLength,r=R.setArraySize(this.clippingPolygon,n);a.computeWorldVertices(e,0,n,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),W=0;W=2?(c=o,o=this.scratch):c=this.scratch,c.length=0,c.push(t),c.push(e),c.push(a),c.push(n),c.push(r),c.push(i),c.push(t),c.push(e),o.length=0;for(var u=s,f=s.length-4,d=0;;d+=2){for(var v=u[d],m=u[d+1],p=u[d+2],g=u[d+3],y=v-p,k=m-g,b=c,x=c.length-2,w=o.length,I=0;I0;if(y*(E-g)-k*(A-p)>0){if(T){o.push(S),o.push(R);continue}var C=R-E,M=S-A,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-E)-C*(v-A))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(T){var X=R-E,P=S-A,L=X*(p-v)-P*(g-m);if(Math.abs(L)>1e-6){var N=(P*(m-E)-X*(v-A))/L;o.push(v+(p-v)*N),o.push(m+(g-m)*N)}else o.push(v),o.push(m);o.push(S),o.push(R)}l=!0}if(w==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var B=o;(o=c).length=0,c=B}if(h!=o){h.length=0;for(var O=0,_=o.length-2;O<_;O++)h[O]=o[O]}else h.length=h.length-2;return l}}],[{key:"makeClockwise",value:function(t){for(var e=t,a=t.length,n=e[a-2]*e[1]-e[0]*e[a-1],r=0,i=0,s=0,o=0,h=a-3;o>1;l=0;Ga--)-1==_a[Ga]&&(_a[Ga]=Va[--Wa])}Pa.setFrame(Na,pa(Oa,"time",0),_a)}r.push(Pa)}if(t.events){for(var Ha=new Et(t.events.length),$a=0,Ja=0;Ja)?=?)"),v("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),v("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),v("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),v("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),v("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(a,"})")+"(?:\\.(\\d{1,".concat(a,"}))?")+"(?:\\.(\\d{1,".concat(a,"}))?")),v("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),v("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),v("COERCERTL",h[l.COERCE],!0),v("COERCERTLFULL",h[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",v("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),v("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("LONECARET","(?:\\^)"),v("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",v("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),v("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),v("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),v("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),v("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ta,Ta.exports);var Ca=Ta.exports;Ia(Ca);var Ma=Object.freeze({loose:!0}),Fa=Object.freeze({}),Ya=function(t){return t?"object"!==n(t)?Ma:t:Fa};Ia(Ya);var Xa=/^[0-9]+$/,Pa=function(t,e){var a=Xa.test(t),n=Xa.test(e);return a&&n&&(t=+t,e=+e),t===e?0:a&&!n?-1:n&&!a?1:tBa)throw new TypeError("version is longer than ".concat(Ba," characters"));Na("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;var i=e.trim().match(a.loose?_a[Da.LOOSE]:_a[Da.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Oa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===a)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(e){var i=[e,n];!1===a&&(i=[e]),0===Ua(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),ja=Wa;Ia(ja);var qa=ja,za=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof qa)return t;try{return new qa(t,e)}catch(t){if(!a)return null;throw t}};Ia(za);var Ga=za,Ha=Ia((function(t,e){var a=Ga(t,e);return a?a.version:null})),$a=ja,Ja=za,Qa=Ca.safeRe,Za=Ca.t,Ka=Ia((function(t,e){if(t instanceof $a)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var a=null;if((e=e||{}).rtl){for(var n,r=e.includePrerelease?Qa[Za.COERCERTLFULL]:Qa[Za.COERCERTL];(n=r.exec(t))&&(!a||a.index+a[0].length!==t.length);)a&&n.index+n[0].length===a.index+a[0].length||(a=n),r.lastIndex=n.index+n[1].length+n[2].length;r.lastIndex=-1}else a=t.match(e.includePrerelease?Qa[Za.COERCEFULL]:Qa[Za.COERCE]);if(null===a)return null;var i=a[2],s=a[3]||"0",o=a[4]||"0",h=e.includePrerelease&&a[5]?"-".concat(a[5]):"",l=e.includePrerelease&&a[6]?"+".concat(a[6]):"";return Ja("".concat(i,".").concat(s,".").concat(o).concat(h).concat(l),e)})),tn=s((function t(){r(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var a=this.map.keys().next().value;this.delete(a)}this.map.set(t,e)}return this}}]);Ia(tn);var en=ja,an=function(t,e,a){return new en(t,a).compare(new en(e,a))};Ia(an);var nn=an,rn=function(t,e,a){return 0===nn(t,e,a)};Ia(rn);var sn=an,on=function(t,e,a){return 0!==sn(t,e,a)};Ia(on);var hn=an,ln=function(t,e,a){return hn(t,e,a)>0};Ia(ln);var cn=an,un=function(t,e,a){return cn(t,e,a)>=0};Ia(un);var fn=an,dn=function(t,e,a){return fn(t,e,a)<0};Ia(dn);var vn=an,mn=function(t,e,a){return vn(t,e,a)<=0};Ia(mn);var pn,gn,yn,kn,bn=rn,xn=on,wn=ln,In=un,An=dn,En=mn,Sn=function(t,e,a,r){switch(e){case"===":return"object"===n(t)&&(t=t.version),"object"===n(a)&&(a=a.version),t===a;case"!==":return"object"===n(t)&&(t=t.version),"object"===n(a)&&(a=a.version),t!==a;case"":case"=":case"==":return bn(t,a,r);case"!=":return xn(t,a,r);case">":return wn(t,a,r);case">=":return In(t,a,r);case"<":return An(t,a,r);case"<=":return En(t,a,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Rn(){if(kn)return yn;kn=1;var t=function(){function t(e,i){var s=this;if(r(this,t),i=a(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!p(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=g(this.set);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(1===c.length&&y(c[0])){this.set=[c];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return s(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var a=this,r=((this.options.includePrerelease&&d)|(this.options.loose&&m))+":"+t,s=e.get(r);if(s)return s;var o=this.options.loose,y=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(y,M(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],c),i("comparator trim",t),t=t.replace(h[l.TILDETRIM],u),i("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),i("caret trim",t);var k=t.split(" ").map((function(t){return b(t,a.options)})).join(" ").split(/\s+/).map((function(t){return C(t,a.options)}));o&&(k=k.filter((function(t){return i("loose invalid filter",t,a.options),!!t.match(h[l.COMPARATORLOOSE])}))),i("range list",k);var x,w=new Map,I=k.map((function(t){return new n(t,a.options)})),A=g(I);try{for(A.s();!(x=A.n()).done;){var E=x.value;if(p(E))return[E];w.set(E.value,E)}}catch(t){A.e(t)}finally{A.f()}w.size>1&&w.has("")&&w.delete("");var S=v(w.values());return e.set(r,S),S}},{key:"intersects",value:function(e,a){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return k(t,a)&&e.set.some((function(e){return k(e,a)&&t.every((function(t){return e.every((function(e){return t.intersects(e,a)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new o(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(o(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(o(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();pn=e;var a=Ya,n=Ca.safeRe,i=Ca.t,o=Sn,h=Ra,l=ja,c=Rn();return pn}(),i=Ra,o=ja,h=Ca.safeRe,l=Ca.t,c=Ca.comparatorTrimReplace,u=Ca.tildeTrimReplace,f=Ca.caretTrimReplace,d=Aa.FLAG_INCLUDE_PRERELEASE,m=Aa.FLAG_LOOSE,p=function(t){return"<0.0.0-0"===t.value},y=function(t){return""===t.value},k=function(t,e){for(var a=!0,n=t.slice(),r=n.pop();a&&n.length;)a=n.every((function(t){return r.intersects(t,e)})),r=n.pop();return a},b=function(t,e){return i("comp",t,e),t=A(t,e),i("caret",t),t=w(t,e),i("tildes",t),t=S(t,e),i("xrange",t),t=T(t,e),i("stars",t),t},x=function(t){return!t||"x"===t.toLowerCase()||"*"===t},w=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){var a=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(a,(function(e,a,n,r,s){var o;return i("tilde",t,e,a,n,r,s),x(a)?o="":x(n)?o=">=".concat(a,".0.0 <").concat(+a+1,".0.0-0"):x(r)?o=">=".concat(a,".").concat(n,".0 <").concat(a,".").concat(+n+1,".0-0"):s?(i("replaceTilde pr",s),o=">=".concat(a,".").concat(n,".").concat(r,"-").concat(s," <").concat(a,".").concat(+n+1,".0-0")):o=">=".concat(a,".").concat(n,".").concat(r," <").concat(a,".").concat(+n+1,".0-0"),i("tilde return",o),o}))},A=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){i("caret",t,e);var a=e.loose?h[l.CARETLOOSE]:h[l.CARET],n=e.includePrerelease?"-0":"";return t.replace(a,(function(e,a,r,s,o){var h;return i("caret",t,e,a,r,s,o),x(a)?h="":x(r)?h=">=".concat(a,".0.0").concat(n," <").concat(+a+1,".0.0-0"):x(s)?h="0"===a?">=".concat(a,".").concat(r,".0").concat(n," <").concat(a,".").concat(+r+1,".0-0"):">=".concat(a,".").concat(r,".0").concat(n," <").concat(+a+1,".0.0-0"):o?(i("replaceCaret pr",o),h="0"===a?"0"===r?">=".concat(a,".").concat(r,".").concat(s,"-").concat(o," <").concat(a,".").concat(r,".").concat(+s+1,"-0"):">=".concat(a,".").concat(r,".").concat(s,"-").concat(o," <").concat(a,".").concat(+r+1,".0-0"):">=".concat(a,".").concat(r,".").concat(s,"-").concat(o," <").concat(+a+1,".0.0-0")):(i("no pr"),h="0"===a?"0"===r?">=".concat(a,".").concat(r,".").concat(s).concat(n," <").concat(a,".").concat(r,".").concat(+s+1,"-0"):">=".concat(a,".").concat(r,".").concat(s).concat(n," <").concat(a,".").concat(+r+1,".0-0"):">=".concat(a,".").concat(r,".").concat(s," <").concat(+a+1,".0.0-0")),i("caret return",h),h}))},S=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var a=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(a,(function(a,n,r,s,o,h){i("xRange",t,a,n,r,s,o,h);var l=x(r),c=l||x(s),u=c||x(o),f=u;return"="===n&&f&&(n=""),h=e.includePrerelease?"-0":"",l?a=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(s=0),o=0,">"===n?(n=">=",c?(r=+r+1,s=0,o=0):(s=+s+1,o=0)):"<="===n&&(n="<",c?r=+r+1:s=+s+1),"<"===n&&(h="-0"),a="".concat(n+r,".").concat(s,".").concat(o).concat(h)):c?a=">=".concat(r,".0.0").concat(h," <").concat(+r+1,".0.0-0"):u&&(a=">=".concat(r,".").concat(s,".0").concat(h," <").concat(r,".").concat(+s+1,".0-0")),i("xRange return",a),a}))},T=function(t,e){return i("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,a,n,r,i,s,o,h,l,c,u,f){return a=x(n)?"":x(r)?">=".concat(n,".0.0").concat(t?"-0":""):x(i)?">=".concat(n,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(a):">=".concat(a).concat(t?"-0":""),h=x(l)?"":x(c)?"<".concat(+l+1,".0.0-0"):x(u)?"<".concat(l,".").concat(+c+1,".0-0"):f?"<=".concat(l,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(l,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(h),"".concat(a," ").concat(h).trim()}},F=function(t,e,a){for(var r=0;r0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return yn}Ia(Sn);var Tn=Rn(),Cn=function(t,e,a){try{e=new Tn(e,a)}catch(t){return!1}return e.test(t)},Mn={valid:Ha,coerce:Ka,satisfies:Ia(Cn),SEMVER_SPEC_VERSION:Ea.SEMVER_SPEC_VERSION},Fn=0,Yn=1,Xn=2,Pn=[0,1,2,2,3,0],Ln=s((function t(e,n,i,s){var h;if(r(this,t),o(this,"autoUpdate",!0),o(this,"skeleton",void 0),o(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===Kt.length){var l,c=g((h=new Kt(n)).pages);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.setTexture(new wa(s[u.name]))}}catch(t){c.e(t)}finally{c.f()}}else h=new Kt(n,(function(t){return new wa(s[t])}));var f=new ua(new he(h));f.scale*=.01;var d=f.readSkeletonData(i);this.skeletonVersion=Mn.valid(Mn.coerce(d.version)),this._spine_3_6_0=Mn.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Mn.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Mn.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Mn.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Se(d),this.skeleton.updateWorldTransform(),this.stateData=new qt(this.skeleton.data),this.states=[new Xt(this.stateData)],this.clipper=new ca,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,n,t),t=u.material,e=s,n=0),t=u.material;var f=u.positions,d=u.vertexColor.r,v=u.vertexColor.g,m=u.vertexColor.b,p=u.vertexColor.a,g=u.uvs,y=void 0,k=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var a=this.states.length;for(e=0;et.length)&&(e=t.length);for(var a=0,n=new Array(e);a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function y(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var n=a.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function k(t,e,a){return e=l(e),u(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,a||[],l(t).constructor):e.apply(t,a))}var b=s((function t(){r(this,t),this.array=new Array}),[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),x=s((function t(){r(this,t),this.entries={},this.size=0}),[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,a=0,n=t.length;a0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;r(this,t),this.r=e,this.g=a,this.b=n,this.a=i}return s(t,[{key:"set",value:function(t,e,a,n){return this.r=t,this.g=e,this.b=a,this.a=n,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value: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?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,a,n){return this.r+=t,this.g+=e,this.b+=a,this.a+=n,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value: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}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}])}();w.WHITE=new w(1,1,1,1),w.RED=new w(1,0,0,1),w.GREEN=new w(0,1,0,1),w.BLUE=new w(0,0,1,1),w.MAGENTA=new w(1,0,1,1);var I=function(){function t(){r(this,t)}return s(t,null,[{key:"clamp",value:function(t,e,a){return ta?a:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,a){return t.randomTriangularWith(e,a,.5*(e+a))}},{key:"randomTriangularWith",value:function(t,e,a){var n=Math.random(),r=e-t;return n<=(a-t)/r?t+Math.sqrt(n*r*(a-t)):e-Math.sqrt((1-n)*r*(e-a))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}])}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var A=s((function t(){r(this,t)}),[{key:"apply",value:function(t,e,a){return t+(e-t)*this.applyInternal(a)}}]),E=function(t){function e(t){var a;return r(this,e),(a=k(this,e)).power=2,a.power=t,a}return h(e,t),s(e,[{key:"applyInternal",value: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}}])}(A),S=function(t){function e(t){return r(this,e),k(this,e,[t])}return h(e,t),s(e,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}])}(E),R=function(){function t(){r(this,t)}return s(t,null,[{key:"arrayCopy",value:function(t,e,a,n,r){for(var i=e,s=n;i2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;if(n==e)return t;if(t.length=e,n2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=a?e:t.setArraySize(e,a,n)}},{key:"newArray",value:function(t,e){for(var a=new Array(t),n=0;n0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;r(this,t),this.x=e,this.y=a}),[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),F=s((function t(){r(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}),[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.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)}}]),Y=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;r(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}),[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,f=0;f0&&(h=o);for(var L=t.bone,N=L.worldX,B=L.worldY,O=L.a,_=L.b,D=L.c,V=L.d,U=e,W=r;W0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;le)return n-1;return a-1}},{key:"search",value:function(t,e,a){for(var n=t.length,r=a;re)return r-a;return n-a}}]),it=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,n])).curves=null,i.curves=R.newFloatArray(t+18*a),i.curves[t-1]=1,i}return h(e,t),s(e,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var a=R.newFloatArray(e);R.arrayCopy(this.curves,0,a,0,e),this.curves=a}}},{key:"setBezier",value:function(t,e,a,n,r,i,s,o,h,l,c){var u=this.curves,f=this.getFrameCount()+18*t;0==a&&(u[e]=2+f);for(var d=.03*(n-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-n+l),p=.006*(3*(s-h)-r+c),g=2*d+m,y=2*v+p,k=.3*(i-n)+d+.16666667*m,b=.3*(s-r)+v+.16666667*p,x=n+k,w=r+b,I=f+18;ft){var i=this.frames[e],s=this.frames[e+a];return s+(t-i)/(r[n]-i)*(r[n+1]-s)}var o=n+18;for(n+=2;n=t){var h=r[n-2],l=r[n-1];return l+(t-h)/(r[n]-h)*(r[n+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+a]-u)}}])}(rt),st=function(t){function e(t,a,n){return r(this,e),L(this,e,[t,a,[n]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,a){t<<=1,this.frames[t]=e,this.frames[t+1]=a}},{key:"getCurveValue",value:function(t){for(var e=this.frames,a=e.length-2,n=2;n<=a;n+=2)if(e[n]>t){a=n-2;break}var r=this.curves[a>>1];switch(r){case 0:var i=e[a],s=e[a+1];return s+(t-i)/(e[a+2]-i)*(e[a+2+1]-s);case 1:return e[a+1]}return this.getBezierValue(t,a,1,r-2)}}])}(it),ot=function(t){function e(t,a,n,i){return r(this,e),L(this,e,[t,a,[n,i]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,a,n){t*=3,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n}}])}(it),ht=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,a,_+"|"+n])).boneIndex=0,i.boneIndex=n,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.bones[this.boneIndex];if(o.active)if(a>2];switch(m){case 0:var p=h[v];u=h[v+1],f=h[v+2],d=h[v+3];var g=(a-p)/(h[v+4]-p);u+=(h[v+4+1]-u)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:u=h[v+1],f=h[v+2],d=h[v+3];break;default:u=this.getBezierValue(a,v,1,m-2),f=this.getBezierValue(a,v,2,m+18-2),d=this.getBezierValue(a,v,3,m+36-2)}if(1==r)l.r=u,l.g=f,l.b=d;else{if(i==N.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(u-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}])}(it),bt=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,a,G+"|"+n])).slotIndex=0,i.slotIndex=n,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(a>3];switch(x){case 0:var w=h[b];d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];var I=(a-w)/(h[b+8]-w);d+=(h[b+8+1]-d)*I,v+=(h[b+8+2]-v)*I,m+=(h[b+8+3]-m)*I,p+=(h[b+8+4]-p)*I,g+=(h[b+8+5]-g)*I,y+=(h[b+8+6]-y)*I,k+=(h[b+8+7]-k)*I;break;case 1:d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];break;default:d=this.getBezierValue(a,b,1,x-2),v=this.getBezierValue(a,b,2,x+18-2),m=this.getBezierValue(a,b,3,x+36-2),p=this.getBezierValue(a,b,4,x+54-2),g=this.getBezierValue(a,b,5,x+72-2),y=this.getBezierValue(a,b,6,x+90-2),k=this.getBezierValue(a,b,7,x+108-2)}if(1==r)l.set(d,v,m,p),c.r=g,c.g=y,c.b=k;else{if(i==N.setup){l.setFromColor(o.data.color);var A=o.data.darkColor;c.r=A.r,c.g=A.g,c.b=A.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(y-c.g)*r,c.b+=(k-c.b)*r}}}}}])}(it),wt=function(t){function e(t,a,n){var i;return r(this,e),(i=L(this,e,[t,a,[z+"|"+n,H+"|"+n]])).slotIndex=0,i.slotIndex=n,i}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,a,n,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,c=o.darkColor;if(at){var i=this.frames[e];return a[n+1]*(t-i)/(a[n]-i)}var s=n+18;for(n+=2;n=t){var o=a[n-2],h=a[n-1];return h+(t-o)/(a[n]-o)*(a[n+1]-h)}var l=a[s-2],c=a[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof P&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(i=N.setup);var c=this.vertices,u=c[0].length,f=this.frames;if(a=f[f.length-1]){var p=c[f.length-1];if(1==r)if(i==N.add){var g=h;if(g.bones)for(var y=0;ya)this.apply(t,e,Number.MAX_VALUE,n,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(a0&&o[l-1]==c;)l--;for(;l=o[l];l++)n.push(this.events[l])}}}}])}(rt);Et.propertyIds=[""+Q];var St=function(t){function e(t){var a;return r(this,e),(a=L(this,e,[t,e.propertyIds])).drawOrders=null,a.drawOrders=new Array(t),a}return h(e,t),s(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,a){this.frames[t]=e,this.drawOrders[t]=a}},{key:"apply",value:function(t,e,a,n,r,i,s){if(s!=B.mixOut)if(a>2];switch(d){case 0:var v=h[f];l=h[f+1],c=h[f+2],u=h[f+3];var m=(a-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,c+=(h[f+4+2]-c)*m,u+=(h[f+4+3]-u)*m;break;case 1:l=h[f+1],c=h[f+2],u=h[f+3];break;default:l=this.getBezierValue(a,f,1,d-2),c=this.getBezierValue(a,f,2,d+18-2),u=this.getBezierValue(a,f,3,d+36-2)}if(i==N.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(c-p.mixX)*r,o.mixY=p.mixY+(u-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(c-o.mixX)*r,o.mixY+=(u-o.mixY)*r}}}}])}(it),Xt=function(){function t(e){r(this,t),this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Lt(this),this.propertyIDs=new x,this.animationsChanged=!1,this.trackEntryPool=new C((function(){return new Pt})),this.data=e}return s(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,a=0,n=e.length;a0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(a,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[a]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var a=t.mixingFrom;if(!a)return!0;var n=this.updateMixingFrom(a,e);return a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=a.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=a.mixingFrom,a.mixingFrom&&(a.mixingFrom.mixingTo=t),t.interruptAlpha=a.interruptAlpha,this.queue.end(a)),n):(a.trackTime+=e*a.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,a=this.tracks,n=!1,r=0,i=a.length;r0)){n=!0;var o=0==r?N.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,c=s.getAnimationTime(),u=c,f=e;s.reverse&&(u=s.animation.duration-u,f=null);var d=s.animation.timelines,v=d.length;if(0==r&&1==h||o==N.add)for(var m=0;m1&&(r=1),a!=N.first&&(a=n.mixBlend));var i=r0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,a,n,r){var i=e.slots[t.slotIndex];i.bone.active&&(a0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),u=f+d-d%360,p!=m&&(u+=360*I.signum(d)),i[s]=u}i[s+1]=f,h.rotation=l+u*n}}else t.apply(e,0,a,null,1,r,B.mixIn)}},{key:"queueEvents",value:function(t,e){for(var a=t.animationStart,n=t.animationEnd,r=n-a,i=t.trackLast%r,s=this.events,o=0,h=s.length;on||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var a=e;;){var n=a.mixingFrom;if(!n)break;this.queue.end(n),a.mixingFrom=null,a.mixingTo=null,a=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,a){var n=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,n&&(a&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,a)}},{key:"setAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));var i=this.trackEntry(t,e,a,r);return this.setCurrent(t,i,n),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,a,n)}},{key:"addAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,a,r);return r?(r.next=i,i.previous=r,n<=0&&(n+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=n,i}},{key:"setEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.setAnimationWith(e,t.emptyAnimation(),!1);return n.mixDuration=a,n.trackEnd=a,n}},{key:"addEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,n);return n<=0&&(r.delay+=r.mixDuration-a),r.mixDuration=a,r.trackEnd=a,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var a=0,n=this.tracks.length;a0){r[h]=Vt,i[h]=u;continue t}break}r[h]=Dt}else r[h]=Bt}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return jt||(jt=new O("",[],0)),jt}}])}(),Pt=s((function t(){r(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=N.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}),[{key:"reset",value:function(){this.next=null,this.previous=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}},{key:"getAnimationTime",value: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)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&(s.names=c,s.values=u,c=null,u=null),s.u=s.x/i.width,s.v=s.y/i.height,90==s.degrees?(s.u2=(s.x+s.height)/i.width,s.v2=(s.y+s.width)/i.height):(s.u2=(s.x+s.width)/i.width,s.v2=(s.y+s.height)/i.height),this.regions.push(s)}else{for((i=new ee).name=l.trim();0!=a.readEntry(n,l=a.readLine());){var p=o[n[0]];p&&p()}this.pages.push(i)}}),[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",n=g(this.pages);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.setTexture(t.get(a+r.name))}}catch(t){n.e(t)}finally{n.f()}}},{key:"dispose",value:function(){for(var t=0;t=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var a=e.indexOf(":");if(-1==a)return 0;t[0]=e.substr(0,a).trim();for(var n=1,r=a+1;;n++){var i=e.indexOf(",",r);if(-1==i)return t[n]=e.substr(r).trim(),n;if(t[n]=e.substr(r,i-r).trim(),r=i+1,4==n)return 4}}}]),ee=s((function t(){r(this,t),this.name=null,this.minFilter=Ht.Nearest,this.magFilter=Ht.Nearest,this.uWrap=$t.ClampToEdge,this.vWrap=$t.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}),[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}}]),ae=function(t){function e(){var t,a,n,i;return r(this,e),a=this,i=arguments,n=l(n=e),(t=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(n,i||[],l(a).constructor):n.apply(a,i))).page=null,t.name=null,t.x=0,t.y=0,t.offsetX=0,t.offsetY=0,t.originalWidth=0,t.originalHeight=0,t.index=0,t.degrees=0,t.names=null,t.values=null,t}return h(e,t),s(e)}(Qt);var ne=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).region=null,a.path=null,a.regionUVs=null,a.uvs=null,a.triangles=null,a.color=new w(1,1,1,1),a.width=0,a.height=0,a.hullLength=0,a.edges=null,a.parentMesh=null,a.tempColor=new w(0,0,0,0),a}return h(e,t),s(e,[{key:"updateUVs",value:function(){var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,a=this.uvs.length,n=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof ae){var o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:n-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,i=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u= 0.");if(!a)throw new Error("name cannot be null.");this.index=e,this.name=a,this.parent=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"}(oe||(oe={}));var ce=s((function t(e,a,n){if(r(this,t),this.data=null,this.skeleton=null,this.parent=null,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.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=a,this.parent=n,this.setToSetupPose()}),[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,a,n,r,i,s){this.ax=t,this.ay=e,this.arotation=a,this.ascaleX=n,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=a+90+s,c=h.scaleX,u=h.scaleY;return this.a=I.cosDeg(a+i)*n*c,this.b=I.cosDeg(l)*r*c,this.c=I.sinDeg(a+i)*n*u,this.d=I.sinDeg(l)*r*u,this.worldX=t*c+h.x,void(this.worldY=e*u+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case oe.Normal:var p=a+90+s,g=I.cosDeg(a+i)*n,y=I.cosDeg(p)*r,k=I.sinDeg(a+i)*n,b=I.sinDeg(p)*r;return this.a=f*g+d*k,this.b=f*y+d*b,this.c=v*g+m*k,void(this.d=v*y+m*b);case oe.OnlyTranslation:var x=a+90+s;this.a=I.cosDeg(a+i)*n,this.b=I.cosDeg(x)*r,this.c=I.sinDeg(a+i)*n,this.d=I.sinDeg(x)*r;break;case oe.NoRotationOrReflection:var w=f*f+v*v,A=0;w>1e-4?(w=Math.abs(f*m-d*v)/w,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*w,m=f*w,A=Math.atan2(v,f)*I.radDeg):(f=0,v=0,A=90-Math.atan2(m,d)*I.radDeg);var E=a+i-A,S=a+s-A+90,R=I.cosDeg(E)*n,T=I.cosDeg(S)*r,C=I.sinDeg(E)*n,M=I.sinDeg(S)*r;this.a=f*R-d*C,this.b=f*T-d*M,this.c=v*R+m*C,this.d=v*T+m*M;break;case oe.NoScale:case oe.NoScaleOrReflection:var F=I.cosDeg(a),Y=I.sinDeg(a),X=(f*F+d*Y)/this.skeleton.scaleX,P=(v*F+m*Y)/this.skeleton.scaleY,L=Math.sqrt(X*X+P*P);L>1e-5&&(L=1/L),X*=L,P*=L,L=Math.sqrt(X*X+P*P),this.data.transformMode==oe.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(L=-L);var N=Math.PI/2+Math.atan2(P,X),B=Math.cos(N)*L,O=Math.sin(N)*L,_=I.cosDeg(i)*n,D=I.cosDeg(90+s)*r,V=I.sinDeg(i)*n,U=I.sinDeg(90+s)*r;this.a=X*_+B*V,this.b=X*D+B*U,this.c=P*_+O*V,this.d=P*D+O*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value: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}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.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)*I.radDeg);var e=t.a,a=t.b,n=t.c,r=t.d,i=1/(e*r-a*n),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*r*i-o*a*i,this.ay=o*e*i-s*n*i;var h=i*r,l=i*e,c=i*a,u=i*n,f=h*this.a-c*this.c,d=h*this.b-c*this.d,v=l*this.c-u*this.a,m=l*this.d-u*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),a=t.x-this.worldX,n=t.y-this.worldY;return t.x=a*this.d*e-n*this.b*e,t.y=n*this.a*e-a*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,a=t.y;return t.x=e*this.a+a*this.b+this.worldX,t.y=e*this.c+a*this.d+this.worldY,t}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(this.a*e-this.c*a,this.d*a-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(a*this.c+e*this.d,a*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,a=this.b,n=this.c,r=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*n,this.b=i*a-s*r,this.c=s*e+i*n,this.d=s*a+i*r}}]),ue=s((function t(e,a,n){r(this,t),this.name=e,this.order=a,this.skinRequired=n})),fe=s((function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,t),this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=a,this.downloader=n||new de}),[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,a){this.toLoad--,this.loaded++,this.assets[e]=a,t&&t(e,a)}},{key:"error",value:function(t,e,a){this.toLoad--,this.loaded++,this.errors[e]=a,t&&t(e,a)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,a){requestAnimationFrame((function n(){t.isLoadingComplete()?t.hasErrors()?a(t.errors):e(t):requestAnimationFrame(n)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadBinary(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadText(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load text ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadJson(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(a,t,e.textureLoader(r))},r.onerror=function(){e.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}else fetch(t,{mode:"cors"}).then((function(a){return a.ok?a.blob():(e.error(n,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(n){n&&e.success(a,t,e.textureLoader(n))}))}},{key:"loadTextureAtlas",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new Kt(i),l=h.pages.length,c=!1,u=g(h.pages);try{var f=function(){var i=o.value;e.loadTexture(null==r?s+i.name:r[i.name],(function(n,r){c||(i.setTexture(r),0==--l&&e.success(a,t,h))}),(function(a,r){c||e.error(n,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(a)),c=!0}))};for(u.s();!(o=u.n()).done;)f()}catch(t){u.e(t)}finally{u.f()}}catch(a){e.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(a.message))}}),(function(a,r){e.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var a=this.errors[t];throw Error("Asset not found: "+t+(a?"\n"+a:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),de=s((function t(){r(this,t),this.callbacks={},this.rawDataUris={}}),[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),a=e.length,n=new Uint8Array(a),r=0;r180?f-=360:f<-180&&(f+=360);var x=t.ascaleX,w=t.ascaleY;if(n||r){switch(t.data.transformMode){case oe.NoScale:case oe.NoScaleOrReflection:d=e-t.worldX,v=a-t.worldY}var A=t.data.length*x,E=Math.sqrt(d*d+v*v);if(n&&EA&&A>1e-4){var S=(E/A-1)*s+1;x*=S,i&&(w*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,x,w,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,a,n,r,i,s,o,h){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,d=u,v=f,m=e.ascaleX,p=0,g=0,y=0;u<0?(u=-u,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var k=e.ax,b=0,x=0,w=0,A=t.a,E=t.b,S=t.c,R=t.d,T=Math.abs(u-f)<=1e-4;!T||i?(b=0,x=A*k+t.worldX,w=S*k+t.worldY):(x=A*k+E*(b=e.ay)+t.worldX,w=S*k+R*b+t.worldY);var C=t.parent;A=C.a,E=C.b,S=C.c;var M,F,Y=1/(A*(R=C.d)-E*S),X=x-C.worldX,P=w-C.worldY,L=(X*R-P*E)*Y-l,N=(P*A-X*S)*Y-c,B=Math.sqrt(L*L+N*N),O=e.data.length*m;if(B<1e-4)return this.apply1(t,a,n,!1,i,!1,h),void e.updateWorldTransformWith(k,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var _=((X=a-C.worldX)*R-(P=n-C.worldY)*E)*Y-l,D=(P*A-X*S)*Y-c,V=_*_+D*D;if(0!=o){o*=u*(m+1)*.5;var U=Math.sqrt(V),W=U-B-O*u+o;if(W>0){var j=Math.min(1,W/(2*o))-1;V=(_-=(j=(W-o*(1-j*j))/U)*_)*_+(D-=j*D)*D}}t:if(T){var q=(V-B*B-(O*=u)*O)/(2*B*O);q<-1?(q=-1,F=Math.PI*r):q>1?(q=1,F=0,i&&(d*=A=(Math.sqrt(V)/(B+O)-1)*h+1,s&&(v*=A))):F=Math.acos(q)*r,A=B+O*q,E=O*Math.sin(F),M=Math.atan2(D*A-_*E,_*A+D*E)}else{var z=(A=u*O)*A,G=(E=f*O)*E,H=Math.atan2(D,_),$=-2*G*B,J=G-z;if((R=$*$-4*J*(S=G*B*B+z*V-z*G))>=0){var Q=Math.sqrt(R);$<0&&(Q=-Q);var Z=(Q=.5*-($+Q))/J,K=S/Q,tt=Math.abs(Z)=-1&&S<=1&&(S=Math.acos(S),(R=(X=A*Math.cos(S)+B)*X+(P=E*Math.sin(S))*P)ot&&(it=S,ot=R,st=X,ht=P)),V<=.5*(nt+ot)?(M=H-Math.atan2(rt*r,at),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(b,k)*y,ct=t.arotation;(M=(M-lt)*I.radDeg+p-ct)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,c,ct+M*h,d,v,0,0),ct=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ct)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(k,b,ct+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]);var ge=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t,0,!1],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).bones=new Array,a.target=null,a.bendDirection=1,a.compress=!1,a.stretch=!1,a.uniform=!1,a.mix=1,a.softness=0,a}return h(e,t),s(e)}(ue);var ye,ke,be,xe=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t,0,!1],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).bones=new Array,a.target=null,a.positionMode=null,a.spacingMode=null,a.rotateMode=null,a.offsetRotation=0,a.position=0,a.spacing=0,a.mixRotate=0,a.mixX=0,a.mixY=0,a}return h(e,t),s(e)}(ue);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(ye||(ye={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(ke||(ke={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(be||(be={}));var we=function(){function t(e,a){if(r(this,t),this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=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,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var n=0,i=e.bones.length;n0){b=c/b*d;for(var M=1;M0?I.degRad:-I.degRad}for(var q=0,z=3;q0){var tt=G.a,et=G.b,at=G.c,nt=G.d,rt=0,it=0,st=0;if(rt=s?_[z-1]:0==u[q+1]?_[z+2]:Math.atan2(Q,J),rt-=Math.atan2(at,tt),W){it=Math.cos(rt),st=Math.sin(rt);var ot=G.data.length;D+=(ot*(it*tt-st*at)-J)*a,V+=(ot*(st*tt+it*at)-Q)*a}else rt+=U;rt>I.PI?rt-=I.PI2:rt<-I.PI&&(rt+=I.PI2),rt*=a,it=Math.cos(rt),st=Math.sin(rt),G.a=it*tt-st*at,G.b=it*et-st*nt,G.c=st*tt+it*at,G.d=st*et+it*nt}G.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,a,n){var r=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*a+2),h=null,l=e.closed,c=e.worldVerticesLength,u=c/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[u-=l?1:2];switch(this.data.positionMode==ye.Percent&&(i*=m),this.data.spacingMode){case ke.Percent:d=m;break;case ke.Proportional:d=m/a;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(b-m,h,0,o,g);continue}}for(;;y++){var x=v[y];if(!(b>x)){if(0==y)b/=x;else{var w=v[y-1];b=(b-w)/(x-w)}break}}y!=f&&(f=y,l&&y==u?(e.computeWorldVertices(r,c-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(b,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,n||p>0&&0==k)}return o}l?(c+=2,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c-4,h,0,2),e.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c,h,0,2));for(var I,A=R.setArraySize(this.curves,u),E=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,X=0,P=0,L=0,N=0,B=0,O=0,_=0,D=0,V=0,U=0,W=0,j=2;WE){this.addAfterPosition(Z-E,h,c-4,o,H);continue}}for(;;$++){var K=A[$];if(!(Z>K)){if(0==$)Z/=K;else{var tt=A[$-1];Z=(Z-tt)/(K-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],_=2*(L=.03*(S-2*C+F))+(B=.006*(3*(C-F)-S+(X=h[et+6]))),D=2*(N=.03*(T-2*M+Y))+(O=.006*(3*(M-Y)-T+(P=h[et+7]))),V=.3*(C-S)+L+.16666667*B,U=.3*(M-T)+N+.16666667*O,z=Math.sqrt(V*V+U*U),q[0]=z,et=1;et<8;et++)V+=_,U+=D,_+=B,D+=O,z+=Math.sqrt(V*V+U*U),q[et]=z;V+=_,U+=D,z+=Math.sqrt(V*V+U*U),q[8]=z,V+=_+B,U+=D+O,z+=Math.sqrt(V*V+U*U),q[9]=z,J=0}for(Z*=z;;J++){var at=q[J];if(!(Z>at)){if(0==J)Z/=at;else{var nt=q[J-1];Z=J+(Z-nt)/(at-nt)}break}}this.addCurvePosition(.1*Z,S,T,C,M,F,Y,X,P,o,H,n||G>0&&0==Q)}return o}},{key:"addBeforePosition",value:function(t,e,a,n,r){var i=e[a],s=e[a+1],o=e[a+2]-i,h=e[a+3]-s,l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addAfterPosition",value:function(t,e,a,n,r){var i=e[a+2],s=e[a+3],o=i-e[a],h=s-e[a+1],l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addCurvePosition",value:function(t,e,a,n,r,i,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=a,void(l[c+2]=Math.atan2(r-a,n-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,k=v*y,b=y*t,x=e*p+n*k+i*b+o*d,w=a*p+r*k+s*b+h*d;l[c]=x,l[c+1]=w,u&&(l[c+2]=t<.001?Math.atan2(r-a,n-e):Math.atan2(w-(a*m+r*g*2+s*f),x-(e*m+n*g*2+i*f)))}}])}();we.NONE=-1,we.BEFORE=-2,we.AFTER=-3,we.epsilon=1e-5;var Ie,Ae=s((function t(e,a){if(r(this,t),this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentTime=0,this.attachmentState=0,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!a)throw new Error("bone cannot be null.");this.data=e,this.bone=a,this.color=new w,this.darkColor=e.darkColor?new w:null,this.setToSetupPose()}),[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof P&&this.attachment instanceof P&&t.deformAttachment==this.attachment.deformAttachment||(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}},{key:"setAttachmentTime",value:function(t){this.attachmentTime=this.bone.skeleton.time-t}},{key:"getAttachmentTime",value:function(){return this.bone.skeleton.time-this.attachmentTime}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),Ee=s((function t(e,a){if(r(this,t),this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new M,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var n=0;n0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(R.x-y.worldX)*e,y.worldY+=(R.y-y.worldY)*a}if(0!=n){var T=Math.sqrt(y.a*y.a+y.c*y.c);0!=T&&(T=(T+(Math.sqrt(h*h+c*c)-T+this.data.offsetScaleX)*n)/T),y.a*=T,y.c*=T}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+u*u)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),X=Math.atan2(u,l)-Math.atan2(c,h)-(Y-Math.atan2(y.c,y.a));X>I.PI?X-=I.PI2:X<-I.PI&&(X+=I.PI2),X=Y+(X+v)*i;var P=Math.sqrt(M*M+F*F);y.b=Math.cos(X)*P,y.d=Math.sin(X)*P}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=a,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=R.x*e,y.worldY+=R.y*a}if(0!=n){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*n+1;y.a*=T,y.c*=T}if(0!=r){var C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(u,l)-Math.atan2(c,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var X=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*X,y.d=Math.sin(M)*X}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var n=this.drawOrder,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=n.length;h0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r(this,t),this.slotIndex=e,this.name=a,this.attachment=n})),Ce=s((function t(e){if(r(this,t),this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}),[{key:"setAttachment",value:function(t,e,a){if(!a)throw new Error("attachment cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=a}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!a)throw new Error("name cannot be null.");if(!n)throw new Error("boneData cannot be null.");this.index=e,this.name=a,this.boneData=n}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Ie||(Ie={}));var Fe,Ye=function(t){function e(t){var a,n,i,s;return r(this,e),n=this,s=[t,0,!1],i=l(i=e),(a=u(n,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(n).constructor):i.apply(n,s))).bones=new Array,a.target=null,a.mixRotate=0,a.mixX=0,a.mixY=0,a.mixScaleX=0,a.mixScaleY=0,a.mixShearY=0,a.offsetRotation=0,a.offsetX=0,a.offsetY=0,a.offsetScaleX=0,a.offsetScaleY=0,a.offsetShearY=0,a.relative=!1,a.local=!1,a}return h(e,t),s(e)}(ue),Xe=s((function t(e){r(this,t),this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=e}),[{key:"readSkeletonData",value:function(t){var e=this.scale,a=new Re;a.name="";var n=new Pe(t),r=n.readInt32(),i=n.readInt32();a.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),a.version=n.readString(),a.x=n.readFloat(),a.y=n.readFloat(),a.width=n.readFloat(),a.height=n.readFloat();var s=n.readBoolean();s&&(a.fps=n.readFloat(),a.imagesPath=n.readString(),a.audioPath=n.readString());var o=0;o=n.readInt(!0);for(var h=0;h0){for(var pn=new St(mn),gn=a.slots.length,yn=0;yn=0;wn--)xn[wn]=-1;for(var In=R.newArray(gn-bn,0),An=0,En=0,Sn=0;Sn=0;Tn--)-1==xn[Tn]&&(xn[Tn]=In[--En]);pn.setFrame(yn,kn,xn)}n.push(pn)}var Cn=t.readInt(!0);if(Cn>0){for(var Mn=new Et(Cn),Fn=0;Fn1&&void 0!==arguments[1]?arguments[1]:new Array,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);r(this,t),this.strings=a,this.index=n,this.buffer=i}),[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),a=127&e;return 0!=(128&e)&&(a|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<28)))),t?a:a>>>1^-(1&a)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",a=0;a>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),a+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),a+=3;break;default:e+=String.fromCharCode(n),a++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),Le=s((function t(e,a,n,i,s){r(this,t),this.mesh=e,this.skin=a,this.slotIndex=n,this.parent=i,this.inheritDeform=s})),Ne=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this.bones=e,this.vertices=a}));function Be(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,n,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(i);break;case oa:_e(t,e,s++,i,0,n,h,r,l,a)}n=h,r=l}return e}function Oe(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=t.readFloat()*a,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,n,r,i),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*a,u=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(s);break;case oa:_e(t,e,o++,s,0,n,l,r,c,a),_e(t,e,o++,s,1,n,l,i,u,a)}n=l,r=c,i=u}return e}function _e(t,e,a,n,r,i,s,o,h,l){e.setBezier(a,n,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Fe||(Fe={}));var De,Ve=0,Ue=1,We=2,je=3,qe=4,ze=5,Ge=6,He=7,$e=8,Je=9,Qe=0,Ze=1,Ke=2,ta=3,ea=4,aa=5,na=0,ra=1,ia=2,sa=1,oa=2,ha=s((function t(){r(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new C((function(){return R.newFloatArray(16)}))}),[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var a=this.boundingBoxes,n=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;a.length=0,r.freeAll(n),n.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,a,n){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&a<=r||e<=i&&n<=i||t>=s&&a>=s||e>=o&&n>=o)return!1;var h=(n-e)/(a-t),l=h*(r-t)+e;if(l>i&&li&&lr&&cr&&ct.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var a=this.polygons,n=0,r=a.length;n=a||l=a){var c=n[o];c+(a-h)/(l-h)*(n[i]-c)=c&&k<=d||k>=d&&k<=c)&&(k>=e&&k<=n||k>=n&&k<=e)){var b=(l*g-h*m)/y;if((b>=u&&b<=v||b>=v&&b<=u)&&(b>=a&&b<=r||b>=r&&b<=a))return!0}c=d,u=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),la=function(){function t(){r(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new C((function(){return new Array})),this.polygonIndicesPool=new C((function(){return new Array}))}return s(t,[{key:"triangulate",value:function(e){var a=e,n=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var c=n-1,u=0,f=1;;){t:if(!s[u]){for(var d=r[c]<<1,v=r[u]<<1,m=r[f]<<1,p=a[d],g=a[d+1],y=a[v],k=a[v+1],b=a[m],x=a[m+1],w=(f+1)%n;w!=c;w=(w+1)%n)if(s[w]){var I=r[w]<<1,A=a[I],E=a[I+1];if(t.positiveArea(b,x,p,g,A,E)&&t.positiveArea(p,g,y,k,A,E)&&t.positiveArea(y,k,b,x,A,E))break t}break}if(0==f){do{if(!s[u])break;u--}while(u>0);break}c=u,u=f,f=(f+1)%n}l.push(r[(n+u-1)%n]),l.push(r[u]),l.push(r[(u+1)%n]),r.splice(u,1),s.splice(u,1);var S=(--n+u-1)%n,R=u==n?0:u;s[S]=t.isConcave(S,n,a,r),s[R]=t.isConcave(R,n,a,r)}return 3==n&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,a){var n=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,c=0,u=a.length;c0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(k),o.push(b),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,k,b),h=f)}o.length>0&&(r.push(o),i.push(s));for(var E=0,S=r.length;E=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,a,n){var r=n[(e+t-1)%e]<<1,i=n[t]<<1,s=n[(t+1)%e]<<1;return!this.positiveArea(a[r],a[r+1],a[i],a[i+1],a[s],a[s+1])}},{key:"positiveArea",value:function(t,e,a,n,r,i){return t*(i-n)+a*(e-i)+r*(n-e)>=0}},{key:"winding",value:function(t,e,a,n,r,i){var s=a-t,o=n-e;return r*o-i*s+s*e-t*o>=0?1:-1}}])}(),ca=function(){function t(){r(this,t),this.triangulator=new la,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return s(t,[{key:"clipStart",value:function(e,a){if(this.clipAttachment)return 0;this.clipAttachment=a;var n=a.worldVerticesLength,r=R.setArraySize(this.clippingPolygon,n);a.computeWorldVertices(e,0,n,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),W=0;W=2?(c=o,o=this.scratch):c=this.scratch,c.length=0,c.push(t),c.push(e),c.push(a),c.push(n),c.push(r),c.push(i),c.push(t),c.push(e),o.length=0;for(var u=s,f=s.length-4,d=0;;d+=2){for(var v=u[d],m=u[d+1],p=u[d+2],g=u[d+3],y=v-p,k=m-g,b=c,x=c.length-2,w=o.length,I=0;I0;if(y*(E-g)-k*(A-p)>0){if(T){o.push(S),o.push(R);continue}var C=R-E,M=S-A,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-E)-C*(v-A))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(T){var X=R-E,P=S-A,L=X*(p-v)-P*(g-m);if(Math.abs(L)>1e-6){var N=(P*(m-E)-X*(v-A))/L;o.push(v+(p-v)*N),o.push(m+(g-m)*N)}else o.push(v),o.push(m);o.push(S),o.push(R)}l=!0}if(w==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var B=o;(o=c).length=0,c=B}if(h!=o){h.length=0;for(var O=0,_=o.length-2;O<_;O++)h[O]=o[O]}else h.length=h.length-2;return l}}],[{key:"makeClockwise",value:function(t){for(var e=t,a=t.length,n=e[a-2]*e[1]-e[0]*e[a-1],r=0,i=0,s=0,o=0,h=a-3;o>1;l=0;Ga--)-1==_a[Ga]&&(_a[Ga]=Va[--Wa])}Pa.setFrame(Na,pa(Oa,"time",0),_a)}r.push(Pa)}if(t.events){for(var Ha=new Et(t.events.length),$a=0,Ja=0;Ja)?=?)"),v("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),v("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),v("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),v("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),v("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(a,"})")+"(?:\\.(\\d{1,".concat(a,"}))?")+"(?:\\.(\\d{1,".concat(a,"}))?")),v("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),v("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),v("COERCERTL",h[l.COERCE],!0),v("COERCERTLFULL",h[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",v("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),v("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("LONECARET","(?:\\^)"),v("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",v("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),v("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),v("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),v("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),v("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ta,Ta.exports);var Ca=Ta.exports;Ia(Ca);var Ma=Object.freeze({loose:!0}),Fa=Object.freeze({}),Ya=function(t){return t?"object"!==n(t)?Ma:t:Fa};Ia(Ya);var Xa=/^[0-9]+$/,Pa=function(t,e){var a=Xa.test(t),n=Xa.test(e);return a&&n&&(t=+t,e=+e),t===e?0:a&&!n?-1:n&&!a?1:tBa)throw new TypeError("version is longer than ".concat(Ba," characters"));Na("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;var i=e.trim().match(a.loose?_a[Da.LOOSE]:_a[Da.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Oa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===a)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(e){var i=[e,n];!1===a&&(i=[e]),0===Ua(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),ja=Wa;Ia(ja);var qa=ja,za=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof qa)return t;try{return new qa(t,e)}catch(t){if(!a)return null;throw t}};Ia(za);var Ga=za,Ha=Ia((function(t,e){var a=Ga(t,e);return a?a.version:null})),$a=ja,Ja=za,Qa=Ca.safeRe,Za=Ca.t,Ka=Ia((function(t,e){if(t instanceof $a)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var a=null;if((e=e||{}).rtl){for(var n,r=e.includePrerelease?Qa[Za.COERCERTLFULL]:Qa[Za.COERCERTL];(n=r.exec(t))&&(!a||a.index+a[0].length!==t.length);)a&&n.index+n[0].length===a.index+a[0].length||(a=n),r.lastIndex=n.index+n[1].length+n[2].length;r.lastIndex=-1}else a=t.match(e.includePrerelease?Qa[Za.COERCEFULL]:Qa[Za.COERCE]);if(null===a)return null;var i=a[2],s=a[3]||"0",o=a[4]||"0",h=e.includePrerelease&&a[5]?"-".concat(a[5]):"",l=e.includePrerelease&&a[6]?"+".concat(a[6]):"";return Ja("".concat(i,".").concat(s,".").concat(o).concat(h).concat(l),e)})),tn=s((function t(){r(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var a=this.map.keys().next().value;this.delete(a)}this.map.set(t,e)}return this}}]);Ia(tn);var en=ja,an=function(t,e,a){return new en(t,a).compare(new en(e,a))};Ia(an);var nn=an,rn=function(t,e,a){return 0===nn(t,e,a)};Ia(rn);var sn=an,on=function(t,e,a){return 0!==sn(t,e,a)};Ia(on);var hn=an,ln=function(t,e,a){return hn(t,e,a)>0};Ia(ln);var cn=an,un=function(t,e,a){return cn(t,e,a)>=0};Ia(un);var fn=an,dn=function(t,e,a){return fn(t,e,a)<0};Ia(dn);var vn=an,mn=function(t,e,a){return vn(t,e,a)<=0};Ia(mn);var pn,gn,yn,kn,bn=rn,xn=on,wn=ln,In=un,An=dn,En=mn,Sn=function(t,e,a,r){switch(e){case"===":return"object"===n(t)&&(t=t.version),"object"===n(a)&&(a=a.version),t===a;case"!==":return"object"===n(t)&&(t=t.version),"object"===n(a)&&(a=a.version),t!==a;case"":case"=":case"==":return bn(t,a,r);case"!=":return xn(t,a,r);case">":return wn(t,a,r);case">=":return In(t,a,r);case"<":return An(t,a,r);case"<=":return En(t,a,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Rn(){if(kn)return yn;kn=1;var t=function(){function t(e,i){var s=this;if(r(this,t),i=a(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!p(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=g(this.set);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(1===c.length&&y(c[0])){this.set=[c];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return s(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var a=this,r=((this.options.includePrerelease&&d)|(this.options.loose&&m))+":"+t,s=e.get(r);if(s)return s;var o=this.options.loose,y=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(y,M(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],c),i("comparator trim",t),t=t.replace(h[l.TILDETRIM],u),i("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),i("caret trim",t);var k=t.split(" ").map((function(t){return b(t,a.options)})).join(" ").split(/\s+/).map((function(t){return C(t,a.options)}));o&&(k=k.filter((function(t){return i("loose invalid filter",t,a.options),!!t.match(h[l.COMPARATORLOOSE])}))),i("range list",k);var x,w=new Map,I=k.map((function(t){return new n(t,a.options)})),A=g(I);try{for(A.s();!(x=A.n()).done;){var E=x.value;if(p(E))return[E];w.set(E.value,E)}}catch(t){A.e(t)}finally{A.f()}w.size>1&&w.has("")&&w.delete("");var S=v(w.values());return e.set(r,S),S}},{key:"intersects",value:function(e,a){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return k(t,a)&&e.set.some((function(e){return k(e,a)&&t.every((function(t){return e.every((function(e){return t.intersects(e,a)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new o(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(o(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(o(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();pn=e;var a=Ya,n=Ca.safeRe,i=Ca.t,o=Sn,h=Ra,l=ja,c=Rn();return pn}(),i=Ra,o=ja,h=Ca.safeRe,l=Ca.t,c=Ca.comparatorTrimReplace,u=Ca.tildeTrimReplace,f=Ca.caretTrimReplace,d=Aa.FLAG_INCLUDE_PRERELEASE,m=Aa.FLAG_LOOSE,p=function(t){return"<0.0.0-0"===t.value},y=function(t){return""===t.value},k=function(t,e){for(var a=!0,n=t.slice(),r=n.pop();a&&n.length;)a=n.every((function(t){return r.intersects(t,e)})),r=n.pop();return a},b=function(t,e){return i("comp",t,e),t=A(t,e),i("caret",t),t=w(t,e),i("tildes",t),t=S(t,e),i("xrange",t),t=T(t,e),i("stars",t),t},x=function(t){return!t||"x"===t.toLowerCase()||"*"===t},w=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){var a=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(a,(function(e,a,n,r,s){var o;return i("tilde",t,e,a,n,r,s),x(a)?o="":x(n)?o=">=".concat(a,".0.0 <").concat(+a+1,".0.0-0"):x(r)?o=">=".concat(a,".").concat(n,".0 <").concat(a,".").concat(+n+1,".0-0"):s?(i("replaceTilde pr",s),o=">=".concat(a,".").concat(n,".").concat(r,"-").concat(s," <").concat(a,".").concat(+n+1,".0-0")):o=">=".concat(a,".").concat(n,".").concat(r," <").concat(a,".").concat(+n+1,".0-0"),i("tilde return",o),o}))},A=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){i("caret",t,e);var a=e.loose?h[l.CARETLOOSE]:h[l.CARET],n=e.includePrerelease?"-0":"";return t.replace(a,(function(e,a,r,s,o){var h;return i("caret",t,e,a,r,s,o),x(a)?h="":x(r)?h=">=".concat(a,".0.0").concat(n," <").concat(+a+1,".0.0-0"):x(s)?h="0"===a?">=".concat(a,".").concat(r,".0").concat(n," <").concat(a,".").concat(+r+1,".0-0"):">=".concat(a,".").concat(r,".0").concat(n," <").concat(+a+1,".0.0-0"):o?(i("replaceCaret pr",o),h="0"===a?"0"===r?">=".concat(a,".").concat(r,".").concat(s,"-").concat(o," <").concat(a,".").concat(r,".").concat(+s+1,"-0"):">=".concat(a,".").concat(r,".").concat(s,"-").concat(o," <").concat(a,".").concat(+r+1,".0-0"):">=".concat(a,".").concat(r,".").concat(s,"-").concat(o," <").concat(+a+1,".0.0-0")):(i("no pr"),h="0"===a?"0"===r?">=".concat(a,".").concat(r,".").concat(s).concat(n," <").concat(a,".").concat(r,".").concat(+s+1,"-0"):">=".concat(a,".").concat(r,".").concat(s).concat(n," <").concat(a,".").concat(+r+1,".0-0"):">=".concat(a,".").concat(r,".").concat(s," <").concat(+a+1,".0.0-0")),i("caret return",h),h}))},S=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var a=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(a,(function(a,n,r,s,o,h){i("xRange",t,a,n,r,s,o,h);var l=x(r),c=l||x(s),u=c||x(o),f=u;return"="===n&&f&&(n=""),h=e.includePrerelease?"-0":"",l?a=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(c&&(s=0),o=0,">"===n?(n=">=",c?(r=+r+1,s=0,o=0):(s=+s+1,o=0)):"<="===n&&(n="<",c?r=+r+1:s=+s+1),"<"===n&&(h="-0"),a="".concat(n+r,".").concat(s,".").concat(o).concat(h)):c?a=">=".concat(r,".0.0").concat(h," <").concat(+r+1,".0.0-0"):u&&(a=">=".concat(r,".").concat(s,".0").concat(h," <").concat(r,".").concat(+s+1,".0-0")),i("xRange return",a),a}))},T=function(t,e){return i("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,a,n,r,i,s,o,h,l,c,u,f){return a=x(n)?"":x(r)?">=".concat(n,".0.0").concat(t?"-0":""):x(i)?">=".concat(n,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(a):">=".concat(a).concat(t?"-0":""),h=x(l)?"":x(c)?"<".concat(+l+1,".0.0-0"):x(u)?"<".concat(l,".").concat(+c+1,".0-0"):f?"<=".concat(l,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(l,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(h),"".concat(a," ").concat(h).trim()}},F=function(t,e,a){for(var r=0;r0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return yn}Ia(Sn);var Tn=Rn(),Cn=function(t,e,a){try{e=new Tn(e,a)}catch(t){return!1}return e.test(t)},Mn={valid:Ha,coerce:Ka,satisfies:Ia(Cn),SEMVER_SPEC_VERSION:Ea.SEMVER_SPEC_VERSION},Fn=0,Yn=1,Xn=2,Pn=[0,1,2,2,3,0],Ln=s((function t(e,n,i,s){var h;if(r(this,t),o(this,"autoUpdate",!0),o(this,"skeleton",void 0),o(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===Kt.length){var l,c=g((h=new Kt(n)).pages);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.setTexture(new wa(s[u.name]))}}catch(t){c.e(t)}finally{c.f()}}else h=new Kt(n,(function(t){return new wa(s[t])}));var f=new ua(new he(h));f.scale*=.01;var d=f.readSkeletonData(i);this.skeletonVersion=Mn.valid(Mn.coerce(d.version)),this._spine_3_6_0=Mn.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Mn.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Mn.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Mn.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Se(d),this.skeleton.updateWorldTransform(),this.stateData=new qt(this.skeleton.data),this.states=[new Xt(this.stateData)],this.clipper=new ca,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,n,t),t=u.material,e=s,n=0),t=u.material;var f=u.positions,d=u.vertexColor.r,v=u.vertexColor.g,m=u.vertexColor.b,p=u.vertexColor.a,g=u.uvs,y=void 0,k=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var a=this.states.length;for(e=0;et.length)&&(e=t.length);for(var n=0,a=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function y(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e);if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function w(t,e,n){return e=l(e),u(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}var k=s((function t(){r(this,t),this.array=new Array}),[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),b=s((function t(){r(this,t),this.entries={},this.size=0}),[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,n=0,a=t.length;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;r(this,t),this.r=e,this.g=n,this.b=a,this.a=i}return s(t,[{key:"set",value:function(t,e,n,a){return this.r=t,this.g=e,this.b=n,this.a=a,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value: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?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,n,a){return this.r+=t,this.g+=e,this.b+=n,this.a+=a,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value: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}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}])}();x.WHITE=new x(1,1,1,1),x.RED=new x(1,0,0,1),x.GREEN=new x(0,1,0,1),x.BLUE=new x(0,0,1,1),x.MAGENTA=new x(1,0,1,1);var I=function(){function t(){r(this,t)}return s(t,null,[{key:"clamp",value:function(t,e,n){return tn?n:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))}},{key:"randomTriangularWith",value:function(t,e,n){var a=Math.random(),r=e-t;return a<=(n-t)/r?t+Math.sqrt(a*r*(n-t)):e-Math.sqrt((1-a)*r*(e-n))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}])}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var E=s((function t(){r(this,t)}),[{key:"apply",value:function(t,e,n){return t+(e-t)*this.applyInternal(n)}}]),A=function(t){function e(t){var n;return r(this,e),(n=w(this,e)).power=2,n.power=t,n}return h(e,t),s(e,[{key:"applyInternal",value: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=function(t){function e(t){return r(this,e),w(this,e,[t])}return h(e,t),s(e,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}])}(A),R=function(){function t(){r(this,t)}return s(t,null,[{key:"arrayCopy",value:function(t,e,n,a,r){for(var i=e,s=a;i2&&void 0!==arguments[2]?arguments[2]:0,a=t.length;if(a==e)return t;if(t.length=e,a2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=n?e:t.setArraySize(e,n,a)}},{key:"newArray",value:function(t,e){for(var n=new Array(t),a=0;a0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;r(this,t),this.x=e,this.y=n}),[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),F=s((function t(){r(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}),[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.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)}}]),Y=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;r(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}),[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,f=0;f0&&(h=o);for(var L=t.bone,N=L.worldX,B=L.worldY,_=L.a,O=L.b,D=L.c,V=L.d,U=e,q=r;q=this.regions.length&&(n=this.regions.length-1);var a=this.regions[n];e.region!=a&&(e.region=a,e.updateRegion())}},{key:"getPath",value:function(t,e){for(var n=t,a=(this.start+e).toString(),r=this.digits-a.length;r>0;r--)n+="0";return n+=a}}],[{key:"nextID",value:function(){return t._nextID++}}])}();N._nextID=0,function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(L||(L={}));var B=[L.hold,L.once,L.loop,L.pingpong,L.onceReverse,L.loopReverse,L.pingpongReverse];function _(t,e,n){return e=l(e),u(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}var O,D,V=s((function t(e,n,a){if(r(this,t),this.timelines=[],this.timelineIds=new b,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(n),this.duration=a}),[{key:"setTimelines",value:function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;le)return a-1;return n-1}},{key:"search",value:function(t,e,n){for(var a=t.length,r=n;re)return r-n;return a-n}}]),lt=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,a])).curves=R.newFloatArray(t+18*n),i.curves[t-1]=1,i}return h(e,t),s(e,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=R.newFloatArray(e);R.arrayCopy(this.curves,0,n,0,e),this.curves=n}}},{key:"setBezier",value:function(t,e,n,a,r,i,s,o,h,l,c){var u=this.curves,f=this.getFrameCount()+18*t;0==n&&(u[e]=2+f);for(var d=.03*(a-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-a+l),p=.006*(3*(s-h)-r+c),g=2*d+m,y=2*v+p,w=.3*(i-a)+d+.16666667*m,k=.3*(s-r)+v+.16666667*p,b=a+w,x=r+k,I=f+18;ft){var i=this.frames[e],s=this.frames[e+n];return s+(t-i)/(r[a]-i)*(r[a+1]-s)}var o=a+18;for(a+=2;a=t){var h=r[a-2],l=r[a-1];return l+(t-h)/(r[a]-h)*(r[a+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)}}])}(ht),ct=function(t){function e(t,n,a){return r(this,e),_(this,e,[t,n,[a]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n}},{key:"getCurveValue",value:function(t){for(var e=this.frames,n=e.length-2,a=2;a<=n;a+=2)if(e[a]>t){n=a-2;break}var r=this.curves[n>>1];switch(r){case 0:var i=e[n],s=e[n+1];return s+(t-i)/(e[n+2]-i)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,r-2)}}])}(lt),ut=function(t){function e(t,n,a,i){return r(this,e),_(this,e,[t,n,[a,i]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,n,a){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=a}}])}(lt),ft=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,n,U+"|"+a])).boneIndex=0,i.boneIndex=a,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.bones[this.boneIndex];if(o.active)if(n>2];switch(m){case 0:var p=h[v];u=h[v+1],f=h[v+2],d=h[v+3];var g=(n-p)/(h[v+4]-p);u+=(h[v+4+1]-u)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:u=h[v+1],f=h[v+2],d=h[v+3];break;default:u=this.getBezierValue(n,v,1,m-2),f=this.getBezierValue(n,v,2,m+18-2),d=this.getBezierValue(n,v,3,m+36-2)}if(1==r)l.r=u,l.g=f,l.b=d;else{if(i==O.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(u-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}])}(lt),Et=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,n,J+"|"+a])).slotIndex=0,i.slotIndex=a,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(n>3];switch(b){case 0:var x=h[k];d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];var I=(n-x)/(h[k+8]-x);d+=(h[k+8+1]-d)*I,v+=(h[k+8+2]-v)*I,m+=(h[k+8+3]-m)*I,p+=(h[k+8+4]-p)*I,g+=(h[k+8+5]-g)*I,y+=(h[k+8+6]-y)*I,w+=(h[k+8+7]-w)*I;break;case 1:d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];break;default:d=this.getBezierValue(n,k,1,b-2),v=this.getBezierValue(n,k,2,b+18-2),m=this.getBezierValue(n,k,3,b+36-2),p=this.getBezierValue(n,k,4,b+54-2),g=this.getBezierValue(n,k,5,b+72-2),y=this.getBezierValue(n,k,6,b+90-2),w=this.getBezierValue(n,k,7,b+108-2)}if(1==r)l.set(d,v,m,p),c.r=g,c.g=y,c.b=w;else{if(i==O.setup){l.setFromColor(o.data.color);var E=o.data.darkColor;c.r=E.r,c.g=E.g,c.b=E.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(y-c.g)*r,c.b+=(w-c.b)*r}}}}}])}(lt),St=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,n,[$+"|"+a,K+"|"+a]])).slotIndex=0,i.slotIndex=a,i}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,n,a,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,c=o.darkColor;if(nt){var i=this.frames[e];return n[a+1]*(t-i)/(n[a]-i)}var s=a+18;for(a+=2;a=t){var o=n[a-2],h=n[a-1];return h+(t-o)/(n[a]-o)*(n[a+1]-h)}var l=n[s-2],c=n[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h&&h instanceof X&&h.timelineAttachment==this.attachment){var l=o.deform;0==l.length&&(i=O.setup);var c=this.vertices,u=c[0].length,f=this.frames;if(n=f[f.length-1]){var p=c[f.length-1];if(1==r)if(i==O.add){var g=h;if(g.bones)for(var y=0;yn)this.apply(t,e,Number.MAX_VALUE,a,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(n0&&o[l-1]==c;)l--;for(;l=o[l];l++)a.push(this.events[l])}}}}])}(ht);Ct.propertyIds=[""+tt];var Mt=function(t){function e(t){var n;return r(this,e),(n=_(this,e,[t,e.propertyIds])).drawOrders=new Array(t),n}return h(e,t),s(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}},{key:"apply",value:function(t,e,n,a,r,i,s){if(s!=D.mixOut)if(n>2];switch(d){case 0:var v=h[f];l=h[f+1],c=h[f+2],u=h[f+3];var m=(n-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,c+=(h[f+4+2]-c)*m,u+=(h[f+4+3]-u)*m;break;case 1:l=h[f+1],c=h[f+2],u=h[f+3];break;default:l=this.getBezierValue(n,f,1,d-2),c=this.getBezierValue(n,f,2,d+18-2),u=this.getBezierValue(n,f,3,d+36-2)}if(i==O.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(c-p.mixX)*r,o.mixY=p.mixY+(u-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(c-o.mixX)*r,o.mixY+=(u-o.mixY)*r}}}}])}(lt),Nt=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,[ot+"|"+n+"|"+a.sequence.id]])).slotIndex=n,i.attachment=a,i}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return e.ENTRIES}},{key:"getSlotIndex",value:function(){return this.slotIndex}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setFrame",value:function(t,n,a,r,i){var s=this.frames;s[t*=e.ENTRIES]=n,s[t+e.MODE]=a|r<<4,s[t+e.DELAY]=i}},{key:"apply",value:function(t,n,a,r,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.attachment,c=this.attachment;if(l==c||l instanceof X&&l.timelineAttachment==c){var u=this.frames;if(a>4,g=this.attachment.sequence.regions.length,y=B[15&v];if(y!=L.hold)switch(p+=(a-d)/m+1e-5|0,y){case L.once:p=Math.min(g-1,p);break;case L.loop:p%=g;break;case L.pingpong:var w=(g<<1)-2;(p=0==w?0:p%w)>=g&&(p=w-p);break;case L.onceReverse:p=Math.max(g-1-p,0);break;case L.loopReverse:p=g-1-p%g;break;case L.pingpongReverse:var k=(g<<1)-2;(p=0==k?0:(p+g-1)%k)>=g&&(p=k-p)}h.sequenceIndex=p}}}}}}])}(ht);Nt.ENTRIES=3,Nt.MODE=1,Nt.DELAY=2;var Bt=function(){function t(e){r(this,t),this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Dt(this),this.propertyIDs=new b,this.animationsChanged=!1,this.trackEntryPool=new C((function(){return new Ot})),this.data=e}return s(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,n=0,a=e.length;n0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var n=t.mixingFrom;if(!n)return!0;var a=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,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),a):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,a=!1,r=0,i=n.length;r0)){a=!0;var o=0==r?O.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,c=s.getAnimationTime(),u=c,f=e;s.reverse&&(u=s.animation.duration-u,f=null);var d=s.animation.timelines,v=d.length;if(0==r&&1==h||o==O.add)for(var m=0;m1&&(r=1),n!=O.first&&(n=a.mixBlend));var i=r0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,n,a,r){var i=e.slots[t.slotIndex];i.bone.active&&(n0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),u=f+d-d%360,p!=m&&(u+=360*I.signum(d)),i[s]=u}i[s+1]=f,h.rotation=l+u*a}}else t.apply(e,0,n,null,1,r,D.mixIn)}},{key:"queueEvents",value:function(t,e){for(var n=t.animationStart,a=t.animationEnd,r=a-n,i=t.trackLast%r,s=this.events,o=0,h=s.length;oa||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:e>=a&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var a=n.mixingFrom;if(!a)break;this.queue.end(a),n.mixingFrom=null,n.mixingTo=null,n=a}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,n){var a=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,a&&(n&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,a,n)}},{key:"setAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var a=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));var i=this.trackEntry(t,e,n,r);return this.setCurrent(t,i,a),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,a)}},{key:"addAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,n,r);return r?(r.next=i,i.previous=r,a<=0&&(a+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=a,i}},{key:"setEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=this.setAnimationWith(e,t.emptyAnimation(),!1);return a.mixDuration=n,a.trackEnd=n,a}},{key:"addEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,a);return a<=0&&(r.delay+=r.mixDuration-n),r.mixDuration=n,r.trackEnd=n,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,a=this.tracks.length;n0){r[h]=jt,i[h]=u;continue t}break}r[h]=zt}else r[h]=Ut}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return t._emptyAnimation}}])}();Bt._emptyAnimation=new V("",[],0);var _t,Ot=s((function t(){r(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=O.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}),[{key:"reset",value:function(){this.next=null,this.previous=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}},{key:"getAnimationTime",value: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)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&c&&c.length>0&&(u.names=l,u.values=c,l=null,c=null),u.u=u.x/h.width,u.v=u.y/h.height,90==u.degrees?(u.u2=(u.x+u.height)/h.width,u.v2=(u.y+u.width)/h.height):(u.u2=(u.x+u.width)/h.width,u.v2=(u.y+u.height)/h.height),this.regions.push(u)}else{for(h=new ie(o.trim());0!=n.readEntry(a,o=n.readLine());){var p=i[a[0]];p&&p(h)}this.pages.push(h)}}),[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",a=g(this.pages);try{for(a.s();!(e=a.n()).done;){var r=e.value;r.setTexture(t.get(n+r.name))}}catch(t){a.e(t)}finally{a.f()}}},{key:"dispose",value:function(){for(var t,e=0;e=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var a=1,r=n+1;;a++){var i=e.indexOf(",",r);if(-1==i)return t[a]=e.substr(r).trim(),a;if(t[a]=e.substr(r,i-r).trim(),r=i+1,4==a)return 4}}}]),ie=s((function t(e){r(this,t),this.minFilter=Qt.Nearest,this.magFilter=Qt.Nearest,this.uWrap=Zt.ClampToEdge,this.vWrap=Zt.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}),[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);var e,n=g(this.regions);try{for(n.s();!(e=n.n()).done;)e.value.texture=t}catch(t){n.e(t)}finally{n.f()}}}]),se=function(t){function e(t,n){var a,i,s,o;return r(this,e),i=this,s=l(s=e),(a=u(i,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(s,[],l(i).constructor):s.apply(i,o))).x=0,a.y=0,a.offsetX=0,a.offsetY=0,a.originalWidth=0,a.originalHeight=0,a.index=0,a.degrees=0,a.names=null,a.values=null,a.page=t,a.name=n,t.regions.push(a),a}return h(e,t),s(e)}(ee);var oe=function(t){function e(t,n){var a,i,s,o;return r(this,e),i=this,o=[t],s=l(s=e),(a=u(i,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(s,o||[],l(i).constructor):s.apply(i,o))).region=null,a.regionUVs=[],a.uvs=[],a.triangles=[],a.color=new x(1,1,1,1),a.width=0,a.height=0,a.hullLength=0,a.edges=[],a.parentMesh=null,a.sequence=null,a.tempColor=new x(0,0,0,0),a.path=n,a}return h(e,t),s(e,[{key:"updateRegion",value:function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,a=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof se){var o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:a-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,i=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=a}));!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"}(ue||(ue={}));var ve=s((function t(e,n,a){if(r(this,t),this.parent=null,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.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=a,this.setToSetupPose()}),[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,n,a,r,i,s){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=a,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=n+90+s,c=h.scaleX,u=h.scaleY;return this.a=I.cosDeg(n+i)*a*c,this.b=I.cosDeg(l)*r*c,this.c=I.sinDeg(n+i)*a*u,this.d=I.sinDeg(l)*r*u,this.worldX=t*c+h.x,void(this.worldY=e*u+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case ue.Normal:var p=n+90+s,g=I.cosDeg(n+i)*a,y=I.cosDeg(p)*r,w=I.sinDeg(n+i)*a,k=I.sinDeg(p)*r;return this.a=f*g+d*w,this.b=f*y+d*k,this.c=v*g+m*w,void(this.d=v*y+m*k);case ue.OnlyTranslation:var b=n+90+s;this.a=I.cosDeg(n+i)*a,this.b=I.cosDeg(b)*r,this.c=I.sinDeg(n+i)*a,this.d=I.sinDeg(b)*r;break;case ue.NoRotationOrReflection:var x=f*f+v*v,E=0;x>1e-4?(x=Math.abs(f*m-d*v)/x,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*x,m=f*x,E=Math.atan2(v,f)*I.radDeg):(f=0,v=0,E=90-Math.atan2(m,d)*I.radDeg);var A=n+i-E,S=n+s-E+90,R=I.cosDeg(A)*a,T=I.cosDeg(S)*r,C=I.sinDeg(A)*a,M=I.sinDeg(S)*r;this.a=f*R-d*C,this.b=f*T-d*M,this.c=v*R+m*C,this.d=v*T+m*M;break;case ue.NoScale:case ue.NoScaleOrReflection:var F=I.cosDeg(n),Y=I.sinDeg(n),P=(f*F+d*Y)/this.skeleton.scaleX,X=(v*F+m*Y)/this.skeleton.scaleY,L=Math.sqrt(P*P+X*X);L>1e-5&&(L=1/L),P*=L,X*=L,L=Math.sqrt(P*P+X*X),this.data.transformMode==ue.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(L=-L);var N=Math.PI/2+Math.atan2(X,P),B=Math.cos(N)*L,_=Math.sin(N)*L,O=I.cosDeg(i)*a,D=I.cosDeg(90+s)*r,V=I.sinDeg(i)*a,U=I.sinDeg(90+s)*r;this.a=P*O+B*V,this.b=P*D+B*U,this.c=X*O+_*V,this.d=X*D+_*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value: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}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.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)*I.radDeg);var e=t.a,n=t.b,a=t.c,r=t.d,i=1/(e*r-n*a),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*r*i-o*n*i,this.ay=o*e*i-s*a*i;var h=i*r,l=i*e,c=i*n,u=i*a,f=h*this.a-c*this.c,d=h*this.b-c*this.d,v=l*this.c-u*this.a,m=l*this.d-u*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,a=t.y-this.worldY;return t.x=n*this.d*e-a*this.b*e,t.y=a*this.a*e-n*this.c*e,t}},{key:"localToWorld",value: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}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,n=this.b,a=this.c,r=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*a,this.b=i*n-s*r,this.c=s*e+i*a,this.d=s*n+i*r}}]),me=s((function t(e,n,a){r(this,t),this.name=e,this.order=n,this.skinRequired=a})),pe=s((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ge;r(this,t),this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=n,this.downloader=a}),[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)}},{key:"error",value:function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,n){requestAnimationFrame((function a(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(a)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadBinary(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load binary ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadText(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load text ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadJson(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load JSON ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(n,t,e.textureLoader(r))},r.onerror=function(){e.error(a,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}else fetch(t,{mode:"cors"}).then((function(n){return n.ok?n.blob():(e.error(a,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(a){a&&e.success(n,t,e.textureLoader(a))}))}},{key:"loadTextureAtlas",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3?arguments[3]:void 0,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new ae(i),l=h.pages.length,c=!1,u=g(h.pages);try{var f=function(){var i=o.value;e.loadTexture(r?r[i.name]:s+i.name,(function(a,r){c||(i.setTexture(r),0==--l&&e.success(n,t,h))}),(function(n,r){c||e.error(a,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(n)),c=!0}))};for(u.s();!(o=u.n()).done;)f()}catch(t){u.e(t)}finally{u.f()}}catch(n){e.error(a,t,"Couldn't parse texture atlas ".concat(t,": ").concat(n.message))}}),(function(n,r){e.error(a,t,"Couldn't load texture atlas ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),ge=s((function t(){r(this,t),this.callbacks={},this.rawDataUris={}}),[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),n=e.length,a=new Uint8Array(n),r=0;r180?f-=360:f<-180&&(f+=360);var b=t.ascaleX,x=t.ascaleY;if(a||r){switch(t.data.transformMode){case ue.NoScale:case ue.NoScaleOrReflection:d=e-t.worldX,v=n-t.worldY}var E=t.data.length*b,A=Math.sqrt(d*d+v*v);if(a&&AE&&E>1e-4){var S=(A/E-1)*s+1;b*=S,i&&(x*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,b,x,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,n,a,r,i,s,o,h){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,d=u,v=f,m=e.ascaleX,p=0,g=0,y=0;u<0?(u=-u,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var w=e.ax,k=0,b=0,x=0,E=t.a,A=t.b,S=t.c,R=t.d,T=Math.abs(u-f)<=1e-4;!T||i?(k=0,b=E*w+t.worldX,x=S*w+t.worldY):(b=E*w+A*(k=e.ay)+t.worldX,x=S*w+R*k+t.worldY);var C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");E=C.a,A=C.b,S=C.c;var M,F,Y=E*(R=C.d)-A*S,P=b-C.worldX,X=x-C.worldY,L=(P*R-X*A)*(Y=Math.abs(Y)<=1e-4?0:1/Y)-l,N=(X*E-P*S)*Y-c,B=Math.sqrt(L*L+N*N),_=e.data.length*m;if(B<1e-4)return this.apply1(t,n,a,!1,i,!1,h),void e.updateWorldTransformWith(w,k,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var O=((P=n-C.worldX)*R-(X=a-C.worldY)*A)*Y-l,D=(X*E-P*S)*Y-c,V=O*O+D*D;if(0!=o){o*=u*(m+1)*.5;var U=Math.sqrt(V),q=U-B-_*u+o;if(q>0){var W=Math.min(1,q/(2*o))-1;V=(O-=(W=(q-o*(1-W*W))/U)*O)*O+(D-=W*D)*D}}t:if(T){var z=(V-B*B-(_*=u)*_)/(2*B*_);z<-1?(z=-1,F=Math.PI*r):z>1?(z=1,F=0,i&&(d*=E=(Math.sqrt(V)/(B+_)-1)*h+1,s&&(v*=E))):F=Math.acos(z)*r,E=B+_*z,A=_*Math.sin(F),M=Math.atan2(D*E-O*A,O*E+D*A)}else{var j=(E=u*_)*E,G=(A=f*_)*A,H=Math.atan2(D,O),$=-2*G*B,J=G-j;if((R=$*$-4*J*(S=G*B*B+j*V-j*G))>=0){var K=Math.sqrt(R);$<0&&(K=-K);var Q=(K=.5*-($+K))/J,Z=S/K,tt=Math.abs(Q)=-1&&S<=1&&(S=Math.acos(S),(R=(P=E*Math.cos(S)+B)*P+(X=A*Math.sin(S))*X)ot&&(it=S,ot=R,st=P,ht=X)),V<=.5*(at+ot)?(M=H-Math.atan2(rt*r,nt),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(k,w)*y,ct=t.arotation;(M=(M-lt)*I.radDeg+p-ct)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,c,ct+M*h,d,v,0,0),ct=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ct)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,k,ct+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]);var be=function(t){function e(t){var n,a,i,s;return r(this,e),a=this,s=[t,0,!1],i=l(i=e),(n=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(a).constructor):i.apply(a,s))).bones=new Array,n._target=null,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return h(e,t),s(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(me);var xe,Ie,Ee,Ae=function(t){function e(t){var n,a,i,s;return r(this,e),a=this,s=[t,0,!1],i=l(i=e),(n=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(a).constructor):i.apply(a,s))).bones=new Array,n._target=null,n.positionMode=xe.Fixed,n.spacingMode=Ie.Fixed,n.rotateMode=Ee.Chain,n.offsetRotation=0,n.position=0,n.spacing=0,n.mixRotate=0,n.mixX=0,n.mixY=0,n}return h(e,t),s(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t}}])}(me);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(xe||(xe={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(Ie||(Ie={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(Ee||(Ee={}));var Se=function(){function t(e,n){if(r(this,t),this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=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,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var a=0,i=e.bones.length;a0){k=c/k*d;for(var M=1;M0?I.degRad:-I.degRad}for(var z=0,j=3;z0){var tt=G.a,et=G.b,nt=G.c,at=G.d,rt=0,it=0,st=0;if(rt=s?O[j-1]:0==u[z+1]?O[j+2]:Math.atan2(K,J),rt-=Math.atan2(nt,tt),q){it=Math.cos(rt),st=Math.sin(rt);var ot=G.data.length;D+=(ot*(it*tt-st*nt)-J)*n,V+=(ot*(st*tt+it*nt)-K)*n}else rt+=U;rt>I.PI?rt-=I.PI2:rt<-I.PI&&(rt+=I.PI2),rt*=n,it=Math.cos(rt),st=Math.sin(rt),G.a=it*tt-st*nt,G.b=it*et-st*at,G.c=st*tt+it*nt,G.d=st*et+it*at}G.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,n,a){var r=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*n+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[u-=l?1:2];switch(this.data.positionMode==xe.Percent&&(i*=m),this.data.spacingMode){case Ie.Percent:d=m;break;case Ie.Proportional:d=m/n;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(k-m,h,0,o,g);continue}}for(;;y++){var b=v[y];if(!(k>b)){if(0==y)k/=b;else{var x=v[y-1];k=(k-x)/(b-x)}break}}y!=f&&(f=y,l&&y==u?(e.computeWorldVertices(r,c-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(k,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,a||p>0&&0==w)}return o}l?(c+=2,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c-4,h,0,2),e.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c,h,0,2));for(var I,E=R.setArraySize(this.curves,u),A=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,P=0,X=0,L=0,N=0,B=0,_=0,O=0,D=0,V=0,U=0,q=0,W=2;qA){this.addAfterPosition(Q-A,h,c-4,o,H);continue}}for(;;$++){var Z=E[$];if(!(Q>Z)){if(0==$)Q/=Z;else{var tt=E[$-1];Q=(Q-tt)/(Z-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],O=2*(L=.03*(S-2*C+F))+(B=.006*(3*(C-F)-S+(P=h[et+6]))),D=2*(N=.03*(T-2*M+Y))+(_=.006*(3*(M-Y)-T+(X=h[et+7]))),V=.3*(C-S)+L+.16666667*B,U=.3*(M-T)+N+.16666667*_,j=Math.sqrt(V*V+U*U),z[0]=j,et=1;et<8;et++)V+=O,U+=D,O+=B,D+=_,j+=Math.sqrt(V*V+U*U),z[et]=j;V+=O,U+=D,j+=Math.sqrt(V*V+U*U),z[8]=j,V+=O+B,U+=D+_,j+=Math.sqrt(V*V+U*U),z[9]=j,J=0}for(Q*=j;;J++){var nt=z[J];if(!(Q>nt)){if(0==J)Q/=nt;else{var at=z[J-1];Q=J+(Q-at)/(nt-at)}break}}this.addCurvePosition(.1*Q,S,T,C,M,F,Y,P,X,o,H,a||G>0&&0==K)}return o}},{key:"addBeforePosition",value:function(t,e,n,a,r){var i=e[n],s=e[n+1],o=e[n+2]-i,h=e[n+3]-s,l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addAfterPosition",value:function(t,e,n,a,r){var i=e[n+2],s=e[n+3],o=i-e[n],h=s-e[n+1],l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addCurvePosition",value:function(t,e,n,a,r,i,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=n,void(l[c+2]=Math.atan2(r-n,a-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,w=v*y,k=y*t,b=e*p+a*w+i*k+o*d,x=n*p+r*w+s*k+h*d;l[c]=b,l[c+1]=x,u&&(l[c+2]=t<.001?Math.atan2(r-n,a-e):Math.atan2(x-(n*m+r*g*2+s*f),b-(e*m+a*g*2+i*f)))}}])}();Se.NONE=-1,Se.BEFORE=-2,Se.AFTER=-3,Se.epsilon=1e-5;var Re=s((function t(e,n){if(r(this,t),this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new x,this.darkColor=e.darkColor?new x:null,this.setToSetupPose()}),[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof X&&this.attachment instanceof X&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),Te=s((function t(e,n){if(r(this,t),this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new M,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var a=0;a0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(R.x-y.worldX)*e,y.worldY+=(R.y-y.worldY)*n}if(0!=a){var T=Math.sqrt(y.a*y.a+y.c*y.c);0!=T&&(T=(T+(Math.sqrt(h*h+c*c)-T+this.data.offsetScaleX)*a)/T),y.a*=T,y.c*=T}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+u*u)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),P=Math.atan2(u,l)-Math.atan2(c,h)-(Y-Math.atan2(y.c,y.a));P>I.PI?P-=I.PI2:P<-I.PI&&(P+=I.PI2),P=Y+(P+v)*i;var X=Math.sqrt(M*M+F*F);y.b=Math.cos(P)*X,y.d=Math.sin(P)*X}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=R.x*e,y.worldY+=R.y*n}if(0!=a){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*a+1;y.a*=T,y.c*=T}if(0!=r){var C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(u,l)-Math.atan2(c,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var P=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*P,y.d=Math.sin(M)*P}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var a=this.drawOrder,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=a.length;h0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;r(this,t),this.slotIndex=e,this.name=n,this.attachment=a})),Pe=s((function t(e){if(r(this,t),this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}),[{key:"setAttachment",value:function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=n}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!n)throw new Error("name cannot be null.");if(!a)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=a}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Me||(Me={}));var Le,Ne=function(t){function e(t){var n,a,i,s;return r(this,e),a=this,s=[t,0,!1],i=l(i=e),(n=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(a).constructor):i.apply(a,s))).bones=new Array,n._target=null,n.mixRotate=0,n.mixX=0,n.mixY=0,n.mixScaleX=0,n.mixScaleY=0,n.mixShearY=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 h(e,t),s(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(me),Be=s((function t(e){r(this,t),this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}),[{key:"readSkeletonData",value:function(t){var e=this.scale,n=new Fe;n.name="";var a=new _e(t),r=a.readInt32(),i=a.readInt32();n.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),n.version=a.readString(),n.x=a.readFloat(),n.y=a.readFloat(),n.width=a.readFloat(),n.height=a.readFloat();var s=a.readBoolean();s&&(n.fps=a.readFloat(),n.imagesPath=a.readString(),n.audioPath=a.readString());var o=0;o=a.readInt(!0);for(var h=0;h>4,t.readFloat())}a.push(ba)}}var Aa=t.readInt(!0);if(Aa>0){for(var Sa=new Mt(Aa),Ra=n.slots.length,Ta=0;Ta=0;Ya--)Fa[Ya]=-1;for(var Pa=R.newArray(Ra-Ma,0),Xa=0,La=0,Na=0;Na=0;_a--)-1==Fa[_a]&&(Fa[_a]=Pa[--La]);Sa.setFrame(Ta,Ca,Fa)}a.push(Sa)}var Oa=t.readInt(!0);if(Oa>0){for(var Da=new Ct(Oa),Va=0;Va1&&void 0!==arguments[1]?arguments[1]:new Array,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);r(this,t),this.strings=n,this.index=a,this.buffer=i}),[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value: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&a)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&a)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(a),n++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),Oe=s((function t(e,n,a,i,s){r(this,t),this.mesh=e,this.skin=n,this.slotIndex=a,this.parent=i,this.inheritTimeline=s})),De=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this.bones=e,this.vertices=n}));function Ve(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,a,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(i);break;case vn:qe(t,e,s++,i,0,a,h,r,l,n)}a=h,r=l}return e}function Ue(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,a,r,i),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(s);break;case vn:qe(t,e,o++,s,0,a,l,r,c,n),qe(t,e,o++,s,1,a,l,i,u,n)}a=l,r=c,i=u}return e}function qe(t,e,n,a,r,i,s,o,h,l){e.setBezier(n,a,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Le||(Le={}));var We,ze=0,je=1,Ge=2,He=3,$e=4,Je=5,Ke=6,Qe=7,Ze=8,tn=9,en=0,nn=1,an=2,rn=3,sn=4,on=5,hn=0,ln=1,cn=0,un=1,fn=2,dn=1,vn=2,mn=s((function t(){r(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new C((function(){return R.newFloatArray(16)}))}),[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,a=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;n.length=0,r.freeAll(a),a.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,n,a){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=i&&a<=i||t>=s&&n>=s||e>=o&&a>=o)return!1;var h=(a-e)/(n-t),l=h*(r-t)+e;if(l>i&&li&&lr&&cr&&ct.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var n=this.polygons,a=0,r=n.length;a=n||l=n){var c=a[o];c+(n-h)/(l-h)*(a[i]-c)=c&&w<=d||w>=d&&w<=c)&&(w>=e&&w<=a||w>=a&&w<=e)){var k=(l*g-h*m)/y;if((k>=u&&k<=v||k>=v&&k<=u)&&(k>=n&&k<=r||k>=r&&k<=n))return!0}c=d,u=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),pn=function(){function t(){r(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new C((function(){return new Array})),this.polygonIndicesPool=new C((function(){return new Array}))}return s(t,[{key:"triangulate",value:function(e){var n=e,a=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var c=a-1,u=0,f=1;;){t:if(!s[u]){for(var d=r[c]<<1,v=r[u]<<1,m=r[f]<<1,p=n[d],g=n[d+1],y=n[v],w=n[v+1],k=n[m],b=n[m+1],x=(f+1)%a;x!=c;x=(x+1)%a)if(s[x]){var I=r[x]<<1,E=n[I],A=n[I+1];if(t.positiveArea(k,b,p,g,E,A)&&t.positiveArea(p,g,y,w,E,A)&&t.positiveArea(y,w,k,b,E,A))break t}break}if(0==f){do{if(!s[u])break;u--}while(u>0);break}c=u,u=f,f=(f+1)%a}l.push(r[(a+u-1)%a]),l.push(r[u]),l.push(r[(u+1)%a]),r.splice(u,1),s.splice(u,1);var S=(--a+u-1)%a,R=u==a?0:u;s[S]=t.isConcave(S,a,n,r),s[R]=t.isConcave(R,a,n,r)}return 3==a&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,n){var a=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,c=0,u=n.length;c0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(w),o.push(k),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,w,k),h=f)}o.length>0&&(r.push(o),i.push(s));for(var A=0,S=r.length;A=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,n,a){var r=a[(e+t-1)%e]<<1,i=a[t]<<1,s=a[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[i],n[i+1],n[s],n[s+1])}},{key:"positiveArea",value:function(t,e,n,a,r,i){return t*(i-a)+n*(e-i)+r*(a-e)>=0}},{key:"winding",value:function(t,e,n,a,r,i){var s=n-t,o=a-e;return r*o-i*s+s*e-t*o>=0?1:-1}}])}(),gn=function(){function t(){r(this,t),this.triangulator=new pn,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}return s(t,[{key:"clipStart",value:function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var a=n.worldVerticesLength,r=R.setArraySize(this.clippingPolygon,a);n.computeWorldVertices(e,0,a,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),q=0;q=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(a),h.push(r),h.push(i),h.push(t),h.push(e),o.length=0;for(var u=s,f=s.length-4,d=0;;d+=2){for(var v=u[d],m=u[d+1],p=u[d+2],g=u[d+3],y=v-p,w=m-g,k=h,b=h.length-2,x=o.length,I=0;I0;if(y*(A-g)-w*(E-p)>0){if(T){o.push(S),o.push(R);continue}var C=R-A,M=S-E,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-A)-C*(v-E))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(T){var P=R-A,X=S-E,L=P*(p-v)-X*(g-m);if(Math.abs(L)>1e-6){var N=(X*(m-A)-P*(v-E))/L;o.push(v+(p-v)*N),o.push(m+(g-m)*N)}else o.push(v),o.push(m);o.push(S),o.push(R)}c=!0}if(x==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var B=o;(o=h).length=0,h=B}if(l!=o){l.length=0;for(var _=0,O=o.length-2;_>1;l=0;la--)-1==ta[la]&&(ta[la]=na[--ra])}$n.setFrame(Kn,In(Zn,"time",0),ta)}r.push($n)}if(t.events){for(var ca=new Ct(t.events.length),ua=0,fa=0;fa)?=?)"),v("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),v("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),v("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),v("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),v("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),v("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),v("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),v("COERCERTL",h[l.COERCE],!0),v("COERCERTLFULL",h[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",v("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),v("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("LONECARET","(?:\\^)"),v("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",v("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),v("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),v("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),v("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),v("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Pn,Pn.exports);var Xn=Pn.exports;Tn(Xn);var Ln=Object.freeze({loose:!0}),Nn=Object.freeze({}),Bn=function(t){return t?"object"!==a(t)?Ln:t:Nn};Tn(Bn);var _n=/^[0-9]+$/,On=function(t,e){var n=_n.test(t),a=_n.test(e);return n&&a&&(t=+t,e=+e),t===e?0:n&&!a?-1:a&&!n?1:tUn)throw new TypeError("version is longer than ".concat(Un," characters"));Vn("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=e.trim().match(n.loose?Wn[zn.LOOSE]:Wn[zn.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>qn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qn||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(e){var i=[e,a];!1===n&&(i=[e]),0===Gn(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),$n=Hn;Tn($n);var Jn=$n,Kn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof Jn)return t;try{return new Jn(t,e)}catch(t){if(!n)return null;throw t}};Tn(Kn);var Qn=Kn,Zn=Tn((function(t,e){var n=Qn(t,e);return n?n.version:null})),ta=$n,ea=Kn,na=Xn.safeRe,aa=Xn.t,ra=Tn((function(t,e){if(t instanceof ta)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var a,r=e.includePrerelease?na[aa.COERCERTLFULL]:na[aa.COERCERTL];(a=r.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&a.index+a[0].length===n.index+n[0].length||(n=a),r.lastIndex=a.index+a[1].length+a[2].length;r.lastIndex=-1}else n=t.match(e.includePrerelease?na[aa.COERCEFULL]:na[aa.COERCE]);if(null===n)return null;var i=n[2],s=n[3]||"0",o=n[4]||"0",h=e.includePrerelease&&n[5]?"-".concat(n[5]):"",l=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return ea("".concat(i,".").concat(s,".").concat(o).concat(h).concat(l),e)})),ia=s((function t(){r(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);Tn(ia);var sa=$n,oa=function(t,e,n){return new sa(t,n).compare(new sa(e,n))};Tn(oa);var ha=oa,la=function(t,e,n){return 0===ha(t,e,n)};Tn(la);var ca=oa,ua=function(t,e,n){return 0!==ca(t,e,n)};Tn(ua);var fa=oa,da=function(t,e,n){return fa(t,e,n)>0};Tn(da);var va=oa,ma=function(t,e,n){return va(t,e,n)>=0};Tn(ma);var pa=oa,ga=function(t,e,n){return pa(t,e,n)<0};Tn(ga);var ya=oa,wa=function(t,e,n){return ya(t,e,n)<=0};Tn(wa);var ka,ba,xa,Ia,Ea=la,Aa=ua,Sa=da,Ra=ma,Ta=ga,Ca=wa,Ma=function(t,e,n,r){switch(e){case"===":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t===n;case"!==":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Ea(t,n,r);case"!=":return Aa(t,n,r);case">":return Sa(t,n,r);case">=":return Ra(t,n,r);case"<":return Ta(t,n,r);case"<=":return Ca(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Fa(){if(Ia)return xa;Ia=1;var t=function(){function t(e,i){var s=this;if(r(this,t),i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!p(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=g(this.set);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(1===c.length&&y(c[0])){this.set=[c];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return s(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,r=((this.options.includePrerelease&&d)|(this.options.loose&&m))+":"+t,s=e.get(r);if(s)return s;var o=this.options.loose,y=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(y,M(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],c),i("comparator trim",t),t=t.replace(h[l.TILDETRIM],u),i("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),i("caret trim",t);var w=t.split(" ").map((function(t){return k(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));o&&(w=w.filter((function(t){return i("loose invalid filter",t,n.options),!!t.match(h[l.COMPARATORLOOSE])}))),i("range list",w);var b,x=new Map,I=w.map((function(t){return new a(t,n.options)})),E=g(I);try{for(E.s();!(b=E.n()).done;){var A=b.value;if(p(A))return[A];x.set(A.value,A)}}catch(t){E.e(t)}finally{E.f()}x.size>1&&x.has("")&&x.delete("");var S=v(x.values());return e.set(r,S),S}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return w(t,n)&&e.set.some((function(e){return w(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new o(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(o(this.semver,"<",t.semver,a)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(o(this.semver,">",t.semver,a)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();ka=e;var n=Bn,a=Xn.safeRe,i=Xn.t,o=Ma,h=Yn,l=$n,c=Fa();return ka}(),i=Yn,o=$n,h=Xn.safeRe,l=Xn.t,c=Xn.comparatorTrimReplace,u=Xn.tildeTrimReplace,f=Xn.caretTrimReplace,d=Cn.FLAG_INCLUDE_PRERELEASE,m=Cn.FLAG_LOOSE,p=function(t){return"<0.0.0-0"===t.value},y=function(t){return""===t.value},w=function(t,e){for(var n=!0,a=t.slice(),r=a.pop();n&&a.length;)n=a.every((function(t){return r.intersects(t,e)})),r=a.pop();return n},k=function(t,e){return i("comp",t,e),t=E(t,e),i("caret",t),t=x(t,e),i("tildes",t),t=S(t,e),i("xrange",t),t=T(t,e),i("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){var n=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(n,(function(e,n,a,r,s){var o;return i("tilde",t,e,n,a,r,s),b(n)?o="":b(a)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(r)?o=">=".concat(n,".").concat(a,".0 <").concat(n,".").concat(+a+1,".0-0"):s?(i("replaceTilde pr",s),o=">=".concat(n,".").concat(a,".").concat(r,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0")):o=">=".concat(n,".").concat(a,".").concat(r," <").concat(n,".").concat(+a+1,".0-0"),i("tilde return",o),o}))},E=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){i("caret",t,e);var n=e.loose?h[l.CARETLOOSE]:h[l.CARET],a=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,r,s,o){var h;return i("caret",t,e,n,r,s,o),b(n)?h="":b(r)?h=">=".concat(n,".0.0").concat(a," <").concat(+n+1,".0.0-0"):b(s)?h="0"===n?">=".concat(n,".").concat(r,".0").concat(a," <").concat(n,".").concat(+r+1,".0-0"):">=".concat(n,".").concat(r,".0").concat(a," <").concat(+n+1,".0.0-0"):o?(i("replaceCaret pr",o),h="0"===n?"0"===r?">=".concat(n,".").concat(r,".").concat(s,"-").concat(o," <").concat(n,".").concat(r,".").concat(+s+1,"-0"):">=".concat(n,".").concat(r,".").concat(s,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0"):">=".concat(n,".").concat(r,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(i("no pr"),h="0"===n?"0"===r?">=".concat(n,".").concat(r,".").concat(s).concat(a," <").concat(n,".").concat(r,".").concat(+s+1,"-0"):">=".concat(n,".").concat(r,".").concat(s).concat(a," <").concat(n,".").concat(+r+1,".0-0"):">=".concat(n,".").concat(r,".").concat(s," <").concat(+n+1,".0.0-0")),i("caret return",h),h}))},S=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var n=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(n,(function(n,a,r,s,o,h){i("xRange",t,n,a,r,s,o,h);var l=b(r),c=l||b(s),u=c||b(o),f=u;return"="===a&&f&&(a=""),h=e.includePrerelease?"-0":"",l?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&f?(c&&(s=0),o=0,">"===a?(a=">=",c?(r=+r+1,s=0,o=0):(s=+s+1,o=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(h="-0"),n="".concat(a+r,".").concat(s,".").concat(o).concat(h)):c?n=">=".concat(r,".0.0").concat(h," <").concat(+r+1,".0.0-0"):u&&(n=">=".concat(r,".").concat(s,".0").concat(h," <").concat(r,".").concat(+s+1,".0-0")),i("xRange return",n),n}))},T=function(t,e){return i("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,n,a,r,i,s,o,h,l,c,u,f){return n=b(a)?"":b(r)?">=".concat(a,".0.0").concat(t?"-0":""):b(i)?">=".concat(a,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=b(l)?"":b(c)?"<".concat(+l+1,".0.0-0"):b(u)?"<".concat(l,".").concat(+c+1,".0-0"):f?"<=".concat(l,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(l,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},F=function(t,e,n){for(var r=0;r0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return xa}Tn(Ma);var Ya=Fa(),Pa=function(t,e,n){try{e=new Ya(e,n)}catch(t){return!1}return e.test(t)},Xa={valid:Zn,coerce:ra,satisfies:Tn(Pa),SEMVER_SPEC_VERSION:Mn.SEMVER_SPEC_VERSION},La=0,Na=1,Ba=2,_a=[0,1,2,2,3,0],Oa=s((function t(e,a,i,s){var h;if(r(this,t),o(this,"autoUpdate",!0),o(this,"skeleton",void 0),o(this,"states",void 0),this._app=e,this._position=new n.Vec3,1===ae.length){var l,c=g((h=new ae(a)).pages);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.setTexture(new Rn(s[u.name]))}}catch(t){c.e(t)}finally{c.f()}}else h=new ae(a,(function(t){return new Rn(s[t])}));var f=new yn(new fe(h));f.scale*=.01;var d=f.readSkeletonData(i);this.skeletonVersion=Xa.valid(Xa.coerce(d.version)),this._spine_3_6_0=Xa.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Xa.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Xa.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Xa.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Ce(d),this.skeleton.updateWorldTransform(),this.stateData=new $t(this.skeleton.data),this.states=[new Bt(this.stateData)],this.clipper=new gn,this._node=new n.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new n.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new n.Vec2,this._aabbTempSize=new n.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[n.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new n.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new n.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,a,t),t=u.material,e=s,a=0),t=u.material;var f=u.positions,d=u.vertexColor.r,v=u.vertexColor.g,m=u.vertexColor.b,p=u.vertexColor.a,g=u.uvs,y=void 0,w=f.length/2;for(y=0;y0){var r=new n.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=n.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new n.MeshInstance(r,this._materials[a],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;et.length)&&(e=t.length);for(var n=0,a=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function y(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e);if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function w(t,e,n){return e=l(e),u(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}var k=s((function t(){r(this,t),this.array=new Array}),[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),b=s((function t(){r(this,t),this.entries={},this.size=0}),[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,n=0,a=t.length;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;r(this,t),this.r=e,this.g=n,this.b=a,this.a=i}return s(t,[{key:"set",value:function(t,e,n,a){return this.r=t,this.g=e,this.b=n,this.a=a,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value: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?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,n,a){return this.r+=t,this.g+=e,this.b+=n,this.a+=a,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value: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}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}])}();x.WHITE=new x(1,1,1,1),x.RED=new x(1,0,0,1),x.GREEN=new x(0,1,0,1),x.BLUE=new x(0,0,1,1),x.MAGENTA=new x(1,0,1,1);var I=function(){function t(){r(this,t)}return s(t,null,[{key:"clamp",value:function(t,e,n){return tn?n:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))}},{key:"randomTriangularWith",value:function(t,e,n){var a=Math.random(),r=e-t;return a<=(n-t)/r?t+Math.sqrt(a*r*(n-t)):e-Math.sqrt((1-a)*r*(e-n))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}])}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var E=s((function t(){r(this,t)}),[{key:"apply",value:function(t,e,n){return t+(e-t)*this.applyInternal(n)}}]),A=function(t){function e(t){var n;return r(this,e),(n=w(this,e)).power=2,n.power=t,n}return h(e,t),s(e,[{key:"applyInternal",value: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=function(t){function e(t){return r(this,e),w(this,e,[t])}return h(e,t),s(e,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}])}(A),R=function(){function t(){r(this,t)}return s(t,null,[{key:"arrayCopy",value:function(t,e,n,a,r){for(var i=e,s=a;i2&&void 0!==arguments[2]?arguments[2]:0,a=t.length;if(a==e)return t;if(t.length=e,a2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=n?e:t.setArraySize(e,n,a)}},{key:"newArray",value:function(t,e){for(var n=new Array(t),a=0;a0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;r(this,t),this.x=e,this.y=n}),[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),F=s((function t(){r(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}),[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.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)}}]),Y=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;r(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}),[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var c=0,u=0,f=0;f0&&(h=o);for(var L=t.bone,N=L.worldX,B=L.worldY,_=L.a,O=L.b,D=L.c,V=L.d,U=e,q=r;q=this.regions.length&&(n=this.regions.length-1);var a=this.regions[n];e.region!=a&&(e.region=a,e.updateRegion())}},{key:"getPath",value:function(t,e){for(var n=t,a=(this.start+e).toString(),r=this.digits-a.length;r>0;r--)n+="0";return n+=a}}],[{key:"nextID",value:function(){return t._nextID++}}])}();N._nextID=0,function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(L||(L={}));var B=[L.hold,L.once,L.loop,L.pingpong,L.onceReverse,L.loopReverse,L.pingpongReverse];function _(t,e,n){return e=l(e),u(t,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(e,n||[],l(t).constructor):e.apply(t,n))}var O,D,V=s((function t(e,n,a){if(r(this,t),this.timelines=[],this.timelineIds=new b,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(n),this.duration=a}),[{key:"setTimelines",value:function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));for(var h=this.timelines,l=0,c=h.length;le)return a-1;return n-1}},{key:"search",value:function(t,e,n){for(var a=t.length,r=n;re)return r-n;return a-n}}]),lt=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,a])).curves=R.newFloatArray(t+18*n),i.curves[t-1]=1,i}return h(e,t),s(e,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=R.newFloatArray(e);R.arrayCopy(this.curves,0,n,0,e),this.curves=n}}},{key:"setBezier",value:function(t,e,n,a,r,i,s,o,h,l,c){var u=this.curves,f=this.getFrameCount()+18*t;0==n&&(u[e]=2+f);for(var d=.03*(a-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-a+l),p=.006*(3*(s-h)-r+c),g=2*d+m,y=2*v+p,w=.3*(i-a)+d+.16666667*m,k=.3*(s-r)+v+.16666667*p,b=a+w,x=r+k,I=f+18;ft){var i=this.frames[e],s=this.frames[e+n];return s+(t-i)/(r[a]-i)*(r[a+1]-s)}var o=a+18;for(a+=2;a=t){var h=r[a-2],l=r[a-1];return l+(t-h)/(r[a]-h)*(r[a+1]-l)}e+=this.getFrameEntries();var c=r[o-2],u=r[o-1];return u+(t-c)/(this.frames[e]-c)*(this.frames[e+n]-u)}}])}(ht),ct=function(t){function e(t,n,a){return r(this,e),_(this,e,[t,n,[a]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n}},{key:"getCurveValue",value:function(t){for(var e=this.frames,n=e.length-2,a=2;a<=n;a+=2)if(e[a]>t){n=a-2;break}var r=this.curves[n>>1];switch(r){case 0:var i=e[n],s=e[n+1];return s+(t-i)/(e[n+2]-i)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,r-2)}}])}(lt),ut=function(t){function e(t,n,a,i){return r(this,e),_(this,e,[t,n,[a,i]])}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,n,a){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=a}}])}(lt),ft=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,n,U+"|"+a])).boneIndex=0,i.boneIndex=a,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.bones[this.boneIndex];if(o.active)if(n>2];switch(m){case 0:var p=h[v];u=h[v+1],f=h[v+2],d=h[v+3];var g=(n-p)/(h[v+4]-p);u+=(h[v+4+1]-u)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:u=h[v+1],f=h[v+2],d=h[v+3];break;default:u=this.getBezierValue(n,v,1,m-2),f=this.getBezierValue(n,v,2,m+18-2),d=this.getBezierValue(n,v,3,m+36-2)}if(1==r)l.r=u,l.g=f,l.b=d;else{if(i==O.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(u-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}])}(lt),Et=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,n,J+"|"+a])).slotIndex=0,i.slotIndex=a,i}return h(e,t),s(e,[{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(n>3];switch(b){case 0:var x=h[k];d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];var I=(n-x)/(h[k+8]-x);d+=(h[k+8+1]-d)*I,v+=(h[k+8+2]-v)*I,m+=(h[k+8+3]-m)*I,p+=(h[k+8+4]-p)*I,g+=(h[k+8+5]-g)*I,y+=(h[k+8+6]-y)*I,w+=(h[k+8+7]-w)*I;break;case 1:d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];break;default:d=this.getBezierValue(n,k,1,b-2),v=this.getBezierValue(n,k,2,b+18-2),m=this.getBezierValue(n,k,3,b+36-2),p=this.getBezierValue(n,k,4,b+54-2),g=this.getBezierValue(n,k,5,b+72-2),y=this.getBezierValue(n,k,6,b+90-2),w=this.getBezierValue(n,k,7,b+108-2)}if(1==r)l.set(d,v,m,p),c.r=g,c.g=y,c.b=w;else{if(i==O.setup){l.setFromColor(o.data.color);var E=o.data.darkColor;c.r=E.r,c.g=E.g,c.b=E.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),c.r+=(g-c.r)*r,c.g+=(y-c.g)*r,c.b+=(w-c.b)*r}}}}}])}(lt),St=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,n,[$+"|"+a,K+"|"+a]])).slotIndex=0,i.slotIndex=a,i}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,n,a,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=a,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,c=o.darkColor;if(nt){var i=this.frames[e];return n[a+1]*(t-i)/(n[a]-i)}var s=a+18;for(a+=2;a=t){var o=n[a-2],h=n[a-1];return h+(t-o)/(n[a]-o)*(n[a+1]-h)}var l=n[s-2],c=n[s-1];return c+(1-c)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h&&h instanceof X&&h.timelineAttachment==this.attachment){var l=o.deform;0==l.length&&(i=O.setup);var c=this.vertices,u=c[0].length,f=this.frames;if(n=f[f.length-1]){var p=c[f.length-1];if(1==r)if(i==O.add){var g=h;if(g.bones)for(var y=0;yn)this.apply(t,e,Number.MAX_VALUE,a,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(n0&&o[l-1]==c;)l--;for(;l=o[l];l++)a.push(this.events[l])}}}}])}(ht);Ct.propertyIds=[""+tt];var Mt=function(t){function e(t){var n;return r(this,e),(n=_(this,e,[t,e.propertyIds])).drawOrders=new Array(t),n}return h(e,t),s(e,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}},{key:"apply",value:function(t,e,n,a,r,i,s){if(s!=D.mixOut)if(n>2];switch(d){case 0:var v=h[f];l=h[f+1],c=h[f+2],u=h[f+3];var m=(n-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,c+=(h[f+4+2]-c)*m,u+=(h[f+4+3]-u)*m;break;case 1:l=h[f+1],c=h[f+2],u=h[f+3];break;default:l=this.getBezierValue(n,f,1,d-2),c=this.getBezierValue(n,f,2,d+18-2),u=this.getBezierValue(n,f,3,d+36-2)}if(i==O.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(c-p.mixX)*r,o.mixY=p.mixY+(u-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(c-o.mixX)*r,o.mixY+=(u-o.mixY)*r}}}}])}(lt),Nt=function(t){function e(t,n,a){var i;return r(this,e),(i=_(this,e,[t,[ot+"|"+n+"|"+a.sequence.id]])).slotIndex=n,i.attachment=a,i}return h(e,t),s(e,[{key:"getFrameEntries",value:function(){return e.ENTRIES}},{key:"getSlotIndex",value:function(){return this.slotIndex}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setFrame",value:function(t,n,a,r,i){var s=this.frames;s[t*=e.ENTRIES]=n,s[t+e.MODE]=a|r<<4,s[t+e.DELAY]=i}},{key:"apply",value:function(t,n,a,r,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.attachment,c=this.attachment;if(l==c||l instanceof X&&l.timelineAttachment==c){var u=this.frames;if(a>4,g=this.attachment.sequence.regions.length,y=B[15&v];if(y!=L.hold)switch(p+=(a-d)/m+1e-5|0,y){case L.once:p=Math.min(g-1,p);break;case L.loop:p%=g;break;case L.pingpong:var w=(g<<1)-2;(p=0==w?0:p%w)>=g&&(p=w-p);break;case L.onceReverse:p=Math.max(g-1-p,0);break;case L.loopReverse:p=g-1-p%g;break;case L.pingpongReverse:var k=(g<<1)-2;(p=0==k?0:(p+g-1)%k)>=g&&(p=k-p)}h.sequenceIndex=p}}}}}}])}(ht);Nt.ENTRIES=3,Nt.MODE=1,Nt.DELAY=2;var Bt=function(){function t(e){r(this,t),this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Dt(this),this.propertyIDs=new b,this.animationsChanged=!1,this.trackEntryPool=new C((function(){return new Ot})),this.data=e}return s(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,n=0,a=e.length;n0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[n]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var n=t.mixingFrom;if(!n)return!0;var a=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,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),a):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,a=!1,r=0,i=n.length;r0)){a=!0;var o=0==r?O.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,c=s.getAnimationTime(),u=c,f=e;s.reverse&&(u=s.animation.duration-u,f=null);var d=s.animation.timelines,v=d.length;if(0==r&&1==h||o==O.add)for(var m=0;m1&&(r=1),n!=O.first&&(n=a.mixBlend));var i=r0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,n,a,r){var i=e.slots[t.slotIndex];i.bone.active&&(n0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),u=f+d-d%360,p!=m&&(u+=360*I.signum(d)),i[s]=u}i[s+1]=f,h.rotation=l+u*a}}else t.apply(e,0,n,null,1,r,D.mixIn)}},{key:"queueEvents",value:function(t,e){for(var n=t.animationStart,a=t.animationEnd,r=a-n,i=t.trackLast%r,s=this.events,o=0,h=s.length;oa||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:e>=a&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var a=n.mixingFrom;if(!a)break;this.queue.end(a),n.mixingFrom=null,n.mixingTo=null,n=a}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,n){var a=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,a&&(n&&this.queue.interrupt(a),e.mixingFrom=a,a.mixingTo=e,e.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(e.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,a,n)}},{key:"setAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var a=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));var i=this.trackEntry(t,e,n,r);return this.setCurrent(t,i,a),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,a)}},{key:"addAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,n,r);return r?(r.next=i,i.previous=r,a<=0&&(a+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=a,i}},{key:"setEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=this.setAnimationWith(e,t.emptyAnimation(),!1);return a.mixDuration=n,a.trackEnd=n,a}},{key:"addEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,a);return a<=0&&(r.delay+=r.mixDuration-n),r.mixDuration=n,r.trackEnd=n,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,a=this.tracks.length;n0){r[h]=jt,i[h]=u;continue t}break}r[h]=zt}else r[h]=Ut}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return t._emptyAnimation}}])}();Bt._emptyAnimation=new V("",[],0);var _t,Ot=s((function t(){r(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=O.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}),[{key:"reset",value:function(){this.next=null,this.previous=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}},{key:"getAnimationTime",value: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)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&c&&c.length>0&&(u.names=l,u.values=c,l=null,c=null),u.u=u.x/h.width,u.v=u.y/h.height,90==u.degrees?(u.u2=(u.x+u.height)/h.width,u.v2=(u.y+u.width)/h.height):(u.u2=(u.x+u.width)/h.width,u.v2=(u.y+u.height)/h.height),this.regions.push(u)}else{for(h=new ie(o.trim());0!=n.readEntry(a,o=n.readLine());){var p=i[a[0]];p&&p(h)}this.pages.push(h)}}),[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",a=g(this.pages);try{for(a.s();!(e=a.n()).done;){var r=e.value;r.setTexture(t.get(n+r.name))}}catch(t){a.e(t)}finally{a.f()}}},{key:"dispose",value:function(){for(var t,e=0;e=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var a=1,r=n+1;;a++){var i=e.indexOf(",",r);if(-1==i)return t[a]=e.substr(r).trim(),a;if(t[a]=e.substr(r,i-r).trim(),r=i+1,4==a)return 4}}}]),ie=s((function t(e){r(this,t),this.minFilter=Qt.Nearest,this.magFilter=Qt.Nearest,this.uWrap=Zt.ClampToEdge,this.vWrap=Zt.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}),[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);var e,n=g(this.regions);try{for(n.s();!(e=n.n()).done;)e.value.texture=t}catch(t){n.e(t)}finally{n.f()}}}]),se=function(t){function e(t,n){var a,i,s,o;return r(this,e),i=this,s=l(s=e),(a=u(i,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(s,[],l(i).constructor):s.apply(i,o))).x=0,a.y=0,a.offsetX=0,a.offsetY=0,a.originalWidth=0,a.originalHeight=0,a.index=0,a.degrees=0,a.names=null,a.values=null,a.page=t,a.name=n,t.regions.push(a),a}return h(e,t),s(e)}(ee);var oe=function(t){function e(t,n){var a,i,s,o;return r(this,e),i=this,o=[t],s=l(s=e),(a=u(i,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(s,o||[],l(i).constructor):s.apply(i,o))).region=null,a.regionUVs=[],a.uvs=[],a.triangles=[],a.color=new x(1,1,1,1),a.width=0,a.height=0,a.hullLength=0,a.edges=[],a.parentMesh=null,a.sequence=null,a.tempColor=new x(0,0,0,0),a.path=n,a}return h(e,t),s(e,[{key:"updateRegion",value:function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,a=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof se){var o=this.region,h=o.page.texture.getImage(),l=h.width,c=h.height;switch(o.degrees){case 90:a-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/c,i=o.originalHeight/l,s=o.originalWidth/c;for(var u=0;u= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=a}));!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"}(ue||(ue={}));var ve=s((function t(e,n,a){if(r(this,t),this.parent=null,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.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=a,this.setToSetupPose()}),[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,n,a,r,i,s){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=a,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=n+90+s,c=h.scaleX,u=h.scaleY;return this.a=I.cosDeg(n+i)*a*c,this.b=I.cosDeg(l)*r*c,this.c=I.sinDeg(n+i)*a*u,this.d=I.sinDeg(l)*r*u,this.worldX=t*c+h.x,void(this.worldY=e*u+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case ue.Normal:var p=n+90+s,g=I.cosDeg(n+i)*a,y=I.cosDeg(p)*r,w=I.sinDeg(n+i)*a,k=I.sinDeg(p)*r;return this.a=f*g+d*w,this.b=f*y+d*k,this.c=v*g+m*w,void(this.d=v*y+m*k);case ue.OnlyTranslation:var b=n+90+s;this.a=I.cosDeg(n+i)*a,this.b=I.cosDeg(b)*r,this.c=I.sinDeg(n+i)*a,this.d=I.sinDeg(b)*r;break;case ue.NoRotationOrReflection:var x=f*f+v*v,E=0;x>1e-4?(x=Math.abs(f*m-d*v)/x,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*x,m=f*x,E=Math.atan2(v,f)*I.radDeg):(f=0,v=0,E=90-Math.atan2(m,d)*I.radDeg);var A=n+i-E,S=n+s-E+90,R=I.cosDeg(A)*a,T=I.cosDeg(S)*r,C=I.sinDeg(A)*a,M=I.sinDeg(S)*r;this.a=f*R-d*C,this.b=f*T-d*M,this.c=v*R+m*C,this.d=v*T+m*M;break;case ue.NoScale:case ue.NoScaleOrReflection:var F=I.cosDeg(n),Y=I.sinDeg(n),P=(f*F+d*Y)/this.skeleton.scaleX,X=(v*F+m*Y)/this.skeleton.scaleY,L=Math.sqrt(P*P+X*X);L>1e-5&&(L=1/L),P*=L,X*=L,L=Math.sqrt(P*P+X*X),this.data.transformMode==ue.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(L=-L);var N=Math.PI/2+Math.atan2(X,P),B=Math.cos(N)*L,_=Math.sin(N)*L,O=I.cosDeg(i)*a,D=I.cosDeg(90+s)*r,V=I.sinDeg(i)*a,U=I.sinDeg(90+s)*r;this.a=P*O+B*V,this.b=P*D+B*U,this.c=X*O+_*V,this.d=X*D+_*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value: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}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.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)*I.radDeg);var e=t.a,n=t.b,a=t.c,r=t.d,i=1/(e*r-n*a),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*r*i-o*n*i,this.ay=o*e*i-s*a*i;var h=i*r,l=i*e,c=i*n,u=i*a,f=h*this.a-c*this.c,d=h*this.b-c*this.d,v=l*this.c-u*this.a,m=l*this.d-u*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,a=t.y-this.worldY;return t.x=n*this.d*e-a*this.b*e,t.y=a*this.a*e-n*this.c*e,t}},{key:"localToWorld",value: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}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,n=this.b,a=this.c,r=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*a,this.b=i*n-s*r,this.c=s*e+i*a,this.d=s*n+i*r}}]),me=s((function t(e,n,a){r(this,t),this.name=e,this.order=n,this.skinRequired=a})),pe=s((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ge;r(this,t),this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=n,this.downloader=a}),[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)}},{key:"error",value:function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,n){requestAnimationFrame((function a(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(a)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadBinary(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load binary ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadText(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load text ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadJson(t,(function(a){e.success(n,t,a)}),(function(n,r){e.error(a,t,"Couldn't load JSON ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t=this.start(t),"undefined"!=typeof window&&"undefined"!=typeof navigator&&window.document){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(n,t,e.textureLoader(r))},r.onerror=function(){e.error(a,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}else fetch(t,{mode:"cors"}).then((function(n){return n.ok?n.blob():(e.error(a,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(a){a&&e.success(n,t,e.textureLoader(a))}))}},{key:"loadTextureAtlas",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=arguments.length>3?arguments[3]:void 0,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new ae(i),l=h.pages.length,c=!1,u=g(h.pages);try{var f=function(){var i=o.value;e.loadTexture(r?r[i.name]:s+i.name,(function(a,r){c||(i.setTexture(r),0==--l&&e.success(n,t,h))}),(function(n,r){c||e.error(a,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(n)),c=!0}))};for(u.s();!(o=u.n()).done;)f()}catch(t){u.e(t)}finally{u.f()}}catch(n){e.error(a,t,"Couldn't parse texture atlas ".concat(t,": ").concat(n.message))}}),(function(n,r){e.error(a,t,"Couldn't load texture atlas ".concat(t,": status ").concat(n,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),ge=s((function t(){r(this,t),this.callbacks={},this.rawDataUris={}}),[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),n=e.length,a=new Uint8Array(n),r=0;r180?f-=360:f<-180&&(f+=360);var b=t.ascaleX,x=t.ascaleY;if(a||r){switch(t.data.transformMode){case ue.NoScale:case ue.NoScaleOrReflection:d=e-t.worldX,v=n-t.worldY}var E=t.data.length*b,A=Math.sqrt(d*d+v*v);if(a&&AE&&E>1e-4){var S=(A/E-1)*s+1;b*=S,i&&(x*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,b,x,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,n,a,r,i,s,o,h){var l=t.ax,c=t.ay,u=t.ascaleX,f=t.ascaleY,d=u,v=f,m=e.ascaleX,p=0,g=0,y=0;u<0?(u=-u,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var w=e.ax,k=0,b=0,x=0,E=t.a,A=t.b,S=t.c,R=t.d,T=Math.abs(u-f)<=1e-4;!T||i?(k=0,b=E*w+t.worldX,x=S*w+t.worldY):(b=E*w+A*(k=e.ay)+t.worldX,x=S*w+R*k+t.worldY);var C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");E=C.a,A=C.b,S=C.c;var M,F,Y=E*(R=C.d)-A*S,P=b-C.worldX,X=x-C.worldY,L=(P*R-X*A)*(Y=Math.abs(Y)<=1e-4?0:1/Y)-l,N=(X*E-P*S)*Y-c,B=Math.sqrt(L*L+N*N),_=e.data.length*m;if(B<1e-4)return this.apply1(t,n,a,!1,i,!1,h),void e.updateWorldTransformWith(w,k,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var O=((P=n-C.worldX)*R-(X=a-C.worldY)*A)*Y-l,D=(X*E-P*S)*Y-c,V=O*O+D*D;if(0!=o){o*=u*(m+1)*.5;var U=Math.sqrt(V),q=U-B-_*u+o;if(q>0){var W=Math.min(1,q/(2*o))-1;V=(O-=(W=(q-o*(1-W*W))/U)*O)*O+(D-=W*D)*D}}t:if(T){var z=(V-B*B-(_*=u)*_)/(2*B*_);z<-1?(z=-1,F=Math.PI*r):z>1?(z=1,F=0,i&&(d*=E=(Math.sqrt(V)/(B+_)-1)*h+1,s&&(v*=E))):F=Math.acos(z)*r,E=B+_*z,A=_*Math.sin(F),M=Math.atan2(D*E-O*A,O*E+D*A)}else{var j=(E=u*_)*E,G=(A=f*_)*A,H=Math.atan2(D,O),$=-2*G*B,J=G-j;if((R=$*$-4*J*(S=G*B*B+j*V-j*G))>=0){var K=Math.sqrt(R);$<0&&(K=-K);var Q=(K=.5*-($+K))/J,Z=S/K,tt=Math.abs(Q)=-1&&S<=1&&(S=Math.acos(S),(R=(P=E*Math.cos(S)+B)*P+(X=A*Math.sin(S))*X)ot&&(it=S,ot=R,st=P,ht=X)),V<=.5*(at+ot)?(M=H-Math.atan2(rt*r,nt),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(k,w)*y,ct=t.arotation;(M=(M-lt)*I.radDeg+p-ct)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,c,ct+M*h,d,v,0,0),ct=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ct)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,k,ct+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]);var be=function(t){function e(t){var n,a,i,s;return r(this,e),a=this,s=[t,0,!1],i=l(i=e),(n=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(a).constructor):i.apply(a,s))).bones=new Array,n._target=null,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return h(e,t),s(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(me);var xe,Ie,Ee,Ae=function(t){function e(t){var n,a,i,s;return r(this,e),a=this,s=[t,0,!1],i=l(i=e),(n=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(a).constructor):i.apply(a,s))).bones=new Array,n._target=null,n.positionMode=xe.Fixed,n.spacingMode=Ie.Fixed,n.rotateMode=Ee.Chain,n.offsetRotation=0,n.position=0,n.spacing=0,n.mixRotate=0,n.mixX=0,n.mixY=0,n}return h(e,t),s(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t}}])}(me);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(xe||(xe={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(Ie||(Ie={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(Ee||(Ee={}));var Se=function(){function t(e,n){if(r(this,t),this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=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,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var a=0,i=e.bones.length;a0){k=c/k*d;for(var M=1;M0?I.degRad:-I.degRad}for(var z=0,j=3;z0){var tt=G.a,et=G.b,nt=G.c,at=G.d,rt=0,it=0,st=0;if(rt=s?O[j-1]:0==u[z+1]?O[j+2]:Math.atan2(K,J),rt-=Math.atan2(nt,tt),q){it=Math.cos(rt),st=Math.sin(rt);var ot=G.data.length;D+=(ot*(it*tt-st*nt)-J)*n,V+=(ot*(st*tt+it*nt)-K)*n}else rt+=U;rt>I.PI?rt-=I.PI2:rt<-I.PI&&(rt+=I.PI2),rt*=n,it=Math.cos(rt),st=Math.sin(rt),G.a=it*tt-st*nt,G.b=it*et-st*at,G.c=st*tt+it*nt,G.d=st*et+it*at}G.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,n,a){var r=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*n+2),h=this.world,l=e.closed,c=e.worldVerticesLength,u=c/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[u-=l?1:2];switch(this.data.positionMode==xe.Percent&&(i*=m),this.data.spacingMode){case Ie.Percent:d=m;break;case Ie.Proportional:d=m/n;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,c-6,4,h,0,2)),this.addAfterPosition(k-m,h,0,o,g);continue}}for(;;y++){var b=v[y];if(!(k>b)){if(0==y)k/=b;else{var x=v[y-1];k=(k-x)/(b-x)}break}}y!=f&&(f=y,l&&y==u?(e.computeWorldVertices(r,c-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(k,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,a||p>0&&0==w)}return o}l?(c+=2,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c-4,h,0,2),e.computeWorldVertices(r,0,2,h,c-4,2),h[c-2]=h[0],h[c-1]=h[1]):(u--,c-=4,h=R.setArraySize(this.world,c),e.computeWorldVertices(r,2,c,h,0,2));for(var I,E=R.setArraySize(this.curves,u),A=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,P=0,X=0,L=0,N=0,B=0,_=0,O=0,D=0,V=0,U=0,q=0,W=2;qA){this.addAfterPosition(Q-A,h,c-4,o,H);continue}}for(;;$++){var Z=E[$];if(!(Q>Z)){if(0==$)Q/=Z;else{var tt=E[$-1];Q=(Q-tt)/(Z-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],O=2*(L=.03*(S-2*C+F))+(B=.006*(3*(C-F)-S+(P=h[et+6]))),D=2*(N=.03*(T-2*M+Y))+(_=.006*(3*(M-Y)-T+(X=h[et+7]))),V=.3*(C-S)+L+.16666667*B,U=.3*(M-T)+N+.16666667*_,j=Math.sqrt(V*V+U*U),z[0]=j,et=1;et<8;et++)V+=O,U+=D,O+=B,D+=_,j+=Math.sqrt(V*V+U*U),z[et]=j;V+=O,U+=D,j+=Math.sqrt(V*V+U*U),z[8]=j,V+=O+B,U+=D+_,j+=Math.sqrt(V*V+U*U),z[9]=j,J=0}for(Q*=j;;J++){var nt=z[J];if(!(Q>nt)){if(0==J)Q/=nt;else{var at=z[J-1];Q=J+(Q-at)/(nt-at)}break}}this.addCurvePosition(.1*Q,S,T,C,M,F,Y,P,X,o,H,a||G>0&&0==K)}return o}},{key:"addBeforePosition",value:function(t,e,n,a,r){var i=e[n],s=e[n+1],o=e[n+2]-i,h=e[n+3]-s,l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addAfterPosition",value:function(t,e,n,a,r){var i=e[n+2],s=e[n+3],o=i-e[n],h=s-e[n+1],l=Math.atan2(h,o);a[r]=i+t*Math.cos(l),a[r+1]=s+t*Math.sin(l),a[r+2]=l}},{key:"addCurvePosition",value:function(t,e,n,a,r,i,s,o,h,l,c,u){if(0==t||isNaN(t))return l[c]=e,l[c+1]=n,void(l[c+2]=Math.atan2(r-n,a-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,w=v*y,k=y*t,b=e*p+a*w+i*k+o*d,x=n*p+r*w+s*k+h*d;l[c]=b,l[c+1]=x,u&&(l[c+2]=t<.001?Math.atan2(r-n,a-e):Math.atan2(x-(n*m+r*g*2+s*f),b-(e*m+a*g*2+i*f)))}}])}();Se.NONE=-1,Se.BEFORE=-2,Se.AFTER=-3,Se.epsilon=1e-5;var Re=s((function t(e,n){if(r(this,t),this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new x,this.darkColor=e.darkColor?new x:null,this.setToSetupPose()}),[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof X&&this.attachment instanceof X&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),Te=s((function t(e,n){if(r(this,t),this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new M,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var a=0;a0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(R.x-y.worldX)*e,y.worldY+=(R.y-y.worldY)*n}if(0!=a){var T=Math.sqrt(y.a*y.a+y.c*y.c);0!=T&&(T=(T+(Math.sqrt(h*h+c*c)-T+this.data.offsetScaleX)*a)/T),y.a*=T,y.c*=T}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+u*u)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),P=Math.atan2(u,l)-Math.atan2(c,h)-(Y-Math.atan2(y.c,y.a));P>I.PI?P-=I.PI2:P<-I.PI&&(P+=I.PI2),P=Y+(P+v)*i;var X=Math.sqrt(M*M+F*F);y.b=Math.cos(P)*X,y.d=Math.sin(P)*X}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,c=o.c,u=o.d,f=h*u-l*c>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var R=this.temp;o.localToWorld(R.set(this.data.offsetX,this.data.offsetY)),y.worldX+=R.x*e,y.worldY+=R.y*n}if(0!=a){var T=(Math.sqrt(h*h+c*c)-1+this.data.offsetScaleX)*a+1;y.a*=T,y.c*=T}if(0!=r){var C=(Math.sqrt(l*l+u*u)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(u,l)-Math.atan2(c,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var P=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*P,y.d=Math.sin(M)*P}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,a=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var a=this.drawOrder,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=a.length;h0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;r(this,t),this.slotIndex=e,this.name=n,this.attachment=a})),Pe=s((function t(e){if(r(this,t),this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}),[{key:"setAttachment",value:function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var a=this.attachments;t>=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=n}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!n)throw new Error("name cannot be null.");if(!a)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=a}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Me||(Me={}));var Le,Ne=function(t){function e(t){var n,a,i,s;return r(this,e),a=this,s=[t,0,!1],i=l(i=e),(n=u(a,function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){return!1}}()?Reflect.construct(i,s||[],l(a).constructor):i.apply(a,s))).bones=new Array,n._target=null,n.mixRotate=0,n.mixX=0,n.mixY=0,n.mixScaleX=0,n.mixScaleY=0,n.mixShearY=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 h(e,t),s(e,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}])}(me),Be=s((function t(e){r(this,t),this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}),[{key:"readSkeletonData",value:function(t){var e=this.scale,n=new Fe;n.name="";var a=new _e(t),r=a.readInt32(),i=a.readInt32();n.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),n.version=a.readString(),n.x=a.readFloat(),n.y=a.readFloat(),n.width=a.readFloat(),n.height=a.readFloat();var s=a.readBoolean();s&&(n.fps=a.readFloat(),n.imagesPath=a.readString(),n.audioPath=a.readString());var o=0;o=a.readInt(!0);for(var h=0;h>4,t.readFloat())}a.push(ba)}}var Aa=t.readInt(!0);if(Aa>0){for(var Sa=new Mt(Aa),Ra=n.slots.length,Ta=0;Ta=0;Ya--)Fa[Ya]=-1;for(var Pa=R.newArray(Ra-Ma,0),Xa=0,La=0,Na=0;Na=0;_a--)-1==Fa[_a]&&(Fa[_a]=Pa[--La]);Sa.setFrame(Ta,Ca,Fa)}a.push(Sa)}var Oa=t.readInt(!0);if(Oa>0){for(var Da=new Ct(Oa),Va=0;Va1&&void 0!==arguments[1]?arguments[1]:new Array,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);r(this,t),this.strings=n,this.index=a,this.buffer=i}),[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value: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&a)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&a)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(a),n++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),Oe=s((function t(e,n,a,i,s){r(this,t),this.mesh=e,this.skin=n,this.slotIndex=a,this.parent=i,this.inheritTimeline=s})),De=s((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this.bones=e,this.vertices=n}));function Ve(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,a,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(i);break;case vn:qe(t,e,s++,i,0,a,h,r,l,n)}a=h,r=l}return e}function Ue(t,e,n){for(var a=t.readFloat(),r=t.readFloat()*n,i=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,a,r,i),s!=h;s++){var l=t.readFloat(),c=t.readFloat()*n,u=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(s);break;case vn:qe(t,e,o++,s,0,a,l,r,c,n),qe(t,e,o++,s,1,a,l,i,u,n)}a=l,r=c,i=u}return e}function qe(t,e,n,a,r,i,s,o,h,l){e.setBezier(n,a,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Le||(Le={}));var We,ze=0,je=1,Ge=2,He=3,$e=4,Je=5,Ke=6,Qe=7,Ze=8,tn=9,en=0,nn=1,an=2,rn=3,sn=4,on=5,hn=0,ln=1,cn=0,un=1,fn=2,dn=1,vn=2,mn=s((function t(){r(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new C((function(){return R.newFloatArray(16)}))}),[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,a=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;n.length=0,r.freeAll(a),a.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,n,a){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=i&&a<=i||t>=s&&n>=s||e>=o&&a>=o)return!1;var h=(a-e)/(n-t),l=h*(r-t)+e;if(l>i&&li&&lr&&cr&&ct.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var n=this.polygons,a=0,r=n.length;a=n||l=n){var c=a[o];c+(n-h)/(l-h)*(a[i]-c)=c&&w<=d||w>=d&&w<=c)&&(w>=e&&w<=a||w>=a&&w<=e)){var k=(l*g-h*m)/y;if((k>=u&&k<=v||k>=v&&k<=u)&&(k>=n&&k<=r||k>=r&&k<=n))return!0}c=d,u=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),pn=function(){function t(){r(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new C((function(){return new Array})),this.polygonIndicesPool=new C((function(){return new Array}))}return s(t,[{key:"triangulate",value:function(e){var n=e,a=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var c=a-1,u=0,f=1;;){t:if(!s[u]){for(var d=r[c]<<1,v=r[u]<<1,m=r[f]<<1,p=n[d],g=n[d+1],y=n[v],w=n[v+1],k=n[m],b=n[m+1],x=(f+1)%a;x!=c;x=(x+1)%a)if(s[x]){var I=r[x]<<1,E=n[I],A=n[I+1];if(t.positiveArea(k,b,p,g,E,A)&&t.positiveArea(p,g,y,w,E,A)&&t.positiveArea(y,w,k,b,E,A))break t}break}if(0==f){do{if(!s[u])break;u--}while(u>0);break}c=u,u=f,f=(f+1)%a}l.push(r[(a+u-1)%a]),l.push(r[u]),l.push(r[(u+1)%a]),r.splice(u,1),s.splice(u,1);var S=(--a+u-1)%a,R=u==a?0:u;s[S]=t.isConcave(S,a,n,r),s[R]=t.isConcave(R,a,n,r)}return 3==a&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,n){var a=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,c=0,u=n.length;c0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(w),o.push(k),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,w,k),h=f)}o.length>0&&(r.push(o),i.push(s));for(var A=0,S=r.length;A=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,n,a){var r=a[(e+t-1)%e]<<1,i=a[t]<<1,s=a[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[i],n[i+1],n[s],n[s+1])}},{key:"positiveArea",value:function(t,e,n,a,r,i){return t*(i-a)+n*(e-i)+r*(a-e)>=0}},{key:"winding",value:function(t,e,n,a,r,i){var s=n-t,o=a-e;return r*o-i*s+s*e-t*o>=0?1:-1}}])}(),gn=function(){function t(){r(this,t),this.triangulator=new pn,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}return s(t,[{key:"clipStart",value:function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var a=n.worldVerticesLength,r=R.setArraySize(this.clippingPolygon,a);n.computeWorldVertices(e,0,a,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),q=0;q=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(a),h.push(r),h.push(i),h.push(t),h.push(e),o.length=0;for(var u=s,f=s.length-4,d=0;;d+=2){for(var v=u[d],m=u[d+1],p=u[d+2],g=u[d+3],y=v-p,w=m-g,k=h,b=h.length-2,x=o.length,I=0;I0;if(y*(A-g)-w*(E-p)>0){if(T){o.push(S),o.push(R);continue}var C=R-A,M=S-E,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-A)-C*(v-E))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(T){var P=R-A,X=S-E,L=P*(p-v)-X*(g-m);if(Math.abs(L)>1e-6){var N=(X*(m-A)-P*(v-E))/L;o.push(v+(p-v)*N),o.push(m+(g-m)*N)}else o.push(v),o.push(m);o.push(S),o.push(R)}c=!0}if(x==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var B=o;(o=h).length=0,h=B}if(l!=o){l.length=0;for(var _=0,O=o.length-2;_>1;l=0;la--)-1==ta[la]&&(ta[la]=na[--ra])}$n.setFrame(Kn,In(Zn,"time",0),ta)}r.push($n)}if(t.events){for(var ca=new Ct(t.events.length),ua=0,fa=0;fa)?=?)"),v("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),v("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),v("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),v("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),v("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),v("COERCEPLAIN","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")),v("COERCE","".concat(h[l.COERCEPLAIN],"(?:$|[^\\d])")),v("COERCEFULL",h[l.COERCEPLAIN]+"(?:".concat(h[l.PRERELEASE],")?")+"(?:".concat(h[l.BUILD],")?")+"(?:$|[^\\d])"),v("COERCERTL",h[l.COERCE],!0),v("COERCERTLFULL",h[l.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",v("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),v("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("LONECARET","(?:\\^)"),v("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",v("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),v("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),v("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),v("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),v("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),v("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Pn,Pn.exports);var Xn=Pn.exports;Tn(Xn);var Ln=Object.freeze({loose:!0}),Nn=Object.freeze({}),Bn=function(t){return t?"object"!==a(t)?Ln:t:Nn};Tn(Bn);var _n=/^[0-9]+$/,On=function(t,e){var n=_n.test(t),a=_n.test(e);return n&&a&&(t=+t,e=+e),t===e?0:n&&!a?-1:a&&!n?1:tUn)throw new TypeError("version is longer than ".concat(Un," characters"));Vn("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=e.trim().match(n.loose?Wn[zn.LOOSE]:Wn[zn.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>qn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qn||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(e){var i=[e,a];!1===n&&(i=[e]),0===Gn(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}])}(),$n=Hn;Tn($n);var Jn=$n,Kn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof Jn)return t;try{return new Jn(t,e)}catch(t){if(!n)return null;throw t}};Tn(Kn);var Qn=Kn,Zn=Tn((function(t,e){var n=Qn(t,e);return n?n.version:null})),ta=$n,ea=Kn,na=Xn.safeRe,aa=Xn.t,ra=Tn((function(t,e){if(t instanceof ta)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var a,r=e.includePrerelease?na[aa.COERCERTLFULL]:na[aa.COERCERTL];(a=r.exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&a.index+a[0].length===n.index+n[0].length||(n=a),r.lastIndex=a.index+a[1].length+a[2].length;r.lastIndex=-1}else n=t.match(e.includePrerelease?na[aa.COERCEFULL]:na[aa.COERCE]);if(null===n)return null;var i=n[2],s=n[3]||"0",o=n[4]||"0",h=e.includePrerelease&&n[5]?"-".concat(n[5]):"",l=e.includePrerelease&&n[6]?"+".concat(n[6]):"";return ea("".concat(i,".").concat(s,".").concat(o).concat(h).concat(l),e)})),ia=s((function t(){r(this,t),this.max=1e3,this.map=new Map}),[{key:"get",value:function(t){var e=this.map.get(t);return void 0===e?void 0:(this.map.delete(t),this.map.set(t,e),e)}},{key:"delete",value:function(t){return!!this.map.has(t)&&(this.map.delete(t),!0)}},{key:"set",value:function(t,e){if(!this.delete(t)&&void 0!==e){if(this.map.size>=this.max){var n=this.map.keys().next().value;this.delete(n)}this.map.set(t,e)}return this}}]);Tn(ia);var sa=$n,oa=function(t,e,n){return new sa(t,n).compare(new sa(e,n))};Tn(oa);var ha=oa,la=function(t,e,n){return 0===ha(t,e,n)};Tn(la);var ca=oa,ua=function(t,e,n){return 0!==ca(t,e,n)};Tn(ua);var fa=oa,da=function(t,e,n){return fa(t,e,n)>0};Tn(da);var va=oa,ma=function(t,e,n){return va(t,e,n)>=0};Tn(ma);var pa=oa,ga=function(t,e,n){return pa(t,e,n)<0};Tn(ga);var ya=oa,wa=function(t,e,n){return ya(t,e,n)<=0};Tn(wa);var ka,ba,xa,Ia,Ea=la,Aa=ua,Sa=da,Ra=ma,Ta=ga,Ca=wa,Ma=function(t,e,n,r){switch(e){case"===":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t===n;case"!==":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Ea(t,n,r);case"!=":return Aa(t,n,r);case">":return Sa(t,n,r);case">=":return Ra(t,n,r);case"<":return Ta(t,n,r);case"<=":return Ca(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function Fa(){if(Ia)return xa;Ia=1;var t=function(){function t(e,i){var s=this;if(r(this,t),i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!p(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=g(this.set);try{for(l.s();!(h=l.n()).done;){var c=h.value;if(1===c.length&&y(c[0])){this.set=[c];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return s(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,r=((this.options.includePrerelease&&d)|(this.options.loose&&m))+":"+t,s=e.get(r);if(s)return s;var o=this.options.loose,y=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(y,M(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],c),i("comparator trim",t),t=t.replace(h[l.TILDETRIM],u),i("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),i("caret trim",t);var w=t.split(" ").map((function(t){return k(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));o&&(w=w.filter((function(t){return i("loose invalid filter",t,n.options),!!t.match(h[l.COMPARATORLOOSE])}))),i("range list",w);var b,x=new Map,I=w.map((function(t){return new a(t,n.options)})),E=g(I);try{for(E.s();!(b=E.n()).done;){var A=b.value;if(p(A))return[A];x.set(A.value,A)}}catch(t){E.e(t)}finally{E.f()}x.size>1&&x.has("")&&x.delete("");var S=v(x.values());return e.set(r,S),S}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return w(t,n)&&e.set.some((function(e){return w(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new o(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(o(this.semver,"<",t.semver,a)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(o(this.semver,">",t.semver,a)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}])}();ka=e;var n=Bn,a=Xn.safeRe,i=Xn.t,o=Ma,h=Yn,l=$n,c=Fa();return ka}(),i=Yn,o=$n,h=Xn.safeRe,l=Xn.t,c=Xn.comparatorTrimReplace,u=Xn.tildeTrimReplace,f=Xn.caretTrimReplace,d=Cn.FLAG_INCLUDE_PRERELEASE,m=Cn.FLAG_LOOSE,p=function(t){return"<0.0.0-0"===t.value},y=function(t){return""===t.value},w=function(t,e){for(var n=!0,a=t.slice(),r=a.pop();n&&a.length;)n=a.every((function(t){return r.intersects(t,e)})),r=a.pop();return n},k=function(t,e){return i("comp",t,e),t=E(t,e),i("caret",t),t=x(t,e),i("tildes",t),t=S(t,e),i("xrange",t),t=T(t,e),i("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){var n=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(n,(function(e,n,a,r,s){var o;return i("tilde",t,e,n,a,r,s),b(n)?o="":b(a)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(r)?o=">=".concat(n,".").concat(a,".0 <").concat(n,".").concat(+a+1,".0-0"):s?(i("replaceTilde pr",s),o=">=".concat(n,".").concat(a,".").concat(r,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0")):o=">=".concat(n,".").concat(a,".").concat(r," <").concat(n,".").concat(+a+1,".0-0"),i("tilde return",o),o}))},E=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){i("caret",t,e);var n=e.loose?h[l.CARETLOOSE]:h[l.CARET],a=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,r,s,o){var h;return i("caret",t,e,n,r,s,o),b(n)?h="":b(r)?h=">=".concat(n,".0.0").concat(a," <").concat(+n+1,".0.0-0"):b(s)?h="0"===n?">=".concat(n,".").concat(r,".0").concat(a," <").concat(n,".").concat(+r+1,".0-0"):">=".concat(n,".").concat(r,".0").concat(a," <").concat(+n+1,".0.0-0"):o?(i("replaceCaret pr",o),h="0"===n?"0"===r?">=".concat(n,".").concat(r,".").concat(s,"-").concat(o," <").concat(n,".").concat(r,".").concat(+s+1,"-0"):">=".concat(n,".").concat(r,".").concat(s,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0"):">=".concat(n,".").concat(r,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(i("no pr"),h="0"===n?"0"===r?">=".concat(n,".").concat(r,".").concat(s).concat(a," <").concat(n,".").concat(r,".").concat(+s+1,"-0"):">=".concat(n,".").concat(r,".").concat(s).concat(a," <").concat(n,".").concat(+r+1,".0-0"):">=".concat(n,".").concat(r,".").concat(s," <").concat(+n+1,".0.0-0")),i("caret return",h),h}))},S=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var n=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(n,(function(n,a,r,s,o,h){i("xRange",t,n,a,r,s,o,h);var l=b(r),c=l||b(s),u=c||b(o),f=u;return"="===a&&f&&(a=""),h=e.includePrerelease?"-0":"",l?n=">"===a||"<"===a?"<0.0.0-0":"*":a&&f?(c&&(s=0),o=0,">"===a?(a=">=",c?(r=+r+1,s=0,o=0):(s=+s+1,o=0)):"<="===a&&(a="<",c?r=+r+1:s=+s+1),"<"===a&&(h="-0"),n="".concat(a+r,".").concat(s,".").concat(o).concat(h)):c?n=">=".concat(r,".0.0").concat(h," <").concat(+r+1,".0.0-0"):u&&(n=">=".concat(r,".").concat(s,".0").concat(h," <").concat(r,".").concat(+s+1,".0-0")),i("xRange return",n),n}))},T=function(t,e){return i("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,n,a,r,i,s,o,h,l,c,u,f){return n=b(a)?"":b(r)?">=".concat(a,".0.0").concat(t?"-0":""):b(i)?">=".concat(a,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=b(l)?"":b(c)?"<".concat(+l+1,".0.0-0"):b(u)?"<".concat(l,".").concat(+c+1,".0-0"):f?"<=".concat(l,".").concat(c,".").concat(u,"-").concat(f):t?"<".concat(l,".").concat(c,".").concat(+u+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},F=function(t,e,n){for(var r=0;r0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return xa}Tn(Ma);var Ya=Fa(),Pa=function(t,e,n){try{e=new Ya(e,n)}catch(t){return!1}return e.test(t)},Xa={valid:Zn,coerce:ra,satisfies:Tn(Pa),SEMVER_SPEC_VERSION:Mn.SEMVER_SPEC_VERSION},La=0,Na=1,Ba=2,_a=[0,1,2,2,3,0],Oa=s((function t(e,a,i,s){var h;if(r(this,t),o(this,"autoUpdate",!0),o(this,"skeleton",void 0),o(this,"states",void 0),this._app=e,this._position=new n.Vec3,1===ae.length){var l,c=g((h=new ae(a)).pages);try{for(c.s();!(l=c.n()).done;){var u=l.value;u.setTexture(new Rn(s[u.name]))}}catch(t){c.e(t)}finally{c.f()}}else h=new ae(a,(function(t){return new Rn(s[t])}));var f=new yn(new fe(h));f.scale*=.01;var d=f.readSkeletonData(i);this.skeletonVersion=Xa.valid(Xa.coerce(d.version)),this._spine_3_6_0=Xa.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=Xa.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=Xa.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=Xa.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Ce(d),this.skeleton.updateWorldTransform(),this.stateData=new $t(this.skeleton.data),this.states=[new Bt(this.stateData)],this.clipper=new gn,this._node=new n.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new n.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new n.Vec2,this._aabbTempSize=new n.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[n.LAYERID_UI],this.init(),this._hidden=!1}),[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new n.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new n.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&u.indices.length>0){t&&t!==u.material&&(this.SubmitBatch(e,a,t),t=u.material,e=s,a=0),t=u.material;var f=u.positions,d=u.vertexColor.r,v=u.vertexColor.g,m=u.vertexColor.b,p=u.vertexColor.a,g=u.uvs,y=void 0,w=f.length/2;for(y=0;y0){var r=new n.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=n.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new n.MeshInstance(r,this._materials[a],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e