var spine;(function(l){class T{constructor(p,A,x){if(p==null)throw new Error("name cannot be null.");if(A==null)throw new Error("timelines cannot be null.");this.name=p,this.timelines=A,this.timelineIds=[];for(var k=0;k0&&(A%=this.duration));let f=this.timelines;for(let V=0,I=f.length;V>>1;for(;;){if(p[(U+1)*x]<=A?k=U+1:R=U,k==R)return(k+1)*x;U=k+R>>>1}}static linearSearch(p,A,x){for(let k=0,R=p.length-x;k<=R;k+=x)if(p[k]>A)return k;return-1}}l.Animation=T;let v;(function(b){b[b.setup=0]="setup",b[b.first=1]="first",b[b.replace=2]="replace",b[b.add=3]="add"})(v=l.MixBlend||(l.MixBlend={}));let e;(function(b){b[b.mixIn=0]="mixIn",b[b.mixOut=1]="mixOut"})(e=l.MixDirection||(l.MixDirection={}));let s;(function(b){b[b.rotate=0]="rotate",b[b.translate=1]="translate",b[b.scale=2]="scale",b[b.shear=3]="shear",b[b.attachment=4]="attachment",b[b.color=5]="color",b[b.deform=6]="deform",b[b.event=7]="event",b[b.drawOrder=8]="drawOrder",b[b.ikConstraint=9]="ikConstraint",b[b.transformConstraint=10]="transformConstraint",b[b.pathConstraintPosition=11]="pathConstraintPosition",b[b.pathConstraintSpacing=12]="pathConstraintSpacing",b[b.pathConstraintMix=13]="pathConstraintMix",b[b.twoColor=14]="twoColor"})(s=l.TimelineType||(l.TimelineType={}));class o{constructor(p){if(p<=0)throw new Error("frameCount must be > 0: "+p);this.curves=l.Utils.newFloatArray((p-1)*o.BEZIER_SIZE)}getFrameCount(){return this.curves.length/o.BEZIER_SIZE+1}setLinear(p){this.curves[p*o.BEZIER_SIZE]=o.LINEAR}setStepped(p){this.curves[p*o.BEZIER_SIZE]=o.STEPPED}getCurveType(p){let A=p*o.BEZIER_SIZE;if(A==this.curves.length)return o.LINEAR;let x=this.curves[A];return x==o.LINEAR?o.LINEAR:x==o.STEPPED?o.STEPPED:o.BEZIER}setCurve(p,A,x,k,R){let U=(-A*2+k)*.03,Y=(-x*2+R)*.03,E=((A-k)*3+1)*.006,f=((x-R)*3+1)*.006,V=U*2+E,I=Y*2+f,C=A*.3+U+E*.16666667,F=x*.3+Y+f*.16666667,N=p*o.BEZIER_SIZE,X=this.curves;X[N++]=o.BEZIER;let W=C,B=F;for(let q=N+o.BEZIER_SIZE-1;N=A){let V,I;return k==E?(V=0,I=0):(V=x[k-2],I=x[k-1]),I+(x[k+1]-I)*(A-V)/(U-V)}let Y=x[k-1];return Y+(1-Y)*(A-U)/(1-U)}}o.LINEAR=0,o.STEPPED=1,o.BEZIER=2,o.BEZIER_SIZE=10*2-1,l.CurveTimeline=o;class t extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p<<1)}getPropertyId(){return(s.rotate<<24)+this.boneIndex}setFrame(p,A,x){p<<=1,this.frames[p]=A,this.frames[p+t.ROTATION]=x}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.bones[this.boneIndex];if(!f.active)return;if(x=E[E.length-t.ENTRIES]){let X=E[E.length+t.PREV_ROTATION];switch(U){case v.setup:f.rotation=f.data.rotation+X*R;break;case v.first:case v.replace:X+=f.data.rotation-f.rotation,X-=(16384-(16384.499999999996-X/360|0))*360;case v.add:f.rotation+=X*R}return}let V=T.binarySearch(E,x,t.ENTRIES),I=E[V+t.PREV_ROTATION],C=E[V],F=this.getCurvePercent((V>>1)-1,1-(x-C)/(E[V+t.PREV_TIME]-C)),N=E[V+t.ROTATION]-I;switch(N=I+(N-(16384-(16384.499999999996-N/360|0))*360)*F,U){case v.setup:f.rotation=f.data.rotation+(N-(16384-(16384.499999999996-N/360|0))*360)*R;break;case v.first:case v.replace:N+=f.data.rotation-f.rotation;case v.add:f.rotation+=(N-(16384-(16384.499999999996-N/360|0))*360)*R}}}t.ENTRIES=2,t.PREV_TIME=-2,t.PREV_ROTATION=-1,t.ROTATION=1,l.RotateTimeline=t;class a extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p*a.ENTRIES)}getPropertyId(){return(s.translate<<24)+this.boneIndex}setFrame(p,A,x,k){p*=a.ENTRIES,this.frames[p]=A,this.frames[p+a.X]=x,this.frames[p+a.Y]=k}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.bones[this.boneIndex];if(!f.active)return;if(x=E[E.length-a.ENTRIES])V=E[E.length+a.PREV_X],I=E[E.length+a.PREV_Y];else{let C=T.binarySearch(E,x,a.ENTRIES);V=E[C+a.PREV_X],I=E[C+a.PREV_Y];let F=E[C],N=this.getCurvePercent(C/a.ENTRIES-1,1-(x-F)/(E[C+a.PREV_TIME]-F));V+=(E[C+a.X]-V)*N,I+=(E[C+a.Y]-I)*N}switch(U){case v.setup:f.x=f.data.x+V*R,f.y=f.data.y+I*R;break;case v.first:case v.replace:f.x+=(f.data.x+V-f.x)*R,f.y+=(f.data.y+I-f.y)*R;break;case v.add:f.x+=V*R,f.y+=I*R}}}a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,l.TranslateTimeline=a;class h extends a{constructor(p){super(p)}getPropertyId(){return(s.scale<<24)+this.boneIndex}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.bones[this.boneIndex];if(!f.active)return;if(x=E[E.length-h.ENTRIES])V=E[E.length+h.PREV_X]*f.data.scaleX,I=E[E.length+h.PREV_Y]*f.data.scaleY;else{let C=T.binarySearch(E,x,h.ENTRIES);V=E[C+h.PREV_X],I=E[C+h.PREV_Y];let F=E[C],N=this.getCurvePercent(C/h.ENTRIES-1,1-(x-F)/(E[C+h.PREV_TIME]-F));V=(V+(E[C+h.X]-V)*N)*f.data.scaleX,I=(I+(E[C+h.Y]-I)*N)*f.data.scaleY}if(R==1)U==v.add?(f.scaleX+=V-f.data.scaleX,f.scaleY+=I-f.data.scaleY):(f.scaleX=V,f.scaleY=I);else{let C=0,F=0;if(Y==e.mixOut)switch(U){case v.setup:C=f.data.scaleX,F=f.data.scaleY,f.scaleX=C+(Math.abs(V)*l.MathUtils.signum(C)-C)*R,f.scaleY=F+(Math.abs(I)*l.MathUtils.signum(F)-F)*R;break;case v.first:case v.replace:C=f.scaleX,F=f.scaleY,f.scaleX=C+(Math.abs(V)*l.MathUtils.signum(C)-C)*R,f.scaleY=F+(Math.abs(I)*l.MathUtils.signum(F)-F)*R;break;case v.add:C=f.scaleX,F=f.scaleY,f.scaleX=C+(Math.abs(V)*l.MathUtils.signum(C)-f.data.scaleX)*R,f.scaleY=F+(Math.abs(I)*l.MathUtils.signum(F)-f.data.scaleY)*R}else switch(U){case v.setup:C=Math.abs(f.data.scaleX)*l.MathUtils.signum(V),F=Math.abs(f.data.scaleY)*l.MathUtils.signum(I),f.scaleX=C+(V-C)*R,f.scaleY=F+(I-F)*R;break;case v.first:case v.replace:C=Math.abs(f.scaleX)*l.MathUtils.signum(V),F=Math.abs(f.scaleY)*l.MathUtils.signum(I),f.scaleX=C+(V-C)*R,f.scaleY=F+(I-F)*R;break;case v.add:C=l.MathUtils.signum(V),F=l.MathUtils.signum(I),f.scaleX=Math.abs(f.scaleX)*C+(V-Math.abs(f.data.scaleX)*C)*R,f.scaleY=Math.abs(f.scaleY)*F+(I-Math.abs(f.data.scaleY)*F)*R}}}}l.ScaleTimeline=h;class r extends a{constructor(p){super(p)}getPropertyId(){return(s.shear<<24)+this.boneIndex}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.bones[this.boneIndex];if(!f.active)return;if(x=E[E.length-r.ENTRIES])V=E[E.length+r.PREV_X],I=E[E.length+r.PREV_Y];else{let C=T.binarySearch(E,x,r.ENTRIES);V=E[C+r.PREV_X],I=E[C+r.PREV_Y];let F=E[C],N=this.getCurvePercent(C/r.ENTRIES-1,1-(x-F)/(E[C+r.PREV_TIME]-F));V=V+(E[C+r.X]-V)*N,I=I+(E[C+r.Y]-I)*N}switch(U){case v.setup:f.shearX=f.data.shearX+V*R,f.shearY=f.data.shearY+I*R;break;case v.first:case v.replace:f.shearX+=(f.data.shearX+V-f.shearX)*R,f.shearY+=(f.data.shearY+I-f.shearY)*R;break;case v.add:f.shearX+=V*R,f.shearY+=I*R}}}l.ShearTimeline=r;class n extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p*n.ENTRIES)}getPropertyId(){return(s.color<<24)+this.slotIndex}setFrame(p,A,x,k,R,U){p*=n.ENTRIES,this.frames[p]=A,this.frames[p+n.R]=x,this.frames[p+n.G]=k,this.frames[p+n.B]=R,this.frames[p+n.A]=U}apply(p,A,x,k,R,U,Y){let E=p.slots[this.slotIndex];if(!E.bone.active)return;let f=this.frames;if(x=f[f.length-n.ENTRIES]){let N=f.length;V=f[N+n.PREV_R],I=f[N+n.PREV_G],C=f[N+n.PREV_B],F=f[N+n.PREV_A]}else{let N=T.binarySearch(f,x,n.ENTRIES);V=f[N+n.PREV_R],I=f[N+n.PREV_G],C=f[N+n.PREV_B],F=f[N+n.PREV_A];let X=f[N],W=this.getCurvePercent(N/n.ENTRIES-1,1-(x-X)/(f[N+n.PREV_TIME]-X));V+=(f[N+n.R]-V)*W,I+=(f[N+n.G]-I)*W,C+=(f[N+n.B]-C)*W,F+=(f[N+n.A]-F)*W}if(R==1)E.color.set(V,I,C,F);else{let N=E.color;U==v.setup&&N.setFromColor(E.data.color),N.add((V-N.r)*R,(I-N.g)*R,(C-N.b)*R,(F-N.a)*R)}}}n.ENTRIES=5,n.PREV_TIME=-5,n.PREV_R=-4,n.PREV_G=-3,n.PREV_B=-2,n.PREV_A=-1,n.R=1,n.G=2,n.B=3,n.A=4,l.ColorTimeline=n;class i extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p*i.ENTRIES)}getPropertyId(){return(s.twoColor<<24)+this.slotIndex}setFrame(p,A,x,k,R,U,Y,E,f){p*=i.ENTRIES,this.frames[p]=A,this.frames[p+i.R]=x,this.frames[p+i.G]=k,this.frames[p+i.B]=R,this.frames[p+i.A]=U,this.frames[p+i.R2]=Y,this.frames[p+i.G2]=E,this.frames[p+i.B2]=f}apply(p,A,x,k,R,U,Y){let E=p.slots[this.slotIndex];if(!E.bone.active)return;let f=this.frames;if(x=f[f.length-i.ENTRIES]){let B=f.length;V=f[B+i.PREV_R],I=f[B+i.PREV_G],C=f[B+i.PREV_B],F=f[B+i.PREV_A],N=f[B+i.PREV_R2],X=f[B+i.PREV_G2],W=f[B+i.PREV_B2]}else{let B=T.binarySearch(f,x,i.ENTRIES);V=f[B+i.PREV_R],I=f[B+i.PREV_G],C=f[B+i.PREV_B],F=f[B+i.PREV_A],N=f[B+i.PREV_R2],X=f[B+i.PREV_G2],W=f[B+i.PREV_B2];let q=f[B],G=this.getCurvePercent(B/i.ENTRIES-1,1-(x-q)/(f[B+i.PREV_TIME]-q));V+=(f[B+i.R]-V)*G,I+=(f[B+i.G]-I)*G,C+=(f[B+i.B]-C)*G,F+=(f[B+i.A]-F)*G,N+=(f[B+i.R2]-N)*G,X+=(f[B+i.G2]-X)*G,W+=(f[B+i.B2]-W)*G}if(R==1)E.color.set(V,I,C,F),E.darkColor.set(N,X,W,1);else{let B=E.color,q=E.darkColor;U==v.setup&&(B.setFromColor(E.data.color),q.setFromColor(E.data.darkColor)),B.add((V-B.r)*R,(I-B.g)*R,(C-B.b)*R,(F-B.a)*R),q.add((N-q.r)*R,(X-q.g)*R,(W-q.b)*R,0)}}}i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,l.TwoColorTimeline=i;class c{constructor(p){this.frames=l.Utils.newFloatArray(p),this.attachmentNames=new Array(p)}getPropertyId(){return(s.attachment<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(p,A,x){this.frames[p]=A,this.attachmentNames[p]=x}apply(p,A,x,k,R,U,Y){let E=p.slots[this.slotIndex];if(!E.bone.active)return;if(Y==e.mixOut){U==v.setup&&this.setAttachment(p,E,E.data.attachmentName);return}let f=this.frames;if(x=f[f.length-1]?V=f.length-1:V=T.binarySearch(f,x,1)-1;let I=this.attachmentNames[V];p.slots[this.slotIndex].setAttachment(I==null?null:p.getAttachment(this.slotIndex,I))}setAttachment(p,A,x){A.attachment=x==null?null:p.getAttachment(this.slotIndex,x)}}l.AttachmentTimeline=c;let u=null;class d extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p),this.frameVertices=new Array(p),u==null&&(u=l.Utils.newFloatArray(64))}getPropertyId(){return(s.deform<<27)+ +this.attachment.id+this.slotIndex}setFrame(p,A,x){this.frames[p]=A,this.frameVertices[p]=x}apply(p,A,x,k,R,U,Y){let E=p.slots[this.slotIndex];if(!E.bone.active)return;let f=E.getAttachment();if(!(f instanceof l.VertexAttachment)||f.deformAttachment!=this.attachment)return;let V=E.deform;V.length==0&&(U=v.setup);let I=this.frameVertices,C=I[0].length,F=this.frames;if(x=F[F.length-1]){let D=I[F.length-1];if(R==1)if(U==v.add){let O=f;if(O.bones==null){let L=O.vertices;for(let $=0;$x)this.apply(p,A,Number.MAX_VALUE,k,R,U,Y),A=-1;else if(A>=E[f-1])return;if(x0&&E[V-1]==I;)V--}for(;V=E[V];V++)k.push(this.events[V])}}l.EventTimeline=m;class g{constructor(p){this.frames=l.Utils.newFloatArray(p),this.drawOrders=new Array(p)}getPropertyId(){return s.drawOrder<<24}getFrameCount(){return this.frames.length}setFrame(p,A,x){this.frames[p]=A,this.drawOrders[p]=x}apply(p,A,x,k,R,U,Y){let E=p.drawOrder,f=p.slots;if(Y==e.mixOut){U==v.setup&&l.Utils.arrayCopy(p.slots,0,p.drawOrder,0,p.slots.length);return}let V=this.frames;if(x=V[V.length-1]?I=V.length-1:I=T.binarySearch(V,x)-1;let C=this.drawOrders[I];if(C==null)l.Utils.arrayCopy(f,0,E,0,f.length);else for(let F=0,N=C.length;F=E[E.length-w.ENTRIES]){U==v.setup?(f.mix=f.data.mix+(E[E.length+w.PREV_MIX]-f.data.mix)*R,f.softness=f.data.softness+(E[E.length+w.PREV_SOFTNESS]-f.data.softness)*R,Y==e.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=E[E.length+w.PREV_BEND_DIRECTION],f.compress=E[E.length+w.PREV_COMPRESS]!=0,f.stretch=E[E.length+w.PREV_STRETCH]!=0)):(f.mix+=(E[E.length+w.PREV_MIX]-f.mix)*R,f.softness+=(E[E.length+w.PREV_SOFTNESS]-f.softness)*R,Y==e.mixIn&&(f.bendDirection=E[E.length+w.PREV_BEND_DIRECTION],f.compress=E[E.length+w.PREV_COMPRESS]!=0,f.stretch=E[E.length+w.PREV_STRETCH]!=0));return}let V=T.binarySearch(E,x,w.ENTRIES),I=E[V+w.PREV_MIX],C=E[V+w.PREV_SOFTNESS],F=E[V],N=this.getCurvePercent(V/w.ENTRIES-1,1-(x-F)/(E[V+w.PREV_TIME]-F));U==v.setup?(f.mix=f.data.mix+(I+(E[V+w.MIX]-I)*N-f.data.mix)*R,f.softness=f.data.softness+(C+(E[V+w.SOFTNESS]-C)*N-f.data.softness)*R,Y==e.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=E[V+w.PREV_BEND_DIRECTION],f.compress=E[V+w.PREV_COMPRESS]!=0,f.stretch=E[V+w.PREV_STRETCH]!=0)):(f.mix+=(I+(E[V+w.MIX]-I)*N-f.mix)*R,f.softness+=(C+(E[V+w.SOFTNESS]-C)*N-f.softness)*R,Y==e.mixIn&&(f.bendDirection=E[V+w.PREV_BEND_DIRECTION],f.compress=E[V+w.PREV_COMPRESS]!=0,f.stretch=E[V+w.PREV_STRETCH]!=0))}}w.ENTRIES=6,w.PREV_TIME=-6,w.PREV_MIX=-5,w.PREV_SOFTNESS=-4,w.PREV_BEND_DIRECTION=-3,w.PREV_COMPRESS=-2,w.PREV_STRETCH=-1,w.MIX=1,w.SOFTNESS=2,w.BEND_DIRECTION=3,w.COMPRESS=4,w.STRETCH=5,l.IkConstraintTimeline=w;class M extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p*M.ENTRIES)}getPropertyId(){return(s.transformConstraint<<24)+this.transformConstraintIndex}setFrame(p,A,x,k,R,U){p*=M.ENTRIES,this.frames[p]=A,this.frames[p+M.ROTATE]=x,this.frames[p+M.TRANSLATE]=k,this.frames[p+M.SCALE]=R,this.frames[p+M.SHEAR]=U}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.transformConstraints[this.transformConstraintIndex];if(!f.active)return;if(x=E[E.length-M.ENTRIES]){let N=E.length;V=E[N+M.PREV_ROTATE],I=E[N+M.PREV_TRANSLATE],C=E[N+M.PREV_SCALE],F=E[N+M.PREV_SHEAR]}else{let N=T.binarySearch(E,x,M.ENTRIES);V=E[N+M.PREV_ROTATE],I=E[N+M.PREV_TRANSLATE],C=E[N+M.PREV_SCALE],F=E[N+M.PREV_SHEAR];let X=E[N],W=this.getCurvePercent(N/M.ENTRIES-1,1-(x-X)/(E[N+M.PREV_TIME]-X));V+=(E[N+M.ROTATE]-V)*W,I+=(E[N+M.TRANSLATE]-I)*W,C+=(E[N+M.SCALE]-C)*W,F+=(E[N+M.SHEAR]-F)*W}if(U==v.setup){let N=f.data;f.rotateMix=N.rotateMix+(V-N.rotateMix)*R,f.translateMix=N.translateMix+(I-N.translateMix)*R,f.scaleMix=N.scaleMix+(C-N.scaleMix)*R,f.shearMix=N.shearMix+(F-N.shearMix)*R}else f.rotateMix+=(V-f.rotateMix)*R,f.translateMix+=(I-f.translateMix)*R,f.scaleMix+=(C-f.scaleMix)*R,f.shearMix+=(F-f.shearMix)*R}}M.ENTRIES=5,M.PREV_TIME=-5,M.PREV_ROTATE=-4,M.PREV_TRANSLATE=-3,M.PREV_SCALE=-2,M.PREV_SHEAR=-1,M.ROTATE=1,M.TRANSLATE=2,M.SCALE=3,M.SHEAR=4,l.TransformConstraintTimeline=M;class S extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p*S.ENTRIES)}getPropertyId(){return(s.pathConstraintPosition<<24)+this.pathConstraintIndex}setFrame(p,A,x){p*=S.ENTRIES,this.frames[p]=A,this.frames[p+S.VALUE]=x}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.pathConstraints[this.pathConstraintIndex];if(!f.active)return;if(x=E[E.length-S.ENTRIES])V=E[E.length+S.PREV_VALUE];else{let I=T.binarySearch(E,x,S.ENTRIES);V=E[I+S.PREV_VALUE];let C=E[I],F=this.getCurvePercent(I/S.ENTRIES-1,1-(x-C)/(E[I+S.PREV_TIME]-C));V+=(E[I+S.VALUE]-V)*F}U==v.setup?f.position=f.data.position+(V-f.data.position)*R:f.position+=(V-f.position)*R}}S.ENTRIES=2,S.PREV_TIME=-2,S.PREV_VALUE=-1,S.VALUE=1,l.PathConstraintPositionTimeline=S;class y extends S{constructor(p){super(p)}getPropertyId(){return(s.pathConstraintSpacing<<24)+this.pathConstraintIndex}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.pathConstraints[this.pathConstraintIndex];if(!f.active)return;if(x=E[E.length-y.ENTRIES])V=E[E.length+y.PREV_VALUE];else{let I=T.binarySearch(E,x,y.ENTRIES);V=E[I+y.PREV_VALUE];let C=E[I],F=this.getCurvePercent(I/y.ENTRIES-1,1-(x-C)/(E[I+y.PREV_TIME]-C));V+=(E[I+y.VALUE]-V)*F}U==v.setup?f.spacing=f.data.spacing+(V-f.data.spacing)*R:f.spacing+=(V-f.spacing)*R}}l.PathConstraintSpacingTimeline=y;class P extends o{constructor(p){super(p),this.frames=l.Utils.newFloatArray(p*P.ENTRIES)}getPropertyId(){return(s.pathConstraintMix<<24)+this.pathConstraintIndex}setFrame(p,A,x,k){p*=P.ENTRIES,this.frames[p]=A,this.frames[p+P.ROTATE]=x,this.frames[p+P.TRANSLATE]=k}apply(p,A,x,k,R,U,Y){let E=this.frames,f=p.pathConstraints[this.pathConstraintIndex];if(!f.active)return;if(x=E[E.length-P.ENTRIES])V=E[E.length+P.PREV_ROTATE],I=E[E.length+P.PREV_TRANSLATE];else{let C=T.binarySearch(E,x,P.ENTRIES);V=E[C+P.PREV_ROTATE],I=E[C+P.PREV_TRANSLATE];let F=E[C],N=this.getCurvePercent(C/P.ENTRIES-1,1-(x-F)/(E[C+P.PREV_TIME]-F));V+=(E[C+P.ROTATE]-V)*N,I+=(E[C+P.TRANSLATE]-I)*N}U==v.setup?(f.rotateMix=f.data.rotateMix+(V-f.data.rotateMix)*R,f.translateMix=f.data.translateMix+(I-f.data.translateMix)*R):(f.rotateMix+=(V-f.rotateMix)*R,f.translateMix+=(I-f.translateMix)*R)}}P.ENTRIES=3,P.PREV_TIME=-3,P.PREV_ROTATE=-2,P.PREV_TRANSLATE=-1,P.ROTATE=1,P.TRANSLATE=2,l.PathConstraintMixTimeline=P})(spine||(spine={}));var spine;(function(l){class T{constructor(a){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new e(this),this.propertyIDs=new l.IntSet,this.animationsChanged=!1,this.trackEntryPool=new l.Pool(()=>new v),this.data=a}update(a){a*=this.timeScale;let h=this.tracks;for(let r=0,n=h.length;r0){if(i.delay-=c,i.delay>0)continue;c=-i.delay,i.delay=0}let u=i.next;if(u!=null){let d=i.trackLast-u.delay;if(d>=0){for(u.delay=0,u.trackTime+=i.timeScale==0?0:(d/i.timeScale+a)*u.timeScale,i.trackTime+=c,this.setCurrent(r,u,!0);u.mixingFrom!=null;)u.mixTime+=a,u=u.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&i.mixingFrom==null){h[r]=null,this.queue.end(i),this.disposeNext(i);continue}if(i.mixingFrom!=null&&this.updateMixingFrom(i,a)){let d=i.mixingFrom;for(i.mixingFrom=null,d!=null&&(d.mixingTo=null);d!=null;)this.queue.end(d),d=d.mixingFrom}i.trackTime+=c}this.queue.drain()}updateMixingFrom(a,h){let r=a.mixingFrom;if(r==null)return!0;let n=this.updateMixingFrom(r,h);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,a.mixTime>0&&a.mixTime>=a.mixDuration?((r.totalAlpha==0||a.mixDuration==0)&&(a.mixingFrom=r.mixingFrom,r.mixingFrom!=null&&(r.mixingFrom.mixingTo=a),a.interruptAlpha=r.interruptAlpha,this.queue.end(r)),n):(r.trackTime+=h*r.timeScale,a.mixTime+=h,!1)}apply(a){if(a==null)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let h=this.events,r=this.tracks,n=!1;for(let M=0,S=r.length;M0)continue;n=!0;let P=M==0?l.MixBlend.first:y.mixBlend,b=y.alpha;y.mixingFrom!=null?b*=this.applyMixingFrom(y,a,P):y.trackTime>=y.trackEnd&&y.next==null&&(b=0);let p=y.animationLast,A=y.getAnimationTime(),x=y.animation.timelines.length,k=y.animation.timelines;if(M==0&&b==1||P==l.MixBlend.add)for(let R=0;R1&&(i=1),r!=l.MixBlend.first&&(r=n.mixBlend));let c=i0&&this.queueEvents(n,g),this.events.length=0,n.nextAnimationLast=g,n.nextTrackLast=n.trackTime,i}applyAttachmentTimeline(a,h,r,n,i){var c=h.slots[a.slotIndex];if(c.bone.active){var u=a.frames;if(r=u[u.length-1]?d=u.length-1:d=l.Animation.binarySearch(u,r)-1,this.setAttachment(h,c,a.attachmentNames[d],i)}c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+T.SETUP)}}setAttachment(a,h,r,n){h.setAttachment(r==null?null:a.getAttachment(h.data.index,r)),n&&(h.attachmentState=this.unkeyedState+T.CURRENT)}applyRotateTimeline(a,h,r,n,i,c,u,d){if(d&&(c[u]=0),n==1){a.apply(h,0,r,null,1,i,l.MixDirection.mixIn);return}let m=a,g=m.frames,w=h.bones[m.boneIndex];if(!w.active)return;let M=0,S=0;if(r=g[g.length-l.RotateTimeline.ENTRIES])S=w.data.rotation+g[g.length+l.RotateTimeline.PREV_ROTATION];else{let b=l.Animation.binarySearch(g,r,l.RotateTimeline.ENTRIES),p=g[b+l.RotateTimeline.PREV_ROTATION],A=g[b],x=m.getCurvePercent((b>>1)-1,1-(r-A)/(g[b+l.RotateTimeline.PREV_TIME]-A));S=g[b+l.RotateTimeline.ROTATION]-p,S-=(16384-(16384.499999999996-S/360|0))*360,S=p+S*x+w.data.rotation,S-=(16384-(16384.499999999996-S/360|0))*360}let y=0,P=S-M;if(P-=(16384-(16384.499999999996-P/360|0))*360,P==0)y=c[u];else{let b=0,p=0;d?(b=0,p=P):(b=c[u],p=c[u+1]);let A=P>0,x=b>=0;l.MathUtils.signum(p)!=l.MathUtils.signum(P)&&Math.abs(p)<=90&&(Math.abs(b)>180&&(b+=360*l.MathUtils.signum(b)),x=A),y=P+b-b%360,x!=A&&(y+=360*l.MathUtils.signum(b)),c[u]=y}c[u+1]=P,M+=y*n,w.rotation=M-(16384-(16384.499999999996-M/360|0))*360}queueEvents(a,h){let r=a.animationStart,n=a.animationEnd,i=n-r,c=a.trackLast%i,u=this.events,d=0,m=u.length;for(;dn||this.queue.event(a,w)}let g=!1;for(a.loop?g=i==0||c>a.trackTime%i:g=h>=n&&a.animationLast=this.tracks.length)return;let h=this.tracks[a];if(h==null)return;this.queue.end(h),this.disposeNext(h);let r=h;for(;;){let n=r.mixingFrom;if(n==null)break;this.queue.end(n),r.mixingFrom=null,r.mixingTo=null,r=n}this.tracks[h.trackIndex]=null,this.queue.drain()}setCurrent(a,h,r){let n=this.expandToIndex(a);this.tracks[a]=h,n!=null&&(r&&this.queue.interrupt(n),h.mixingFrom=n,n.mixingTo=h,h.mixTime=0,n.mixingFrom!=null&&n.mixDuration>0&&(h.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(h)}setAnimation(a,h,r){let n=this.data.skeletonData.findAnimation(h);if(n==null)throw new Error("Animation not found: "+h);return this.setAnimationWith(a,n,r)}setAnimationWith(a,h,r){if(h==null)throw new Error("animation cannot be null.");let n=!0,i=this.expandToIndex(a);i!=null&&(i.nextTrackLast==-1?(this.tracks[a]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.disposeNext(i),i=i.mixingFrom,n=!1):this.disposeNext(i));let c=this.trackEntry(a,h,r,i);return this.setCurrent(a,c,n),this.queue.drain(),c}addAnimation(a,h,r,n){let i=this.data.skeletonData.findAnimation(h);if(i==null)throw new Error("Animation not found: "+h);return this.addAnimationWith(a,i,r,n)}addAnimationWith(a,h,r,n){if(h==null)throw new Error("animation cannot be null.");let i=this.expandToIndex(a);if(i!=null)for(;i.next!=null;)i=i.next;let c=this.trackEntry(a,h,r,i);if(i==null)this.setCurrent(a,c,!0),this.queue.drain();else if(i.next=c,n<=0){let u=i.animationEnd-i.animationStart;u!=0?(i.loop?n+=u*(1+(i.trackTime/u|0)):n+=Math.max(u,i.trackTime),n-=this.data.getMix(i.animation,h)):n=i.trackTime}return c.delay=n,c}setEmptyAnimation(a,h){let r=this.setAnimationWith(a,T.emptyAnimation,!1);return r.mixDuration=h,r.trackEnd=h,r}addEmptyAnimation(a,h,r){r<=0&&(r-=h);let n=this.addAnimationWith(a,T.emptyAnimation,!1,r);return n.mixDuration=h,n.trackEnd=h,n}setEmptyAnimations(a){let h=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let r=0,n=this.tracks.length;r0){i[d]=T.HOLD_MIX,c[d]=w;continue t}break}i[d]=T.HOLD_FIRST}}}getCurrent(a){return a>=this.tracks.length?null:this.tracks[a]}addListener(a){if(a==null)throw new Error("listener cannot be null.");this.listeners.push(a)}removeListener(a){let h=this.listeners.indexOf(a);h>=0&&this.listeners.splice(h,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}T.emptyAnimation=new l.Animation("",[],0),T.SUBSEQUENT=0,T.FIRST=1,T.HOLD_SUBSEQUENT=2,T.HOLD_FIRST=3,T.HOLD_MIX=4,T.SETUP=1,T.CURRENT=2,l.AnimationState=T;class v{constructor(){this.mixBlend=l.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}reset(){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}getAnimationTime(){if(this.loop){let a=this.animationEnd-this.animationStart;return a==0?this.animationStart:this.trackTime%a+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(a){this.animationLast=a,this.nextAnimationLast=a}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}}l.TrackEntry=v;class e{constructor(a){this.objects=[],this.drainDisabled=!1,this.animState=a}start(a){this.objects.push(s.start),this.objects.push(a),this.animState.animationsChanged=!0}interrupt(a){this.objects.push(s.interrupt),this.objects.push(a)}end(a){this.objects.push(s.end),this.objects.push(a),this.animState.animationsChanged=!0}dispose(a){this.objects.push(s.dispose),this.objects.push(a)}complete(a){this.objects.push(s.complete),this.objects.push(a)}event(a,h){this.objects.push(s.event),this.objects.push(a),this.objects.push(h)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let a=this.objects,h=this.animState.listeners;for(let r=0;r{a?s(t.loader.getRes(e)):o("download text error: ",e)}))}downloadBinary(e,s,o){let t=window.Laya.Laya?window.Laya.Laya:Laya;t.loader.load([{type:t.Loader.BUFFER,url:e}],t.Handler.create(this,a=>{a?s(new Uint8Array(t.loader.getRes(e))):o("download binary error: ",e)}))}setRawDataURI(e,s){this.rawDataUris[this.pathPrefix+e]=s}loadBinary(e,s=null,o=null){e=this.pathPrefix+e,this.toLoad++,this.downloadBinary(e,t=>{this.assets[e]=t,s&&s(e,t),this.toLoad--,this.loaded++},(t,a)=>{this.errors[e]=`Couldn't load binary ${e}: status ${t}, ${a}`,o&&o(e,`Couldn't load binary ${e}: status ${t}, ${a}`),this.toLoad--,this.loaded++})}loadText(e,s=null,o=null){e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,t=>{this.assets[e]=t,s&&s(e,t),this.toLoad--,this.loaded++},(t,a)=>{this.errors[e]=`Couldn't load text ${e}: status ${status}, ${a}`,o&&o(e,`Couldn't load text ${e}: status ${status}, ${a}`),this.toLoad--,this.loaded++})}loadTexture(e,s=null,o=null){e=this.pathPrefix+e;let t=e;this.toLoad++;let a=window.Laya.Laya?window.Laya.Laya:Laya;a.loader.load([{type:a.Loader.IMAGE,url:e}],a.Handler.create(this,h=>{if(h){let r=this.textureLoader(a.loader.getRes(e));this.assets[e]=r,this.toLoad--,this.loaded++,s&&s(e,r)}else this.errors[e]=`Couldn't load image ${e}`,this.toLoad--,this.loaded++,o&&o(e,`Couldn't load image ${e}`)}))}loadTextureAtlas(e,s=null,o=null){let t=e.lastIndexOf("/")>=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,a=>{let h={count:0},r=new Array;try{let n=new l.TextureAtlas(a,i=>{r.push(t==""?i:t+"/"+i);let c=document.createElement("img");return new l.FakeTexture(c)})}catch(n){let i=n;this.errors[e]=`Couldn't load texture atlas ${e}: ${i.message}`,o&&o(e,`Couldn't load texture atlas ${e}: ${i.message}`),this.toLoad--,this.loaded++;return}for(let n of r){let i=!1;this.loadTexture(n,(c,u)=>{if(h.count++,h.count==r.length)if(i)this.errors[e]=`Couldn't load texture atlas page ${c}} of atlas ${e}`,o&&o(e,`Couldn't load texture atlas page ${c} of atlas ${e}`),this.toLoad--,this.loaded++;else try{let d=new l.TextureAtlas(a,m=>this.get(t==""?m:t+"/"+m));this.assets[e]=d,s&&s(e,d),this.toLoad--,this.loaded++}catch(d){let m=d;this.errors[e]=`Couldn't load texture atlas ${e}: ${m.message}`,o&&o(e,`Couldn't load texture atlas ${e}: ${m.message}`),this.toLoad--,this.loaded++}},(c,u)=>{i=!0,h.count++,h.count==r.length&&(this.errors[e]=`Couldn't load texture atlas page ${c}} of atlas ${e}`,o&&o(e,`Couldn't load texture atlas page ${c} of atlas ${e}`),this.toLoad--,this.loaded++)})}},(a,h)=>{this.errors[e]=`Couldn't load texture atlas ${e}: status ${status}, ${h}`,o&&o(e,`Couldn't load texture atlas ${e}: status ${status}, ${h}`),this.toLoad--,this.loaded++})}get(e){return e=this.pathPrefix+e,this.assets[e]}remove(e){e=this.pathPrefix+e;let s=this.assets[e];s.dispose&&s.dispose(),this.assets[e]=null}removeAll(){for(let e in this.assets){let s=this.assets[e];s.dispose&&s.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}}l.AssetManager=T})(spine||(spine={}));var spine;(function(l){class T{constructor(e){this.atlas=e}newRegionAttachment(e,s,o){let t=this.atlas.findRegion(o);if(t==null)throw new Error("Region not found in atlas: "+o+" (region attachment: "+s+")");t.renderObject=t;let a=new l.RegionAttachment(s);return a.setRegion(t),a}newMeshAttachment(e,s,o){let t=this.atlas.findRegion(o);if(t==null)throw new Error("Region not found in atlas: "+o+" (mesh attachment: "+s+")");t.renderObject=t;let a=new l.MeshAttachment(s);return a.region=t,a}newBoundingBoxAttachment(e,s){return new l.BoundingBoxAttachment(s)}newPathAttachment(e,s){return new l.PathAttachment(s)}newPointAttachment(e,s){return new l.PointAttachment(s)}newClippingAttachment(e,s){return new l.ClippingAttachment(s)}}l.AtlasAttachmentLoader=T})(spine||(spine={}));var spine;(function(l){let T;(function(v){v[v.Normal=0]="Normal",v[v.Additive=1]="Additive",v[v.Multiply=2]="Multiply",v[v.Screen=3]="Screen"})(T=l.BlendMode||(l.BlendMode={}))})(spine||(spine={}));var spine;(function(l){class T{constructor(e,s,o){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,e==null)throw new Error("data cannot be null.");if(s==null)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=s,this.parent=o,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,s,o,t,a,h,r){this.ax=e,this.ay=s,this.arotation=o,this.ascaleX=t,this.ascaleY=a,this.ashearX=h,this.ashearY=r,this.appliedValid=!0;let n=this.parent;if(n==null){let m=this.skeleton,g=o+90+r,w=m.scaleX,M=m.scaleY;this.a=l.MathUtils.cosDeg(o+h)*t*w,this.b=l.MathUtils.cosDeg(g)*a*w,this.c=l.MathUtils.sinDeg(o+h)*t*M,this.d=l.MathUtils.sinDeg(g)*a*M,this.worldX=e*w+m.x,this.worldY=s*M+m.y;return}let i=n.a,c=n.b,u=n.c,d=n.d;switch(this.worldX=i*e+c*s+n.worldX,this.worldY=u*e+d*s+n.worldY,this.data.transformMode){case l.TransformMode.Normal:{let m=o+90+r,g=l.MathUtils.cosDeg(o+h)*t,w=l.MathUtils.cosDeg(m)*a,M=l.MathUtils.sinDeg(o+h)*t,S=l.MathUtils.sinDeg(m)*a;this.a=i*g+c*M,this.b=i*w+c*S,this.c=u*g+d*M,this.d=u*w+d*S;return}case l.TransformMode.OnlyTranslation:{let m=o+90+r;this.a=l.MathUtils.cosDeg(o+h)*t,this.b=l.MathUtils.cosDeg(m)*a,this.c=l.MathUtils.sinDeg(o+h)*t,this.d=l.MathUtils.sinDeg(m)*a;break}case l.TransformMode.NoRotationOrReflection:{let m=i*i+u*u,g=0;m>1e-4?(m=Math.abs(i*d-c*u)/m,i/=this.skeleton.scaleX,u/=this.skeleton.scaleY,c=u*m,d=i*m,g=Math.atan2(u,i)*l.MathUtils.radDeg):(i=0,u=0,g=90-Math.atan2(d,c)*l.MathUtils.radDeg);let w=o+h-g,M=o+r-g+90,S=l.MathUtils.cosDeg(w)*t,y=l.MathUtils.cosDeg(M)*a,P=l.MathUtils.sinDeg(w)*t,b=l.MathUtils.sinDeg(M)*a;this.a=i*S-c*P,this.b=i*y-c*b,this.c=u*S+d*P,this.d=u*y+d*b;break}case l.TransformMode.NoScale:case l.TransformMode.NoScaleOrReflection:{let m=l.MathUtils.cosDeg(o),g=l.MathUtils.sinDeg(o),w=(i*m+c*g)/this.skeleton.scaleX,M=(u*m+d*g)/this.skeleton.scaleY,S=Math.sqrt(w*w+M*M);S>1e-5&&(S=1/S),w*=S,M*=S,S=Math.sqrt(w*w+M*M),this.data.transformMode==l.TransformMode.NoScale&&i*d-c*u<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(S=-S);let y=Math.PI/2+Math.atan2(M,w),P=Math.cos(y)*S,b=Math.sin(y)*S,p=l.MathUtils.cosDeg(h)*t,A=l.MathUtils.cosDeg(90+r)*a,x=l.MathUtils.sinDeg(h)*t,k=l.MathUtils.sinDeg(90+r)*a;this.a=w*p+P*x,this.b=w*A+P*k,this.c=M*p+b*x,this.d=M*A+b*k;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY}getWorldRotationX(){return Math.atan2(this.c,this.a)*l.MathUtils.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*l.MathUtils.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}updateAppliedTransform(){this.appliedValid=!0;let e=this.parent;if(e==null){this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*l.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*l.MathUtils.radDeg;return}let s=e.a,o=e.b,t=e.c,a=e.d,h=1/(s*a-o*t),r=this.worldX-e.worldX,n=this.worldY-e.worldY;this.ax=r*a*h-n*o*h,this.ay=n*s*h-r*t*h;let i=h*a,c=h*s,u=h*o,d=h*t,m=i*this.a-u*this.c,g=i*this.b-u*this.d,w=c*this.c-d*this.a,M=c*this.d-d*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(m*m+w*w),this.ascaleX>1e-4){let S=m*M-g*w;this.ascaleY=S/this.ascaleX,this.ashearY=Math.atan2(m*g+w*M,S)*l.MathUtils.radDeg,this.arotation=Math.atan2(w,m)*l.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(g*g+M*M),this.ashearY=0,this.arotation=90-Math.atan2(M,g)*l.MathUtils.radDeg}worldToLocal(e){let s=this.a,o=this.b,t=this.c,a=this.d,h=1/(s*a-o*t),r=e.x-this.worldX,n=e.y-this.worldY;return e.x=r*a*h-n*o*h,e.y=n*s*h-r*t*h,e}localToWorld(e){let s=e.x,o=e.y;return e.x=s*this.a+o*this.b+this.worldX,e.y=s*this.c+o*this.d+this.worldY,e}worldToLocalRotation(e){let s=l.MathUtils.sinDeg(e),o=l.MathUtils.cosDeg(e);return Math.atan2(this.a*s-this.c*o,this.d*o-this.b*s)*l.MathUtils.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=l.MathUtils.sinDeg(e),o=l.MathUtils.cosDeg(e);return Math.atan2(o*this.c+s*this.d,o*this.a+s*this.b)*l.MathUtils.radDeg}rotateWorld(e){let s=this.a,o=this.b,t=this.c,a=this.d,h=l.MathUtils.cosDeg(e),r=l.MathUtils.sinDeg(e);this.a=h*s-r*t,this.b=h*o-r*a,this.c=r*s+h*t,this.d=r*o+h*a,this.appliedValid=!1}}l.Bone=T})(spine||(spine={}));var spine;(function(l){class T{constructor(s,o,t){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=v.Normal,this.skinRequired=!1,this.color=new l.Color,s<0)throw new Error("index must be >= 0.");if(o==null)throw new Error("name cannot be null.");this.index=s,this.name=o,this.parent=t}}l.BoneData=T;let v;(function(e){e[e.Normal=0]="Normal",e[e.OnlyTranslation=1]="OnlyTranslation",e[e.NoRotationOrReflection=2]="NoRotationOrReflection",e[e.NoScale=3]="NoScale",e[e.NoScaleOrReflection=4]="NoScaleOrReflection"})(v=l.TransformMode||(l.TransformMode={}))})(spine||(spine={}));var spine;(function(l){class T{constructor(e,s,o){this.name=e,this.order=s,this.skinRequired=o}}l.ConstraintData=T})(spine||(spine={}));var spine;(function(l){class T{constructor(e,s){if(s==null)throw new Error("data cannot be null.");this.time=e,this.data=s}}l.Event=T})(spine||(spine={}));var spine;(function(l){class T{constructor(e){this.name=e}}l.EventData=T})(spine||(spine={}));var spine;(function(l){class T{constructor(e,s){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,e==null)throw new Error("data cannot be null.");if(s==null)throw new Error("skeleton cannot be null.");this.data=e,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch,this.bones=new Array;for(let o=0;o180?m-=360:m<-180&&(m+=360);let M=e.ascaleX,S=e.ascaleY;if(t||a){switch(e.data.transformMode){case l.TransformMode.NoScale:case l.TransformMode.NoScaleOrReflection:g=s-e.worldX,w=o-e.worldY}let y=e.data.length*M,P=Math.sqrt(g*g+w*w);if(t&&Py&&y>1e-4){let b=(P/y-1)*r+1;M*=b,h&&(S*=b)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+m*r,M,S,e.ashearX,e.ashearY)}apply2(e,s,o,t,a,h,r,n){if(n==0){s.updateWorldTransform();return}e.appliedValid||e.updateAppliedTransform(),s.appliedValid||s.updateAppliedTransform();let i=e.ax,c=e.ay,u=e.ascaleX,d=u,m=e.ascaleY,g=s.ascaleX,w=0,M=0,S=0;u<0?(u=-u,w=180,S=-1):(w=0,S=1),m<0&&(m=-m,S=-S),g<0?(g=-g,M=180):M=0;let y=s.ax,P=0,b=0,p=0,A=e.a,x=e.b,k=e.c,R=e.d,U=Math.abs(u-m)<=1e-4;U?(P=s.ay,b=A*y+x*P+e.worldX,p=k*y+R*P+e.worldY):(P=0,b=A*y+e.worldX,p=k*y+e.worldY);let Y=e.parent;A=Y.a,x=Y.b,k=Y.c,R=Y.d;let E=1/(A*R-x*k),f=b-Y.worldX,V=p-Y.worldY,I=(f*R-V*x)*E-i,C=(V*A-f*k)*E-c,F=Math.sqrt(I*I+C*C),N=s.data.length*g,X,W;if(F<1e-4){this.apply1(e,o,t,!1,h,!1,n),s.updateWorldTransformWith(y,P,0,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY);return}f=o-Y.worldX,V=t-Y.worldY;let B=(f*R-V*x)*E-i,q=(V*A-f*k)*E-c,G=B*B+q*q;if(r!=0){r*=u*(g+1)/2;let O=Math.sqrt(G),L=O-F-N*u+r;if(L>0){let $=Math.min(1,L/(r*2))-1;$=(L-r*(1-$*$))/O,B-=$*B,q-=$*q,G=B*B+q*q}}t:if(U){N*=u;let O=(G-F*F-N*N)/(2*F*N);O<-1?O=-1:O>1&&(O=1,h&&(d*=(Math.sqrt(G)/(F+N)-1)*n+1)),W=Math.acos(O)*a,A=F+N*O,x=N*Math.sin(W),X=Math.atan2(q*A-B*x,B*A+q*x)}else{A=u*N,x=m*N;let O=A*A,L=x*x,$=Math.atan2(q,B);k=L*F*F+O*G-O*L;let j=-2*L*F,Z=L-O;if(R=j*j-4*Z*k,R>=0){let K=Math.sqrt(R);j<0&&(K=-K),K=-(j+K)/2;let rt=K/Z,nt=k/K,_=Math.abs(rt)=-1&&k<=1&&(k=Math.acos(k),f=A*Math.cos(k)+F,V=x*Math.sin(k),R=f*f+V*V,Ret&&(st=k,et=R,tt=f,it=V)),G<=(J+et)/2?(X=$-Math.atan2(at*a,z),W=Q*a):(X=$-Math.atan2(it*a,tt),W=st*a)}let H=Math.atan2(P,y)*S,D=e.arotation;X=(X-H)*l.MathUtils.radDeg+w-D,X>180?X-=360:X<-180&&(X+=360),e.updateWorldTransformWith(i,c,D+X*n,d,e.ascaleY,0,0),D=s.arotation,W=((W+H)*l.MathUtils.radDeg-s.ashearX)*S+M-D,W>180?W-=360:W<-180&&(W+=360),s.updateWorldTransformWith(y,P,D+W*n,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}}l.IkConstraint=T})(spine||(spine={}));var spine;(function(l){class T extends l.ConstraintData{constructor(e){super(e,0,!1),this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}}l.IkConstraintData=T})(spine||(spine={}));var spine;(function(l){class T{constructor(e,s){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,e==null)throw new Error("data cannot be null.");if(s==null)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let o=0,t=e.bones.length;o0,a=s>0;if(!t&&!a)return;let h=this.data,r=h.spacingMode==l.SpacingMode.Percent,n=h.rotateMode,i=n==l.RotateMode.Tangent,c=n==l.RotateMode.ChainScale,u=this.bones.length,d=i?u:u+1,m=this.bones,g=l.Utils.setArraySize(this.spaces,d),w=null,M=this.spacing;if(c||!r){c&&(w=l.Utils.setArraySize(this.lengths,u));let A=h.spacingMode==l.SpacingMode.Length;for(let x=0,k=d-1;x0?l.MathUtils.degRad:-l.MathUtils.degRad}for(let A=0,x=3;Al.MathUtils.PI?F-=l.MathUtils.PI2:F<-l.MathUtils.PI&&(F+=l.MathUtils.PI2),F*=s,N=Math.cos(F),X=Math.sin(F),k.a=N*f-X*I,k.b=N*V-X*C,k.c=X*f+N*I,k.d=X*V+N*C}k.appliedValid=!1}}computeWorldPositions(e,s,o,t,a){let h=this.target,r=this.position,n=this.spaces,i=l.Utils.setArraySize(this.positions,s*3+2),c=null,u=e.closed,d=e.worldVerticesLength,m=d/6,g=T.NONE;if(!e.constantSpeed){let X=e.lengths;m-=u?1:2;let W=X[m];if(t&&(r*=W),a)for(let B=1;BW){g!=T.AFTER&&(g=T.AFTER,e.computeWorldVertices(h,d-6,4,c,0,2)),this.addAfterPosition(D-W,c,0,i,q);continue}for(;;G++){let O=X[G];if(!(D>O)){if(G==0)D/=O;else{let L=X[G-1];D=(D-L)/(O-L)}break}}G!=g&&(g=G,u&&G==m?(e.computeWorldVertices(h,d-4,4,c,0,2),e.computeWorldVertices(h,0,4,c,4,2)):e.computeWorldVertices(h,G*6+2,8,c,0,2)),this.addCurvePosition(D,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],i,q,o||B>0&&H==0)}return i}u?(d+=2,c=l.Utils.setArraySize(this.world,d),e.computeWorldVertices(h,2,d-4,c,0,2),e.computeWorldVertices(h,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(m--,d-=4,c=l.Utils.setArraySize(this.world,d),e.computeWorldVertices(h,2,d,c,0,2));let w=l.Utils.setArraySize(this.curves,m),M=0,S=c[0],y=c[1],P=0,b=0,p=0,A=0,x=0,k=0,R=0,U=0,Y=0,E=0,f=0,V=0,I=0,C=0;for(let X=0,W=2;XM){this.addAfterPosition(H-M,c,d-4,i,W);continue}for(;;B++){let D=w[B];if(!(H>D)){if(B==0)H/=D;else{let O=w[B-1];H=(H-O)/(D-O)}break}}if(B!=g){g=B;let D=B*6;for(S=c[D],y=c[D+1],P=c[D+2],b=c[D+3],p=c[D+4],A=c[D+5],x=c[D+6],k=c[D+7],R=(S-P*2+p)*.03,U=(y-b*2+A)*.03,Y=((P-p)*3-S+x)*.006,E=((b-A)*3-y+k)*.006,f=R*2+Y,V=U*2+E,I=(P-S)*.3+R+Y*.16666667,C=(b-y)*.3+U+E*.16666667,N=Math.sqrt(I*I+C*C),F[0]=N,D=1;D<8;D++)I+=f,C+=V,f+=Y,V+=E,N+=Math.sqrt(I*I+C*C),F[D]=N;I+=f,C+=V,N+=Math.sqrt(I*I+C*C),F[8]=N,I+=f+Y,C+=V+E,N+=Math.sqrt(I*I+C*C),F[9]=N,q=0}for(H*=N;;q++){let D=F[q];if(!(H>D)){if(q==0)H/=D;else{let O=F[q-1];H=q+(H-O)/(D-O)}break}}this.addCurvePosition(H*.1,S,y,P,b,p,A,x,k,i,W,o||X>0&&G==0)}return i}addBeforePosition(e,s,o,t,a){let h=s[o],r=s[o+1],n=s[o+2]-h,i=s[o+3]-r,c=Math.atan2(i,n);t[a]=h+e*Math.cos(c),t[a+1]=r+e*Math.sin(c),t[a+2]=c}addAfterPosition(e,s,o,t,a){let h=s[o+2],r=s[o+3],n=h-s[o],i=r-s[o+1],c=Math.atan2(i,n);t[a]=h+e*Math.cos(c),t[a+1]=r+e*Math.sin(c),t[a+2]=c}addCurvePosition(e,s,o,t,a,h,r,n,i,c,u,d){if(e==0||isNaN(e)){c[u]=s,c[u+1]=o,c[u+2]=Math.atan2(a-o,t-s);return}let m=e*e,g=m*e,w=1-e,M=w*w,S=M*w,y=w*e,P=y*3,b=w*P,p=P*e,A=s*S+t*b+h*p+n*g,x=o*S+a*b+r*p+i*g;c[u]=A,c[u+1]=x,d&&(e<.001?c[u+2]=Math.atan2(a-o,t-s):c[u+2]=Math.atan2(x-(o*M+a*y*2+r*m),A-(s*M+t*y*2+h*m)))}}T.NONE=-1,T.BEFORE=-2,T.AFTER=-3,T.epsilon=1e-5,l.PathConstraint=T})(spine||(spine={}));var spine;(function(l){class T extends l.ConstraintData{constructor(t){super(t,0,!1),this.bones=new Array}}l.PathConstraintData=T;let v;(function(o){o[o.Fixed=0]="Fixed",o[o.Percent=1]="Percent"})(v=l.PositionMode||(l.PositionMode={}));let e;(function(o){o[o.Length=0]="Length",o[o.Fixed=1]="Fixed",o[o.Percent=2]="Percent"})(e=l.SpacingMode||(l.SpacingMode={}));let s;(function(o){o[o.Tangent=0]="Tangent",o[o.Chain=1]="Chain",o[o.ChainScale=2]="ChainScale"})(s=l.RotateMode||(l.RotateMode={}))})(spine||(spine={}));var spine;(function(l){class T{constructor(s){this.toLoad=new Array,this.assets={},this.clientId=s}loaded(){let s=0;for(let o in this.assets)s++;return s}}class v{constructor(s=""){this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=s}queueAsset(s,o,t){let a=this.clientAssets[s];return a==null&&(a=new T(s),this.clientAssets[s]=a),o!==null&&(a.textureLoader=o),a.toLoad.push(t),this.queuedAssets[t]===t?!1:(this.queuedAssets[t]=t,!0)}loadText(s,o){if(o=this.pathPrefix+o,!this.queueAsset(s,null,o))return;let t=new XMLHttpRequest;t.overrideMimeType("text/html"),t.onreadystatechange=()=>{t.readyState==XMLHttpRequest.DONE&&(t.status>=200&&t.status<300?this.rawAssets[o]=t.responseText:this.errors[o]=`Couldn't load text ${o}: status ${t.status}, ${t.responseText}`)},t.open("GET",o,!0),t.send()}loadJson(s,o){if(o=this.pathPrefix+o,!this.queueAsset(s,null,o))return;let t=new XMLHttpRequest;t.overrideMimeType("text/html"),t.onreadystatechange=()=>{t.readyState==XMLHttpRequest.DONE&&(t.status>=200&&t.status<300?this.rawAssets[o]=JSON.parse(t.responseText):this.errors[o]=`Couldn't load text ${o}: status ${t.status}, ${t.responseText}`)},t.open("GET",o,!0),t.send()}loadTexture(s,o,t){if(t=this.pathPrefix+t,!!this.queueAsset(s,o,t))if(!(typeof window<"u"&&typeof navigator<"u"&&window.document)&&typeof importScripts<"u")fetch(t,{mode:"cors"}).then(a=>(a.ok||(this.errors[t]="Couldn't load image "+t),a.blob())).then(a=>createImageBitmap(a,{premultiplyAlpha:"none",colorSpaceConversion:"none"})).then(a=>{this.rawAssets[t]=a});else{let a=new Image;a.crossOrigin="anonymous",a.onload=h=>{this.rawAssets[t]=a},a.onerror=h=>{this.errors[t]=`Couldn't load image ${t}`},a.src=t}}get(s,o){o=this.pathPrefix+o;let t=this.clientAssets[s];return t==null?!0:t.assets[o]}updateClientAssets(s){let o=!(typeof window<"u"&&typeof navigator<"u"&&window.document)&&typeof importScripts<"u";for(let t=0;t0}getErrors(){return this.errors}}l.SharedAssetManager=v})(spine||(spine={}));var spine;(function(l){class T{constructor(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,e==null)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let s=0;s1){let a=o[o.length-1];this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}this._updateCache.push(e),this.sortReset(t.children),o[o.length-1].sorted=!0}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin!=null&&l.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target,o=s.data.index,t=s.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,o,t),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,o,t);for(let n=0,i=this.data.skins.length;n-1||this.updateCacheReset.push(a)}else for(let t=0;t0){let g=new l.DrawOrderTimeline(d),w=h.slots.length;for(let M=0;M=0;x--)P[x]=-1;let b=l.Utils.newArray(w-y,0),p=0,A=0;for(let x=0;x=0;x--)P[x]==-1&&(P[x]=b[--A]);g.setFrame(M,S,P)}r.push(g),i=Math.max(i,g.frames[d-1])}let m=t.readInt(!0);if(m>0){let g=new l.EventTimeline(m);for(let w=0;w>>1^-(h&1)}readStringRef(){let t=this.readInt(!0);return t==0?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let a="",h=0;for(let r=0;r>4){case 12:case 13:a+=String.fromCharCode((n&31)<<6|this.readByte()&63),r+=2;break;case 14:a+=String.fromCharCode((n&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),r+=3;break;default:a+=String.fromCharCode(n),r++}}return a}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return this.readByte()!=0}}class e{constructor(t,a,h,r,n){this.mesh=t,this.skin=a,this.slotIndex=h,this.parent=r,this.inheritDeform=n}}class s{constructor(t=null,a=null){this.bones=t,this.vertices=a}}})(spine||(spine={}));var spine;(function(l){class T{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new l.Pool(()=>l.Utils.newFloatArray(16))}update(e,s){if(e==null)throw new Error("skeleton cannot be null.");let o=this.boundingBoxes,t=this.polygons,a=this.polygonPool,h=e.slots,r=h.length;o.length=0,a.freeAll(t),t.length=0;for(let n=0;n=this.minX&&e<=this.maxX&&s>=this.minY&&s<=this.maxY}aabbIntersectsSegment(e,s,o,t){let a=this.minX,h=this.minY,r=this.maxX,n=this.maxY;if(e<=a&&o<=a||s<=h&&t<=h||e>=r&&o>=r||s>=n&&t>=n)return!1;let i=(t-s)/(o-e),c=i*(a-e)+s;if(c>h&&ch&&ca&&ua&&ue.minX&&this.minYe.minY}containsPoint(e,s){let o=this.polygons;for(let t=0,a=o.length;t=o||c=o){let u=t[n];u+(o-i)/(c-i)*(t[h]-u)=u&&b<=g||b>=g&&b<=u)&&(b>=s&&b<=t||b>=t&&b<=s)){let p=(c*y-i*M)/P;if((p>=d&&p<=w||p>=w&&p<=d)&&(p>=o&&p<=a||p>=a&&p<=o))return!0}u=g,d=w}return!1}getPolygon(e){if(e==null)throw new Error("boundingBox cannot be null.");let s=this.boundingBoxes.indexOf(e);return s==-1?null:this.polygons[s]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}l.SkeletonBounds=T})(spine||(spine={}));var spine;(function(l){class T{constructor(){this.triangulator=new l.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}clipStart(e,s){if(this.clipAttachment!=null)return 0;this.clipAttachment=s;let o=s.worldVerticesLength,t=l.Utils.setArraySize(this.clippingPolygon,o);s.computeWorldVertices(e,0,o,t,0,2);let a=this.clippingPolygon;T.makeClockwise(a);let h=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a));for(let r=0,n=h.length;r>1,G=this.clipOutput,H=l.Utils.setArraySize(c,I+q*g);for(let O=0;O=2?(u=n,n=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(s),u.push(o),u.push(t),u.push(a),u.push(h),u.push(e),u.push(s),n.length=0;let d=r,m=r.length-4;for(let g=0;;g+=2){let w=d[g],M=d[g+1],S=d[g+2],y=d[g+3],P=w-S,b=M-y,p=u,A=u.length-2,x=n.length;for(let R=0;R0;if(P*(Y-y)-b*(U-S)>0){if(V){n.push(E),n.push(f);continue}let I=f-Y,C=E-U,F=I*(S-w)-C*(y-M);if(Math.abs(F)>1e-6){let N=(C*(M-Y)-I*(w-U))/F;n.push(w+(S-w)*N),n.push(M+(y-M)*N)}else n.push(w),n.push(M)}else if(V){let I=f-Y,C=E-U,F=I*(S-w)-C*(y-M);if(Math.abs(F)>1e-6){let N=(C*(M-Y)-I*(w-U))/F;n.push(w+(S-w)*N),n.push(M+(y-M)*N)}else n.push(w),n.push(M);n.push(E),n.push(f)}c=!0}if(x==n.length)return i.length=0,!0;if(n.push(n[0]),n.push(n[1]),g==m)break;let k=n;n=u,n.length=0,u=k}if(i!=n){i.length=0;for(let g=0,w=n.length-2;g>1;i=0;P--)g[P]==-1&&(g[P]=M[--y])}i.setFrame(u++,this.getValue(m,"time",0),g)}h.push(i),r=Math.max(r,i.frames[i.getFrameCount()-1])}if(s.events){let i=new l.EventTimeline(s.events.length),c=0;for(let u=0;u=a.length&&(a.length=s+1),a[s]||(a[s]={}),a[s][o]=t}addSkin(s){for(let a=0;a= 0.");if(s==null)throw new Error("name cannot be null.");if(o==null)throw new Error("boneData cannot be null.");this.index=e,this.name=s,this.boneData=o}}l.SlotData=T})(spine||(spine={}));var spine;(function(l){class T{constructor(a){this._image=a}getImage(){return this._image}static filterFromString(a){switch(a.toLowerCase()){case"nearest":return v.Nearest;case"linear":return v.Linear;case"mipmap":return v.MipMap;case"mipmapnearestnearest":return v.MipMapNearestNearest;case"mipmaplinearnearest":return v.MipMapLinearNearest;case"mipmapnearestlinear":return v.MipMapNearestLinear;case"mipmaplinearlinear":return v.MipMapLinearLinear;default:throw new Error(`Unknown texture filter ${a}`)}}static wrapFromString(a){switch(a.toLowerCase()){case"mirroredtepeat":return e.MirroredRepeat;case"clamptoedge":return e.ClampToEdge;case"repeat":return e.Repeat;default:throw new Error(`Unknown texture wrap ${a}`)}}}l.Texture=T;let v;(function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"})(v=l.TextureFilter||(l.TextureFilter={}));let e;(function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"})(e=l.TextureWrap||(l.TextureWrap={}));class s{constructor(){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}}l.TextureRegion=s;class o extends T{setFilters(a,h){}setWraps(a,h){}dispose(){}}l.FakeTexture=o})(spine||(spine={}));var spine;(function(l){class T{constructor(t,a){this.pages=new Array,this.regions=new Array,this.load(t,a)}load(t,a){if(a==null)throw new Error("textureLoader cannot be null.");let h=new v(t),r=new Array(4),n=null;for(;;){let i=h.readLine();if(i==null)break;if(i=i.trim(),i.length==0)n=null;else if(n){let c=new s;c.name=i,c.page=n;let u=h.readValue();u.toLocaleLowerCase()=="true"?c.degrees=90:u.toLocaleLowerCase()=="false"?c.degrees=0:c.degrees=parseFloat(u),c.rotate=c.degrees==90,h.readTuple(r);let d=parseInt(r[0]),m=parseInt(r[1]);h.readTuple(r);let g=parseInt(r[0]),w=parseInt(r[1]);c.u=d/n.width,c.v=m/n.height,c.rotate?(c.u2=(d+w)/n.width,c.v2=(m+g)/n.height):(c.u2=(d+g)/n.width,c.v2=(m+w)/n.height),c.x=d,c.y=m,c.width=Math.abs(g),c.height=Math.abs(w),h.readTuple(r)==4&&h.readTuple(r)==4&&h.readTuple(r),c.originalWidth=parseInt(r[0]),c.originalHeight=parseInt(r[1]),h.readTuple(r),c.offsetX=parseInt(r[0]),c.offsetY=parseInt(r[1]),c.index=parseInt(h.readValue()),c.texture=n.texture,this.regions.push(c)}else{n=new e,n.name=i,h.readTuple(r)==2&&(n.width=parseInt(r[0]),n.height=parseInt(r[1]),h.readTuple(r)),h.readTuple(r),n.minFilter=l.Texture.filterFromString(r[0]),n.magFilter=l.Texture.filterFromString(r[1]);let c=h.readValue();n.uWrap=l.TextureWrap.ClampToEdge,n.vWrap=l.TextureWrap.ClampToEdge,c=="x"?n.uWrap=l.TextureWrap.Repeat:c=="y"?n.vWrap=l.TextureWrap.Repeat:c=="xy"&&(n.uWrap=n.vWrap=l.TextureWrap.Repeat),n.texture=a(i),n.texture.setFilters(n.minFilter,n.magFilter),n.texture.setWraps(n.uWrap,n.vWrap),n.width=n.texture.getImage().width,n.height=n.texture.getImage().height,this.pages.push(n)}}}findRegion(t){for(let a=0;a=this.lines.length?null:this.lines[this.index++]}readValue(){let t=this.readLine(),a=t.indexOf(":");if(a==-1)throw new Error("Invalid line: "+t);return t.substring(a+1).trim()}readTuple(t){let a=this.readLine(),h=a.indexOf(":");if(h==-1)throw new Error("Invalid line: "+a);let r=0,n=h+1;for(;r<3;r++){let i=a.indexOf(",",n);if(i==-1)break;t[r]=a.substr(n,i-n).trim(),n=i+1}return t[r]=a.substring(n).trim(),r+1}}class e{}l.TextureAtlasPage=e;class s extends l.TextureRegion{}l.TextureAtlasRegion=s})(spine||(spine={}));var spine;(function(l){class T{constructor(e,s){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new l.Vector2,this.active=!1,e==null)throw new Error("data cannot be null.");if(s==null)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(let o=0;o0?l.MathUtils.degRad:-l.MathUtils.degRad,u=this.data.offsetRotation*c,d=this.data.offsetShearY*c,m=this.bones;for(let g=0,w=m.length;gl.MathUtils.PI?A-=l.MathUtils.PI2:A<-l.MathUtils.PI&&(A+=l.MathUtils.PI2),A*=e;let x=Math.cos(A),k=Math.sin(A);M.a=x*y-k*b,M.b=x*P-k*p,M.c=k*y+x*b,M.d=k*P+x*p,S=!0}if(s!=0){let y=this.temp;a.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),M.worldX+=(y.x-M.worldX)*s,M.worldY+=(y.y-M.worldY)*s,S=!0}if(o>0){let y=Math.sqrt(M.a*M.a+M.c*M.c),P=Math.sqrt(h*h+n*n);y>1e-5&&(y=(y+(P-y+this.data.offsetScaleX)*o)/y),M.a*=y,M.c*=y,y=Math.sqrt(M.b*M.b+M.d*M.d),P=Math.sqrt(r*r+i*i),y>1e-5&&(y=(y+(P-y+this.data.offsetScaleY)*o)/y),M.b*=y,M.d*=y,S=!0}if(t>0){let y=M.b,P=M.d,b=Math.atan2(P,y),p=Math.atan2(i,r)-Math.atan2(n,h)-(b-Math.atan2(M.c,M.a));p>l.MathUtils.PI?p-=l.MathUtils.PI2:p<-l.MathUtils.PI&&(p+=l.MathUtils.PI2),p=b+(p+d)*t;let A=Math.sqrt(y*y+P*P);M.b=Math.cos(p)*A,M.d=Math.sin(p)*A,S=!0}S&&(M.appliedValid=!1)}}applyRelativeWorld(){let e=this.rotateMix,s=this.translateMix,o=this.scaleMix,t=this.shearMix,a=this.target,h=a.a,r=a.b,n=a.c,i=a.d,c=h*i-r*n>0?l.MathUtils.degRad:-l.MathUtils.degRad,u=this.data.offsetRotation*c,d=this.data.offsetShearY*c,m=this.bones;for(let g=0,w=m.length;gl.MathUtils.PI?A-=l.MathUtils.PI2:A<-l.MathUtils.PI&&(A+=l.MathUtils.PI2),A*=e;let x=Math.cos(A),k=Math.sin(A);M.a=x*y-k*b,M.b=x*P-k*p,M.c=k*y+x*b,M.d=k*P+x*p,S=!0}if(s!=0){let y=this.temp;a.localToWorld(y.set(this.data.offsetX,this.data.offsetY)),M.worldX+=y.x*s,M.worldY+=y.y*s,S=!0}if(o>0){let y=(Math.sqrt(h*h+n*n)-1+this.data.offsetScaleX)*o+1;M.a*=y,M.c*=y,y=(Math.sqrt(r*r+i*i)-1+this.data.offsetScaleY)*o+1,M.b*=y,M.d*=y,S=!0}if(t>0){let y=Math.atan2(i,r)-Math.atan2(n,h);y>l.MathUtils.PI?y-=l.MathUtils.PI2:y<-l.MathUtils.PI&&(y+=l.MathUtils.PI2);let P=M.b,b=M.d;y=Math.atan2(b,P)+(y-l.MathUtils.PI/2+d)*t;let p=Math.sqrt(P*P+b*b);M.b=Math.cos(y)*p,M.d=Math.sin(y)*p,S=!0}S&&(M.appliedValid=!1)}}applyAbsoluteLocal(){let e=this.rotateMix,s=this.translateMix,o=this.scaleMix,t=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();let h=this.bones;for(let r=0,n=h.length;r1e-5&&(m=(m+(a.ascaleX-m+this.data.offsetScaleX)*o)/m),g>1e-5&&(g=(g+(a.ascaleY-g+this.data.offsetScaleY)*o)/g));let w=i.ashearY;if(t!=0){let M=a.ashearY-w+this.data.offsetShearY;M-=(16384-(16384.499999999996-M/360|0))*360,i.shearY+=M*t}i.updateWorldTransformWith(u,d,c,m,g,i.ashearX,w)}}applyRelativeLocal(){let e=this.rotateMix,s=this.translateMix,o=this.scaleMix,t=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();let h=this.bones;for(let r=0,n=h.length;r1e-5&&(m*=(a.ascaleX-1+this.data.offsetScaleX)*o+1),g>1e-5&&(g*=(a.ascaleY-1+this.data.offsetScaleY)*o+1));let w=i.ashearY;t!=0&&(w+=(a.ashearY+this.data.offsetShearY)*t),i.updateWorldTransformWith(u,d,c,m,g,i.ashearX,w)}}}l.TransformConstraint=T})(spine||(spine={}));var spine;(function(l){class T extends l.ConstraintData{constructor(e){super(e,0,!1),this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}}l.TransformConstraintData=T})(spine||(spine={}));var spine;(function(l){class T{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new l.Pool(()=>new Array),this.polygonIndicesPool=new l.Pool(()=>new Array)}triangulate(e){let s=e,o=e.length>>1,t=this.indicesArray;t.length=0;for(let r=0;r3;){let r=o-1,n=0,i=1;for(;;){t:if(!a[n]){let d=t[r]<<1,m=t[n]<<1,g=t[i]<<1,w=s[d],M=s[d+1],S=s[m],y=s[m+1],P=s[g],b=s[g+1];for(let p=(i+1)%o;p!=r;p=(p+1)%o){if(!a[p])continue;let A=t[p]<<1,x=s[A],k=s[A+1];if(T.positiveArea(P,b,w,M,x,k)&&T.positiveArea(w,M,S,y,x,k)&&T.positiveArea(S,y,P,b,x,k))break t}break}if(i==0){do{if(!a[n])break;n--}while(n>0);break}r=n,n=i,i=(i+1)%o}h.push(t[(o+n-1)%o]),h.push(t[n]),h.push(t[(n+1)%o]),t.splice(n,1),a.splice(n,1),o--;let c=(o+n-1)%o,u=n==o?0:n;a[c]=T.isConcave(c,o,s,t),a[u]=T.isConcave(u,o,s,t)}return o==3&&(h.push(t[2]),h.push(t[0]),h.push(t[1])),h}decompose(e,s){let o=e,t=this.convexPolygons;this.polygonPool.freeAll(t),t.length=0;let a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;let h=this.polygonIndicesPool.obtain();h.length=0;let r=this.polygonPool.obtain();r.length=0;let n=-1,i=0;for(let c=0,u=s.length;c0?(t.push(r),a.push(h)):(this.polygonPool.free(r),this.polygonIndicesPool.free(h)),r=this.polygonPool.obtain(),r.length=0,r.push(w),r.push(M),r.push(S),r.push(y),r.push(P),r.push(b),h=this.polygonIndicesPool.obtain(),h.length=0,h.push(d),h.push(m),h.push(g),i=T.winding(w,M,S,y,P,b),n=d)}r.length>0&&(t.push(r),a.push(h));for(let c=0,u=t.length;c=0;c--)r=t[c],r.length==0&&(t.splice(c,1),this.polygonPool.free(r),h=a[c],a.splice(c,1),this.polygonIndicesPool.free(h));return t}static isConcave(e,s,o,t){let a=t[(s+e-1)%s]<<1,h=t[e]<<1,r=t[(e+1)%s]<<1;return!this.positiveArea(o[a],o[a+1],o[h],o[h+1],o[r],o[r+1])}static positiveArea(e,s,o,t,a,h){return e*(h-t)+o*(s-h)+a*(t-s)>=0}static winding(e,s,o,t,a,h){let r=o-e,n=t-s;return a*n-h*r+r*s-e*n>=0?1:-1}}l.Triangulator=T})(spine||(spine={}));var spine;(function(l){class T{constructor(){this.array=new Array}add(d){let m=this.contains(d);return this.array[d|0]=d|0,!m}contains(d){return this.array[d|0]!=null}remove(d){this.array[d|0]=void 0}clear(){this.array.length=0}}l.IntSet=T;class v{constructor(d=0,m=0,g=0,w=0){this.r=d,this.g=m,this.b=g,this.a=w}set(d,m,g,w){return this.r=d,this.g=m,this.b=g,this.a=w,this.clamp(),this}setFromColor(d){return this.r=d.r,this.g=d.g,this.b=d.b,this.a=d.a,this}setFromString(d){return d=d.charAt(0)=="#"?d.substr(1):d,this.r=parseInt(d.substr(0,2),16)/255,this.g=parseInt(d.substr(2,2),16)/255,this.b=parseInt(d.substr(4,2),16)/255,this.a=(d.length!=8?255:parseInt(d.substr(6,2),16))/255,this}add(d,m,g,w){return this.r+=d,this.g+=m,this.b+=g,this.a+=w,this.clamp(),this}clamp(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this}static rgba8888ToColor(d,m){d.r=((m&4278190080)>>>24)/255,d.g=((m&16711680)>>>16)/255,d.b=((m&65280)>>>8)/255,d.a=(m&255)/255}static rgb888ToColor(d,m){d.r=((m&16711680)>>>16)/255,d.g=((m&65280)>>>8)/255,d.b=(m&255)/255}}v.WHITE=new v(1,1,1,1),v.RED=new v(1,0,0,1),v.GREEN=new v(0,1,0,1),v.BLUE=new v(0,0,1,1),v.MAGENTA=new v(1,0,1,1),l.Color=v;class e{static clamp(d,m,g){return dg?g:d}static cosDeg(d){return Math.cos(d*e.degRad)}static sinDeg(d){return Math.sin(d*e.degRad)}static signum(d){return d>0?1:d<0?-1:0}static toInt(d){return d>0?Math.floor(d):Math.ceil(d)}static cbrt(d){let m=Math.pow(Math.abs(d),.3333333333333333);return d<0?-m:m}static randomTriangular(d,m){return e.randomTriangularWith(d,m,(d+m)*.5)}static randomTriangularWith(d,m,g){let w=Math.random(),M=m-d;return w<=(g-d)/M?d+Math.sqrt(w*M*(g-d)):m-Math.sqrt((1-w)*M*(m-g))}}e.PI=3.1415927,e.PI2=e.PI*2,e.radiansToDegrees=180/e.PI,e.radDeg=e.radiansToDegrees,e.degreesToRadians=e.PI/180,e.degRad=e.degreesToRadians,l.MathUtils=e;class s{apply(d,m,g){return d+(m-d)*this.applyInternal(g)}}l.Interpolation=s;class o extends s{constructor(d){super(),this.power=2,this.power=d}applyInternal(d){return d<=.5?Math.pow(d*2,this.power)/2:Math.pow((d-1)*2,this.power)/(this.power%2==0?-2:2)+1}}l.Pow=o;class t extends o{constructor(d){super(d)}applyInternal(d){return Math.pow(d-1,this.power)*(this.power%2==0?-1:1)+1}}l.PowOut=t;class a{static arrayCopy(d,m,g,w,M){for(let S=m,y=w;S=m?d:a.setArraySize(d,m,g)}static newArray(d,m){let g=new Array(d);for(let w=0;w0?this.items.pop():this.instantiator()}free(d){d.reset&&d.reset(),this.items.push(d)}freeAll(d){for(let m=0;mthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=d,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}l.TimeKeeper=i;class c{constructor(d=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(d)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(d){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let d=0;for(let m=0;m>1)*r;let n=s.bone.skeleton,i=s.deform,c=this.vertices,u=this.bones;if(u==null){i.length>0&&(c=i);let w=s.bone,M=w.worldX,S=w.worldY,y=w.a,P=w.b,b=w.c,p=w.d;for(let A=o,x=h;x