"use strict";(self.webpackChunkcoinflip=self.webpackChunkcoinflip||[]).push([[873],{2873:(t,e,n)=>{n.r(e),n.d(e,{Animation:()=>x,AnimationState:()=>H,AnimationStateAdapter:()=>K,AnimationStateData:()=>et,AtlasAttachmentLoader:()=>nt,Attachment:()=>a,AttachmentTimeline:()=>F,Bone:()=>at,BoneData:()=>rt,BoundingBoxAttachment:()=>o,ClippingAttachment:()=>l,ColorTimeline:()=>C,ConstraintData:()=>it,CurveTimeline:()=>M,DeformTimeline:()=>N,DrawOrderTimeline:()=>Y,Event:()=>ot,EventData:()=>lt,EventQueue:()=>z,EventTimeline:()=>_,EventType:()=>J,IkConstraint:()=>ht,IkConstraintData:()=>ct,IkConstraintTimeline:()=>D,JitterEffect:()=>g,MeshAttachment:()=>h,PathAttachment:()=>c,PathConstraint:()=>mt,PathConstraintData:()=>dt,PathConstraintMixTimeline:()=>$,PathConstraintPositionTimeline:()=>L,PathConstraintSpacingTimeline:()=>W,PointAttachment:()=>d,RegionAttachment:()=>m,RotateTimeline:()=>I,ScaleTimeline:()=>R,ShearTimeline:()=>y,Skeleton:()=>Et,SkeletonBinary:()=>Tt,SkeletonBounds:()=>yt,SkeletonData:()=>xt,SkeletonJson:()=>kt,Skin:()=>St,SkinEntry:()=>Mt,Slot:()=>u,SlotData:()=>bt,SpacingMode:()=>ut,Spine:()=>Vt,SwirlEffect:()=>E,TimelineType:()=>b,TrackEntry:()=>j,TransformConstraint:()=>gt,TransformConstraintData:()=>wt,TransformConstraintTimeline:()=>q,TranslateTimeline:()=>A,TwoColorTimeline:()=>P,VertexAttachment:()=>i});var s=n(8766);class a{constructor(t){if(null==t)throw new Error("name cannot be null.");this.name=t}}const r=class extends a{constructor(t){super(t),this.id=(65535&r.nextID++)<<11,this.worldVerticesLength=0,this.deformAttachment=this}computeWorldVerticesOld(t,e){this.computeWorldVertices(t,0,this.worldVerticesLength,e,0,2)}computeWorldVertices(t,e,n,s,a,r){n=a+(n>>1)*r;const i=t.bone.skeleton,o=t.deform;let l=this.vertices;const h=this.bones;if(null==h){o.length>0&&(l=o);const i=t.bone.matrix,h=i.tx,c=i.ty,d=i.a,u=i.c,f=i.b,m=i.d;for(let t=e,i=a;i0&&(e%=this.duration));const l=this.timelines;for(let s=0,h=l.length;s>>1;for(;;){if(t[(r+1)*n]<=e?s=r+1:a=r,s==a)return(s+1)*n;r=s+a>>>1}}static linearSearch(t,e,n){for(let s=0,a=t.length-n;s<=a;s+=n)if(t[s]>e)return s;return-1}}var b=(t=>(t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor",t))(b||{});const w=class{constructor(t){if(t<=0)throw new Error(`frameCount must be > 0: ${t}`);this.curves=s.cQ.newFloatArray((t-1)*w.BEZIER_SIZE)}getFrameCount(){return this.curves.length/w.BEZIER_SIZE+1}setLinear(t){this.curves[t*w.BEZIER_SIZE]=w.LINEAR}setStepped(t){this.curves[t*w.BEZIER_SIZE]=w.STEPPED}getCurveType(t){const e=t*w.BEZIER_SIZE;if(e==this.curves.length)return w.LINEAR;const n=this.curves[e];return n==w.LINEAR?w.LINEAR:n==w.STEPPED?w.STEPPED:w.BEZIER}setCurve(t,e,n,s,a){const r=.03*(2*-e+s),i=.03*(2*-n+a),o=.006*(3*(e-s)+1),l=.006*(3*(n-a)+1);let h=2*r+o,c=2*i+l,d=.3*e+r+.16666667*o,u=.3*n+i+.16666667*l,f=t*w.BEZIER_SIZE;const m=this.curves;m[f++]=w.BEZIER;let g=d,p=u;for(let t=f+w.BEZIER_SIZE-1;f=e){let s,r;return a==t?(s=0,r=0):(s=n[a-2],r=n[a-1]),r+(n[a+1]-r)*(e-s)/(i-s)}const o=n[a-1];return o+(1-o)*(e-i)/(1-i)}};let M=w;M.LINEAR=0,M.STEPPED=1,M.BEZIER=2,M.BEZIER_SIZE=19;const S=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t<<1)}getPropertyId(){return 0+this.boneIndex}setFrame(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+S.ROTATION]=n}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n=l[l.length-S.ENTRIES]){let t=l[l.length+S.PREV_ROTATION];switch(i){case s.bq.setup:h.rotation=h.data.rotation+t*r;break;case s.bq.first:case s.bq.replace:t+=h.data.rotation-h.rotation,t-=360*(16384-(16384.499999999996-t/360|0));case s.bq.add:h.rotation+=t*r}return}const c=x.binarySearch(l,n,S.ENTRIES),d=l[c+S.PREV_ROTATION],u=l[c],f=this.getCurvePercent((c>>1)-1,1-(n-u)/(l[c+S.PREV_TIME]-u));let m=l[c+S.ROTATION]-d;switch(m=d+(m-360*(16384-(16384.499999999996-m/360|0)))*f,i){case s.bq.setup:h.rotation=h.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*r;break;case s.bq.first:case s.bq.replace:m+=h.data.rotation-h.rotation;case s.bq.add:h.rotation+=(m-360*(16384-(16384.499999999996-m/360|0)))*r}}};let I=S;I.ENTRIES=2,I.PREV_TIME=-2,I.PREV_ROTATION=-1,I.ROTATION=1;const T=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*T.ENTRIES)}getPropertyId(){return(1<<24)+this.boneIndex}setFrame(t,e,n,s){t*=T.ENTRIES,this.frames[t]=e,this.frames[t+T.X]=n,this.frames[t+T.Y]=s}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n=l[l.length-T.ENTRIES])c=l[l.length+T.PREV_X],d=l[l.length+T.PREV_Y];else{const t=x.binarySearch(l,n,T.ENTRIES);c=l[t+T.PREV_X],d=l[t+T.PREV_Y];const e=l[t],s=this.getCurvePercent(t/T.ENTRIES-1,1-(n-e)/(l[t+T.PREV_TIME]-e));c+=(l[t+T.X]-c)*s,d+=(l[t+T.Y]-d)*s}switch(i){case s.bq.setup:h.x=h.data.x+c*r,h.y=h.data.y+d*r;break;case s.bq.first:case s.bq.replace:h.x+=(h.data.x+c-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case s.bq.add:h.x+=c*r,h.y+=d*r}}};let A=T;A.ENTRIES=3,A.PREV_TIME=-3,A.PREV_X=-2,A.PREV_Y=-1,A.X=1,A.Y=2;class R extends A{constructor(t){super(t)}getPropertyId(){return(2<<24)+this.boneIndex}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n=l[l.length-R.ENTRIES])c=l[l.length+R.PREV_X]*h.data.scaleX,d=l[l.length+R.PREV_Y]*h.data.scaleY;else{const t=x.binarySearch(l,n,R.ENTRIES);c=l[t+R.PREV_X],d=l[t+R.PREV_Y];const e=l[t],s=this.getCurvePercent(t/R.ENTRIES-1,1-(n-e)/(l[t+R.PREV_TIME]-e));c=(c+(l[t+R.X]-c)*s)*h.data.scaleX,d=(d+(l[t+R.Y]-d)*s)*h.data.scaleY}if(1==r)i==s.bq.add?(h.scaleX+=c-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=c,h.scaleY=d);else{let t=0,e=0;if(o==s.mJ.mixOut)switch(i){case s.bq.setup:t=h.data.scaleX,e=h.data.scaleY,h.scaleX=t+(Math.abs(c)*s.M8.signum(t)-t)*r,h.scaleY=e+(Math.abs(d)*s.M8.signum(e)-e)*r;break;case s.bq.first:case s.bq.replace:t=h.scaleX,e=h.scaleY,h.scaleX=t+(Math.abs(c)*s.M8.signum(t)-t)*r,h.scaleY=e+(Math.abs(d)*s.M8.signum(e)-e)*r;break;case s.bq.add:t=h.scaleX,e=h.scaleY,h.scaleX=t+(Math.abs(c)*s.M8.signum(t)-h.data.scaleX)*r,h.scaleY=e+(Math.abs(d)*s.M8.signum(e)-h.data.scaleY)*r}else switch(i){case s.bq.setup:t=Math.abs(h.data.scaleX)*s.M8.signum(c),e=Math.abs(h.data.scaleY)*s.M8.signum(d),h.scaleX=t+(c-t)*r,h.scaleY=e+(d-e)*r;break;case s.bq.first:case s.bq.replace:t=Math.abs(h.scaleX)*s.M8.signum(c),e=Math.abs(h.scaleY)*s.M8.signum(d),h.scaleX=t+(c-t)*r,h.scaleY=e+(d-e)*r;break;case s.bq.add:t=s.M8.signum(c),e=s.M8.signum(d),h.scaleX=Math.abs(h.scaleX)*t+(c-Math.abs(h.data.scaleX)*t)*r,h.scaleY=Math.abs(h.scaleY)*e+(d-Math.abs(h.data.scaleY)*e)*r}}}}class y extends A{constructor(t){super(t)}getPropertyId(){return(3<<24)+this.boneIndex}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.bones[this.boneIndex];if(!h.active)return;if(n=l[l.length-y.ENTRIES])c=l[l.length+y.PREV_X],d=l[l.length+y.PREV_Y];else{const t=x.binarySearch(l,n,y.ENTRIES);c=l[t+y.PREV_X],d=l[t+y.PREV_Y];const e=l[t],s=this.getCurvePercent(t/y.ENTRIES-1,1-(n-e)/(l[t+y.PREV_TIME]-e));c+=(l[t+y.X]-c)*s,d+=(l[t+y.Y]-d)*s}switch(i){case s.bq.setup:h.shearX=h.data.shearX+c*r,h.shearY=h.data.shearY+d*r;break;case s.bq.first:case s.bq.replace:h.shearX+=(h.data.shearX+c-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case s.bq.add:h.shearX+=c*r,h.shearY+=d*r}}}const k=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*k.ENTRIES)}getPropertyId(){return(5<<24)+this.slotIndex}setFrame(t,e,n,s,a,r){t*=k.ENTRIES,this.frames[t]=e,this.frames[t+k.R]=n,this.frames[t+k.G]=s,this.frames[t+k.B]=a,this.frames[t+k.A]=r}apply(t,e,n,a,r,i,o){const l=t.slots[this.slotIndex];if(!l.bone.active)return;const h=this.frames;if(n=h[h.length-k.ENTRIES]){const t=h.length;c=h[t+k.PREV_R],d=h[t+k.PREV_G],u=h[t+k.PREV_B],f=h[t+k.PREV_A]}else{const t=x.binarySearch(h,n,k.ENTRIES);c=h[t+k.PREV_R],d=h[t+k.PREV_G],u=h[t+k.PREV_B],f=h[t+k.PREV_A];const e=h[t],s=this.getCurvePercent(t/k.ENTRIES-1,1-(n-e)/(h[t+k.PREV_TIME]-e));c+=(h[t+k.R]-c)*s,d+=(h[t+k.G]-d)*s,u+=(h[t+k.B]-u)*s,f+=(h[t+k.A]-f)*s}if(1==r)l.color.set(c,d,u,f);else{const t=l.color;i==s.bq.setup&&t.setFromColor(l.data.color),t.add((c-t.r)*r,(d-t.g)*r,(u-t.b)*r,(f-t.a)*r)}}};let C=k;C.ENTRIES=5,C.PREV_TIME=-5,C.PREV_R=-4,C.PREV_G=-3,C.PREV_B=-2,C.PREV_A=-1,C.R=1,C.G=2,C.B=3,C.A=4;const V=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*V.ENTRIES)}getPropertyId(){return(14<<24)+this.slotIndex}setFrame(t,e,n,s,a,r,i,o,l){t*=V.ENTRIES,this.frames[t]=e,this.frames[t+V.R]=n,this.frames[t+V.G]=s,this.frames[t+V.B]=a,this.frames[t+V.A]=r,this.frames[t+V.R2]=i,this.frames[t+V.G2]=o,this.frames[t+V.B2]=l}apply(t,e,n,a,r,i,o){const l=t.slots[this.slotIndex];if(!l.bone.active)return;const h=this.frames;if(n=h[h.length-V.ENTRIES]){const t=h.length;c=h[t+V.PREV_R],d=h[t+V.PREV_G],u=h[t+V.PREV_B],f=h[t+V.PREV_A],m=h[t+V.PREV_R2],g=h[t+V.PREV_G2],p=h[t+V.PREV_B2]}else{const t=x.binarySearch(h,n,V.ENTRIES);c=h[t+V.PREV_R],d=h[t+V.PREV_G],u=h[t+V.PREV_B],f=h[t+V.PREV_A],m=h[t+V.PREV_R2],g=h[t+V.PREV_G2],p=h[t+V.PREV_B2];const e=h[t],s=this.getCurvePercent(t/V.ENTRIES-1,1-(n-e)/(h[t+V.PREV_TIME]-e));c+=(h[t+V.R]-c)*s,d+=(h[t+V.G]-d)*s,u+=(h[t+V.B]-u)*s,f+=(h[t+V.A]-f)*s,m+=(h[t+V.R2]-m)*s,g+=(h[t+V.G2]-g)*s,p+=(h[t+V.B2]-p)*s}if(1==r)l.color.set(c,d,u,f),l.darkColor.set(m,g,p,1);else{const t=l.color,e=l.darkColor;i==s.bq.setup&&(t.setFromColor(l.data.color),e.setFromColor(l.data.darkColor)),t.add((c-t.r)*r,(d-t.g)*r,(u-t.b)*r,(f-t.a)*r),e.add((m-e.r)*r,(g-e.g)*r,(p-e.b)*r,0)}}};let P=V;P.ENTRIES=8,P.PREV_TIME=-8,P.PREV_R=-7,P.PREV_G=-6,P.PREV_B=-5,P.PREV_A=-4,P.PREV_R2=-3,P.PREV_G2=-2,P.PREV_B2=-1,P.R=1,P.G=2,P.B=3,P.A=4,P.R2=5,P.G2=6,P.B2=7;class F{constructor(t){this.frames=s.cQ.newFloatArray(t),this.attachmentNames=new Array(t)}getPropertyId(){return(4<<24)+this.slotIndex}getFrameCount(){return this.frames.length}setFrame(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n}apply(t,e,n,a,r,i,o){const l=t.slots[this.slotIndex];if(!l.bone.active)return;if(o==s.mJ.mixOut)return void(i==s.bq.setup&&this.setAttachment(t,l,l.data.attachmentName));const h=this.frames;if(n=h[h.length-1]?h.length-1:x.binarySearch(h,n,1)-1;const d=this.attachmentNames[c];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}setAttachment(t,e,n){e.setAttachment(null==n?null:t.getAttachment(this.slotIndex,n))}}let v=null;class N extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t),this.frameVertices=new Array(t),null==v&&(v=s.cQ.newFloatArray(64))}getPropertyId(){return(6<<27)+Number(this.attachment.id)+this.slotIndex}setFrame(t,e,n){this.frames[t]=e,this.frameVertices[t]=n}apply(t,e,n,a,r,o,l){const h=t.slots[this.slotIndex];if(!h.bone.active)return;const c=h.getAttachment();if(!(c instanceof i)||c.deformAttachment!=this.attachment)return;const d=h.deform;0==d.length&&(o=s.bq.setup);const u=this.frameVertices,f=u[0].length,m=this.frames;if(n=m[m.length-1]){const t=u[m.length-1];if(1==r)if(o==s.bq.add){const e=c;if(null==e.bones){const n=e.vertices;for(let e=0;en)this.apply(t,e,Number.MAX_VALUE,s,a,r,i),e=-1;else if(e>=o[l-1])return;if(n0&&o[h-1]==t;)h--}for(;h=o[h];h++)s.push(this.events[h])}}class Y{constructor(t){this.frames=s.cQ.newFloatArray(t),this.drawOrders=new Array(t)}getPropertyId(){return 8<<24}getFrameCount(){return this.frames.length}setFrame(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}apply(t,e,n,a,r,i,o){const l=t.drawOrder,h=t.slots;if(o==s.mJ.mixOut&&i==s.bq.setup)return void s.cQ.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length);const c=this.frames;if(n=c[c.length-1]?c.length-1:x.binarySearch(c,n)-1;const u=this.drawOrders[d];if(null==u)s.cQ.arrayCopy(h,0,l,0,h.length);else for(let t=0,e=u.length;t=l[l.length-X.ENTRIES])return void(i==s.bq.setup?(h.mix=h.data.mix+(l[l.length+X.PREV_MIX]-h.data.mix)*r,h.softness=h.data.softness+(l[l.length+X.PREV_SOFTNESS]-h.data.softness)*r,o==s.mJ.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=l[l.length+X.PREV_BEND_DIRECTION],h.compress=0!=l[l.length+X.PREV_COMPRESS],h.stretch=0!=l[l.length+X.PREV_STRETCH])):(h.mix+=(l[l.length+X.PREV_MIX]-h.mix)*r,h.softness+=(l[l.length+X.PREV_SOFTNESS]-h.softness)*r,o==s.mJ.mixIn&&(h.bendDirection=l[l.length+X.PREV_BEND_DIRECTION],h.compress=0!=l[l.length+X.PREV_COMPRESS],h.stretch=0!=l[l.length+X.PREV_STRETCH])));const c=x.binarySearch(l,n,X.ENTRIES),d=l[c+X.PREV_MIX],u=l[c+X.PREV_SOFTNESS],f=l[c],m=this.getCurvePercent(c/X.ENTRIES-1,1-(n-f)/(l[c+X.PREV_TIME]-f));i==s.bq.setup?(h.mix=h.data.mix+(d+(l[c+X.MIX]-d)*m-h.data.mix)*r,h.softness=h.data.softness+(u+(l[c+X.SOFTNESS]-u)*m-h.data.softness)*r,o==s.mJ.mixOut?(h.bendDirection=h.data.bendDirection,h.compress=h.data.compress,h.stretch=h.data.stretch):(h.bendDirection=l[c+X.PREV_BEND_DIRECTION],h.compress=0!=l[c+X.PREV_COMPRESS],h.stretch=0!=l[c+X.PREV_STRETCH])):(h.mix+=(d+(l[c+X.MIX]-d)*m-h.mix)*r,h.softness+=(u+(l[c+X.SOFTNESS]-u)*m-h.softness)*r,o==s.mJ.mixIn&&(h.bendDirection=l[c+X.PREV_BEND_DIRECTION],h.compress=0!=l[c+X.PREV_COMPRESS],h.stretch=0!=l[c+X.PREV_STRETCH]))}};let D=X;D.ENTRIES=6,D.PREV_TIME=-6,D.PREV_MIX=-5,D.PREV_SOFTNESS=-4,D.PREV_BEND_DIRECTION=-3,D.PREV_COMPRESS=-2,D.PREV_STRETCH=-1,D.MIX=1,D.SOFTNESS=2,D.BEND_DIRECTION=3,D.COMPRESS=4,D.STRETCH=5;const O=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*O.ENTRIES)}getPropertyId(){return(10<<24)+this.transformConstraintIndex}setFrame(t,e,n,s,a,r){t*=O.ENTRIES,this.frames[t]=e,this.frames[t+O.ROTATE]=n,this.frames[t+O.TRANSLATE]=s,this.frames[t+O.SCALE]=a,this.frames[t+O.SHEAR]=r}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(!h.active)return;if(n=l[l.length-O.ENTRIES]){const t=l.length;c=l[t+O.PREV_ROTATE],d=l[t+O.PREV_TRANSLATE],u=l[t+O.PREV_SCALE],f=l[t+O.PREV_SHEAR]}else{const t=x.binarySearch(l,n,O.ENTRIES);c=l[t+O.PREV_ROTATE],d=l[t+O.PREV_TRANSLATE],u=l[t+O.PREV_SCALE],f=l[t+O.PREV_SHEAR];const e=l[t],s=this.getCurvePercent(t/O.ENTRIES-1,1-(n-e)/(l[t+O.PREV_TIME]-e));c+=(l[t+O.ROTATE]-c)*s,d+=(l[t+O.TRANSLATE]-d)*s,u+=(l[t+O.SCALE]-u)*s,f+=(l[t+O.SHEAR]-f)*s}if(i==s.bq.setup){const t=h.data;h.rotateMix=t.rotateMix+(c-t.rotateMix)*r,h.translateMix=t.translateMix+(d-t.translateMix)*r,h.scaleMix=t.scaleMix+(u-t.scaleMix)*r,h.shearMix=t.shearMix+(f-t.shearMix)*r}else h.rotateMix+=(c-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r,h.scaleMix+=(u-h.scaleMix)*r,h.shearMix+=(f-h.shearMix)*r}};let q=O;q.ENTRIES=5,q.PREV_TIME=-5,q.PREV_ROTATE=-4,q.PREV_TRANSLATE=-3,q.PREV_SCALE=-2,q.PREV_SHEAR=-1,q.ROTATE=1,q.TRANSLATE=2,q.SCALE=3,q.SHEAR=4;const B=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*B.ENTRIES)}getPropertyId(){return(11<<24)+this.pathConstraintIndex}setFrame(t,e,n){t*=B.ENTRIES,this.frames[t]=e,this.frames[t+B.VALUE]=n}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(n=l[l.length-B.ENTRIES])c=l[l.length+B.PREV_VALUE];else{const t=x.binarySearch(l,n,B.ENTRIES);c=l[t+B.PREV_VALUE];const e=l[t],s=this.getCurvePercent(t/B.ENTRIES-1,1-(n-e)/(l[t+B.PREV_TIME]-e));c+=(l[t+B.VALUE]-c)*s}i==s.bq.setup?h.position=h.data.position+(c-h.data.position)*r:h.position+=(c-h.position)*r}};let L=B;L.ENTRIES=2,L.PREV_TIME=-2,L.PREV_VALUE=-1,L.VALUE=1;class W extends L{constructor(t){super(t)}getPropertyId(){return(12<<24)+this.pathConstraintIndex}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(n=l[l.length-W.ENTRIES])c=l[l.length+W.PREV_VALUE];else{const t=x.binarySearch(l,n,W.ENTRIES);c=l[t+W.PREV_VALUE];const e=l[t],s=this.getCurvePercent(t/W.ENTRIES-1,1-(n-e)/(l[t+W.PREV_TIME]-e));c+=(l[t+W.VALUE]-c)*s}i==s.bq.setup?h.spacing=h.data.spacing+(c-h.data.spacing)*r:h.spacing+=(c-h.spacing)*r}}const Q=class extends M{constructor(t){super(t),this.frames=s.cQ.newFloatArray(t*Q.ENTRIES)}getPropertyId(){return(13<<24)+this.pathConstraintIndex}setFrame(t,e,n,s){t*=Q.ENTRIES,this.frames[t]=e,this.frames[t+Q.ROTATE]=n,this.frames[t+Q.TRANSLATE]=s}apply(t,e,n,a,r,i,o){const l=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(!h.active)return;if(n=l[l.length-Q.ENTRIES])c=l[l.length+Q.PREV_ROTATE],d=l[l.length+Q.PREV_TRANSLATE];else{const t=x.binarySearch(l,n,Q.ENTRIES);c=l[t+Q.PREV_ROTATE],d=l[t+Q.PREV_TRANSLATE];const e=l[t],s=this.getCurvePercent(t/Q.ENTRIES-1,1-(n-e)/(l[t+Q.PREV_TIME]-e));c+=(l[t+Q.ROTATE]-c)*s,d+=(l[t+Q.TRANSLATE]-d)*s}i==s.bq.setup?(h.rotateMix=h.data.rotateMix+(c-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(c-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}};let $=Q;$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2;const U=class{constructor(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new z(this),this.propertyIDs=new s.JS,this.animationsChanged=!1,this.trackEntryPool=new s.Kg((()=>new j)),this.data=t}update(t){t*=this.timeScale;const e=this.tracks;for(let n=0,s=e.length;n0){if(s.delay-=a,s.delay>0)continue;a=-s.delay,s.delay=0}let r=s.next;if(null!=r){const e=s.trackLast-r.delay;if(e>=0){for(r.delay=0,r.trackTime+=0==s.timeScale?0:(e/s.timeScale+t)*r.timeScale,s.trackTime+=a,this.setCurrent(n,r,!0);null!=r.mixingFrom;)r.mixTime+=t,r=r.mixingFrom;continue}}else if(s.trackLast>=s.trackEnd&&null==s.mixingFrom){e[n]=null,this.queue.end(s),this.disposeNext(s);continue}if(null!=s.mixingFrom&&this.updateMixingFrom(s,t)){let t=s.mixingFrom;for(s.mixingFrom=null,null!=t&&(t.mixingTo=null);null!=t;)this.queue.end(t),t=t.mixingFrom}s.trackTime+=a}this.queue.drain()}updateMixingFrom(t,e){const n=t.mixingFrom;if(null==n)return!0;const s=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),s):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}apply(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const e=this.events,n=this.tracks;let a=!1;for(let r=0,i=n.length;r0)continue;a=!0;const o=0==r?s.bq.first:i.mixBlend;let l=i.alpha;null!=i.mixingFrom?l*=this.applyMixingFrom(i,t,o):i.trackTime>=i.trackEnd&&null==i.next&&(l=0);const h=i.animationLast,c=i.getAnimationTime(),d=i.animation.timelines.length,u=i.animation.timelines;if(0==r&&1==l||o==s.bq.add)for(let n=0;n1&&(r=1),n!=s.bq.first&&(n=a.mixBlend));const i=r0&&this.queueEvents(a,c),this.events.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(t,e,n,a,r){const i=e.slots[t.slotIndex];if(!i.bone.active)return;const o=t.frames;if(n=o[o.length-1]?o.length-1:x.binarySearch(o,n)-1,this.setAttachment(e,i,t.attachmentNames[s],r)}i.attachmentState<=this.unkeyedState&&(i.attachmentState=this.unkeyedState+U.SETUP)}setAttachment(t,e,n,s){e.setAttachment(null==n?null:t.getAttachment(e.data.index,n)),s&&(e.attachmentState=this.unkeyedState+U.CURRENT)}applyRotateTimeline(t,e,n,a,r,i,o,l){if(l&&(i[o]=0),1==a)return void t.apply(e,0,n,null,1,r,s.mJ.mixIn);const h=t,c=h.frames,d=e.bones[h.boneIndex];if(!d.active)return;let u=0,f=0;if(n=c[c.length-I.ENTRIES])f=d.data.rotation+c[c.length+I.PREV_ROTATION];else{const t=x.binarySearch(c,n,I.ENTRIES),e=c[t+I.PREV_ROTATION],s=c[t],a=h.getCurvePercent((t>>1)-1,1-(n-s)/(c[t+I.PREV_TIME]-s));f=c[t+I.ROTATION]-e,f-=360*(16384-(16384.499999999996-f/360|0)),f=e+f*a+d.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}let m=0,g=f-u;if(g-=360*(16384-(16384.499999999996-g/360|0)),0==g)m=i[o];else{let t=0,e=0;l?(t=0,e=g):(t=i[o],e=i[o+1]);const n=g>0;let a=t>=0;s.M8.signum(e)!=s.M8.signum(g)&&Math.abs(e)<=90&&(Math.abs(t)>180&&(t+=360*s.M8.signum(t)),a=n),m=g+t-t%360,a!=n&&(m+=360*s.M8.signum(t)),i[o]=m}i[o+1]=g,u+=m*a,d.rotation=u-360*(16384-(16384.499999999996-u/360|0))}queueEvents(t,e){const n=t.animationStart,s=t.animationEnd,a=s-n,r=t.trackLast%a,i=this.events;let o=0;const l=i.length;for(;os||this.queue.event(t,e)}let h=!1;for(h=t.loop?0==a||r>t.trackTime%a:e>=s&&t.animationLast=this.tracks.length)return;const e=this.tracks[t];if(null==e)return;this.queue.end(e),this.disposeNext(e);let n=e;for(;;){const t=n.mixingFrom;if(null==t)break;this.queue.end(t),n.mixingFrom=null,n.mixingTo=null,n=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,n){const s=this.expandToIndex(t);this.tracks[t]=e,null!=s&&(n&&this.queue.interrupt(s),e.mixingFrom=s,s.mixingTo=e,e.mixTime=0,null!=s.mixingFrom&&s.mixDuration>0&&(e.interruptAlpha*=Math.min(1,s.mixTime/s.mixDuration)),s.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,n){const s=this.data.skeletonData.findAnimation(e);if(null==s)throw new Error(`Animation not found: ${e}`);return this.setAnimationWith(t,s,n)}setAnimationWith(t,e,n){if(null==e)throw new Error("animation cannot be null.");let s=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,s=!1):this.disposeNext(a));const r=this.trackEntry(t,e,n,a);return this.setCurrent(t,r,s),this.queue.drain(),r}addAnimation(t,e,n,s){const a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error(`Animation not found: ${e}`);return this.addAnimationWith(t,a,n,s)}addAnimationWith(t,e,n,s){if(null==e)throw new Error("animation cannot be null.");let a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;const r=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,r,!0),this.queue.drain();else if(a.next=r,s<=0){const t=a.animationEnd-a.animationStart;0!=t?(a.loop?s+=t*(1+(a.trackTime/t|0)):s+=Math.max(t,a.trackTime),s-=this.data.getMix(a.animation,e)):s=a.trackTime}return r.delay=s,r}setEmptyAnimation(t,e){const n=this.setAnimationWith(t,U.emptyAnimation,!1);return n.mixDuration=e,n.trackEnd=e,n}addEmptyAnimation(t,e,n){n<=0&&(n-=e);const s=this.addAnimationWith(t,U.emptyAnimation,!1,n);return s.mixDuration=e,s.trackEnd=e,s}setEmptyAnimations(t){const e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,n=this.tracks.length;e0){r[s]=U.HOLD_MIX,i[s]=n;continue t}break}r[s]=U.HOLD_FIRST}else r[s]=U.SUBSEQUENT}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}setAnimationByName(t,e,n){U.deprecatedWarning1||(U.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.")),this.setAnimation(t,e,n)}addAnimationByName(t,e,n,s){U.deprecatedWarning2||(U.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.")),this.addAnimation(t,e,n,s)}hasAnimation(t){return null!==this.data.skeletonData.findAnimation(t)}hasAnimationByName(t){return U.deprecatedWarning3||(U.deprecatedWarning3=!0,console.warn("Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.")),this.hasAnimation(t)}};let H=U;H.emptyAnimation=new x("",[],0),H.SUBSEQUENT=0,H.FIRST=1,H.HOLD_SUBSEQUENT=2,H.HOLD_FIRST=3,H.HOLD_MIX=4,H.SETUP=1,H.CURRENT=2,H.deprecatedWarning1=!1,H.deprecatedWarning2=!1,H.deprecatedWarning3=!1;const G=class{constructor(){this.mixBlend=s.bq.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){const t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}get time(){return G.deprecatedWarning1||(G.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime}set time(t){G.deprecatedWarning1||(G.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.")),this.trackTime=t}get endTime(){return G.deprecatedWarning2||(G.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime}set endTime(t){G.deprecatedWarning2||(G.deprecatedWarning2=!0,console.warn("Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.")),this.trackTime=t}loopsCount(){return Math.floor(this.trackTime/this.trackEnd)}};let j=G;j.deprecatedWarning1=!1,j.deprecatedWarning2=!1;const Z=class{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(J.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(J.interrupt),this.objects.push(t)}end(t){this.objects.push(J.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(J.dispose),this.objects.push(t)}complete(t){this.objects.push(J.complete),this.objects.push(t)}event(t,e){this.objects.push(J.event),this.objects.push(t),this.objects.push(e)}deprecateStuff(){return Z.deprecatedWarning1||(Z.deprecatedWarning1=!0,console.warn("Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'")),!0}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;const t=this.objects,e=this.animState.listeners;for(let n=0;n(t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event",t))(J||{});class K{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}}const tt=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,n){const s=this.skeletonData.findAnimation(t);if(null==s)throw new Error(`Animation not found: ${t}`);const a=this.skeletonData.findAnimation(e);if(null==a)throw new Error(`Animation not found: ${e}`);this.setMixWith(s,a,n)}setMixByName(t,e,n){tt.deprecatedWarning1||(tt.deprecatedWarning1=!0,console.warn("Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.")),this.setMix(t,e,n)}setMixWith(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");const s=`${t.name}.${e.name}`;this.animationToMixTime[s]=n}getMix(t,e){const n=`${t.name}.${e.name}`,s=this.animationToMixTime[n];return void 0===s?this.defaultMix:s}};let et=tt;et.deprecatedWarning1=!1;class nt{constructor(t){this.atlas=t}newRegionAttachment(t,e,n){const s=this.atlas.findRegion(n);if(null==s)throw new Error(`Region not found in atlas: ${n} (region attachment: ${e})`);const a=new m(e);return a.region=s,a}newMeshAttachment(t,e,n){const s=this.atlas.findRegion(n);if(null==s)throw new Error(`Region not found in atlas: ${n} (mesh attachment: ${e})`);const a=new h(e);return a.region=s,a}newBoundingBoxAttachment(t,e){return new o(e)}newPathAttachment(t,e){return new c(e)}newPointAttachment(t,e){return new d(e)}newClippingAttachment(t,e){return new l(e)}}var st=n(6951);class at{constructor(t,e,n){if(this.matrix=new st.y3,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.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}get worldX(){return this.matrix.tx}get worldY(){return this.matrix.ty}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(t,e,n,a,r,i,o){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=a,this.ascaleY=r,this.ashearX=i,this.ashearY=o,this.appliedValid=!0;const l=this.parent,h=this.matrix,c=this.skeleton.scaleX,d=s.Xd.yDown?-this.skeleton.scaleY:this.skeleton.scaleY;if(null==l){const l=this.skeleton,u=n+90+o;return h.a=s.M8.cosDeg(n+i)*a*c,h.c=s.M8.cosDeg(u)*r*c,h.b=s.M8.sinDeg(n+i)*a*d,h.d=s.M8.sinDeg(u)*r*d,h.tx=t*c+l.x,void(h.ty=e*d+l.y)}let u=l.matrix.a,f=l.matrix.c,m=l.matrix.b,g=l.matrix.d;switch(h.tx=u*t+f*e+l.matrix.tx,h.ty=m*t+g*e+l.matrix.ty,this.data.transformMode){case s.Qe.Normal:{const t=n+90+o,e=s.M8.cosDeg(n+i)*a,l=s.M8.cosDeg(t)*r,c=s.M8.sinDeg(n+i)*a,d=s.M8.sinDeg(t)*r;return h.a=u*e+f*c,h.c=u*l+f*d,h.b=m*e+g*c,void(h.d=m*l+g*d)}case s.Qe.OnlyTranslation:{const t=n+90+o;h.a=s.M8.cosDeg(n+i)*a,h.c=s.M8.cosDeg(t)*r,h.b=s.M8.sinDeg(n+i)*a,h.d=s.M8.sinDeg(t)*r;break}case s.Qe.NoRotationOrReflection:{let t=u*u+m*m,e=0;t>1e-4?(t=Math.abs(u*g-f*m)/t,u/=this.skeleton.scaleX,m/=this.skeleton.scaleY,f=m*t,g=u*t,e=Math.atan2(m,u)*s.M8.radDeg):(u=0,m=0,e=90-Math.atan2(g,f)*s.M8.radDeg);const l=n+i-e,c=n+o-e+90,d=s.M8.cosDeg(l)*a,p=s.M8.cosDeg(c)*r,E=s.M8.sinDeg(l)*a,x=s.M8.sinDeg(c)*r;h.a=u*d-f*E,h.c=u*p-f*x,h.b=m*d+g*E,h.d=m*p+g*x;break}case s.Qe.NoScale:case s.Qe.NoScaleOrReflection:{const t=s.M8.cosDeg(n),e=s.M8.sinDeg(n);let l=(u*t+f*e)/c,p=(m*t+g*e)/d,E=Math.sqrt(l*l+p*p);E>1e-5&&(E=1/E),l*=E,p*=E,E=Math.sqrt(l*l+p*p),this.data.transformMode==s.Qe.NoScale&&u*g-f*m<0!=(s.Xd.yDown?this.skeleton.scaleX<0!=this.skeleton.scaleY>0:this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(E=-E);const x=Math.PI/2+Math.atan2(p,l),b=Math.cos(x)*E,w=Math.sin(x)*E,M=s.M8.cosDeg(i)*a,S=s.M8.cosDeg(90+o)*r,I=s.M8.sinDeg(i)*a,T=s.M8.sinDeg(90+o)*r;h.a=l*M+b*I,h.c=l*S+b*T,h.b=p*M+w*I,h.d=p*S+w*T;break}}h.a*=c,h.c*=c,h.b*=d,h.d*=d}setToSetupPose(){const t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}getWorldRotationX(){return Math.atan2(this.matrix.b,this.matrix.a)*s.M8.radDeg}getWorldRotationY(){return Math.atan2(this.matrix.d,this.matrix.c)*s.M8.radDeg}getWorldScaleX(){const t=this.matrix;return Math.sqrt(t.a*t.a+t.c*t.c)}getWorldScaleY(){const t=this.matrix;return Math.sqrt(t.b*t.b+t.d*t.d)}updateAppliedTransform(){this.appliedValid=!0;const t=this.parent,e=this.matrix;if(null==t)return this.ax=e.tx,this.ay=e.ty,this.arotation=Math.atan2(e.b,e.a)*s.M8.radDeg,this.ascaleX=Math.sqrt(e.a*e.a+e.b*e.b),this.ascaleY=Math.sqrt(e.c*e.c+e.d*e.d),this.ashearX=0,void(this.ashearY=Math.atan2(e.a*e.c+e.b*e.d,e.a*e.d-e.b*e.c)*s.M8.radDeg);const n=t.matrix,a=1/(n.a*n.d-n.b*n.c),r=e.tx-n.tx,i=e.ty-n.ty;this.ax=r*n.d*a-i*n.c*a,this.ay=i*n.a*a-r*n.b*a;const o=a*n.d,l=a*n.a,h=a*n.c,c=a*n.b,d=o*e.a-h*e.b,u=o*e.c-h*e.d,f=l*e.b-c*e.a,m=l*e.d-c*e.c;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+f*f),this.ascaleX>1e-4){const t=d*m-u*f;this.ascaleY=t/this.ascaleX,this.ashearY=Math.atan2(d*u+f*m,t)*s.M8.radDeg,this.arotation=Math.atan2(f,d)*s.M8.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,u)*s.M8.radDeg}worldToLocal(t){const e=this.matrix,n=e.a,s=e.c,a=e.b,r=e.d,i=1/(n*r-s*a),o=t.x-e.tx,l=t.y-e.ty;return t.x=o*r*i-l*s*i,t.y=l*n*i-o*a*i,t}localToWorld(t){const e=this.matrix,n=t.x,s=t.y;return t.x=n*e.a+s*e.c+e.tx,t.y=n*e.b+s*e.d+e.ty,t}worldToLocalRotation(t){const e=s.M8.sinDeg(t),n=s.M8.cosDeg(t),a=this.matrix;return Math.atan2(a.a*e-a.b*n,a.d*n-a.c*e)*s.M8.radDeg}localToWorldRotation(t){const e=s.M8.sinDeg(t),n=s.M8.cosDeg(t),a=this.matrix;return Math.atan2(n*a.b+e*a.d,n*a.a+e*a.c)*s.M8.radDeg}rotateWorld(t){const e=this.matrix,n=e.a,a=e.c,r=e.b,i=e.d,o=s.M8.cosDeg(t),l=s.M8.sinDeg(t);e.a=o*n-l*r,e.c=o*a-l*i,e.b=l*n+o*r,e.d=l*a+o*i,this.appliedValid=!1}}class rt{constructor(t,e,n){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=s.Qe.Normal,this.skinRequired=!1,this.color=new s.Il,t<0)throw new Error("index must be >= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}}class it{constructor(t,e,n){this.name=t,this.order=e,this.skinRequired=n}}class ot{constructor(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}}class lt{constructor(t){this.name=t}}class ht{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(let n=0;n180?f-=360:f<-180&&(f+=360);let p=t.ascaleX,E=t.ascaleY;if(a||r){switch(t.data.transformMode){case s.Qe.NoScale:case s.Qe.NoScaleOrReflection:m=e-t.worldX,g=n-t.worldY}const l=t.data.length*p,h=Math.sqrt(m*m+g*g);if(a&&hl&&l>1e-4){const t=(h/l-1)*o+1;p*=t,i&&(E*=t)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*o,p,E,t.ashearX,t.ashearY)}apply2(t,e,n,a,r,i,o,l){if(0==l)return void e.updateWorldTransform();t.appliedValid||t.updateAppliedTransform(),e.appliedValid||e.updateAppliedTransform();const h=t.ax,c=t.ay;let d=t.ascaleX,u=d,f=t.ascaleY,m=e.ascaleX;const g=t.matrix;let p=0,E=0,x=0;d<0?(d=-d,p=180,x=-1):(p=0,x=1),f<0&&(f=-f,x=-x),m<0?(m=-m,E=180):E=0;const b=e.ax;let w=0,M=0,S=0,I=g.a,T=g.c,A=g.b,R=g.d;const y=Math.abs(d-f)<=1e-4;y?(w=e.ay,M=I*b+T*w+g.tx,S=A*b+R*w+g.ty):(w=0,M=I*b+g.tx,S=A*b+g.ty);const k=t.parent.matrix;I=k.a,T=k.c,A=k.b,R=k.d;const C=1/(I*R-T*A);let V=M-k.tx,P=S-k.ty;const F=(V*R-P*T)*C-h,v=(P*I-V*A)*C-c,N=Math.sqrt(F*F+v*v);let _,Y,X=e.data.length*m;if(N<1e-4)return this.apply1(t,n,a,!1,i,!1,l),void e.updateWorldTransformWith(b,w,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);V=n-k.tx,P=a-k.ty;let D=(V*R-P*T)*C-h,O=(P*I-V*A)*C-c,q=D*D+O*O;if(0!=o){o*=d*(m+1)/2;const t=Math.sqrt(q),e=t-N-X*d+o;if(e>0){let n=Math.min(1,e/(2*o))-1;n=(e-o*(1-n*n))/t,D-=n*D,O-=n*O,q=D*D+O*O}}t:if(y){X*=d;let t=(q-N*N-X*X)/(2*N*X);t<-1?t=-1:t>1&&(t=1,i&&(u*=(Math.sqrt(q)/(N+X)-1)*l+1)),Y=Math.acos(t)*r,I=N+X*t,T=X*Math.sin(Y),_=Math.atan2(O*I-D*T,D*I+O*T)}else{I=d*X,T=f*X;const t=I*I,e=T*T,n=Math.atan2(O,D);A=e*N*N+t*q-t*e;const a=-2*e*N,i=e-t;if(R=a*a-4*i*A,R>=0){let t=Math.sqrt(R);a<0&&(t=-t),t=-(a+t)/2;const e=t/i,s=A/t,o=Math.abs(e)=-1&&A<=1&&(A=Math.acos(A),V=I*Math.cos(A)+N,P=T*Math.sin(A),R=V*V+P*P,Rg&&(u=A,g=R,m=V,p=P)),q<=(h+g)/2?(_=n-Math.atan2(c*r,l),Y=o*r):(_=n-Math.atan2(p*r,m),Y=u*r)}const B=Math.atan2(w,b)*x;let L=t.arotation;_=(_-B)*s.M8.radDeg+p-L,_>180?_-=360:_<-180&&(_+=360),t.updateWorldTransformWith(h,c,L+_*l,u,t.ascaleY,0,0),L=e.arotation,Y=((Y+B)*s.M8.radDeg-e.ashearX)*x+E-L,Y>180?Y-=360:Y<-180&&(Y+=360),e.updateWorldTransformWith(b,w,L+Y*l,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}class ct extends it{constructor(t){super(t,0,!1),this.bones=new Array,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}}class dt extends it{constructor(t){super(t,0,!1),this.bones=new Array}}var ut=(t=>(t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t))(ut||{});const ft=class{constructor(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let n=0,s=t.bones.length;n0;if(!(n>0||a))return;const r=this.data,i=r.spacingMode,o=i==ut.Length,l=r.rotateMode,h=l==s.YK.Tangent,d=l==s.YK.ChainScale,u=this.bones.length,f=h?u:u+1,m=this.bones,g=s.cQ.setArraySize(this.spaces,f);let p=null;const E=this.spacing;if(d||o){d&&(p=s.cQ.setArraySize(this.lengths,u));for(let t=0,e=f-1;t0?s.M8.degRad:-s.M8.degRad}for(let t=0,r=3;ts.M8.PI?d-=s.M8.PI2:d<-s.M8.PI&&(d+=s.M8.PI2),d*=e,m=Math.cos(d),p=Math.sin(d),o.a=m*n-p*l,o.c=m*a-p*c,o.b=p*n+m*l,o.d=p*a+m*c}i.appliedValid=!1}}computeWorldPositions(t,e,n,a,r){const i=this.target;let o=this.position;const l=this.spaces,h=s.cQ.setArraySize(this.positions,3*e+2);let c=null;const d=t.closed;let u=t.worldVerticesLength,f=u/6,m=ft.NONE;if(!t.constantSpeed){const g=t.lengths;f-=d?1:2;const p=g[f];if(a&&(o*=p),r)for(let t=0;tp){m!=ft.AFTER&&(m=ft.AFTER,t.computeWorldVertices(i,u-6,4,c,0,2)),this.addAfterPosition(E-p,c,0,h,a);continue}}for(;;r++){const t=g[r];if(!(E>t)){if(0==r)E/=t;else{const e=g[r-1];E=(E-e)/(t-e)}break}}r!=m&&(m=r,d&&r==f?(t.computeWorldVertices(i,u-4,4,c,0,2),t.computeWorldVertices(i,0,4,c,4,2)):t.computeWorldVertices(i,6*r+2,8,c,0,2)),this.addCurvePosition(E,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],h,a,n||s>0&&0==e)}return h}d?(u+=2,c=s.cQ.setArraySize(this.world,u),t.computeWorldVertices(i,2,u-4,c,0,2),t.computeWorldVertices(i,0,2,c,u-4,2),c[u-2]=c[0],c[u-1]=c[1]):(f--,u-=4,c=s.cQ.setArraySize(this.world,u),t.computeWorldVertices(i,2,u,c,0,2));const g=s.cQ.setArraySize(this.curves,f);let p=0,E=c[0],x=c[1],b=0,w=0,M=0,S=0,I=0,T=0,A=0,R=0,y=0,k=0,C=0,V=0,P=0,F=0;for(let t=0,e=2;tp){this.addAfterPosition(i-p,c,u-4,h,s);continue}}for(;;a++){const t=g[a];if(!(i>t)){if(0==a)i/=t;else{const e=g[a-1];i=(i-e)/(t-e)}break}}if(a!=m){m=a;let t=6*a;for(E=c[t],x=c[t+1],b=c[t+2],w=c[t+3],M=c[t+4],S=c[t+5],I=c[t+6],T=c[t+7],A=.03*(E-2*b+M),R=.03*(x-2*w+S),y=.006*(3*(b-M)-E+I),k=.006*(3*(w-S)-x+T),C=2*A+y,V=2*R+k,P=.3*(b-E)+A+.16666667*y,F=.3*(w-x)+R+.16666667*k,N=Math.sqrt(P*P+F*F),v[0]=N,t=1;t<8;t++)P+=C,F+=V,C+=y,V+=k,N+=Math.sqrt(P*P+F*F),v[t]=N;P+=C,F+=V,N+=Math.sqrt(P*P+F*F),v[8]=N,P+=C+y,F+=V+k,N+=Math.sqrt(P*P+F*F),v[9]=N,r=0}for(i*=N;;r++){const t=v[r];if(!(i>t)){if(0==r)i/=t;else{const e=v[r-1];i=r+(i-e)/(t-e)}break}}this.addCurvePosition(.1*i,E,x,b,w,M,S,I,T,h,s,n||t>0&&0==e)}return h}addBeforePosition(t,e,n,s,a){const r=e[n],i=e[n+1],o=e[n+2]-r,l=e[n+3]-i,h=Math.atan2(l,o);s[a]=r+t*Math.cos(h),s[a+1]=i+t*Math.sin(h),s[a+2]=h}addAfterPosition(t,e,n,s,a){const r=e[n+2],i=e[n+3],o=r-e[n],l=i-e[n+1],h=Math.atan2(l,o);s[a]=r+t*Math.cos(h),s[a+1]=i+t*Math.sin(h),s[a+2]=h}addCurvePosition(t,e,n,s,a,r,i,o,l,h,c,d){(0==t||isNaN(t))&&(t=1e-4);const u=t*t,f=u*t,m=1-t,g=m*m,p=g*m,E=m*t,x=3*E,b=m*x,w=x*t,M=e*p+s*b+r*w+o*f,S=n*p+a*b+i*w+l*f;h[c]=M,h[c+1]=S,d&&(h[c+2]=Math.atan2(S-(n*g+a*E*2+i*u),M-(e*g+s*E*2+r*u)))}};let mt=ft;mt.NONE=-1,mt.BEFORE=-2,mt.AFTER=-3,mt.epsilon=1e-5;class gt{constructor(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new s.FM,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(let n=0;n0?s.M8.degRad:-s.M8.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,m=this.bones;for(let i=0,d=m.length;is.M8.PI?i-=s.M8.PI2:i<-s.M8.PI&&(i+=s.M8.PI2),i*=t;const l=Math.cos(i),c=Math.sin(i);p.a=l*e-c*a,p.c=l*n-c*r,p.b=c*e+l*a,p.d=c*n+l*r,g=!0}if(0!=e){const t=this.temp;r.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),p.tx+=(t.x-p.tx)*e,p.ty+=(t.y-p.ty)*e,g=!0}if(n>0){let t=Math.sqrt(p.a*p.a+p.b*p.b),e=Math.sqrt(o*o+h*h);t>1e-5&&(t=(t+(e-t+this.data.offsetScaleX)*n)/t),p.a*=t,p.b*=t,t=Math.sqrt(p.c*p.c+p.d*p.d),e=Math.sqrt(l*l+c*c),t>1e-5&&(t=(t+(e-t+this.data.offsetScaleY)*n)/t),p.c*=t,p.d*=t,g=!0}if(a>0){const t=p.c,e=p.d,n=Math.atan2(e,t);let r=Math.atan2(c,l)-Math.atan2(h,o)-(n-Math.atan2(p.b,p.a));r>s.M8.PI?r-=s.M8.PI2:r<-s.M8.PI&&(r+=s.M8.PI2),r=n+(r+f)*a;const i=Math.sqrt(t*t+e*e);p.c=Math.cos(r)*i,p.d=Math.sin(r)*i,g=!0}g&&(d.appliedValid=!1)}}applyRelativeWorld(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,a=this.shearMix,r=this.target,i=r.matrix,o=i.a,l=i.c,h=i.b,c=i.d,d=o*c-l*h>0?s.M8.degRad:-s.M8.degRad,u=this.data.offsetRotation*d,f=this.data.offsetShearY*d,m=this.bones;for(let i=0,d=m.length;is.M8.PI?i-=s.M8.PI2:i<-s.M8.PI&&(i+=s.M8.PI2),i*=t;const l=Math.cos(i),c=Math.sin(i);p.a=l*e-c*a,p.c=l*n-c*r,p.b=c*e+l*a,p.d=c*n+l*r,g=!0}if(0!=e){const t=this.temp;r.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),p.tx+=t.x*e,p.ty+=t.y*e,g=!0}if(n>0){let t=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*n+1;p.a*=t,p.b*=t,t=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleY)*n+1,p.c*=t,p.d*=t,g=!0}if(a>0){let t=Math.atan2(c,l)-Math.atan2(h,o);t>s.M8.PI?t-=s.M8.PI2:t<-s.M8.PI&&(t+=s.M8.PI2);const e=p.c,n=p.d;t=Math.atan2(n,e)+(t-s.M8.PI/2+f)*a;const r=Math.sqrt(e*e+n*n);p.c=Math.cos(t)*r,p.d=Math.sin(t)*r,g=!0}g&&(d.appliedValid=!1)}}applyAbsoluteLocal(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,s=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();const r=this.bones;for(let i=0,o=r.length;i0&&(d>1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*n)/d),u>1e-5&&(u=(u+(a.ascaleY-u+this.data.offsetScaleY)*n)/u));const f=o.ashearY;if(s>0){let t=a.ashearY-f+this.data.offsetShearY;t-=360*(16384-(16384.499999999996-t/360|0)),o.shearY+=t*s}o.updateWorldTransformWith(h,c,l,d,u,o.ashearX,f)}}applyRelativeLocal(){const t=this.rotateMix,e=this.translateMix,n=this.scaleMix,s=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();const r=this.bones;for(let i=0,o=r.length;i0&&(d>1e-5&&(d*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),u>1e-5&&(u*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));let f=o.ashearY;s>0&&(f+=(a.ashearY+this.data.offsetShearY)*s),o.updateWorldTransformWith(h,c,l,d,u,o.ashearX,f)}}}const pt=class{constructor(t){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==t)throw new Error("data cannot be null.");this.data=t,this.bones=new Array;for(let e=0;e1){const t=n[n.length-1];this._updateCache.indexOf(t)>-1||this.updateCacheReset.push(t)}this._updateCache.push(t),this.sortReset(a.children),n[n.length-1].sorted=!0}sortPathConstraint(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||null!=this.skin&&s.cQ.contains(this.skin.constraints,t.data,!0)),!t.active)return;const e=t.target,n=e.data.index,a=e.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,n,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,n,a);for(let t=0,e=this.data.skins.length;t-1||this.updateCacheReset.push(n)}else for(let t=0;t= 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}}class wt extends it{constructor(t){super(t,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}}class Mt{constructor(t,e,n){this.slotIndex=t,this.name=e,this.attachment=n}}class St{constructor(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,null==t)throw new Error("name cannot be null.");this.name=t}setAttachment(t,e,n){if(null==n)throw new Error("attachment cannot be null.");const s=this.attachments;t>=s.length&&(s.length=t+1),s[t]||(s[t]={}),s[t][e]=n}addSkin(t){for(let e=0;e0){const e=new Y(h),r=n.slots.length;for(let n=0;n=0;t--)o[t]=-1;const l=s.cQ.newArray(r-i,0);let h=0,c=0;for(let e=0;e=0;t--)-1==o[t]&&(o[t]=l[--c]);e.setFrame(n,a,o)}a.push(e),i=Math.max(i,e.frames[h-1])}const c=t.readInt(!0);if(c>0){const e=new _(c);for(let s=0;s=0;n--)-1==l[n]&&(l[n]=t[--r])}t.setFrame(a++,this.getValue(i,"time",0),l)}r.push(t),i=Math.max(i,t.frames[t.getFrameCount()-1])}if(t.events){const e=new _(t.events.length);let a=0;for(let r=0;r