diff --git a/build/playcanvas-spine.3.6.js b/build/playcanvas-spine.3.6.js index b251611..e0a4953 100644 --- a/build/playcanvas-spine.3.6.js +++ b/build/playcanvas-spine.3.6.js @@ -7334,7 +7334,7 @@ pc.extend(pc, function () { var textureData = {}; for (var i = 0, n = this.textureAssets.length; i < n; i++) { var asset = this.system.app.assets.get(this.textureAssets[i]); - var path = asset.file ? asset.file.filename : null; + var path = asset.name ? asset.name : (asset.file ? asset.file.filename : null); // Fallback if filename doesn't exist if (!path) { path = pc.path.getBasename(asset.file.url); diff --git a/build/playcanvas-spine.3.6.min.js b/build/playcanvas-spine.3.6.min.js index 025e3ed..09287dd 100644 --- a/build/playcanvas-spine.3.6.min.js +++ b/build/playcanvas-spine.3.6.min.js @@ -1,3 +1,3 @@ /* Copyright 2015-2021 PlayCanvas Ltd */ -var spine,__extends=this&&this.__extends||function(){var i=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])};return function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();!function(V){var N,c,t,k=(e.prototype.apply=function(t,e,n,i,r,a,s,o){if(null==t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(n%=this.duration,0>>1;;){if(t[(a+1)*n]<=e?i=a+1:r=a,i==r)return(i+1)*n;a=i+r>>>1}},e.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;return-1},e);function e(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}V.Animation=k,(n=N=V.MixPose||(V.MixPose={}))[n.setup=0]="setup",n[n.current=1]="current",n[n.currentLayered=2]="currentLayered",(r=c=V.MixDirection||(V.MixDirection={}))[r.in=0]="in",r[r.out=1]="out",(s=t=V.TimelineType||(V.TimelineType={}))[s.rotate=0]="rotate",s[s.translate=1]="translate",s[s.scale=2]="scale",s[s.shear=3]="shear",s[s.attachment=4]="attachment",s[s.color=5]="color",s[s.deform=6]="deform",s[s.event=7]="event",s[s.drawOrder=8]="drawOrder",s[s.ikConstraint=9]="ikConstraint",s[s.transformConstraint=10]="transformConstraint",s[s.pathConstraintPosition=11]="pathConstraintPosition",s[s.pathConstraintSpacing=12]="pathConstraintSpacing",s[s.pathConstraintMix=13]="pathConstraintMix",s[s.twoColor=14]="twoColor";var n=(y.prototype.getFrameCount=function(){return this.curves.length/y.BEZIER_SIZE+1},y.prototype.setLinear=function(t){this.curves[t*y.BEZIER_SIZE]=y.LINEAR},y.prototype.setStepped=function(t){this.curves[t*y.BEZIER_SIZE]=y.STEPPED},y.prototype.getCurveType=function(t){t*=y.BEZIER_SIZE;if(t==this.curves.length)return y.LINEAR;t=this.curves[t];return t==y.LINEAR?y.LINEAR:t==y.STEPPED?y.STEPPED:y.BEZIER},y.prototype.setCurve=function(t,e,n,i,r){var a=.03*(2*-e+i),s=.03*(2*-n+r),o=.006*(3*(e-i)+1),h=.006*(3*(n-r)+1),l=2*a+o,u=2*s+h,p=.3*e+a+.16666667*o,c=.3*n+s+.16666667*h,d=t*y.BEZIER_SIZE,f=this.curves;f[d++]=y.BEZIER;for(var m=p,g=c,v=d+y.BEZIER_SIZE-1;d 0: "+t);this.curves=V.Utils.newFloatArray((t-1)*y.BEZIER_SIZE)}V.CurveTimeline=n;var i,r=(__extends(d,i=n),d.prototype.getPropertyId=function(){return(t.rotate<<24)+this.boneIndex},d.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+d.ROTATION]=n},d.prototype.apply=function(t,e,n,i,r,a,s){var o,h,l=this.frames,u=t.bones[this.boneIndex];if(n=l[l.length-d.ENTRIES]?a==N.setup?u.rotation=u.data.rotation+l[l.length+d.PREV_ROTATION]*r:(o=u.data.rotation+l[l.length+d.PREV_ROTATION]-u.rotation,o-=360*(16384-(16384.499999999996-o/360|0)),u.rotation+=o*r):(t=l[(h=k.binarySearch(l,n,d.ENTRIES))+d.PREV_ROTATION],o=l[h],o=this.getCurvePercent((h>>1)-1,1-(n-o)/(l[h+d.PREV_TIME]-o)),h=l[h+d.ROTATION]-t,h=t+(h-=360*(16384-(16384.499999999996-h/360|0)))*o,a==N.setup?(h-=360*(16384-(16384.499999999996-h/360|0)),u.rotation=u.data.rotation+h*r):(h=u.data.rotation+h-u.rotation,h-=360*(16384-(16384.499999999996-h/360|0)),u.rotation+=h*r))},d.ENTRIES=2,d.PREV_TIME=-2,d.PREV_ROTATION=-1,d.ROTATION=1,d);function d(t){var e=i.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t<<1),e}V.RotateTimeline=r;var a,s=(__extends(f,a=n),f.prototype.getPropertyId=function(){return(t.translate<<24)+this.boneIndex},f.prototype.setFrame=function(t,e,n,i){t*=f.ENTRIES,this.frames[t]=e,this.frames[t+f.X]=n,this.frames[t+f.Y]=i},f.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.bones[this.boneIndex];if(n=o[o.length-f.ENTRIES]?(u=o[o.length+f.PREV_X],p=o[o.length+f.PREV_Y]):(u=o[(l=k.binarySearch(o,n,f.ENTRIES))+f.PREV_X],p=o[l+f.PREV_Y],t=o[l],t=this.getCurvePercent(l/f.ENTRIES-1,1-(n-t)/(o[l+f.PREV_TIME]-t)),u+=(o[l+f.X]-u)*t,p+=(o[l+f.Y]-p)*t),a==N.setup?(h.x=h.data.x+u*r,h.y=h.data.y+p*r):(h.x+=(h.data.x+u-h.x)*r,h.y+=(h.data.y+p-h.y)*r)}},f.ENTRIES=3,f.PREV_TIME=-3,f.PREV_X=-2,f.PREV_Y=-1,f.X=1,f.Y=2,f);function f(t){var e=a.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*f.ENTRIES),e}V.TranslateTimeline=s;var o,r=(__extends(m,o=s),m.prototype.getPropertyId=function(){return(t.scale<<24)+this.boneIndex},m.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.bones[this.boneIndex];if(n=o[o.length-m.ENTRIES]?(p=o[o.length+m.PREV_X]*h.data.scaleX,o[o.length+m.PREV_Y]*h.data.scaleY):(p=o[(l=k.binarySearch(o,n,m.ENTRIES))+m.PREV_X],t=o[l+m.PREV_Y],u=o[l],u=this.getCurvePercent(l/m.ENTRIES-1,1-(n-u)/(o[l+m.PREV_TIME]-u)),p=(p+(o[l+m.X]-p)*u)*h.data.scaleX,(t+(o[l+m.Y]-t)*u)*h.data.scaleY),1==r?(h.scaleX=p,h.scaleY=t):(u=l=0,u=a==N.setup?(l=h.data.scaleX,h.data.scaleY):(l=h.scaleX,h.scaleY),s==c.out?(p=Math.abs(p)*V.MathUtils.signum(l),t=Math.abs(t)*V.MathUtils.signum(u)):(l=Math.abs(l)*V.MathUtils.signum(p),u=Math.abs(u)*V.MathUtils.signum(t)),h.scaleX=l+(p-l)*r,h.scaleY=u+(t-u)*r)}},m);function m(t){return o.call(this,t)||this}V.ScaleTimeline=r;var h,s=(__extends(g,h=s),g.prototype.getPropertyId=function(){return(t.shear<<24)+this.boneIndex},g.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.bones[this.boneIndex];if(n=o[o.length-g.ENTRIES]?(u=o[o.length+g.PREV_X],p=o[o.length+g.PREV_Y]):(u=o[(l=k.binarySearch(o,n,g.ENTRIES))+g.PREV_X],p=o[l+g.PREV_Y],t=o[l],t=this.getCurvePercent(l/g.ENTRIES-1,1-(n-t)/(o[l+g.PREV_TIME]-t)),u+=(o[l+g.X]-u)*t,p+=(o[l+g.Y]-p)*t),a==N.setup?(h.shearX=h.data.shearX+u*r,h.shearY=h.data.shearY+p*r):(h.shearX+=(h.data.shearX+u-h.shearX)*r,h.shearY+=(h.data.shearY+p-h.shearY)*r)}},g);function g(t){return h.call(this,t)||this}V.ShearTimeline=s;var l,s=(__extends(v,l=n),v.prototype.getPropertyId=function(){return(t.color<<24)+this.slotIndex},v.prototype.setFrame=function(t,e,n,i,r,a){t*=v.ENTRIES,this.frames[t]=e,this.frames[t+v.R]=n,this.frames[t+v.G]=i,this.frames[t+v.B]=r,this.frames[t+v.A]=a},v.prototype.apply=function(t,e,n,i,r,a,s){var o=t.slots[this.slotIndex],h=this.frames;if(n=h[h.length-v.ENTRIES]?(c=h[(p=h.length)+v.PREV_R],d=h[p+v.PREV_G],f=h[p+v.PREV_B],m=h[p+v.PREV_A]):(c=h[(t=k.binarySearch(h,n,v.ENTRIES))+v.PREV_R],d=h[t+v.PREV_G],f=h[t+v.PREV_B],m=h[t+v.PREV_A],p=h[t],p=this.getCurvePercent(t/v.ENTRIES-1,1-(n-p)/(h[t+v.PREV_TIME]-p)),c+=(h[t+v.R]-c)*p,d+=(h[t+v.G]-d)*p,f+=(h[t+v.B]-f)*p,m+=(h[t+v.A]-m)*p),1==r?o.color.set(c,d,f,m):(l=o.color,a==N.setup&&l.setFromColor(o.data.color),l.add((c-l.r)*r,(d-l.g)*r,(f-l.b)*r,(m-l.a)*r))}},v.ENTRIES=5,v.PREV_TIME=-5,v.PREV_R=-4,v.PREV_G=-3,v.PREV_B=-2,v.PREV_A=-1,v.R=1,v.G=2,v.B=3,v.A=4,v);function v(t){var e=l.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*v.ENTRIES),e}V.ColorTimeline=s;var u,s=(__extends(w,u=n),w.prototype.getPropertyId=function(){return(t.twoColor<<24)+this.slotIndex},w.prototype.setFrame=function(t,e,n,i,r,a,s,o,h){t*=w.ENTRIES,this.frames[t]=e,this.frames[t+w.R]=n,this.frames[t+w.G]=i,this.frames[t+w.B]=r,this.frames[t+w.A]=a,this.frames[t+w.R2]=s,this.frames[t+w.G2]=o,this.frames[t+w.B2]=h},w.prototype.apply=function(t,e,n,i,r,a,s){var o=t.slots[this.slotIndex],h=this.frames;if(n=h[h.length-w.ENTRIES]?(f=h[(d=h.length)+w.PREV_R],m=h[d+w.PREV_G],g=h[d+w.PREV_B],v=h[d+w.PREV_A],y=h[d+w.PREV_R2],x=h[d+w.PREV_G2],E=h[d+w.PREV_B2]):(f=h[(t=k.binarySearch(h,n,w.ENTRIES))+w.PREV_R],m=h[t+w.PREV_G],g=h[t+w.PREV_B],v=h[t+w.PREV_A],y=h[t+w.PREV_R2],x=h[t+w.PREV_G2],E=h[t+w.PREV_B2],d=h[t],d=this.getCurvePercent(t/w.ENTRIES-1,1-(n-d)/(h[t+w.PREV_TIME]-d)),f+=(h[t+w.R]-f)*d,m+=(h[t+w.G]-m)*d,g+=(h[t+w.B]-g)*d,v+=(h[t+w.A]-v)*d,y+=(h[t+w.R2]-y)*d,x+=(h[t+w.G2]-x)*d,E+=(h[t+w.B2]-E)*d),1==r?(o.color.set(f,m,g,v),o.darkColor.set(y,x,E,1)):(l=o.color,u=o.darkColor,a==N.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((f-l.r)*r,(m-l.g)*r,(g-l.b)*r,(v-l.a)*r),u.add((y-u.r)*r,(x-u.g)*r,(E-u.b)*r,0))}},w.ENTRIES=8,w.PREV_TIME=-8,w.PREV_R=-7,w.PREV_G=-6,w.PREV_B=-5,w.PREV_A=-4,w.PREV_R2=-3,w.PREV_G2=-2,w.PREV_B2=-1,w.R=1,w.G=2,w.B=3,w.A=4,w.R2=5,w.G2=6,w.B2=7,w);function w(t){var e=u.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*w.ENTRIES),e}function p(t){this.frames=V.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}V.TwoColorTimeline=s,p.prototype.getPropertyId=function(){return(t.attachment<<24)+this.slotIndex},p.prototype.getFrameCount=function(){return this.frames.length},p.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},p.prototype.apply=function(t,e,n,i,r,a,s){var o,h=t.slots[this.slotIndex];s!=c.out||a!=N.setup?n<(s=this.frames)[0]?a==N.setup&&(a=h.data.attachmentName,h.setAttachment(null==a?null:t.getAttachment(this.slotIndex,a))):(o=0,o=n>=s[s.length-1]?s.length-1:k.binarySearch(s,n,1)-1,o=this.attachmentNames[o],t.slots[this.slotIndex].setAttachment(null==o?null:t.getAttachment(this.slotIndex,o))):(o=h.data.attachmentName,h.setAttachment(null==o?null:t.getAttachment(this.slotIndex,o)))},s=p,V.AttachmentTimeline=s;var x,E=null,s=(__extends(M,x=n),M.prototype.getPropertyId=function(){return(t.deform<<27)+ +this.attachment.id+this.slotIndex},M.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},M.prototype.apply=function(t,e,n,i,r,a,s){var o=t.slots[this.slotIndex],h=o.getAttachment();if(h instanceof V.VertexAttachment&&h.applyDeform(this.attachment)){var l=o.attachmentVertices;0==l.length&&(r=1);var u=this.frameVertices,p=u[0].length,t=this.frames;if(n=t[t.length-1]){var v=u[t.length-1];if(1==r)V.Utils.arrayCopy(v,0,g,0,p);else if(a==N.setup)if(null==(c=h).bones)for(var y=c.vertices,x=0;x=o[h-1])return;if(!(n=o[l];l++)i.push(this.events[l])}}},s=A,V.EventTimeline=s,T.prototype.getPropertyId=function(){return t.drawOrder<<24},T.prototype.getFrameCount=function(){return this.frames.length},T.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},T.prototype.apply=function(t,e,n,i,r,a,s){var o=t.drawOrder,h=t.slots;if(s!=c.out||a!=N.setup){s=this.frames;if(n=s[s.length-1]?s.length-1:k.binarySearch(s,n)-1,l=this.drawOrders[a];if(null==l)V.Utils.arrayCopy(h,0,o,0,h.length);else for(var u=0,p=l.length;u=l[l.length-R.ENTRIES]?a==N.setup?(u.mix=u.data.mix+(l[l.length+R.PREV_MIX]-u.data.mix)*r,u.bendDirection=s==c.out?u.data.bendDirection:l[l.length+R.PREV_BEND_DIRECTION]):(u.mix+=(l[l.length+R.PREV_MIX]-u.mix)*r,s==c.in&&(u.bendDirection=l[l.length+R.PREV_BEND_DIRECTION])):(h=l[(o=k.binarySearch(l,n,R.ENTRIES))+R.PREV_MIX],t=l[o],t=this.getCurvePercent(o/R.ENTRIES-1,1-(n-t)/(l[o+R.PREV_TIME]-t)),a==N.setup?(u.mix=u.data.mix+(h+(l[o+R.MIX]-h)*t-u.data.mix)*r,u.bendDirection=s==c.out?u.data.bendDirection:l[o+R.PREV_BEND_DIRECTION]):(u.mix+=(h+(l[o+R.MIX]-h)*t-u.mix)*r,s==c.in&&(u.bendDirection=l[o+R.PREV_BEND_DIRECTION])))},R.ENTRIES=3,R.PREV_TIME=-3,R.PREV_MIX=-2,R.PREV_BEND_DIRECTION=-1,R.MIX=1,R.BEND_DIRECTION=2,R);function R(t){var e=b.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*R.ENTRIES),e}V.IkConstraintTimeline=s;var I,s=(__extends(S,I=n),S.prototype.getPropertyId=function(){return(t.transformConstraint<<24)+this.transformConstraintIndex},S.prototype.setFrame=function(t,e,n,i,r,a){t*=S.ENTRIES,this.frames[t]=e,this.frames[t+S.ROTATE]=n,this.frames[t+S.TRANSLATE]=i,this.frames[t+S.SCALE]=r,this.frames[t+S.SHEAR]=a},S.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(n=o[o.length-S.ENTRIES]?(p=o[(u=o.length)+S.PREV_ROTATE],c=o[u+S.PREV_TRANSLATE],d=o[u+S.PREV_SCALE],f=o[u+S.PREV_SHEAR]):(p=o[(t=k.binarySearch(o,n,S.ENTRIES))+S.PREV_ROTATE],c=o[t+S.PREV_TRANSLATE],d=o[t+S.PREV_SCALE],f=o[t+S.PREV_SHEAR],u=o[t],u=this.getCurvePercent(t/S.ENTRIES-1,1-(n-u)/(o[t+S.PREV_TIME]-u)),p+=(o[t+S.ROTATE]-p)*u,c+=(o[t+S.TRANSLATE]-c)*u,d+=(o[t+S.SCALE]-d)*u,f+=(o[t+S.SHEAR]-f)*u),a==N.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(c-l.translateMix)*r,h.scaleMix=l.scaleMix+(d-l.scaleMix)*r,h.shearMix=l.shearMix+(f-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r,h.scaleMix+=(d-h.scaleMix)*r,h.shearMix+=(f-h.shearMix)*r)}},S.ENTRIES=5,S.PREV_TIME=-5,S.PREV_ROTATE=-4,S.PREV_TRANSLATE=-3,S.PREV_SCALE=-2,S.PREV_SHEAR=-1,S.ROTATE=1,S.TRANSLATE=2,S.SCALE=3,S.SHEAR=4,S);function S(t){var e=I.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*S.ENTRIES),e}V.TransformConstraintTimeline=s;var C,s=(__extends(_,C=n),_.prototype.getPropertyId=function(){return(t.pathConstraintPosition<<24)+this.pathConstraintIndex},_.prototype.setFrame=function(t,e,n){t*=_.ENTRIES,this.frames[t]=e,this.frames[t+_.VALUE]=n},_.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(n=o[o.length-_.ENTRIES]?u=o[o.length+_.PREV_VALUE]:(u=o[(l=k.binarySearch(o,n,_.ENTRIES))+_.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/_.ENTRIES-1,1-(n-t)/(o[l+_.PREV_TIME]-t)),u+=(o[l+_.VALUE]-u)*t),a==N.setup?h.position=h.data.position+(u-h.data.position)*r:h.position+=(u-h.position)*r}},_.ENTRIES=2,_.PREV_TIME=-2,_.PREV_VALUE=-1,_.VALUE=1,_);function _(t){var e=C.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*_.ENTRIES),e}V.PathConstraintPositionTimeline=s;var P,s=(__extends(D,P=s),D.prototype.getPropertyId=function(){return(t.pathConstraintSpacing<<24)+this.pathConstraintIndex},D.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(n=o[o.length-D.ENTRIES]?u=o[o.length+D.PREV_VALUE]:(u=o[(l=k.binarySearch(o,n,D.ENTRIES))+D.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/D.ENTRIES-1,1-(n-t)/(o[l+D.PREV_TIME]-t)),u+=(o[l+D.VALUE]-u)*t),a==N.setup?h.spacing=h.data.spacing+(u-h.data.spacing)*r:h.spacing+=(u-h.spacing)*r}},D);function D(t){return P.call(this,t)||this}V.PathConstraintSpacingTimeline=s;var L,n=(__extends(Y,L=n),Y.prototype.getPropertyId=function(){return(t.pathConstraintMix<<24)+this.pathConstraintIndex},Y.prototype.setFrame=function(t,e,n,i){t*=Y.ENTRIES,this.frames[t]=e,this.frames[t+Y.ROTATE]=n,this.frames[t+Y.TRANSLATE]=i},Y.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(n=o[o.length-Y.ENTRIES]?(u=o[o.length+Y.PREV_ROTATE],p=o[o.length+Y.PREV_TRANSLATE]):(u=o[(l=k.binarySearch(o,n,Y.ENTRIES))+Y.PREV_ROTATE],p=o[l+Y.PREV_TRANSLATE],t=o[l],t=this.getCurvePercent(l/Y.ENTRIES-1,1-(n-t)/(o[l+Y.PREV_TIME]-t)),u+=(o[l+Y.ROTATE]-u)*t,p+=(o[l+Y.TRANSLATE]-p)*t),a==N.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(p-h.data.translateMix)*r):(h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(p-h.translateMix)*r)}},Y.ENTRIES=3,Y.PREV_TIME=-3,Y.PREV_ROTATE=-2,Y.PREV_TRANSLATE=-1,Y.ROTATE=1,Y.TRANSLATE=2,Y);function Y(t){var e=L.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*Y.ENTRIES),e}V.PathConstraintMixTimeline=n}(spine=spine||{}),function(A){var f=(T.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null;null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}}this.queue.drain()},T.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,0=t.mixDuration||0==t.timeScale)?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e*t.timeScale,!1)},T.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,i=!1,r=0,a=n.length;r=s.trackEnd&&null==s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),p=s.animation.timelines.length,c=s.animation.timelines;if(1==h)for(var d=0;d=T.FIRST?A.MixPose.setup:o;v instanceof A.RotateTimeline?this.applyRotateTimeline(v,t,u,h,y,g,d<<1,m):(A.Utils.webkit602BugfixHelper(h,y),v.apply(t,l,u,e,h,y,A.MixDirection.in))}}this.queueEvents(s,u),e.length=0,s.nextAnimationLast=u,s.nextTrackLast=s.trackTime}}return this.queue.drain(),i},T.prototype.applyMixingFrom=function(t,e,n){var i=t.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,e,n);var r=0;0==t.mixDuration?(r=1,n=A.MixPose.setup):1<(r=t.mixTime/t.mixDuration)&&(r=1);var a=r=u[u.length-A.RotateTimeline.ENTRIES]?m=l.data.rotation+u[u.length+A.RotateTimeline.PREV_ROTATION]:(d=u[(c=A.Animation.binarySearch(u,n,A.RotateTimeline.ENTRIES))+A.RotateTimeline.PREV_ROTATION],p=u[c],f=h.getCurvePercent((c>>1)-1,1-(n-p)/(u[c+A.RotateTimeline.PREV_TIME]-p)),m=u[c+A.RotateTimeline.ROTATION]-d,m=d+(m-=360*(16384-(16384.499999999996-m/360|0)))*f+l.data.rotation,m-=360*(16384-(16384.499999999996-m/360|0))),(p=0)==(c=m-(u=(r==A.MixPose.setup?l.data:l).rotation))?p=a[s]:(c-=360*(16384-(16384.499999999996-c/360|0)),f=d=0,f=o?(d=0,c):(d=a[s],a[s+1]),m=0i||this.queue.event(t,l)}for((t.loop?0==r||a>t.trackTime%r:i<=e&&t.animationLast=this.tracks.length)){t=this.tracks[t];if(null!=t){this.queue.end(t),this.disposeNext(t);for(var e=t;;){var n=e.mixingFrom;if(null==n)break;this.queue.end(n),e.mixingFrom=null,e=n}this.tracks[t.trackIndex]=null,this.queue.drain()}}},T.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,e.mixTime=0,null!=i.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},T.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},T.prototype.removeListener=function(t){t=this.listeners.indexOf(t);0<=t&&this.listeners.splice(t,1)},T.prototype.clearListeners=function(){this.listeners.length=0},T.prototype.clearListenerNotifications=function(){this.queue.clear()},T.emptyAnimation=new A.Animation("",[],0),T.SUBSEQUENT=0,T.FIRST=1,T.DIP=2,T.DIP_MIX=3,T);function T(t){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new n(this),this.propertyIDs=new A.IntSet,this.mixingTo=new Array,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new A.Pool(function(){return new e}),this.data=t}A.AnimationState=f;var e=(t.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},t.prototype.setTimelineData=function(t,e,n){null!=t&&e.push(t);var i=null!=this.mixingFrom?this.mixingFrom.setTimelineData(this,e,n):this;null!=t&&e.pop();var r=e,a=e.length-1,s=this.animation.timelines,o=this.animation.timelines.length,h=A.Utils.setArraySize(this.timelineData,o);this.timelineDipMix.length=0;var l=A.Utils.setArraySize(this.timelineDipMix,o);t:for(var u=0;u=this.animationEnd-this.animationStart},t.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},t);function t(){this.timelineData=new Array,this.timelineDipMix=new Array,this.timelinesRotation=new Array}A.TrackEntry=e;var o,n=(i.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},i.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},i.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},i.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},i.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},i.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},i.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}var i;t.BoneData=e,(t=i=t.TransformMode||(t.TransformMode={}))[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(spine=spine||{}),(spine||(spine={})).Event=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e},(spine||(spine={})).EventData=function(t){this.name=t},function(j){var t=(e.prototype.getOrder=function(){return this.data.order},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}},e.prototype.apply1=function(t,e,n,i){t.appliedValid||t.updateAppliedTransform();var r=t.parent,a=1/(r.a*r.d-r.b*r.c),s=e-r.worldX,e=n-r.worldY,n=(s*r.d-e*r.b)*a-t.ax,a=(e*r.a-s*r.c)*a-t.ay,n=Math.atan2(a,n)*j.MathUtils.radDeg-t.ashearX-t.arotation;t.ascaleX<0&&(n+=180),180Z.MathUtils.PI?L-=Z.MathUtils.PI2:L<-Z.MathUtils.PI&&(L+=Z.MathUtils.PI2),L*=e,N=Math.cos(L),k=Math.sin(L),b.a=N*C-k*P,b.b=N*_-k*V,b.c=k*C+N*P,b.d=k*_+N*V),b.appliedValid=!1}}}},H.prototype.computeWorldPositions=function(t,e,n,i,r){var a=this.target,s=this.position,o=this.spaces,h=Z.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,p=t.worldVerticesLength,c=p/6,d=H.NONE;if(!t.constantSpeed){var f=t.lengths,m=f[c-=u?1:2];if(i&&(s*=m),r)for(var g=0;g=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=a&&i<=a||s<=t&&s<=n||o<=e&&o<=i)return!1;i=(i-e)/(n-t),n=i*(r-t)+e;if(at.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,i=0,r=n.length;i>1,U=this.clipOutput,F=j.Utils.setArraySize(l,_+Y*d),X=0;X>1;s=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},n.prototype.getAttachment=function(t,e){t=this.attachments[t];return t?t[e]:null},n.prototype.attachAll=function(t,e){for(var n=0,i=0;i= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}i.SlotData=t}(spine=spine||{}),function(t){var e,n,i=(r.prototype.getImage=function(){return this._image},r.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)}},r.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)}},r);function r(t){this._image=t}t.Texture=i,(i=e=t.TextureFilter||(t.TextureFilter={}))[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.MipMap=9987]="MipMap",i[i.MipMapNearestNearest=9984]="MipMapNearestNearest",i[i.MipMapLinearNearest=9985]="MipMapLinearNearest",i[i.MipMapNearestLinear=9986]="MipMapNearestLinear",i[i.MipMapLinearLinear=9987]="MipMapLinearLinear",(i=n=t.TextureWrap||(t.TextureWrap={}))[i.MirroredRepeat=33648]="MirroredRepeat",i[i.ClampToEdge=33071]="ClampToEdge",i[i.Repeat=10497]="Repeat",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,i=(a=t.Texture,__extends(s,a),s.prototype.setFilters=function(t,e){},s.prototype.setWraps=function(t,e){},s.prototype.dispose=function(){},s);function s(){return null!==a&&a.apply(this,arguments)||this}t.FakeTexture=i}(spine=spine||{}),function(p){var t=(e.prototype.load=function(t,e){if(null==e)throw new Error("textureLoader cannot be null.");for(var n=new c(t),i=new Array(4),r=null;;){var a,s,o,h,l,u=n.readLine();if(null==u)break;0==(u=u.trim()).length?r=null:r?((l=new f).name=u,l.page=r,l.rotate="true"==n.readValue(),n.readTuple(i),a=parseInt(i[0]),s=parseInt(i[1]),n.readTuple(i),o=parseInt(i[0]),h=parseInt(i[1]),l.u=a/r.width,l.v=s/r.height,l.rotate?(l.u2=(a+h)/r.width,l.v2=(s+o)/r.height):(l.u2=(a+o)/r.width,l.v2=(s+h)/r.height),l.x=a,l.y=s,l.width=Math.abs(o),l.height=Math.abs(h),4==n.readTuple(i)&&4==n.readTuple(i)&&n.readTuple(i),l.originalWidth=parseInt(i[0]),l.originalHeight=parseInt(i[1]),n.readTuple(i),l.offsetX=parseInt(i[0]),l.offsetY=parseInt(i[1]),l.index=parseInt(n.readValue()),l.texture=r.texture,this.regions.push(l)):((r=new d).name=u,2==n.readTuple(i)&&(r.width=parseInt(i[0]),r.height=parseInt(i[1]),n.readTuple(i)),n.readTuple(i),r.minFilter=p.Texture.filterFromString(i[0]),r.magFilter=p.Texture.filterFromString(i[1]),l=n.readValue(),r.uWrap=p.TextureWrap.ClampToEdge,r.vWrap=p.TextureWrap.ClampToEdge,"x"==l?r.uWrap=p.TextureWrap.Repeat:"y"==l?r.vWrap=p.TextureWrap.Repeat:"xy"==l&&(r.uWrap=r.vWrap=p.TextureWrap.Repeat),r.texture=e(u),r.texture.setFilters(r.minFilter,r.magFilter),r.texture.setWraps(r.uWrap,r.vWrap),r.width=r.texture.getImage().width,r.height=r.texture.getImage().height,this.pages.push(r))}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},n.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()},n.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var a=e.indexOf(",",r);if(-1==a)break;t[i]=e.substr(r,a-r).trim(),r=a+1}return t[i]=e.substring(r).trim(),i+1},n);function n(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var d=function(){};p.TextureAtlasPage=d;var i,f=(i=p.TextureRegion,__extends(r,i),r);function r(){return null!==i&&i.apply(this,arguments)||this}p.TextureAtlasRegion=f}(spine=spine||{}),function(R){var t=(e.prototype.apply=function(){this.update()},e.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,a=r.a,s=r.b,o=r.c,h=r.d,l=0R.MathUtils.PI?M-=R.MathUtils.PI2:M<-R.MathUtils.PI&&(M+=R.MathUtils.PI2),M*=t,y=Math.cos(M),v=Math.sin(M),T.a=y*m-v*g,T.b=y*x-v*E,T.c=v*m+y*g,T.d=v*x+y*E,b=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),T.worldX+=(y.x-T.worldX)*e,T.worldY+=(y.y-T.worldY)*e,b=!0),0R.MathUtils.PI?M-=R.MathUtils.PI2:M<-R.MathUtils.PI&&(M+=R.MathUtils.PI2),M=w+(M+p)*i,A=Math.sqrt(x*x+E*E),T.b=Math.cos(M)*A,T.d=Math.sin(M)*A,b=!0),b&&(T.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,a=r.a,s=r.b,o=r.c,h=r.d,l=0R.MathUtils.PI?x-=R.MathUtils.PI2:x<-R.MathUtils.PI&&(x+=R.MathUtils.PI2),x*=t,y=Math.cos(x),v=Math.sin(x),A.a=y*m-v*g,A.b=y*E-v*w,A.c=v*m+y*g,A.d=v*E+y*w,T=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),A.worldX+=y.x*e,A.worldY+=y.y*e,T=!0),0R.MathUtils.PI?x-=R.MathUtils.PI2:x<-R.MathUtils.PI&&(x+=R.MathUtils.PI2),E=A.b,w=A.d,x=Math.atan2(w,E)+(x-R.MathUtils.PI/2+p)*i,M=Math.sqrt(E*E+w*w),A.b=Math.cos(x)*M,A.d=Math.sin(x)*M,T=!0),T&&(A.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var a=this.bones,s=0,o=a.length;s>1,i=this.indicesArray,r=i.length=0;r=e?t:u.setArraySize(t,e,n)},u.newArray=function(t,e){for(var n=new Array(t),i=0;ithis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},m.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},m.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*a;var s=t.bone.skeleton,o=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,p=0,c=0;ca[o]?1:-1}return r.length!=a.length?-1:0}function a(t){this._image={width:t.width,height:t.height},this.pcTexture=t}var o=0,h=1,l=2,n={9728:pc.FILTER_NEAREST,9729:pc.FILTER_LINEAR,9984:pc.FILTER_NEAREST_MIPMAP_NEAREST,9985:pc.FILTER_LINEAR_MIPMAP_NEAREST,9986:pc.FILTER_NEAREST_MIPMAP_LINEAR,9987:pc.FILTER_LINEAR_MIPMAP_LINEAR},i={33648:pc.ADDRESS_MIRRORED_REPEAT,33071:pc.ADDRESS_CLAMP_TO_EDGE,10487:pc.ADDRESS_REPEAT},u=[0,1,2,2,3,0];a.prototype={setFilters:function(t,e){this.pcTexture.minFilter=n[t],this.pcTexture.magFilter=n[e]},setWraps:function(t,e){this.pcTexture.addressU=i[t],this.pcTexture.addressV=i[e]},getImage:function(){return this._image}};function t(t,e,n,i){this._app=t,this._position=new pc.Vec3,e=new spine.TextureAtlas(e,function(t){return new a(i[t])}),(e=new spine.SkeletonJson(new spine.AtlasAttachmentLoader(e))).scale*=.01,n=e.readSkeletonData(n),this.skeletonVersion=n.version,this._spine_3_6_0=r(this.skeletonVersion,"3.6.0")<=0,this._spine_3_7_99=r(this.skeletonVersion,"3.7.99")<=0,this.skeleton=new spine.Skeleton(n),this.skeleton.updateWorldTransform(),this.stateData=new spine.AnimationStateData(this.skeleton.data),this.states=[new spine.AnimationState(this.stateData)],this.clipper=new spine.SkeletonClipping,this._node=new pc.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new pc.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new pc.Vec2,this._aabbTempSize=new pc.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[pc.LAYERID_UI],this.init(),this.autoUpdate=!0,this._hidden=!1}return t.prototype.destroy=function(){this.removeFromLayers();for(var t=0;t>>1;;){if(t[(a+1)*n]<=e?i=a+1:r=a,i==r)return(i+1)*n;a=i+r>>>1}},e.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;return-1},e);function e(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}V.Animation=k,(n=N=V.MixPose||(V.MixPose={}))[n.setup=0]="setup",n[n.current=1]="current",n[n.currentLayered=2]="currentLayered",(r=c=V.MixDirection||(V.MixDirection={}))[r.in=0]="in",r[r.out=1]="out",(s=t=V.TimelineType||(V.TimelineType={}))[s.rotate=0]="rotate",s[s.translate=1]="translate",s[s.scale=2]="scale",s[s.shear=3]="shear",s[s.attachment=4]="attachment",s[s.color=5]="color",s[s.deform=6]="deform",s[s.event=7]="event",s[s.drawOrder=8]="drawOrder",s[s.ikConstraint=9]="ikConstraint",s[s.transformConstraint=10]="transformConstraint",s[s.pathConstraintPosition=11]="pathConstraintPosition",s[s.pathConstraintSpacing=12]="pathConstraintSpacing",s[s.pathConstraintMix=13]="pathConstraintMix",s[s.twoColor=14]="twoColor";var n=(y.prototype.getFrameCount=function(){return this.curves.length/y.BEZIER_SIZE+1},y.prototype.setLinear=function(t){this.curves[t*y.BEZIER_SIZE]=y.LINEAR},y.prototype.setStepped=function(t){this.curves[t*y.BEZIER_SIZE]=y.STEPPED},y.prototype.getCurveType=function(t){t*=y.BEZIER_SIZE;if(t==this.curves.length)return y.LINEAR;t=this.curves[t];return t==y.LINEAR?y.LINEAR:t==y.STEPPED?y.STEPPED:y.BEZIER},y.prototype.setCurve=function(t,e,n,i,r){var a=.03*(2*-e+i),s=.03*(2*-n+r),o=.006*(3*(e-i)+1),h=.006*(3*(n-r)+1),l=2*a+o,u=2*s+h,p=.3*e+a+.16666667*o,c=.3*n+s+.16666667*h,d=t*y.BEZIER_SIZE,f=this.curves;f[d++]=y.BEZIER;for(var m=p,g=c,v=d+y.BEZIER_SIZE-1;d 0: "+t);this.curves=V.Utils.newFloatArray((t-1)*y.BEZIER_SIZE)}V.CurveTimeline=n;var i,r=(__extends(d,i=n),d.prototype.getPropertyId=function(){return(t.rotate<<24)+this.boneIndex},d.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+d.ROTATION]=n},d.prototype.apply=function(t,e,n,i,r,a,s){var o,h,l=this.frames,u=t.bones[this.boneIndex];if(n=l[l.length-d.ENTRIES]?a==N.setup?u.rotation=u.data.rotation+l[l.length+d.PREV_ROTATION]*r:(o=u.data.rotation+l[l.length+d.PREV_ROTATION]-u.rotation,o-=360*(16384-(16384.499999999996-o/360|0)),u.rotation+=o*r):(t=l[(h=k.binarySearch(l,n,d.ENTRIES))+d.PREV_ROTATION],o=l[h],o=this.getCurvePercent((h>>1)-1,1-(n-o)/(l[h+d.PREV_TIME]-o)),h=l[h+d.ROTATION]-t,h=t+(h-=360*(16384-(16384.499999999996-h/360|0)))*o,a==N.setup?(h-=360*(16384-(16384.499999999996-h/360|0)),u.rotation=u.data.rotation+h*r):(h=u.data.rotation+h-u.rotation,h-=360*(16384-(16384.499999999996-h/360|0)),u.rotation+=h*r))},d.ENTRIES=2,d.PREV_TIME=-2,d.PREV_ROTATION=-1,d.ROTATION=1,d);function d(t){var e=i.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t<<1),e}V.RotateTimeline=r;var a,s=(__extends(f,a=n),f.prototype.getPropertyId=function(){return(t.translate<<24)+this.boneIndex},f.prototype.setFrame=function(t,e,n,i){t*=f.ENTRIES,this.frames[t]=e,this.frames[t+f.X]=n,this.frames[t+f.Y]=i},f.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.bones[this.boneIndex];if(n=o[o.length-f.ENTRIES]?(u=o[o.length+f.PREV_X],p=o[o.length+f.PREV_Y]):(u=o[(l=k.binarySearch(o,n,f.ENTRIES))+f.PREV_X],p=o[l+f.PREV_Y],t=o[l],t=this.getCurvePercent(l/f.ENTRIES-1,1-(n-t)/(o[l+f.PREV_TIME]-t)),u+=(o[l+f.X]-u)*t,p+=(o[l+f.Y]-p)*t),a==N.setup?(h.x=h.data.x+u*r,h.y=h.data.y+p*r):(h.x+=(h.data.x+u-h.x)*r,h.y+=(h.data.y+p-h.y)*r)}},f.ENTRIES=3,f.PREV_TIME=-3,f.PREV_X=-2,f.PREV_Y=-1,f.X=1,f.Y=2,f);function f(t){var e=a.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*f.ENTRIES),e}V.TranslateTimeline=s;var o,r=(__extends(m,o=s),m.prototype.getPropertyId=function(){return(t.scale<<24)+this.boneIndex},m.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.bones[this.boneIndex];if(n=o[o.length-m.ENTRIES]?(p=o[o.length+m.PREV_X]*h.data.scaleX,o[o.length+m.PREV_Y]*h.data.scaleY):(p=o[(l=k.binarySearch(o,n,m.ENTRIES))+m.PREV_X],t=o[l+m.PREV_Y],u=o[l],u=this.getCurvePercent(l/m.ENTRIES-1,1-(n-u)/(o[l+m.PREV_TIME]-u)),p=(p+(o[l+m.X]-p)*u)*h.data.scaleX,(t+(o[l+m.Y]-t)*u)*h.data.scaleY),1==r?(h.scaleX=p,h.scaleY=t):(u=l=0,u=a==N.setup?(l=h.data.scaleX,h.data.scaleY):(l=h.scaleX,h.scaleY),s==c.out?(p=Math.abs(p)*V.MathUtils.signum(l),t=Math.abs(t)*V.MathUtils.signum(u)):(l=Math.abs(l)*V.MathUtils.signum(p),u=Math.abs(u)*V.MathUtils.signum(t)),h.scaleX=l+(p-l)*r,h.scaleY=u+(t-u)*r)}},m);function m(t){return o.call(this,t)||this}V.ScaleTimeline=r;var h,s=(__extends(g,h=s),g.prototype.getPropertyId=function(){return(t.shear<<24)+this.boneIndex},g.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.bones[this.boneIndex];if(n=o[o.length-g.ENTRIES]?(u=o[o.length+g.PREV_X],p=o[o.length+g.PREV_Y]):(u=o[(l=k.binarySearch(o,n,g.ENTRIES))+g.PREV_X],p=o[l+g.PREV_Y],t=o[l],t=this.getCurvePercent(l/g.ENTRIES-1,1-(n-t)/(o[l+g.PREV_TIME]-t)),u+=(o[l+g.X]-u)*t,p+=(o[l+g.Y]-p)*t),a==N.setup?(h.shearX=h.data.shearX+u*r,h.shearY=h.data.shearY+p*r):(h.shearX+=(h.data.shearX+u-h.shearX)*r,h.shearY+=(h.data.shearY+p-h.shearY)*r)}},g);function g(t){return h.call(this,t)||this}V.ShearTimeline=s;var l,s=(__extends(v,l=n),v.prototype.getPropertyId=function(){return(t.color<<24)+this.slotIndex},v.prototype.setFrame=function(t,e,n,i,r,a){t*=v.ENTRIES,this.frames[t]=e,this.frames[t+v.R]=n,this.frames[t+v.G]=i,this.frames[t+v.B]=r,this.frames[t+v.A]=a},v.prototype.apply=function(t,e,n,i,r,a,s){var o=t.slots[this.slotIndex],h=this.frames;if(n=h[h.length-v.ENTRIES]?(c=h[(p=h.length)+v.PREV_R],d=h[p+v.PREV_G],f=h[p+v.PREV_B],m=h[p+v.PREV_A]):(c=h[(t=k.binarySearch(h,n,v.ENTRIES))+v.PREV_R],d=h[t+v.PREV_G],f=h[t+v.PREV_B],m=h[t+v.PREV_A],p=h[t],p=this.getCurvePercent(t/v.ENTRIES-1,1-(n-p)/(h[t+v.PREV_TIME]-p)),c+=(h[t+v.R]-c)*p,d+=(h[t+v.G]-d)*p,f+=(h[t+v.B]-f)*p,m+=(h[t+v.A]-m)*p),1==r?o.color.set(c,d,f,m):(l=o.color,a==N.setup&&l.setFromColor(o.data.color),l.add((c-l.r)*r,(d-l.g)*r,(f-l.b)*r,(m-l.a)*r))}},v.ENTRIES=5,v.PREV_TIME=-5,v.PREV_R=-4,v.PREV_G=-3,v.PREV_B=-2,v.PREV_A=-1,v.R=1,v.G=2,v.B=3,v.A=4,v);function v(t){var e=l.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*v.ENTRIES),e}V.ColorTimeline=s;var u,s=(__extends(w,u=n),w.prototype.getPropertyId=function(){return(t.twoColor<<24)+this.slotIndex},w.prototype.setFrame=function(t,e,n,i,r,a,s,o,h){t*=w.ENTRIES,this.frames[t]=e,this.frames[t+w.R]=n,this.frames[t+w.G]=i,this.frames[t+w.B]=r,this.frames[t+w.A]=a,this.frames[t+w.R2]=s,this.frames[t+w.G2]=o,this.frames[t+w.B2]=h},w.prototype.apply=function(t,e,n,i,r,a,s){var o=t.slots[this.slotIndex],h=this.frames;if(n=h[h.length-w.ENTRIES]?(f=h[(d=h.length)+w.PREV_R],m=h[d+w.PREV_G],g=h[d+w.PREV_B],v=h[d+w.PREV_A],y=h[d+w.PREV_R2],x=h[d+w.PREV_G2],E=h[d+w.PREV_B2]):(f=h[(t=k.binarySearch(h,n,w.ENTRIES))+w.PREV_R],m=h[t+w.PREV_G],g=h[t+w.PREV_B],v=h[t+w.PREV_A],y=h[t+w.PREV_R2],x=h[t+w.PREV_G2],E=h[t+w.PREV_B2],d=h[t],d=this.getCurvePercent(t/w.ENTRIES-1,1-(n-d)/(h[t+w.PREV_TIME]-d)),f+=(h[t+w.R]-f)*d,m+=(h[t+w.G]-m)*d,g+=(h[t+w.B]-g)*d,v+=(h[t+w.A]-v)*d,y+=(h[t+w.R2]-y)*d,x+=(h[t+w.G2]-x)*d,E+=(h[t+w.B2]-E)*d),1==r?(o.color.set(f,m,g,v),o.darkColor.set(y,x,E,1)):(l=o.color,u=o.darkColor,a==N.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((f-l.r)*r,(m-l.g)*r,(g-l.b)*r,(v-l.a)*r),u.add((y-u.r)*r,(x-u.g)*r,(E-u.b)*r,0))}},w.ENTRIES=8,w.PREV_TIME=-8,w.PREV_R=-7,w.PREV_G=-6,w.PREV_B=-5,w.PREV_A=-4,w.PREV_R2=-3,w.PREV_G2=-2,w.PREV_B2=-1,w.R=1,w.G=2,w.B=3,w.A=4,w.R2=5,w.G2=6,w.B2=7,w);function w(t){var e=u.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*w.ENTRIES),e}function p(t){this.frames=V.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}V.TwoColorTimeline=s,p.prototype.getPropertyId=function(){return(t.attachment<<24)+this.slotIndex},p.prototype.getFrameCount=function(){return this.frames.length},p.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},p.prototype.apply=function(t,e,n,i,r,a,s){var o,h=t.slots[this.slotIndex];s!=c.out||a!=N.setup?n<(s=this.frames)[0]?a==N.setup&&(a=h.data.attachmentName,h.setAttachment(null==a?null:t.getAttachment(this.slotIndex,a))):(o=0,o=n>=s[s.length-1]?s.length-1:k.binarySearch(s,n,1)-1,o=this.attachmentNames[o],t.slots[this.slotIndex].setAttachment(null==o?null:t.getAttachment(this.slotIndex,o))):(o=h.data.attachmentName,h.setAttachment(null==o?null:t.getAttachment(this.slotIndex,o)))},s=p,V.AttachmentTimeline=s;var x,E=null,s=(__extends(M,x=n),M.prototype.getPropertyId=function(){return(t.deform<<27)+ +this.attachment.id+this.slotIndex},M.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},M.prototype.apply=function(t,e,n,i,r,a,s){var o=t.slots[this.slotIndex],h=o.getAttachment();if(h instanceof V.VertexAttachment&&h.applyDeform(this.attachment)){var l=o.attachmentVertices;0==l.length&&(r=1);var u=this.frameVertices,p=u[0].length,t=this.frames;if(n=t[t.length-1]){var v=u[t.length-1];if(1==r)V.Utils.arrayCopy(v,0,g,0,p);else if(a==N.setup)if(null==(c=h).bones)for(var y=c.vertices,x=0;x=o[h-1])return;if(!(n=o[l];l++)i.push(this.events[l])}}},s=A,V.EventTimeline=s,T.prototype.getPropertyId=function(){return t.drawOrder<<24},T.prototype.getFrameCount=function(){return this.frames.length},T.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},T.prototype.apply=function(t,e,n,i,r,a,s){var o=t.drawOrder,h=t.slots;if(s!=c.out||a!=N.setup){s=this.frames;if(n=s[s.length-1]?s.length-1:k.binarySearch(s,n)-1,l=this.drawOrders[a];if(null==l)V.Utils.arrayCopy(h,0,o,0,h.length);else for(var u=0,p=l.length;u=l[l.length-R.ENTRIES]?a==N.setup?(u.mix=u.data.mix+(l[l.length+R.PREV_MIX]-u.data.mix)*r,u.bendDirection=s==c.out?u.data.bendDirection:l[l.length+R.PREV_BEND_DIRECTION]):(u.mix+=(l[l.length+R.PREV_MIX]-u.mix)*r,s==c.in&&(u.bendDirection=l[l.length+R.PREV_BEND_DIRECTION])):(h=l[(o=k.binarySearch(l,n,R.ENTRIES))+R.PREV_MIX],t=l[o],t=this.getCurvePercent(o/R.ENTRIES-1,1-(n-t)/(l[o+R.PREV_TIME]-t)),a==N.setup?(u.mix=u.data.mix+(h+(l[o+R.MIX]-h)*t-u.data.mix)*r,u.bendDirection=s==c.out?u.data.bendDirection:l[o+R.PREV_BEND_DIRECTION]):(u.mix+=(h+(l[o+R.MIX]-h)*t-u.mix)*r,s==c.in&&(u.bendDirection=l[o+R.PREV_BEND_DIRECTION])))},R.ENTRIES=3,R.PREV_TIME=-3,R.PREV_MIX=-2,R.PREV_BEND_DIRECTION=-1,R.MIX=1,R.BEND_DIRECTION=2,R);function R(t){var e=b.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*R.ENTRIES),e}V.IkConstraintTimeline=s;var I,s=(__extends(S,I=n),S.prototype.getPropertyId=function(){return(t.transformConstraint<<24)+this.transformConstraintIndex},S.prototype.setFrame=function(t,e,n,i,r,a){t*=S.ENTRIES,this.frames[t]=e,this.frames[t+S.ROTATE]=n,this.frames[t+S.TRANSLATE]=i,this.frames[t+S.SCALE]=r,this.frames[t+S.SHEAR]=a},S.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(n=o[o.length-S.ENTRIES]?(p=o[(u=o.length)+S.PREV_ROTATE],c=o[u+S.PREV_TRANSLATE],d=o[u+S.PREV_SCALE],f=o[u+S.PREV_SHEAR]):(p=o[(t=k.binarySearch(o,n,S.ENTRIES))+S.PREV_ROTATE],c=o[t+S.PREV_TRANSLATE],d=o[t+S.PREV_SCALE],f=o[t+S.PREV_SHEAR],u=o[t],u=this.getCurvePercent(t/S.ENTRIES-1,1-(n-u)/(o[t+S.PREV_TIME]-u)),p+=(o[t+S.ROTATE]-p)*u,c+=(o[t+S.TRANSLATE]-c)*u,d+=(o[t+S.SCALE]-d)*u,f+=(o[t+S.SHEAR]-f)*u),a==N.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(c-l.translateMix)*r,h.scaleMix=l.scaleMix+(d-l.scaleMix)*r,h.shearMix=l.shearMix+(f-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r,h.scaleMix+=(d-h.scaleMix)*r,h.shearMix+=(f-h.shearMix)*r)}},S.ENTRIES=5,S.PREV_TIME=-5,S.PREV_ROTATE=-4,S.PREV_TRANSLATE=-3,S.PREV_SCALE=-2,S.PREV_SHEAR=-1,S.ROTATE=1,S.TRANSLATE=2,S.SCALE=3,S.SHEAR=4,S);function S(t){var e=I.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*S.ENTRIES),e}V.TransformConstraintTimeline=s;var C,s=(__extends(_,C=n),_.prototype.getPropertyId=function(){return(t.pathConstraintPosition<<24)+this.pathConstraintIndex},_.prototype.setFrame=function(t,e,n){t*=_.ENTRIES,this.frames[t]=e,this.frames[t+_.VALUE]=n},_.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(n=o[o.length-_.ENTRIES]?u=o[o.length+_.PREV_VALUE]:(u=o[(l=k.binarySearch(o,n,_.ENTRIES))+_.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/_.ENTRIES-1,1-(n-t)/(o[l+_.PREV_TIME]-t)),u+=(o[l+_.VALUE]-u)*t),a==N.setup?h.position=h.data.position+(u-h.data.position)*r:h.position+=(u-h.position)*r}},_.ENTRIES=2,_.PREV_TIME=-2,_.PREV_VALUE=-1,_.VALUE=1,_);function _(t){var e=C.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*_.ENTRIES),e}V.PathConstraintPositionTimeline=s;var P,s=(__extends(D,P=s),D.prototype.getPropertyId=function(){return(t.pathConstraintSpacing<<24)+this.pathConstraintIndex},D.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(n=o[o.length-D.ENTRIES]?u=o[o.length+D.PREV_VALUE]:(u=o[(l=k.binarySearch(o,n,D.ENTRIES))+D.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/D.ENTRIES-1,1-(n-t)/(o[l+D.PREV_TIME]-t)),u+=(o[l+D.VALUE]-u)*t),a==N.setup?h.spacing=h.data.spacing+(u-h.data.spacing)*r:h.spacing+=(u-h.spacing)*r}},D);function D(t){return P.call(this,t)||this}V.PathConstraintSpacingTimeline=s;var L,n=(__extends(Y,L=n),Y.prototype.getPropertyId=function(){return(t.pathConstraintMix<<24)+this.pathConstraintIndex},Y.prototype.setFrame=function(t,e,n,i){t*=Y.ENTRIES,this.frames[t]=e,this.frames[t+Y.ROTATE]=n,this.frames[t+Y.TRANSLATE]=i},Y.prototype.apply=function(t,e,n,i,r,a,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(n=o[o.length-Y.ENTRIES]?(u=o[o.length+Y.PREV_ROTATE],p=o[o.length+Y.PREV_TRANSLATE]):(u=o[(l=k.binarySearch(o,n,Y.ENTRIES))+Y.PREV_ROTATE],p=o[l+Y.PREV_TRANSLATE],t=o[l],t=this.getCurvePercent(l/Y.ENTRIES-1,1-(n-t)/(o[l+Y.PREV_TIME]-t)),u+=(o[l+Y.ROTATE]-u)*t,p+=(o[l+Y.TRANSLATE]-p)*t),a==N.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(p-h.data.translateMix)*r):(h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(p-h.translateMix)*r)}},Y.ENTRIES=3,Y.PREV_TIME=-3,Y.PREV_ROTATE=-2,Y.PREV_TRANSLATE=-1,Y.ROTATE=1,Y.TRANSLATE=2,Y);function Y(t){var e=L.call(this,t)||this;return e.frames=V.Utils.newFloatArray(t*Y.ENTRIES),e}V.PathConstraintMixTimeline=n}(spine=spine||{}),function(A){var f=(T.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null;null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=a}}this.queue.drain()},T.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,0=t.mixDuration||0==t.timeScale)?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e*t.timeScale,!1)},T.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,i=!1,r=0,a=n.length;r=s.trackEnd&&null==s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),p=s.animation.timelines.length,c=s.animation.timelines;if(1==h)for(var d=0;d=T.FIRST?A.MixPose.setup:o;v instanceof A.RotateTimeline?this.applyRotateTimeline(v,t,u,h,y,g,d<<1,m):(A.Utils.webkit602BugfixHelper(h,y),v.apply(t,l,u,e,h,y,A.MixDirection.in))}}this.queueEvents(s,u),e.length=0,s.nextAnimationLast=u,s.nextTrackLast=s.trackTime}}return this.queue.drain(),i},T.prototype.applyMixingFrom=function(t,e,n){var i=t.mixingFrom;null!=i.mixingFrom&&this.applyMixingFrom(i,e,n);var r=0;0==t.mixDuration?(r=1,n=A.MixPose.setup):1<(r=t.mixTime/t.mixDuration)&&(r=1);var a=r=u[u.length-A.RotateTimeline.ENTRIES]?m=l.data.rotation+u[u.length+A.RotateTimeline.PREV_ROTATION]:(d=u[(c=A.Animation.binarySearch(u,n,A.RotateTimeline.ENTRIES))+A.RotateTimeline.PREV_ROTATION],p=u[c],f=h.getCurvePercent((c>>1)-1,1-(n-p)/(u[c+A.RotateTimeline.PREV_TIME]-p)),m=u[c+A.RotateTimeline.ROTATION]-d,m=d+(m-=360*(16384-(16384.499999999996-m/360|0)))*f+l.data.rotation,m-=360*(16384-(16384.499999999996-m/360|0))),(p=0)==(c=m-(u=(r==A.MixPose.setup?l.data:l).rotation))?p=a[s]:(c-=360*(16384-(16384.499999999996-c/360|0)),f=d=0,f=o?(d=0,c):(d=a[s],a[s+1]),m=0i||this.queue.event(t,l)}for((t.loop?0==r||a>t.trackTime%r:i<=e&&t.animationLast=this.tracks.length)){t=this.tracks[t];if(null!=t){this.queue.end(t),this.disposeNext(t);for(var e=t;;){var n=e.mixingFrom;if(null==n)break;this.queue.end(n),e.mixingFrom=null,e=n}this.tracks[t.trackIndex]=null,this.queue.drain()}}},T.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,e.mixTime=0,null!=i.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},T.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},T.prototype.removeListener=function(t){t=this.listeners.indexOf(t);0<=t&&this.listeners.splice(t,1)},T.prototype.clearListeners=function(){this.listeners.length=0},T.prototype.clearListenerNotifications=function(){this.queue.clear()},T.emptyAnimation=new A.Animation("",[],0),T.SUBSEQUENT=0,T.FIRST=1,T.DIP=2,T.DIP_MIX=3,T);function T(t){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new n(this),this.propertyIDs=new A.IntSet,this.mixingTo=new Array,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new A.Pool(function(){return new e}),this.data=t}A.AnimationState=f;var e=(t.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},t.prototype.setTimelineData=function(t,e,n){null!=t&&e.push(t);var i=null!=this.mixingFrom?this.mixingFrom.setTimelineData(this,e,n):this;null!=t&&e.pop();var r=e,a=e.length-1,s=this.animation.timelines,o=this.animation.timelines.length,h=A.Utils.setArraySize(this.timelineData,o);this.timelineDipMix.length=0;var l=A.Utils.setArraySize(this.timelineDipMix,o);t:for(var u=0;u=this.animationEnd-this.animationStart},t.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},t);function t(){this.timelineData=new Array,this.timelineDipMix=new Array,this.timelinesRotation=new Array}A.TrackEntry=e;var o,n=(i.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},i.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},i.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},i.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},i.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},i.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},i.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}var i;t.BoneData=e,(t=i=t.TransformMode||(t.TransformMode={}))[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(spine=spine||{}),(spine||(spine={})).Event=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e},(spine||(spine={})).EventData=function(t){this.name=t},function(j){var t=(e.prototype.getOrder=function(){return this.data.order},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.mix)}},e.prototype.apply1=function(t,e,n,i){t.appliedValid||t.updateAppliedTransform();var r=t.parent,a=1/(r.a*r.d-r.b*r.c),s=e-r.worldX,e=n-r.worldY,n=(s*r.d-e*r.b)*a-t.ax,a=(e*r.a-s*r.c)*a-t.ay,n=Math.atan2(a,n)*j.MathUtils.radDeg-t.ashearX-t.arotation;t.ascaleX<0&&(n+=180),180Z.MathUtils.PI?L-=Z.MathUtils.PI2:L<-Z.MathUtils.PI&&(L+=Z.MathUtils.PI2),L*=e,N=Math.cos(L),k=Math.sin(L),b.a=N*C-k*P,b.b=N*_-k*V,b.c=k*C+N*P,b.d=k*_+N*V),b.appliedValid=!1}}}},H.prototype.computeWorldPositions=function(t,e,n,i,r){var a=this.target,s=this.position,o=this.spaces,h=Z.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,p=t.worldVerticesLength,c=p/6,d=H.NONE;if(!t.constantSpeed){var f=t.lengths,m=f[c-=u?1:2];if(i&&(s*=m),r)for(var g=0;g=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,a=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=a&&i<=a||s<=t&&s<=n||o<=e&&o<=i)return!1;i=(i-e)/(n-t),n=i*(r-t)+e;if(at.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,i=0,r=n.length;i>1,U=this.clipOutput,F=j.Utils.setArraySize(l,_+Y*d),X=0;X>1;s=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},n.prototype.getAttachment=function(t,e){t=this.attachments[t];return t?t[e]:null},n.prototype.attachAll=function(t,e){for(var n=0,i=0;i= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}i.SlotData=t}(spine=spine||{}),function(t){var e,n,i=(r.prototype.getImage=function(){return this._image},r.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)}},r.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)}},r);function r(t){this._image=t}t.Texture=i,(i=e=t.TextureFilter||(t.TextureFilter={}))[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.MipMap=9987]="MipMap",i[i.MipMapNearestNearest=9984]="MipMapNearestNearest",i[i.MipMapLinearNearest=9985]="MipMapLinearNearest",i[i.MipMapNearestLinear=9986]="MipMapNearestLinear",i[i.MipMapLinearLinear=9987]="MipMapLinearLinear",(i=n=t.TextureWrap||(t.TextureWrap={}))[i.MirroredRepeat=33648]="MirroredRepeat",i[i.ClampToEdge=33071]="ClampToEdge",i[i.Repeat=10497]="Repeat",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,i=(a=t.Texture,__extends(s,a),s.prototype.setFilters=function(t,e){},s.prototype.setWraps=function(t,e){},s.prototype.dispose=function(){},s);function s(){return null!==a&&a.apply(this,arguments)||this}t.FakeTexture=i}(spine=spine||{}),function(p){var t=(e.prototype.load=function(t,e){if(null==e)throw new Error("textureLoader cannot be null.");for(var n=new c(t),i=new Array(4),r=null;;){var a,s,o,h,l,u=n.readLine();if(null==u)break;0==(u=u.trim()).length?r=null:r?((l=new f).name=u,l.page=r,l.rotate="true"==n.readValue(),n.readTuple(i),a=parseInt(i[0]),s=parseInt(i[1]),n.readTuple(i),o=parseInt(i[0]),h=parseInt(i[1]),l.u=a/r.width,l.v=s/r.height,l.rotate?(l.u2=(a+h)/r.width,l.v2=(s+o)/r.height):(l.u2=(a+o)/r.width,l.v2=(s+h)/r.height),l.x=a,l.y=s,l.width=Math.abs(o),l.height=Math.abs(h),4==n.readTuple(i)&&4==n.readTuple(i)&&n.readTuple(i),l.originalWidth=parseInt(i[0]),l.originalHeight=parseInt(i[1]),n.readTuple(i),l.offsetX=parseInt(i[0]),l.offsetY=parseInt(i[1]),l.index=parseInt(n.readValue()),l.texture=r.texture,this.regions.push(l)):((r=new d).name=u,2==n.readTuple(i)&&(r.width=parseInt(i[0]),r.height=parseInt(i[1]),n.readTuple(i)),n.readTuple(i),r.minFilter=p.Texture.filterFromString(i[0]),r.magFilter=p.Texture.filterFromString(i[1]),l=n.readValue(),r.uWrap=p.TextureWrap.ClampToEdge,r.vWrap=p.TextureWrap.ClampToEdge,"x"==l?r.uWrap=p.TextureWrap.Repeat:"y"==l?r.vWrap=p.TextureWrap.Repeat:"xy"==l&&(r.uWrap=r.vWrap=p.TextureWrap.Repeat),r.texture=e(u),r.texture.setFilters(r.minFilter,r.magFilter),r.texture.setWraps(r.uWrap,r.vWrap),r.width=r.texture.getImage().width,r.height=r.texture.getImage().height,this.pages.push(r))}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},n.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()},n.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var a=e.indexOf(",",r);if(-1==a)break;t[i]=e.substr(r,a-r).trim(),r=a+1}return t[i]=e.substring(r).trim(),i+1},n);function n(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var d=function(){};p.TextureAtlasPage=d;var i,f=(i=p.TextureRegion,__extends(r,i),r);function r(){return null!==i&&i.apply(this,arguments)||this}p.TextureAtlasRegion=f}(spine=spine||{}),function(R){var t=(e.prototype.apply=function(){this.update()},e.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,a=r.a,s=r.b,o=r.c,h=r.d,l=0R.MathUtils.PI?M-=R.MathUtils.PI2:M<-R.MathUtils.PI&&(M+=R.MathUtils.PI2),M*=t,y=Math.cos(M),v=Math.sin(M),T.a=y*m-v*g,T.b=y*x-v*E,T.c=v*m+y*g,T.d=v*x+y*E,b=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),T.worldX+=(y.x-T.worldX)*e,T.worldY+=(y.y-T.worldY)*e,b=!0),0R.MathUtils.PI?M-=R.MathUtils.PI2:M<-R.MathUtils.PI&&(M+=R.MathUtils.PI2),M=w+(M+p)*i,A=Math.sqrt(x*x+E*E),T.b=Math.cos(M)*A,T.d=Math.sin(M)*A,b=!0),b&&(T.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,a=r.a,s=r.b,o=r.c,h=r.d,l=0R.MathUtils.PI?x-=R.MathUtils.PI2:x<-R.MathUtils.PI&&(x+=R.MathUtils.PI2),x*=t,y=Math.cos(x),v=Math.sin(x),A.a=y*m-v*g,A.b=y*E-v*w,A.c=v*m+y*g,A.d=v*E+y*w,T=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),A.worldX+=y.x*e,A.worldY+=y.y*e,T=!0),0R.MathUtils.PI?x-=R.MathUtils.PI2:x<-R.MathUtils.PI&&(x+=R.MathUtils.PI2),E=A.b,w=A.d,x=Math.atan2(w,E)+(x-R.MathUtils.PI/2+p)*i,M=Math.sqrt(E*E+w*w),A.b=Math.cos(x)*M,A.d=Math.sin(x)*M,T=!0),T&&(A.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var a=this.bones,s=0,o=a.length;s>1,i=this.indicesArray,r=i.length=0;r=e?t:u.setArraySize(t,e,n)},u.newArray=function(t,e){for(var n=new Array(t),i=0;ithis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},m.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},m.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*a;var s=t.bone.skeleton,o=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,p=0,c=0;ca[o]?1:-1}return r.length!=a.length?-1:0}function a(t){this._image={width:t.width,height:t.height},this.pcTexture=t}var o=0,h=1,l=2,n={9728:pc.FILTER_NEAREST,9729:pc.FILTER_LINEAR,9984:pc.FILTER_NEAREST_MIPMAP_NEAREST,9985:pc.FILTER_LINEAR_MIPMAP_NEAREST,9986:pc.FILTER_NEAREST_MIPMAP_LINEAR,9987:pc.FILTER_LINEAR_MIPMAP_LINEAR},i={33648:pc.ADDRESS_MIRRORED_REPEAT,33071:pc.ADDRESS_CLAMP_TO_EDGE,10487:pc.ADDRESS_REPEAT},u=[0,1,2,2,3,0];a.prototype={setFilters:function(t,e){this.pcTexture.minFilter=n[t],this.pcTexture.magFilter=n[e]},setWraps:function(t,e){this.pcTexture.addressU=i[t],this.pcTexture.addressV=i[e]},getImage:function(){return this._image}};function t(t,e,n,i){this._app=t,this._position=new pc.Vec3,e=new spine.TextureAtlas(e,function(t){return new a(i[t])}),(e=new spine.SkeletonJson(new spine.AtlasAttachmentLoader(e))).scale*=.01,n=e.readSkeletonData(n),this.skeletonVersion=n.version,this._spine_3_6_0=r(this.skeletonVersion,"3.6.0")<=0,this._spine_3_7_99=r(this.skeletonVersion,"3.7.99")<=0,this.skeleton=new spine.Skeleton(n),this.skeleton.updateWorldTransform(),this.stateData=new spine.AnimationStateData(this.skeleton.data),this.states=[new spine.AnimationState(this.stateData)],this.clipper=new spine.SkeletonClipping,this._node=new pc.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new pc.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new pc.Vec2,this._aabbTempSize=new pc.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[pc.LAYERID_UI],this.init(),this.autoUpdate=!0,this._hidden=!1}return t.prototype.destroy=function(){this.removeFromLayers();for(var t=0;t>>1;;){if(t[(i+1)*n]<=e?a=i+1:r=i,a==r)return(a+1)*n;i=a+r>>>1}},e.linearSearch=function(t,e,n){for(var a=0,r=t.length-n;a<=r;a+=n)if(t[a]>e)return a;return-1},e);function e(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 a=0;a 0: "+t);this.curves=D.Utils.newFloatArray((t-1)*y.BEZIER_SIZE)}D.CurveTimeline=n;var a,r=(__extends(m,a=n),m.prototype.getPropertyId=function(){return(t.rotate<<24)+this.boneIndex},m.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+m.ROTATION]=n},m.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-m.ENTRIES]){var u=o[o.length+m.PREV_ROTATION];switch(i){case B.setup:h.rotation=h.data.rotation+u*r;break;case B.first:case B.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case B.add:h.rotation+=u*r}}else{var c=U.binarySearch(o,n,m.ENTRIES),d=o[c+m.PREV_ROTATION],t=o[c],t=this.getCurvePercent((c>>1)-1,1-(n-t)/(o[c+m.PREV_TIME]-t)),p=d+((p=o[c+m.ROTATION]-d)-360*(16384-(16384.499999999996-p/360|0)))*t;switch(i){case B.setup:h.rotation=h.data.rotation+(p-360*(16384-(16384.499999999996-p/360|0)))*r;break;case B.first:case B.replace:p+=h.data.rotation-h.rotation;case B.add:h.rotation+=(p-360*(16384-(16384.499999999996-p/360|0)))*r}}},m.ENTRIES=2,m.PREV_TIME=-2,m.PREV_ROTATION=-1,m.ROTATION=1,m);function m(t){var e=a.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t<<1),e}D.RotateTimeline=r;var i,s=(__extends(d,i=n),d.prototype.getPropertyId=function(){return(t.translate<<24)+this.boneIndex},d.prototype.setFrame=function(t,e,n,a){t*=d.ENTRIES,this.frames[t]=e,this.frames[t+d.X]=n,this.frames[t+d.Y]=a},d.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-d.ENTRIES]?(u=o[o.length+d.PREV_X],c=o[o.length+d.PREV_Y]):(u=o[(l=U.binarySearch(o,n,d.ENTRIES))+d.PREV_X],c=o[l+d.PREV_Y],t=o[l],t=this.getCurvePercent(l/d.ENTRIES-1,1-(n-t)/(o[l+d.PREV_TIME]-t)),u+=(o[l+d.X]-u)*t,c+=(o[l+d.Y]-c)*t),i){case B.setup:h.x=h.data.x+u*r,h.y=h.data.y+c*r;break;case B.first:case B.replace:h.x+=(h.data.x+u-h.x)*r,h.y+=(h.data.y+c-h.y)*r;break;case B.add:h.x+=u*r,h.y+=c*r}}},d.ENTRIES=3,d.PREV_TIME=-3,d.PREV_X=-2,d.PREV_Y=-1,d.X=1,d.Y=2,d);function d(t){var e=i.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*d.ENTRIES),e}D.TranslateTimeline=s;var o,r=(__extends(g,o=s),g.prototype.getPropertyId=function(){return(t.scale<<24)+this.boneIndex},g.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-g.ENTRIES]?(u=o[o.length+g.PREV_X]*h.data.scaleX,o[o.length+g.PREV_Y]*h.data.scaleY):(u=o[(l=U.binarySearch(o,n,g.ENTRIES))+g.PREV_X],c=o[l+g.PREV_Y],t=o[l],t=this.getCurvePercent(l/g.ENTRIES-1,1-(n-t)/(o[l+g.PREV_TIME]-t)),u=(u+(o[l+g.X]-u)*t)*h.data.scaleX,(c+(o[l+g.Y]-c)*t)*h.data.scaleY),1==r)i==B.add?(h.scaleX+=u-h.data.scaleX,h.scaleY+=c-h.data.scaleY):(h.scaleX=u,h.scaleY=c);else{var d=0,p=0;if(s==f.mixOut)switch(i){case B.setup:d=h.data.scaleX,p=h.data.scaleY,h.scaleX=d+(Math.abs(u)*D.MathUtils.signum(d)-d)*r,h.scaleY=p+(Math.abs(c)*D.MathUtils.signum(p)-p)*r;break;case B.first:case B.replace:d=h.scaleX,p=h.scaleY,h.scaleX=d+(Math.abs(u)*D.MathUtils.signum(d)-d)*r,h.scaleY=p+(Math.abs(c)*D.MathUtils.signum(p)-p)*r;break;case B.add:d=h.scaleX,p=h.scaleY,h.scaleX=d+(Math.abs(u)*D.MathUtils.signum(d)-h.data.scaleX)*r,h.scaleY=p+(Math.abs(c)*D.MathUtils.signum(p)-h.data.scaleY)*r}else switch(i){case B.setup:d=Math.abs(h.data.scaleX)*D.MathUtils.signum(u),p=Math.abs(h.data.scaleY)*D.MathUtils.signum(c),h.scaleX=d+(u-d)*r,h.scaleY=p+(c-p)*r;break;case B.first:case B.replace:d=Math.abs(h.scaleX)*D.MathUtils.signum(u),p=Math.abs(h.scaleY)*D.MathUtils.signum(c),h.scaleX=d+(u-d)*r,h.scaleY=p+(c-p)*r;break;case B.add:d=D.MathUtils.signum(u),p=D.MathUtils.signum(c),h.scaleX=Math.abs(h.scaleX)*d+(u-Math.abs(h.data.scaleX)*d)*r,h.scaleY=Math.abs(h.scaleY)*p+(c-Math.abs(h.data.scaleY)*p)*r}}}},g);function g(t){return o.call(this,t)||this}D.ScaleTimeline=r;var h,s=(__extends(p,h=s),p.prototype.getPropertyId=function(){return(t.shear<<24)+this.boneIndex},p.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-p.ENTRIES]?(u=o[o.length+p.PREV_X],c=o[o.length+p.PREV_Y]):(u=o[(l=U.binarySearch(o,n,p.ENTRIES))+p.PREV_X],c=o[l+p.PREV_Y],t=o[l],t=this.getCurvePercent(l/p.ENTRIES-1,1-(n-t)/(o[l+p.PREV_TIME]-t)),u+=(o[l+p.X]-u)*t,c+=(o[l+p.Y]-c)*t),i){case B.setup:h.shearX=h.data.shearX+u*r,h.shearY=h.data.shearY+c*r;break;case B.first:case B.replace:h.shearX+=(h.data.shearX+u-h.shearX)*r,h.shearY+=(h.data.shearY+c-h.shearY)*r;break;case B.add:h.shearX+=u*r,h.shearY+=c*r}}},p);function p(t){return h.call(this,t)||this}D.ShearTimeline=s;var l,s=(__extends(v,l=n),v.prototype.getPropertyId=function(){return(t.color<<24)+this.slotIndex},v.prototype.setFrame=function(t,e,n,a,r,i){t*=v.ENTRIES,this.frames[t]=e,this.frames[t+v.R]=n,this.frames[t+v.G]=a,this.frames[t+v.B]=r,this.frames[t+v.A]=i},v.prototype.apply=function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-v.ENTRIES]?(d=h[(c=h.length)+v.PREV_R],p=h[c+v.PREV_G],f=h[c+v.PREV_B],m=h[c+v.PREV_A]):(d=h[(t=U.binarySearch(h,n,v.ENTRIES))+v.PREV_R],p=h[t+v.PREV_G],f=h[t+v.PREV_B],m=h[t+v.PREV_A],c=h[t],c=this.getCurvePercent(t/v.ENTRIES-1,1-(n-c)/(h[t+v.PREV_TIME]-c)),d+=(h[t+v.R]-d)*c,p+=(h[t+v.G]-p)*c,f+=(h[t+v.B]-f)*c,m+=(h[t+v.A]-m)*c),1==r?o.color.set(d,p,f,m):(l=o.color,i==B.setup&&l.setFromColor(o.data.color),l.add((d-l.r)*r,(p-l.g)*r,(f-l.b)*r,(m-l.a)*r))}}},v.ENTRIES=5,v.PREV_TIME=-5,v.PREV_R=-4,v.PREV_G=-3,v.PREV_B=-2,v.PREV_A=-1,v.R=1,v.G=2,v.B=3,v.A=4,v);function v(t){var e=l.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*v.ENTRIES),e}D.ColorTimeline=s;var u,s=(__extends(M,u=n),M.prototype.getPropertyId=function(){return(t.twoColor<<24)+this.slotIndex},M.prototype.setFrame=function(t,e,n,a,r,i,s,o,h){t*=M.ENTRIES,this.frames[t]=e,this.frames[t+M.R]=n,this.frames[t+M.G]=a,this.frames[t+M.B]=r,this.frames[t+M.A]=i,this.frames[t+M.R2]=s,this.frames[t+M.G2]=o,this.frames[t+M.B2]=h},M.prototype.apply=function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-M.ENTRIES]?(f=h[(p=h.length)+M.PREV_R],m=h[p+M.PREV_G],g=h[p+M.PREV_B],v=h[p+M.PREV_A],y=h[p+M.PREV_R2],x=h[p+M.PREV_G2],w=h[p+M.PREV_B2]):(f=h[(t=U.binarySearch(h,n,M.ENTRIES))+M.PREV_R],m=h[t+M.PREV_G],g=h[t+M.PREV_B],v=h[t+M.PREV_A],y=h[t+M.PREV_R2],x=h[t+M.PREV_G2],w=h[t+M.PREV_B2],p=h[t],p=this.getCurvePercent(t/M.ENTRIES-1,1-(n-p)/(h[t+M.PREV_TIME]-p)),f+=(h[t+M.R]-f)*p,m+=(h[t+M.G]-m)*p,g+=(h[t+M.B]-g)*p,v+=(h[t+M.A]-v)*p,y+=(h[t+M.R2]-y)*p,x+=(h[t+M.G2]-x)*p,w+=(h[t+M.B2]-w)*p),1==r?(o.color.set(f,m,g,v),o.darkColor.set(y,x,w,1)):(l=o.color,u=o.darkColor,i==B.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((f-l.r)*r,(m-l.g)*r,(g-l.b)*r,(v-l.a)*r),u.add((y-u.r)*r,(x-u.g)*r,(w-u.b)*r,0))}}},M.ENTRIES=8,M.PREV_TIME=-8,M.PREV_R=-7,M.PREV_G=-6,M.PREV_B=-5,M.PREV_A=-4,M.PREV_R2=-3,M.PREV_G2=-2,M.PREV_B2=-1,M.R=1,M.G=2,M.B=3,M.A=4,M.R2=5,M.G2=6,M.B2=7,M);function M(t){var e=u.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*M.ENTRIES),e}function c(t){this.frames=D.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}D.TwoColorTimeline=s,c.prototype.getPropertyId=function(){return(t.attachment<<24)+this.slotIndex},c.prototype.getFrameCount=function(){return this.frames.length},c.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},c.prototype.apply=function(t,e,n,a,r,i,s){var o,h=t.slots[this.slotIndex];h.bone.active&&(s!=f.mixOut||i!=B.setup?n<(s=this.frames)[0]?i!=B.setup&&i!=B.first||(i=h.data.attachmentName,h.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))):(o=0,o=n>=s[s.length-1]?s.length-1:U.binarySearch(s,n,1)-1,o=this.attachmentNames[o],t.slots[this.slotIndex].setAttachment(null==o?null:t.getAttachment(this.slotIndex,o))):(o=h.data.attachmentName,h.setAttachment(null==o?null:t.getAttachment(this.slotIndex,o))))},s=c,D.AttachmentTimeline=s;var x,w=null,s=(__extends(E,x=n),E.prototype.getPropertyId=function(){return(t.deform<<27)+ +this.attachment.id+this.slotIndex},E.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},E.prototype.apply=function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof D.VertexAttachment&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(i=B.setup);var u=this.frameVertices,c=u[0].length,t=this.frames;if(n=t[t.length-1]){var v=u[t.length-1];if(1==r)if(i==B.add)if(null==(d=h).bones)for(var f=d.vertices,y=0;y=o[h-1])return;if(!(n=o[l];l++)a.push(this.events[l])}}},s=T,D.EventTimeline=s,A.prototype.getPropertyId=function(){return t.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(t,e,n,a,r,i,s){var o=t.drawOrder,h=t.slots;if(s!=f.mixOut||i!=B.setup){s=this.frames;if(n=s[s.length-1]?s.length-1:U.binarySearch(s,n)-1,l=this.drawOrders[i];if(null==l)D.Utils.arrayCopy(h,0,o,0,h.length);else for(var u=0,c=l.length;u=u[u.length-S.ENTRIES]?i==B.setup?(c.mix=c.data.mix+(u[u.length+S.PREV_MIX]-c.data.mix)*r,c.softness=c.data.softness+(u[u.length+S.PREV_SOFTNESS]-c.data.softness)*r,s==f.mixOut?(c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,c.stretch=c.data.stretch):(c.bendDirection=u[u.length+S.PREV_BEND_DIRECTION],c.compress=0!=u[u.length+S.PREV_COMPRESS],c.stretch=0!=u[u.length+S.PREV_STRETCH])):(c.mix+=(u[u.length+S.PREV_MIX]-c.mix)*r,c.softness+=(u[u.length+S.PREV_SOFTNESS]-c.softness)*r,s==f.mixIn&&(c.bendDirection=u[u.length+S.PREV_BEND_DIRECTION],c.compress=0!=u[u.length+S.PREV_COMPRESS],c.stretch=0!=u[u.length+S.PREV_STRETCH])):(h=u[(o=U.binarySearch(u,n,S.ENTRIES))+S.PREV_MIX],l=u[o+S.PREV_SOFTNESS],t=u[o],t=this.getCurvePercent(o/S.ENTRIES-1,1-(n-t)/(u[o+S.PREV_TIME]-t)),i==B.setup?(c.mix=c.data.mix+(h+(u[o+S.MIX]-h)*t-c.data.mix)*r,c.softness=c.data.softness+(l+(u[o+S.SOFTNESS]-l)*t-c.data.softness)*r,s==f.mixOut?(c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,c.stretch=c.data.stretch):(c.bendDirection=u[o+S.PREV_BEND_DIRECTION],c.compress=0!=u[o+S.PREV_COMPRESS],c.stretch=0!=u[o+S.PREV_STRETCH])):(c.mix+=(h+(u[o+S.MIX]-h)*t-c.mix)*r,c.softness+=(l+(u[o+S.SOFTNESS]-l)*t-c.softness)*r,s==f.mixIn&&(c.bendDirection=u[o+S.PREV_BEND_DIRECTION],c.compress=0!=u[o+S.PREV_COMPRESS],c.stretch=0!=u[o+S.PREV_STRETCH])))},S.ENTRIES=6,S.PREV_TIME=-6,S.PREV_MIX=-5,S.PREV_SOFTNESS=-4,S.PREV_BEND_DIRECTION=-3,S.PREV_COMPRESS=-2,S.PREV_STRETCH=-1,S.MIX=1,S.SOFTNESS=2,S.BEND_DIRECTION=3,S.COMPRESS=4,S.STRETCH=5,S);function S(t){var e=b.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*S.ENTRIES),e}D.IkConstraintTimeline=s;var I,s=(__extends(C,I=n),C.prototype.getPropertyId=function(){return(t.transformConstraint<<24)+this.transformConstraintIndex},C.prototype.setFrame=function(t,e,n,a,r,i){t*=C.ENTRIES,this.frames[t]=e,this.frames[t+C.ROTATE]=n,this.frames[t+C.TRANSLATE]=a,this.frames[t+C.SCALE]=r,this.frames[t+C.SHEAR]=i},C.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(n=o[o.length-C.ENTRIES]?(c=o[(u=o.length)+C.PREV_ROTATE],d=o[u+C.PREV_TRANSLATE],p=o[u+C.PREV_SCALE],f=o[u+C.PREV_SHEAR]):(c=o[(t=U.binarySearch(o,n,C.ENTRIES))+C.PREV_ROTATE],d=o[t+C.PREV_TRANSLATE],p=o[t+C.PREV_SCALE],f=o[t+C.PREV_SHEAR],u=o[t],u=this.getCurvePercent(t/C.ENTRIES-1,1-(n-u)/(o[t+C.PREV_TIME]-u)),c+=(o[t+C.ROTATE]-c)*u,d+=(o[t+C.TRANSLATE]-d)*u,p+=(o[t+C.SCALE]-p)*u,f+=(o[t+C.SHEAR]-f)*u),i==B.setup?(l=h.data,h.rotateMix=l.rotateMix+(c-l.rotateMix)*r,h.translateMix=l.translateMix+(d-l.translateMix)*r,h.scaleMix=l.scaleMix+(p-l.scaleMix)*r,h.shearMix=l.shearMix+(f-l.shearMix)*r):(h.rotateMix+=(c-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r,h.scaleMix+=(p-h.scaleMix)*r,h.shearMix+=(f-h.shearMix)*r)}},C.ENTRIES=5,C.PREV_TIME=-5,C.PREV_ROTATE=-4,C.PREV_TRANSLATE=-3,C.PREV_SCALE=-2,C.PREV_SHEAR=-1,C.ROTATE=1,C.TRANSLATE=2,C.SCALE=3,C.SHEAR=4,C);function C(t){var e=I.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*C.ENTRIES),e}D.TransformConstraintTimeline=s;var R,s=(__extends(_,R=n),_.prototype.getPropertyId=function(){return(t.pathConstraintPosition<<24)+this.pathConstraintIndex},_.prototype.setFrame=function(t,e,n){t*=_.ENTRIES,this.frames[t]=e,this.frames[t+_.VALUE]=n},_.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-_.ENTRIES]?u=o[o.length+_.PREV_VALUE]:(u=o[(l=U.binarySearch(o,n,_.ENTRIES))+_.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/_.ENTRIES-1,1-(n-t)/(o[l+_.PREV_TIME]-t)),u+=(o[l+_.VALUE]-u)*t),i==B.setup?h.position=h.data.position+(u-h.data.position)*r:h.position+=(u-h.position)*r}},_.ENTRIES=2,_.PREV_TIME=-2,_.PREV_VALUE=-1,_.VALUE=1,_);function _(t){var e=R.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*_.ENTRIES),e}D.PathConstraintPositionTimeline=s;var P,s=(__extends(V,P=s),V.prototype.getPropertyId=function(){return(t.pathConstraintSpacing<<24)+this.pathConstraintIndex},V.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-V.ENTRIES]?u=o[o.length+V.PREV_VALUE]:(u=o[(l=U.binarySearch(o,n,V.ENTRIES))+V.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/V.ENTRIES-1,1-(n-t)/(o[l+V.PREV_TIME]-t)),u+=(o[l+V.VALUE]-u)*t),i==B.setup?h.spacing=h.data.spacing+(u-h.data.spacing)*r:h.spacing+=(u-h.spacing)*r}},V);function V(t){return P.call(this,t)||this}D.PathConstraintSpacingTimeline=s;var k,n=(__extends(N,k=n),N.prototype.getPropertyId=function(){return(t.pathConstraintMix<<24)+this.pathConstraintIndex},N.prototype.setFrame=function(t,e,n,a){t*=N.ENTRIES,this.frames[t]=e,this.frames[t+N.ROTATE]=n,this.frames[t+N.TRANSLATE]=a},N.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-N.ENTRIES]?(u=o[o.length+N.PREV_ROTATE],c=o[o.length+N.PREV_TRANSLATE]):(u=o[(l=U.binarySearch(o,n,N.ENTRIES))+N.PREV_ROTATE],c=o[l+N.PREV_TRANSLATE],t=o[l],t=this.getCurvePercent(l/N.ENTRIES-1,1-(n-t)/(o[l+N.PREV_TIME]-t)),u+=(o[l+N.ROTATE]-u)*t,c+=(o[l+N.TRANSLATE]-c)*t),i==B.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(c-h.data.translateMix)*r):(h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r)}},N.ENTRIES=3,N.PREV_TIME=-3,N.PREV_ROTATE=-2,N.PREV_TRANSLATE=-1,N.ROTATE=1,N.TRANSLATE=2,N);function N(t){var e=k.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*N.ENTRIES),e}D.PathConstraintMixTimeline=n}(spine=spine||{}),function(A){var t=(b.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,a=e.length;n=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()},b.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var a=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,0=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)),a):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},b.prototype.apply=function(t){if(null==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;r=s.trackEnd&&null==s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),c=s.animation.timelines.length,d=s.animation.timelines;if(0==r&&1==h||o==A.MixBlend.add)for(var p=0;p=l[l.length-A.RotateTimeline.ENTRIES]?d=u.data.rotation+l[l.length+A.RotateTimeline.PREV_ROTATION]:(f=l[(p=A.Animation.binarySearch(l,n,A.RotateTimeline.ENTRIES))+A.RotateTimeline.PREV_ROTATION],g=l[p],m=h.getCurvePercent((p>>1)-1,1-(n-g)/(l[p+A.RotateTimeline.PREV_TIME]-g)),d=l[p+A.RotateTimeline.ROTATION]-f,d=f+(d-=360*(16384-(16384.499999999996-d/360|0)))*m+u.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0)))}var p,f,m,g=0,l=d-c;0==(l-=360*(16384-(16384.499999999996-l/360|0)))?g=i[s]:(f=p=0,f=o?(p=0,l):(p=i[s],i[s+1]),m=0a||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:a<=e&&t.animationLast=this.tracks.length)){t=this.tracks[t];if(null!=t){this.queue.end(t),this.disposeNext(t);for(var e=t;;){var n=e.mixingFrom;if(null==n)break;this.queue.end(n),e.mixingFrom=null,e.mixingTo=null,e=n}this.tracks[t.trackIndex]=null,this.queue.drain()}}},b.prototype.setCurrent=function(t,e,n){var a=this.expandToIndex(t);this.tracks[t]=e,null!=a&&(n&&this.queue.interrupt(a),((e.mixingFrom=a).mixingTo=e).mixTime=0,null!=a.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},b.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},b.prototype.removeListener=function(t){t=this.listeners.indexOf(t);0<=t&&this.listeners.splice(t,1)},b.prototype.clearListeners=function(){this.listeners.length=0},b.prototype.clearListenerNotifications=function(){this.queue.clear()},b.emptyAnimation=new A.Animation("",[],0),b.SUBSEQUENT=0,b.FIRST=1,b.HOLD=2,b.HOLD_MIX=3,b.NOT_LAST=4,b);function b(t){this.tracks=new Array,this.timeScale=1,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new A.IntSet,this.animationsChanged=!1,this.trackEntryPool=new A.Pool(function(){return new e}),this.data=t}A.AnimationState=t;var e=(n.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},n.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)},n.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},n.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n);function n(){this.mixBlend=A.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}A.TrackEntry=e;var o,a=(r.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},r.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},r.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},r.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},r.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},r.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},r.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n};a.BoneData=t,(t=r=a.TransformMode||(a.TransformMode={}))[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(spine=spine||{}),(spine||(spine={})).ConstraintData=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n},(spine||(spine={})).Event=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e},(spine||(spine={})).EventData=function(t){this.name=t},function(J){var t=(e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},e.prototype.apply1=function(t,e,n,a,r,i,s){t.appliedValid||t.updateAppliedTransform();var o=t.parent,h=o.a,l=o.b,u=o.c,c=o.d,d=-t.ashearX-t.arotation,p=0,f=0;switch(t.data.transformMode){case J.TransformMode.OnlyTranslation:p=e-t.worldX,f=n-t.worldY;break;case J.TransformMode.NoRotationOrReflection:d+=Math.atan2(u,h)*J.MathUtils.radDeg;var m=Math.abs(h*c-l*u)/(h*h+u*u),l=-u*m,c=h*m;default:var g=e-o.worldX,v=n-o.worldY,m=h*c-l*u,p=(g*c-v*l)/m-t.ax,f=(v*h-g*u)/m-t.ay}d+=Math.atan2(f,p)*J.MathUtils.radDeg,t.ascaleX<0&&(d+=180),180z.MathUtils.PI?L-=z.MathUtils.PI2:L<-z.MathUtils.PI&&(L+=z.MathUtils.PI2),L*=e,k=Math.cos(L),N=Math.sin(L),b.a=k*R-N*P,b.b=k*_-N*V,b.c=N*R+k*P,b.d=N*_+k*V),b.appliedValid=!1}}}},Z.prototype.computeWorldPositions=function(t,e,n,a,r){var i=this.target,s=this.position,o=this.spaces,h=z.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,d=c/6,p=Z.NONE;if(!t.constantSpeed){var f=t.lengths,m=f[d-=u?1:2];if(a&&(s*=m),r)for(var g=1;g>>1^-(1&n)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.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&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},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,n,a){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===a&&(a=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=a}var R=function(t,e,n,a,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=a,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(spine=spine||{}),function(c){var t=(e.prototype.update=function(t,e){if(null==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);for(var o=a.length=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=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||s<=t&&s<=n||o<=e&&o<=a)return!1;a=(a-e)/(n-t),n=a*(r-t)+e;if(it.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,a=0,r=n.length;a>1,D=this.clipOutput,B=H.Utils.setArraySize(l,_+O*p),U=0;U>1;s=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=n},e.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}a.SlotData=t}(spine=spine||{}),function(t){var e,n,a=(r.prototype.getImage=function(){return this._image},r.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)}},r.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)}},r);function r(t){this._image=t}t.Texture=a,(i=e=t.TextureFilter||(t.TextureFilter={}))[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.MipMap=9987]="MipMap",i[i.MipMapNearestNearest=9984]="MipMapNearestNearest",i[i.MipMapLinearNearest=9985]="MipMapLinearNearest",i[i.MipMapNearestLinear=9986]="MipMapNearestLinear",i[i.MipMapLinearLinear=9987]="MipMapLinearLinear",(i=n=t.TextureWrap||(t.TextureWrap={}))[i.MirroredRepeat=33648]="MirroredRepeat",i[i.ClampToEdge=33071]="ClampToEdge",i[i.Repeat=10497]="Repeat";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 s,a=(__extends(o,s=a),o.prototype.setFilters=function(t,e){},o.prototype.setWraps=function(t,e){},o.prototype.dispose=function(){},o);function o(){return null!==s&&s.apply(this,arguments)||this}t.FakeTexture=a}(spine=spine||{}),function(c){var t=(e.prototype.load=function(t,e){if(null==e)throw new Error("textureLoader cannot be null.");for(var n=new d(t),a=new Array(4),r=null;;){var i,s,o,h,l,u=n.readLine();if(null==u)break;0==(u=u.trim()).length?r=null:r?((l=new f).name=u,l.page=r,"true"==(h=n.readValue()).toLocaleLowerCase()?l.degrees=90:"false"==h.toLocaleLowerCase()?l.degrees=0:l.degrees=parseFloat(h),l.rotate=90==l.degrees,n.readTuple(a),i=parseInt(a[0]),s=parseInt(a[1]),n.readTuple(a),o=parseInt(a[0]),h=parseInt(a[1]),l.u=i/r.width,l.v=s/r.height,l.rotate?(l.u2=(i+h)/r.width,l.v2=(s+o)/r.height):(l.u2=(i+o)/r.width,l.v2=(s+h)/r.height),l.x=i,l.y=s,l.width=Math.abs(o),l.height=Math.abs(h),4==n.readTuple(a)&&4==n.readTuple(a)&&n.readTuple(a),l.originalWidth=parseInt(a[0]),l.originalHeight=parseInt(a[1]),n.readTuple(a),l.offsetX=parseInt(a[0]),l.offsetY=parseInt(a[1]),l.index=parseInt(n.readValue()),l.texture=r.texture,this.regions.push(l)):((r=new p).name=u,2==n.readTuple(a)&&(r.width=parseInt(a[0]),r.height=parseInt(a[1]),n.readTuple(a)),n.readTuple(a),r.minFilter=c.Texture.filterFromString(a[0]),r.magFilter=c.Texture.filterFromString(a[1]),l=n.readValue(),r.uWrap=c.TextureWrap.ClampToEdge,r.vWrap=c.TextureWrap.ClampToEdge,"x"==l?r.uWrap=c.TextureWrap.Repeat:"y"==l?r.vWrap=c.TextureWrap.Repeat:"xy"==l&&(r.uWrap=r.vWrap=c.TextureWrap.Repeat),r.texture=e(u),r.texture.setFilters(r.minFilter,r.magFilter),r.texture.setWraps(r.uWrap,r.vWrap),r.width=r.texture.getImage().width,r.height=r.texture.getImage().height,this.pages.push(r))}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},n.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()},n.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var a=0,r=n+1;a<3;a++){var i=e.indexOf(",",r);if(-1==i)break;t[a]=e.substr(r,i-r).trim(),r=i+1}return t[a]=e.substring(r).trim(),a+1},n);function n(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var p=function(){};c.TextureAtlasPage=p;var a,f=(a=c.TextureRegion,__extends(r,a),r);function r(){return null!==a&&a.apply(this,arguments)||this}c.TextureAtlasRegion=f}(spine=spine||{}),function(S){var t=(e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.a,s=r.b,o=r.c,h=r.d,l=0S.MathUtils.PI?E-=S.MathUtils.PI2:E<-S.MathUtils.PI&&(E+=S.MathUtils.PI2),E*=t,y=Math.cos(E),v=Math.sin(E),A.a=y*m-v*g,A.b=y*x-v*w,A.c=v*m+y*g,A.d=v*x+y*w,b=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),A.worldX+=(y.x-A.worldX)*e,A.worldY+=(y.y-A.worldY)*e,b=!0),0S.MathUtils.PI?E-=S.MathUtils.PI2:E<-S.MathUtils.PI&&(E+=S.MathUtils.PI2),E=M+(E+c)*a,T=Math.sqrt(x*x+w*w),A.b=Math.cos(E)*T,A.d=Math.sin(E)*T,b=!0),b&&(A.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.a,s=r.b,o=r.c,h=r.d,l=0S.MathUtils.PI?x-=S.MathUtils.PI2:x<-S.MathUtils.PI&&(x+=S.MathUtils.PI2),x*=t,y=Math.cos(x),v=Math.sin(x),T.a=y*m-v*g,T.b=y*w-v*M,T.c=v*m+y*g,T.d=v*w+y*M,A=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),T.worldX+=y.x*e,T.worldY+=y.y*e,A=!0),0S.MathUtils.PI?x-=S.MathUtils.PI2:x<-S.MathUtils.PI&&(x+=S.MathUtils.PI2),w=T.b,M=T.d,x=Math.atan2(M,w)+(x-S.MathUtils.PI/2+c)*a,E=Math.sqrt(w*w+M*M),T.b=Math.cos(x)*E,T.d=Math.sin(x)*E,A=!0),A&&(T.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s>1,a=this.indicesArray,r=a.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},a.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},a.WHITE=new a(1,1,1,1),a.RED=new a(1,0,0,1),a.GREEN=new a(0,1,0,1),a.BLUE=new a(0,0,1,1),a.MAGENTA=new a(1,0,1,1),e=a,t.Color=e,r.clamp=function(t,e,n){return t=e?t:u.setArraySize(t,e,n)},u.newArray=function(t,e){for(var n=new Array(t),a=0;athis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},m.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},m.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,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;di[o]?1:-1}return r.length!=i.length?-1:0}function i(t){this._image={width:t.width,height:t.height},this.pcTexture=t}var o=0,h=1,l=2,n={9728:pc.FILTER_NEAREST,9729:pc.FILTER_LINEAR,9984:pc.FILTER_NEAREST_MIPMAP_NEAREST,9985:pc.FILTER_LINEAR_MIPMAP_NEAREST,9986:pc.FILTER_NEAREST_MIPMAP_LINEAR,9987:pc.FILTER_LINEAR_MIPMAP_LINEAR},a={33648:pc.ADDRESS_MIRRORED_REPEAT,33071:pc.ADDRESS_CLAMP_TO_EDGE,10487:pc.ADDRESS_REPEAT},u=[0,1,2,2,3,0];i.prototype={setFilters:function(t,e){this.pcTexture.minFilter=n[t],this.pcTexture.magFilter=n[e]},setWraps:function(t,e){this.pcTexture.addressU=a[t],this.pcTexture.addressV=a[e]},getImage:function(){return this._image}};function t(t,e,n,a){this._app=t,this._position=new pc.Vec3,e=new spine.TextureAtlas(e,function(t){return new i(a[t])}),(e=new spine.SkeletonJson(new spine.AtlasAttachmentLoader(e))).scale*=.01,n=e.readSkeletonData(n),this.skeletonVersion=n.version,this._spine_3_6_0=r(this.skeletonVersion,"3.6.0")<=0,this._spine_3_7_99=r(this.skeletonVersion,"3.7.99")<=0,this.skeleton=new spine.Skeleton(n),this.skeleton.updateWorldTransform(),this.stateData=new spine.AnimationStateData(this.skeleton.data),this.states=[new spine.AnimationState(this.stateData)],this.clipper=new spine.SkeletonClipping,this._node=new pc.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new pc.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new pc.Vec2,this._aabbTempSize=new pc.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[pc.LAYERID_UI],this.init(),this.autoUpdate=!0,this._hidden=!1}return t.prototype.destroy=function(){this.removeFromLayers();for(var t=0;t>>1;;){if(t[(i+1)*n]<=e?a=i+1:r=i,a==r)return(a+1)*n;i=a+r>>>1}},e.linearSearch=function(t,e,n){for(var a=0,r=t.length-n;a<=r;a+=n)if(t[a]>e)return a;return-1},e);function e(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 a=0;a 0: "+t);this.curves=D.Utils.newFloatArray((t-1)*y.BEZIER_SIZE)}D.CurveTimeline=n;var a,r=(__extends(m,a=n),m.prototype.getPropertyId=function(){return(t.rotate<<24)+this.boneIndex},m.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+m.ROTATION]=n},m.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-m.ENTRIES]){var u=o[o.length+m.PREV_ROTATION];switch(i){case B.setup:h.rotation=h.data.rotation+u*r;break;case B.first:case B.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case B.add:h.rotation+=u*r}}else{var c=U.binarySearch(o,n,m.ENTRIES),d=o[c+m.PREV_ROTATION],t=o[c],t=this.getCurvePercent((c>>1)-1,1-(n-t)/(o[c+m.PREV_TIME]-t)),p=d+((p=o[c+m.ROTATION]-d)-360*(16384-(16384.499999999996-p/360|0)))*t;switch(i){case B.setup:h.rotation=h.data.rotation+(p-360*(16384-(16384.499999999996-p/360|0)))*r;break;case B.first:case B.replace:p+=h.data.rotation-h.rotation;case B.add:h.rotation+=(p-360*(16384-(16384.499999999996-p/360|0)))*r}}},m.ENTRIES=2,m.PREV_TIME=-2,m.PREV_ROTATION=-1,m.ROTATION=1,m);function m(t){var e=a.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t<<1),e}D.RotateTimeline=r;var i,s=(__extends(d,i=n),d.prototype.getPropertyId=function(){return(t.translate<<24)+this.boneIndex},d.prototype.setFrame=function(t,e,n,a){t*=d.ENTRIES,this.frames[t]=e,this.frames[t+d.X]=n,this.frames[t+d.Y]=a},d.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-d.ENTRIES]?(u=o[o.length+d.PREV_X],c=o[o.length+d.PREV_Y]):(u=o[(l=U.binarySearch(o,n,d.ENTRIES))+d.PREV_X],c=o[l+d.PREV_Y],t=o[l],t=this.getCurvePercent(l/d.ENTRIES-1,1-(n-t)/(o[l+d.PREV_TIME]-t)),u+=(o[l+d.X]-u)*t,c+=(o[l+d.Y]-c)*t),i){case B.setup:h.x=h.data.x+u*r,h.y=h.data.y+c*r;break;case B.first:case B.replace:h.x+=(h.data.x+u-h.x)*r,h.y+=(h.data.y+c-h.y)*r;break;case B.add:h.x+=u*r,h.y+=c*r}}},d.ENTRIES=3,d.PREV_TIME=-3,d.PREV_X=-2,d.PREV_Y=-1,d.X=1,d.Y=2,d);function d(t){var e=i.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*d.ENTRIES),e}D.TranslateTimeline=s;var o,r=(__extends(g,o=s),g.prototype.getPropertyId=function(){return(t.scale<<24)+this.boneIndex},g.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-g.ENTRIES]?(u=o[o.length+g.PREV_X]*h.data.scaleX,o[o.length+g.PREV_Y]*h.data.scaleY):(u=o[(l=U.binarySearch(o,n,g.ENTRIES))+g.PREV_X],c=o[l+g.PREV_Y],t=o[l],t=this.getCurvePercent(l/g.ENTRIES-1,1-(n-t)/(o[l+g.PREV_TIME]-t)),u=(u+(o[l+g.X]-u)*t)*h.data.scaleX,(c+(o[l+g.Y]-c)*t)*h.data.scaleY),1==r)i==B.add?(h.scaleX+=u-h.data.scaleX,h.scaleY+=c-h.data.scaleY):(h.scaleX=u,h.scaleY=c);else{var d=0,p=0;if(s==f.mixOut)switch(i){case B.setup:d=h.data.scaleX,p=h.data.scaleY,h.scaleX=d+(Math.abs(u)*D.MathUtils.signum(d)-d)*r,h.scaleY=p+(Math.abs(c)*D.MathUtils.signum(p)-p)*r;break;case B.first:case B.replace:d=h.scaleX,p=h.scaleY,h.scaleX=d+(Math.abs(u)*D.MathUtils.signum(d)-d)*r,h.scaleY=p+(Math.abs(c)*D.MathUtils.signum(p)-p)*r;break;case B.add:d=h.scaleX,p=h.scaleY,h.scaleX=d+(Math.abs(u)*D.MathUtils.signum(d)-h.data.scaleX)*r,h.scaleY=p+(Math.abs(c)*D.MathUtils.signum(p)-h.data.scaleY)*r}else switch(i){case B.setup:d=Math.abs(h.data.scaleX)*D.MathUtils.signum(u),p=Math.abs(h.data.scaleY)*D.MathUtils.signum(c),h.scaleX=d+(u-d)*r,h.scaleY=p+(c-p)*r;break;case B.first:case B.replace:d=Math.abs(h.scaleX)*D.MathUtils.signum(u),p=Math.abs(h.scaleY)*D.MathUtils.signum(c),h.scaleX=d+(u-d)*r,h.scaleY=p+(c-p)*r;break;case B.add:d=D.MathUtils.signum(u),p=D.MathUtils.signum(c),h.scaleX=Math.abs(h.scaleX)*d+(u-Math.abs(h.data.scaleX)*d)*r,h.scaleY=Math.abs(h.scaleY)*p+(c-Math.abs(h.data.scaleY)*p)*r}}}},g);function g(t){return o.call(this,t)||this}D.ScaleTimeline=r;var h,s=(__extends(p,h=s),p.prototype.getPropertyId=function(){return(t.shear<<24)+this.boneIndex},p.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-p.ENTRIES]?(u=o[o.length+p.PREV_X],c=o[o.length+p.PREV_Y]):(u=o[(l=U.binarySearch(o,n,p.ENTRIES))+p.PREV_X],c=o[l+p.PREV_Y],t=o[l],t=this.getCurvePercent(l/p.ENTRIES-1,1-(n-t)/(o[l+p.PREV_TIME]-t)),u+=(o[l+p.X]-u)*t,c+=(o[l+p.Y]-c)*t),i){case B.setup:h.shearX=h.data.shearX+u*r,h.shearY=h.data.shearY+c*r;break;case B.first:case B.replace:h.shearX+=(h.data.shearX+u-h.shearX)*r,h.shearY+=(h.data.shearY+c-h.shearY)*r;break;case B.add:h.shearX+=u*r,h.shearY+=c*r}}},p);function p(t){return h.call(this,t)||this}D.ShearTimeline=s;var l,s=(__extends(v,l=n),v.prototype.getPropertyId=function(){return(t.color<<24)+this.slotIndex},v.prototype.setFrame=function(t,e,n,a,r,i){t*=v.ENTRIES,this.frames[t]=e,this.frames[t+v.R]=n,this.frames[t+v.G]=a,this.frames[t+v.B]=r,this.frames[t+v.A]=i},v.prototype.apply=function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-v.ENTRIES]?(d=h[(c=h.length)+v.PREV_R],p=h[c+v.PREV_G],f=h[c+v.PREV_B],m=h[c+v.PREV_A]):(d=h[(t=U.binarySearch(h,n,v.ENTRIES))+v.PREV_R],p=h[t+v.PREV_G],f=h[t+v.PREV_B],m=h[t+v.PREV_A],c=h[t],c=this.getCurvePercent(t/v.ENTRIES-1,1-(n-c)/(h[t+v.PREV_TIME]-c)),d+=(h[t+v.R]-d)*c,p+=(h[t+v.G]-p)*c,f+=(h[t+v.B]-f)*c,m+=(h[t+v.A]-m)*c),1==r?o.color.set(d,p,f,m):(l=o.color,i==B.setup&&l.setFromColor(o.data.color),l.add((d-l.r)*r,(p-l.g)*r,(f-l.b)*r,(m-l.a)*r))}}},v.ENTRIES=5,v.PREV_TIME=-5,v.PREV_R=-4,v.PREV_G=-3,v.PREV_B=-2,v.PREV_A=-1,v.R=1,v.G=2,v.B=3,v.A=4,v);function v(t){var e=l.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*v.ENTRIES),e}D.ColorTimeline=s;var u,s=(__extends(M,u=n),M.prototype.getPropertyId=function(){return(t.twoColor<<24)+this.slotIndex},M.prototype.setFrame=function(t,e,n,a,r,i,s,o,h){t*=M.ENTRIES,this.frames[t]=e,this.frames[t+M.R]=n,this.frames[t+M.G]=a,this.frames[t+M.B]=r,this.frames[t+M.A]=i,this.frames[t+M.R2]=s,this.frames[t+M.G2]=o,this.frames[t+M.B2]=h},M.prototype.apply=function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-M.ENTRIES]?(f=h[(p=h.length)+M.PREV_R],m=h[p+M.PREV_G],g=h[p+M.PREV_B],v=h[p+M.PREV_A],y=h[p+M.PREV_R2],x=h[p+M.PREV_G2],w=h[p+M.PREV_B2]):(f=h[(t=U.binarySearch(h,n,M.ENTRIES))+M.PREV_R],m=h[t+M.PREV_G],g=h[t+M.PREV_B],v=h[t+M.PREV_A],y=h[t+M.PREV_R2],x=h[t+M.PREV_G2],w=h[t+M.PREV_B2],p=h[t],p=this.getCurvePercent(t/M.ENTRIES-1,1-(n-p)/(h[t+M.PREV_TIME]-p)),f+=(h[t+M.R]-f)*p,m+=(h[t+M.G]-m)*p,g+=(h[t+M.B]-g)*p,v+=(h[t+M.A]-v)*p,y+=(h[t+M.R2]-y)*p,x+=(h[t+M.G2]-x)*p,w+=(h[t+M.B2]-w)*p),1==r?(o.color.set(f,m,g,v),o.darkColor.set(y,x,w,1)):(l=o.color,u=o.darkColor,i==B.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((f-l.r)*r,(m-l.g)*r,(g-l.b)*r,(v-l.a)*r),u.add((y-u.r)*r,(x-u.g)*r,(w-u.b)*r,0))}}},M.ENTRIES=8,M.PREV_TIME=-8,M.PREV_R=-7,M.PREV_G=-6,M.PREV_B=-5,M.PREV_A=-4,M.PREV_R2=-3,M.PREV_G2=-2,M.PREV_B2=-1,M.R=1,M.G=2,M.B=3,M.A=4,M.R2=5,M.G2=6,M.B2=7,M);function M(t){var e=u.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*M.ENTRIES),e}function c(t){this.frames=D.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}D.TwoColorTimeline=s,c.prototype.getPropertyId=function(){return(t.attachment<<24)+this.slotIndex},c.prototype.getFrameCount=function(){return this.frames.length},c.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},c.prototype.apply=function(t,e,n,a,r,i,s){var o,h=t.slots[this.slotIndex];h.bone.active&&(s!=f.mixOut||i!=B.setup?n<(s=this.frames)[0]?i!=B.setup&&i!=B.first||(i=h.data.attachmentName,h.setAttachment(null==i?null:t.getAttachment(this.slotIndex,i))):(o=0,o=n>=s[s.length-1]?s.length-1:U.binarySearch(s,n,1)-1,o=this.attachmentNames[o],t.slots[this.slotIndex].setAttachment(null==o?null:t.getAttachment(this.slotIndex,o))):(o=h.data.attachmentName,h.setAttachment(null==o?null:t.getAttachment(this.slotIndex,o))))},s=c,D.AttachmentTimeline=s;var x,w=null,s=(__extends(E,x=n),E.prototype.getPropertyId=function(){return(t.deform<<27)+ +this.attachment.id+this.slotIndex},E.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},E.prototype.apply=function(t,e,n,a,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof D.VertexAttachment&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(i=B.setup);var u=this.frameVertices,c=u[0].length,t=this.frames;if(n=t[t.length-1]){var v=u[t.length-1];if(1==r)if(i==B.add)if(null==(d=h).bones)for(var f=d.vertices,y=0;y=o[h-1])return;if(!(n=o[l];l++)a.push(this.events[l])}}},s=T,D.EventTimeline=s,A.prototype.getPropertyId=function(){return t.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(t,e,n,a,r,i,s){var o=t.drawOrder,h=t.slots;if(s!=f.mixOut||i!=B.setup){s=this.frames;if(n=s[s.length-1]?s.length-1:U.binarySearch(s,n)-1,l=this.drawOrders[i];if(null==l)D.Utils.arrayCopy(h,0,o,0,h.length);else for(var u=0,c=l.length;u=u[u.length-S.ENTRIES]?i==B.setup?(c.mix=c.data.mix+(u[u.length+S.PREV_MIX]-c.data.mix)*r,c.softness=c.data.softness+(u[u.length+S.PREV_SOFTNESS]-c.data.softness)*r,s==f.mixOut?(c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,c.stretch=c.data.stretch):(c.bendDirection=u[u.length+S.PREV_BEND_DIRECTION],c.compress=0!=u[u.length+S.PREV_COMPRESS],c.stretch=0!=u[u.length+S.PREV_STRETCH])):(c.mix+=(u[u.length+S.PREV_MIX]-c.mix)*r,c.softness+=(u[u.length+S.PREV_SOFTNESS]-c.softness)*r,s==f.mixIn&&(c.bendDirection=u[u.length+S.PREV_BEND_DIRECTION],c.compress=0!=u[u.length+S.PREV_COMPRESS],c.stretch=0!=u[u.length+S.PREV_STRETCH])):(h=u[(o=U.binarySearch(u,n,S.ENTRIES))+S.PREV_MIX],l=u[o+S.PREV_SOFTNESS],t=u[o],t=this.getCurvePercent(o/S.ENTRIES-1,1-(n-t)/(u[o+S.PREV_TIME]-t)),i==B.setup?(c.mix=c.data.mix+(h+(u[o+S.MIX]-h)*t-c.data.mix)*r,c.softness=c.data.softness+(l+(u[o+S.SOFTNESS]-l)*t-c.data.softness)*r,s==f.mixOut?(c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,c.stretch=c.data.stretch):(c.bendDirection=u[o+S.PREV_BEND_DIRECTION],c.compress=0!=u[o+S.PREV_COMPRESS],c.stretch=0!=u[o+S.PREV_STRETCH])):(c.mix+=(h+(u[o+S.MIX]-h)*t-c.mix)*r,c.softness+=(l+(u[o+S.SOFTNESS]-l)*t-c.softness)*r,s==f.mixIn&&(c.bendDirection=u[o+S.PREV_BEND_DIRECTION],c.compress=0!=u[o+S.PREV_COMPRESS],c.stretch=0!=u[o+S.PREV_STRETCH])))},S.ENTRIES=6,S.PREV_TIME=-6,S.PREV_MIX=-5,S.PREV_SOFTNESS=-4,S.PREV_BEND_DIRECTION=-3,S.PREV_COMPRESS=-2,S.PREV_STRETCH=-1,S.MIX=1,S.SOFTNESS=2,S.BEND_DIRECTION=3,S.COMPRESS=4,S.STRETCH=5,S);function S(t){var e=b.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*S.ENTRIES),e}D.IkConstraintTimeline=s;var I,s=(__extends(C,I=n),C.prototype.getPropertyId=function(){return(t.transformConstraint<<24)+this.transformConstraintIndex},C.prototype.setFrame=function(t,e,n,a,r,i){t*=C.ENTRIES,this.frames[t]=e,this.frames[t+C.ROTATE]=n,this.frames[t+C.TRANSLATE]=a,this.frames[t+C.SCALE]=r,this.frames[t+C.SHEAR]=i},C.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(n=o[o.length-C.ENTRIES]?(c=o[(u=o.length)+C.PREV_ROTATE],d=o[u+C.PREV_TRANSLATE],p=o[u+C.PREV_SCALE],f=o[u+C.PREV_SHEAR]):(c=o[(t=U.binarySearch(o,n,C.ENTRIES))+C.PREV_ROTATE],d=o[t+C.PREV_TRANSLATE],p=o[t+C.PREV_SCALE],f=o[t+C.PREV_SHEAR],u=o[t],u=this.getCurvePercent(t/C.ENTRIES-1,1-(n-u)/(o[t+C.PREV_TIME]-u)),c+=(o[t+C.ROTATE]-c)*u,d+=(o[t+C.TRANSLATE]-d)*u,p+=(o[t+C.SCALE]-p)*u,f+=(o[t+C.SHEAR]-f)*u),i==B.setup?(l=h.data,h.rotateMix=l.rotateMix+(c-l.rotateMix)*r,h.translateMix=l.translateMix+(d-l.translateMix)*r,h.scaleMix=l.scaleMix+(p-l.scaleMix)*r,h.shearMix=l.shearMix+(f-l.shearMix)*r):(h.rotateMix+=(c-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r,h.scaleMix+=(p-h.scaleMix)*r,h.shearMix+=(f-h.shearMix)*r)}},C.ENTRIES=5,C.PREV_TIME=-5,C.PREV_ROTATE=-4,C.PREV_TRANSLATE=-3,C.PREV_SCALE=-2,C.PREV_SHEAR=-1,C.ROTATE=1,C.TRANSLATE=2,C.SCALE=3,C.SHEAR=4,C);function C(t){var e=I.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*C.ENTRIES),e}D.TransformConstraintTimeline=s;var R,s=(__extends(_,R=n),_.prototype.getPropertyId=function(){return(t.pathConstraintPosition<<24)+this.pathConstraintIndex},_.prototype.setFrame=function(t,e,n){t*=_.ENTRIES,this.frames[t]=e,this.frames[t+_.VALUE]=n},_.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-_.ENTRIES]?u=o[o.length+_.PREV_VALUE]:(u=o[(l=U.binarySearch(o,n,_.ENTRIES))+_.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/_.ENTRIES-1,1-(n-t)/(o[l+_.PREV_TIME]-t)),u+=(o[l+_.VALUE]-u)*t),i==B.setup?h.position=h.data.position+(u-h.data.position)*r:h.position+=(u-h.position)*r}},_.ENTRIES=2,_.PREV_TIME=-2,_.PREV_VALUE=-1,_.VALUE=1,_);function _(t){var e=R.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*_.ENTRIES),e}D.PathConstraintPositionTimeline=s;var P,s=(__extends(V,P=s),V.prototype.getPropertyId=function(){return(t.pathConstraintSpacing<<24)+this.pathConstraintIndex},V.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-V.ENTRIES]?u=o[o.length+V.PREV_VALUE]:(u=o[(l=U.binarySearch(o,n,V.ENTRIES))+V.PREV_VALUE],t=o[l],t=this.getCurvePercent(l/V.ENTRIES-1,1-(n-t)/(o[l+V.PREV_TIME]-t)),u+=(o[l+V.VALUE]-u)*t),i==B.setup?h.spacing=h.data.spacing+(u-h.data.spacing)*r:h.spacing+=(u-h.spacing)*r}},V);function V(t){return P.call(this,t)||this}D.PathConstraintSpacingTimeline=s;var k,n=(__extends(N,k=n),N.prototype.getPropertyId=function(){return(t.pathConstraintMix<<24)+this.pathConstraintIndex},N.prototype.setFrame=function(t,e,n,a){t*=N.ENTRIES,this.frames[t]=e,this.frames[t+N.ROTATE]=n,this.frames[t+N.TRANSLATE]=a},N.prototype.apply=function(t,e,n,a,r,i,s){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-N.ENTRIES]?(u=o[o.length+N.PREV_ROTATE],c=o[o.length+N.PREV_TRANSLATE]):(u=o[(l=U.binarySearch(o,n,N.ENTRIES))+N.PREV_ROTATE],c=o[l+N.PREV_TRANSLATE],t=o[l],t=this.getCurvePercent(l/N.ENTRIES-1,1-(n-t)/(o[l+N.PREV_TIME]-t)),u+=(o[l+N.ROTATE]-u)*t,c+=(o[l+N.TRANSLATE]-c)*t),i==B.setup?(h.rotateMix=h.data.rotateMix+(u-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(c-h.data.translateMix)*r):(h.rotateMix+=(u-h.rotateMix)*r,h.translateMix+=(c-h.translateMix)*r)}},N.ENTRIES=3,N.PREV_TIME=-3,N.PREV_ROTATE=-2,N.PREV_TRANSLATE=-1,N.ROTATE=1,N.TRANSLATE=2,N);function N(t){var e=k.call(this,t)||this;return e.frames=D.Utils.newFloatArray(t*N.ENTRIES),e}D.PathConstraintMixTimeline=n}(spine=spine||{}),function(A){var t=(b.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,a=e.length;n=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()},b.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var a=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,0=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)),a):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},b.prototype.apply=function(t){if(null==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;r=s.trackEnd&&null==s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),c=s.animation.timelines.length,d=s.animation.timelines;if(0==r&&1==h||o==A.MixBlend.add)for(var p=0;p=l[l.length-A.RotateTimeline.ENTRIES]?d=u.data.rotation+l[l.length+A.RotateTimeline.PREV_ROTATION]:(f=l[(p=A.Animation.binarySearch(l,n,A.RotateTimeline.ENTRIES))+A.RotateTimeline.PREV_ROTATION],g=l[p],m=h.getCurvePercent((p>>1)-1,1-(n-g)/(l[p+A.RotateTimeline.PREV_TIME]-g)),d=l[p+A.RotateTimeline.ROTATION]-f,d=f+(d-=360*(16384-(16384.499999999996-d/360|0)))*m+u.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0)))}var p,f,m,g=0,l=d-c;0==(l-=360*(16384-(16384.499999999996-l/360|0)))?g=i[s]:(f=p=0,f=o?(p=0,l):(p=i[s],i[s+1]),m=0a||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:a<=e&&t.animationLast=this.tracks.length)){t=this.tracks[t];if(null!=t){this.queue.end(t),this.disposeNext(t);for(var e=t;;){var n=e.mixingFrom;if(null==n)break;this.queue.end(n),e.mixingFrom=null,e.mixingTo=null,e=n}this.tracks[t.trackIndex]=null,this.queue.drain()}}},b.prototype.setCurrent=function(t,e,n){var a=this.expandToIndex(t);this.tracks[t]=e,null!=a&&(n&&this.queue.interrupt(a),((e.mixingFrom=a).mixingTo=e).mixTime=0,null!=a.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},b.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},b.prototype.removeListener=function(t){t=this.listeners.indexOf(t);0<=t&&this.listeners.splice(t,1)},b.prototype.clearListeners=function(){this.listeners.length=0},b.prototype.clearListenerNotifications=function(){this.queue.clear()},b.emptyAnimation=new A.Animation("",[],0),b.SUBSEQUENT=0,b.FIRST=1,b.HOLD=2,b.HOLD_MIX=3,b.NOT_LAST=4,b);function b(t){this.tracks=new Array,this.timeScale=1,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new A.IntSet,this.animationsChanged=!1,this.trackEntryPool=new A.Pool(function(){return new e}),this.data=t}A.AnimationState=t;var e=(n.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},n.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)},n.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},n.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n);function n(){this.mixBlend=A.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}A.TrackEntry=e;var o,a=(r.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},r.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},r.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},r.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},r.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},r.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},r.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n};a.BoneData=t,(t=r=a.TransformMode||(a.TransformMode={}))[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(spine=spine||{}),(spine||(spine={})).ConstraintData=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n},(spine||(spine={})).Event=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e},(spine||(spine={})).EventData=function(t){this.name=t},function(J){var t=(e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},e.prototype.apply1=function(t,e,n,a,r,i,s){t.appliedValid||t.updateAppliedTransform();var o=t.parent,h=o.a,l=o.b,u=o.c,c=o.d,d=-t.ashearX-t.arotation,p=0,f=0;switch(t.data.transformMode){case J.TransformMode.OnlyTranslation:p=e-t.worldX,f=n-t.worldY;break;case J.TransformMode.NoRotationOrReflection:d+=Math.atan2(u,h)*J.MathUtils.radDeg;var m=Math.abs(h*c-l*u)/(h*h+u*u),l=-u*m,c=h*m;default:var g=e-o.worldX,v=n-o.worldY,m=h*c-l*u,p=(g*c-v*l)/m-t.ax,f=(v*h-g*u)/m-t.ay}d+=Math.atan2(f,p)*J.MathUtils.radDeg,t.ascaleX<0&&(d+=180),180z.MathUtils.PI?L-=z.MathUtils.PI2:L<-z.MathUtils.PI&&(L+=z.MathUtils.PI2),L*=e,k=Math.cos(L),N=Math.sin(L),b.a=k*R-N*P,b.b=k*_-N*V,b.c=N*R+k*P,b.d=N*_+k*V),b.appliedValid=!1}}}},Z.prototype.computeWorldPositions=function(t,e,n,a,r){var i=this.target,s=this.position,o=this.spaces,h=z.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,d=c/6,p=Z.NONE;if(!t.constantSpeed){var f=t.lengths,m=f[d-=u?1:2];if(a&&(s*=m),r)for(var g=1;g>>1^-(1&n)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.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&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},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,n,a){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===a&&(a=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=a}var R=function(t,e,n,a,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=a,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(spine=spine||{}),function(c){var t=(e.prototype.update=function(t,e){if(null==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);for(var o=a.length=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=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||s<=t&&s<=n||o<=e&&o<=a)return!1;a=(a-e)/(n-t),n=a*(r-t)+e;if(it.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,a=0,r=n.length;a>1,D=this.clipOutput,B=H.Utils.setArraySize(l,_+O*p),U=0;U>1;s=a.length&&(a.length=t+1),a[t]||(a[t]={}),a[t][e]=n},e.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}a.SlotData=t}(spine=spine||{}),function(t){var e,n,a=(r.prototype.getImage=function(){return this._image},r.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)}},r.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)}},r);function r(t){this._image=t}t.Texture=a,(i=e=t.TextureFilter||(t.TextureFilter={}))[i.Nearest=9728]="Nearest",i[i.Linear=9729]="Linear",i[i.MipMap=9987]="MipMap",i[i.MipMapNearestNearest=9984]="MipMapNearestNearest",i[i.MipMapLinearNearest=9985]="MipMapLinearNearest",i[i.MipMapNearestLinear=9986]="MipMapNearestLinear",i[i.MipMapLinearLinear=9987]="MipMapLinearLinear",(i=n=t.TextureWrap||(t.TextureWrap={}))[i.MirroredRepeat=33648]="MirroredRepeat",i[i.ClampToEdge=33071]="ClampToEdge",i[i.Repeat=10497]="Repeat";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 s,a=(__extends(o,s=a),o.prototype.setFilters=function(t,e){},o.prototype.setWraps=function(t,e){},o.prototype.dispose=function(){},o);function o(){return null!==s&&s.apply(this,arguments)||this}t.FakeTexture=a}(spine=spine||{}),function(c){var t=(e.prototype.load=function(t,e){if(null==e)throw new Error("textureLoader cannot be null.");for(var n=new d(t),a=new Array(4),r=null;;){var i,s,o,h,l,u=n.readLine();if(null==u)break;0==(u=u.trim()).length?r=null:r?((l=new f).name=u,l.page=r,"true"==(h=n.readValue()).toLocaleLowerCase()?l.degrees=90:"false"==h.toLocaleLowerCase()?l.degrees=0:l.degrees=parseFloat(h),l.rotate=90==l.degrees,n.readTuple(a),i=parseInt(a[0]),s=parseInt(a[1]),n.readTuple(a),o=parseInt(a[0]),h=parseInt(a[1]),l.u=i/r.width,l.v=s/r.height,l.rotate?(l.u2=(i+h)/r.width,l.v2=(s+o)/r.height):(l.u2=(i+o)/r.width,l.v2=(s+h)/r.height),l.x=i,l.y=s,l.width=Math.abs(o),l.height=Math.abs(h),4==n.readTuple(a)&&4==n.readTuple(a)&&n.readTuple(a),l.originalWidth=parseInt(a[0]),l.originalHeight=parseInt(a[1]),n.readTuple(a),l.offsetX=parseInt(a[0]),l.offsetY=parseInt(a[1]),l.index=parseInt(n.readValue()),l.texture=r.texture,this.regions.push(l)):((r=new p).name=u,2==n.readTuple(a)&&(r.width=parseInt(a[0]),r.height=parseInt(a[1]),n.readTuple(a)),n.readTuple(a),r.minFilter=c.Texture.filterFromString(a[0]),r.magFilter=c.Texture.filterFromString(a[1]),l=n.readValue(),r.uWrap=c.TextureWrap.ClampToEdge,r.vWrap=c.TextureWrap.ClampToEdge,"x"==l?r.uWrap=c.TextureWrap.Repeat:"y"==l?r.vWrap=c.TextureWrap.Repeat:"xy"==l&&(r.uWrap=r.vWrap=c.TextureWrap.Repeat),r.texture=e(u),r.texture.setFilters(r.minFilter,r.magFilter),r.texture.setWraps(r.uWrap,r.vWrap),r.width=r.texture.getImage().width,r.height=r.texture.getImage().height,this.pages.push(r))}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},n.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()},n.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var a=0,r=n+1;a<3;a++){var i=e.indexOf(",",r);if(-1==i)break;t[a]=e.substr(r,i-r).trim(),r=i+1}return t[a]=e.substring(r).trim(),a+1},n);function n(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var p=function(){};c.TextureAtlasPage=p;var a,f=(a=c.TextureRegion,__extends(r,a),r);function r(){return null!==a&&a.apply(this,arguments)||this}c.TextureAtlasRegion=f}(spine=spine||{}),function(S){var t=(e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.a,s=r.b,o=r.c,h=r.d,l=0S.MathUtils.PI?E-=S.MathUtils.PI2:E<-S.MathUtils.PI&&(E+=S.MathUtils.PI2),E*=t,y=Math.cos(E),v=Math.sin(E),A.a=y*m-v*g,A.b=y*x-v*w,A.c=v*m+y*g,A.d=v*x+y*w,b=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),A.worldX+=(y.x-A.worldX)*e,A.worldY+=(y.y-A.worldY)*e,b=!0),0S.MathUtils.PI?E-=S.MathUtils.PI2:E<-S.MathUtils.PI&&(E+=S.MathUtils.PI2),E=M+(E+c)*a,T=Math.sqrt(x*x+w*w),A.b=Math.cos(E)*T,A.d=Math.sin(E)*T,b=!0),b&&(A.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.a,s=r.b,o=r.c,h=r.d,l=0S.MathUtils.PI?x-=S.MathUtils.PI2:x<-S.MathUtils.PI&&(x+=S.MathUtils.PI2),x*=t,y=Math.cos(x),v=Math.sin(x),T.a=y*m-v*g,T.b=y*w-v*M,T.c=v*m+y*g,T.d=v*w+y*M,A=!0),0!=e&&(y=this.temp,r.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),T.worldX+=y.x*e,T.worldY+=y.y*e,A=!0),0S.MathUtils.PI?x-=S.MathUtils.PI2:x<-S.MathUtils.PI&&(x+=S.MathUtils.PI2),w=T.b,M=T.d,x=Math.atan2(M,w)+(x-S.MathUtils.PI/2+c)*a,E=Math.sqrt(w*w+M*M),T.b=Math.cos(x)*E,T.d=Math.sin(x)*E,A=!0),A&&(T.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var i=this.bones,s=0,o=i.length;s>1,a=this.indicesArray,r=a.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},a.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},a.WHITE=new a(1,1,1,1),a.RED=new a(1,0,0,1),a.GREEN=new a(0,1,0,1),a.BLUE=new a(0,0,1,1),a.MAGENTA=new a(1,0,1,1),e=a,t.Color=e,r.clamp=function(t,e,n){return t=e?t:u.setArraySize(t,e,n)},u.newArray=function(t,e){for(var n=new Array(t),a=0;athis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},m.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},m.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,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,d=0;di[o]?1:-1}return r.length!=i.length?-1:0}function i(t){this._image={width:t.width,height:t.height},this.pcTexture=t}var o=0,h=1,l=2,n={9728:pc.FILTER_NEAREST,9729:pc.FILTER_LINEAR,9984:pc.FILTER_NEAREST_MIPMAP_NEAREST,9985:pc.FILTER_LINEAR_MIPMAP_NEAREST,9986:pc.FILTER_NEAREST_MIPMAP_LINEAR,9987:pc.FILTER_LINEAR_MIPMAP_LINEAR},a={33648:pc.ADDRESS_MIRRORED_REPEAT,33071:pc.ADDRESS_CLAMP_TO_EDGE,10487:pc.ADDRESS_REPEAT},u=[0,1,2,2,3,0];i.prototype={setFilters:function(t,e){this.pcTexture.minFilter=n[t],this.pcTexture.magFilter=n[e]},setWraps:function(t,e){this.pcTexture.addressU=a[t],this.pcTexture.addressV=a[e]},getImage:function(){return this._image}};function t(t,e,n,a){this._app=t,this._position=new pc.Vec3,e=new spine.TextureAtlas(e,function(t){return new i(a[t])}),(e=new spine.SkeletonJson(new spine.AtlasAttachmentLoader(e))).scale*=.01,n=e.readSkeletonData(n),this.skeletonVersion=n.version,this._spine_3_6_0=r(this.skeletonVersion,"3.6.0")<=0,this._spine_3_7_99=r(this.skeletonVersion,"3.7.99")<=0,this.skeleton=new spine.Skeleton(n),this.skeleton.updateWorldTransform(),this.stateData=new spine.AnimationStateData(this.skeleton.data),this.states=[new spine.AnimationState(this.stateData)],this.clipper=new spine.SkeletonClipping,this._node=new pc.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new pc.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new pc.Vec2,this._aabbTempSize=new pc.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[pc.LAYERID_UI],this.init(),this.autoUpdate=!0,this._hidden=!1}return t.prototype.destroy=function(){this.removeFromLayers();for(var t=0;t