@esotericsoftware/spine-canvas 4.2.26 → 4.2.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var spine=(()=>{var Fe=Object.defineProperty,Sr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyNames,Cr=Object.prototype.hasOwnProperty,Ir=(e,t,r)=>t in e?Fe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yr=(e,t)=>{for(var r in t)Fe(e,r,{get:t[r],enumerable:!0})},Tr=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kr(t))!Cr.call(e,i)&&i!==r&&Fe(e,i,{get:()=>t[i],enumerable:!(a=Sr(t,i))||a.enumerable});return e},Xr=e=>Tr(Fe({},"__esModule",{value:!0}),e),V=(e,t,r)=>(Ir(e,typeof t!="symbol"?t+"":t,r),r),Wt={};Yr(Wt,{AlphaTimeline:()=>dt,Animation:()=>Be,AnimationState:()=>er,AnimationStateAdapter:()=>Pr,AnimationStateData:()=>Vr,AssetManager:()=>us,AssetManagerBase:()=>cr,AtlasAttachmentLoader:()=>Nr,Attachment:()=>Qe,AttachmentTimeline:()=>we,BinaryInput:()=>xr,BlendMode:()=>He,Bone:()=>Tt,BoneData:()=>Yt,BoundingBoxAttachment:()=>Ne,CURRENT:()=>ir,CanvasTexture:()=>wr,ClippingAttachment:()=>St,Color:()=>N,ConstraintData:()=>_e,CurveTimeline:()=>ie,CurveTimeline1:()=>ae,CurveTimeline2:()=>Pe,DebugUtils:()=>Er,DeformTimeline:()=>mt,Downloader:()=>Xt,DrawOrderTimeline:()=>be,Event:()=>Mt,EventData:()=>Ft,EventQueue:()=>rr,EventTimeline:()=>Xe,EventType:()=>Z,FIRST:()=>yt,FakeTexture:()=>Dr,HOLD_FIRST:()=>Le,HOLD_MIX:()=>sr,HOLD_SUBSEQUENT:()=>vt,IkConstraint:()=>dr,IkConstraintData:()=>Et,IkConstraintTimeline:()=>gt,IntSet:()=>Mr,Interpolation:()=>zt,MathUtils:()=>X,MeshAttachment:()=>pe,MixBlend:()=>Jt,MixDirection:()=>Kt,PathAttachment:()=>Ae,PathConstraint:()=>Se,PathConstraintData:()=>Rt,PathConstraintMixTimeline:()=>pt,PathConstraintPositionTimeline:()=>wt,PathConstraintSpacingTimeline:()=>bt,PointAttachment:()=>It,Pool:()=>Ye,PositionMode:()=>Ue,Pow:()=>$t,PowOut:()=>Fr,RGB2Timeline:()=>ut,RGBA2Timeline:()=>ft,RGBATimeline:()=>ht,RGBTimeline:()=>ct,RegionAttachment:()=>P,RotateMode:()=>ze,RotateTimeline:()=>Te,SETUP:()=>At,SUBSEQUENT:()=>De,ScaleTimeline:()=>st,ScaleXTimeline:()=>it,ScaleYTimeline:()=>at,SequenceTimeline:()=>ve,ShearTimeline:()=>nt,ShearXTimeline:()=>lt,ShearYTimeline:()=>ot,Skeleton:()=>gr,SkeletonBinary:()=>Or,SkeletonBounds:()=>cs,SkeletonClipping:()=>Nt,SkeletonData:()=>Bt,SkeletonJson:()=>ds,SkeletonRenderer:()=>qt,Skin:()=>$e,SkinEntry:()=>Pt,Slot:()=>fr,SlotData:()=>Vt,SpacingMode:()=>We,StringSet:()=>Ke,Texture:()=>kt,TextureAtlas:()=>lr,TextureAtlasPage:()=>or,TextureAtlasRegion:()=>Ct,TextureFilter:()=>Oe,TextureRegion:()=>nr,TextureWrap:()=>ar,TimeKeeper:()=>Rr,Timeline:()=>J,TrackEntry:()=>tr,TransformConstraint:()=>ur,TransformConstraintData:()=>Dt,TransformConstraintTimeline:()=>xt,TransformMode:()=>qe,TranslateTimeline:()=>et,TranslateXTimeline:()=>tt,TranslateYTimeline:()=>rt,Triangulator:()=>ee,Utils:()=>B,Vector2:()=>Ee,VertexAttachment:()=>se,WindowedMean:()=>Br});var Mr=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Ke=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var r=0,a=e.length;r<a;r++)this.add(e[r]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},xe=class{constructor(e=0,t=0,r=0,a=0){this.r=e,this.g=t,this.b=r,this.a=a}set(e,t,r,a){return this.r=e,this.g=t,this.b=r,this.a=a,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,t,r,a){return this.r+=e,this.g+=t,this.b+=r,this.a+=a,this.clamp()}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(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}static fromString(e){return new xe().setFromString(e)}},N=xe;V(N,"WHITE",new xe(1,1,1,1)),V(N,"RED",new xe(1,0,0,1)),V(N,"GREEN",new xe(0,1,0,1)),V(N,"BLUE",new xe(0,0,1,1)),V(N,"MAGENTA",new xe(1,0,1,1));var ce=class{static clamp(e,t,r){return e<t?t:e>r?r:e}static cosDeg(e){return Math.cos(e*ce.degRad)}static sinDeg(e){return Math.sin(e*ce.degRad)}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ce.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,r){let a=Math.random(),i=t-e;return a<=(r-e)/i?e+Math.sqrt(a*i*(r-e)):t-Math.sqrt((1-a)*i*(t-r))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},X=ce;V(X,"PI",3.1415927),V(X,"PI2",ce.PI*2),V(X,"radiansToDegrees",180/ce.PI),V(X,"radDeg",ce.radiansToDegrees),V(X,"degreesToRadians",ce.PI/180),V(X,"degRad",ce.degreesToRadians);var zt=class{apply(e,t,r){return e+(t-e)*this.applyInternal(r)}},$t=class extends zt{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Fr=class extends $t{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},ye=class{static arrayCopy(e,t,r,a,i){for(let c=t,o=a;c<t+i;c++,o++)r[o]=e[c]}static arrayFill(e,t,r,a){for(let i=t;i<r;i++)e[i]=a}static setArraySize(e,t,r=0){let a=e.length;if(a==t)return e;if(e.length=t,a<t)for(let i=a;i<t;i++)e[i]=r;return e}static ensureArrayCapacity(e,t,r=0){return e.length>=t?e:ye.setArraySize(e,t,r)}static newArray(e,t){let r=new Array(e);for(let a=0;a<e;a++)r[a]=t;return r}static newFloatArray(e){if(ye.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let t=new Array(e);for(let r=0;r<t.length;r++)t[r]=0;return t}}static newShortArray(e){if(ye.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let t=new Array(e);for(let r=0;r<t.length;r++)t[r]=0;return t}}static toFloatArray(e){return ye.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return ye.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,t){}static contains(e,t,r=!0){for(var a=0;a<e.length;a++)if(e[a]==t)return!0;return!1}static enumValue(e,t){return e[t[0].toUpperCase()+t.slice(1)]}},B=ye;V(B,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u");var Er=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let r=e.bones[t];console.log(r.data.name+", "+r.a+", "+r.b+", "+r.c+", "+r.d+", "+r.worldX+", "+r.worldY)}}},Ye=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Ee=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},Rr=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},Br=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Qe=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},Ht=class extends Qe{id=Ht.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(e){super(e)}computeWorldVertices(e,t,r,a,i,c){r=i+(r>>1)*c;let o=e.bone.skeleton,s=e.deform,l=this.vertices,n=this.bones;if(!n){s.length>0&&(l=s);let u=e.bone,g=u.worldX,x=u.worldY,p=u.a,y=u.b,m=u.c,w=u.d;for(let b=t,v=i;v<r;b+=2,v+=c){let A=l[b],S=l[b+1];a[v]=A*p+S*y+g,a[v+1]=A*m+S*w+x}return}let h=0,d=0;for(let u=0;u<t;u+=2){let g=n[h];h+=g+1,d+=g}let f=o.bones;if(s.length==0)for(let u=i,g=d*3;u<r;u+=c){let x=0,p=0,y=n[h++];for(y+=h;h<y;h++,g+=3){let m=f[n[h]],w=l[g],b=l[g+1],v=l[g+2];x+=(w*m.a+b*m.b+m.worldX)*v,p+=(w*m.c+b*m.d+m.worldY)*v}a[u]=x,a[u+1]=p}else{let u=s;for(let g=i,x=d*3,p=d<<1;g<r;g+=c){let y=0,m=0,w=n[h++];for(w+=h;h<w;h++,x+=3,p+=2){let b=f[n[h]],v=l[x]+u[p],A=l[x+1]+u[p+1],S=l[x+2];y+=(v*b.a+A*b.b+b.worldX)*S,m+=(v*b.c+A*b.d+b.worldY)*S}a[g]=y,a[g+1]=m}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),B.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=B.newFloatArray(this.vertices.length),B.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment}},se=Ht;V(se,"nextID",0);var Re=class{id=Re.nextID();regions;start=0;digits=0;setupIndex=0;constructor(e){this.regions=new Array(e)}copy(){let e=new Re(this.regions.length);return B.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,t){let r=e.sequenceIndex;r==-1&&(r=this.setupIndex),r>=this.regions.length&&(r=this.regions.length-1);let a=this.regions[r];t.region!=a&&(t.region=a,t.updateRegion())}getPath(e,t){let r=e,a=(this.start+t).toString();for(let i=this.digits-a.length;i>0;i--)r+="0";return r+=a,r}static nextID(){return Re._nextID++}},Ze=Re;V(Ze,"_nextID",0);var Gt=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(Gt||{}),jt=[0,1,2,3,4,5,6],Be=class{name;timelines=[];timelineIds=new Ke;duration;constructor(e,t,r){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=r}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,r,a,i,c,o,s){if(!e)throw new Error("skeleton cannot be null.");a&&this.duration!=0&&(r%=this.duration,t>0&&(t%=this.duration));let l=this.timelines;for(let n=0,h=l.length;n<h;n++)l[n].apply(e,t,r,i,c,o,s)}},Jt=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(Jt||{}),Kt=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(Kt||{}),G={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,sequence:19},J=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=B.newFloatArray(e*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(e,t){let r=e.length;for(let a=1;a<r;a++)if(e[a]>t)return a-1;return r-1}static search(e,t,r){let a=e.length;for(let i=r;i<a;i+=r)if(e[i]>t)return i-r;return a-r}},ie=class extends J{curves;constructor(e,t,r){super(e,r),this.curves=B.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let r=B.newFloatArray(t);B.arrayCopy(this.curves,0,r,0,t),this.curves=r}}setBezier(e,t,r,a,i,c,o,s,l,n,h){let d=this.curves,f=this.getFrameCount()+e*18;r==0&&(d[t]=2+f);let u=(a-c*2+s)*.03,g=(i-o*2+l)*.03,x=((c-s)*3-a+n)*.006,p=((o-l)*3-i+h)*.006,y=u*2+x,m=g*2+p,w=(c-a)*.3+u+x*.16666667,b=(o-i)*.3+g+p*.16666667,v=a+w,A=i+b;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,b+=m,y+=x,m+=p,v+=w,A+=b}getBezierValue(e,t,r,a){let i=this.curves;if(i[a]>e){let l=this.frames[t],n=this.frames[t+r];return n+(e-l)/(i[a]-l)*(i[a+1]-n)}let c=a+18;for(a+=2;a<c;a+=2)if(i[a]>=e){let l=i[a-2],n=i[a-1];return n+(e-l)/(i[a]-l)*(i[a+1]-n)}t+=this.getFrameEntries();let o=i[c-2],s=i[c-1];return s+(e-o)/(this.frames[t]-o)*(this.frames[t+r]-s)}},ae=class extends ie{constructor(e,t,r){super(e,t,[r])}getFrameEntries(){return 2}setFrame(e,t,r){e<<=1,this.frames[e]=t,this.frames[e+1]=r}getCurveValue(e){let t=this.frames,r=t.length-2;for(let i=2;i<=r;i+=2)if(t[i]>e){r=i-2;break}let a=this.curves[r>>1];switch(a){case 0:let i=t[r],c=t[r+1];return c+(e-i)/(t[r+2]-i)*(t[r+2+1]-c);case 1:return t[r+1]}return this.getBezierValue(e,r,1,a-2)}},Pe=class extends ie{constructor(e,t,r,a){super(e,t,[r,a])}getFrameEntries(){return 3}setFrame(e,t,r,a){e*=3,this.frames[e]=t,this.frames[e+1]=r,this.frames[e+2]=a}},Te=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.rotate+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.rotation=s.data.rotation;return;case 1:s.rotation+=(s.data.rotation-s.rotation)*i}return}let n=this.getCurveValue(r);switch(c){case 0:s.rotation=s.data.rotation+n*i;break;case 1:case 2:n+=s.data.rotation-s.rotation;case 3:s.rotation+=n*i}}},et=class extends Pe{boneIndex=0;constructor(e,t,r){super(e,t,G.x+"|"+r,G.y+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.x=s.data.x,s.y=s.data.y;return;case 1:s.x+=(s.data.x-s.x)*i,s.y+=(s.data.y-s.y)*i}return}let n=0,h=0,d=J.search(l,r,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];n=l[d+1],h=l[d+2];let g=(r-u)/(l[d+3]-u);n+=(l[d+3+1]-n)*g,h+=(l[d+3+2]-h)*g;break;case 1:n=l[d+1],h=l[d+2];break;default:n=this.getBezierValue(r,d,1,f-2),h=this.getBezierValue(r,d,2,f+18-2)}switch(c){case 0:s.x=s.data.x+n*i,s.y=s.data.y+h*i;break;case 1:case 2:s.x+=(s.data.x+n-s.x)*i,s.y+=(s.data.y+h-s.y)*i;break;case 3:s.x+=n*i,s.y+=h*i}}},tt=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.x+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.x=s.data.x;return;case 1:s.x+=(s.data.x-s.x)*i}return}let n=this.getCurveValue(r);switch(c){case 0:s.x=s.data.x+n*i;break;case 1:case 2:s.x+=(s.data.x+n-s.x)*i;break;case 3:s.x+=n*i}}},rt=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.y+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.y=s.data.y;return;case 1:s.y+=(s.data.y-s.y)*i}return}let n=this.getCurveValue(r);switch(c){case 0:s.y=s.data.y+n*i;break;case 1:case 2:s.y+=(s.data.y+n-s.y)*i;break;case 3:s.y+=n*i}}},st=class extends Pe{boneIndex=0;constructor(e,t,r){super(e,t,G.scaleX+"|"+r,G.scaleY+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.scaleX=s.data.scaleX,s.scaleY=s.data.scaleY;return;case 1:s.scaleX+=(s.data.scaleX-s.scaleX)*i,s.scaleY+=(s.data.scaleY-s.scaleY)*i}return}let n,h,d=J.search(l,r,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];n=l[d+1],h=l[d+2];let g=(r-u)/(l[d+3]-u);n+=(l[d+3+1]-n)*g,h+=(l[d+3+2]-h)*g;break;case 1:n=l[d+1],h=l[d+2];break;default:n=this.getBezierValue(r,d,1,f-2),h=this.getBezierValue(r,d,2,f+18-2)}if(n*=s.data.scaleX,h*=s.data.scaleY,i==1)c==3?(s.scaleX+=n-s.data.scaleX,s.scaleY+=h-s.data.scaleY):(s.scaleX=n,s.scaleY=h);else{let u=0,g=0;if(o==1)switch(c){case 0:u=s.data.scaleX,g=s.data.scaleY,s.scaleX=u+(Math.abs(n)*X.signum(u)-u)*i,s.scaleY=g+(Math.abs(h)*X.signum(g)-g)*i;break;case 1:case 2:u=s.scaleX,g=s.scaleY,s.scaleX=u+(Math.abs(n)*X.signum(u)-u)*i,s.scaleY=g+(Math.abs(h)*X.signum(g)-g)*i;break;case 3:s.scaleX+=(n-s.data.scaleX)*i,s.scaleY+=(h-s.data.scaleY)*i}else switch(c){case 0:u=Math.abs(s.data.scaleX)*X.signum(n),g=Math.abs(s.data.scaleY)*X.signum(h),s.scaleX=u+(n-u)*i,s.scaleY=g+(h-g)*i;break;case 1:case 2:u=Math.abs(s.scaleX)*X.signum(n),g=Math.abs(s.scaleY)*X.signum(h),s.scaleX=u+(n-u)*i,s.scaleY=g+(h-g)*i;break;case 3:s.scaleX+=(n-s.data.scaleX)*i,s.scaleY+=(h-s.data.scaleY)*i}}}},it=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.scaleX+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.scaleX=s.data.scaleX;return;case 1:s.scaleX+=(s.data.scaleX-s.scaleX)*i}return}let n=this.getCurveValue(r)*s.data.scaleX;if(i==1)c==3?s.scaleX+=n-s.data.scaleX:s.scaleX=n;else{let h=0;if(o==1)switch(c){case 0:h=s.data.scaleX,s.scaleX=h+(Math.abs(n)*X.signum(h)-h)*i;break;case 1:case 2:h=s.scaleX,s.scaleX=h+(Math.abs(n)*X.signum(h)-h)*i;break;case 3:s.scaleX+=(n-s.data.scaleX)*i}else switch(c){case 0:h=Math.abs(s.data.scaleX)*X.signum(n),s.scaleX=h+(n-h)*i;break;case 1:case 2:h=Math.abs(s.scaleX)*X.signum(n),s.scaleX=h+(n-h)*i;break;case 3:s.scaleX+=(n-s.data.scaleX)*i}}}},at=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.scaleY+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.scaleY=s.data.scaleY;return;case 1:s.scaleY+=(s.data.scaleY-s.scaleY)*i}return}let n=this.getCurveValue(r)*s.data.scaleY;if(i==1)c==3?s.scaleY+=n-s.data.scaleY:s.scaleY=n;else{let h=0;if(o==1)switch(c){case 0:h=s.data.scaleY,s.scaleY=h+(Math.abs(n)*X.signum(h)-h)*i;break;case 1:case 2:h=s.scaleY,s.scaleY=h+(Math.abs(n)*X.signum(h)-h)*i;break;case 3:s.scaleY+=(n-s.data.scaleY)*i}else switch(c){case 0:h=Math.abs(s.data.scaleY)*X.signum(n),s.scaleY=h+(n-h)*i;break;case 1:case 2:h=Math.abs(s.scaleY)*X.signum(n),s.scaleY=h+(n-h)*i;break;case 3:s.scaleY+=(n-s.data.scaleY)*i}}}},nt=class extends Pe{boneIndex=0;constructor(e,t,r){super(e,t,G.shearX+"|"+r,G.shearY+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.shearX=s.data.shearX,s.shearY=s.data.shearY;return;case 1:s.shearX+=(s.data.shearX-s.shearX)*i,s.shearY+=(s.data.shearY-s.shearY)*i}return}let n=0,h=0,d=J.search(l,r,3),f=this.curves[d/3];switch(f){case 0:let u=l[d];n=l[d+1],h=l[d+2];let g=(r-u)/(l[d+3]-u);n+=(l[d+3+1]-n)*g,h+=(l[d+3+2]-h)*g;break;case 1:n=l[d+1],h=l[d+2];break;default:n=this.getBezierValue(r,d,1,f-2),h=this.getBezierValue(r,d,2,f+18-2)}switch(c){case 0:s.shearX=s.data.shearX+n*i,s.shearY=s.data.shearY+h*i;break;case 1:case 2:s.shearX+=(s.data.shearX+n-s.shearX)*i,s.shearY+=(s.data.shearY+h-s.shearY)*i;break;case 3:s.shearX+=n*i,s.shearY+=h*i}}},lt=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.shearX+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.shearX=s.data.shearX;return;case 1:s.shearX+=(s.data.shearX-s.shearX)*i}return}let n=this.getCurveValue(r);switch(c){case 0:s.shearX=s.data.shearX+n*i;break;case 1:case 2:s.shearX+=(s.data.shearX+n-s.shearX)*i;break;case 3:s.shearX+=n*i}}},ot=class extends ae{boneIndex=0;constructor(e,t,r){super(e,t,G.shearY+"|"+r),this.boneIndex=r}apply(e,t,r,a,i,c,o){let s=e.bones[this.boneIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.shearY=s.data.shearY;return;case 1:s.shearY+=(s.data.shearY-s.shearY)*i}return}let n=this.getCurveValue(r);switch(c){case 0:s.shearY=s.data.shearY+n*i;break;case 1:case 2:s.shearY+=(s.data.shearY+n-s.shearY)*i;break;case 3:s.shearY+=n*i}}},ht=class extends ie{slotIndex=0;constructor(e,t,r){super(e,t,[G.rgb+"|"+r,G.alpha+"|"+r]),this.slotIndex=r}getFrameEntries(){return 5}setFrame(e,t,r,a,i,c){e*=5,this.frames[e]=t,this.frames[e+1]=r,this.frames[e+2]=a,this.frames[e+3]=i,this.frames[e+4]=c}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=this.frames,n=s.color;if(r<l[0]){let p=s.data.color;switch(c){case 0:n.setFromColor(p);return;case 1:n.add((p.r-n.r)*i,(p.g-n.g)*i,(p.b-n.b)*i,(p.a-n.a)*i)}return}let h=0,d=0,f=0,u=0,g=J.search(l,r,5),x=this.curves[g/5];switch(x){case 0:let p=l[g];h=l[g+1],d=l[g+2],f=l[g+3],u=l[g+4];let y=(r-p)/(l[g+5]-p);h+=(l[g+5+1]-h)*y,d+=(l[g+5+2]-d)*y,f+=(l[g+5+3]-f)*y,u+=(l[g+5+4]-u)*y;break;case 1:h=l[g+1],d=l[g+2],f=l[g+3],u=l[g+4];break;default:h=this.getBezierValue(r,g,1,x-2),d=this.getBezierValue(r,g,2,x+18-2),f=this.getBezierValue(r,g,3,x+18*2-2),u=this.getBezierValue(r,g,4,x+18*3-2)}i==1?n.set(h,d,f,u):(c==0&&n.setFromColor(s.data.color),n.add((h-n.r)*i,(d-n.g)*i,(f-n.b)*i,(u-n.a)*i))}},ct=class extends ie{slotIndex=0;constructor(e,t,r){super(e,t,[G.rgb+"|"+r]),this.slotIndex=r}getFrameEntries(){return 4}setFrame(e,t,r,a,i){e<<=2,this.frames[e]=t,this.frames[e+1]=r,this.frames[e+2]=a,this.frames[e+3]=i}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=this.frames,n=s.color;if(r<l[0]){let x=s.data.color;switch(c){case 0:n.r=x.r,n.g=x.g,n.b=x.b;return;case 1:n.r+=(x.r-n.r)*i,n.g+=(x.g-n.g)*i,n.b+=(x.b-n.b)*i}return}let h=0,d=0,f=0,u=J.search(l,r,4),g=this.curves[u>>2];switch(g){case 0:let x=l[u];h=l[u+1],d=l[u+2],f=l[u+3];let p=(r-x)/(l[u+4]-x);h+=(l[u+4+1]-h)*p,d+=(l[u+4+2]-d)*p,f+=(l[u+4+3]-f)*p;break;case 1:h=l[u+1],d=l[u+2],f=l[u+3];break;default:h=this.getBezierValue(r,u,1,g-2),d=this.getBezierValue(r,u,2,g+18-2),f=this.getBezierValue(r,u,3,g+18*2-2)}if(i==1)n.r=h,n.g=d,n.b=f;else{if(c==0){let x=s.data.color;n.r=x.r,n.g=x.g,n.b=x.b}n.r+=(h-n.r)*i,n.g+=(d-n.g)*i,n.b+=(f-n.b)*i}}},dt=class extends ae{slotIndex=0;constructor(e,t,r){super(e,t,G.alpha+"|"+r),this.slotIndex=r}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=s.color;if(r<this.frames[0]){let h=s.data.color;switch(c){case 0:l.a=h.a;return;case 1:l.a+=(h.a-l.a)*i}return}let n=this.getCurveValue(r);i==1?l.a=n:(c==0&&(l.a=s.data.color.a),l.a+=(n-l.a)*i)}},ft=class extends ie{slotIndex=0;constructor(e,t,r){super(e,t,[G.rgb+"|"+r,G.alpha+"|"+r,G.rgb2+"|"+r]),this.slotIndex=r}getFrameEntries(){return 8}setFrame(e,t,r,a,i,c,o,s,l){e<<=3,this.frames[e]=t,this.frames[e+1]=r,this.frames[e+2]=a,this.frames[e+3]=i,this.frames[e+4]=c,this.frames[e+5]=o,this.frames[e+6]=s,this.frames[e+7]=l}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=this.frames,n=s.color,h=s.darkColor;if(r<l[0]){let b=s.data.color,v=s.data.darkColor;switch(c){case 0:n.setFromColor(b),h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:n.add((b.r-n.r)*i,(b.g-n.g)*i,(b.b-n.b)*i,(b.a-n.a)*i),h.r+=(v.r-h.r)*i,h.g+=(v.g-h.g)*i,h.b+=(v.b-h.b)*i}return}let d=0,f=0,u=0,g=0,x=0,p=0,y=0,m=J.search(l,r,8),w=this.curves[m>>3];switch(w){case 0:let b=l[m];d=l[m+1],f=l[m+2],u=l[m+3],g=l[m+4],x=l[m+5],p=l[m+6],y=l[m+7];let v=(r-b)/(l[m+8]-b);d+=(l[m+8+1]-d)*v,f+=(l[m+8+2]-f)*v,u+=(l[m+8+3]-u)*v,g+=(l[m+8+4]-g)*v,x+=(l[m+8+5]-x)*v,p+=(l[m+8+6]-p)*v,y+=(l[m+8+7]-y)*v;break;case 1:d=l[m+1],f=l[m+2],u=l[m+3],g=l[m+4],x=l[m+5],p=l[m+6],y=l[m+7];break;default:d=this.getBezierValue(r,m,1,w-2),f=this.getBezierValue(r,m,2,w+18-2),u=this.getBezierValue(r,m,3,w+18*2-2),g=this.getBezierValue(r,m,4,w+18*3-2),x=this.getBezierValue(r,m,5,w+18*4-2),p=this.getBezierValue(r,m,6,w+18*5-2),y=this.getBezierValue(r,m,7,w+18*6-2)}if(i==1)n.set(d,f,u,g),h.r=x,h.g=p,h.b=y;else{if(c==0){n.setFromColor(s.data.color);let b=s.data.darkColor;h.r=b.r,h.g=b.g,h.b=b.b}n.add((d-n.r)*i,(f-n.g)*i,(u-n.b)*i,(g-n.a)*i),h.r+=(x-h.r)*i,h.g+=(p-h.g)*i,h.b+=(y-h.b)*i}}},ut=class extends ie{slotIndex=0;constructor(e,t,r){super(e,t,[G.rgb+"|"+r,G.rgb2+"|"+r]),this.slotIndex=r}getFrameEntries(){return 7}setFrame(e,t,r,a,i,c,o,s){e*=7,this.frames[e]=t,this.frames[e+1]=r,this.frames[e+2]=a,this.frames[e+3]=i,this.frames[e+4]=c,this.frames[e+5]=o,this.frames[e+6]=s}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=this.frames,n=s.color,h=s.darkColor;if(r<l[0]){let b=s.data.color,v=s.data.darkColor;switch(c){case 0:n.r=b.r,n.g=b.g,n.b=b.b,h.r=v.r,h.g=v.g,h.b=v.b;return;case 1:n.r+=(b.r-n.r)*i,n.g+=(b.g-n.g)*i,n.b+=(b.b-n.b)*i,h.r+=(v.r-h.r)*i,h.g+=(v.g-h.g)*i,h.b+=(v.b-h.b)*i}return}let d=0,f=0,u=0,g=0,x=0,p=0,y=0,m=J.search(l,r,7),w=this.curves[m/7];switch(w){case 0:let b=l[m];d=l[m+1],f=l[m+2],u=l[m+3],x=l[m+4],p=l[m+5],y=l[m+6];let v=(r-b)/(l[m+7]-b);d+=(l[m+7+1]-d)*v,f+=(l[m+7+2]-f)*v,u+=(l[m+7+3]-u)*v,x+=(l[m+7+4]-x)*v,p+=(l[m+7+5]-p)*v,y+=(l[m+7+6]-y)*v;break;case 1:d=l[m+1],f=l[m+2],u=l[m+3],x=l[m+4],p=l[m+5],y=l[m+6];break;default:d=this.getBezierValue(r,m,1,w-2),f=this.getBezierValue(r,m,2,w+18-2),u=this.getBezierValue(r,m,3,w+18*2-2),x=this.getBezierValue(r,m,4,w+18*3-2),p=this.getBezierValue(r,m,5,w+18*4-2),y=this.getBezierValue(r,m,6,w+18*5-2)}if(i==1)n.r=d,n.g=f,n.b=u,h.r=x,h.g=p,h.b=y;else{if(c==0){let b=s.data.color,v=s.data.darkColor;n.r=b.r,n.g=b.g,n.b=b.b,h.r=v.r,h.g=v.g,h.b=v.b}n.r+=(d-n.r)*i,n.g+=(f-n.g)*i,n.b+=(u-n.b)*i,h.r+=(x-h.r)*i,h.g+=(p-h.g)*i,h.b+=(y-h.b)*i}}},we=class extends J{slotIndex=0;attachmentNames;constructor(e,t){super(e,[G.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,r){this.frames[e]=t,this.attachmentNames[e]=r}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(s.bone.active){if(o==1){c==0&&this.setAttachment(e,s,s.data.attachmentName);return}if(r<this.frames[0]){(c==0||c==1)&&this.setAttachment(e,s,s.data.attachmentName);return}this.setAttachment(e,s,this.attachmentNames[J.search1(this.frames,r)])}}setAttachment(e,t,r){t.setAttachment(r?e.getAttachment(this.slotIndex,r):null)}},mt=class extends ie{slotIndex=0;attachment;vertices;constructor(e,t,r,a){super(e,t,[G.deform+"|"+r+"|"+a.id]),this.slotIndex=r,this.attachment=a,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,r){this.frames[e]=t,this.vertices[e]=r}setBezier(e,t,r,a,i,c,o,s,l,n,h){let d=this.curves,f=this.getFrameCount()+e*18;r==0&&(d[t]=2+f);let u=(a-c*2+s)*.03,g=l*.03-o*.06,x=((c-s)*3-a+n)*.006,p=(o-l+.33333333)*.018,y=u*2+x,m=g*2+p,w=(c-a)*.3+u+x*.16666667,b=o*.3+g+p*.16666667,v=a+w,A=b;for(let S=f+18;f<S;f+=2)d[f]=v,d[f+1]=A,w+=y,b+=m,y+=x,m+=p,v+=w,A+=b}getCurvePercent(e,t){let r=this.curves,a=r[t];switch(a){case 0:let s=this.frames[t];return(e-s)/(this.frames[t+this.getFrameEntries()]-s);case 1:return 0}if(a-=2,r[a]>e){let s=this.frames[t];return r[a+1]*(e-s)/(r[a]-s)}let i=a+18;for(a+=2;a<i;a+=2)if(r[a]>=e){let s=r[a-2],l=r[a-1];return l+(e-s)/(r[a]-s)*(r[a+1]-l)}let c=r[i-2],o=r[i-1];return o+(1-o)*(e-c)/(this.frames[t+this.getFrameEntries()]-c)}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=s.getAttachment();if(!l||!(l instanceof se)||l.timelineAttachment!=this.attachment)return;let n=s.deform;n.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(r<f[0]){switch(c){case 0:n.length=0;return;case 1:if(i==1){n.length=0;return}n.length=d;let m=l;if(m.bones){i=1-i;for(var u=0;u<d;u++)n[u]*=i}else{let w=m.vertices;for(var u=0;u<d;u++)n[u]+=(w[u]-n[u])*i}}return}if(n.length=d,r>=f[f.length-1]){let m=h[f.length-1];if(i==1)if(c==3){let w=l;if(w.bones)for(let b=0;b<d;b++)n[b]+=m[b];else{let b=w.vertices;for(let v=0;v<d;v++)n[v]+=m[v]-b[v]}}else B.arrayCopy(m,0,n,0,d);else switch(c){case 0:{let b=l;if(b.bones)for(let v=0;v<d;v++)n[v]=m[v]*i;else{let v=b.vertices;for(let A=0;A<d;A++){let S=v[A];n[A]=S+(m[A]-S)*i}}break}case 1:case 2:for(let b=0;b<d;b++)n[b]+=(m[b]-n[b])*i;break;case 3:let w=l;if(w.bones)for(let b=0;b<d;b++)n[b]+=m[b]*i;else{let b=w.vertices;for(let v=0;v<d;v++)n[v]+=(m[v]-b[v])*i}}return}let g=J.search1(f,r),x=this.getCurvePercent(r,g),p=h[g],y=h[g+1];if(i==1)if(c==3){let m=l;if(m.bones)for(let w=0;w<d;w++){let b=p[w];n[w]+=b+(y[w]-b)*x}else{let w=m.vertices;for(let b=0;b<d;b++){let v=p[b];n[b]+=v+(y[b]-v)*x-w[b]}}}else for(let m=0;m<d;m++){let w=p[m];n[m]=w+(y[m]-w)*x}else switch(c){case 0:{let w=l;if(w.bones)for(let b=0;b<d;b++){let v=p[b];n[b]=(v+(y[b]-v)*x)*i}else{let b=w.vertices;for(let v=0;v<d;v++){let A=p[v],S=b[v];n[v]=S+(A+(y[v]-A)*x-S)*i}}break}case 1:case 2:for(let w=0;w<d;w++){let b=p[w];n[w]+=(b+(y[w]-b)*x-n[w])*i}break;case 3:let m=l;if(m.bones)for(let w=0;w<d;w++){let b=p[w];n[w]+=(b+(y[w]-b)*x)*i}else{let w=m.vertices;for(let b=0;b<d;b++){let v=p[b];n[b]+=(v+(y[b]-v)*x-w[b])*i}}}}},Qt=class extends J{events;constructor(e){super(e,Qt.propertyIds),this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t.time,this.events[e]=t}apply(e,t,r,a,i,c,o){if(!a)return;let s=this.frames,l=this.frames.length;if(t>r)this.apply(e,t,Number.MAX_VALUE,a,i,c,o),t=-1;else if(t>=s[l-1])return;if(r<s[0])return;let n=0;if(t<s[0])n=0;else{n=J.search1(s,t)+1;let h=s[n];for(;n>0&&s[n-1]==h;)n--}for(;n<l&&r>=s[n];n++)a.push(this.events[n])}},Xe=Qt;V(Xe,"propertyIds",[""+G.event]);var Zt=class extends J{drawOrders;constructor(e){super(e,Zt.propertyIds),this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,r){this.frames[e]=t,this.drawOrders[e]=r}apply(e,t,r,a,i,c,o){if(o==1){c==0&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(r<this.frames[0]){(c==0||c==1)&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let s=J.search1(this.frames,r),l=this.drawOrders[s];if(!l)B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let n=e.drawOrder,h=e.slots;for(let d=0,f=l.length;d<f;d++)n[d]=h[l[d]]}}},be=Zt;V(be,"propertyIds",[""+G.drawOrder]);var gt=class extends ie{ikConstraintIndex=0;constructor(e,t,r){super(e,t,[G.ikConstraint+"|"+r]),this.ikConstraintIndex=r}getFrameEntries(){return 6}setFrame(e,t,r,a,i,c,o){e*=6,this.frames[e]=t,this.frames[e+1]=r,this.frames[e+2]=a,this.frames[e+3]=i,this.frames[e+4]=c?1:0,this.frames[e+5]=o?1:0}apply(e,t,r,a,i,c,o){let s=e.ikConstraints[this.ikConstraintIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.mix=s.data.mix,s.softness=s.data.softness,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch;return;case 1:s.mix+=(s.data.mix-s.mix)*i,s.softness+=(s.data.softness-s.softness)*i,s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch}return}let n=0,h=0,d=J.search(l,r,6),f=this.curves[d/6];switch(f){case 0:let u=l[d];n=l[d+1],h=l[d+2];let g=(r-u)/(l[d+6]-u);n+=(l[d+6+1]-n)*g,h+=(l[d+6+2]-h)*g;break;case 1:n=l[d+1],h=l[d+2];break;default:n=this.getBezierValue(r,d,1,f-2),h=this.getBezierValue(r,d,2,f+18-2)}c==0?(s.mix=s.data.mix+(n-s.data.mix)*i,s.softness=s.data.softness+(h-s.data.softness)*i,o==1?(s.bendDirection=s.data.bendDirection,s.compress=s.data.compress,s.stretch=s.data.stretch):(s.bendDirection=l[d+3],s.compress=l[d+4]!=0,s.stretch=l[d+5]!=0)):(s.mix+=(n-s.mix)*i,s.softness+=(h-s.softness)*i,o==0&&(s.bendDirection=l[d+3],s.compress=l[d+4]!=0,s.stretch=l[d+5]!=0))}},xt=class extends ie{transformConstraintIndex=0;constructor(e,t,r){super(e,t,[G.transformConstraint+"|"+r]),this.transformConstraintIndex=r}getFrameEntries(){return 7}setFrame(e,t,r,a,i,c,o,s){let l=this.frames;e*=7,l[e]=t,l[e+1]=r,l[e+2]=a,l[e+3]=i,l[e+4]=c,l[e+5]=o,l[e+6]=s}apply(e,t,r,a,i,c,o){let s=e.transformConstraints[this.transformConstraintIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){let y=s.data;switch(c){case 0:s.mixRotate=y.mixRotate,s.mixX=y.mixX,s.mixY=y.mixY,s.mixScaleX=y.mixScaleX,s.mixScaleY=y.mixScaleY,s.mixShearY=y.mixShearY;return;case 1:s.mixRotate+=(y.mixRotate-s.mixRotate)*i,s.mixX+=(y.mixX-s.mixX)*i,s.mixY+=(y.mixY-s.mixY)*i,s.mixScaleX+=(y.mixScaleX-s.mixScaleX)*i,s.mixScaleY+=(y.mixScaleY-s.mixScaleY)*i,s.mixShearY+=(y.mixShearY-s.mixShearY)*i}return}let n,h,d,f,u,g,x=J.search(l,r,7),p=this.curves[x/7];switch(p){case 0:let y=l[x];n=l[x+1],h=l[x+2],d=l[x+3],f=l[x+4],u=l[x+5],g=l[x+6];let m=(r-y)/(l[x+7]-y);n+=(l[x+7+1]-n)*m,h+=(l[x+7+2]-h)*m,d+=(l[x+7+3]-d)*m,f+=(l[x+7+4]-f)*m,u+=(l[x+7+5]-u)*m,g+=(l[x+7+6]-g)*m;break;case 1:n=l[x+1],h=l[x+2],d=l[x+3],f=l[x+4],u=l[x+5],g=l[x+6];break;default:n=this.getBezierValue(r,x,1,p-2),h=this.getBezierValue(r,x,2,p+18-2),d=this.getBezierValue(r,x,3,p+18*2-2),f=this.getBezierValue(r,x,4,p+18*3-2),u=this.getBezierValue(r,x,5,p+18*4-2),g=this.getBezierValue(r,x,6,p+18*5-2)}if(c==0){let y=s.data;s.mixRotate=y.mixRotate+(n-y.mixRotate)*i,s.mixX=y.mixX+(h-y.mixX)*i,s.mixY=y.mixY+(d-y.mixY)*i,s.mixScaleX=y.mixScaleX+(f-y.mixScaleX)*i,s.mixScaleY=y.mixScaleY+(u-y.mixScaleY)*i,s.mixShearY=y.mixShearY+(g-y.mixShearY)*i}else s.mixRotate+=(n-s.mixRotate)*i,s.mixX+=(h-s.mixX)*i,s.mixY+=(d-s.mixY)*i,s.mixScaleX+=(f-s.mixScaleX)*i,s.mixScaleY+=(u-s.mixScaleY)*i,s.mixShearY+=(g-s.mixShearY)*i}},wt=class extends ae{pathConstraintIndex=0;constructor(e,t,r){super(e,t,G.pathConstraintPosition+"|"+r),this.pathConstraintIndex=r}apply(e,t,r,a,i,c,o){let s=e.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.position=s.data.position;return;case 1:s.position+=(s.data.position-s.position)*i}return}let n=this.getCurveValue(r);c==0?s.position=s.data.position+(n-s.data.position)*i:s.position+=(n-s.position)*i}},bt=class extends ae{pathConstraintIndex=0;constructor(e,t,r){super(e,t,G.pathConstraintSpacing+"|"+r),this.pathConstraintIndex=r}apply(e,t,r,a,i,c,o){let s=e.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.spacing=s.data.spacing;return;case 1:s.spacing+=(s.data.spacing-s.spacing)*i}return}let n=this.getCurveValue(r);c==0?s.spacing=s.data.spacing+(n-s.data.spacing)*i:s.spacing+=(n-s.spacing)*i}},pt=class extends ie{pathConstraintIndex=0;constructor(e,t,r){super(e,t,[G.pathConstraintMix+"|"+r]),this.pathConstraintIndex=r}getFrameEntries(){return 4}setFrame(e,t,r,a,i){let c=this.frames;e<<=2,c[e]=t,c[e+1]=r,c[e+2]=a,c[e+3]=i}apply(e,t,r,a,i,c,o){let s=e.pathConstraints[this.pathConstraintIndex];if(!s.active)return;let l=this.frames;if(r<l[0]){switch(c){case 0:s.mixRotate=s.data.mixRotate,s.mixX=s.data.mixX,s.mixY=s.data.mixY;return;case 1:s.mixRotate+=(s.data.mixRotate-s.mixRotate)*i,s.mixX+=(s.data.mixX-s.mixX)*i,s.mixY+=(s.data.mixY-s.mixY)*i}return}let n,h,d,f=J.search(l,r,4),u=this.curves[f>>2];switch(u){case 0:let g=l[f];n=l[f+1],h=l[f+2],d=l[f+3];let x=(r-g)/(l[f+4]-g);n+=(l[f+4+1]-n)*x,h+=(l[f+4+2]-h)*x,d+=(l[f+4+3]-d)*x;break;case 1:n=l[f+1],h=l[f+2],d=l[f+3];break;default:n=this.getBezierValue(r,f,1,u-2),h=this.getBezierValue(r,f,2,u+18-2),d=this.getBezierValue(r,f,3,u+18*2-2)}if(c==0){let g=s.data;s.mixRotate=g.mixRotate+(n-g.mixRotate)*i,s.mixX=g.mixX+(h-g.mixX)*i,s.mixY=g.mixY+(d-g.mixY)*i}else s.mixRotate+=(n-s.mixRotate)*i,s.mixX+=(h-s.mixX)*i,s.mixY+=(d-s.mixY)*i}},ue=class extends J{slotIndex;attachment;constructor(e,t,r){super(e,[G.sequence+"|"+t+"|"+r.sequence.id]),this.slotIndex=t,this.attachment=r}getFrameEntries(){return ue.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,t,r,a,i){let c=this.frames;e*=ue.ENTRIES,c[e]=t,c[e+ue.MODE]=r|a<<4,c[e+ue.DELAY]=i}apply(e,t,r,a,i,c,o){let s=e.slots[this.slotIndex];if(!s.bone.active)return;let l=s.attachment,n=this.attachment;if(l!=n&&(!(l instanceof se)||l.timelineAttachment!=n))return;let h=this.frames;if(r<h[0]){(c==0||c==1)&&(s.sequenceIndex=-1);return}let d=J.search(h,r,ue.ENTRIES),f=h[d],u=h[d+ue.MODE],g=h[d+ue.DELAY];if(!this.attachment.sequence)return;let x=u>>4,p=this.attachment.sequence.regions.length,y=jt[u&15];if(y!=0)switch(x+=(r-f)/g+1e-5|0,y){case 1:x=Math.min(p-1,x);break;case 2:x%=p;break;case 3:{let m=(p<<1)-2;x=m==0?0:x%m,x>=p&&(x=m-x);break}case 4:x=Math.max(p-1-x,0);break;case 5:x=p-1-x%p;break;case 6:{let m=(p<<1)-2;x=m==0?0:(x+p-1)%m,x>=p&&(x=m-x)}}s.sequenceIndex=x}},ve=ue;V(ve,"ENTRIES",3),V(ve,"MODE",1),V(ve,"DELAY",2);var Ve=class{static emptyAnimation(){return Ve._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new rr(this);propertyIDs=new Ke;animationsChanged=!1;trackEntryPool=new Ye(()=>new tr);constructor(e){this.data=e}update(e){e*=this.timeScale;let t=this.tracks;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(!i)continue;i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast;let c=e*i.timeScale;if(i.delay>0){if(i.delay-=c,i.delay>0)continue;c=-i.delay,i.delay=0}let o=i.next;if(o){let s=i.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime+=i.timeScale==0?0:(s/i.timeScale+e)*o.timeScale,i.trackTime+=c,this.setCurrent(r,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&!i.mixingFrom){t[r]=null,this.queue.end(i),this.clearNext(i);continue}if(i.mixingFrom&&this.updateMixingFrom(i,e)){let s=i.mixingFrom;for(i.mixingFrom=null,s&&(s.mixingTo=null);s;)this.queue.end(s),s=s.mixingFrom}i.trackTime+=c}this.queue.drain()}updateMixingFrom(e,t){let r=e.mixingFrom;if(!r)return!0;let a=this.updateMixingFrom(r,t);return r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((r.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=r.mixingFrom,r.mixingFrom&&(r.mixingFrom.mixingTo=e),e.interruptAlpha=r.interruptAlpha,this.queue.end(r)),a):(r.trackTime+=t*r.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,r=this.tracks,a=!1;for(let d=0,f=r.length;d<f;d++){let u=r[d];if(!u||u.delay>0)continue;a=!0;let g=d==0?1:u.mixBlend,x=u.alpha;u.mixingFrom?x*=this.applyMixingFrom(u,e,g):u.trackTime>=u.trackEnd&&!u.next&&(x=0);let p=u.animationLast,y=u.getAnimationTime(),m=y,w=t;u.reverse&&(m=u.animation.duration-m,w=null);let b=u.animation.timelines,v=b.length;if(d==0&&x==1||g==3)for(let A=0;A<v;A++){B.webkit602BugfixHelper(x,g);var i=b[A];i instanceof we?this.applyAttachmentTimeline(i,e,m,g,!0):i.apply(e,p,m,w,x,g,0)}else{let A=u.timelineMode,S=u.shortestRotation,C=!S&&u.timelinesRotation.length!=v<<1;C&&(u.timelinesRotation.length=v<<1);for(let Y=0;Y<v;Y++){let M=b[Y],R=A[Y]==De?g:0;!S&&M instanceof Te?this.applyRotateTimeline(M,e,m,x,R,u.timelinesRotation,Y<<1,C):M instanceof we?this.applyAttachmentTimeline(M,e,m,g,!0):(B.webkit602BugfixHelper(x,g),M.apply(e,p,m,w,x,R,0))}}this.queueEvents(u,y),t.length=0,u.nextAnimationLast=y,u.nextTrackLast=u.trackTime}for(var c=this.unkeyedState+At,o=e.slots,s=0,l=e.slots.length;s<l;s++){var n=o[s];if(n.attachmentState==c){var h=n.data.attachmentName;n.setAttachment(h?e.getAttachment(n.data.index,h):null)}}return this.unkeyedState+=2,this.queue.drain(),a}applyMixingFrom(e,t,r){let a=e.mixingFrom;a.mixingFrom&&this.applyMixingFrom(a,t,r);let i=0;e.mixDuration==0?(i=1,r==1&&(r=0)):(i=e.mixTime/e.mixDuration,i>1&&(i=1),r!=1&&(r=a.mixBlend));let c=i<a.attachmentThreshold,o=i<a.drawOrderThreshold,s=a.animation.timelines,l=s.length,n=a.alpha*e.interruptAlpha,h=n*(1-i),d=a.animationLast,f=a.getAnimationTime(),u=f,g=null;if(a.reverse?u=a.animation.duration-u:i<a.eventThreshold&&(g=this.events),r==3)for(let x=0;x<l;x++)s[x].apply(t,d,u,g,h,r,1);else{let x=a.timelineMode,p=a.timelineHoldMix,y=a.shortestRotation,m=!y&&a.timelinesRotation.length!=l<<1;m&&(a.timelinesRotation.length=l<<1),a.totalAlpha=0;for(let w=0;w<l;w++){let b=s[w],v=1,A,S=0;switch(x[w]){case De:if(!o&&b instanceof be)continue;A=r,S=h;break;case yt:A=0,S=h;break;case vt:A=r,S=n;break;case Le:A=0,S=n;break;default:A=0;let C=p[w];S=n*Math.max(0,1-C.mixTime/C.mixDuration);break}a.totalAlpha+=S,!y&&b instanceof Te?this.applyRotateTimeline(b,t,u,S,A,a.timelinesRotation,w<<1,m):b instanceof we?this.applyAttachmentTimeline(b,t,u,A,c):(B.webkit602BugfixHelper(S,r),o&&b instanceof be&&A==0&&(v=0),b.apply(t,d,u,g,S,A,v))}}return e.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,i}applyAttachmentTimeline(e,t,r,a,i){var c=t.slots[e.slotIndex];c.bone.active&&(r<e.frames[0]?(a==0||a==1)&&this.setAttachment(t,c,c.data.attachmentName,i):this.setAttachment(t,c,e.attachmentNames[J.search1(e.frames,r)],i),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+At))}setAttachment(e,t,r,a){t.setAttachment(r?e.getAttachment(t.data.index,r):null),a&&(t.attachmentState=this.unkeyedState+ir)}applyRotateTimeline(e,t,r,a,i,c,o,s){if(s&&(c[o]=0),a==1){e.apply(t,0,r,null,1,i,0);return}let l=t.bones[e.boneIndex];if(!l.active)return;let n=e.frames,h=0,d=0;if(r<n[0])switch(i){case 0:l.rotation=l.data.rotation;default:return;case 1:h=l.rotation,d=l.data.rotation}else h=i==0?l.data.rotation:l.rotation,d=l.data.rotation+e.getCurveValue(r);let f=0,u=d-h;if(u-=(16384-(16384.499999999996-u/360|0))*360,u==0)f=c[o];else{let g=0,x=0;s?(g=0,x=u):(g=c[o],x=c[o+1]);let p=g-g%360;f=u+p;let y=u>=0,m=g>=0;Math.abs(x)<=90&&X.signum(x)!=X.signum(u)&&(Math.abs(g-p)>180?(f+=360*X.signum(g),m=y):p!=0?f-=360*X.signum(g):m=y),m!=y&&(f+=360*X.signum(g)),c[o]=f}c[o+1]=u,l.rotation=h+f*a}queueEvents(e,t){let r=e.animationStart,a=e.animationEnd,i=a-r,c=e.trackLast%i,o=this.events,s=0,l=o.length;for(;s<l;s++){let h=o[s];if(h.time<c)break;h.time>a||this.queue.event(e,h)}let n=!1;for(e.loop?n=i==0||c>e.trackTime%i:n=t>=a&&e.animationLast<a,n&&this.queue.complete(e);s<l;s++){let h=o[s];h.time<r||this.queue.event(e,h)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,r=this.tracks.length;t<r;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let r=t;for(;;){let a=r.mixingFrom;if(!a)break;this.queue.end(a),r.mixingFrom=null,r.mixingTo=null,r=a}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,r){let a=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,a&&(r&&this.queue.interrupt(a),t.mixingFrom=a,a.mixingTo=t,t.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(t.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,r=!1){let a=this.data.skeletonData.findAnimation(t);if(!a)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,a,r)}setAnimationWith(e,t,r=!1){if(!t)throw new Error("animation cannot be null.");let a=!0,i=this.expandToIndex(e);i&&(i.nextTrackLast==-1?(this.tracks[e]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.clearNext(i),i=i.mixingFrom,a=!1):this.clearNext(i));let c=this.trackEntry(e,t,r,i);return this.setCurrent(e,c,a),this.queue.drain(),c}addAnimation(e,t,r=!1,a=0){let i=this.data.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,i,r,a)}addAnimationWith(e,t,r=!1,a=0){if(!t)throw new Error("animation cannot be null.");let i=this.expandToIndex(e);if(i)for(;i.next;)i=i.next;let c=this.trackEntry(e,t,r,i);return i?(i.next=c,c.previous=i,a<=0&&(a+=i.getTrackComplete()-c.mixDuration)):(this.setCurrent(e,c,!0),this.queue.drain()),c.delay=a,c}setEmptyAnimation(e,t=0){let r=this.setAnimationWith(e,Ve.emptyAnimation(),!1);return r.mixDuration=t,r.trackEnd=t,r}addEmptyAnimation(e,t=0,r=0){let a=this.addAnimationWith(e,Ve.emptyAnimation(),!1,r);return r<=0&&(a.delay+=a.mixDuration-t),a.mixDuration=t,a.trackEnd=t,a}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let r=0,a=this.tracks.length;r<a;r++){let i=this.tracks[r];i&&this.setEmptyAnimation(i.trackIndex,e)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(B.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,t,r,a){let i=this.trackEntryPool.obtain();return i.reset(),i.trackIndex=e,i.animation=t,i.loop=r,i.holdPrevious=!1,i.reverse=!1,i.shortestRotation=!1,i.eventThreshold=0,i.attachmentThreshold=0,i.drawOrderThreshold=0,i.animationStart=0,i.animationEnd=t.duration,i.animationLast=-1,i.nextAnimationLast=-1,i.delay=0,i.trackTime=0,i.trackLast=-1,i.nextTrackLast=-1,i.trackEnd=Number.MAX_VALUE,i.timeScale=1,i.alpha=1,i.mixTime=0,i.mixDuration=a?this.data.getMix(a.animation,t):0,i.interruptAlpha=1,i.totalAlpha=0,i.mixBlend=2,i}clearNext(e){let t=e.next;for(;t;)this.queue.dispose(t),t=t.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let t=0,r=e.length;t<r;t++){let a=e[t];if(a){for(;a.mixingFrom;)a=a.mixingFrom;do(!a.mixingTo||a.mixBlend!=3)&&this.computeHold(a),a=a.mixingTo;while(a)}}}computeHold(e){let t=e.mixingTo,r=e.animation.timelines,a=e.animation.timelines.length,i=e.timelineMode;i.length=a;let c=e.timelineHoldMix;c.length=0;let o=this.propertyIDs;if(t&&t.holdPrevious){for(let s=0;s<a;s++)i[s]=o.addAll(r[s].getPropertyIds())?Le:vt;return}e:for(let s=0;s<a;s++){let l=r[s],n=l.getPropertyIds();if(!o.addAll(n))i[s]=De;else if(!t||l instanceof we||l instanceof be||l instanceof Xe||!t.animation.hasTimeline(n))i[s]=yt;else{for(let h=t.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(n)){if(e.mixDuration>0){i[s]=sr,c[s]=h;continue e}break}i[s]=Le}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},er=Ve;V(er,"_emptyAnimation",new Be("<empty>",[],0));var tr=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;attachmentThreshold=0;drawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;mixDuration=0;interruptAlpha=0;totalAlpha=0;mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}},rr=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(Z.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Z.interrupt),this.objects.push(e)}end(e){this.objects.push(Z.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Z.dispose),this.objects.push(e)}complete(e){this.objects.push(Z.complete),this.objects.push(e)}event(e,t){this.objects.push(Z.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let r=0;r<e.length;r+=2){let a=e[r],i=e[r+1];switch(a){case Z.start:i.listener&&i.listener.start&&i.listener.start(i);for(let o=0;o<t.length;o++){let s=t[o];s.start&&s.start(i)}break;case Z.interrupt:i.listener&&i.listener.interrupt&&i.listener.interrupt(i);for(let o=0;o<t.length;o++){let s=t[o];s.interrupt&&s.interrupt(i)}break;case Z.end:i.listener&&i.listener.end&&i.listener.end(i);for(let o=0;o<t.length;o++){let s=t[o];s.end&&s.end(i)}case Z.dispose:i.listener&&i.listener.dispose&&i.listener.dispose(i);for(let o=0;o<t.length;o++){let s=t[o];s.dispose&&s.dispose(i)}this.animState.trackEntryPool.free(i);break;case Z.complete:i.listener&&i.listener.complete&&i.listener.complete(i);for(let o=0;o<t.length;o++){let s=t[o];s.complete&&s.complete(i)}break;case Z.event:let c=e[r+++2];i.listener&&i.listener.event&&i.listener.event(i,c);for(let o=0;o<t.length;o++){let s=t[o];s.event&&s.event(i,c)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Z=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(Z||{}),Pr=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},De=0,yt=1,vt=2,Le=3,sr=4,At=1,ir=2,Vr=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,r){let a=this.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);this.setMixWith(a,i,r)}setMixWith(e,t,r){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let a=e.name+"."+t.name;this.animationToMixTime[a]=r}getMix(e,t){let r=e.name+"."+t.name,a=this.animationToMixTime[r];return a===void 0?this.defaultMix:a}},Ne=class extends se{color=new N(1,1,1,1);constructor(e){super(e)}copy(){let e=new Ne(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},St=class extends se{endSlot=null;color=new N(.2275,.2275,.8078,1);constructor(e){super(e)}copy(){let e=new St(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},kt=class{_image;constructor(e){this._image=e}getImage(){return this._image}},Oe=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(Oe||{}),ar=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(ar||{}),nr=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},Dr=class extends kt{setFilters(e,t){}setWraps(e,t){}dispose(){}},lr=class{pages=new Array;regions=new Array;constructor(e){let t=new Lr(e),r=new Array(4),a={};a.size=n=>{n.width=parseInt(r[1]),n.height=parseInt(r[2])},a.format=()=>{},a.filter=n=>{n.minFilter=B.enumValue(Oe,r[1]),n.magFilter=B.enumValue(Oe,r[2])},a.repeat=n=>{r[1].indexOf("x")!=-1&&(n.uWrap=10497),r[1].indexOf("y")!=-1&&(n.vWrap=10497)},a.pma=n=>{n.pma=r[1]=="true"};var i={};i.xy=n=>{n.x=parseInt(r[1]),n.y=parseInt(r[2])},i.size=n=>{n.width=parseInt(r[1]),n.height=parseInt(r[2])},i.bounds=n=>{n.x=parseInt(r[1]),n.y=parseInt(r[2]),n.width=parseInt(r[3]),n.height=parseInt(r[4])},i.offset=n=>{n.offsetX=parseInt(r[1]),n.offsetY=parseInt(r[2])},i.orig=n=>{n.originalWidth=parseInt(r[1]),n.originalHeight=parseInt(r[2])},i.offsets=n=>{n.offsetX=parseInt(r[1]),n.offsetY=parseInt(r[2]),n.originalWidth=parseInt(r[3]),n.originalHeight=parseInt(r[4])},i.rotate=n=>{let h=r[1];h=="true"?n.degrees=90:h!="false"&&(n.degrees=parseInt(h))},i.index=n=>{n.index=parseInt(r[1])};let c=t.readLine();for(;c&&c.trim().length==0;)c=t.readLine();for(;!(!c||c.trim().length==0||t.readEntry(r,c)==0);)c=t.readLine();let o=null,s=null,l=null;for(;c!==null;)if(c.trim().length==0)o=null,c=t.readLine();else if(o){let n=new Ct(o,c);for(;;){let h=t.readEntry(r,c=t.readLine());if(h==0)break;let d=i[r[0]];if(d)d(n);else{s||(s=[]),l||(l=[]),s.push(r[0]);let f=[];for(let u=0;u<h;u++)f.push(parseInt(r[u+1]));l.push(f)}}n.originalWidth==0&&n.originalHeight==0&&(n.originalWidth=n.width,n.originalHeight=n.height),s&&s.length>0&&l&&l.length>0&&(n.names=s,n.values=l,s=null,l=null),n.u=n.x/o.width,n.v=n.y/o.height,n.degrees==90?(n.u2=(n.x+n.height)/o.width,n.v2=(n.y+n.width)/o.height):(n.u2=(n.x+n.width)/o.width,n.v2=(n.y+n.height)/o.height),this.regions.push(n)}else{for(o=new or(c.trim());t.readEntry(r,c=t.readLine())!=0;){let n=a[r[0]];n&&n(o)}this.pages.push(o)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let r of this.pages)r.setTexture(e.get(t+r.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},Lr=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let r=t.indexOf(":");if(r==-1)return 0;e[0]=t.substr(0,r).trim();for(let a=1,i=r+1;;a++){let c=t.indexOf(",",i);if(c==-1)return e[a]=t.substr(i).trim(),a;if(e[a]=t.substr(i,c-i).trim(),i=c+1,a==4)return 4}}},or=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},Ct=class extends nr{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},pe=class extends se{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new N(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new N(0,0,0,0);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=B.newFloatArray(e.length));let t=this.uvs,r=this.uvs.length,a=this.region.u,i=this.region.v,c=0,o=0;if(this.region instanceof Ct){let s=this.region,l=s.page,n=l.width,h=l.height;switch(s.degrees){case 90:a-=(s.originalHeight-s.offsetY-s.height)/n,i-=(s.originalWidth-s.offsetX-s.width)/h,c=s.originalHeight/n,o=s.originalWidth/h;for(let d=0;d<r;d+=2)t[d]=a+e[d+1]*c,t[d+1]=i+(1-e[d])*o;return;case 180:a-=(s.originalWidth-s.offsetX-s.width)/n,i-=s.offsetY/h,c=s.originalWidth/n,o=s.originalHeight/h;for(let d=0;d<r;d+=2)t[d]=a+(1-e[d])*c,t[d+1]=i+(1-e[d+1])*o;return;case 270:a-=s.offsetY/n,i-=s.offsetX/h,c=s.originalHeight/n,o=s.originalWidth/h;for(let d=0;d<r;d+=2)t[d]=a+(1-e[d+1])*c,t[d+1]=i+e[d]*o;return}a-=s.offsetX/n,i-=(s.originalHeight-s.offsetY-s.height)/h,c=s.originalWidth/n,o=s.originalHeight/h}else this.region?(c=this.region.u2-a,o=this.region.v2-i):(a=i=0,c=o=1);for(let s=0;s<r;s+=2)t[s]=a+e[s]*c,t[s+1]=i+e[s+1]*o}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new pe(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),B.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),B.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),B.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),B.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,t,r,a,i,c){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,t,r,a,i,c)}newLinkedMesh(){let e=new pe(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),e.timelineAttachment=this.timelineAttachment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},Ae=class extends se{lengths=[];closed=!1;constantSpeed=!1;color=new N(1,1,1,1);constructor(e){super(e)}copy(){let e=new Ae(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),B.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},It=class extends se{x=0;y=0;rotation=0;color=new N(.38,.94,0,1);constructor(e){super(e)}computeWorldPosition(e,t){return t.x=this.x*e.a+this.y*e.b+e.worldX,t.y=this.x*e.c+this.y*e.d+e.worldY,t}computeWorldRotation(e){let t=X.cosDeg(this.rotation),r=X.sinDeg(this.rotation),a=t*e.a+r*e.b,i=t*e.c+r*e.d;return Math.atan2(i,a)*X.radDeg}copy(){let e=new It(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},hr=class extends Qe{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new N(1,1,1,1);path;region=null;sequence=null;offset=B.newFloatArray(8);uvs=B.newFloatArray(8);tempColor=new N(1,1,1,1);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.region,t=this.uvs;if(e==null){t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=1,t[5]=1,t[6]=1,t[7]=0;return}let r=this.width/this.region.originalWidth*this.scaleX,a=this.height/this.region.originalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.region.offsetX*r,c=-this.height/2*this.scaleY+this.region.offsetY*a,o=i+this.region.width*r,s=c+this.region.height*a,l=this.rotation*Math.PI/180,n=Math.cos(l),h=Math.sin(l),d=this.x,f=this.y,u=i*n+d,g=i*h,x=c*n+f,p=c*h,y=o*n+d,m=o*h,w=s*n+f,b=s*h,v=this.offset;v[0]=u-p,v[1]=x+g,v[2]=u-b,v[3]=w+g,v[4]=y-b,v[5]=w+m,v[6]=y-p,v[7]=x+m,e.degrees==90?(t[0]=e.u2,t[1]=e.v2,t[2]=e.u,t[3]=e.v2,t[4]=e.u,t[5]=e.v,t[6]=e.u2,t[7]=e.v):(t[0]=e.u,t[1]=e.v2,t[2]=e.u,t[3]=e.v,t[4]=e.u2,t[5]=e.v,t[6]=e.u2,t[7]=e.v2)}computeWorldVertices(e,t,r,a){this.sequence!=null&&this.sequence.apply(e,this);let i=e.bone,c=this.offset,o=i.worldX,s=i.worldY,l=i.a,n=i.b,h=i.c,d=i.d,f=0,u=0;f=c[0],u=c[1],t[r]=f*l+u*n+o,t[r+1]=f*h+u*d+s,r+=a,f=c[2],u=c[3],t[r]=f*l+u*n+o,t[r+1]=f*h+u*d+s,r+=a,f=c[4],u=c[5],t[r]=f*l+u*n+o,t[r+1]=f*h+u*d+s,r+=a,f=c[6],u=c[7],t[r]=f*l+u*n+o,t[r+1]=f*h+u*d+s}copy(){let e=new hr(this.name,this.path);return e.region=this.region,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,B.arrayCopy(this.uvs,0,e.uvs,0,8),B.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},P=hr;V(P,"X1",0),V(P,"Y1",1),V(P,"C1R",2),V(P,"C1G",3),V(P,"C1B",4),V(P,"C1A",5),V(P,"U1",6),V(P,"V1",7),V(P,"X2",8),V(P,"Y2",9),V(P,"C2R",10),V(P,"C2G",11),V(P,"C2B",12),V(P,"C2A",13),V(P,"U2",14),V(P,"V2",15),V(P,"X3",16),V(P,"Y3",17),V(P,"C3R",18),V(P,"C3G",19),V(P,"C3B",20),V(P,"C3A",21),V(P,"U3",22),V(P,"V3",23),V(P,"X4",24),V(P,"Y4",25),V(P,"C4R",26),V(P,"C4G",27),V(P,"C4B",28),V(P,"C4A",29),V(P,"U4",30),V(P,"V4",31);var Nr=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,r){let a=r.regions;for(let i=0,c=a.length;i<c;i++){let o=r.getPath(t,i),s=this.atlas.findRegion(o);if(s==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+e+")");a[i]=s}}newRegionAttachment(e,t,r,a){let i=new P(t,r);if(a!=null)this.loadSequence(t,r,a);else{let c=this.atlas.findRegion(r);if(!c)throw new Error("Region not found in atlas: "+r+" (region attachment: "+t+")");i.region=c}return i}newMeshAttachment(e,t,r,a){let i=new pe(t,r);if(a!=null)this.loadSequence(t,r,a);else{let c=this.atlas.findRegion(r);if(!c)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+t+")");i.region=c}return i}newBoundingBoxAttachment(e,t){return new Ne(t)}newPathAttachment(e,t){return new Ae(t)}newPointAttachment(e,t){return new It(t)}newClippingAttachment(e,t){return new St(t)}},Yt=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;transformMode=qe.Normal;skinRequired=!1;color=new N;constructor(e,t,r){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=r}},qe=(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",e))(qe||{}),Tt=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;sorted=!1;active=!1;constructor(e,t,r){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=r,this.setToSetupPose()}isActive(){return this.active}update(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,r,a,i,c,o){this.ax=e,this.ay=t,this.arotation=r,this.ascaleX=a,this.ascaleY=i,this.ashearX=c,this.ashearY=o;let s=this.parent;if(!s){let f=this.skeleton,u=r+90+o,g=f.scaleX,x=f.scaleY;this.a=X.cosDeg(r+c)*a*g,this.b=X.cosDeg(u)*i*g,this.c=X.sinDeg(r+c)*a*x,this.d=X.sinDeg(u)*i*x,this.worldX=e*g+f.x,this.worldY=t*x+f.y;return}let l=s.a,n=s.b,h=s.c,d=s.d;switch(this.worldX=l*e+n*t+s.worldX,this.worldY=h*e+d*t+s.worldY,this.data.transformMode){case 0:{let f=r+90+o,u=X.cosDeg(r+c)*a,g=X.cosDeg(f)*i,x=X.sinDeg(r+c)*a,p=X.sinDeg(f)*i;this.a=l*u+n*x,this.b=l*g+n*p,this.c=h*u+d*x,this.d=h*g+d*p;return}case 1:{let f=r+90+o;this.a=X.cosDeg(r+c)*a,this.b=X.cosDeg(f)*i,this.c=X.sinDeg(r+c)*a,this.d=X.sinDeg(f)*i;break}case 2:{let f=l*l+h*h,u=0;f>1e-4?(f=Math.abs(l*d-n*h)/f,l/=this.skeleton.scaleX,h/=this.skeleton.scaleY,n=h*f,d=l*f,u=Math.atan2(h,l)*X.radDeg):(l=0,h=0,u=90-Math.atan2(d,n)*X.radDeg);let g=r+c-u,x=r+o-u+90,p=X.cosDeg(g)*a,y=X.cosDeg(x)*i,m=X.sinDeg(g)*a,w=X.sinDeg(x)*i;this.a=l*p-n*m,this.b=l*y-n*w,this.c=h*p+d*m,this.d=h*y+d*w;break}case 3:case 4:{let f=X.cosDeg(r),u=X.sinDeg(r),g=(l*f+n*u)/this.skeleton.scaleX,x=(h*f+d*u)/this.skeleton.scaleY,p=Math.sqrt(g*g+x*x);p>1e-5&&(p=1/p),g*=p,x*=p,p=Math.sqrt(g*g+x*x),this.data.transformMode==3&&l*d-n*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let y=Math.PI/2+Math.atan2(x,g),m=Math.cos(y)*p,w=Math.sin(y)*p,b=X.cosDeg(c)*a,v=X.cosDeg(90+o)*i,A=X.sinDeg(c)*a,S=X.sinDeg(90+o)*i;this.a=g*b+m*A,this.b=g*v+m*S,this.c=x*b+w*A,this.d=x*v+w*S;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)*X.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*X.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(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*X.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)*X.radDeg;return}let t=e.a,r=e.b,a=e.c,i=e.d,c=1/(t*i-r*a),o=i*c,s=r*c,l=a*c,n=t*c,h=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=h*o-d*s,this.ay=d*n-h*l;let f,u,g,x;if(this.data.transformMode==1)f=this.a,u=this.b,g=this.c,x=this.d;else{switch(this.data.transformMode){case 2:{let b=Math.abs(t*i-r*a)/(t*t+a*a),v=t/this.skeleton.scaleX;r=-(a/this.skeleton.scaleY)*b*this.skeleton.scaleX,i=v*b*this.skeleton.scaleY,c=1/(t*i-r*a),o=i*c,s=r*c;break}case 3:case 4:let p=X.cosDeg(this.rotation),y=X.sinDeg(this.rotation);t=(t*p+r*y)/this.skeleton.scaleX,a=(a*p+i*y)/this.skeleton.scaleY;let m=Math.sqrt(t*t+a*a);m>1e-5&&(m=1/m),t*=m,a*=m,m=Math.sqrt(t*t+a*a),this.data.transformMode==3&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(m=-m);let w=X.PI/2+Math.atan2(a,t);r=Math.cos(w)*m,i=Math.sin(w)*m,c=1/(t*i-r*a),o=i*c,s=r*c,l=a*c,n=t*c}f=o*this.a-s*this.c,u=o*this.b-s*this.d,g=n*this.c-l*this.a,x=n*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+g*g),this.ascaleX>1e-4){let p=f*x-u*g;this.ascaleY=p/this.ascaleX,this.ashearY=-Math.atan2(f*u+g*x,p)*X.radDeg,this.arotation=Math.atan2(g,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,u)*X.radDeg}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),r=e.x-this.worldX,a=e.y-this.worldY;return e.x=r*this.d*t-a*this.b*t,e.y=a*this.a*t-r*this.c*t,e}localToWorld(e){let t=e.x,r=e.y;return e.x=t*this.a+r*this.b+this.worldX,e.y=t*this.c+r*this.d+this.worldY,e}worldToLocalRotation(e){let t=X.sinDeg(e),r=X.cosDeg(e);return Math.atan2(this.a*t-this.c*r,this.d*r-this.b*t)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=X.sinDeg(e),r=X.cosDeg(e);return Math.atan2(r*this.c+t*this.d,r*this.a+t*this.b)*X.radDeg}rotateWorld(e){let t=this.a,r=this.b,a=this.c,i=this.d,c=X.cosDeg(e),o=X.sinDeg(e);this.a=c*t-o*a,this.b=c*r-o*i,this.c=o*t+c*a,this.d=o*r+c*i}},_e=class{constructor(e,t,r){this.name=e,this.order=t,this.skinRequired=r}},cr=class{pathPrefix="";textureLoader;downloader;assets={};errors={};toLoad=0;loaded=0;constructor(e,t="",r=new Xt){this.textureLoader=e,this.pathPrefix=t,this.downloader=r}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,r){this.toLoad--,this.loaded++,this.assets[t]=r,e&&e(t,r)}error(e,t,r){this.toLoad--,this.loaded++,this.errors[t]=r,e&&e(t,r)}loadAll(){return new Promise((t,r)=>{let a=()=>{if(this.isLoadingComplete()){this.hasErrors()?r(this.errors):t(this);return}requestAnimationFrame(a)};requestAnimationFrame(a)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},r=()=>{}){e=this.start(e),this.downloader.downloadBinary(e,a=>{this.success(t,e,a)},(a,i)=>{this.error(r,e,`Couldn't load binary ${e}: status ${a}, ${i}`)})}loadText(e,t=()=>{},r=()=>{}){e=this.start(e),this.downloader.downloadText(e,a=>{this.success(t,e,a)},(a,i)=>{this.error(r,e,`Couldn't load text ${e}: status ${a}, ${i}`)})}loadJson(e,t=()=>{},r=()=>{}){e=this.start(e),this.downloader.downloadJson(e,a=>{this.success(t,e,a)},(a,i)=>{this.error(r,e,`Couldn't load JSON ${e}: status ${a}, ${i}`)})}loadTexture(e,t=()=>{},r=()=>{}){if(e=this.start(e),!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(r,e,`Couldn't load image: ${e}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(t,e,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(t,e,this.textureLoader(c))},c.onerror=()=>{this.error(r,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),c.src=e}}loadTextureAtlas(e,t=()=>{},r=()=>{},a){let i=e.lastIndexOf("/"),c=i>=0?e.substring(0,i+1):"";e=this.start(e),this.downloader.downloadText(e,o=>{try{let s=new lr(o),l=s.pages.length,n=!1;for(let h of s.pages)this.loadTexture(a?a[h.name]:c+h.name,(d,f)=>{n||(h.setTexture(f),--l==0&&this.success(t,e,s))},(d,f)=>{n||this.error(r,e,`Couldn't load texture atlas ${e} page image: ${d}`),n=!0})}catch(s){this.error(r,e,`Couldn't parse texture atlas ${e}: ${s.message}`)}},(o,s)=>{this.error(r,e,`Couldn't load texture atlas ${e}: status ${o}, ${s}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.assets[e];if(t)return t;let r=this.errors[e];throw Error("Asset not found: "+e+(r?`
2
- `+r:""))}remove(e){e=this.pathPrefix+e;let t=this.assets[e];return t.dispose&&t.dispose(),delete this.assets[e],t}removeAll(){for(let e in this.assets){let t=this.assets[e];t.dispose&&t.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}},Xt=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),r=t.length,a=new Uint8Array(r),i=0;i<r;i++)a[i]=t.charCodeAt(i);return a}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,r){if(this.start(e,t,r))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.overrideMimeType("text/html"),a.open("GET",e,!0);let i=()=>{this.finish(e,a.status,a.responseText)};a.onload=i,a.onerror=i,a.send()}downloadJson(e,t,r){this.downloadText(e,a=>{t(JSON.parse(a))},r)}downloadBinary(e,t,r){if(this.start(e,t,r))return;if(this.rawDataUris[e]){try{let c=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(c))}catch(c){this.finish(e,400,JSON.stringify(c))}return}let a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer";let i=()=>{this.finish(e,a.status,a.response)};a.onload=()=>{a.status==200||a.status==0?this.finish(e,200,new Uint8Array(a.response)):i()},a.onerror=i,a.send()}start(e,t,r){let a=this.callbacks[e];try{if(a)return!0;this.callbacks[e]=a=[]}finally{a.push(t,r)}}finish(e,t,r){let a=this.callbacks[e];delete this.callbacks[e];let i=t==200||t==0?[r]:[t,r];for(let c=i.length-1,o=a.length;c<o;c+=2)a[c].apply(null,i)}},Mt=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},Ft=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},dr=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)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 a=0;a<e.bones.length;a++){let i=t.findBone(e.bones[a].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[a].name}`);this.bones.push(i)}let r=t.findBone(e.target.name);if(!r)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=r}isActive(){return this.active}update(){if(this.mix==0)return;let e=this.target,t=this.bones;switch(t.length){case 1:this.apply1(t[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(t[0],t[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,r,a,i,c,o){let s=e.parent;if(!s)throw new Error("IK bone must have parent.");let l=s.a,n=s.b,h=s.c,d=s.d,f=-e.ashearX-e.arotation,u=0,g=0;switch(e.data.transformMode){case 1:u=t-e.worldX,g=r-e.worldY;break;case 2:let y=Math.abs(l*d-n*h)/Math.max(1e-4,l*l+h*h),m=l/e.skeleton.scaleX,w=h/e.skeleton.scaleY;n=-w*y*e.skeleton.scaleX,d=m*y*e.skeleton.scaleY,f+=Math.atan2(w,m)*X.radDeg;default:let b=t-s.worldX,v=r-s.worldY,A=l*d-n*h;Math.abs(A)<=1e-4?(u=0,g=0):(u=(b*d-v*n)/A-e.ax,g=(v*l-b*h)/A-e.ay)}f+=Math.atan2(g,u)*X.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let x=e.ascaleX,p=e.ascaleY;if(a||i){switch(e.data.transformMode){case 3:case 4:u=t-e.worldX,g=r-e.worldY}let y=e.data.length*x,m=Math.sqrt(u*u+g*g);if(a&&m<y||i&&m>y&&y>1e-4){let w=(m/y-1)*o+1;x*=w,c&&(p*=w)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*o,x,p,e.ashearX,e.ashearY)}apply2(e,t,r,a,i,c,o,s,l){let n=e.ax,h=e.ay,d=e.ascaleX,f=e.ascaleY,u=d,g=f,x=t.ascaleX,p=0,y=0,m=0;d<0?(d=-d,p=180,m=-1):(p=0,m=1),f<0&&(f=-f,m=-m),x<0?(x=-x,y=180):y=0;let w=t.ax,b=0,v=0,A=0,S=e.a,C=e.b,Y=e.c,M=e.d,R=Math.abs(d-f)<=1e-4;!R||c?(b=0,v=S*w+e.worldX,A=Y*w+e.worldY):(b=t.ay,v=S*w+C*b+e.worldX,A=Y*w+M*b+e.worldY);let E=e.parent;if(!E)throw new Error("IK parent must itself have a parent.");S=E.a,C=E.b,Y=E.c,M=E.d;let F=S*M-C*Y,I=v-E.worldX,T=A-E.worldY;F=Math.abs(F)<=1e-4?0:1/F;let D=(I*M-T*C)*F-n,U=(T*S-I*Y)*F-h,L=Math.sqrt(D*D+U*U),z=t.data.length*x,q,H;if(L<1e-4){this.apply1(e,r,a,!1,c,!1,l),t.updateWorldTransformWith(w,b,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}I=r-E.worldX,T=a-E.worldY;let _=(I*M-T*C)*F-n,O=(T*S-I*Y)*F-h,j=_*_+O*O;if(s!=0){s*=d*(x+1)*.5;let K=Math.sqrt(j),te=K-L-z*d+s;if(te>0){let re=Math.min(1,te/(s*2))-1;re=(te-s*(1-re*re))/K,_-=re*_,O-=re*O,j=_*_+O*O}}e:if(R){z*=d;let K=(j-L*L-z*z)/(2*L*z);K<-1?(K=-1,H=Math.PI*i):K>1?(K=1,H=0,c&&(S=(Math.sqrt(j)/(L+z)-1)*l+1,u*=S,o&&(g*=S))):H=Math.acos(K)*i,S=L+z*K,C=z*Math.sin(H),q=Math.atan2(O*S-_*C,_*S+O*C)}else{S=d*z,C=f*z;let K=S*S,te=C*C,re=Math.atan2(O,_);Y=te*L*L+K*j-K*te;let ge=-2*te*L,ke=te-K;if(M=ge*ge-4*ke*Y,M>=0){let Ce=Math.sqrt(M);ge<0&&(Ce=-Ce),Ce=-(ge+Ce)*.5;let vr=Ce/ke,Ar=Y/Ce,Ie=Math.abs(vr)<Math.abs(Ar)?vr:Ar;if(Ie*Ie<=j){T=Math.sqrt(j-Ie*Ie)*i,q=re-Math.atan2(T,Ie),H=Math.atan2(T/f,(Ie-L)/d);break e}}let Me=X.PI,je=L-S,_t=je*je,br=0,pr=0,Je=L+S,Ut=Je*Je,yr=0;Y=-S*L/(K-te),Y>=-1&&Y<=1&&(Y=Math.acos(Y),I=S*Math.cos(Y)+L,T=C*Math.sin(Y),M=I*I+T*T,M<_t&&(Me=Y,_t=M,je=I,br=T),M>Ut&&(pr=Y,Ut=M,Je=I,yr=T)),j<=(_t+Ut)*.5?(q=re-Math.atan2(br*i,je),H=Me*i):(q=re-Math.atan2(yr*i,Je),H=pr*i)}let Q=Math.atan2(b,w)*m,oe=e.arotation;q=(q-Q)*X.radDeg+p-oe,q>180?q-=360:q<-180&&(q+=360),e.updateWorldTransformWith(n,h,oe+q*l,u,g,0,0),oe=t.arotation,H=((H+Q)*X.radDeg-t.ashearX)*m+y-oe,H>180?H-=360:H<-180&&(H+=360),t.updateWorldTransformWith(w,b,oe+H*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Et=class extends _e{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=1;compress=!1;stretch=!1;uniform=!1;mix=1;softness=0;constructor(e){super(e,0,!1)}},Rt=class extends _e{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=Ue.Fixed;spacingMode=We.Fixed;rotateMode=ze.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(e){super(e,0,!1)}},Ue=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(Ue||{}),We=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(We||{}),ze=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(ze||{}),de=class{data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let a=0,i=e.bones.length;a<i;a++){let c=t.findBone(e.bones[a].name);if(!c)throw new Error(`Couldn't find bone ${e.bones[a].name}.`);this.bones.push(c)}let r=t.findSlot(e.target.name);if(!r)throw new Error(`Couldn't find target bone ${e.target.name}`);this.target=r,this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}update(){let e=this.target.getAttachment();if(!(e instanceof Ae))return;let t=this.mixRotate,r=this.mixX,a=this.mixY;if(t==0&&r==0&&a==0)return;let i=this.data,c=i.rotateMode==0,o=i.rotateMode==2,s=this.bones,l=s.length,n=c?l:l+1,h=B.setArraySize(this.spaces,n),d=o?this.lengths=B.setArraySize(this.lengths,l):[],f=this.spacing;switch(i.spacingMode){case 2:if(o)for(let b=0,v=n-1;b<v;b++){let A=s[b],S=A.data.length;if(S<de.epsilon)d[b]=0;else{let C=S*A.a,Y=S*A.c;d[b]=Math.sqrt(C*C+Y*Y)}}B.arrayFill(h,1,n,f);break;case 3:let m=0;for(let b=0,v=n-1;b<v;){let A=s[b],S=A.data.length;if(S<de.epsilon)o&&(d[b]=0),h[++b]=f;else{let C=S*A.a,Y=S*A.c,M=Math.sqrt(C*C+Y*Y);o&&(d[b]=M),h[++b]=M,m+=M}}if(m>0){m=n/m*f;for(let b=1;b<n;b++)h[b]*=m}break;default:let w=i.spacingMode==0;for(let b=0,v=n-1;b<v;){let A=s[b],S=A.data.length;if(S<de.epsilon)o&&(d[b]=0),h[++b]=f;else{let C=S*A.a,Y=S*A.c,M=Math.sqrt(C*C+Y*Y);o&&(d[b]=M),h[++b]=(w?S+f:f)*M/S}}}let u=this.computeWorldPositions(e,n,c),g=u[0],x=u[1],p=i.offsetRotation,y=!1;if(p==0)y=i.rotateMode==1;else{y=!1;let m=this.target.bone;p*=m.a*m.d-m.b*m.c>0?X.degRad:-X.degRad}for(let m=0,w=3;m<l;m++,w+=3){let b=s[m];b.worldX+=(g-b.worldX)*r,b.worldY+=(x-b.worldY)*a;let v=u[w],A=u[w+1],S=v-g,C=A-x;if(o){let Y=d[m];if(Y!=0){let M=(Math.sqrt(S*S+C*C)/Y-1)*t+1;b.a*=M,b.c*=M}}if(g=v,x=A,t>0){let Y=b.a,M=b.b,R=b.c,E=b.d,F=0,I=0,T=0;if(c?F=u[w-1]:h[m+1]==0?F=u[w+2]:F=Math.atan2(C,S),F-=Math.atan2(R,Y),y){I=Math.cos(F),T=Math.sin(F);let D=b.data.length;g+=(D*(I*Y-T*R)-S)*t,x+=(D*(T*Y+I*R)-C)*t}else F+=p;F>X.PI?F-=X.PI2:F<-X.PI&&(F+=X.PI2),F*=t,I=Math.cos(F),T=Math.sin(F),b.a=I*Y-T*R,b.b=I*M-T*E,b.c=T*Y+I*R,b.d=T*M+I*E}b.updateAppliedTransform()}}computeWorldPositions(e,t,r){let a=this.target,i=this.position,c=this.spaces,o=B.setArraySize(this.positions,t*3+2),s=this.world,l=e.closed,n=e.worldVerticesLength,h=n/6,d=de.NONE;if(!e.constantSpeed){let U=e.lengths;h-=l?1:2;let L=U[h];this.data.positionMode==1&&(i*=L);let z;switch(this.data.spacingMode){case 2:z=L;break;case 3:z=L/t;break;default:z=1}s=B.setArraySize(this.world,8);for(let q=0,H=0,_=0;q<t;q++,H+=3){let O=c[q]*z;i+=O;let j=i;if(l)j%=L,j<0&&(j+=L),_=0;else if(j<0){d!=de.BEFORE&&(d=de.BEFORE,e.computeWorldVertices(a,2,4,s,0,2)),this.addBeforePosition(j,s,0,o,H);continue}else if(j>L){d!=de.AFTER&&(d=de.AFTER,e.computeWorldVertices(a,n-6,4,s,0,2)),this.addAfterPosition(j-L,s,0,o,H);continue}for(;;_++){let Q=U[_];if(!(j>Q)){if(_==0)j/=Q;else{let oe=U[_-1];j=(j-oe)/(Q-oe)}break}}_!=d&&(d=_,l&&_==h?(e.computeWorldVertices(a,n-4,4,s,0,2),e.computeWorldVertices(a,0,4,s,4,2)):e.computeWorldVertices(a,_*6+2,8,s,0,2)),this.addCurvePosition(j,s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],o,H,r||q>0&&O==0)}return o}l?(n+=2,s=B.setArraySize(this.world,n),e.computeWorldVertices(a,2,n-4,s,0,2),e.computeWorldVertices(a,0,2,s,n-4,2),s[n-2]=s[0],s[n-1]=s[1]):(h--,n-=4,s=B.setArraySize(this.world,n),e.computeWorldVertices(a,2,n,s,0,2));let f=B.setArraySize(this.curves,h),u=0,g=s[0],x=s[1],p=0,y=0,m=0,w=0,b=0,v=0,A=0,S=0,C=0,Y=0,M=0,R=0,E=0,F=0;for(let U=0,L=2;U<h;U++,L+=6)p=s[L],y=s[L+1],m=s[L+2],w=s[L+3],b=s[L+4],v=s[L+5],A=(g-p*2+m)*.1875,S=(x-y*2+w)*.1875,C=((p-m)*3-g+b)*.09375,Y=((y-w)*3-x+v)*.09375,M=A*2+C,R=S*2+Y,E=(p-g)*.75+A+C*.16666667,F=(y-x)*.75+S+Y*.16666667,u+=Math.sqrt(E*E+F*F),E+=M,F+=R,M+=C,R+=Y,u+=Math.sqrt(E*E+F*F),E+=M,F+=R,u+=Math.sqrt(E*E+F*F),E+=M+C,F+=R+Y,u+=Math.sqrt(E*E+F*F),f[U]=u,g=b,x=v;this.data.positionMode==1&&(i*=u);let I;switch(this.data.spacingMode){case 2:I=u;break;case 3:I=u/t;break;default:I=1}let T=this.segments,D=0;for(let U=0,L=0,z=0,q=0;U<t;U++,L+=3){let H=c[U]*I;i+=H;let _=i;if(l)_%=u,_<0&&(_+=u),z=0;else if(_<0){this.addBeforePosition(_,s,0,o,L);continue}else if(_>u){this.addAfterPosition(_-u,s,n-4,o,L);continue}for(;;z++){let O=f[z];if(!(_>O)){if(z==0)_/=O;else{let j=f[z-1];_=(_-j)/(O-j)}break}}if(z!=d){d=z;let O=z*6;for(g=s[O],x=s[O+1],p=s[O+2],y=s[O+3],m=s[O+4],w=s[O+5],b=s[O+6],v=s[O+7],A=(g-p*2+m)*.03,S=(x-y*2+w)*.03,C=((p-m)*3-g+b)*.006,Y=((y-w)*3-x+v)*.006,M=A*2+C,R=S*2+Y,E=(p-g)*.3+A+C*.16666667,F=(y-x)*.3+S+Y*.16666667,D=Math.sqrt(E*E+F*F),T[0]=D,O=1;O<8;O++)E+=M,F+=R,M+=C,R+=Y,D+=Math.sqrt(E*E+F*F),T[O]=D;E+=M,F+=R,D+=Math.sqrt(E*E+F*F),T[8]=D,E+=M+C,F+=R+Y,D+=Math.sqrt(E*E+F*F),T[9]=D,q=0}for(_*=D;;q++){let O=T[q];if(!(_>O)){if(q==0)_/=O;else{let j=T[q-1];_=q+(_-j)/(O-j)}break}}this.addCurvePosition(_*.1,g,x,p,y,m,w,b,v,o,L,r||U>0&&H==0)}return o}addBeforePosition(e,t,r,a,i){let c=t[r],o=t[r+1],s=t[r+2]-c,l=t[r+3]-o,n=Math.atan2(l,s);a[i]=c+e*Math.cos(n),a[i+1]=o+e*Math.sin(n),a[i+2]=n}addAfterPosition(e,t,r,a,i){let c=t[r+2],o=t[r+3],s=c-t[r],l=o-t[r+1],n=Math.atan2(l,s);a[i]=c+e*Math.cos(n),a[i+1]=o+e*Math.sin(n),a[i+2]=n}addCurvePosition(e,t,r,a,i,c,o,s,l,n,h,d){if(e==0||isNaN(e)){n[h]=t,n[h+1]=r,n[h+2]=Math.atan2(i-r,a-t);return}let f=e*e,u=f*e,g=1-e,x=g*g,p=x*g,y=g*e,m=y*3,w=g*m,b=m*e,v=t*p+a*w+c*b+s*u,A=r*p+i*w+o*b+l*u;n[h]=v,n[h+1]=A,d&&(e<.001?n[h+2]=Math.atan2(i-r,a-t):n[h+2]=Math.atan2(A-(r*x+i*y*2+o*f),v-(t*x+a*y*2+c*f)))}},Se=de;V(Se,"NONE",-1),V(Se,"BEFORE",-2),V(Se,"AFTER",-3),V(Se,"epsilon",1e-5);var fr=class{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new N,this.darkColor=e.darkColor?new N:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof se)||!(this.attachment instanceof se)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},ur=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new Ee;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(let a=0;a<e.bones.length;a++){let i=t.findBone(e.bones[a].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[a].name}.`);this.bones.push(i)}let r=t.findBone(e.target.name);if(!r)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=r}isActive(){return this.active}update(){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,r=this.mixY,a=this.mixScaleX,i=this.mixScaleY,c=this.mixShearY,o=t!=0||r!=0,s=this.target,l=s.a,n=s.b,h=s.c,d=s.d,f=l*d-n*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,g=this.data.offsetShearY*f,x=this.bones;for(let p=0,y=x.length;p<y;p++){let m=x[p];if(e!=0){let w=m.a,b=m.b,v=m.c,A=m.d,S=Math.atan2(h,l)-Math.atan2(v,w)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let C=Math.cos(S),Y=Math.sin(S);m.a=C*w-Y*v,m.b=C*b-Y*A,m.c=Y*w+C*v,m.d=Y*b+C*A}if(o){let w=this.temp;s.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(w.x-m.worldX)*t,m.worldY+=(w.y-m.worldY)*r}if(a!=0){let w=Math.sqrt(m.a*m.a+m.c*m.c);w!=0&&(w=(w+(Math.sqrt(l*l+h*h)-w+this.data.offsetScaleX)*a)/w),m.a*=w,m.c*=w}if(i!=0){let w=Math.sqrt(m.b*m.b+m.d*m.d);w!=0&&(w=(w+(Math.sqrt(n*n+d*d)-w+this.data.offsetScaleY)*i)/w),m.b*=w,m.d*=w}if(c>0){let w=m.b,b=m.d,v=Math.atan2(b,w),A=Math.atan2(d,n)-Math.atan2(h,l)-(v-Math.atan2(m.c,m.a));A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A=v+(A+g)*c;let S=Math.sqrt(w*w+b*b);m.b=Math.cos(A)*S,m.d=Math.sin(A)*S}m.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,r=this.mixY,a=this.mixScaleX,i=this.mixScaleY,c=this.mixShearY,o=t!=0||r!=0,s=this.target,l=s.a,n=s.b,h=s.c,d=s.d,f=l*d-n*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,g=this.data.offsetShearY*f,x=this.bones;for(let p=0,y=x.length;p<y;p++){let m=x[p];if(e!=0){let w=m.a,b=m.b,v=m.c,A=m.d,S=Math.atan2(h,l)+u;S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S*=e;let C=Math.cos(S),Y=Math.sin(S);m.a=C*w-Y*v,m.b=C*b-Y*A,m.c=Y*w+C*v,m.d=Y*b+C*A}if(o){let w=this.temp;s.localToWorld(w.set(this.data.offsetX,this.data.offsetY)),m.worldX+=w.x*t,m.worldY+=w.y*r}if(a!=0){let w=(Math.sqrt(l*l+h*h)-1+this.data.offsetScaleX)*a+1;m.a*=w,m.c*=w}if(i!=0){let w=(Math.sqrt(n*n+d*d)-1+this.data.offsetScaleY)*i+1;m.b*=w,m.d*=w}if(c>0){let w=Math.atan2(d,n)-Math.atan2(h,l);w>X.PI?w-=X.PI2:w<-X.PI&&(w+=X.PI2);let b=m.b,v=m.d;w=Math.atan2(v,b)+(w-X.PI/2+g)*c;let A=Math.sqrt(b*b+v*v);m.b=Math.cos(w)*A,m.d=Math.sin(w)*A}m.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,r=this.mixY,a=this.mixScaleX,i=this.mixScaleY,c=this.mixShearY,o=this.target,s=this.bones;for(let l=0,n=s.length;l<n;l++){let h=s[l],d=h.arotation;if(e!=0){let y=o.arotation-d+this.data.offsetRotation;y-=(16384-(16384.499999999996-y/360|0))*360,d+=y*e}let f=h.ax,u=h.ay;f+=(o.ax-f+this.data.offsetX)*t,u+=(o.ay-u+this.data.offsetY)*r;let g=h.ascaleX,x=h.ascaleY;a!=0&&g!=0&&(g=(g+(o.ascaleX-g+this.data.offsetScaleX)*a)/g),i!=0&&x!=0&&(x=(x+(o.ascaleY-x+this.data.offsetScaleY)*i)/x);let p=h.ashearY;if(c!=0){let y=o.ashearY-p+this.data.offsetShearY;y-=(16384-(16384.499999999996-y/360|0))*360,p+=y*c}h.updateWorldTransformWith(f,u,d,g,x,h.ashearX,p)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,r=this.mixY,a=this.mixScaleX,i=this.mixScaleY,c=this.mixShearY,o=this.target,s=this.bones;for(let l=0,n=s.length;l<n;l++){let h=s[l],d=h.arotation+(o.arotation+this.data.offsetRotation)*e,f=h.ax+(o.ax+this.data.offsetX)*t,u=h.ay+(o.ay+this.data.offsetY)*r,g=h.ascaleX*((o.ascaleX-1+this.data.offsetScaleX)*a+1),x=h.ascaleY*((o.ascaleY-1+this.data.offsetScaleY)*i+1),p=h.ashearY+(o.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,u,d,g,x,h.ashearX,p)}}},mr=class{data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return mr.yDown?-this._scaleY:this._scaleY}set scaleY(e){this._scaleY=e}x=0;y=0;constructor(e){if(!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let t=0;t<e.bones.length;t++){let r=e.bones[t],a;if(!r.parent)a=new Tt(r,this,null);else{let i=this.bones[r.parent.index];a=new Tt(r,this,i),i.children.push(a)}this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<e.slots.length;t++){let r=e.slots[t],a=this.bones[r.boneData.index],i=new fr(r,a);this.slots.push(i),this.drawOrder.push(i)}this.ikConstraints=new Array;for(let t=0;t<e.ikConstraints.length;t++){let r=e.ikConstraints[t];this.ikConstraints.push(new dr(r,this))}this.transformConstraints=new Array;for(let t=0;t<e.transformConstraints.length;t++){let r=e.transformConstraints[t];this.transformConstraints.push(new ur(r,this))}this.pathConstraints=new Array;for(let t=0;t<e.pathConstraints.length;t++){let r=e.pathConstraints[t];this.pathConstraints.push(new Se(r,this))}this.color=new N(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let t=this.bones;for(let n=0,h=t.length;n<h;n++){let d=t[n];d.sorted=d.data.skinRequired,d.active=!d.sorted}if(this.skin){let n=this.skin.bones;for(let h=0,d=this.skin.bones.length;h<d;h++){let f=this.bones[n[h].index];do f.sorted=!1,f.active=!0,f=f.parent;while(f)}}let r=this.ikConstraints,a=this.transformConstraints,i=this.pathConstraints,c=r.length,o=a.length,s=i.length,l=c+o+s;e:for(let n=0;n<l;n++){for(let h=0;h<c;h++){let d=r[h];if(d.data.order==n){this.sortIkConstraint(d);continue e}}for(let h=0;h<o;h++){let d=a[h];if(d.data.order==n){this.sortTransformConstraint(d);continue e}}for(let h=0;h<s;h++){let d=i[h];if(d.data.order==n){this.sortPathConstraint(d);continue e}}}for(let n=0,h=t.length;n<h;n++)this.sortBone(t[n])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target;this.sortBone(t);let r=e.bones,a=r[0];if(this.sortBone(a),r.length==1)this._updateCache.push(e),this.sortReset(a.children);else{let i=r[r.length-1];this.sortBone(i),this._updateCache.push(e),this.sortReset(a.children),i.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target,r=t.data.index,a=t.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(let s=0,l=this.data.skins.length;s<l;s++)this.sortPathConstraintAttachment(this.data.skins[s],r,a);let i=t.getAttachment();i instanceof Ae&&this.sortPathConstraintAttachmentWith(i,a);let c=e.bones,o=c.length;for(let s=0;s<o;s++)this.sortBone(c[s]);this._updateCache.push(e);for(let s=0;s<o;s++)this.sortReset(c[s].children);for(let s=0;s<o;s++)c[s].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&B.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let t=e.bones,r=t.length;if(e.data.local)for(let a=0;a<r;a++){let i=t[a];this.sortBone(i.parent),this.sortBone(i)}else for(let a=0;a<r;a++)this.sortBone(t[a]);this._updateCache.push(e);for(let a=0;a<r;a++)this.sortReset(t[a].children);for(let a=0;a<r;a++)t[a].sorted=!0}sortPathConstraintAttachment(e,t,r){let a=e.attachments[t];if(a)for(let i in a)this.sortPathConstraintAttachmentWith(a[i],r)}sortPathConstraintAttachmentWith(e,t){if(!(e instanceof Ae))return;let r=e.bones;if(!r)this.sortBone(t);else{let a=this.bones;for(let i=0,c=r.length;i<c;){let o=r[i++];for(o+=i;i<o;)this.sortBone(a[r[i++]])}}}sortBone(e){if(!e||e.sorted)return;let t=e.parent;t&&this.sortBone(t),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let t=0,r=e.length;t<r;t++){let a=e[t];a.active&&(a.sorted&&this.sortReset(a.children),a.sorted=!1)}}updateWorldTransform(){let e=this.bones;for(let r=0,a=e.length;r<a;r++){let i=e[r];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY}let t=this._updateCache;for(let r=0,a=t.length;r<a;r++)t[r].update()}updateWorldTransformWith(e){let t=this.getRootBone();if(!t)throw new Error("Root bone must not be null.");let r=e.a,a=e.b,i=e.c,c=e.d;t.worldX=r*this.x+a*this.y+e.worldX,t.worldY=i*this.x+c*this.y+e.worldY;let o=t.rotation+90+t.shearY,s=X.cosDeg(t.rotation+t.shearX)*t.scaleX,l=X.cosDeg(o)*t.scaleY,n=X.sinDeg(t.rotation+t.shearX)*t.scaleX,h=X.sinDeg(o)*t.scaleY;t.a=(r*s+a*n)*this.scaleX,t.b=(r*l+a*h)*this.scaleX,t.c=(i*s+c*n)*this.scaleY,t.d=(i*l+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,u=d.length;f<u;f++){let g=d[f];g!=t&&g.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let e=this.bones;for(let i=0,c=e.length;i<c;i++)e[i].setToSetupPose();let t=this.ikConstraints;for(let i=0,c=t.length;i<c;i++){let o=t[i];o.mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}let r=this.transformConstraints;for(let i=0,c=r.length;i<c;i++){let o=r[i],s=o.data;o.mixRotate=s.mixRotate,o.mixX=s.mixX,o.mixY=s.mixY,o.mixScaleX=s.mixScaleX,o.mixScaleY=s.mixScaleY,o.mixShearY=s.mixShearY}let a=this.pathConstraints;for(let i=0,c=a.length;i<c;i++){let o=a[i],s=o.data;o.position=s.position,o.spacing=s.spacing,o.mixRotate=s.mixRotate,o.mixX=s.mixX,o.mixY=s.mixY}}setSlotsToSetupPose(){let e=this.slots;B.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,r=e.length;t<r;t++)e[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.data.name==e)return i}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.data.name==e)return i}return null}setSkinByName(e){let t=this.data.findSkin(e);if(!t)throw new Error("Skin not found: "+e);this.setSkin(t)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let t=this.slots;for(let r=0,a=t.length;r<a;r++){let i=t[r],c=i.data.attachmentName;if(c){let o=e.getAttachment(r,c);o&&i.setAttachment(o)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,t){let r=this.data.findSlot(e);if(!r)throw new Error(`Can't find slot with name ${e}`);return this.getAttachment(r.index,t)}getAttachment(e,t){if(!t)throw new Error("attachmentName cannot be null.");if(this.skin){let r=this.skin.getAttachment(e,t);if(r)return r}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,t):null}setAttachment(e,t){if(!e)throw new Error("slotName cannot be null.");let r=this.slots;for(let a=0,i=r.length;a<i;a++){let c=r[a];if(c.data.name==e){let o=null;if(t&&(o=this.getAttachment(a,t),!o))throw new Error("Attachment not found: "+t+", for slot: "+e);c.setAttachment(o);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.ikConstraints;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.data.name==e)return i}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.transformConstraints;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.data.name==e)return i}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.pathConstraints;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.data.name==e)return i}return null}getBoundsRect(){let e=new Ee,t=new Ee;return this.getBounds(e,t),{x:e.x,y:e.y,width:t.x,height:t.y}}getBounds(e,t,r=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let a=this.drawOrder,i=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let l=0,n=a.length;l<n;l++){let h=a[l];if(!h.bone.active)continue;let d=0,f=null,u=h.getAttachment();if(u instanceof P)d=8,f=B.setArraySize(r,d,0),u.computeWorldVertices(h,f,0,2);else if(u instanceof pe){let g=u;d=g.worldVerticesLength,f=B.setArraySize(r,d,0),g.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let g=0,x=f.length;g<x;g+=2){let p=f[g],y=f[g+1];i=Math.min(i,p),c=Math.min(c,y),o=Math.max(o,p),s=Math.max(s,y)}}e.set(i,c),t.set(o-i,s-c)}},gr=mr;V(gr,"yDown",!1);var Bt=class{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;x=0;y=0;width=0;height=0;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.ikConstraints;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.transformConstraints;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let t=this.pathConstraints;for(let r=0,a=t.length;r<a;r++){let i=t[r];if(i.name==e)return i}return null}},Pt=class{constructor(e=0,t,r){this.slotIndex=e,this.name=t,this.attachment=r}},$e=class{name;attachments=new Array;bones=Array();constraints=new Array;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,r){if(!r)throw new Error("attachment cannot be null.");let a=this.attachments;e>=a.length&&(a.length=e+1),a[e]||(a[e]={}),a[e][t]=r}addSkin(e){for(let a=0;a<e.bones.length;a++){let i=e.bones[a],c=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==i){c=!0;break}c||this.bones.push(i)}for(let a=0;a<e.constraints.length;a++){let i=e.constraints[a],c=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==i){c=!0;break}c||this.constraints.push(i)}let t=e.getAttachments();for(let a=0;a<t.length;a++){var r=t[a];this.setAttachment(r.slotIndex,r.name,r.attachment)}}copySkin(e){for(let a=0;a<e.bones.length;a++){let i=e.bones[a],c=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==i){c=!0;break}c||this.bones.push(i)}for(let a=0;a<e.constraints.length;a++){let i=e.constraints[a],c=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==i){c=!0;break}c||this.constraints.push(i)}let t=e.getAttachments();for(let a=0;a<t.length;a++){var r=t[a];r.attachment&&(r.attachment instanceof pe?(r.attachment=r.attachment.newLinkedMesh(),this.setAttachment(r.slotIndex,r.name,r.attachment)):(r.attachment=r.attachment.copy(),this.setAttachment(r.slotIndex,r.name,r.attachment)))}}getAttachment(e,t){let r=this.attachments[e];return r?r[t]:null}removeAttachment(e,t){let r=this.attachments[e];r&&delete r[t]}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let r=this.attachments[t];if(r)for(let a in r){let i=r[a];i&&e.push(new Pt(t,a,i))}}return e}getAttachmentsForSlot(e,t){let r=this.attachments[e];if(r)for(let a in r){let i=r[a];i&&t.push(new Pt(e,a,i))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let r=0;for(let a=0;a<e.slots.length;a++){let i=e.slots[a],c=i.getAttachment();if(c&&r<t.attachments.length){let o=t.attachments[r];for(let s in o){let l=o[s];if(c==l){let n=this.getAttachment(r,s);n&&i.setAttachment(n);break}}}r++}}},Vt=class{index=0;name;boneData;color=new N(1,1,1,1);darkColor=null;attachmentName=null;blendMode=He.Normal;constructor(e,t,r){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=r}},He=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(He||{}),Dt=class extends _e{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(e){super(e,0,!1)}},Or=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,r=new Bt;r.name="";let a=new xr(e),i=a.readInt32(),c=a.readInt32();r.hash=c==0&&i==0?null:c.toString(16)+i.toString(16),r.version=a.readString(),r.x=a.readFloat(),r.y=a.readFloat(),r.width=a.readFloat(),r.height=a.readFloat();let o=a.readBoolean();o&&(r.fps=a.readFloat(),r.imagesPath=a.readString(),r.audioPath=a.readString());let s=0;s=a.readInt(!0);for(let n=0;n<s;n++){let h=a.readString();if(!h)throw new Error("String in string table must not be null.");a.strings.push(h)}s=a.readInt(!0);for(let n=0;n<s;n++){let h=a.readString();if(!h)throw new Error("Bone name must not be null.");let d=n==0?null:r.bones[a.readInt(!0)],f=new Yt(n,h,d);f.rotation=a.readFloat(),f.x=a.readFloat()*t,f.y=a.readFloat()*t,f.scaleX=a.readFloat(),f.scaleY=a.readFloat(),f.shearX=a.readFloat(),f.shearY=a.readFloat(),f.length=a.readFloat()*t,f.transformMode=a.readInt(!0),f.skinRequired=a.readBoolean(),o&&N.rgba8888ToColor(f.color,a.readInt32()),r.bones.push(f)}s=a.readInt(!0);for(let n=0;n<s;n++){let h=a.readString();if(!h)throw new Error("Slot name must not be null.");let d=r.bones[a.readInt(!0)],f=new Vt(n,h,d);N.rgba8888ToColor(f.color,a.readInt32());let u=a.readInt32();u!=-1&&N.rgb888ToColor(f.darkColor=new N,u),f.attachmentName=a.readStringRef(),f.blendMode=a.readInt(!0),r.slots.push(f)}s=a.readInt(!0);for(let n=0,h;n<s;n++){let d=a.readString();if(!d)throw new Error("IK constraint data name must not be null.");let f=new Et(d);f.order=a.readInt(!0),f.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let u=0;u<h;u++)f.bones.push(r.bones[a.readInt(!0)]);f.target=r.bones[a.readInt(!0)],f.mix=a.readFloat(),f.softness=a.readFloat()*t,f.bendDirection=a.readByte(),f.compress=a.readBoolean(),f.stretch=a.readBoolean(),f.uniform=a.readBoolean(),r.ikConstraints.push(f)}s=a.readInt(!0);for(let n=0,h;n<s;n++){let d=a.readString();if(!d)throw new Error("Transform constraint data name must not be null.");let f=new Dt(d);f.order=a.readInt(!0),f.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let u=0;u<h;u++)f.bones.push(r.bones[a.readInt(!0)]);f.target=r.bones[a.readInt(!0)],f.local=a.readBoolean(),f.relative=a.readBoolean(),f.offsetRotation=a.readFloat(),f.offsetX=a.readFloat()*t,f.offsetY=a.readFloat()*t,f.offsetScaleX=a.readFloat(),f.offsetScaleY=a.readFloat(),f.offsetShearY=a.readFloat(),f.mixRotate=a.readFloat(),f.mixX=a.readFloat(),f.mixY=a.readFloat(),f.mixScaleX=a.readFloat(),f.mixScaleY=a.readFloat(),f.mixShearY=a.readFloat(),r.transformConstraints.push(f)}s=a.readInt(!0);for(let n=0,h;n<s;n++){let d=a.readString();if(!d)throw new Error("Path constraint data name must not be null.");let f=new Rt(d);f.order=a.readInt(!0),f.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let u=0;u<h;u++)f.bones.push(r.bones[a.readInt(!0)]);f.target=r.slots[a.readInt(!0)],f.positionMode=a.readInt(!0),f.spacingMode=a.readInt(!0),f.rotateMode=a.readInt(!0),f.offsetRotation=a.readFloat(),f.position=a.readFloat(),f.positionMode==0&&(f.position*=t),f.spacing=a.readFloat(),(f.spacingMode==0||f.spacingMode==1)&&(f.spacing*=t),f.mixRotate=a.readFloat(),f.mixX=a.readFloat(),f.mixY=a.readFloat(),r.pathConstraints.push(f)}let l=this.readSkin(a,r,!0,o);l&&(r.defaultSkin=l,r.skins.push(l));{let n=r.skins.length;for(B.setArraySize(r.skins,s=n+a.readInt(!0));n<s;n++){let h=this.readSkin(a,r,!1,o);if(!h)throw new Error("readSkin() should not have returned null.");r.skins[n]=h}}s=this.linkedMeshes.length;for(let n=0;n<s;n++){let h=this.linkedMeshes[n],d=h.skin?r.findSkin(h.skin):r.defaultSkin;if(!d)throw new Error("Not skin found for linked mesh.");if(!h.parent)throw new Error("Linked mesh parent must not be null");let f=d.getAttachment(h.slotIndex,h.parent);if(!f)throw new Error(`Parent mesh not found: ${h.parent}`);h.mesh.timelineAttachment=h.inheritTimeline?f:h.mesh,h.mesh.setParentMesh(f),h.mesh.region!=null&&h.mesh.updateRegion()}this.linkedMeshes.length=0,s=a.readInt(!0);for(let n=0;n<s;n++){let h=a.readStringRef();if(!h)throw new Error;let d=new Ft(h);d.intValue=a.readInt(!1),d.floatValue=a.readFloat(),d.stringValue=a.readString(),d.audioPath=a.readString(),d.audioPath&&(d.volume=a.readFloat(),d.balance=a.readFloat()),r.events.push(d)}s=a.readInt(!0);for(let n=0;n<s;n++){let h=a.readString();if(!h)throw new Error("Animatio name must not be null.");r.animations.push(this.readAnimation(a,h,r))}return r}readSkin(e,t,r,a){let i=null,c=0;if(r){if(c=e.readInt(!0),c==0)return null;i=new $e("default")}else{let o=e.readStringRef();if(!o)throw new Error("Skin name must not be null.");i=new $e(o),i.bones.length=e.readInt(!0);for(let s=0,l=i.bones.length;s<l;s++)i.bones[s]=t.bones[e.readInt(!0)];for(let s=0,l=e.readInt(!0);s<l;s++)i.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let s=0,l=e.readInt(!0);s<l;s++)i.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let s=0,l=e.readInt(!0);s<l;s++)i.constraints.push(t.pathConstraints[e.readInt(!0)]);c=e.readInt(!0)}for(let o=0;o<c;o++){let s=e.readInt(!0);for(let l=0,n=e.readInt(!0);l<n;l++){let h=e.readStringRef();if(!h)throw new Error("Attachment name must not be null");let d=this.readAttachment(e,t,i,s,h,a);d&&i.setAttachment(s,h,d)}}return i}readAttachment(e,t,r,a,i,c){let o=this.scale,s=e.readStringRef();switch(s||(s=i),e.readByte()){case me.Region:{let l=e.readStringRef(),n=e.readFloat(),h=e.readFloat(),d=e.readFloat(),f=e.readFloat(),u=e.readFloat(),g=e.readFloat(),x=e.readFloat(),p=e.readInt32(),y=this.readSequence(e);l||(l=s);let m=this.attachmentLoader.newRegionAttachment(r,s,l,y);return m?(m.path=l,m.x=h*o,m.y=d*o,m.scaleX=f,m.scaleY=u,m.rotation=n,m.width=g*o,m.height=x*o,N.rgba8888ToColor(m.color,p),m.sequence=y,y==null&&m.updateRegion(),m):null}case me.BoundingBox:{let l=e.readInt(!0),n=this.readVertices(e,l),h=c?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(r,s);return d?(d.worldVerticesLength=l<<1,d.vertices=n.vertices,d.bones=n.bones,c&&N.rgba8888ToColor(d.color,h),d):null}case me.Mesh:{let l=e.readStringRef(),n=e.readInt32(),h=e.readInt(!0),d=this.readFloatArray(e,h<<1,1),f=this.readShortArray(e),u=this.readVertices(e,h),g=e.readInt(!0),x=this.readSequence(e),p=[],y=0,m=0;c&&(p=this.readShortArray(e),y=e.readFloat(),m=e.readFloat()),l||(l=s);let w=this.attachmentLoader.newMeshAttachment(r,s,l,x);return w?(w.path=l,N.rgba8888ToColor(w.color,n),w.bones=u.bones,w.vertices=u.vertices,w.worldVerticesLength=h<<1,w.triangles=f,w.regionUVs=d,x==null&&w.updateRegion(),w.hullLength=g<<1,w.sequence=x,c&&(w.edges=p,w.width=y*o,w.height=m*o),w):null}case me.LinkedMesh:{let l=e.readStringRef(),n=e.readInt32(),h=e.readStringRef(),d=e.readStringRef(),f=e.readBoolean(),u=this.readSequence(e),g=0,x=0;c&&(g=e.readFloat(),x=e.readFloat()),l||(l=s);let p=this.attachmentLoader.newMeshAttachment(r,s,l,u);return p?(p.path=l,N.rgba8888ToColor(p.color,n),p.sequence=u,c&&(p.width=g*o,p.height=x*o),this.linkedMeshes.push(new qr(p,h,a,d,f)),p):null}case me.Path:{let l=e.readBoolean(),n=e.readBoolean(),h=e.readInt(!0),d=this.readVertices(e,h),f=B.newArray(h/3,0);for(let x=0,p=f.length;x<p;x++)f[x]=e.readFloat()*o;let u=c?e.readInt32():0,g=this.attachmentLoader.newPathAttachment(r,s);return g?(g.closed=l,g.constantSpeed=n,g.worldVerticesLength=h<<1,g.vertices=d.vertices,g.bones=d.bones,g.lengths=f,c&&N.rgba8888ToColor(g.color,u),g):null}case me.Point:{let l=e.readFloat(),n=e.readFloat(),h=e.readFloat(),d=c?e.readInt32():0,f=this.attachmentLoader.newPointAttachment(r,s);return f?(f.x=n*o,f.y=h*o,f.rotation=l,c&&N.rgba8888ToColor(f.color,d),f):null}case me.Clipping:{let l=e.readInt(!0),n=e.readInt(!0),h=this.readVertices(e,n),d=c?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(r,s);return f?(f.endSlot=t.slots[l],f.worldVerticesLength=n<<1,f.vertices=h.vertices,f.bones=h.bones,c&&N.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){if(!e.readBoolean())return null;let t=new Ze(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){let r=this.scale,a=t<<1,i=new _r;if(!e.readBoolean())return i.vertices=this.readFloatArray(e,a,r),i;let c=new Array,o=new Array;for(let s=0;s<t;s++){let l=e.readInt(!0);o.push(l);for(let n=0;n<l;n++)o.push(e.readInt(!0)),c.push(e.readFloat()*r),c.push(e.readFloat()*r),c.push(e.readFloat())}return i.vertices=B.toFloatArray(c),i.bones=o,i}readFloatArray(e,t,r){let a=new Array(t);if(r==1)for(let i=0;i<t;i++)a[i]=e.readFloat();else for(let i=0;i<t;i++)a[i]=e.readFloat()*r;return a}readShortArray(e){let t=e.readInt(!0),r=new Array(t);for(let a=0;a<t;a++)r[a]=e.readShort();return r}readAnimation(e,t,r){e.readInt(!0);let a=new Array,i=this.scale,c=new N,o=new N;for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readByte(),p=e.readInt(!0),y=p-1;switch(x){case Zr:{let m=new we(p,f);for(let w=0;w<p;w++)m.setFrame(w,e.readFloat(),e.readStringRef());a.push(m);break}case es:{let m=e.readInt(!0),w=new ht(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255;for(let Y=0,M=0;w.setFrame(Y,b,v,A,S,C),Y!=y;Y++){let R=e.readFloat(),E=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255;switch(e.readByte()){case ne:w.setStepped(Y);break;case le:W(e,w,M++,Y,0,b,R,v,E,1),W(e,w,M++,Y,1,b,R,A,F,1),W(e,w,M++,Y,2,b,R,S,I,1),W(e,w,M++,Y,3,b,R,C,T,1)}b=R,v=E,A=F,S=I,C=T}a.push(w);break}case ts:{let m=e.readInt(!0),w=new ct(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255;for(let C=0,Y=0;w.setFrame(C,b,v,A,S),C!=y;C++){let M=e.readFloat(),R=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255;switch(e.readByte()){case ne:w.setStepped(C);break;case le:W(e,w,Y++,C,0,b,M,v,R,1),W(e,w,Y++,C,1,b,M,A,E,1),W(e,w,Y++,C,2,b,M,S,F,1)}b=M,v=R,A=E,S=F}a.push(w);break}case rs:{let m=e.readInt(!0),w=new ft(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255;for(let E=0,F=0;w.setFrame(E,b,v,A,S,C,Y,M,R),E!=y;E++){let I=e.readFloat(),T=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,z=e.readUnsignedByte()/255,q=e.readUnsignedByte()/255,H=e.readUnsignedByte()/255;switch(e.readByte()){case ne:w.setStepped(E);break;case le:W(e,w,F++,E,0,b,I,v,T,1),W(e,w,F++,E,1,b,I,A,D,1),W(e,w,F++,E,2,b,I,S,U,1),W(e,w,F++,E,3,b,I,C,L,1),W(e,w,F++,E,4,b,I,Y,z,1),W(e,w,F++,E,5,b,I,M,q,1),W(e,w,F++,E,6,b,I,R,H,1)}b=I,v=T,A=D,S=U,C=L,Y=z,M=q,R=H}a.push(w);break}case ss:{let m=e.readInt(!0),w=new ut(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let R=0,E=0;w.setFrame(R,b,v,A,S,C,Y,M),R!=y;R++){let F=e.readFloat(),I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,z=e.readUnsignedByte()/255;switch(e.readByte()){case ne:w.setStepped(R);break;case le:W(e,w,E++,R,0,b,F,v,I,1),W(e,w,E++,R,1,b,F,A,T,1),W(e,w,E++,R,2,b,F,S,D,1),W(e,w,E++,R,3,b,F,C,U,1),W(e,w,E++,R,4,b,F,Y,L,1),W(e,w,E++,R,5,b,F,M,z,1)}b=F,v=I,A=T,S=D,C=U,Y=L,M=z}a.push(w);break}case is:{let m=new dt(p,e.readInt(!0),f),w=e.readFloat(),b=e.readUnsignedByte()/255;for(let v=0,A=0;m.setFrame(v,w,b),v!=y;v++){let S=e.readFloat(),C=e.readUnsignedByte()/255;switch(e.readByte()){case ne:m.setStepped(v);break;case le:W(e,m,A++,v,0,w,S,b,C,1)}w=S,b=C}a.push(m)}}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readByte(),p=e.readInt(!0),y=e.readInt(!0);switch(x){case Ur:a.push(fe(e,new Te(p,y,f),1));break;case Wr:a.push(Lt(e,new et(p,y,f),i));break;case zr:a.push(fe(e,new tt(p,y,f),i));break;case $r:a.push(fe(e,new rt(p,y,f),i));break;case Hr:a.push(Lt(e,new st(p,y,f),1));break;case Gr:a.push(fe(e,new it(p,y,f),1));break;case jr:a.push(fe(e,new at(p,y,f),1));break;case Jr:a.push(Lt(e,new nt(p,y,f),1));break;case Kr:a.push(fe(e,new lt(p,y,f),1));break;case Qr:a.push(fe(e,new ot(p,y,f),1))}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),g=u-1,x=new gt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),m=e.readFloat()*i;for(let w=0,b=0;x.setFrame(w,p,y,m,e.readByte(),e.readBoolean(),e.readBoolean()),w!=g;w++){let v=e.readFloat(),A=e.readFloat(),S=e.readFloat()*i;switch(e.readByte()){case ne:x.setStepped(w);break;case le:W(e,x,b++,w,0,p,v,y,A,1),W(e,x,b++,w,1,p,v,m,S,i)}p=v,y=A,m=S}a.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),g=u-1,x=new xt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),m=e.readFloat(),w=e.readFloat(),b=e.readFloat(),v=e.readFloat(),A=e.readFloat();for(let S=0,C=0;x.setFrame(S,p,y,m,w,b,v,A),S!=g;S++){let Y=e.readFloat(),M=e.readFloat(),R=e.readFloat(),E=e.readFloat(),F=e.readFloat(),I=e.readFloat(),T=e.readFloat();switch(e.readByte()){case ne:x.setStepped(S);break;case le:W(e,x,C++,S,0,p,Y,y,M,1),W(e,x,C++,S,1,p,Y,m,R,1),W(e,x,C++,S,2,p,Y,w,E,1),W(e,x,C++,S,3,p,Y,b,F,1),W(e,x,C++,S,4,p,Y,v,I,1),W(e,x,C++,S,5,p,Y,A,T,1)}p=Y,y=M,m=R,w=E,b=F,v=I,A=T}a.push(x)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=r.pathConstraints[f];for(let g=0,x=e.readInt(!0);g<x;g++)switch(e.readByte()){case ls:a.push(fe(e,new wt(e.readInt(!0),e.readInt(!0),f),u.positionMode==0?i:1));break;case os:a.push(fe(e,new bt(e.readInt(!0),e.readInt(!0),f),u.spacingMode==0||u.spacingMode==1?i:1));break;case hs:let p=new pt(e.readInt(!0),e.readInt(!0),f),y=e.readFloat(),m=e.readFloat(),w=e.readFloat(),b=e.readFloat();for(let v=0,A=0,S=p.getFrameCount()-1;p.setFrame(v,y,m,w,b),v!=S;v++){let C=e.readFloat(),Y=e.readFloat(),M=e.readFloat(),R=e.readFloat();switch(e.readByte()){case ne:p.setStepped(v);break;case le:W(e,p,A++,v,0,y,C,m,Y,1),W(e,p,A++,v,1,y,C,w,M,1),W(e,p,A++,v,2,y,C,b,R,1)}y=C,m=Y,w=M,b=R}a.push(p)}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=r.skins[e.readInt(!0)];for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readInt(!0);for(let p=0,y=e.readInt(!0);p<y;p++){let m=e.readStringRef();if(!m)throw new Error("attachmentName must not be null.");let w=f.getAttachment(x,m),b=e.readByte(),v=e.readInt(!0),A=v-1;switch(b){case as:{let S=w,C=S.bones,Y=S.vertices,M=C?Y.length/3*2:Y.length,R=e.readInt(!0),E=new mt(v,R,x,S),F=e.readFloat();for(let I=0,T=0;;I++){let D,U=e.readInt(!0);if(U==0)D=C?B.newFloatArray(M):Y;else{D=B.newFloatArray(M);let z=e.readInt(!0);if(U+=z,i==1)for(let q=z;q<U;q++)D[q]=e.readFloat();else for(let q=z;q<U;q++)D[q]=e.readFloat()*i;if(!C)for(let q=0,H=D.length;q<H;q++)D[q]+=Y[q]}if(E.setFrame(I,F,D),I==A)break;let L=e.readFloat();switch(e.readByte()){case ne:E.setStepped(I);break;case le:W(e,E,T++,I,0,F,L,0,1,1)}F=L}a.push(E);break}case ns:{let S=new ve(v,x,w);for(let C=0;C<v;C++){let Y=e.readFloat(),M=e.readInt32();S.setFrame(C,Y,jt[M&15],M>>4,e.readFloat())}a.push(S);break}}}}}let s=e.readInt(!0);if(s>0){let h=new be(s),d=r.slots.length;for(let f=0;f<s;f++){let u=e.readFloat(),g=e.readInt(!0),x=B.newArray(d,0);for(let w=d-1;w>=0;w--)x[w]=-1;let p=B.newArray(d-g,0),y=0,m=0;for(let w=0;w<g;w++){let b=e.readInt(!0);for(;y!=b;)p[m++]=y++;x[y+e.readInt(!0)]=y++}for(;y<d;)p[m++]=y++;for(let w=d-1;w>=0;w--)x[w]==-1&&(x[w]=p[--m]);h.setFrame(f,u,x)}a.push(h)}let l=e.readInt(!0);if(l>0){let h=new Xe(l);for(let d=0;d<l;d++){let f=e.readFloat(),u=r.events[e.readInt(!0)],g=new Mt(f,u);g.intValue=e.readInt(!1),g.floatValue=e.readFloat(),g.stringValue=e.readBoolean()?e.readString():u.stringValue,g.data.audioPath&&(g.volume=e.readFloat(),g.balance=e.readFloat()),h.setFrame(d,g)}a.push(h)}let n=0;for(let h=0,d=a.length;h<d;h++)n=Math.max(n,a[h].getDuration());return new Be(t,a,n)}},xr=class{constructor(e,t=new Array,r=0,a=new DataView(e.buffer)){this.strings=t,this.index=r,this.buffer=a}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),r=t&127;return t&128&&(t=this.readByte(),r|=(t&127)<<7,t&128&&(t=this.readByte(),r|=(t&127)<<14,t&128&&(t=this.readByte(),r|=(t&127)<<21,t&128&&(t=this.readByte(),r|=(t&127)<<28)))),e?r:r>>>1^-(r&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",r=0;for(let a=0;a<e;){let i=this.readUnsignedByte();switch(i>>4){case 12:case 13:t+=String.fromCharCode((i&31)<<6|this.readByte()&63),a+=2;break;case 14:t+=String.fromCharCode((i&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),a+=3;break;default:t+=String.fromCharCode(i),a++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},qr=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,r,a,i){this.mesh=e,this.skin=t,this.slotIndex=r,this.parent=a,this.inheritTimeline=i}},_r=class{constructor(e=null,t=null){this.bones=e,this.vertices=t}},me=(e=>(e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping",e))(me||{});function fe(e,t,r){let a=e.readFloat(),i=e.readFloat()*r;for(let c=0,o=0,s=t.getFrameCount()-1;t.setFrame(c,a,i),c!=s;c++){let l=e.readFloat(),n=e.readFloat()*r;switch(e.readByte()){case ne:t.setStepped(c);break;case le:W(e,t,o++,c,0,a,l,i,n,r)}a=l,i=n}return t}function Lt(e,t,r){let a=e.readFloat(),i=e.readFloat()*r,c=e.readFloat()*r;for(let o=0,s=0,l=t.getFrameCount()-1;t.setFrame(o,a,i,c),o!=l;o++){let n=e.readFloat(),h=e.readFloat()*r,d=e.readFloat()*r;switch(e.readByte()){case ne:t.setStepped(o);break;case le:W(e,t,s++,o,0,a,n,i,h,r),W(e,t,s++,o,1,a,n,c,d,r)}a=n,i=h,c=d}return t}function W(e,t,r,a,i,c,o,s,l,n){t.setBezier(r,a,i,c,s,e.readFloat(),e.readFloat()*n,e.readFloat(),e.readFloat()*n,o,l)}var Ur=0,Wr=1,zr=2,$r=3,Hr=4,Gr=5,jr=6,Jr=7,Kr=8,Qr=9,Zr=0,es=1,ts=2,rs=3,ss=4,is=5,as=0,ns=1,ls=0,os=1,hs=2,ne=1,le=2,cs=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Ye(()=>B.newFloatArray(16));update(e,t){if(!e)throw new Error("skeleton cannot be null.");let r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,c=e.slots,o=c.length;r.length=0,i.freeAll(a),a.length=0;for(let s=0;s<o;s++){let l=c[s];if(!l.bone.active)continue;let n=l.getAttachment();if(n instanceof Ne){let h=n;r.push(h);let d=i.obtain();d.length!=h.worldVerticesLength&&(d=B.newFloatArray(h.worldVerticesLength)),a.push(d),h.computeWorldVertices(l,0,h.worldVerticesLength,d,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,i=this.polygons;for(let c=0,o=i.length;c<o;c++){let s=i[c],l=s;for(let n=0,h=s.length;n<h;n+=2){let d=l[n],f=l[n+1];e=Math.min(e,d),t=Math.min(t,f),r=Math.max(r,d),a=Math.max(a,f)}}this.minX=e,this.minY=t,this.maxX=r,this.maxY=a}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,r,a){let i=this.minX,c=this.minY,o=this.maxX,s=this.maxY;if(e<=i&&r<=i||t<=c&&a<=c||e>=o&&r>=o||t>=s&&a>=s)return!1;let l=(a-t)/(r-e),n=l*(i-e)+t;if(n>c&&n<s||(n=l*(o-e)+t,n>c&&n<s))return!0;let h=(c-t)/l+e;return h>i&&h<o||(h=(s-t)/l+e,h>i&&h<o)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let r=this.polygons;for(let a=0,i=r.length;a<i;a++)if(this.containsPointPolygon(r[a],e,t))return this.boundingBoxes[a];return null}containsPointPolygon(e,t,r){let a=e,i=e.length,c=i-2,o=!1;for(let s=0;s<i;s+=2){let l=a[s+1],n=a[c+1];if(l<r&&n>=r||n<r&&l>=r){let h=a[s];h+(r-l)/(n-l)*(a[c]-h)<t&&(o=!o)}c=s}return o}intersectsSegment(e,t,r,a){let i=this.polygons;for(let c=0,o=i.length;c<o;c++)if(this.intersectsSegmentPolygon(i[c],e,t,r,a))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(e,t,r,a,i){let c=e,o=e.length,s=t-a,l=r-i,n=t*i-r*a,h=c[o-2],d=c[o-1];for(let f=0;f<o;f+=2){let u=c[f],g=c[f+1],x=h*g-d*u,p=h-u,y=d-g,m=s*y-l*p,w=(n*p-s*x)/m;if((w>=h&&w<=u||w>=u&&w<=h)&&(w>=t&&w<=a||w>=a&&w<=t)){let b=(n*y-l*x)/m;if((b>=d&&b<=g||b>=g&&b<=d)&&(b>=r&&b<=i||b>=i&&b<=r))return!0}h=u,d=g}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ee=class{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Ye(()=>new Array);polygonIndicesPool=new Ye(()=>new Array);triangulate(e){let t=e,r=e.length>>1,a=this.indicesArray;a.length=0;for(let o=0;o<r;o++)a[o]=o;let i=this.isConcaveArray;i.length=0;for(let o=0,s=r;o<s;++o)i[o]=ee.isConcave(o,r,t,a);let c=this.triangles;for(c.length=0;r>3;){let o=r-1,s=0,l=1;for(;;){e:if(!i[s]){let d=a[o]<<1,f=a[s]<<1,u=a[l]<<1,g=t[d],x=t[d+1],p=t[f],y=t[f+1],m=t[u],w=t[u+1];for(let b=(l+1)%r;b!=o;b=(b+1)%r){if(!i[b])continue;let v=a[b]<<1,A=t[v],S=t[v+1];if(ee.positiveArea(m,w,g,x,A,S)&&ee.positiveArea(g,x,p,y,A,S)&&ee.positiveArea(p,y,m,w,A,S))break e}break}if(l==0){do{if(!i[s])break;s--}while(s>0);break}o=s,s=l,l=(l+1)%r}c.push(a[(r+s-1)%r]),c.push(a[s]),c.push(a[(s+1)%r]),a.splice(s,1),i.splice(s,1),r--;let n=(r+s-1)%r,h=s==r?0:s;i[n]=ee.isConcave(n,r,t,a),i[h]=ee.isConcave(h,r,t,a)}return r==3&&(c.push(a[2]),c.push(a[0]),c.push(a[1])),c}decompose(e,t){let r=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let o=this.polygonPool.obtain();o.length=0;let s=-1,l=0;for(let n=0,h=t.length;n<h;n+=3){let d=t[n]<<1,f=t[n+1]<<1,u=t[n+2]<<1,g=r[d],x=r[d+1],p=r[f],y=r[f+1],m=r[u],w=r[u+1],b=!1;if(s==d){let v=o.length-4,A=ee.winding(o[v],o[v+1],o[v+2],o[v+3],m,w),S=ee.winding(m,w,o[0],o[1],o[2],o[3]);A==l&&S==l&&(o.push(m),o.push(w),c.push(u),b=!0)}b||(o.length>0?(a.push(o),i.push(c)):(this.polygonPool.free(o),this.polygonIndicesPool.free(c)),o=this.polygonPool.obtain(),o.length=0,o.push(g),o.push(x),o.push(p),o.push(y),o.push(m),o.push(w),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(u),l=ee.winding(g,x,p,y,m,w),s=d)}o.length>0&&(a.push(o),i.push(c));for(let n=0,h=a.length;n<h;n++){if(c=i[n],c.length==0)continue;let d=c[0],f=c[c.length-1];o=a[n];let u=o.length-4,g=o[u],x=o[u+1],p=o[u+2],y=o[u+3],m=o[0],w=o[1],b=o[2],v=o[3],A=ee.winding(g,x,p,y,m,w);for(let S=0;S<h;S++){if(S==n)continue;let C=i[S];if(C.length!=3)continue;let Y=C[0],M=C[1],R=C[2],E=a[S],F=E[E.length-2],I=E[E.length-1];if(Y!=d||M!=f)continue;let T=ee.winding(g,x,p,y,F,I),D=ee.winding(F,I,m,w,b,v);T==A&&D==A&&(E.length=0,C.length=0,o.push(F),o.push(I),c.push(R),g=p,x=y,p=F,y=I,S=0)}}for(let n=a.length-1;n>=0;n--)o=a[n],o.length==0&&(a.splice(n,1),this.polygonPool.free(o),c=i[n],i.splice(n,1),this.polygonIndicesPool.free(c));return a}static isConcave(e,t,r,a){let i=a[(t+e-1)%t]<<1,c=a[e]<<1,o=a[(e+1)%t]<<1;return!this.positiveArea(r[i],r[i+1],r[c],r[c+1],r[o],r[o+1])}static positiveArea(e,t,r,a,i,c){return e*(c-a)+r*(t-c)+i*(a-t)>=0}static winding(e,t,r,a,i,c){let o=r-e,s=a-t;return i*s-c*o+o*t-e*s>=0?1:-1}},Nt=class{triangulator=new ee;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let r=t.worldVerticesLength,a=B.setArraySize(this.clippingPolygon,r);t.computeWorldVertices(e,0,r,a,0,2);let i=this.clippingPolygon;Nt.makeClockwise(i);let c=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i));for(let o=0,s=c.length;o<s;o++){let l=c[o];Nt.makeClockwise(l),l.push(l[0]),l.push(l[1])}return c.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(e,t,r,a,i,c,o,s){let l=this.clipOutput,n=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=d.length,u=s?12:8,g=0;n.length=0,h.length=0;e:for(let x=0;x<a;x+=3){let p=r[x]<<1,y=e[p],m=e[p+1],w=i[p],b=i[p+1];p=r[x+1]<<1;let v=e[p],A=e[p+1],S=i[p],C=i[p+1];p=r[x+2]<<1;let Y=e[p],M=e[p+1],R=i[p],E=i[p+1];for(let F=0;F<f;F++){let I=n.length;if(this.clip(y,m,v,A,Y,M,d[F],l)){let T=l.length;if(T==0)continue;let D=A-M,U=Y-v,L=y-Y,z=M-m,q=1/(D*L+U*(m-M)),H=T>>1,_=this.clipOutput,O=B.setArraySize(n,I+H*u);for(let Q=0;Q<T;Q+=2){let oe=_[Q],K=_[Q+1];O[I]=oe,O[I+1]=K,O[I+2]=c.r,O[I+3]=c.g,O[I+4]=c.b,O[I+5]=c.a;let te=oe-Y,re=K-M,ge=(D*te+U*re)*q,ke=(z*te+L*re)*q,Me=1-ge-ke;O[I+6]=w*ge+S*ke+R*Me,O[I+7]=b*ge+C*ke+E*Me,s&&(O[I+8]=o.r,O[I+9]=o.g,O[I+10]=o.b,O[I+11]=o.a),I+=u}I=h.length;let j=B.setArraySize(h,I+3*(H-2));H--;for(let Q=1;Q<H;Q++)j[I]=g,j[I+1]=g+Q,j[I+2]=g+Q+1,I+=3;g+=H+1}else{let T=B.setArraySize(n,I+3*u);T[I]=y,T[I+1]=m,T[I+2]=c.r,T[I+3]=c.g,T[I+4]=c.b,T[I+5]=c.a,s?(T[I+6]=w,T[I+7]=b,T[I+8]=o.r,T[I+9]=o.g,T[I+10]=o.b,T[I+11]=o.a,T[I+12]=v,T[I+13]=A,T[I+14]=c.r,T[I+15]=c.g,T[I+16]=c.b,T[I+17]=c.a,T[I+18]=S,T[I+19]=C,T[I+20]=o.r,T[I+21]=o.g,T[I+22]=o.b,T[I+23]=o.a,T[I+24]=Y,T[I+25]=M,T[I+26]=c.r,T[I+27]=c.g,T[I+28]=c.b,T[I+29]=c.a,T[I+30]=R,T[I+31]=E,T[I+32]=o.r,T[I+33]=o.g,T[I+34]=o.b,T[I+35]=o.a):(T[I+6]=w,T[I+7]=b,T[I+8]=v,T[I+9]=A,T[I+10]=c.r,T[I+11]=c.g,T[I+12]=c.b,T[I+13]=c.a,T[I+14]=S,T[I+15]=C,T[I+16]=Y,T[I+17]=M,T[I+18]=c.r,T[I+19]=c.g,T[I+20]=c.b,T[I+21]=c.a,T[I+22]=R,T[I+23]=E),I=h.length;let D=B.setArraySize(h,I+3);D[I]=g,D[I+1]=g+1,D[I+2]=g+2,g+=3;continue e}}}}clip(e,t,r,a,i,c,o,s){let l=s,n=!1,h;o.length%4>=2?(h=s,s=this.scratch):h=this.scratch,h.length=0,h.push(e),h.push(t),h.push(r),h.push(a),h.push(i),h.push(c),h.push(e),h.push(t),s.length=0;let d=o,f=o.length-4;for(let u=0;;u+=2){let g=d[u],x=d[u+1],p=d[u+2],y=d[u+3],m=g-p,w=x-y,b=h,v=h.length-2,A=s.length;for(let C=0;C<v;C+=2){let Y=b[C],M=b[C+1],R=b[C+2],E=b[C+3],F=m*(E-y)-w*(R-p)>0;if(m*(M-y)-w*(Y-p)>0){if(F){s.push(R),s.push(E);continue}let I=E-M,T=R-Y,D=I*(p-g)-T*(y-x);if(Math.abs(D)>1e-6){let U=(T*(x-M)-I*(g-Y))/D;s.push(g+(p-g)*U),s.push(x+(y-x)*U)}else s.push(g),s.push(x)}else if(F){let I=E-M,T=R-Y,D=I*(p-g)-T*(y-x);if(Math.abs(D)>1e-6){let U=(T*(x-M)-I*(g-Y))/D;s.push(g+(p-g)*U),s.push(x+(y-x)*U)}else s.push(g),s.push(x);s.push(R),s.push(E)}n=!0}if(A==s.length)return l.length=0,!0;if(s.push(s[0]),s.push(s[1]),u==f)break;let S=s;s=h,s.length=0,h=S}if(l!=s){l.length=0;for(let u=0,g=s.length-2;u<g;u++)l[u]=s[u]}else l.length=l.length-2;return n}static makeClockwise(e){let t=e,r=e.length,a=t[r-2]*t[1]-t[0]*t[r-1],i=0,c=0,o=0,s=0;for(let l=0,n=r-3;l<n;l+=2)i=t[l],c=t[l+1],o=t[l+2],s=t[l+3],a+=i*s-o*c;if(!(a<0))for(let l=0,n=r-2,h=r>>1;l<h;l+=2){let d=t[l],f=t[l+1],u=n-l;t[l]=t[u],t[l+1]=t[u+1],t[u]=d,t[u+1]=f}}},ds=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,r=new Bt,a=typeof e=="string"?JSON.parse(e):e,i=a.skeleton;if(i&&(r.hash=i.hash,r.version=i.spine,r.x=i.x,r.y=i.y,r.width=i.width,r.height=i.height,r.fps=i.fps,r.imagesPath=i.images),a.bones)for(let c=0;c<a.bones.length;c++){let o=a.bones[c],s=null,l=k(o,"parent",null);l&&(s=r.findBone(l));let n=new Yt(r.bones.length,o.name,s);n.length=k(o,"length",0)*t,n.x=k(o,"x",0)*t,n.y=k(o,"y",0)*t,n.rotation=k(o,"rotation",0),n.scaleX=k(o,"scaleX",1),n.scaleY=k(o,"scaleY",1),n.shearX=k(o,"shearX",0),n.shearY=k(o,"shearY",0),n.transformMode=B.enumValue(qe,k(o,"transform","Normal")),n.skinRequired=k(o,"skin",!1);let h=k(o,"color",null);h&&n.color.setFromString(h),r.bones.push(n)}if(a.slots)for(let c=0;c<a.slots.length;c++){let o=a.slots[c],s=r.findBone(o.bone);if(!s)throw new Error(`Couldn't find bone ${o.bone} for slot ${o.name}`);let l=new Vt(r.slots.length,o.name,s),n=k(o,"color",null);n&&l.color.setFromString(n);let h=k(o,"dark",null);h&&(l.darkColor=N.fromString(h)),l.attachmentName=k(o,"attachment",null),l.blendMode=B.enumValue(He,k(o,"blend","normal")),r.slots.push(l)}if(a.ik)for(let c=0;c<a.ik.length;c++){let o=a.ik[c],s=new Et(o.name);s.order=k(o,"order",0),s.skinRequired=k(o,"skin",!1);for(let n=0;n<o.bones.length;n++){let h=r.findBone(o.bones[n]);if(!h)throw new Error(`Couldn't find bone ${o.bones[n]} for IK constraint ${o.name}.`);s.bones.push(h)}let l=r.findBone(o.target);if(!l)throw new Error(`Couldn't find target bone ${o.target} for IK constraint ${o.name}.`);s.target=l,s.mix=k(o,"mix",1),s.softness=k(o,"softness",0)*t,s.bendDirection=k(o,"bendPositive",!0)?1:-1,s.compress=k(o,"compress",!1),s.stretch=k(o,"stretch",!1),s.uniform=k(o,"uniform",!1),r.ikConstraints.push(s)}if(a.transform)for(let c=0;c<a.transform.length;c++){let o=a.transform[c],s=new Dt(o.name);s.order=k(o,"order",0),s.skinRequired=k(o,"skin",!1);for(let h=0;h<o.bones.length;h++){let d=o.bones[h],f=r.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for transform constraint ${o.name}.`);s.bones.push(f)}let l=o.target,n=r.findBone(l);if(!n)throw new Error(`Couldn't find target bone ${l} for transform constraint ${o.name}.`);s.target=n,s.local=k(o,"local",!1),s.relative=k(o,"relative",!1),s.offsetRotation=k(o,"rotation",0),s.offsetX=k(o,"x",0)*t,s.offsetY=k(o,"y",0)*t,s.offsetScaleX=k(o,"scaleX",0),s.offsetScaleY=k(o,"scaleY",0),s.offsetShearY=k(o,"shearY",0),s.mixRotate=k(o,"mixRotate",1),s.mixX=k(o,"mixX",1),s.mixY=k(o,"mixY",s.mixX),s.mixScaleX=k(o,"mixScaleX",1),s.mixScaleY=k(o,"mixScaleY",s.mixScaleX),s.mixShearY=k(o,"mixShearY",1),r.transformConstraints.push(s)}if(a.path)for(let c=0;c<a.path.length;c++){let o=a.path[c],s=new Rt(o.name);s.order=k(o,"order",0),s.skinRequired=k(o,"skin",!1);for(let h=0;h<o.bones.length;h++){let d=o.bones[h],f=r.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for path constraint ${o.name}.`);s.bones.push(f)}let l=o.target,n=r.findSlot(l);if(!n)throw new Error(`Couldn't find target slot ${l} for path constraint ${o.name}.`);s.target=n,s.positionMode=B.enumValue(Ue,k(o,"positionMode","Percent")),s.spacingMode=B.enumValue(We,k(o,"spacingMode","Length")),s.rotateMode=B.enumValue(ze,k(o,"rotateMode","Tangent")),s.offsetRotation=k(o,"rotation",0),s.position=k(o,"position",0),s.positionMode==0&&(s.position*=t),s.spacing=k(o,"spacing",0),(s.spacingMode==0||s.spacingMode==1)&&(s.spacing*=t),s.mixRotate=k(o,"mixRotate",1),s.mixX=k(o,"mixX",1),s.mixY=k(o,"mixY",s.mixX),r.pathConstraints.push(s)}if(a.skins)for(let c=0;c<a.skins.length;c++){let o=a.skins[c],s=new $e(o.name);if(o.bones)for(let l=0;l<o.bones.length;l++){let n=o.bones[l],h=r.findBone(n);if(!h)throw new Error(`Couldn't find bone ${n} for skin ${o.name}.`);s.bones.push(h)}if(o.ik)for(let l=0;l<o.ik.length;l++){let n=o.ik[l],h=r.findIkConstraint(n);if(!h)throw new Error(`Couldn't find IK constraint ${n} for skin ${o.name}.`);s.constraints.push(h)}if(o.transform)for(let l=0;l<o.transform.length;l++){let n=o.transform[l],h=r.findTransformConstraint(n);if(!h)throw new Error(`Couldn't find transform constraint ${n} for skin ${o.name}.`);s.constraints.push(h)}if(o.path)for(let l=0;l<o.path.length;l++){let n=o.path[l],h=r.findPathConstraint(n);if(!h)throw new Error(`Couldn't find path constraint ${n} for skin ${o.name}.`);s.constraints.push(h)}for(let l in o.attachments){let n=r.findSlot(l);if(!n)throw new Error(`Couldn't find slot ${l} for skin ${o.name}.`);let h=o.attachments[l];for(let d in h){let f=this.readAttachment(h[d],s,n.index,d,r);f&&s.setAttachment(n.index,d,f)}}r.skins.push(s),s.name=="default"&&(r.defaultSkin=s)}for(let c=0,o=this.linkedMeshes.length;c<o;c++){let s=this.linkedMeshes[c],l=s.skin?r.findSkin(s.skin):r.defaultSkin;if(!l)throw new Error(`Skin not found: ${s.skin}`);let n=l.getAttachment(s.slotIndex,s.parent);if(!n)throw new Error(`Parent mesh not found: ${s.parent}`);s.mesh.timelineAttachment=s.inheritTimeline?n:s.mesh,s.mesh.setParentMesh(n),s.mesh.region!=null&&s.mesh.updateRegion()}if(this.linkedMeshes.length=0,a.events)for(let c in a.events){let o=a.events[c],s=new Ft(c);s.intValue=k(o,"int",0),s.floatValue=k(o,"float",0),s.stringValue=k(o,"string",""),s.audioPath=k(o,"audio",null),s.audioPath&&(s.volume=k(o,"volume",1),s.balance=k(o,"balance",0)),r.events.push(s)}if(a.animations)for(let c in a.animations){let o=a.animations[c];this.readAnimation(o,c,r)}return r}readAttachment(e,t,r,a,i){let c=this.scale;switch(a=k(e,"name",a),k(e,"type","region")){case"region":{let o=k(e,"path",a),s=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(t,a,o,s);if(!l)return null;l.path=o,l.x=k(e,"x",0)*c,l.y=k(e,"y",0)*c,l.scaleX=k(e,"scaleX",1),l.scaleY=k(e,"scaleY",1),l.rotation=k(e,"rotation",0),l.width=e.width*c,l.height=e.height*c,l.sequence=s;let n=k(e,"color",null);return n&&l.color.setFromString(n),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let o=this.attachmentLoader.newBoundingBoxAttachment(t,a);if(!o)return null;this.readVertices(e,o,e.vertexCount<<1);let s=k(e,"color",null);return s&&o.color.setFromString(s),o}case"mesh":case"linkedmesh":{let o=k(e,"path",a),s=this.readSequence(k(e,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(t,a,o,s);if(!l)return null;l.path=o;let n=k(e,"color",null);n&&l.color.setFromString(n),l.width=k(e,"width",0)*c,l.height=k(e,"height",0)*c,l.sequence=s;let h=k(e,"parent",null);if(h)return this.linkedMeshes.push(new fs(l,k(e,"skin",null),r,h,k(e,"timelines",!0))),l;let d=e.uvs;return this.readVertices(e,l,d.length),l.triangles=e.triangles,l.regionUVs=d,l.region!=null&&l.updateRegion(),l.edges=k(e,"edges",null),l.hullLength=k(e,"hull",0)*2,l}case"path":{let o=this.attachmentLoader.newPathAttachment(t,a);if(!o)return null;o.closed=k(e,"closed",!1),o.constantSpeed=k(e,"constantSpeed",!0);let s=e.vertexCount;this.readVertices(e,o,s<<1);let l=B.newArray(s/3,0);for(let h=0;h<e.lengths.length;h++)l[h]=e.lengths[h]*c;o.lengths=l;let n=k(e,"color",null);return n&&o.color.setFromString(n),o}case"point":{let o=this.attachmentLoader.newPointAttachment(t,a);if(!o)return null;o.x=k(e,"x",0)*c,o.y=k(e,"y",0)*c,o.rotation=k(e,"rotation",0);let s=k(e,"color",null);return s&&o.color.setFromString(s),o}case"clipping":{let o=this.attachmentLoader.newClippingAttachment(t,a);if(!o)return null;let s=k(e,"end",null);s&&(o.endSlot=i.findSlot(s));let l=e.vertexCount;this.readVertices(e,o,l<<1);let n=k(e,"color",null);return n&&o.color.setFromString(n),o}}return null}readSequence(e){if(e==null)return null;let t=new Ze(k(e,"count",0));return t.start=k(e,"start",1),t.digits=k(e,"digits",0),t.setupIndex=k(e,"setup",0),t}readVertices(e,t,r){let a=this.scale;t.worldVerticesLength=r;let i=e.vertices;if(r==i.length){let s=B.toFloatArray(i);if(a!=1)for(let l=0,n=i.length;l<n;l++)s[l]*=a;t.vertices=s;return}let c=new Array,o=new Array;for(let s=0,l=i.length;s<l;){let n=i[s++];o.push(n);for(let h=s+n*4;s<h;s+=4)o.push(i[s]),c.push(i[s+1]*a),c.push(i[s+2]*a),c.push(i[s+3])}t.bones=o,t.vertices=B.toFloatArray(c)}readAnimation(e,t,r){let a=this.scale,i=new Array;if(e.slots)for(let o in e.slots){let s=e.slots[o],l=r.findSlot(o);if(!l)throw new Error("Slot not found: "+o);let n=l.index;for(let h in s){let d=s[h];if(!d)continue;let f=d.length;if(h=="attachment"){let u=new we(f,n);for(let g=0;g<f;g++){let x=d[g];u.setFrame(g,k(x,"time",0),k(x,"name",null))}i.push(u)}else if(h=="rgba"){let u=new ht(f,f<<2,n),g=d[0],x=k(g,"time",0),p=N.fromString(g.color);for(let y=0,m=0;;y++){u.setFrame(y,x,p.r,p.g,p.b,p.a);let w=d[y+1];if(!w){u.shrink(m);break}let b=k(w,"time",0),v=N.fromString(w.color),A=g.curve;A&&(m=$(A,u,m,y,0,x,b,p.r,v.r,1),m=$(A,u,m,y,1,x,b,p.g,v.g,1),m=$(A,u,m,y,2,x,b,p.b,v.b,1),m=$(A,u,m,y,3,x,b,p.a,v.a,1)),x=b,p=v,g=w}i.push(u)}else if(h=="rgb"){let u=new ct(f,f*3,n),g=d[0],x=k(g,"time",0),p=N.fromString(g.color);for(let y=0,m=0;;y++){u.setFrame(y,x,p.r,p.g,p.b);let w=d[y+1];if(!w){u.shrink(m);break}let b=k(w,"time",0),v=N.fromString(w.color),A=g.curve;A&&(m=$(A,u,m,y,0,x,b,p.r,v.r,1),m=$(A,u,m,y,1,x,b,p.g,v.g,1),m=$(A,u,m,y,2,x,b,p.b,v.b,1)),x=b,p=v,g=w}i.push(u)}else if(h=="alpha")i.push(he(d,new dt(f,f,n),0,1));else if(h=="rgba2"){let u=new ft(f,f*7,n),g=d[0],x=k(g,"time",0),p=N.fromString(g.light),y=N.fromString(g.dark);for(let m=0,w=0;;m++){u.setFrame(m,x,p.r,p.g,p.b,p.a,y.r,y.g,y.b);let b=d[m+1];if(!b){u.shrink(w);break}let v=k(b,"time",0),A=N.fromString(b.light),S=N.fromString(b.dark),C=g.curve;C&&(w=$(C,u,w,m,0,x,v,p.r,A.r,1),w=$(C,u,w,m,1,x,v,p.g,A.g,1),w=$(C,u,w,m,2,x,v,p.b,A.b,1),w=$(C,u,w,m,3,x,v,p.a,A.a,1),w=$(C,u,w,m,4,x,v,y.r,S.r,1),w=$(C,u,w,m,5,x,v,y.g,S.g,1),w=$(C,u,w,m,6,x,v,y.b,S.b,1)),x=v,p=A,y=S,g=b}i.push(u)}else if(h=="rgb2"){let u=new ut(f,f*6,n),g=d[0],x=k(g,"time",0),p=N.fromString(g.light),y=N.fromString(g.dark);for(let m=0,w=0;;m++){u.setFrame(m,x,p.r,p.g,p.b,y.r,y.g,y.b);let b=d[m+1];if(!b){u.shrink(w);break}let v=k(b,"time",0),A=N.fromString(b.light),S=N.fromString(b.dark),C=g.curve;C&&(w=$(C,u,w,m,0,x,v,p.r,A.r,1),w=$(C,u,w,m,1,x,v,p.g,A.g,1),w=$(C,u,w,m,2,x,v,p.b,A.b,1),w=$(C,u,w,m,3,x,v,y.r,S.r,1),w=$(C,u,w,m,4,x,v,y.g,S.g,1),w=$(C,u,w,m,5,x,v,y.b,S.b,1)),x=v,p=A,y=S,g=b}i.push(u)}}}if(e.bones)for(let o in e.bones){let s=e.bones[o],l=r.findBone(o);if(!l)throw new Error("Bone not found: "+o);let n=l.index;for(let h in s){let d=s[h],f=d.length;if(f!=0){if(h==="rotate")i.push(he(d,new Te(f,f,n),0,1));else if(h==="translate"){let u=new et(f,f<<1,n);i.push(Ot(d,u,"x","y",0,a))}else if(h==="translatex"){let u=new tt(f,f,n);i.push(he(d,u,0,a))}else if(h==="translatey"){let u=new rt(f,f,n);i.push(he(d,u,0,a))}else if(h==="scale"){let u=new st(f,f<<1,n);i.push(Ot(d,u,"x","y",1,1))}else if(h==="scalex"){let u=new it(f,f,n);i.push(he(d,u,1,1))}else if(h==="scaley"){let u=new at(f,f,n);i.push(he(d,u,1,1))}else if(h==="shear"){let u=new nt(f,f<<1,n);i.push(Ot(d,u,"x","y",0,1))}else if(h==="shearx"){let u=new lt(f,f,n);i.push(he(d,u,0,1))}else if(h==="sheary"){let u=new ot(f,f,n);i.push(he(d,u,0,1))}}}}if(e.ik)for(let o in e.ik){let s=e.ik[o],l=s[0];if(!l)continue;let n=r.findIkConstraint(o);if(!n)throw new Error("IK Constraint not found: "+o);let h=r.ikConstraints.indexOf(n),d=new gt(s.length,s.length<<1,h),f=k(l,"time",0),u=k(l,"mix",1),g=k(l,"softness",0)*a;for(let x=0,p=0;;x++){d.setFrame(x,f,u,g,k(l,"bendPositive",!0)?1:-1,k(l,"compress",!1),k(l,"stretch",!1));let y=s[x+1];if(!y){d.shrink(p);break}let m=k(y,"time",0),w=k(y,"mix",1),b=k(y,"softness",0)*a,v=l.curve;v&&(p=$(v,d,p,x,0,f,m,u,w,1),p=$(v,d,p,x,1,f,m,g,b,a)),f=m,u=w,g=b,l=y}i.push(d)}if(e.transform)for(let o in e.transform){let s=e.transform[o],l=s[0];if(!l)continue;let n=r.findTransformConstraint(o);if(!n)throw new Error("Transform constraint not found: "+o);let h=r.transformConstraints.indexOf(n),d=new xt(s.length,s.length*6,h),f=k(l,"time",0),u=k(l,"mixRotate",1),g=k(l,"mixX",1),x=k(l,"mixY",g),p=k(l,"mixScaleX",1),y=k(l,"mixScaleY",p),m=k(l,"mixShearY",1);for(let w=0,b=0;;w++){d.setFrame(w,f,u,g,x,p,y,m);let v=s[w+1];if(!v){d.shrink(b);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),C=k(v,"mixX",1),Y=k(v,"mixY",C),M=k(v,"mixScaleX",1),R=k(v,"mixScaleY",M),E=k(v,"mixShearY",1),F=l.curve;F&&(b=$(F,d,b,w,0,f,A,u,S,1),b=$(F,d,b,w,1,f,A,g,C,1),b=$(F,d,b,w,2,f,A,x,Y,1),b=$(F,d,b,w,3,f,A,p,M,1),b=$(F,d,b,w,4,f,A,y,R,1),b=$(F,d,b,w,5,f,A,m,E,1)),f=A,u=S,g=C,x=Y,p=M,y=R,p=M,l=v}i.push(d)}if(e.path)for(let o in e.path){let s=e.path[o],l=r.findPathConstraint(o);if(!l)throw new Error("Path constraint not found: "+o);let n=r.pathConstraints.indexOf(l);for(let h in s){let d=s[h],f=d[0];if(!f)continue;let u=d.length;if(h==="position"){let g=new wt(u,u,n);i.push(he(d,g,0,l.positionMode==0?a:1))}else if(h==="spacing"){let g=new bt(u,u,n);i.push(he(d,g,0,l.spacingMode==0||l.spacingMode==1?a:1))}else if(h==="mix"){let g=new pt(u,u*3,n),x=k(f,"time",0),p=k(f,"mixRotate",1),y=k(f,"mixX",1),m=k(f,"mixY",y);for(let w=0,b=0;;w++){g.setFrame(w,x,p,y,m);let v=d[w+1];if(!v){g.shrink(b);break}let A=k(v,"time",0),S=k(v,"mixRotate",1),C=k(v,"mixX",1),Y=k(v,"mixY",C),M=f.curve;M&&(b=$(M,g,b,w,0,x,A,p,S,1),b=$(M,g,b,w,1,x,A,y,C,1),b=$(M,g,b,w,2,x,A,m,Y,1)),x=A,p=S,y=C,m=Y,f=v}i.push(g)}}}if(e.attachments)for(let o in e.attachments){let s=e.attachments[o],l=r.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let n in s){let h=s[n],d=r.findSlot(n);if(!d)throw new Error("Slot not found: "+n);let f=d.index;for(let u in h){let g=h[u],x=l.getAttachment(f,u);for(let p in g){let y=g[p],m=y[0];if(m){if(p=="deform"){let w=x.bones,b=x.vertices,v=w?b.length/3*2:b.length,A=new mt(y.length,y.length,f,x),S=k(m,"time",0);for(let C=0,Y=0;;C++){let M,R=k(m,"vertices",null);if(!R)M=w?B.newFloatArray(v):b;else{M=B.newFloatArray(v);let T=k(m,"offset",0);if(B.arrayCopy(R,0,M,T,R.length),a!=1)for(let D=T,U=D+R.length;D<U;D++)M[D]*=a;if(!w)for(let D=0;D<v;D++)M[D]+=b[D]}A.setFrame(C,S,M);let E=y[C+1];if(!E){A.shrink(Y);break}let F=k(E,"time",0),I=m.curve;I&&(Y=$(I,A,Y,C,0,S,F,0,1,1)),S=F,m=E}i.push(A)}else if(p=="sequence"){let w=new ve(y.length,f,x),b=0;for(let v=0;v<y.length;v++){let A=k(m,"delay",b),S=k(m,"time",0),C=Gt[k(m,"mode","hold")],Y=k(m,"index",0);w.setFrame(v,S,C,Y,A),b=A,m=y[v+1]}i.push(w)}}}}}}if(e.drawOrder){let o=new be(e.drawOrder.length),s=r.slots.length,l=0;for(let n=0;n<e.drawOrder.length;n++,l++){let h=e.drawOrder[n],d=null,f=k(h,"offsets",null);if(f){d=B.newArray(s,-1);let u=B.newArray(s-f.length,0),g=0,x=0;for(let p=0;p<f.length;p++){let y=f[p],m=r.findSlot(y.slot);if(!m)throw new Error("Slot not found: "+m);let w=m.index;for(;g!=w;)u[x++]=g++;d[g+y.offset]=g++}for(;g<s;)u[x++]=g++;for(let p=s-1;p>=0;p--)d[p]==-1&&(d[p]=u[--x])}o.setFrame(l,k(h,"time",0),d)}i.push(o)}if(e.events){let o=new Xe(e.events.length),s=0;for(let l=0;l<e.events.length;l++,s++){let n=e.events[l],h=r.findEvent(n.name);if(!h)throw new Error("Event not found: "+n.name);let d=new Mt(B.toSinglePrecision(k(n,"time",0)),h);d.intValue=k(n,"int",h.intValue),d.floatValue=k(n,"float",h.floatValue),d.stringValue=k(n,"string",h.stringValue),d.data.audioPath&&(d.volume=k(n,"volume",1),d.balance=k(n,"balance",0)),o.setFrame(s,d)}i.push(o)}let c=0;for(let o=0,s=i.length;o<s;o++)c=Math.max(c,i[o].getDuration());r.animations.push(new Be(t,i,c))}},fs=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,r,a,i){this.mesh=e,this.skin=t,this.slotIndex=r,this.parent=a,this.inheritTimeline=i}};function he(e,t,r,a){let i=e[0],c=k(i,"time",0),o=k(i,"value",r)*a,s=0;for(let l=0;;l++){t.setFrame(l,c,o);let n=e[l+1];if(!n)return t.shrink(s),t;let h=k(n,"time",0),d=k(n,"value",r)*a;i.curve&&(s=$(i.curve,t,s,l,0,c,h,o,d,a)),c=h,o=d,i=n}}function Ot(e,t,r,a,i,c){let o=e[0],s=k(o,"time",0),l=k(o,r,i)*c,n=k(o,a,i)*c,h=0;for(let d=0;;d++){t.setFrame(d,s,l,n);let f=e[d+1];if(!f)return t.shrink(h),t;let u=k(f,"time",0),g=k(f,r,i)*c,x=k(f,a,i)*c,p=o.curve;p&&(h=$(p,t,h,d,0,s,u,l,g,c),h=$(p,t,h,d,1,s,u,n,x,c)),s=u,l=g,n=x,o=f}}function $(e,t,r,a,i,c,o,s,l,n){if(e=="stepped")return t.setStepped(a),r;let h=i<<2,d=e[h],f=e[h+1]*n,u=e[h+2],g=e[h+3]*n;return t.setBezier(r,a,i,c,s,d,f,u,g,o,l),r+1}function k(e,t,r){return e[t]!==void 0?e[t]:r}typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)));var wr=class extends kt{constructor(e){super(e)}setFilters(e,t){}setWraps(e,t){}dispose(){}},us=class extends cr{constructor(e="",t=new Xt){super(r=>new wr(r),e,t)}},ms=B.newFloatArray(8),Ge=class{ctx;triangleRendering=!1;debugRendering=!1;vertices=B.newFloatArray(8*1024);tempColor=new N;constructor(e){this.ctx=e}draw(e){this.triangleRendering?this.drawTriangles(e):this.drawImages(e)}drawImages(e){let t=this.ctx,r=this.tempColor,a=e.color,i=e.drawOrder;this.debugRendering&&(t.strokeStyle="green");for(let c=0,o=i.length;c<o;c++){let s=i[c],l=s.bone;if(!l.active)continue;let n=s.getAttachment();if(!(n instanceof P))continue;n.computeWorldVertices(s,ms,0,2);let h=n.region,d=h.texture.getImage(),f=s.color,u=n.color;r.set(a.r*f.r*u.r,a.g*f.g*u.g,a.b*f.b*u.b,a.a*f.a*u.a),t.save(),t.transform(l.a,l.c,l.b,l.d,l.worldX,l.worldY),t.translate(n.offset[0],n.offset[1]),t.rotate(n.rotation*Math.PI/180);let g=n.width/h.originalWidth;t.scale(g*n.scaleX,g*n.scaleY);let x=h.width,p=h.height;if(t.translate(x/2,p/2),n.region.degrees==90){let y=x;x=p,p=y,t.rotate(-Math.PI/2)}t.scale(1,-1),t.translate(-x/2,-p/2),t.globalAlpha=r.a,t.drawImage(d,d.width*h.u,d.height*h.v,x,p,0,0,x,p),this.debugRendering&&t.strokeRect(0,0,x,p),t.restore()}}drawTriangles(e){let t=this.ctx,r=this.tempColor,a=e.color,i=e.drawOrder,c=null,o=this.vertices,s=null;for(let n=0,h=i.length;n<h;n++){let d=i[n],f=d.getAttachment(),u,g;if(f instanceof P){let x=f;o=this.computeRegionVertices(d,x,!1),s=Ge.QUAD_TRIANGLES,u=x.region.texture.getImage()}else if(f instanceof pe){let x=f;o=this.computeMeshVertices(d,x,!1),s=x.triangles,u=x.region.texture.getImage()}else continue;if(u){d.data.blendMode!=c&&(c=d.data.blendMode);let x=d.color,p=f.color;r.set(a.r*x.r*p.r,a.g*x.g*p.g,a.b*x.b*p.b,a.a*x.a*p.a),t.globalAlpha=r.a;for(var l=0;l<s.length;l+=3){let y=s[l]*8,m=s[l+1]*8,w=s[l+2]*8,b=o[y],v=o[y+1],A=o[y+6],S=o[y+7],C=o[m],Y=o[m+1],M=o[m+6],R=o[m+7],E=o[w],F=o[w+1],I=o[w+6],T=o[w+7];this.drawTriangle(u,b,v,A,S,C,Y,M,R,E,F,I,T),this.debugRendering&&(t.strokeStyle="green",t.beginPath(),t.moveTo(b,v),t.lineTo(C,Y),t.lineTo(E,F),t.lineTo(b,v),t.stroke())}}}this.ctx.globalAlpha=1}drawTriangle(e,t,r,a,i,c,o,s,l,n,h,d,f){let u=this.ctx;a*=e.width,i*=e.height,s*=e.width,l*=e.height,d*=e.width,f*=e.height,u.beginPath(),u.moveTo(t,r),u.lineTo(c,o),u.lineTo(n,h),u.closePath(),c-=t,o-=r,n-=t,h-=r,s-=a,l-=i,d-=a,f-=i;var g=1/(s*f-d*l),x=(f*c-l*n)*g,p=(f*o-l*h)*g,y=(s*n-d*c)*g,m=(s*h-d*o)*g,w=t-x*a-y*i,b=r-p*a-m*i;u.save(),u.transform(x,p,y,m,w,b),u.clip(),u.drawImage(e,0,0),u.restore()}computeRegionVertices(e,t,r){let a=e.bone.skeleton.color,i=e.color,c=t.color,o=a.a*i.a*c.a,s=r?o:1,l=this.tempColor;l.set(a.r*i.r*c.r*s,a.g*i.g*c.g*s,a.b*i.b*c.b*s,o),t.computeWorldVertices(e,this.vertices,0,Ge.VERTEX_SIZE);let n=this.vertices,h=t.uvs;return n[P.C1R]=l.r,n[P.C1G]=l.g,n[P.C1B]=l.b,n[P.C1A]=l.a,n[P.U1]=h[0],n[P.V1]=h[1],n[P.C2R]=l.r,n[P.C2G]=l.g,n[P.C2B]=l.b,n[P.C2A]=l.a,n[P.U2]=h[2],n[P.V2]=h[3],n[P.C3R]=l.r,n[P.C3G]=l.g,n[P.C3B]=l.b,n[P.C3A]=l.a,n[P.U3]=h[4],n[P.V3]=h[5],n[P.C4R]=l.r,n[P.C4G]=l.g,n[P.C4B]=l.b,n[P.C4A]=l.a,n[P.U4]=h[6],n[P.V4]=h[7],n}computeMeshVertices(e,t,r){let a=e.bone.skeleton.color,i=e.color,c=t.color,o=a.a*i.a*c.a,s=r?o:1,l=this.tempColor;l.set(a.r*i.r*c.r*s,a.g*i.g*c.g*s,a.b*i.b*c.b*s,o);let n=t.worldVerticesLength/2,h=this.vertices;h.length<t.worldVerticesLength&&(this.vertices=h=B.newFloatArray(t.worldVerticesLength)),t.computeWorldVertices(e,0,t.worldVerticesLength,h,0,Ge.VERTEX_SIZE);let d=t.uvs;for(let f=0,u=0,g=2;f<n;f++)h[g++]=l.r,h[g++]=l.g,h[g++]=l.b,h[g++]=l.a,h[g++]=d[u++],h[g++]=d[u++],g+=2;return h}},qt=Ge;return V(qt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),V(qt,"VERTEX_SIZE",8),Xr(Wt)})();
1
+ "use strict";var spine=(()=>{var Re=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Ms=Object.getOwnPropertyNames,Ys=Object.prototype.hasOwnProperty,Xs=(e,t,s)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Fs=(e,t)=>{for(var s in t)Re(e,s,{get:t[s],enumerable:!0})},Rs=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ms(t))!Ys.call(e,a)&&a!==s&&Re(e,a,{get:()=>t[a],enumerable:!(i=Ts(t,a))||i.enumerable});return e},Es=e=>Rs(Re({},"__esModule",{value:!0}),e),B=(e,t,s)=>(Xs(e,typeof t!="symbol"?t+"":t,s),s),zt={};Fs(zt,{AlphaTimeline:()=>ft,Animation:()=>Be,AnimationState:()=>rs,AnimationStateAdapter:()=>$s,AnimationStateData:()=>Hs,AssetManager:()=>Ir,AssetManagerBase:()=>us,AtlasAttachmentLoader:()=>Js,Attachment:()=>Ze,AttachmentTimeline:()=>be,BinaryInput:()=>ys,BlendMode:()=>Ge,Bone:()=>Yt,BoneData:()=>Mt,BoundingBoxAttachment:()=>Ne,CURRENT:()=>ls,CanvasTexture:()=>vs,ClippingAttachment:()=>Ct,Color:()=>O,ConstraintData:()=>Ue,CurveTimeline:()=>ne,CurveTimeline1:()=>te,CurveTimeline2:()=>Ve,DebugUtils:()=>Vs,DeformTimeline:()=>gt,Downloader:()=>Xt,DrawOrderTimeline:()=>pe,Event:()=>Ft,EventData:()=>Rt,EventQueue:()=>as,EventTimeline:()=>Xe,EventType:()=>Z,FIRST:()=>vt,FakeTexture:()=>Gs,HOLD_FIRST:()=>Oe,HOLD_MIX:()=>ns,HOLD_SUBSEQUENT:()=>At,IkConstraint:()=>ms,IkConstraintData:()=>Et,IkConstraintTimeline:()=>xt,IntSet:()=>Ps,Interpolation:()=>$t,MathUtils:()=>F,MeshAttachment:()=>ye,MixBlend:()=>Kt,MixDirection:()=>Qt,PathAttachment:()=>Se,PathConstraint:()=>Ce,PathConstraintData:()=>Pt,PathConstraintMixTimeline:()=>yt,PathConstraintPositionTimeline:()=>bt,PathConstraintSpacingTimeline:()=>pt,Physics:()=>ps,PhysicsConstraintDampingTimeline:()=>_s,PhysicsConstraintGravityTimeline:()=>Ws,PhysicsConstraintInertiaTimeline:()=>Os,PhysicsConstraintMassTimeline:()=>qs,PhysicsConstraintMixTimeline:()=>zs,PhysicsConstraintResetTimeline:()=>ss,PhysicsConstraintStrengthTimeline:()=>Ns,PhysicsConstraintTimeline:()=>fe,PhysicsConstraintWindTimeline:()=>Us,PointAttachment:()=>Tt,Pool:()=>Me,PositionMode:()=>We,Pow:()=>Ht,PowOut:()=>Bs,RGB2Timeline:()=>mt,RGBA2Timeline:()=>ut,RGBATimeline:()=>ct,RGBTimeline:()=>dt,RegionAttachment:()=>V,RotateMode:()=>$e,RotateTimeline:()=>Ye,SETUP:()=>St,SUBSEQUENT:()=>De,ScaleTimeline:()=>it,ScaleXTimeline:()=>at,ScaleYTimeline:()=>nt,SequenceTimeline:()=>Ae,ShearTimeline:()=>lt,ShearXTimeline:()=>ot,ShearYTimeline:()=>ht,Skeleton:()=>bs,SkeletonBinary:()=>Qs,SkeletonBounds:()=>Ar,SkeletonClipping:()=>Nt,SkeletonData:()=>Bt,SkeletonJson:()=>Sr,SkeletonRenderer:()=>qt,Skin:()=>He,SkinEntry:()=>Vt,Slot:()=>gs,SlotData:()=>Lt,SpacingMode:()=>ze,StringSet:()=>Qe,Texture:()=>It,TextureAtlas:()=>cs,TextureAtlasPage:()=>ds,TextureAtlasRegion:()=>kt,TextureFilter:()=>_e,TextureRegion:()=>hs,TextureWrap:()=>os,TimeKeeper:()=>Ls,Timeline:()=>J,TrackEntry:()=>is,TransformConstraint:()=>xs,TransformConstraintData:()=>Dt,TransformConstraintTimeline:()=>wt,TransformMode:()=>qe,TranslateTimeline:()=>tt,TranslateXTimeline:()=>st,TranslateYTimeline:()=>rt,Triangulator:()=>ee,Utils:()=>P,Vector2:()=>Ee,VertexAttachment:()=>ae,WindowedMean:()=>Ds});var Ps=class{array=new Array;add(e){let t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Qe=class{entries={};size=0;add(e){let t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){let t=this.size;for(var s=0,i=e.length;s<i;s++)this.add(e[s]);return t!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},we=class{constructor(e=0,t=0,s=0,i=0){this.r=e,this.g=t,this.b=s,this.a=i}set(e,t,s,i){return this.r=e,this.g=t,this.b=s,this.a=i,this.clamp()}setFromColor(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}setFromString(e){return e=e.charAt(0)=="#"?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=e.length!=8?1:parseInt(e.substr(6,2),16)/255,this}add(e,t,s,i){return this.r+=e,this.g+=t,this.b+=s,this.a+=i,this.clamp()}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(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255}static rgb888ToColor(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255}static fromString(e){return new we().setFromString(e)}},O=we;B(O,"WHITE",new we(1,1,1,1)),B(O,"RED",new we(1,0,0,1)),B(O,"GREEN",new we(0,1,0,1)),B(O,"BLUE",new we(0,0,1,1)),B(O,"MAGENTA",new we(1,0,1,1));var ie=class{static clamp(e,t,s){return e<t?t:e>s?s:e}static cosDeg(e){return Math.cos(e*ie.degRad)}static sinDeg(e){return Math.sin(e*ie.degRad)}static atan2Deg(e,t){return Math.atan2(e,t)*ie.degRad}static signum(e){return e>0?1:e<0?-1:0}static toInt(e){return e>0?Math.floor(e):Math.ceil(e)}static cbrt(e){let t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t}static randomTriangular(e,t){return ie.randomTriangularWith(e,t,(e+t)*.5)}static randomTriangularWith(e,t,s){let i=Math.random(),a=t-e;return i<=(s-e)/a?e+Math.sqrt(i*a*(s-e)):t-Math.sqrt((1-i)*a*(t-s))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},F=ie;B(F,"PI",3.1415927),B(F,"PI2",ie.PI*2),B(F,"invPI2",1/ie.PI2),B(F,"radiansToDegrees",180/ie.PI),B(F,"radDeg",ie.radiansToDegrees),B(F,"degreesToRadians",ie.PI/180),B(F,"degRad",ie.degreesToRadians);var $t=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},Ht=class extends $t{power=2;constructor(e){super(),this.power=e}applyInternal(e){return e<=.5?Math.pow(e*2,this.power)/2:Math.pow((e-1)*2,this.power)/(this.power%2==0?-2:2)+1}},Bs=class extends Ht{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},ve=class{static arrayCopy(e,t,s,i,a){for(let h=t,o=i;h<t+a;h++,o++)s[o]=e[h]}static arrayFill(e,t,s,i){for(let a=t;a<s;a++)e[a]=i}static setArraySize(e,t,s=0){let i=e.length;if(i==t)return e;if(e.length=t,i<t)for(let a=i;a<t;a++)e[a]=s;return e}static ensureArrayCapacity(e,t,s=0){return e.length>=t?e:ve.setArraySize(e,t,s)}static newArray(e,t){let s=new Array(e);for(let i=0;i<e;i++)s[i]=t;return s}static newFloatArray(e){if(ve.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let t=new Array(e);for(let s=0;s<t.length;s++)t[s]=0;return t}}static newShortArray(e){if(ve.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let t=new Array(e);for(let s=0;s<t.length;s++)t[s]=0;return t}}static toFloatArray(e){return ve.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return ve.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,t){}static contains(e,t,s=!0){for(var i=0;i<e.length;i++)if(e[i]==t)return!0;return!1}static enumValue(e,t){return e[t[0].toUpperCase()+t.slice(1)]}},P=ve;B(P,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u");var Vs=class{static logBones(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}},Me=class{items=new Array;instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset&&e.reset(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Ee=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){let e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},Ls=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){let e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}},Ds=class{values;addedValues=0;lastValue=0;mean=0;dirty=!0;constructor(e=32){this.values=new Array(e)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let e=0;for(let t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Ze=class{name;constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},Gt=class extends Ze{id=Gt.nextID++;bones=null;vertices=[];worldVerticesLength=0;timelineAttachment=this;constructor(e){super(e)}computeWorldVertices(e,t,s,i,a,h){s=a+(s>>1)*h;let o=e.bone.skeleton,r=e.deform,l=this.vertices,n=this.bones;if(!n){r.length>0&&(l=r);let u=e.bone,g=u.worldX,x=u.worldY,b=u.a,v=u.b,w=u.c,m=u.d;for(let p=t,y=a;y<s;p+=2,y+=h){let A=l[p],S=l[p+1];i[y]=A*b+S*v+g,i[y+1]=A*w+S*m+x}return}let c=0,f=0;for(let u=0;u<t;u+=2){let g=n[c];c+=g+1,f+=g}let d=o.bones;if(r.length==0)for(let u=a,g=f*3;u<s;u+=h){let x=0,b=0,v=n[c++];for(v+=c;c<v;c++,g+=3){let w=d[n[c]],m=l[g],p=l[g+1],y=l[g+2];x+=(m*w.a+p*w.b+w.worldX)*y,b+=(m*w.c+p*w.d+w.worldY)*y}i[u]=x,i[u+1]=b}else{let u=r;for(let g=a,x=f*3,b=f<<1;g<s;g+=h){let v=0,w=0,m=n[c++];for(m+=c;c<m;c++,x+=3,b+=2){let p=d[n[c]],y=l[x]+u[b],A=l[x+1]+u[b+1],S=l[x+2];v+=(y*p.a+A*p.b+p.worldX)*S,w+=(y*p.c+A*p.d+p.worldY)*S}i[g]=v,i[g+1]=w}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),P.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=P.newFloatArray(this.vertices.length),P.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment}},ae=Gt;B(ae,"nextID",0);var Pe=class{id=Pe.nextID();regions;start=0;digits=0;setupIndex=0;constructor(e){this.regions=new Array(e)}copy(){let e=new Pe(this.regions.length);return P.arrayCopy(this.regions,0,e.regions,0,this.regions.length),e.start=this.start,e.digits=this.digits,e.setupIndex=this.setupIndex,e}apply(e,t){let s=e.sequenceIndex;s==-1&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let i=this.regions[s];t.region!=i&&(t.region=i,t.updateRegion())}getPath(e,t){let s=e,i=(this.start+t).toString();for(let a=this.digits-i.length;a>0;a--)s+="0";return s+=i,s}static nextID(){return Pe._nextID++}},et=Pe;B(et,"_nextID",0);var jt=(e=>(e[e.hold=0]="hold",e[e.once=1]="once",e[e.loop=2]="loop",e[e.pingpong=3]="pingpong",e[e.onceReverse=4]="onceReverse",e[e.loopReverse=5]="loopReverse",e[e.pingpongReverse=6]="pingpongReverse",e))(jt||{}),Jt=[0,1,2,3,4,5,6],Be=class{name;timelines=[];timelineIds=new Qe;duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(t),this.duration=s}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var t=0;t<e.length;t++)this.timelineIds.addAll(e[t].getPropertyIds())}hasTimeline(e){for(let t=0;t<e.length;t++)if(this.timelineIds.contains(e[t]))return!0;return!1}apply(e,t,s,i,a,h,o,r){if(!e)throw new Error("skeleton cannot be null.");i&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let l=this.timelines;for(let n=0,c=l.length;n<c;n++)l[n].apply(e,t,s,a,h,o,r)}},Kt=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(Kt||{}),Qt=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(Qt||{}),q={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,rgb:7,alpha:8,rgb2:9,attachment:10,deform:11,event:12,drawOrder:13,ikConstraint:14,transformConstraint:15,pathConstraintPosition:16,pathConstraintSpacing:17,pathConstraintMix:18,physicsConstraintInertia:19,physicsConstraintStrength:20,physicsConstraintDamping:21,physicsConstraintMass:22,physicsConstraintWind:23,physicsConstraintGravity:24,physicsConstraintMix:25,physicsConstraintReset:26,sequence:27},J=class{propertyIds;frames;constructor(e,t){this.propertyIds=t,this.frames=P.newFloatArray(e*this.getFrameEntries())}getPropertyIds(){return this.propertyIds}getFrameEntries(){return 1}getFrameCount(){return this.frames.length/this.getFrameEntries()}getDuration(){return this.frames[this.frames.length-this.getFrameEntries()]}static search1(e,t){let s=e.length;for(let i=1;i<s;i++)if(e[i]>t)return i-1;return s-1}static search(e,t,s){let i=e.length;for(let a=s;a<i;a+=s)if(e[a]>t)return a-s;return i-s}},ne=class extends J{curves;constructor(e,t,s){super(e,s),this.curves=P.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let t=this.getFrameCount()+e*18;if(this.curves.length>t){let s=P.newFloatArray(t);P.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,i,a,h,o,r,l,n,c){let f=this.curves,d=this.getFrameCount()+e*18;s==0&&(f[t]=2+d);let u=(i-h*2+r)*.03,g=(a-o*2+l)*.03,x=((h-r)*3-i+n)*.006,b=((o-l)*3-a+c)*.006,v=u*2+x,w=g*2+b,m=(h-i)*.3+u+x*.16666667,p=(o-a)*.3+g+b*.16666667,y=i+m,A=a+p;for(let S=d+18;d<S;d+=2)f[d]=y,f[d+1]=A,m+=v,p+=w,v+=x,w+=b,y+=m,A+=p}getBezierValue(e,t,s,i){let a=this.curves;if(a[i]>e){let l=this.frames[t],n=this.frames[t+s];return n+(e-l)/(a[i]-l)*(a[i+1]-n)}let h=i+18;for(i+=2;i<h;i+=2)if(a[i]>=e){let l=a[i-2],n=a[i-1];return n+(e-l)/(a[i]-l)*(a[i+1]-n)}t+=this.getFrameEntries();let o=a[h-2],r=a[h-1];return r+(e-o)/(this.frames[t]-o)*(this.frames[t+s]-r)}},te=class extends ne{constructor(e,t,s){super(e,t,[s])}getFrameEntries(){return 2}setFrame(e,t,s){e<<=1,this.frames[e]=t,this.frames[e+1]=s}getCurveValue(e){let t=this.frames,s=t.length-2;for(let a=2;a<=s;a+=2)if(t[a]>e){s=a-2;break}let i=this.curves[s>>1];switch(i){case 0:let a=t[s],h=t[s+1];return h+(e-a)/(t[s+2]-a)*(t[s+2+1]-h);case 1:return t[s+1]}return this.getBezierValue(e,s,1,i-2)}getRelativeValue(e,t,s,i,a){if(e<this.frames[0]){switch(s){case 0:return a;case 1:return i+(a-i)*t}return i}let h=this.getCurveValue(e);switch(s){case 0:return a+h*t;case 1:case 2:h+=a-i}return i+h*t}getAbsoluteValue(e,t,s,i,a){if(e<this.frames[0]){switch(s){case 0:return a;case 1:return i+(a-i)*t}return i}let h=this.getCurveValue(e);return s==0?a+(h-a)*t:i+(h-i)*t}getAbsoluteValue2(e,t,s,i,a,h){if(e<this.frames[0]){switch(s){case 0:return a;case 1:return i+(a-i)*t}return i}return s==0?a+(h-a)*t:i+(h-i)*t}getScaleValue(e,t,s,i,a,h){const o=this.frames;if(e<o[0]){switch(s){case 0:return h;case 1:return a+(h-a)*t}return a}let r=this.getCurveValue(e)*h;if(t==1)return s==3?a+r-h:r;if(i==1)switch(s){case 0:return h+(Math.abs(r)*F.signum(h)-h)*t;case 1:case 2:return a+(Math.abs(r)*F.signum(a)-a)*t}else{let l=0;switch(s){case 0:return l=Math.abs(h)*F.signum(r),l+(r-l)*t;case 1:case 2:return l=Math.abs(a)*F.signum(r),l+(r-l)*t}}return a+(r-h)*t}},Ve=class extends ne{constructor(e,t,s,i){super(e,t,[s,i])}getFrameEntries(){return 3}setFrame(e,t,s,i){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i}},Ye=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.rotation=this.getRelativeValue(s,a,h,r.rotation,r.data.rotation))}},tt=class extends Ve{boneIndex=0;constructor(e,t,s){super(e,t,q.x+"|"+s,q.y+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];if(!r.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:r.x=r.data.x,r.y=r.data.y;return;case 1:r.x+=(r.data.x-r.x)*a,r.y+=(r.data.y-r.y)*a}return}let n=0,c=0,f=J.search(l,s,3),d=this.curves[f/3];switch(d){case 0:let u=l[f];n=l[f+1],c=l[f+2];let g=(s-u)/(l[f+3]-u);n+=(l[f+3+1]-n)*g,c+=(l[f+3+2]-c)*g;break;case 1:n=l[f+1],c=l[f+2];break;default:n=this.getBezierValue(s,f,1,d-2),c=this.getBezierValue(s,f,2,d+18-2)}switch(h){case 0:r.x=r.data.x+n*a,r.y=r.data.y+c*a;break;case 1:case 2:r.x+=(r.data.x+n-r.x)*a,r.y+=(r.data.y+c-r.y)*a;break;case 3:r.x+=n*a,r.y+=c*a}}},st=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.x+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.x=this.getRelativeValue(s,a,h,r.x,r.data.x))}},rt=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.y+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.y=this.getRelativeValue(s,a,h,r.y,r.data.y))}},it=class extends Ve{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleX+"|"+s,q.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];if(!r.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:r.scaleX=r.data.scaleX,r.scaleY=r.data.scaleY;return;case 1:r.scaleX+=(r.data.scaleX-r.scaleX)*a,r.scaleY+=(r.data.scaleY-r.scaleY)*a}return}let n,c,f=J.search(l,s,3),d=this.curves[f/3];switch(d){case 0:let u=l[f];n=l[f+1],c=l[f+2];let g=(s-u)/(l[f+3]-u);n+=(l[f+3+1]-n)*g,c+=(l[f+3+2]-c)*g;break;case 1:n=l[f+1],c=l[f+2];break;default:n=this.getBezierValue(s,f,1,d-2),c=this.getBezierValue(s,f,2,d+18-2)}if(n*=r.data.scaleX,c*=r.data.scaleY,a==1)h==3?(r.scaleX+=n-r.data.scaleX,r.scaleY+=c-r.data.scaleY):(r.scaleX=n,r.scaleY=c);else{let u=0,g=0;if(o==1)switch(h){case 0:u=r.data.scaleX,g=r.data.scaleY,r.scaleX=u+(Math.abs(n)*F.signum(u)-u)*a,r.scaleY=g+(Math.abs(c)*F.signum(g)-g)*a;break;case 1:case 2:u=r.scaleX,g=r.scaleY,r.scaleX=u+(Math.abs(n)*F.signum(u)-u)*a,r.scaleY=g+(Math.abs(c)*F.signum(g)-g)*a;break;case 3:r.scaleX+=(n-r.data.scaleX)*a,r.scaleY+=(c-r.data.scaleY)*a}else switch(h){case 0:u=Math.abs(r.data.scaleX)*F.signum(n),g=Math.abs(r.data.scaleY)*F.signum(c),r.scaleX=u+(n-u)*a,r.scaleY=g+(c-g)*a;break;case 1:case 2:u=Math.abs(r.scaleX)*F.signum(n),g=Math.abs(r.scaleY)*F.signum(c),r.scaleX=u+(n-u)*a,r.scaleY=g+(c-g)*a;break;case 3:r.scaleX+=(n-r.data.scaleX)*a,r.scaleY+=(c-r.data.scaleY)*a}}}},at=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.scaleX=this.getScaleValue(s,a,h,o,r.scaleX,r.data.scaleX))}},nt=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.scaleY=this.getScaleValue(s,a,h,o,r.scaleX,r.data.scaleY))}},lt=class extends Ve{boneIndex=0;constructor(e,t,s){super(e,t,q.shearX+"|"+s,q.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];if(!r.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:r.shearX=r.data.shearX,r.shearY=r.data.shearY;return;case 1:r.shearX+=(r.data.shearX-r.shearX)*a,r.shearY+=(r.data.shearY-r.shearY)*a}return}let n=0,c=0,f=J.search(l,s,3),d=this.curves[f/3];switch(d){case 0:let u=l[f];n=l[f+1],c=l[f+2];let g=(s-u)/(l[f+3]-u);n+=(l[f+3+1]-n)*g,c+=(l[f+3+2]-c)*g;break;case 1:n=l[f+1],c=l[f+2];break;default:n=this.getBezierValue(s,f,1,d-2),c=this.getBezierValue(s,f,2,d+18-2)}switch(h){case 0:r.shearX=r.data.shearX+n*a,r.shearY=r.data.shearY+c*a;break;case 1:case 2:r.shearX+=(r.data.shearX+n-r.shearX)*a,r.shearY+=(r.data.shearY+c-r.shearY)*a;break;case 3:r.shearX+=n*a,r.shearY+=c*a}}},ot=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.shearX=this.getRelativeValue(s,a,h,r.shearX,r.data.shearX))}},ht=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,q.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,o){let r=e.bones[this.boneIndex];r.active&&(r.shearY=this.getRelativeValue(s,a,h,r.shearX,r.data.shearY))}},ct=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.alpha+"|"+s]),this.slotIndex=s}getFrameEntries(){return 5}setFrame(e,t,s,i,a,h){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=a,this.frames[e+4]=h}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=this.frames,n=r.color;if(s<l[0]){let b=r.data.color;switch(h){case 0:n.setFromColor(b);return;case 1:n.add((b.r-n.r)*a,(b.g-n.g)*a,(b.b-n.b)*a,(b.a-n.a)*a)}return}let c=0,f=0,d=0,u=0,g=J.search(l,s,5),x=this.curves[g/5];switch(x){case 0:let b=l[g];c=l[g+1],f=l[g+2],d=l[g+3],u=l[g+4];let v=(s-b)/(l[g+5]-b);c+=(l[g+5+1]-c)*v,f+=(l[g+5+2]-f)*v,d+=(l[g+5+3]-d)*v,u+=(l[g+5+4]-u)*v;break;case 1:c=l[g+1],f=l[g+2],d=l[g+3],u=l[g+4];break;default:c=this.getBezierValue(s,g,1,x-2),f=this.getBezierValue(s,g,2,x+18-2),d=this.getBezierValue(s,g,3,x+18*2-2),u=this.getBezierValue(s,g,4,x+18*3-2)}a==1?n.set(c,f,d,u):(h==0&&n.setFromColor(r.data.color),n.add((c-n.r)*a,(f-n.g)*a,(d-n.b)*a,(u-n.a)*a))}},dt=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s]),this.slotIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,i,a){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=a}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=this.frames,n=r.color;if(s<l[0]){let x=r.data.color;switch(h){case 0:n.r=x.r,n.g=x.g,n.b=x.b;return;case 1:n.r+=(x.r-n.r)*a,n.g+=(x.g-n.g)*a,n.b+=(x.b-n.b)*a}return}let c=0,f=0,d=0,u=J.search(l,s,4),g=this.curves[u>>2];switch(g){case 0:let x=l[u];c=l[u+1],f=l[u+2],d=l[u+3];let b=(s-x)/(l[u+4]-x);c+=(l[u+4+1]-c)*b,f+=(l[u+4+2]-f)*b,d+=(l[u+4+3]-d)*b;break;case 1:c=l[u+1],f=l[u+2],d=l[u+3];break;default:c=this.getBezierValue(s,u,1,g-2),f=this.getBezierValue(s,u,2,g+18-2),d=this.getBezierValue(s,u,3,g+18*2-2)}if(a==1)n.r=c,n.g=f,n.b=d;else{if(h==0){let x=r.data.color;n.r=x.r,n.g=x.g,n.b=x.b}n.r+=(c-n.r)*a,n.g+=(f-n.g)*a,n.b+=(d-n.b)*a}}},ft=class extends te{slotIndex=0;constructor(e,t,s){super(e,t,q.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=r.color;if(s<this.frames[0]){let c=r.data.color;switch(h){case 0:l.a=c.a;return;case 1:l.a+=(c.a-l.a)*a}return}let n=this.getCurveValue(s);a==1?l.a=n:(h==0&&(l.a=r.data.color.a),l.a+=(n-l.a)*a)}},ut=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.alpha+"|"+s,q.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,i,a,h,o,r,l){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=a,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=r,this.frames[e+7]=l}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=this.frames,n=r.color,c=r.darkColor;if(s<l[0]){let p=r.data.color,y=r.data.darkColor;switch(h){case 0:n.setFromColor(p),c.r=y.r,c.g=y.g,c.b=y.b;return;case 1:n.add((p.r-n.r)*a,(p.g-n.g)*a,(p.b-n.b)*a,(p.a-n.a)*a),c.r+=(y.r-c.r)*a,c.g+=(y.g-c.g)*a,c.b+=(y.b-c.b)*a}return}let f=0,d=0,u=0,g=0,x=0,b=0,v=0,w=J.search(l,s,8),m=this.curves[w>>3];switch(m){case 0:let p=l[w];f=l[w+1],d=l[w+2],u=l[w+3],g=l[w+4],x=l[w+5],b=l[w+6],v=l[w+7];let y=(s-p)/(l[w+8]-p);f+=(l[w+8+1]-f)*y,d+=(l[w+8+2]-d)*y,u+=(l[w+8+3]-u)*y,g+=(l[w+8+4]-g)*y,x+=(l[w+8+5]-x)*y,b+=(l[w+8+6]-b)*y,v+=(l[w+8+7]-v)*y;break;case 1:f=l[w+1],d=l[w+2],u=l[w+3],g=l[w+4],x=l[w+5],b=l[w+6],v=l[w+7];break;default:f=this.getBezierValue(s,w,1,m-2),d=this.getBezierValue(s,w,2,m+18-2),u=this.getBezierValue(s,w,3,m+18*2-2),g=this.getBezierValue(s,w,4,m+18*3-2),x=this.getBezierValue(s,w,5,m+18*4-2),b=this.getBezierValue(s,w,6,m+18*5-2),v=this.getBezierValue(s,w,7,m+18*6-2)}if(a==1)n.set(f,d,u,g),c.r=x,c.g=b,c.b=v;else{if(h==0){n.setFromColor(r.data.color);let p=r.data.darkColor;c.r=p.r,c.g=p.g,c.b=p.b}n.add((f-n.r)*a,(d-n.g)*a,(u-n.b)*a,(g-n.a)*a),c.r+=(x-c.r)*a,c.g+=(b-c.g)*a,c.b+=(v-c.b)*a}}},mt=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[q.rgb+"|"+s,q.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,i,a,h,o,r){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=a,this.frames[e+4]=h,this.frames[e+5]=o,this.frames[e+6]=r}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=this.frames,n=r.color,c=r.darkColor;if(s<l[0]){let p=r.data.color,y=r.data.darkColor;switch(h){case 0:n.r=p.r,n.g=p.g,n.b=p.b,c.r=y.r,c.g=y.g,c.b=y.b;return;case 1:n.r+=(p.r-n.r)*a,n.g+=(p.g-n.g)*a,n.b+=(p.b-n.b)*a,c.r+=(y.r-c.r)*a,c.g+=(y.g-c.g)*a,c.b+=(y.b-c.b)*a}return}let f=0,d=0,u=0,g=0,x=0,b=0,v=0,w=J.search(l,s,7),m=this.curves[w/7];switch(m){case 0:let p=l[w];f=l[w+1],d=l[w+2],u=l[w+3],x=l[w+4],b=l[w+5],v=l[w+6];let y=(s-p)/(l[w+7]-p);f+=(l[w+7+1]-f)*y,d+=(l[w+7+2]-d)*y,u+=(l[w+7+3]-u)*y,x+=(l[w+7+4]-x)*y,b+=(l[w+7+5]-b)*y,v+=(l[w+7+6]-v)*y;break;case 1:f=l[w+1],d=l[w+2],u=l[w+3],x=l[w+4],b=l[w+5],v=l[w+6];break;default:f=this.getBezierValue(s,w,1,m-2),d=this.getBezierValue(s,w,2,m+18-2),u=this.getBezierValue(s,w,3,m+18*2-2),x=this.getBezierValue(s,w,4,m+18*3-2),b=this.getBezierValue(s,w,5,m+18*4-2),v=this.getBezierValue(s,w,6,m+18*5-2)}if(a==1)n.r=f,n.g=d,n.b=u,c.r=x,c.g=b,c.b=v;else{if(h==0){let p=r.data.color,y=r.data.darkColor;n.r=p.r,n.g=p.g,n.b=p.b,c.r=y.r,c.g=y.g,c.b=y.b}n.r+=(f-n.r)*a,n.g+=(d-n.g)*a,n.b+=(u-n.b)*a,c.r+=(x-c.r)*a,c.g+=(b-c.g)*a,c.b+=(v-c.b)*a}}},be=class extends J{slotIndex=0;attachmentNames;constructor(e,t){super(e,[q.attachment+"|"+t]),this.slotIndex=t,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(r.bone.active){if(o==1){h==0&&this.setAttachment(e,r,r.data.attachmentName);return}if(s<this.frames[0]){(h==0||h==1)&&this.setAttachment(e,r,r.data.attachmentName);return}this.setAttachment(e,r,this.attachmentNames[J.search1(this.frames,s)])}}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},gt=class extends ne{slotIndex=0;attachment;vertices;constructor(e,t,s,i){super(e,t,[q.deform+"|"+s+"|"+i.id]),this.slotIndex=s,this.attachment=i,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,i,a,h,o,r,l,n,c){let f=this.curves,d=this.getFrameCount()+e*18;s==0&&(f[t]=2+d);let u=(i-h*2+r)*.03,g=l*.03-o*.06,x=((h-r)*3-i+n)*.006,b=(o-l+.33333333)*.018,v=u*2+x,w=g*2+b,m=(h-i)*.3+u+x*.16666667,p=o*.3+g+b*.16666667,y=i+m,A=p;for(let S=d+18;d<S;d+=2)f[d]=y,f[d+1]=A,m+=v,p+=w,v+=x,w+=b,y+=m,A+=p}getCurvePercent(e,t){let s=this.curves,i=s[t];switch(i){case 0:let r=this.frames[t];return(e-r)/(this.frames[t+this.getFrameEntries()]-r);case 1:return 0}if(i-=2,s[i]>e){let r=this.frames[t];return s[i+1]*(e-r)/(s[i]-r)}let a=i+18;for(i+=2;i<a;i+=2)if(s[i]>=e){let r=s[i-2],l=s[i-1];return l+(e-r)/(s[i]-r)*(s[i+1]-l)}let h=s[a-2],o=s[a-1];return o+(1-o)*(e-h)/(this.frames[t+this.getFrameEntries()]-h)}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=r.getAttachment();if(!l||!(l instanceof ae)||l.timelineAttachment!=this.attachment)return;let n=r.deform;n.length==0&&(h=0);let c=this.vertices,f=c[0].length,d=this.frames;if(s<d[0]){switch(h){case 0:n.length=0;return;case 1:if(a==1){n.length=0;return}n.length=f;let w=l;if(w.bones){a=1-a;for(var u=0;u<f;u++)n[u]*=a}else{let m=w.vertices;for(var u=0;u<f;u++)n[u]+=(m[u]-n[u])*a}}return}if(n.length=f,s>=d[d.length-1]){let w=c[d.length-1];if(a==1)if(h==3){let m=l;if(m.bones)for(let p=0;p<f;p++)n[p]+=w[p];else{let p=m.vertices;for(let y=0;y<f;y++)n[y]+=w[y]-p[y]}}else P.arrayCopy(w,0,n,0,f);else switch(h){case 0:{let p=l;if(p.bones)for(let y=0;y<f;y++)n[y]=w[y]*a;else{let y=p.vertices;for(let A=0;A<f;A++){let S=y[A];n[A]=S+(w[A]-S)*a}}break}case 1:case 2:for(let p=0;p<f;p++)n[p]+=(w[p]-n[p])*a;break;case 3:let m=l;if(m.bones)for(let p=0;p<f;p++)n[p]+=w[p]*a;else{let p=m.vertices;for(let y=0;y<f;y++)n[y]+=(w[y]-p[y])*a}}return}let g=J.search1(d,s),x=this.getCurvePercent(s,g),b=c[g],v=c[g+1];if(a==1)if(h==3){let w=l;if(w.bones)for(let m=0;m<f;m++){let p=b[m];n[m]+=p+(v[m]-p)*x}else{let m=w.vertices;for(let p=0;p<f;p++){let y=b[p];n[p]+=y+(v[p]-y)*x-m[p]}}}else for(let w=0;w<f;w++){let m=b[w];n[w]=m+(v[w]-m)*x}else switch(h){case 0:{let m=l;if(m.bones)for(let p=0;p<f;p++){let y=b[p];n[p]=(y+(v[p]-y)*x)*a}else{let p=m.vertices;for(let y=0;y<f;y++){let A=b[y],S=p[y];n[y]=S+(A+(v[y]-A)*x-S)*a}}break}case 1:case 2:for(let m=0;m<f;m++){let p=b[m];n[m]+=(p+(v[m]-p)*x-n[m])*a}break;case 3:let w=l;if(w.bones)for(let m=0;m<f;m++){let p=b[m];n[m]+=(p+(v[m]-p)*x)*a}else{let m=w.vertices;for(let p=0;p<f;p++){let y=b[p];n[p]+=(y+(v[p]-y)*x-m[p])*a}}}}},Zt=class extends J{events;constructor(e){super(e,Zt.propertyIds),this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t.time,this.events[e]=t}apply(e,t,s,i,a,h,o){if(!i)return;let r=this.frames,l=this.frames.length;if(t>s)this.apply(e,t,Number.MAX_VALUE,i,a,h,o),t=-1;else if(t>=r[l-1])return;if(s<r[0])return;let n=0;if(t<r[0])n=0;else{n=J.search1(r,t)+1;let c=r[n];for(;n>0&&r[n-1]==c;)n--}for(;n<l&&s>=r[n];n++)i.push(this.events[n])}},Xe=Zt;B(Xe,"propertyIds",[""+q.event]);var es=class extends J{drawOrders;constructor(e){super(e,es.propertyIds),this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.drawOrders[e]=s}apply(e,t,s,i,a,h,o){if(o==1){h==0&&P.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(s<this.frames[0]){(h==0||h==1)&&P.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let r=J.search1(this.frames,s),l=this.drawOrders[r];if(!l)P.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let n=e.drawOrder,c=e.slots;for(let f=0,d=l.length;f<d;f++)n[f]=c[l[f]]}}},pe=es;B(pe,"propertyIds",[""+q.drawOrder]);var xt=class extends ne{constraintIndex=0;constructor(e,t,s){super(e,t,[q.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,i,a,h,o){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=a,this.frames[e+4]=h?1:0,this.frames[e+5]=o?1:0}apply(e,t,s,i,a,h,o){let r=e.ikConstraints[this.constraintIndex];if(!r.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:r.mix=r.data.mix,r.softness=r.data.softness,r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch;return;case 1:r.mix+=(r.data.mix-r.mix)*a,r.softness+=(r.data.softness-r.softness)*a,r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch}return}let n=0,c=0,f=J.search(l,s,6),d=this.curves[f/6];switch(d){case 0:let u=l[f];n=l[f+1],c=l[f+2];let g=(s-u)/(l[f+6]-u);n+=(l[f+6+1]-n)*g,c+=(l[f+6+2]-c)*g;break;case 1:n=l[f+1],c=l[f+2];break;default:n=this.getBezierValue(s,f,1,d-2),c=this.getBezierValue(s,f,2,d+18-2)}h==0?(r.mix=r.data.mix+(n-r.data.mix)*a,r.softness=r.data.softness+(c-r.data.softness)*a,o==1?(r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch):(r.bendDirection=l[f+3],r.compress=l[f+4]!=0,r.stretch=l[f+5]!=0)):(r.mix+=(n-r.mix)*a,r.softness+=(c-r.softness)*a,o==0&&(r.bendDirection=l[f+3],r.compress=l[f+4]!=0,r.stretch=l[f+5]!=0))}},wt=class extends ne{constraintIndex=0;constructor(e,t,s){super(e,t,[q.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,i,a,h,o,r){let l=this.frames;e*=7,l[e]=t,l[e+1]=s,l[e+2]=i,l[e+3]=a,l[e+4]=h,l[e+5]=o,l[e+6]=r}apply(e,t,s,i,a,h,o){let r=e.transformConstraints[this.constraintIndex];if(!r.active)return;let l=this.frames;if(s<l[0]){let v=r.data;switch(h){case 0:r.mixRotate=v.mixRotate,r.mixX=v.mixX,r.mixY=v.mixY,r.mixScaleX=v.mixScaleX,r.mixScaleY=v.mixScaleY,r.mixShearY=v.mixShearY;return;case 1:r.mixRotate+=(v.mixRotate-r.mixRotate)*a,r.mixX+=(v.mixX-r.mixX)*a,r.mixY+=(v.mixY-r.mixY)*a,r.mixScaleX+=(v.mixScaleX-r.mixScaleX)*a,r.mixScaleY+=(v.mixScaleY-r.mixScaleY)*a,r.mixShearY+=(v.mixShearY-r.mixShearY)*a}return}let n,c,f,d,u,g,x=J.search(l,s,7),b=this.curves[x/7];switch(b){case 0:let v=l[x];n=l[x+1],c=l[x+2],f=l[x+3],d=l[x+4],u=l[x+5],g=l[x+6];let w=(s-v)/(l[x+7]-v);n+=(l[x+7+1]-n)*w,c+=(l[x+7+2]-c)*w,f+=(l[x+7+3]-f)*w,d+=(l[x+7+4]-d)*w,u+=(l[x+7+5]-u)*w,g+=(l[x+7+6]-g)*w;break;case 1:n=l[x+1],c=l[x+2],f=l[x+3],d=l[x+4],u=l[x+5],g=l[x+6];break;default:n=this.getBezierValue(s,x,1,b-2),c=this.getBezierValue(s,x,2,b+18-2),f=this.getBezierValue(s,x,3,b+18*2-2),d=this.getBezierValue(s,x,4,b+18*3-2),u=this.getBezierValue(s,x,5,b+18*4-2),g=this.getBezierValue(s,x,6,b+18*5-2)}if(h==0){let v=r.data;r.mixRotate=v.mixRotate+(n-v.mixRotate)*a,r.mixX=v.mixX+(c-v.mixX)*a,r.mixY=v.mixY+(f-v.mixY)*a,r.mixScaleX=v.mixScaleX+(d-v.mixScaleX)*a,r.mixScaleY=v.mixScaleY+(u-v.mixScaleY)*a,r.mixShearY=v.mixShearY+(g-v.mixShearY)*a}else r.mixRotate+=(n-r.mixRotate)*a,r.mixX+=(c-r.mixX)*a,r.mixY+=(f-r.mixY)*a,r.mixScaleX+=(d-r.mixScaleX)*a,r.mixScaleY+=(u-r.mixScaleY)*a,r.mixShearY+=(g-r.mixShearY)*a}},bt=class extends te{constraintIndex=0;constructor(e,t,s){super(e,t,q.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,i,a,h,o){let r=e.pathConstraints[this.constraintIndex];r.active&&(r.position=this.getAbsoluteValue(s,a,h,r.position,r.data.position))}},pt=class extends te{constraintIndex=0;constructor(e,t,s){super(e,t,q.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,i,a,h,o){let r=e.pathConstraints[this.constraintIndex];r.active&&(r.spacing=this.getAbsoluteValue(s,a,h,r.spacing,r.data.spacing))}},yt=class extends ne{constraintIndex=0;constructor(e,t,s){super(e,t,[q.pathConstraintMix+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,i,a){let h=this.frames;e<<=2,h[e]=t,h[e+1]=s,h[e+2]=i,h[e+3]=a}apply(e,t,s,i,a,h,o){let r=e.pathConstraints[this.constraintIndex];if(!r.active)return;let l=this.frames;if(s<l[0]){switch(h){case 0:r.mixRotate=r.data.mixRotate,r.mixX=r.data.mixX,r.mixY=r.data.mixY;return;case 1:r.mixRotate+=(r.data.mixRotate-r.mixRotate)*a,r.mixX+=(r.data.mixX-r.mixX)*a,r.mixY+=(r.data.mixY-r.mixY)*a}return}let n,c,f,d=J.search(l,s,4),u=this.curves[d>>2];switch(u){case 0:let g=l[d];n=l[d+1],c=l[d+2],f=l[d+3];let x=(s-g)/(l[d+4]-g);n+=(l[d+4+1]-n)*x,c+=(l[d+4+2]-c)*x,f+=(l[d+4+3]-f)*x;break;case 1:n=l[d+1],c=l[d+2],f=l[d+3];break;default:n=this.getBezierValue(s,d,1,u-2),c=this.getBezierValue(s,d,2,u+18-2),f=this.getBezierValue(s,d,3,u+18*2-2)}if(h==0){let g=r.data;r.mixRotate=g.mixRotate+(n-g.mixRotate)*a,r.mixX=g.mixX+(c-g.mixX)*a,r.mixY=g.mixY+(f-g.mixY)*a}else r.mixRotate+=(n-r.mixRotate)*a,r.mixX+=(c-r.mixX)*a,r.mixY+=(f-r.mixY)*a}},fe=class extends te{constraintIndex=0;constructor(e,t,s,i){super(e,t,i+"|"+s),this.constraintIndex=s}apply(e,t,s,i,a,h,o){let r;if(this.constraintIndex==-1){const l=s>=this.frames[0]?this.getCurveValue(s):0;for(const n of e.physicsConstraints)n.active&&this.global(n.data)&&this.set(n,this.getAbsoluteValue2(s,a,h,this.get(n),this.setup(n),l))}else r=e.physicsConstraints[this.constraintIndex],r.active&&this.set(r,this.getAbsoluteValue(s,a,h,this.get(r),this.setup(r)))}},Os=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Ns=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},_s=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},qs=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintMass)}setup(e){return 1/e.data.massInverse}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},Us=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},Ws=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},zs=class extends fe{constructor(e,t,s,i){super(e,t,s,q.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},ts=class extends J{constraintIndex;constructor(e,t){super(e,ts.propertyIds),this.constraintIndex=t}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t}apply(e,t,s,i,a,h,o){let r;if(this.constraintIndex!=-1&&(r=e.physicsConstraints[this.constraintIndex],!r.active))return;const l=this.frames;if(t>s)this.apply(e,t,Number.MAX_VALUE,[],a,h,o),t=-1;else if(t>=l[l.length-1])return;if(!(s<l[0])&&(t<l[0]||s>=l[J.search1(l,t)+1]))if(r!=null)r.reset();else for(const n of e.physicsConstraints)n.active&&n.reset()}},ss=ts;B(ss,"propertyIds",[q.physicsConstraintReset.toString()]);var ue=class extends J{slotIndex;attachment;constructor(e,t,s){super(e,[q.sequence+"|"+t+"|"+s.sequence.id]),this.slotIndex=t,this.attachment=s}getFrameEntries(){return ue.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,t,s,i,a){let h=this.frames;e*=ue.ENTRIES,h[e]=t,h[e+ue.MODE]=s|i<<4,h[e+ue.DELAY]=a}apply(e,t,s,i,a,h,o){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let l=r.attachment,n=this.attachment;if(l!=n&&(!(l instanceof ae)||l.timelineAttachment!=n))return;let c=this.frames;if(s<c[0]){(h==0||h==1)&&(r.sequenceIndex=-1);return}let f=J.search(c,s,ue.ENTRIES),d=c[f],u=c[f+ue.MODE],g=c[f+ue.DELAY];if(!this.attachment.sequence)return;let x=u>>4,b=this.attachment.sequence.regions.length,v=Jt[u&15];if(v!=0)switch(x+=(s-d)/g+1e-5|0,v){case 1:x=Math.min(b-1,x);break;case 2:x%=b;break;case 3:{let w=(b<<1)-2;x=w==0?0:x%w,x>=b&&(x=w-x);break}case 4:x=Math.max(b-1-x,0);break;case 5:x=b-1-x%b;break;case 6:{let w=(b<<1)-2;x=w==0?0:(x+b-1)%w,x>=b&&(x=w-x)}}r.sequenceIndex=x}},Ae=ue;B(Ae,"ENTRIES",3),B(Ae,"MODE",1),B(Ae,"DELAY",2);var Le=class{static emptyAnimation(){return Le._emptyAnimation}data;tracks=new Array;timeScale=1;unkeyedState=0;events=new Array;listeners=new Array;queue=new as(this);propertyIDs=new Qe;animationsChanged=!1;trackEntryPool=new Me(()=>new is);constructor(e){this.data=e}update(e){e*=this.timeScale;let t=this.tracks;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(!a)continue;a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast;let h=e*a.timeScale;if(a.delay>0){if(a.delay-=h,a.delay>0)continue;h=-a.delay,a.delay=0}let o=a.next;if(o){let r=a.trackLast-o.delay;if(r>=0){for(o.delay=0,o.trackTime+=a.timeScale==0?0:(r/a.timeScale+e)*o.timeScale,a.trackTime+=h,this.setCurrent(s,o,!0);o.mixingFrom;)o.mixTime+=e,o=o.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&!a.mixingFrom){t[s]=null,this.queue.end(a),this.clearNext(a);continue}if(a.mixingFrom&&this.updateMixingFrom(a,e)){let r=a.mixingFrom;for(a.mixingFrom=null,r&&(r.mixingTo=null);r;)this.queue.end(r),r=r.mixingFrom}a.trackTime+=h}this.queue.drain()}updateMixingFrom(e,t){let s=e.mixingFrom;if(!s)return!0;let i=this.updateMixingFrom(s,t);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((s.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=s.mixingFrom,s.mixingFrom&&(s.mixingFrom.mixingTo=e),e.interruptAlpha=s.interruptAlpha,this.queue.end(s)),i):(s.trackTime+=t*s.timeScale,e.mixTime+=t,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let t=this.events,s=this.tracks,i=!1;for(let f=0,d=s.length;f<d;f++){let u=s[f];if(!u||u.delay>0)continue;i=!0;let g=f==0?1:u.mixBlend,x=u.alpha;u.mixingFrom?x*=this.applyMixingFrom(u,e,g):u.trackTime>=u.trackEnd&&!u.next&&(x=0);let b=x>=u.alphaAttachmentThreshold,v=u.animationLast,w=u.getAnimationTime(),m=w,p=t;u.reverse&&(m=u.animation.duration-m,p=null);let y=u.animation.timelines,A=y.length;if(f==0&&x==1||g==3){f==0&&(b=!0);for(let S=0;S<A;S++){P.webkit602BugfixHelper(x,g);var a=y[S];a instanceof be?this.applyAttachmentTimeline(a,e,m,g,b):a.apply(e,v,m,p,x,g,0)}}else{let S=u.timelineMode,I=u.shortestRotation,T=!I&&u.timelinesRotation.length!=A<<1;T&&(u.timelinesRotation.length=A<<1);for(let Y=0;Y<A;Y++){let E=y[Y],X=S[Y]==De?g:0;!I&&E instanceof Ye?this.applyRotateTimeline(E,e,m,x,X,u.timelinesRotation,Y<<1,T):E instanceof be?this.applyAttachmentTimeline(E,e,m,g,b):(P.webkit602BugfixHelper(x,g),E.apply(e,v,m,p,x,X,0))}}this.queueEvents(u,w),t.length=0,u.nextAnimationLast=w,u.nextTrackLast=u.trackTime}for(var h=this.unkeyedState+St,o=e.slots,r=0,l=e.slots.length;r<l;r++){var n=o[r];if(n.attachmentState==h){var c=n.data.attachmentName;n.setAttachment(c?e.getAttachment(n.data.index,c):null)}}return this.unkeyedState+=2,this.queue.drain(),i}applyMixingFrom(e,t,s){let i=e.mixingFrom;i.mixingFrom&&this.applyMixingFrom(i,t,s);let a=0;e.mixDuration==0?(a=1,s==1&&(s=0)):(a=e.mixTime/e.mixDuration,a>1&&(a=1),s!=1&&(s=i.mixBlend));let h=a<i.mixAttachmentThreshold,o=a<i.mixDrawOrderThreshold,r=i.animation.timelines,l=r.length,n=i.alpha*e.interruptAlpha,c=n*(1-a),f=i.animationLast,d=i.getAnimationTime(),u=d,g=null;if(i.reverse?u=i.animation.duration-u:a<i.eventThreshold&&(g=this.events),s==3)for(let x=0;x<l;x++)r[x].apply(t,f,u,g,c,s,1);else{let x=i.timelineMode,b=i.timelineHoldMix,v=i.shortestRotation,w=!v&&i.timelinesRotation.length!=l<<1;w&&(i.timelinesRotation.length=l<<1),i.totalAlpha=0;for(let m=0;m<l;m++){let p=r[m],y=1,A,S=0;switch(x[m]){case De:if(!o&&p instanceof pe)continue;A=s,S=c;break;case vt:A=0,S=c;break;case At:A=s,S=n;break;case Oe:A=0,S=n;break;default:A=0;let I=b[m];S=n*Math.max(0,1-I.mixTime/I.mixDuration);break}i.totalAlpha+=S,!v&&p instanceof Ye?this.applyRotateTimeline(p,t,u,S,A,i.timelinesRotation,m<<1,w):p instanceof be?this.applyAttachmentTimeline(p,t,u,A,h&&S>=i.alphaAttachmentThreshold):(P.webkit602BugfixHelper(S,s),o&&p instanceof pe&&A==0&&(y=0),p.apply(t,f,u,g,S,A,y))}}return e.mixDuration>0&&this.queueEvents(i,d),this.events.length=0,i.nextAnimationLast=d,i.nextTrackLast=i.trackTime,a}applyAttachmentTimeline(e,t,s,i,a){var h=t.slots[e.slotIndex];h.bone.active&&(s<e.frames[0]?(i==0||i==1)&&this.setAttachment(t,h,h.data.attachmentName,a):this.setAttachment(t,h,e.attachmentNames[J.search1(e.frames,s)],a),h.attachmentState<=this.unkeyedState&&(h.attachmentState=this.unkeyedState+St))}setAttachment(e,t,s,i){t.setAttachment(s?e.getAttachment(t.data.index,s):null),i&&(t.attachmentState=this.unkeyedState+ls)}applyRotateTimeline(e,t,s,i,a,h,o,r){if(r&&(h[o]=0),i==1){e.apply(t,0,s,null,1,a,0);return}let l=t.bones[e.boneIndex];if(!l.active)return;let n=e.frames,c=0,f=0;if(s<n[0])switch(a){case 0:l.rotation=l.data.rotation;default:return;case 1:c=l.rotation,f=l.data.rotation}else c=a==0?l.data.rotation:l.rotation,f=l.data.rotation+e.getCurveValue(s);let d=0,u=f-c;if(u-=Math.ceil(u/360-.5)*360,u==0)d=h[o];else{let g=0,x=0;r?(g=0,x=u):(g=h[o],x=h[o+1]);let b=g-g%360;d=u+b;let v=u>=0,w=g>=0;Math.abs(x)<=90&&F.signum(x)!=F.signum(u)&&(Math.abs(g-b)>180?(d+=360*F.signum(g),w=v):b!=0?d-=360*F.signum(g):w=v),w!=v&&(d+=360*F.signum(g)),h[o]=d}h[o+1]=u,l.rotation=c+d*i}queueEvents(e,t){let s=e.animationStart,i=e.animationEnd,a=i-s,h=e.trackLast%a,o=this.events,r=0,l=o.length;for(;r<l;r++){let c=o[r];if(c.time<h)break;c.time>i||this.queue.event(e,c)}let n=!1;for(e.loop?n=a==0||h>e.trackTime%a:n=t>=i&&e.animationLast<i,n&&this.queue.complete(e);r<l;r++){let c=o[r];c.time<s||this.queue.event(e,c)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,s=this.tracks.length;t<s;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let t=this.tracks[e];if(!t)return;this.queue.end(t),this.clearNext(t);let s=t;for(;;){let i=s.mixingFrom;if(!i)break;this.queue.end(i),s.mixingFrom=null,s.mixingTo=null,s=i}this.tracks[t.trackIndex]=null,this.queue.drain()}setCurrent(e,t,s){let i=this.expandToIndex(e);this.tracks[e]=t,t.previous=null,i&&(s&&this.queue.interrupt(i),t.mixingFrom=i,i.mixingTo=t,t.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(t.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(t)}setAnimation(e,t,s=!1){let i=this.data.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);return this.setAnimationWith(e,i,s)}setAnimationWith(e,t,s=!1){if(!t)throw new Error("animation cannot be null.");let i=!0,a=this.expandToIndex(e);a&&(a.nextTrackLast==-1?(this.tracks[e]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.clearNext(a),a=a.mixingFrom,i=!1):this.clearNext(a));let h=this.trackEntry(e,t,s,a);return this.setCurrent(e,h,i),this.queue.drain(),h}addAnimation(e,t,s=!1,i=0){let a=this.data.skeletonData.findAnimation(t);if(!a)throw new Error("Animation not found: "+t);return this.addAnimationWith(e,a,s,i)}addAnimationWith(e,t,s=!1,i=0){if(!t)throw new Error("animation cannot be null.");let a=this.expandToIndex(e);if(a)for(;a.next;)a=a.next;let h=this.trackEntry(e,t,s,a);return a?(a.next=h,h.previous=a,i<=0&&(i+=a.getTrackComplete()-h.mixDuration)):(this.setCurrent(e,h,!0),this.queue.drain()),h.delay=i,h}setEmptyAnimation(e,t=0){let s=this.setAnimationWith(e,Le.emptyAnimation(),!1);return s.mixDuration=t,s.trackEnd=t,s}addEmptyAnimation(e,t=0,s=0){let i=this.addAnimationWith(e,Le.emptyAnimation(),!1,s);return s<=0&&(i.delay+=i.mixDuration-t),i.mixDuration=t,i.trackEnd=t,i}setEmptyAnimations(e=0){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,i=this.tracks.length;s<i;s++){let a=this.tracks[s];a&&this.setEmptyAnimation(a.trackIndex,e)}this.queue.drainDisabled=t,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(P.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,t,s,i){let a=this.trackEntryPool.obtain();return a.reset(),a.trackIndex=e,a.animation=t,a.loop=s,a.holdPrevious=!1,a.reverse=!1,a.shortestRotation=!1,a.eventThreshold=0,a.alphaAttachmentThreshold=0,a.mixAttachmentThreshold=0,a.mixDrawOrderThreshold=0,a.animationStart=0,a.animationEnd=t.duration,a.animationLast=-1,a.nextAnimationLast=-1,a.delay=0,a.trackTime=0,a.trackLast=-1,a.nextTrackLast=-1,a.trackEnd=Number.MAX_VALUE,a.timeScale=1,a.alpha=1,a.mixTime=0,a.mixDuration=i?this.data.getMix(i.animation,t):0,a.interruptAlpha=1,a.totalAlpha=0,a.mixBlend=2,a}clearNext(e){let t=e.next;for(;t;)this.queue.dispose(t),t=t.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let t=0,s=e.length;t<s;t++){let i=e[t];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do(!i.mixingTo||i.mixBlend!=3)&&this.computeHold(i),i=i.mixingTo;while(i)}}}computeHold(e){let t=e.mixingTo,s=e.animation.timelines,i=e.animation.timelines.length,a=e.timelineMode;a.length=i;let h=e.timelineHoldMix;h.length=0;let o=this.propertyIDs;if(t&&t.holdPrevious){for(let r=0;r<i;r++)a[r]=o.addAll(s[r].getPropertyIds())?Oe:At;return}e:for(let r=0;r<i;r++){let l=s[r],n=l.getPropertyIds();if(!o.addAll(n))a[r]=De;else if(!t||l instanceof be||l instanceof pe||l instanceof Xe||!t.animation.hasTimeline(n))a[r]=vt;else{for(let c=t.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(n)){if(e.mixDuration>0){a[r]=ns,h[r]=c;continue e}break}a[r]=Oe}}}getCurrent(e){return e>=this.tracks.length?null:this.tracks[e]}addListener(e){if(!e)throw new Error("listener cannot be null.");this.listeners.push(e)}removeListener(e){let t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},rs=Le;B(rs,"_emptyAnimation",new Be("<empty>",[],0));var is=class{animation=null;previous=null;next=null;mixingFrom=null;mixingTo=null;listener=null;trackIndex=0;loop=!1;holdPrevious=!1;reverse=!1;shortestRotation=!1;eventThreshold=0;mixAttachmentThreshold=0;alphaAttachmentThreshold=0;mixDrawOrderThreshold=0;animationStart=0;animationEnd=0;animationLast=0;nextAnimationLast=0;delay=0;trackTime=0;trackLast=0;nextTrackLast=0;trackEnd=0;timeScale=0;alpha=0;mixTime=0;_mixDuration=0;interruptAlpha=0;totalAlpha=0;get mixDuration(){return this._mixDuration}set mixDuration(e){this._mixDuration=e,this.previous!=null&&this.delay<=0&&(this.delay+=this.previous.getTrackComplete()-e),this.delay=this.delay}mixBlend=2;timelineMode=new Array;timelineHoldMix=new Array;timelinesRotation=new Array;reset(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}getAnimationTime(){if(this.loop){let e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(e){this.animationLast=e,this.nextAnimationLast=e}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let e=this.animationEnd-this.animationStart;if(e!=0){if(this.loop)return e*(1+(this.trackTime/e|0));if(this.trackTime<e)return e}return this.trackTime}wasApplied(){return this.nextTrackLast!=-1}},as=class{objects=[];drainDisabled=!1;animState;constructor(e){this.animState=e}start(e){this.objects.push(Z.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Z.interrupt),this.objects.push(e)}end(e){this.objects.push(Z.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Z.dispose),this.objects.push(e)}complete(e){this.objects.push(Z.complete),this.objects.push(e)}event(e,t){this.objects.push(Z.event),this.objects.push(e),this.objects.push(t)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,t=this.animState.listeners;for(let s=0;s<e.length;s+=2){let i=e[s],a=e[s+1];switch(i){case Z.start:a.listener&&a.listener.start&&a.listener.start(a);for(let o=0;o<t.length;o++){let r=t[o];r.start&&r.start(a)}break;case Z.interrupt:a.listener&&a.listener.interrupt&&a.listener.interrupt(a);for(let o=0;o<t.length;o++){let r=t[o];r.interrupt&&r.interrupt(a)}break;case Z.end:a.listener&&a.listener.end&&a.listener.end(a);for(let o=0;o<t.length;o++){let r=t[o];r.end&&r.end(a)}case Z.dispose:a.listener&&a.listener.dispose&&a.listener.dispose(a);for(let o=0;o<t.length;o++){let r=t[o];r.dispose&&r.dispose(a)}this.animState.trackEntryPool.free(a);break;case Z.complete:a.listener&&a.listener.complete&&a.listener.complete(a);for(let o=0;o<t.length;o++){let r=t[o];r.complete&&r.complete(a)}break;case Z.event:let h=e[s+++2];a.listener&&a.listener.event&&a.listener.event(a,h);for(let o=0;o<t.length;o++){let r=t[o];r.event&&r.event(a,h)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Z=(e=>(e[e.start=0]="start",e[e.interrupt=1]="interrupt",e[e.end=2]="end",e[e.dispose=3]="dispose",e[e.complete=4]="complete",e[e.event=5]="event",e))(Z||{}),$s=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},De=0,vt=1,At=2,Oe=3,ns=4,St=1,ls=2,Hs=class{skeletonData;animationToMixTime={};defaultMix=0;constructor(e){if(!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,t,s){let i=this.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);let a=this.skeletonData.findAnimation(t);if(!a)throw new Error("Animation not found: "+t);this.setMixWith(i,a,s)}setMixWith(e,t,s){if(!e)throw new Error("from cannot be null.");if(!t)throw new Error("to cannot be null.");let i=e.name+"."+t.name;this.animationToMixTime[i]=s}getMix(e,t){let s=e.name+"."+t.name,i=this.animationToMixTime[s];return i===void 0?this.defaultMix:i}},Ne=class extends ae{color=new O(1,1,1,1);constructor(e){super(e)}copy(){let e=new Ne(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},Ct=class extends ae{endSlot=null;color=new O(.2275,.2275,.8078,1);constructor(e){super(e)}copy(){let e=new Ct(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},It=class{_image;constructor(e){this._image=e}getImage(){return this._image}},_e=(e=>(e[e.Nearest=9728]="Nearest",e[e.Linear=9729]="Linear",e[e.MipMap=9987]="MipMap",e[e.MipMapNearestNearest=9984]="MipMapNearestNearest",e[e.MipMapLinearNearest=9985]="MipMapLinearNearest",e[e.MipMapNearestLinear=9986]="MipMapNearestLinear",e[e.MipMapLinearLinear=9987]="MipMapLinearLinear",e))(_e||{}),os=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(os||{}),hs=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},Gs=class extends It{setFilters(e,t){}setWraps(e,t){}dispose(){}},cs=class{pages=new Array;regions=new Array;constructor(e){let t=new js(e),s=new Array(4),i={};i.size=n=>{n.width=parseInt(s[1]),n.height=parseInt(s[2])},i.format=()=>{},i.filter=n=>{n.minFilter=P.enumValue(_e,s[1]),n.magFilter=P.enumValue(_e,s[2])},i.repeat=n=>{s[1].indexOf("x")!=-1&&(n.uWrap=10497),s[1].indexOf("y")!=-1&&(n.vWrap=10497)},i.pma=n=>{n.pma=s[1]=="true"};var a={};a.xy=n=>{n.x=parseInt(s[1]),n.y=parseInt(s[2])},a.size=n=>{n.width=parseInt(s[1]),n.height=parseInt(s[2])},a.bounds=n=>{n.x=parseInt(s[1]),n.y=parseInt(s[2]),n.width=parseInt(s[3]),n.height=parseInt(s[4])},a.offset=n=>{n.offsetX=parseInt(s[1]),n.offsetY=parseInt(s[2])},a.orig=n=>{n.originalWidth=parseInt(s[1]),n.originalHeight=parseInt(s[2])},a.offsets=n=>{n.offsetX=parseInt(s[1]),n.offsetY=parseInt(s[2]),n.originalWidth=parseInt(s[3]),n.originalHeight=parseInt(s[4])},a.rotate=n=>{let c=s[1];c=="true"?n.degrees=90:c!="false"&&(n.degrees=parseInt(c))},a.index=n=>{n.index=parseInt(s[1])};let h=t.readLine();for(;h&&h.trim().length==0;)h=t.readLine();for(;!(!h||h.trim().length==0||t.readEntry(s,h)==0);)h=t.readLine();let o=null,r=null,l=null;for(;h!==null;)if(h.trim().length==0)o=null,h=t.readLine();else if(o){let n=new kt(o,h);for(;;){let c=t.readEntry(s,h=t.readLine());if(c==0)break;let f=a[s[0]];if(f)f(n);else{r||(r=[]),l||(l=[]),r.push(s[0]);let d=[];for(let u=0;u<c;u++)d.push(parseInt(s[u+1]));l.push(d)}}n.originalWidth==0&&n.originalHeight==0&&(n.originalWidth=n.width,n.originalHeight=n.height),r&&r.length>0&&l&&l.length>0&&(n.names=r,n.values=l,r=null,l=null),n.u=n.x/o.width,n.v=n.y/o.height,n.degrees==90?(n.u2=(n.x+n.height)/o.width,n.v2=(n.y+n.width)/o.height):(n.u2=(n.x+n.width)/o.width,n.v2=(n.y+n.height)/o.height),this.regions.push(n)}else{for(o=new ds(h.trim());t.readEntry(s,h=t.readLine())!=0;){let n=i[s[0]];n&&n(o)}this.pages.push(o)}}findRegion(e){for(let t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null}setTextures(e,t=""){for(let s of this.pages)s.setTexture(e.get(t+s.name))}dispose(){for(let e=0;e<this.pages.length;e++)this.pages[e].texture?.dispose()}},js=class{lines;index=0;constructor(e){this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,t){if(!t||(t=t.trim(),t.length==0))return 0;let s=t.indexOf(":");if(s==-1)return 0;e[0]=t.substr(0,s).trim();for(let i=1,a=s+1;;i++){let h=t.indexOf(",",a);if(h==-1)return e[i]=t.substr(a).trim(),i;if(e[i]=t.substr(a,h-a).trim(),a=h+1,i==4)return 4}}},ds=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=new Array;constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let t of this.regions)t.texture=e}},kt=class extends hs{page;name;x=0;y=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0;index=0;degrees=0;names=null;values=null;constructor(e,t){super(),this.page=e,this.name=t,e.regions.push(this)}},ye=class extends ae{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new O(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new O(0,0,0,0);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.regionUVs;(!this.uvs||this.uvs.length!=e.length)&&(this.uvs=P.newFloatArray(e.length));let t=this.uvs,s=this.uvs.length,i=this.region.u,a=this.region.v,h=0,o=0;if(this.region instanceof kt){let r=this.region,l=r.page,n=l.width,c=l.height;switch(r.degrees){case 90:i-=(r.originalHeight-r.offsetY-r.height)/n,a-=(r.originalWidth-r.offsetX-r.width)/c,h=r.originalHeight/n,o=r.originalWidth/c;for(let f=0;f<s;f+=2)t[f]=i+e[f+1]*h,t[f+1]=a+(1-e[f])*o;return;case 180:i-=(r.originalWidth-r.offsetX-r.width)/n,a-=r.offsetY/c,h=r.originalWidth/n,o=r.originalHeight/c;for(let f=0;f<s;f+=2)t[f]=i+(1-e[f])*h,t[f+1]=a+(1-e[f+1])*o;return;case 270:i-=r.offsetY/n,a-=r.offsetX/c,h=r.originalHeight/n,o=r.originalWidth/c;for(let f=0;f<s;f+=2)t[f]=i+(1-e[f+1])*h,t[f+1]=a+e[f]*o;return}i-=r.offsetX/n,a-=(r.originalHeight-r.offsetY-r.height)/c,h=r.originalWidth/n,o=r.originalHeight/c}else this.region?(h=this.region.u2-i,o=this.region.v2-a):(i=a=0,h=o=1);for(let r=0;r<s;r+=2)t[r]=i+e[r]*h,t[r+1]=a+e[r+1]*o}getParentMesh(){return this.parentMesh}setParentMesh(e){this.parentMesh=e,e&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)}copy(){if(this.parentMesh)return this.newLinkedMesh();let e=new ye(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),P.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),P.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),P.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,e.sequence=this.sequence!=null?this.sequence.copy():null,this.edges&&(e.edges=new Array(this.edges.length),P.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e}computeWorldVertices(e,t,s,i,a,h){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,t,s,i,a,h)}newLinkedMesh(){let e=new ye(this.name,this.path);return e.region=this.region,e.color.setFromColor(this.color),e.timelineAttachment=this.timelineAttachment,e.setParentMesh(this.parentMesh?this.parentMesh:this),e.region!=null&&e.updateRegion(),e}},Se=class extends ae{lengths=[];closed=!1;constantSpeed=!1;color=new O(1,1,1,1);constructor(e){super(e)}copy(){let e=new Se(this.name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),P.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e}},Tt=class extends ae{x=0;y=0;rotation=0;color=new O(.38,.94,0,1);constructor(e){super(e)}computeWorldPosition(e,t){return t.x=this.x*e.a+this.y*e.b+e.worldX,t.y=this.x*e.c+this.y*e.d+e.worldY,t}computeWorldRotation(e){const t=this.rotation*F.degRad,s=Math.cos(t),i=Math.sin(t),a=s*e.a+i*e.b,h=s*e.c+i*e.d;return F.atan2Deg(h,a)}copy(){let e=new Tt(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},fs=class extends Ze{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new O(1,1,1,1);path;region=null;sequence=null;offset=P.newFloatArray(8);uvs=P.newFloatArray(8);tempColor=new O(1,1,1,1);constructor(e,t){super(e),this.path=t}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.region,t=this.uvs;if(e==null){t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=1,t[5]=1,t[6]=1,t[7]=0;return}let s=this.width/this.region.originalWidth*this.scaleX,i=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*s,h=-this.height/2*this.scaleY+this.region.offsetY*i,o=a+this.region.width*s,r=h+this.region.height*i,l=this.rotation*F.degRad,n=Math.cos(l),c=Math.sin(l),f=this.x,d=this.y,u=a*n+f,g=a*c,x=h*n+d,b=h*c,v=o*n+f,w=o*c,m=r*n+d,p=r*c,y=this.offset;y[0]=u-b,y[1]=x+g,y[2]=u-p,y[3]=m+g,y[4]=v-p,y[5]=m+w,y[6]=v-b,y[7]=x+w,e.degrees==90?(t[0]=e.u2,t[1]=e.v2,t[2]=e.u,t[3]=e.v2,t[4]=e.u,t[5]=e.v,t[6]=e.u2,t[7]=e.v):(t[0]=e.u,t[1]=e.v2,t[2]=e.u,t[3]=e.v,t[4]=e.u2,t[5]=e.v,t[6]=e.u2,t[7]=e.v2)}computeWorldVertices(e,t,s,i){this.sequence!=null&&this.sequence.apply(e,this);let a=e.bone,h=this.offset,o=a.worldX,r=a.worldY,l=a.a,n=a.b,c=a.c,f=a.d,d=0,u=0;d=h[0],u=h[1],t[s]=d*l+u*n+o,t[s+1]=d*c+u*f+r,s+=i,d=h[2],u=h[3],t[s]=d*l+u*n+o,t[s+1]=d*c+u*f+r,s+=i,d=h[4],u=h[5],t[s]=d*l+u*n+o,t[s+1]=d*c+u*f+r,s+=i,d=h[6],u=h[7],t[s]=d*l+u*n+o,t[s+1]=d*c+u*f+r}copy(){let e=new fs(this.name,this.path);return e.region=this.region,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,P.arrayCopy(this.uvs,0,e.uvs,0,8),P.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e.sequence=this.sequence!=null?this.sequence.copy():null,e}},V=fs;B(V,"X1",0),B(V,"Y1",1),B(V,"C1R",2),B(V,"C1G",3),B(V,"C1B",4),B(V,"C1A",5),B(V,"U1",6),B(V,"V1",7),B(V,"X2",8),B(V,"Y2",9),B(V,"C2R",10),B(V,"C2G",11),B(V,"C2B",12),B(V,"C2A",13),B(V,"U2",14),B(V,"V2",15),B(V,"X3",16),B(V,"Y3",17),B(V,"C3R",18),B(V,"C3G",19),B(V,"C3B",20),B(V,"C3A",21),B(V,"U3",22),B(V,"V3",23),B(V,"X4",24),B(V,"Y4",25),B(V,"C4R",26),B(V,"C4G",27),B(V,"C4B",28),B(V,"C4A",29),B(V,"U4",30),B(V,"V4",31);var Js=class{atlas;constructor(e){this.atlas=e}loadSequence(e,t,s){let i=s.regions;for(let a=0,h=i.length;a<h;a++){let o=s.getPath(t,a),r=this.atlas.findRegion(o);if(r==null)throw new Error("Region not found in atlas: "+o+" (sequence: "+e+")");i[a]=r}}newRegionAttachment(e,t,s,i){let a=new V(t,s);if(i!=null)this.loadSequence(t,s,i);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (region attachment: "+t+")");a.region=h}return a}newMeshAttachment(e,t,s,i){let a=new ye(t,s);if(i!=null)this.loadSequence(t,s,i);else{let h=this.atlas.findRegion(s);if(!h)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+t+")");a.region=h}return a}newBoundingBoxAttachment(e,t){return new Ne(t)}newPathAttachment(e,t){return new Se(t)}newPointAttachment(e,t){return new Tt(t)}newClippingAttachment(e,t){return new Ct(t)}},Mt=class{index=0;name;parent=null;length=0;x=0;y=0;rotation=0;scaleX=1;scaleY=1;shearX=0;shearY=0;transformMode=qe.Normal;skinRequired=!1;color=new O;icon;visible=!1;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");this.index=e,this.name=t,this.parent=s}},qe=(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",e))(qe||{}),Yt=class{data;skeleton;parent=null;children=new Array;x=0;y=0;rotation=0;scaleX=0;scaleY=0;shearX=0;shearY=0;ax=0;ay=0;arotation=0;ascaleX=0;ascaleY=0;ashearX=0;ashearY=0;a=0;b=0;c=0;d=0;worldY=0;worldX=0;sorted=!1;active=!1;constructor(e,t,s){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=t,this.parent=s,this.setToSetupPose()}isActive(){return this.active}update(e){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}updateWorldTransform(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}updateWorldTransformWith(e,t,s,i,a,h,o){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=i,this.ascaleY=a,this.ashearX=h,this.ashearY=o;let r=this.parent;if(!r){let d=this.skeleton;const u=d.scaleX,g=d.scaleY,x=(s+h)*F.degRad,b=(s+90+o)*F.degRad;this.a=Math.cos(x)*i*u,this.b=Math.cos(b)*a*u,this.c=Math.sin(x)*i*g,this.d=Math.sin(b)*a*g,this.worldX=e*u+d.x,this.worldY=t*g+d.y;return}let l=r.a,n=r.b,c=r.c,f=r.d;switch(this.worldX=l*e+n*t+r.worldX,this.worldY=c*e+f*t+r.worldY,this.data.transformMode){case 0:{const d=(s+h)*F.degRad,u=(s+90+o)*F.degRad,g=Math.cos(d)*i,x=Math.cos(u)*a,b=Math.sin(d)*i,v=Math.sin(u)*a;this.a=l*g+n*b,this.b=l*x+n*v,this.c=c*g+f*b,this.d=c*x+f*v;return}case 1:{const d=(s+h)*F.degRad,u=(s+90+o)*F.degRad;this.a=Math.cos(d)*i,this.b=Math.cos(u)*a,this.c=Math.sin(d)*i,this.d=Math.sin(u)*a;break}case 2:{let d=l*l+c*c,u=0;d>1e-4?(d=Math.abs(l*f-n*c)/d,l/=this.skeleton.scaleX,c/=this.skeleton.scaleY,n=c*d,f=l*d,u=Math.atan2(c,l)*F.radDeg):(l=0,c=0,u=90-Math.atan2(f,n)*F.radDeg);const g=(s+h-u)*F.degRad,x=(s+o-u+90)*F.degRad,b=Math.cos(g)*i,v=Math.cos(x)*a,w=Math.sin(g)*i,m=Math.sin(x)*a;this.a=l*b-n*w,this.b=l*v-n*m,this.c=c*b+f*w,this.d=c*v+f*m;break}case 3:case 4:{s*=F.degRad;const d=Math.cos(s),u=Math.sin(s);let g=(l*d+n*u)/this.skeleton.scaleX,x=(c*d+f*u)/this.skeleton.scaleY,b=Math.sqrt(g*g+x*x);b>1e-5&&(b=1/b),g*=b,x*=b,b=Math.sqrt(g*g+x*x),this.data.transformMode==3&&l*f-n*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(b=-b),s=Math.PI/2+Math.atan2(x,g);const v=Math.cos(s)*b,w=Math.sin(s)*b;h*=F.degRad,o=(90+o)*F.degRad;const m=Math.cos(h)*i,p=Math.cos(o)*a,y=Math.sin(h)*i,A=Math.sin(o)*a;this.a=g*m+v*y,this.b=g*p+v*A,this.c=x*m+w*y,this.d=x*p+w*A;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}updateAppliedTransform(){let e=this.parent;if(!e){this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*F.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)*F.radDeg;return}let t=e.a,s=e.b,i=e.c,a=e.d,h=1/(t*a-s*i),o=a*h,r=s*h,l=i*h,n=t*h,c=this.worldX-e.worldX,f=this.worldY-e.worldY;this.ax=c*o-f*r,this.ay=f*n-c*l;let d,u,g,x;if(this.data.transformMode==1)d=this.a,u=this.b,g=this.c,x=this.d;else{switch(this.data.transformMode){case 2:{let p=Math.abs(t*a-s*i)/(t*t+i*i),y=t/this.skeleton.scaleX;s=-(i/this.skeleton.scaleY)*p*this.skeleton.scaleX,a=y*p*this.skeleton.scaleY,h=1/(t*a-s*i),o=a*h,r=s*h;break}case 3:case 4:let b=F.cosDeg(this.rotation),v=F.sinDeg(this.rotation);t=(t*b+s*v)/this.skeleton.scaleX,i=(i*b+a*v)/this.skeleton.scaleY;let w=Math.sqrt(t*t+i*i);w>1e-5&&(w=1/w),t*=w,i*=w,w=Math.sqrt(t*t+i*i),this.data.transformMode==3&&h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(w=-w);let m=F.PI/2+Math.atan2(i,t);s=Math.cos(m)*w,a=Math.sin(m)*w,h=1/(t*a-s*i),o=a*h,r=s*h,l=i*h,n=t*h}d=o*this.a-r*this.c,u=o*this.b-r*this.d,g=n*this.c-l*this.a,x=n*this.d-l*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+g*g),this.ascaleX>1e-4){let b=d*x-u*g;this.ascaleY=b/this.ascaleX,this.ashearY=-Math.atan2(d*u+g*x,b)*F.radDeg,this.arotation=Math.atan2(g,d)*F.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+x*x),this.ashearY=0,this.arotation=90-Math.atan2(x,u)*F.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*F.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*F.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)}worldToLocal(e){let t=1/(this.a*this.d-this.b*this.c),s=e.x-this.worldX,i=e.y-this.worldY;return e.x=s*this.d*t-i*this.b*t,e.y=i*this.a*t-s*this.c*t,e}localToWorld(e){let t=e.x,s=e.y;return e.x=t*this.a+s*this.b+this.worldX,e.y=t*this.c+s*this.d+this.worldY,e}worldToParent(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.worldToLocal(e)}parentToWorld(e){if(e==null)throw new Error("world cannot be null.");return this.parent==null?e:this.parent.localToWorld(e)}worldToLocalRotation(e){let t=F.sinDeg(e),s=F.cosDeg(e);return Math.atan2(this.a*t-this.c*s,this.d*s-this.b*t)*F.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let t=F.sinDeg(e),s=F.cosDeg(e);return Math.atan2(s*this.c+t*this.d,s*this.a+t*this.b)*F.radDeg}rotateWorld(e){e*=F.degRad;const t=Math.sin(e),s=Math.cos(e),i=this.a,a=this.b;this.a=s*i-t*this.c,this.b=s*a-t*this.d,this.c=t*i+s*this.c,this.d=t*a+s*this.d}},Ue=class{constructor(e,t,s){this.name=e,this.order=t,this.skinRequired=s}},us=class{pathPrefix="";textureLoader;downloader;assets={};errors={};toLoad=0;loaded=0;constructor(e,t="",s=new Xt){this.textureLoader=e,this.pathPrefix=t,this.downloader=s}start(e){return this.toLoad++,this.pathPrefix+e}success(e,t,s){this.toLoad--,this.loaded++,this.assets[t]=s,e&&e(t,s)}error(e,t,s){this.toLoad--,this.loaded++,this.errors[t]=s,e&&e(t,s)}loadAll(){return new Promise((t,s)=>{let i=()=>{if(this.isLoadingComplete()){this.hasErrors()?s(this.errors):t(this);return}requestAnimationFrame(i)};requestAnimationFrame(i)})}setRawDataURI(e,t){this.downloader.rawDataUris[this.pathPrefix+e]=t}loadBinary(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadBinary(e,i=>{this.success(t,e,i)},(i,a)=>{this.error(s,e,`Couldn't load binary ${e}: status ${i}, ${a}`)})}loadText(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadText(e,i=>{this.success(t,e,i)},(i,a)=>{this.error(s,e,`Couldn't load text ${e}: status ${i}, ${a}`)})}loadJson(e,t=()=>{},s=()=>{}){e=this.start(e),this.downloader.downloadJson(e,i=>{this.success(t,e,i)},(i,a)=>{this.error(s,e,`Couldn't load JSON ${e}: status ${i}, ${a}`)})}loadTexture(e,t=()=>{},s=()=>{}){if(e=this.start(e),!!!(typeof window<"u"&&typeof navigator<"u"&&window.document))fetch(e,{mode:"cors"}).then(h=>h.ok?h.blob():(this.error(s,e,`Couldn't load image: ${e}`),null)).then(h=>h?createImageBitmap(h,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(h=>{h&&this.success(t,e,this.textureLoader(h))});else{let h=new Image;h.crossOrigin="anonymous",h.onload=()=>{this.success(t,e,this.textureLoader(h))},h.onerror=()=>{this.error(s,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),h.src=e}}loadTextureAtlas(e,t=()=>{},s=()=>{},i){let a=e.lastIndexOf("/"),h=a>=0?e.substring(0,a+1):"";e=this.start(e),this.downloader.downloadText(e,o=>{try{let r=new cs(o),l=r.pages.length,n=!1;for(let c of r.pages)this.loadTexture(i?i[c.name]:h+c.name,(f,d)=>{n||(c.setTexture(d),--l==0&&this.success(t,e,r))},(f,d)=>{n||this.error(s,e,`Couldn't load texture atlas ${e} page image: ${f}`),n=!0})}catch(r){this.error(s,e,`Couldn't parse texture atlas ${e}: ${r.message}`)}},(o,r)=>{this.error(s,e,`Couldn't load texture atlas ${e}: status ${o}, ${r}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let t=this.assets[e];if(t)return t;let s=this.errors[e];throw Error("Asset not found: "+e+(s?`
2
+ `+s:""))}remove(e){e=this.pathPrefix+e;let t=this.assets[e];return t.dispose&&t.dispose(),delete this.assets[e],t}removeAll(){for(let e in this.assets){let t=this.assets[e];t.dispose&&t.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}},Xt=class{callbacks={};rawDataUris={};dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");return t!=-1?(t+=7,atob(e.substr(t))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var t=window.atob(e),s=t.length,i=new Uint8Array(s),a=0;a<s;a++)i[a]=t.charCodeAt(a);return i}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let t=e.indexOf("base64,");if(t==-1)throw new Error("Not a binary data URI.");return t+=7,this.base64ToUint8Array(e.substr(t))}downloadText(e,t,s){if(this.start(e,t,s))return;if(this.rawDataUris[e]){try{let h=this.rawDataUris[e];this.finish(e,200,this.dataUriToString(h))}catch(h){this.finish(e,400,JSON.stringify(h))}return}let i=new XMLHttpRequest;i.overrideMimeType("text/html"),i.open("GET",e,!0);let a=()=>{this.finish(e,i.status,i.responseText)};i.onload=a,i.onerror=a,i.send()}downloadJson(e,t,s){this.downloadText(e,i=>{t(JSON.parse(i))},s)}downloadBinary(e,t,s){if(this.start(e,t,s))return;if(this.rawDataUris[e]){try{let h=this.rawDataUris[e];this.finish(e,200,this.dataUriToUint8Array(h))}catch(h){this.finish(e,400,JSON.stringify(h))}return}let i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer";let a=()=>{this.finish(e,i.status,i.response)};i.onload=()=>{i.status==200||i.status==0?this.finish(e,200,new Uint8Array(i.response)):a()},i.onerror=a,i.send()}start(e,t,s){let i=this.callbacks[e];try{if(i)return!0;this.callbacks[e]=i=[]}finally{i.push(t,s)}}finish(e,t,s){let i=this.callbacks[e];delete this.callbacks[e];let a=t==200||t==0?[s]:[t,s];for(let h=a.length-1,o=i.length;h<o;h+=2)i[h].apply(null,a)}},Ft=class{data;intValue=0;floatValue=0;stringValue=null;time=0;volume=0;balance=0;constructor(e,t){if(!t)throw new Error("data cannot be null.");this.time=e,this.data=t}},Rt=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},ms=class{data;bones;target;bendDirection=0;compress=!1;stretch=!1;mix=1;softness=0;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)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 i=0;i<e.bones.length;i++){let a=t.findBone(e.bones[i].name);if(!a)throw new Error(`Couldn't find bone ${e.bones[i].name}`);this.bones.push(a)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=s}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch}update(e){if(this.mix==0)return;let t=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,t,s,i,a,h,o){let r=e.parent;if(!r)throw new Error("IK bone must have parent.");let l=r.a,n=r.b,c=r.c,f=r.d,d=-e.ashearX-e.arotation,u=0,g=0;switch(e.data.transformMode){case 1:u=t-e.worldX,g=s-e.worldY;break;case 2:let v=Math.abs(l*f-n*c)/Math.max(1e-4,l*l+c*c),w=l/e.skeleton.scaleX,m=c/e.skeleton.scaleY;n=-m*v*e.skeleton.scaleX,f=w*v*e.skeleton.scaleY,d+=Math.atan2(m,w)*F.radDeg;default:let p=t-r.worldX,y=s-r.worldY,A=l*f-n*c;Math.abs(A)<=1e-4?(u=0,g=0):(u=(p*f-y*n)/A-e.ax,g=(y*l-p*c)/A-e.ay)}d+=Math.atan2(g,u)*F.radDeg,e.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360);let x=e.ascaleX,b=e.ascaleY;if(i||a){switch(e.data.transformMode){case 3:case 4:u=t-e.worldX,g=s-e.worldY}const v=e.data.length*x;if(v>1e-4){const w=u*u+g*g;if(i&&w<v*v||a&&w>v*v){const m=(Math.sqrt(w)/v-1)*o+1;x*=m,h&&(b*=m)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*o,x,b,e.ashearX,e.ashearY)}apply2(e,t,s,i,a,h,o,r,l){let n=e.ax,c=e.ay,f=e.ascaleX,d=e.ascaleY,u=f,g=d,x=t.ascaleX,b=0,v=0,w=0;f<0?(f=-f,b=180,w=-1):(b=0,w=1),d<0&&(d=-d,w=-w),x<0?(x=-x,v=180):v=0;let m=t.ax,p=0,y=0,A=0,S=e.a,I=e.b,T=e.c,Y=e.d,E=Math.abs(f-d)<=1e-4;!E||h?(p=0,y=S*m+e.worldX,A=T*m+e.worldY):(p=t.ay,y=S*m+I*p+e.worldX,A=T*m+Y*p+e.worldY);let X=e.parent;if(!X)throw new Error("IK parent must itself have a parent.");S=X.a,I=X.b,T=X.c,Y=X.d;let R=S*Y-I*T,k=y-X.worldX,M=A-X.worldY;R=Math.abs(R)<=1e-4?0:1/R;let L=(k*Y-M*I)*R-n,U=(M*S-k*T)*R-c,D=Math.sqrt(L*L+U*U),$=t.data.length*x,_,G;if(D<1e-4){this.apply1(e,s,i,!1,h,!1,l),t.updateWorldTransformWith(m,p,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}k=s-X.worldX,M=i-X.worldY;let W=(k*Y-M*I)*R-n,N=(M*S-k*T)*R-c,j=W*W+N*N;if(r!=0){r*=f*(x+1)*.5;let K=Math.sqrt(j),se=K-D-$*f+r;if(se>0){let re=Math.min(1,se/(r*2))-1;re=(se-r*(1-re*re))/K,W-=re*W,N-=re*N,j=W*W+N*N}}e:if(E){$*=f;let K=(j-D*D-$*$)/(2*D*$);K<-1?(K=-1,G=Math.PI*a):K>1?(K=1,G=0,h&&(S=(Math.sqrt(j)/(D+$)-1)*l+1,u*=S,o&&(g*=S))):G=Math.acos(K)*a,S=D+$*K,I=$*Math.sin(G),_=Math.atan2(N*S-W*I,W*S+N*I)}else{S=f*$,I=d*$;let K=S*S,se=I*I,re=Math.atan2(N,W);T=se*D*D+K*j-K*se;let xe=-2*se*D,Ie=se-K;if(Y=xe*xe-4*Ie*T,Y>=0){let ke=Math.sqrt(Y);xe<0&&(ke=-ke),ke=-(xe+ke)*.5;let Is=ke/Ie,ks=T/ke,Te=Math.abs(Is)<Math.abs(ks)?Is:ks;if(Te*Te<=j){M=Math.sqrt(j-Te*Te)*a,_=re-Math.atan2(M,Te),G=Math.atan2(M/d,(Te-D)/f);break e}}let Fe=F.PI,Je=D-S,Ut=Je*Je,As=0,Ss=0,Ke=D+S,Wt=Ke*Ke,Cs=0;T=-S*D/(K-se),T>=-1&&T<=1&&(T=Math.acos(T),k=S*Math.cos(T)+D,M=I*Math.sin(T),Y=k*k+M*M,Y<Ut&&(Fe=T,Ut=Y,Je=k,As=M),Y>Wt&&(Ss=T,Wt=Y,Ke=k,Cs=M)),j<=(Ut+Wt)*.5?(_=re-Math.atan2(As*a,Je),G=Fe*a):(_=re-Math.atan2(Cs*a,Ke),G=Ss*a)}let Q=Math.atan2(p,m)*w,he=e.arotation;_=(_-Q)*F.radDeg+b-he,_>180?_-=360:_<-180&&(_+=360),e.updateWorldTransformWith(n,c,he+_*l,u,g,0,0),he=t.arotation,G=((G+Q)*F.radDeg-t.ashearX)*w+v-he,G>180?G-=360:G<-180&&(G+=360),t.updateWorldTransformWith(m,p,he+G*l,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Et=class extends Ue{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}bendDirection=1;compress=!1;stretch=!1;uniform=!1;mix=1;softness=0;constructor(e){super(e,0,!1)}},Pt=class extends Ue{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}positionMode=We.Fixed;spacingMode=ze.Fixed;rotateMode=$e.Chain;offsetRotation=0;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;constructor(e){super(e,0,!1)}},We=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(We||{}),ze=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(ze||{}),$e=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))($e||{}),me=class{data;bones;target;position=0;spacing=0;mixRotate=0;mixX=0;mixY=0;spaces=new Array;positions=new Array;world=new Array;curves=new Array;lengths=new Array;segments=new Array;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let i=0,a=e.bones.length;i<a;i++){let h=t.findBone(e.bones[i].name);if(!h)throw new Error(`Couldn't find bone ${e.bones[i].name}.`);this.bones.push(h)}let s=t.findSlot(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}`);this.target=s,this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}isActive(){return this.active}setToSetupPose(){const e=this.data;this.position=e.position,this.spacing=e.spacing,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY}update(e){let t=this.target.getAttachment();if(!(t instanceof Se))return;let s=this.mixRotate,i=this.mixX,a=this.mixY;if(s==0&&i==0&&a==0)return;let h=this.data,o=h.rotateMode==0,r=h.rotateMode==2,l=this.bones,n=l.length,c=o?n:n+1,f=P.setArraySize(this.spaces,c),d=r?this.lengths=P.setArraySize(this.lengths,n):[],u=this.spacing;switch(h.spacingMode){case 2:if(r)for(let y=0,A=c-1;y<A;y++){let S=l[y],I=S.data.length,T=I*S.a,Y=I*S.c;d[y]=Math.sqrt(T*T+Y*Y)}P.arrayFill(f,1,c,u);break;case 3:let m=0;for(let y=0,A=c-1;y<A;){let S=l[y],I=S.data.length;if(I<me.epsilon)r&&(d[y]=0),f[++y]=u;else{let T=I*S.a,Y=I*S.c,E=Math.sqrt(T*T+Y*Y);r&&(d[y]=E),f[++y]=E,m+=E}}if(m>0){m=c/m*u;for(let y=1;y<c;y++)f[y]*=m}break;default:let p=h.spacingMode==0;for(let y=0,A=c-1;y<A;){let S=l[y],I=S.data.length;if(I<me.epsilon)r&&(d[y]=0),f[++y]=u;else{let T=I*S.a,Y=I*S.c,E=Math.sqrt(T*T+Y*Y);r&&(d[y]=E),f[++y]=(p?I+u:u)*E/I}}}let g=this.computeWorldPositions(t,c,o),x=g[0],b=g[1],v=h.offsetRotation,w=!1;if(v==0)w=h.rotateMode==1;else{w=!1;let m=this.target.bone;v*=m.a*m.d-m.b*m.c>0?F.degRad:-F.degRad}for(let m=0,p=3;m<n;m++,p+=3){let y=l[m];y.worldX+=(x-y.worldX)*i,y.worldY+=(b-y.worldY)*a;let A=g[p],S=g[p+1],I=A-x,T=S-b;if(r){let Y=d[m];if(Y!=0){let E=(Math.sqrt(I*I+T*T)/Y-1)*s+1;y.a*=E,y.c*=E}}if(x=A,b=S,s>0){let Y=y.a,E=y.b,X=y.c,R=y.d,k=0,M=0,L=0;if(o?k=g[p-1]:f[m+1]==0?k=g[p+2]:k=Math.atan2(T,I),k-=Math.atan2(X,Y),w){M=Math.cos(k),L=Math.sin(k);let U=y.data.length;x+=(U*(M*Y-L*X)-I)*s,b+=(U*(L*Y+M*X)-T)*s}else k+=v;k>F.PI?k-=F.PI2:k<-F.PI&&(k+=F.PI2),k*=s,M=Math.cos(k),L=Math.sin(k),y.a=M*Y-L*X,y.b=M*E-L*R,y.c=L*Y+M*X,y.d=L*E+M*R}y.updateAppliedTransform()}}computeWorldPositions(e,t,s){let i=this.target,a=this.position,h=this.spaces,o=P.setArraySize(this.positions,t*3+2),r=this.world,l=e.closed,n=e.worldVerticesLength,c=n/6,f=me.NONE;if(!e.constantSpeed){let U=e.lengths;c-=l?1:2;let D=U[c];this.data.positionMode==1&&(a*=D);let $;switch(this.data.spacingMode){case 2:$=D;break;case 3:$=D/t;break;default:$=1}r=P.setArraySize(this.world,8);for(let _=0,G=0,W=0;_<t;_++,G+=3){let N=h[_]*$;a+=N;let j=a;if(l)j%=D,j<0&&(j+=D),W=0;else if(j<0){f!=me.BEFORE&&(f=me.BEFORE,e.computeWorldVertices(i,2,4,r,0,2)),this.addBeforePosition(j,r,0,o,G);continue}else if(j>D){f!=me.AFTER&&(f=me.AFTER,e.computeWorldVertices(i,n-6,4,r,0,2)),this.addAfterPosition(j-D,r,0,o,G);continue}for(;;W++){let Q=U[W];if(!(j>Q)){if(W==0)j/=Q;else{let he=U[W-1];j=(j-he)/(Q-he)}break}}W!=f&&(f=W,l&&W==c?(e.computeWorldVertices(i,n-4,4,r,0,2),e.computeWorldVertices(i,0,4,r,4,2)):e.computeWorldVertices(i,W*6+2,8,r,0,2)),this.addCurvePosition(j,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],o,G,s||_>0&&N==0)}return o}l?(n+=2,r=P.setArraySize(this.world,n),e.computeWorldVertices(i,2,n-4,r,0,2),e.computeWorldVertices(i,0,2,r,n-4,2),r[n-2]=r[0],r[n-1]=r[1]):(c--,n-=4,r=P.setArraySize(this.world,n),e.computeWorldVertices(i,2,n,r,0,2));let d=P.setArraySize(this.curves,c),u=0,g=r[0],x=r[1],b=0,v=0,w=0,m=0,p=0,y=0,A=0,S=0,I=0,T=0,Y=0,E=0,X=0,R=0;for(let U=0,D=2;U<c;U++,D+=6)b=r[D],v=r[D+1],w=r[D+2],m=r[D+3],p=r[D+4],y=r[D+5],A=(g-b*2+w)*.1875,S=(x-v*2+m)*.1875,I=((b-w)*3-g+p)*.09375,T=((v-m)*3-x+y)*.09375,Y=A*2+I,E=S*2+T,X=(b-g)*.75+A+I*.16666667,R=(v-x)*.75+S+T*.16666667,u+=Math.sqrt(X*X+R*R),X+=Y,R+=E,Y+=I,E+=T,u+=Math.sqrt(X*X+R*R),X+=Y,R+=E,u+=Math.sqrt(X*X+R*R),X+=Y+I,R+=E+T,u+=Math.sqrt(X*X+R*R),d[U]=u,g=p,x=y;this.data.positionMode==1&&(a*=u);let k;switch(this.data.spacingMode){case 2:k=u;break;case 3:k=u/t;break;default:k=1}let M=this.segments,L=0;for(let U=0,D=0,$=0,_=0;U<t;U++,D+=3){let G=h[U]*k;a+=G;let W=a;if(l)W%=u,W<0&&(W+=u),$=0;else if(W<0){this.addBeforePosition(W,r,0,o,D);continue}else if(W>u){this.addAfterPosition(W-u,r,n-4,o,D);continue}for(;;$++){let N=d[$];if(!(W>N)){if($==0)W/=N;else{let j=d[$-1];W=(W-j)/(N-j)}break}}if($!=f){f=$;let N=$*6;for(g=r[N],x=r[N+1],b=r[N+2],v=r[N+3],w=r[N+4],m=r[N+5],p=r[N+6],y=r[N+7],A=(g-b*2+w)*.03,S=(x-v*2+m)*.03,I=((b-w)*3-g+p)*.006,T=((v-m)*3-x+y)*.006,Y=A*2+I,E=S*2+T,X=(b-g)*.3+A+I*.16666667,R=(v-x)*.3+S+T*.16666667,L=Math.sqrt(X*X+R*R),M[0]=L,N=1;N<8;N++)X+=Y,R+=E,Y+=I,E+=T,L+=Math.sqrt(X*X+R*R),M[N]=L;X+=Y,R+=E,L+=Math.sqrt(X*X+R*R),M[8]=L,X+=Y+I,R+=E+T,L+=Math.sqrt(X*X+R*R),M[9]=L,_=0}for(W*=L;;_++){let N=M[_];if(!(W>N)){if(_==0)W/=N;else{let j=M[_-1];W=_+(W-j)/(N-j)}break}}this.addCurvePosition(W*.1,g,x,b,v,w,m,p,y,o,D,s||U>0&&G==0)}return o}addBeforePosition(e,t,s,i,a){let h=t[s],o=t[s+1],r=t[s+2]-h,l=t[s+3]-o,n=Math.atan2(l,r);i[a]=h+e*Math.cos(n),i[a+1]=o+e*Math.sin(n),i[a+2]=n}addAfterPosition(e,t,s,i,a){let h=t[s+2],o=t[s+3],r=h-t[s],l=o-t[s+1],n=Math.atan2(l,r);i[a]=h+e*Math.cos(n),i[a+1]=o+e*Math.sin(n),i[a+2]=n}addCurvePosition(e,t,s,i,a,h,o,r,l,n,c,f){if(e==0||isNaN(e)){n[c]=t,n[c+1]=s,n[c+2]=Math.atan2(a-s,i-t);return}let d=e*e,u=d*e,g=1-e,x=g*g,b=x*g,v=g*e,w=v*3,m=g*w,p=w*e,y=t*b+i*m+h*p+r*u,A=s*b+a*m+o*p+l*u;n[c]=y,n[c+1]=A,f&&(e<.001?n[c+2]=Math.atan2(a-s,i-t):n[c+2]=Math.atan2(A-(s*x+a*v*2+o*d),y-(t*x+i*v*2+h*d)))}},Ce=me;B(Ce,"NONE",-1),B(Ce,"BEFORE",-2),B(Ce,"AFTER",-3),B(Ce,"epsilon",1e-5);var Ks=class{data;_bone=null;set bone(e){this._bone=e}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}inertia=0;strength=0;damping=0;massInverse=0;wind=0;gravity=0;mix=0;_reset=!0;ux=0;uy=0;cx=0;cy=0;tx=0;ty=0;xOffset=0;xVelocity=0;yOffset=0;yVelocity=0;rotateOffset=0;rotateVelocity=0;scaleOffset=0;scaleVelocity=0;active=!1;skeleton;remaining=0;lastTime=0;constructor(e,t){this.data=e,this.skeleton=t,this.bone=t.bones[e.bone.index],this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}reset(){this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0}setToSetupPose(){const e=this.data;this.inertia=e.inertia,this.strength=e.strength,this.damping=e.damping,this.massInverse=e.massInverse,this.wind=e.wind,this.gravity=e.gravity,this.mix=e.mix}isActive(){return this.active}update(e){const t=this.mix;if(t==0)return;const s=this.data.x>0,i=this.data.y>0,a=this.data.rotate>0||this.data.shearX>0,h=this.data.scaleX>0,o=this.bone,r=o.data.length;switch(e){case 0:return;case 1:this.reset();case 2:this.remaining+=Math.max(this.skeleton.time-this.lastTime,0),this.lastTime=this.skeleton.time;const l=o.worldX,n=o.worldY;if(this._reset)this._reset=!1,this.ux=l,this.uy=n;else{let c=this.remaining,f=this.inertia,d=this.data.step;if(s||i){if(s&&(this.xOffset+=(this.ux-l)*f,this.ux=l),i&&(this.yOffset+=(this.uy-n)*f,this.uy=n),c>=d){const u=this.massInverse*d,g=this.strength,x=this.wind*100,b=this.gravity*-100,v=Math.pow(this.damping,60*d);do s&&(this.xVelocity+=(x-this.xOffset*g)*u,this.xOffset+=this.xVelocity*d,this.xVelocity*=v),i&&(this.yVelocity+=(b-this.yOffset*g)*u,this.yOffset+=this.yVelocity*d,this.yVelocity*=v),c-=d;while(c>=d)}s&&(o.worldX+=this.xOffset*t*this.data.x),i&&(o.worldY+=this.yOffset*t*this.data.y)}if(a||h){let u=Math.atan2(o.c,o.a),g=0,x=0,b=0;if(a){b=t*this.data.rotate;let v=this.cx-o.worldX,w=this.cy-o.worldY,m=Math.atan2(w+this.ty,v+this.tx)-u-this.rotateOffset*b;this.rotateOffset+=(m-Math.ceil(m*F.invPI2-.5)*F.PI2)*f,m=this.rotateOffset*b+u,g=Math.cos(m),x=Math.sin(m),h&&(m=r*o.getWorldScaleX(),m>0&&(this.scaleOffset+=(v*g+w*x)*f/m))}else{g=Math.cos(u),x=Math.sin(u);const v=r*o.getWorldScaleX();v>0&&(this.scaleOffset+=((this.cx-o.worldX)*g+(this.cy-o.worldY)*x)*f/v)}if(c=this.remaining,c>=d){const v=this.massInverse*d,w=this.strength,m=this.wind,p=this.gravity,y=Math.pow(this.damping,60*d);for(;;)if(c-=d,h&&(this.scaleVelocity+=(m*g-p*x-this.scaleOffset*w)*v,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=y),a){if(this.rotateVelocity+=(-.01*r*(m*x+p*g)-this.rotateOffset*w)*v,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=y,c<d)break;const A=this.rotateOffset*b+u;g=Math.cos(A),x=Math.sin(A)}else if(c<d)break}}this.remaining=c}this.cx=o.worldX,this.cy=o.worldY;break;case 3:s&&(o.worldX+=this.xOffset*t*this.data.x),i&&(o.worldY+=this.yOffset*t*this.data.y)}if(a){let l=this.rotateOffset*t,n=0,c=0,f=0;if(this.data.shearX>0){let d=0;this.data.rotate>0&&(d=l*this.data.rotate,n=Math.sin(d),c=Math.cos(d),f=o.b,o.b=c*f-n*o.d,o.d=n*f+c*o.d),d+=l*this.data.shearX,n=Math.sin(d),c=Math.cos(d),f=o.a,o.a=c*f-n*o.c,o.c=n*f+c*o.c}else l*=this.data.rotate,n=Math.sin(l),c=Math.cos(l),f=o.a,o.a=c*f-n*o.c,o.c=n*f+c*o.c,f=o.b,o.b=c*f-n*o.d,o.d=n*f+c*o.d}if(h){const l=1+this.scaleOffset*t*this.data.scaleX;o.a*=l,o.c*=l}e!=3&&(this.tx=r*o.a,this.ty=r*o.c),o.updateAppliedTransform()}},gs=class{data;bone;color;darkColor=null;attachment=null;attachmentState=0;sequenceIndex=-1;deform=new Array;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("bone cannot be null.");this.data=e,this.bone=t,this.color=new O,this.darkColor=e.darkColor?new O:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&((!(e instanceof ae)||!(this.attachment instanceof ae)||e.timelineAttachment!=this.attachment.timelineAttachment)&&(this.deform.length=0),this.attachment=e,this.sequenceIndex=-1)}setToSetupPose(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}},xs=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new Ee;active=!1;constructor(e,t){if(!e)throw new Error("data cannot be null.");if(!t)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(let i=0;i<e.bones.length;i++){let a=t.findBone(e.bones[i].name);if(!a)throw new Error(`Couldn't find bone ${e.bones[i].name}.`);this.bones.push(a)}let s=t.findBone(e.target.name);if(!s)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=s}isActive(){return this.active}setToSetupPose(){const e=this.data;this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}update(e){this.mixRotate==0&&this.mixX==0&&this.mixY==0&&this.mixScaleX==0&&this.mixScaleY==0&&this.mixShearY==0||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())}applyAbsoluteWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,o=t!=0||s!=0,r=this.target,l=r.a,n=r.b,c=r.c,f=r.d,d=l*f-n*c>0?F.degRad:-F.degRad,u=this.data.offsetRotation*d,g=this.data.offsetShearY*d,x=this.bones;for(let b=0,v=x.length;b<v;b++){let w=x[b];if(e!=0){let m=w.a,p=w.b,y=w.c,A=w.d,S=Math.atan2(c,l)-Math.atan2(y,m)+u;S>F.PI?S-=F.PI2:S<-F.PI&&(S+=F.PI2),S*=e;let I=Math.cos(S),T=Math.sin(S);w.a=I*m-T*y,w.b=I*p-T*A,w.c=T*m+I*y,w.d=T*p+I*A}if(o){let m=this.temp;r.localToWorld(m.set(this.data.offsetX,this.data.offsetY)),w.worldX+=(m.x-w.worldX)*t,w.worldY+=(m.y-w.worldY)*s}if(i!=0){let m=Math.sqrt(w.a*w.a+w.c*w.c);m!=0&&(m=(m+(Math.sqrt(l*l+c*c)-m+this.data.offsetScaleX)*i)/m),w.a*=m,w.c*=m}if(a!=0){let m=Math.sqrt(w.b*w.b+w.d*w.d);m!=0&&(m=(m+(Math.sqrt(n*n+f*f)-m+this.data.offsetScaleY)*a)/m),w.b*=m,w.d*=m}if(h>0){let m=w.b,p=w.d,y=Math.atan2(p,m),A=Math.atan2(f,n)-Math.atan2(c,l)-(y-Math.atan2(w.c,w.a));A>F.PI?A-=F.PI2:A<-F.PI&&(A+=F.PI2),A=y+(A+g)*h;let S=Math.sqrt(m*m+p*p);w.b=Math.cos(A)*S,w.d=Math.sin(A)*S}w.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,o=t!=0||s!=0,r=this.target,l=r.a,n=r.b,c=r.c,f=r.d,d=l*f-n*c>0?F.degRad:-F.degRad,u=this.data.offsetRotation*d,g=this.data.offsetShearY*d,x=this.bones;for(let b=0,v=x.length;b<v;b++){let w=x[b];if(e!=0){let m=w.a,p=w.b,y=w.c,A=w.d,S=Math.atan2(c,l)+u;S>F.PI?S-=F.PI2:S<-F.PI&&(S+=F.PI2),S*=e;let I=Math.cos(S),T=Math.sin(S);w.a=I*m-T*y,w.b=I*p-T*A,w.c=T*m+I*y,w.d=T*p+I*A}if(o){let m=this.temp;r.localToWorld(m.set(this.data.offsetX,this.data.offsetY)),w.worldX+=m.x*t,w.worldY+=m.y*s}if(i!=0){let m=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleX)*i+1;w.a*=m,w.c*=m}if(a!=0){let m=(Math.sqrt(n*n+f*f)-1+this.data.offsetScaleY)*a+1;w.b*=m,w.d*=m}if(h>0){let m=Math.atan2(f,n)-Math.atan2(c,l);m>F.PI?m-=F.PI2:m<-F.PI&&(m+=F.PI2);let p=w.b,y=w.d;m=Math.atan2(y,p)+(m-F.PI/2+g)*h;let A=Math.sqrt(p*p+y*y);w.b=Math.cos(m)*A,w.d=Math.sin(m)*A}w.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,o=this.target,r=this.bones;for(let l=0,n=r.length;l<n;l++){let c=r[l],f=c.arotation;if(e!=0){let v=o.arotation-f+this.data.offsetRotation;v-=Math.ceil(v/360-.5)*360,f+=v*e}let d=c.ax,u=c.ay;d+=(o.ax-d+this.data.offsetX)*t,u+=(o.ay-u+this.data.offsetY)*s;let g=c.ascaleX,x=c.ascaleY;i!=0&&g!=0&&(g=(g+(o.ascaleX-g+this.data.offsetScaleX)*i)/g),a!=0&&x!=0&&(x=(x+(o.ascaleY-x+this.data.offsetScaleY)*a)/x);let b=c.ashearY;if(h!=0){let v=o.ashearY-b+this.data.offsetShearY;v-=Math.ceil(v/360-.5)*360,b+=v*h}c.updateWorldTransformWith(d,u,f,g,x,c.ashearX,b)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,o=this.target,r=this.bones;for(let l=0,n=r.length;l<n;l++){let c=r[l],f=c.arotation+(o.arotation+this.data.offsetRotation)*e,d=c.ax+(o.ax+this.data.offsetX)*t,u=c.ay+(o.ay+this.data.offsetY)*s,g=c.ascaleX*((o.ascaleX-1+this.data.offsetScaleX)*i+1),x=c.ascaleY*((o.ascaleY-1+this.data.offsetScaleY)*a+1),b=c.ashearY+(o.ashearY+this.data.offsetShearY)*h;c.updateWorldTransformWith(d,u,f,g,x,c.ashearX,b)}}},ws=class{data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return ws.yDown?-this._scaleY:this._scaleY}set scaleY(e){this._scaleY=e}x=0;y=0;time=0;constructor(e){if(!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let t=0;t<e.bones.length;t++){let s=e.bones[t],i;if(!s.parent)i=new Yt(s,this,null);else{let a=this.bones[s.parent.index];i=new Yt(s,this,a),a.children.push(i)}this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let t=0;t<e.slots.length;t++){let s=e.slots[t],i=this.bones[s.boneData.index],a=new gs(s,i);this.slots.push(a),this.drawOrder.push(a)}this.ikConstraints=new Array;for(let t=0;t<e.ikConstraints.length;t++){let s=e.ikConstraints[t];this.ikConstraints.push(new ms(s,this))}this.transformConstraints=new Array;for(let t=0;t<e.transformConstraints.length;t++){let s=e.transformConstraints[t];this.transformConstraints.push(new xs(s,this))}this.pathConstraints=new Array;for(let t=0;t<e.pathConstraints.length;t++){let s=e.pathConstraints[t];this.pathConstraints.push(new Ce(s,this))}this.physicsConstraints=new Array;for(let t=0;t<e.physicsConstraints.length;t++){let s=e.physicsConstraints[t];this.physicsConstraints.push(new Ks(s,this))}this.color=new O(1,1,1,1),this.updateCache()}updateCache(){let e=this._updateCache;e.length=0;let t=this.bones;for(let f=0,d=t.length;f<d;f++){let u=t[f];u.sorted=u.data.skinRequired,u.active=!u.sorted}if(this.skin){let f=this.skin.bones;for(let d=0,u=this.skin.bones.length;d<u;d++){let g=this.bones[f[d].index];do g.sorted=!1,g.active=!0,g=g.parent;while(g)}}let s=this.ikConstraints,i=this.transformConstraints,a=this.pathConstraints,h=this.physicsConstraints,o=s.length,r=i.length,l=a.length,n=this.physicsConstraints.length,c=o+r+l+n;e:for(let f=0;f<c;f++){for(let d=0;d<o;d++){let u=s[d];if(u.data.order==f){this.sortIkConstraint(u);continue e}}for(let d=0;d<r;d++){let u=i[d];if(u.data.order==f){this.sortTransformConstraint(u);continue e}}for(let d=0;d<l;d++){let u=a[d];if(u.data.order==f){this.sortPathConstraint(u);continue e}}for(let d=0;d<n;d++){const u=h[d];if(u.data.order==f){this.sortPhysicsConstraint(u);continue e}}}for(let f=0,d=t.length;f<d;f++)this.sortBone(t[f])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&P.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target;this.sortBone(t);let s=e.bones,i=s[0];if(this.sortBone(i),s.length==1)this._updateCache.push(e),this.sortReset(i.children);else{let a=s[s.length-1];this.sortBone(a),this._updateCache.push(e),this.sortReset(i.children),a.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&P.contains(this.skin.constraints,e.data,!0)),!e.active)return;let t=e.target,s=t.data.index,i=t.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,s,i),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,i);for(let r=0,l=this.data.skins.length;r<l;r++)this.sortPathConstraintAttachment(this.data.skins[r],s,i);let a=t.getAttachment();a instanceof Se&&this.sortPathConstraintAttachmentWith(a,i);let h=e.bones,o=h.length;for(let r=0;r<o;r++)this.sortBone(h[r]);this._updateCache.push(e);for(let r=0;r<o;r++)this.sortReset(h[r].children);for(let r=0;r<o;r++)h[r].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&P.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let t=e.bones,s=t.length;if(e.data.local)for(let i=0;i<s;i++){let a=t[i];this.sortBone(a.parent),this.sortBone(a)}else for(let i=0;i<s;i++)this.sortBone(t[i]);this._updateCache.push(e);for(let i=0;i<s;i++)this.sortReset(t[i].children);for(let i=0;i<s;i++)t[i].sorted=!0}sortPathConstraintAttachment(e,t,s){let i=e.attachments[t];if(i)for(let a in i)this.sortPathConstraintAttachmentWith(i[a],s)}sortPathConstraintAttachmentWith(e,t){if(!(e instanceof Se))return;let s=e.bones;if(!s)this.sortBone(t);else{let i=this.bones;for(let a=0,h=s.length;a<h;){let o=s[a++];for(o+=a;a<o;)this.sortBone(i[s[a++]])}}}sortPhysicsConstraint(e){const t=e.bone;e.active=t.active&&!e.data.skinRequired||this.skin!=null&&P.contains(this.skin.constraints,e.data,!0),e.active&&(this.sortBone(t),this._updateCache.push(e),this.sortReset(t.children),t.sorted=!0)}sortBone(e){if(!e||e.sorted)return;let t=e.parent;t&&this.sortBone(t),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let t=0,s=e.length;t<s;t++){let i=e[t];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}}updateWorldTransform(e){if(!e)throw new Error("physics is undefined");let t=this.bones;for(let i=0,a=t.length;i<a;i++){let h=t[i];h.ax=h.x,h.ay=h.y,h.arotation=h.rotation,h.ascaleX=h.scaleX,h.ascaleY=h.scaleY,h.ashearX=h.shearX,h.ashearY=h.shearY}let s=this._updateCache;for(let i=0,a=s.length;i<a;i++)s[i].update(e)}updateWorldTransformWith(e,t){let s=this.getRootBone();if(!s)throw new Error("Root bone must not be null.");let i=t.a,a=t.b,h=t.c,o=t.d;s.worldX=i*this.x+a*this.y+t.worldX,s.worldY=h*this.x+o*this.y+t.worldY;const r=(s.rotation+s.shearX)*F.degRad,l=(s.rotation+90+s.shearY)*F.degRad,n=Math.cos(r)*s.scaleX,c=Math.cos(l)*s.scaleY,f=Math.sin(r)*s.scaleX,d=Math.sin(l)*s.scaleY;s.a=(i*n+a*f)*this.scaleX,s.b=(i*c+a*d)*this.scaleX,s.c=(h*n+o*f)*this.scaleY,s.d=(h*c+o*d)*this.scaleY;let u=this._updateCache;for(let g=0,x=u.length;g<x;g++){let b=u[g];b!=s&&b.update(e)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const e of this.bones)e.setToSetupPose();for(const e of this.ikConstraints)e.setToSetupPose();for(const e of this.transformConstraints)e.setToSetupPose();for(const e of this.pathConstraints)e.setToSetupPose();for(const e of this.physicsConstraints)e.setToSetupPose()}setSlotsToSetupPose(){let e=this.slots;P.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,s=e.length;t<s;t++)e[t].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.data.name==e)return a}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.data.name==e)return a}return null}setSkinByName(e){let t=this.data.findSkin(e);if(!t)throw new Error("Skin not found: "+e);this.setSkin(t)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let t=this.slots;for(let s=0,i=t.length;s<i;s++){let a=t[s],h=a.data.attachmentName;if(h){let o=e.getAttachment(s,h);o&&a.setAttachment(o)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,t){let s=this.data.findSlot(e);if(!s)throw new Error(`Can't find slot with name ${e}`);return this.getAttachment(s.index,t)}getAttachment(e,t){if(!t)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(e,t);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,t):null}setAttachment(e,t){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let i=0,a=s.length;i<a;i++){let h=s[i];if(h.data.name==e){let o=null;if(t&&(o=this.getAttachment(i,t),!o))throw new Error("Attachment not found: "+t+", for slot: "+e);h.setAttachment(o);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.ikConstraints.find(t=>t.data.name==e)??null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.transformConstraints.find(t=>t.data.name==e)??null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");return this.pathConstraints.find(t=>t.data.name==e)??null}findPhysicsConstraint(e){if(e==null)throw new Error("constraintName cannot be null.");return this.physicsConstraints.find(t=>t.data.name==e)??null}getBoundsRect(){let e=new Ee,t=new Ee;return this.getBounds(e,t),{x:e.x,y:e.y,width:t.x,height:t.y}}getBounds(e,t,s=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!t)throw new Error("size cannot be null.");let i=this.drawOrder,a=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let l=0,n=i.length;l<n;l++){let c=i[l];if(!c.bone.active)continue;let f=0,d=null,u=c.getAttachment();if(u instanceof V)f=8,d=P.setArraySize(s,f,0),u.computeWorldVertices(c,d,0,2);else if(u instanceof ye){let g=u;f=g.worldVerticesLength,d=P.setArraySize(s,f,0),g.computeWorldVertices(c,0,f,d,0,2)}if(d)for(let g=0,x=d.length;g<x;g+=2){let b=d[g],v=d[g+1];a=Math.min(a,b),h=Math.min(h,v),o=Math.max(o,b),r=Math.max(r,v)}}e.set(a,h),t.set(o-a,r-h)}update(e){this.time+=e}},bs=ws;B(bs,"yDown",!1);var ps=(e=>(e[e.none=0]="none",e[e.reset=1]="reset",e[e.update=2]="update",e[e.pose=3]="pose",e))(ps||{}),Bt=class{name=null;bones=new Array;slots=new Array;skins=new Array;defaultSkin=null;events=new Array;animations=new Array;ikConstraints=new Array;transformConstraints=new Array;pathConstraints=new Array;physicsConstraints=new Array;x=0;y=0;width=0;height=0;version=null;hash=null;fps=0;imagesPath=null;audioPath=null;findBone(e){if(!e)throw new Error("boneName cannot be null.");let t=this.bones;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.name==e)return a}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.name==e)return a}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let t=this.skins;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.name==e)return a}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let t=this.events;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.name==e)return a}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let t=this.animations;for(let s=0,i=t.length;s<i;s++){let a=t[s];if(a.name==e)return a}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.ikConstraints;for(let s=0,i=t.length;s<i;s++){const a=t[s];if(a.name==e)return a}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.transformConstraints;for(let s=0,i=t.length;s<i;s++){const a=t[s];if(a.name==e)return a}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.pathConstraints;for(let s=0,i=t.length;s<i;s++){const a=t[s];if(a.name==e)return a}return null}findPhysicsConstraint(e){if(!e)throw new Error("constraintName cannot be null.");const t=this.physicsConstraints;for(let s=0,i=t.length;s<i;s++){const a=t[s];if(a.name==e)return a}return null}},Vt=class{constructor(e=0,t,s){this.slotIndex=e,this.name=t,this.attachment=s}},He=class{name;attachments=new Array;bones=Array();constraints=new Array;color=new O(.99607843,.61960787,.30980393,1);constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,t,s){if(!s)throw new Error("attachment cannot be null.");let i=this.attachments;e>=i.length&&(i.length=e+1),i[e]||(i[e]={}),i[e][t]=s}addSkin(e){for(let i=0;i<e.bones.length;i++){let a=e.bones[i],h=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==a){h=!0;break}h||this.bones.push(a)}for(let i=0;i<e.constraints.length;i++){let a=e.constraints[i],h=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==a){h=!0;break}h||this.constraints.push(a)}let t=e.getAttachments();for(let i=0;i<t.length;i++){var s=t[i];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let i=0;i<e.bones.length;i++){let a=e.bones[i],h=!1;for(let o=0;o<this.bones.length;o++)if(this.bones[o]==a){h=!0;break}h||this.bones.push(a)}for(let i=0;i<e.constraints.length;i++){let a=e.constraints[i],h=!1;for(let o=0;o<this.constraints.length;o++)if(this.constraints[o]==a){h=!0;break}h||this.constraints.push(a)}let t=e.getAttachments();for(let i=0;i<t.length;i++){var s=t[i];s.attachment&&(s.attachment instanceof ye?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))}}getAttachment(e,t){let s=this.attachments[e];return s?s[t]:null}removeAttachment(e,t){let s=this.attachments[e];s&&delete s[t]}getAttachments(){let e=new Array;for(var t=0;t<this.attachments.length;t++){let s=this.attachments[t];if(s)for(let i in s){let a=s[i];a&&e.push(new Vt(t,i,a))}}return e}getAttachmentsForSlot(e,t){let s=this.attachments[e];if(s)for(let i in s){let a=s[i];a&&t.push(new Vt(e,i,a))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,t){let s=0;for(let i=0;i<e.slots.length;i++){let a=e.slots[i],h=a.getAttachment();if(h&&s<t.attachments.length){let o=t.attachments[s];for(let r in o){let l=o[r];if(h==l){let n=this.getAttachment(s,r);n&&a.setAttachment(n);break}}}s++}}},Lt=class{index=0;name;boneData;color=new O(1,1,1,1);darkColor=null;attachmentName=null;blendMode=Ge.Normal;visible=!0;constructor(e,t,s){if(e<0)throw new Error("index must be >= 0.");if(!t)throw new Error("name cannot be null.");if(!s)throw new Error("boneData cannot be null.");this.index=e,this.name=t,this.boneData=s}},Ge=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(Ge||{}),Dt=class extends Ue{bones=new Array;_target=null;set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;offsetRotation=0;offsetX=0;offsetY=0;offsetScaleX=0;offsetScaleY=0;offsetShearY=0;relative=!1;local=!1;constructor(e){super(e,0,!1)}},Qs=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new Bt;s.name="";let i=new ys(e),a=i.readInt32(),h=i.readInt32();s.hash=h==0&&a==0?null:h.toString(16)+a.toString(16),s.version=i.readString(),s.x=i.readFloat(),s.y=i.readFloat(),s.width=i.readFloat(),s.height=i.readFloat();let o=i.readBoolean();o&&(s.fps=i.readFloat(),s.imagesPath=i.readString(),s.audioPath=i.readString());let r=0;r=i.readInt(!0);for(let n=0;n<r;n++){let c=i.readString();if(!c)throw new Error("String in string table must not be null.");i.strings.push(c)}r=i.readInt(!0);for(let n=0;n<r;n++){let c=i.readString();if(!c)throw new Error("Bone name must not be null.");let f=n==0?null:s.bones[i.readInt(!0)],d=new Mt(n,c,f);d.rotation=i.readFloat(),d.x=i.readFloat()*t,d.y=i.readFloat()*t,d.scaleX=i.readFloat(),d.scaleY=i.readFloat(),d.shearX=i.readFloat(),d.shearY=i.readFloat(),d.length=i.readFloat()*t,d.transformMode=i.readInt(!0),d.skinRequired=i.readBoolean(),o&&O.rgba8888ToColor(d.color,i.readInt32()),s.bones.push(d)}r=i.readInt(!0);for(let n=0;n<r;n++){let c=i.readString();if(!c)throw new Error("Slot name must not be null.");let f=s.bones[i.readInt(!0)],d=new Lt(n,c,f);O.rgba8888ToColor(d.color,i.readInt32());let u=i.readInt32();u!=-1&&O.rgb888ToColor(d.darkColor=new O,u),d.attachmentName=i.readStringRef(),d.blendMode=i.readInt(!0),s.slots.push(d)}r=i.readInt(!0);for(let n=0,c;n<r;n++){let f=i.readString();if(!f)throw new Error("IK constraint data name must not be null.");let d=new Et(f);d.order=i.readInt(!0),d.skinRequired=i.readBoolean(),c=i.readInt(!0);for(let u=0;u<c;u++)d.bones.push(s.bones[i.readInt(!0)]);d.target=s.bones[i.readInt(!0)],d.mix=i.readFloat(),d.softness=i.readFloat()*t,d.bendDirection=i.readByte(),d.compress=i.readBoolean(),d.stretch=i.readBoolean(),d.uniform=i.readBoolean(),s.ikConstraints.push(d)}r=i.readInt(!0);for(let n=0,c;n<r;n++){let f=i.readString();if(!f)throw new Error("Transform constraint data name must not be null.");let d=new Dt(f);d.order=i.readInt(!0),d.skinRequired=i.readBoolean(),c=i.readInt(!0);for(let u=0;u<c;u++)d.bones.push(s.bones[i.readInt(!0)]);d.target=s.bones[i.readInt(!0)],d.local=i.readBoolean(),d.relative=i.readBoolean(),d.offsetRotation=i.readFloat(),d.offsetX=i.readFloat()*t,d.offsetY=i.readFloat()*t,d.offsetScaleX=i.readFloat(),d.offsetScaleY=i.readFloat(),d.offsetShearY=i.readFloat(),d.mixRotate=i.readFloat(),d.mixX=i.readFloat(),d.mixY=i.readFloat(),d.mixScaleX=i.readFloat(),d.mixScaleY=i.readFloat(),d.mixShearY=i.readFloat(),s.transformConstraints.push(d)}r=i.readInt(!0);for(let n=0,c;n<r;n++){let f=i.readString();if(!f)throw new Error("Path constraint data name must not be null.");let d=new Pt(f);d.order=i.readInt(!0),d.skinRequired=i.readBoolean(),c=i.readInt(!0);for(let u=0;u<c;u++)d.bones.push(s.bones[i.readInt(!0)]);d.target=s.slots[i.readInt(!0)],d.positionMode=i.readInt(!0),d.spacingMode=i.readInt(!0),d.rotateMode=i.readInt(!0),d.offsetRotation=i.readFloat(),d.position=i.readFloat(),d.positionMode==0&&(d.position*=t),d.spacing=i.readFloat(),(d.spacingMode==0||d.spacingMode==1)&&(d.spacing*=t),d.mixRotate=i.readFloat(),d.mixX=i.readFloat(),d.mixY=i.readFloat(),s.pathConstraints.push(d)}let l=this.readSkin(i,s,!0,o);l&&(s.defaultSkin=l,s.skins.push(l));{let n=s.skins.length;for(P.setArraySize(s.skins,r=n+i.readInt(!0));n<r;n++){let c=this.readSkin(i,s,!1,o);if(!c)throw new Error("readSkin() should not have returned null.");s.skins[n]=c}}r=this.linkedMeshes.length;for(let n=0;n<r;n++){let c=this.linkedMeshes[n],f=c.skin?s.findSkin(c.skin):s.defaultSkin;if(!f)throw new Error("Not skin found for linked mesh.");if(!c.parent)throw new Error("Linked mesh parent must not be null");let d=f.getAttachment(c.slotIndex,c.parent);if(!d)throw new Error(`Parent mesh not found: ${c.parent}`);c.mesh.timelineAttachment=c.inheritTimeline?d:c.mesh,c.mesh.setParentMesh(d),c.mesh.region!=null&&c.mesh.updateRegion()}this.linkedMeshes.length=0,r=i.readInt(!0);for(let n=0;n<r;n++){let c=i.readStringRef();if(!c)throw new Error;let f=new Rt(c);f.intValue=i.readInt(!1),f.floatValue=i.readFloat(),f.stringValue=i.readString(),f.audioPath=i.readString(),f.audioPath&&(f.volume=i.readFloat(),f.balance=i.readFloat()),s.events.push(f)}r=i.readInt(!0);for(let n=0;n<r;n++){let c=i.readString();if(!c)throw new Error("Animatio name must not be null.");s.animations.push(this.readAnimation(i,c,s))}return s}readSkin(e,t,s,i){let a=null,h=0;if(s){if(h=e.readInt(!0),h==0)return null;a=new He("default")}else{let o=e.readStringRef();if(!o)throw new Error("Skin name must not be null.");a=new He(o),a.bones.length=e.readInt(!0);for(let r=0,l=a.bones.length;r<l;r++)a.bones[r]=t.bones[e.readInt(!0)];for(let r=0,l=e.readInt(!0);r<l;r++)a.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let r=0,l=e.readInt(!0);r<l;r++)a.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let r=0,l=e.readInt(!0);r<l;r++)a.constraints.push(t.pathConstraints[e.readInt(!0)]);h=e.readInt(!0)}for(let o=0;o<h;o++){let r=e.readInt(!0);for(let l=0,n=e.readInt(!0);l<n;l++){let c=e.readStringRef();if(!c)throw new Error("Attachment name must not be null");let f=this.readAttachment(e,t,a,r,c,i);f&&a.setAttachment(r,c,f)}}return a}readAttachment(e,t,s,i,a,h){let o=this.scale,r=e.readStringRef();switch(r||(r=a),e.readByte()){case ge.Region:{let l=e.readStringRef(),n=e.readFloat(),c=e.readFloat(),f=e.readFloat(),d=e.readFloat(),u=e.readFloat(),g=e.readFloat(),x=e.readFloat(),b=e.readInt32(),v=this.readSequence(e);l||(l=r);let w=this.attachmentLoader.newRegionAttachment(s,r,l,v);return w?(w.path=l,w.x=c*o,w.y=f*o,w.scaleX=d,w.scaleY=u,w.rotation=n,w.width=g*o,w.height=x*o,O.rgba8888ToColor(w.color,b),w.sequence=v,v==null&&w.updateRegion(),w):null}case ge.BoundingBox:{let l=e.readInt(!0),n=this.readVertices(e,l),c=h?e.readInt32():0,f=this.attachmentLoader.newBoundingBoxAttachment(s,r);return f?(f.worldVerticesLength=l<<1,f.vertices=n.vertices,f.bones=n.bones,h&&O.rgba8888ToColor(f.color,c),f):null}case ge.Mesh:{let l=e.readStringRef(),n=e.readInt32(),c=e.readInt(!0),f=this.readFloatArray(e,c<<1,1),d=this.readShortArray(e),u=this.readVertices(e,c),g=e.readInt(!0),x=this.readSequence(e),b=[],v=0,w=0;h&&(b=this.readShortArray(e),v=e.readFloat(),w=e.readFloat()),l||(l=r);let m=this.attachmentLoader.newMeshAttachment(s,r,l,x);return m?(m.path=l,O.rgba8888ToColor(m.color,n),m.bones=u.bones,m.vertices=u.vertices,m.worldVerticesLength=c<<1,m.triangles=d,m.regionUVs=f,x==null&&m.updateRegion(),m.hullLength=g<<1,m.sequence=x,h&&(m.edges=b,m.width=v*o,m.height=w*o),m):null}case ge.LinkedMesh:{let l=e.readStringRef(),n=e.readInt32(),c=e.readStringRef(),f=e.readStringRef(),d=e.readBoolean(),u=this.readSequence(e),g=0,x=0;h&&(g=e.readFloat(),x=e.readFloat()),l||(l=r);let b=this.attachmentLoader.newMeshAttachment(s,r,l,u);return b?(b.path=l,O.rgba8888ToColor(b.color,n),b.sequence=u,h&&(b.width=g*o,b.height=x*o),this.linkedMeshes.push(new Zs(b,c,i,f,d)),b):null}case ge.Path:{let l=e.readBoolean(),n=e.readBoolean(),c=e.readInt(!0),f=this.readVertices(e,c),d=P.newArray(c/3,0);for(let x=0,b=d.length;x<b;x++)d[x]=e.readFloat()*o;let u=h?e.readInt32():0,g=this.attachmentLoader.newPathAttachment(s,r);return g?(g.closed=l,g.constantSpeed=n,g.worldVerticesLength=c<<1,g.vertices=f.vertices,g.bones=f.bones,g.lengths=d,h&&O.rgba8888ToColor(g.color,u),g):null}case ge.Point:{let l=e.readFloat(),n=e.readFloat(),c=e.readFloat(),f=h?e.readInt32():0,d=this.attachmentLoader.newPointAttachment(s,r);return d?(d.x=n*o,d.y=c*o,d.rotation=l,h&&O.rgba8888ToColor(d.color,f),d):null}case ge.Clipping:{let l=e.readInt(!0),n=e.readInt(!0),c=this.readVertices(e,n),f=h?e.readInt32():0,d=this.attachmentLoader.newClippingAttachment(s,r);return d?(d.endSlot=t.slots[l],d.worldVerticesLength=n<<1,d.vertices=c.vertices,d.bones=c.bones,h&&O.rgba8888ToColor(d.color,f),d):null}}return null}readSequence(e){if(!e.readBoolean())return null;let t=new et(e.readInt(!0));return t.start=e.readInt(!0),t.digits=e.readInt(!0),t.setupIndex=e.readInt(!0),t}readVertices(e,t){let s=this.scale,i=t<<1,a=new er;if(!e.readBoolean())return a.vertices=this.readFloatArray(e,i,s),a;let h=new Array,o=new Array;for(let r=0;r<t;r++){let l=e.readInt(!0);o.push(l);for(let n=0;n<l;n++)o.push(e.readInt(!0)),h.push(e.readFloat()*s),h.push(e.readFloat()*s),h.push(e.readFloat())}return a.vertices=P.toFloatArray(h),a.bones=o,a}readFloatArray(e,t,s){let i=new Array(t);if(s==1)for(let a=0;a<t;a++)i[a]=e.readFloat();else for(let a=0;a<t;a++)i[a]=e.readFloat()*s;return i}readShortArray(e){let t=e.readInt(!0),s=new Array(t);for(let i=0;i<t;i++)s[i]=e.readShort();return s}readAnimation(e,t,s){e.readInt(!0);let i=new Array,a=this.scale,h=new O,o=new O;for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0);for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readByte(),b=e.readInt(!0),v=b-1;switch(x){case dr:{let w=new be(b,d);for(let m=0;m<b;m++)w.setFrame(m,e.readFloat(),e.readStringRef());i.push(w);break}case fr:{let w=e.readInt(!0),m=new ct(b,w,d),p=e.readFloat(),y=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;for(let T=0,Y=0;m.setFrame(T,p,y,A,S,I),T!=v;T++){let E=e.readFloat(),X=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(T);break;case oe:z(e,m,Y++,T,0,p,E,y,X,1),z(e,m,Y++,T,1,p,E,A,R,1),z(e,m,Y++,T,2,p,E,S,k,1),z(e,m,Y++,T,3,p,E,I,M,1)}p=E,y=X,A=R,S=k,I=M}i.push(m);break}case ur:{let w=e.readInt(!0),m=new dt(b,w,d),p=e.readFloat(),y=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255;for(let I=0,T=0;m.setFrame(I,p,y,A,S),I!=v;I++){let Y=e.readFloat(),E=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(I);break;case oe:z(e,m,T++,I,0,p,Y,y,E,1),z(e,m,T++,I,1,p,Y,A,X,1),z(e,m,T++,I,2,p,Y,S,R,1)}p=Y,y=E,A=X,S=R}i.push(m);break}case mr:{let w=e.readInt(!0),m=new ut(b,w,d),p=e.readFloat(),y=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;for(let X=0,R=0;m.setFrame(X,p,y,A,S,I,T,Y,E),X!=v;X++){let k=e.readFloat(),M=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,$=e.readUnsignedByte()/255,_=e.readUnsignedByte()/255,G=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(X);break;case oe:z(e,m,R++,X,0,p,k,y,M,1),z(e,m,R++,X,1,p,k,A,L,1),z(e,m,R++,X,2,p,k,S,U,1),z(e,m,R++,X,3,p,k,I,D,1),z(e,m,R++,X,4,p,k,T,$,1),z(e,m,R++,X,5,p,k,Y,_,1),z(e,m,R++,X,6,p,k,E,G,1)}p=k,y=M,A=L,S=U,I=D,T=$,Y=_,E=G}i.push(m);break}case gr:{let w=e.readInt(!0),m=new mt(b,w,d),p=e.readFloat(),y=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255;for(let E=0,X=0;m.setFrame(E,p,y,A,S,I,T,Y),E!=v;E++){let R=e.readFloat(),k=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,$=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(E);break;case oe:z(e,m,X++,E,0,p,R,y,k,1),z(e,m,X++,E,1,p,R,A,M,1),z(e,m,X++,E,2,p,R,S,L,1),z(e,m,X++,E,3,p,R,I,U,1),z(e,m,X++,E,4,p,R,T,D,1),z(e,m,X++,E,5,p,R,Y,$,1)}p=R,y=k,A=M,S=L,I=U,T=D,Y=$}i.push(m);break}case xr:{let w=new ft(b,e.readInt(!0),d),m=e.readFloat(),p=e.readUnsignedByte()/255;for(let y=0,A=0;w.setFrame(y,m,p),y!=v;y++){let S=e.readFloat(),I=e.readUnsignedByte()/255;switch(e.readByte()){case le:w.setStepped(y);break;case oe:z(e,w,A++,y,0,m,S,p,I,1)}m=S,p=I}i.push(w)}}}}for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0);for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readByte(),b=e.readInt(!0),v=e.readInt(!0);switch(x){case tr:i.push(de(e,new Ye(b,v,d),1));break;case sr:i.push(Ot(e,new tt(b,v,d),a));break;case rr:i.push(de(e,new st(b,v,d),a));break;case ir:i.push(de(e,new rt(b,v,d),a));break;case ar:i.push(Ot(e,new it(b,v,d),1));break;case nr:i.push(de(e,new at(b,v,d),1));break;case lr:i.push(de(e,new nt(b,v,d),1));break;case or:i.push(Ot(e,new lt(b,v,d),1));break;case hr:i.push(de(e,new ot(b,v,d),1));break;case cr:i.push(de(e,new ht(b,v,d),1))}}}for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0),u=e.readInt(!0),g=u-1,x=new xt(u,e.readInt(!0),d),b=e.readFloat(),v=e.readFloat(),w=e.readFloat()*a;for(let m=0,p=0;x.setFrame(m,b,v,w,e.readByte(),e.readBoolean(),e.readBoolean()),m!=g;m++){let y=e.readFloat(),A=e.readFloat(),S=e.readFloat()*a;switch(e.readByte()){case le:x.setStepped(m);break;case oe:z(e,x,p++,m,0,b,y,v,A,1),z(e,x,p++,m,1,b,y,w,S,a)}b=y,v=A,w=S}i.push(x)}for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0),u=e.readInt(!0),g=u-1,x=new wt(u,e.readInt(!0),d),b=e.readFloat(),v=e.readFloat(),w=e.readFloat(),m=e.readFloat(),p=e.readFloat(),y=e.readFloat(),A=e.readFloat();for(let S=0,I=0;x.setFrame(S,b,v,w,m,p,y,A),S!=g;S++){let T=e.readFloat(),Y=e.readFloat(),E=e.readFloat(),X=e.readFloat(),R=e.readFloat(),k=e.readFloat(),M=e.readFloat();switch(e.readByte()){case le:x.setStepped(S);break;case oe:z(e,x,I++,S,0,b,T,v,Y,1),z(e,x,I++,S,1,b,T,w,E,1),z(e,x,I++,S,2,b,T,m,X,1),z(e,x,I++,S,3,b,T,p,R,1),z(e,x,I++,S,4,b,T,y,k,1),z(e,x,I++,S,5,b,T,A,M,1)}b=T,v=Y,w=E,m=X,p=R,y=k,A=M}i.push(x)}for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0),u=s.pathConstraints[d];for(let g=0,x=e.readInt(!0);g<x;g++)switch(e.readByte()){case pr:i.push(de(e,new bt(e.readInt(!0),e.readInt(!0),d),u.positionMode==0?a:1));break;case yr:i.push(de(e,new pt(e.readInt(!0),e.readInt(!0),d),u.spacingMode==0||u.spacingMode==1?a:1));break;case vr:let b=new yt(e.readInt(!0),e.readInt(!0),d),v=e.readFloat(),w=e.readFloat(),m=e.readFloat(),p=e.readFloat();for(let y=0,A=0,S=b.getFrameCount()-1;b.setFrame(y,v,w,m,p),y!=S;y++){let I=e.readFloat(),T=e.readFloat(),Y=e.readFloat(),E=e.readFloat();switch(e.readByte()){case le:b.setStepped(y);break;case oe:z(e,b,A++,y,0,v,I,w,T,1),z(e,b,A++,y,1,v,I,m,Y,1),z(e,b,A++,y,2,v,I,p,E,1)}v=I,w=T,m=Y,p=E}i.push(b)}}for(let c=0,f=e.readInt(!0);c<f;c++){let d=s.skins[e.readInt(!0)];for(let u=0,g=e.readInt(!0);u<g;u++){let x=e.readInt(!0);for(let b=0,v=e.readInt(!0);b<v;b++){let w=e.readStringRef();if(!w)throw new Error("attachmentName must not be null.");let m=d.getAttachment(x,w),p=e.readByte(),y=e.readInt(!0),A=y-1;switch(p){case wr:{let S=m,I=S.bones,T=S.vertices,Y=I?T.length/3*2:T.length,E=e.readInt(!0),X=new gt(y,E,x,S),R=e.readFloat();for(let k=0,M=0;;k++){let L,U=e.readInt(!0);if(U==0)L=I?P.newFloatArray(Y):T;else{L=P.newFloatArray(Y);let $=e.readInt(!0);if(U+=$,a==1)for(let _=$;_<U;_++)L[_]=e.readFloat();else for(let _=$;_<U;_++)L[_]=e.readFloat()*a;if(!I)for(let _=0,G=L.length;_<G;_++)L[_]+=T[_]}if(X.setFrame(k,R,L),k==A)break;let D=e.readFloat();switch(e.readByte()){case le:X.setStepped(k);break;case oe:z(e,X,M++,k,0,R,D,0,1,1)}R=D}i.push(X);break}case br:{let S=new Ae(y,x,m);for(let I=0;I<y;I++){let T=e.readFloat(),Y=e.readInt32();S.setFrame(I,T,Jt[Y&15],Y>>4,e.readFloat())}i.push(S);break}}}}}let r=e.readInt(!0);if(r>0){let c=new pe(r),f=s.slots.length;for(let d=0;d<r;d++){let u=e.readFloat(),g=e.readInt(!0),x=P.newArray(f,0);for(let m=f-1;m>=0;m--)x[m]=-1;let b=P.newArray(f-g,0),v=0,w=0;for(let m=0;m<g;m++){let p=e.readInt(!0);for(;v!=p;)b[w++]=v++;x[v+e.readInt(!0)]=v++}for(;v<f;)b[w++]=v++;for(let m=f-1;m>=0;m--)x[m]==-1&&(x[m]=b[--w]);c.setFrame(d,u,x)}i.push(c)}let l=e.readInt(!0);if(l>0){let c=new Xe(l);for(let f=0;f<l;f++){let d=e.readFloat(),u=s.events[e.readInt(!0)],g=new Ft(d,u);g.intValue=e.readInt(!1),g.floatValue=e.readFloat(),g.stringValue=e.readBoolean()?e.readString():u.stringValue,g.data.audioPath&&(g.volume=e.readFloat(),g.balance=e.readFloat()),c.setFrame(f,g)}i.push(c)}let n=0;for(let c=0,f=i.length;c<f;c++)n=Math.max(n,i[c].getDuration());return new Be(t,i,n)}},ys=class{constructor(e,t=new Array,s=0,i=new DataView(e.buffer)){this.strings=t,this.index=s,this.buffer=i}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let e=this.buffer.getInt16(this.index);return this.index+=2,e}readInt32(){let e=this.buffer.getInt32(this.index);return this.index+=4,e}readInt(e){let t=this.readByte(),s=t&127;return t&128&&(t=this.readByte(),s|=(t&127)<<7,t&128&&(t=this.readByte(),s|=(t&127)<<14,t&128&&(t=this.readByte(),s|=(t&127)<<21,t&128&&(t=this.readByte(),s|=(t&127)<<28)))),e?s:s>>>1^-(s&1)}readStringRef(){let e=this.readInt(!0);return e==0?null:this.strings[e-1]}readString(){let e=this.readInt(!0);switch(e){case 0:return null;case 1:return""}e--;let t="",s=0;for(let i=0;i<e;){let a=this.readUnsignedByte();switch(a>>4){case 12:case 13:t+=String.fromCharCode((a&31)<<6|this.readByte()&63),i+=2;break;case 14:t+=String.fromCharCode((a&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),i+=3;break;default:t+=String.fromCharCode(a),i++}}return t}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Zs=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,s,i,a){this.mesh=e,this.skin=t,this.slotIndex=s,this.parent=i,this.inheritTimeline=a}},er=class{constructor(e=null,t=null){this.bones=e,this.vertices=t}},ge=(e=>(e[e.Region=0]="Region",e[e.BoundingBox=1]="BoundingBox",e[e.Mesh=2]="Mesh",e[e.LinkedMesh=3]="LinkedMesh",e[e.Path=4]="Path",e[e.Point=5]="Point",e[e.Clipping=6]="Clipping",e))(ge||{});function de(e,t,s){let i=e.readFloat(),a=e.readFloat()*s;for(let h=0,o=0,r=t.getFrameCount()-1;t.setFrame(h,i,a),h!=r;h++){let l=e.readFloat(),n=e.readFloat()*s;switch(e.readByte()){case le:t.setStepped(h);break;case oe:z(e,t,o++,h,0,i,l,a,n,s)}i=l,a=n}return t}function Ot(e,t,s){let i=e.readFloat(),a=e.readFloat()*s,h=e.readFloat()*s;for(let o=0,r=0,l=t.getFrameCount()-1;t.setFrame(o,i,a,h),o!=l;o++){let n=e.readFloat(),c=e.readFloat()*s,f=e.readFloat()*s;switch(e.readByte()){case le:t.setStepped(o);break;case oe:z(e,t,r++,o,0,i,n,a,c,s),z(e,t,r++,o,1,i,n,h,f,s)}i=n,a=c,h=f}return t}function z(e,t,s,i,a,h,o,r,l,n){t.setBezier(s,i,a,h,r,e.readFloat(),e.readFloat()*n,e.readFloat(),e.readFloat()*n,o,l)}var tr=0,sr=1,rr=2,ir=3,ar=4,nr=5,lr=6,or=7,hr=8,cr=9,dr=0,fr=1,ur=2,mr=3,gr=4,xr=5,wr=0,br=1,pr=0,yr=1,vr=2,le=1,oe=2,Ar=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Me(()=>P.newFloatArray(16));update(e,t){if(!e)throw new Error("skeleton cannot be null.");let s=this.boundingBoxes,i=this.polygons,a=this.polygonPool,h=e.slots,o=h.length;s.length=0,a.freeAll(i),i.length=0;for(let r=0;r<o;r++){let l=h[r];if(!l.bone.active)continue;let n=l.getAttachment();if(n instanceof Ne){let c=n;s.push(c);let f=a.obtain();f.length!=c.worldVerticesLength&&(f=P.newFloatArray(c.worldVerticesLength)),i.push(f),c.computeWorldVertices(l,0,c.worldVerticesLength,f,0,2)}}t?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)}aabbCompute(){let e=Number.POSITIVE_INFINITY,t=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,a=this.polygons;for(let h=0,o=a.length;h<o;h++){let r=a[h],l=r;for(let n=0,c=r.length;n<c;n+=2){let f=l[n],d=l[n+1];e=Math.min(e,f),t=Math.min(t,d),s=Math.max(s,f),i=Math.max(i,d)}}this.minX=e,this.minY=t,this.maxX=s,this.maxY=i}aabbContainsPoint(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY}aabbIntersectsSegment(e,t,s,i){let a=this.minX,h=this.minY,o=this.maxX,r=this.maxY;if(e<=a&&s<=a||t<=h&&i<=h||e>=o&&s>=o||t>=r&&i>=r)return!1;let l=(i-t)/(s-e),n=l*(a-e)+t;if(n>h&&n<r||(n=l*(o-e)+t,n>h&&n<r))return!0;let c=(h-t)/l+e;return c>a&&c<o||(c=(r-t)/l+e,c>a&&c<o)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,t){let s=this.polygons;for(let i=0,a=s.length;i<a;i++)if(this.containsPointPolygon(s[i],e,t))return this.boundingBoxes[i];return null}containsPointPolygon(e,t,s){let i=e,a=e.length,h=a-2,o=!1;for(let r=0;r<a;r+=2){let l=i[r+1],n=i[h+1];if(l<s&&n>=s||n<s&&l>=s){let c=i[r];c+(s-l)/(n-l)*(i[h]-c)<t&&(o=!o)}h=r}return o}intersectsSegment(e,t,s,i){let a=this.polygons;for(let h=0,o=a.length;h<o;h++)if(this.intersectsSegmentPolygon(a[h],e,t,s,i))return this.boundingBoxes[h];return null}intersectsSegmentPolygon(e,t,s,i,a){let h=e,o=e.length,r=t-i,l=s-a,n=t*a-s*i,c=h[o-2],f=h[o-1];for(let d=0;d<o;d+=2){let u=h[d],g=h[d+1],x=c*g-f*u,b=c-u,v=f-g,w=r*v-l*b,m=(n*b-r*x)/w;if((m>=c&&m<=u||m>=u&&m<=c)&&(m>=t&&m<=i||m>=i&&m<=t)){let p=(n*v-l*x)/w;if((p>=f&&p<=g||p>=g&&p<=f)&&(p>=s&&p<=a||p>=a&&p<=s))return!0}c=u,f=g}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},ee=class{convexPolygons=new Array;convexPolygonsIndices=new Array;indicesArray=new Array;isConcaveArray=new Array;triangles=new Array;polygonPool=new Me(()=>new Array);polygonIndicesPool=new Me(()=>new Array);triangulate(e){let t=e,s=e.length>>1,i=this.indicesArray;i.length=0;for(let o=0;o<s;o++)i[o]=o;let a=this.isConcaveArray;a.length=0;for(let o=0,r=s;o<r;++o)a[o]=ee.isConcave(o,s,t,i);let h=this.triangles;for(h.length=0;s>3;){let o=s-1,r=0,l=1;for(;;){e:if(!a[r]){let f=i[o]<<1,d=i[r]<<1,u=i[l]<<1,g=t[f],x=t[f+1],b=t[d],v=t[d+1],w=t[u],m=t[u+1];for(let p=(l+1)%s;p!=o;p=(p+1)%s){if(!a[p])continue;let y=i[p]<<1,A=t[y],S=t[y+1];if(ee.positiveArea(w,m,g,x,A,S)&&ee.positiveArea(g,x,b,v,A,S)&&ee.positiveArea(b,v,w,m,A,S))break e}break}if(l==0){do{if(!a[r])break;r--}while(r>0);break}o=r,r=l,l=(l+1)%s}h.push(i[(s+r-1)%s]),h.push(i[r]),h.push(i[(r+1)%s]),i.splice(r,1),a.splice(r,1),s--;let n=(s+r-1)%s,c=r==s?0:r;a[n]=ee.isConcave(n,s,t,i),a[c]=ee.isConcave(c,s,t,i)}return s==3&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h}decompose(e,t){let s=e,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;let a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;let h=this.polygonIndicesPool.obtain();h.length=0;let o=this.polygonPool.obtain();o.length=0;let r=-1,l=0;for(let n=0,c=t.length;n<c;n+=3){let f=t[n]<<1,d=t[n+1]<<1,u=t[n+2]<<1,g=s[f],x=s[f+1],b=s[d],v=s[d+1],w=s[u],m=s[u+1],p=!1;if(r==f){let y=o.length-4,A=ee.winding(o[y],o[y+1],o[y+2],o[y+3],w,m),S=ee.winding(w,m,o[0],o[1],o[2],o[3]);A==l&&S==l&&(o.push(w),o.push(m),h.push(u),p=!0)}p||(o.length>0?(i.push(o),a.push(h)):(this.polygonPool.free(o),this.polygonIndicesPool.free(h)),o=this.polygonPool.obtain(),o.length=0,o.push(g),o.push(x),o.push(b),o.push(v),o.push(w),o.push(m),h=this.polygonIndicesPool.obtain(),h.length=0,h.push(f),h.push(d),h.push(u),l=ee.winding(g,x,b,v,w,m),r=f)}o.length>0&&(i.push(o),a.push(h));for(let n=0,c=i.length;n<c;n++){if(h=a[n],h.length==0)continue;let f=h[0],d=h[h.length-1];o=i[n];let u=o.length-4,g=o[u],x=o[u+1],b=o[u+2],v=o[u+3],w=o[0],m=o[1],p=o[2],y=o[3],A=ee.winding(g,x,b,v,w,m);for(let S=0;S<c;S++){if(S==n)continue;let I=a[S];if(I.length!=3)continue;let T=I[0],Y=I[1],E=I[2],X=i[S],R=X[X.length-2],k=X[X.length-1];if(T!=f||Y!=d)continue;let M=ee.winding(g,x,b,v,R,k),L=ee.winding(R,k,w,m,p,y);M==A&&L==A&&(X.length=0,I.length=0,o.push(R),o.push(k),h.push(E),g=b,x=v,b=R,v=k,S=0)}}for(let n=i.length-1;n>=0;n--)o=i[n],o.length==0&&(i.splice(n,1),this.polygonPool.free(o),h=a[n],a.splice(n,1),this.polygonIndicesPool.free(h));return i}static isConcave(e,t,s,i){let a=i[(t+e-1)%t]<<1,h=i[e]<<1,o=i[(e+1)%t]<<1;return!this.positiveArea(s[a],s[a+1],s[h],s[h+1],s[o],s[o+1])}static positiveArea(e,t,s,i,a,h){return e*(h-i)+s*(t-h)+a*(i-t)>=0}static winding(e,t,s,i,a,h){let o=s-e,r=i-t;return a*r-h*o+o*t-e*r>=0?1:-1}},Nt=class{triangulator=new ee;clippingPolygon=new Array;clipOutput=new Array;clippedVertices=new Array;clippedTriangles=new Array;scratch=new Array;clipAttachment=null;clippingPolygons=null;clipStart(e,t){if(this.clipAttachment)return 0;this.clipAttachment=t;let s=t.worldVerticesLength,i=P.setArraySize(this.clippingPolygon,s);t.computeWorldVertices(e,0,s,i,0,2);let a=this.clippingPolygon;Nt.makeClockwise(a);let h=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a));for(let o=0,r=h.length;o<r;o++){let l=h[o];Nt.makeClockwise(l),l.push(l[0]),l.push(l[1])}return h.length}clipEndWithSlot(e){this.clipAttachment&&this.clipAttachment.endSlot==e.data&&this.clipEnd()}clipEnd(){this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)}isClipping(){return this.clipAttachment!=null}clipTriangles(e,t,s,i,a,h,o,r){let l=this.clipOutput,n=this.clippedVertices,c=this.clippedTriangles,f=this.clippingPolygons,d=f.length,u=r?12:8,g=0;n.length=0,c.length=0;e:for(let x=0;x<i;x+=3){let b=s[x]<<1,v=e[b],w=e[b+1],m=a[b],p=a[b+1];b=s[x+1]<<1;let y=e[b],A=e[b+1],S=a[b],I=a[b+1];b=s[x+2]<<1;let T=e[b],Y=e[b+1],E=a[b],X=a[b+1];for(let R=0;R<d;R++){let k=n.length;if(this.clip(v,w,y,A,T,Y,f[R],l)){let M=l.length;if(M==0)continue;let L=A-Y,U=T-y,D=v-T,$=Y-w,_=1/(L*D+U*(w-Y)),G=M>>1,W=this.clipOutput,N=P.setArraySize(n,k+G*u);for(let Q=0;Q<M;Q+=2){let he=W[Q],K=W[Q+1];N[k]=he,N[k+1]=K,N[k+2]=h.r,N[k+3]=h.g,N[k+4]=h.b,N[k+5]=h.a;let se=he-T,re=K-Y,xe=(L*se+U*re)*_,Ie=($*se+D*re)*_,Fe=1-xe-Ie;N[k+6]=m*xe+S*Ie+E*Fe,N[k+7]=p*xe+I*Ie+X*Fe,r&&(N[k+8]=o.r,N[k+9]=o.g,N[k+10]=o.b,N[k+11]=o.a),k+=u}k=c.length;let j=P.setArraySize(c,k+3*(G-2));G--;for(let Q=1;Q<G;Q++)j[k]=g,j[k+1]=g+Q,j[k+2]=g+Q+1,k+=3;g+=G+1}else{let M=P.setArraySize(n,k+3*u);M[k]=v,M[k+1]=w,M[k+2]=h.r,M[k+3]=h.g,M[k+4]=h.b,M[k+5]=h.a,r?(M[k+6]=m,M[k+7]=p,M[k+8]=o.r,M[k+9]=o.g,M[k+10]=o.b,M[k+11]=o.a,M[k+12]=y,M[k+13]=A,M[k+14]=h.r,M[k+15]=h.g,M[k+16]=h.b,M[k+17]=h.a,M[k+18]=S,M[k+19]=I,M[k+20]=o.r,M[k+21]=o.g,M[k+22]=o.b,M[k+23]=o.a,M[k+24]=T,M[k+25]=Y,M[k+26]=h.r,M[k+27]=h.g,M[k+28]=h.b,M[k+29]=h.a,M[k+30]=E,M[k+31]=X,M[k+32]=o.r,M[k+33]=o.g,M[k+34]=o.b,M[k+35]=o.a):(M[k+6]=m,M[k+7]=p,M[k+8]=y,M[k+9]=A,M[k+10]=h.r,M[k+11]=h.g,M[k+12]=h.b,M[k+13]=h.a,M[k+14]=S,M[k+15]=I,M[k+16]=T,M[k+17]=Y,M[k+18]=h.r,M[k+19]=h.g,M[k+20]=h.b,M[k+21]=h.a,M[k+22]=E,M[k+23]=X),k=c.length;let L=P.setArraySize(c,k+3);L[k]=g,L[k+1]=g+1,L[k+2]=g+2,g+=3;continue e}}}}clip(e,t,s,i,a,h,o,r){let l=r,n=!1,c;o.length%4>=2?(c=r,r=this.scratch):c=this.scratch,c.length=0,c.push(e),c.push(t),c.push(s),c.push(i),c.push(a),c.push(h),c.push(e),c.push(t),r.length=0;let f=o,d=o.length-4;for(let u=0;;u+=2){let g=f[u],x=f[u+1],b=f[u+2],v=f[u+3],w=g-b,m=x-v,p=c,y=c.length-2,A=r.length;for(let I=0;I<y;I+=2){let T=p[I],Y=p[I+1],E=p[I+2],X=p[I+3],R=w*(X-v)-m*(E-b)>0;if(w*(Y-v)-m*(T-b)>0){if(R){r.push(E),r.push(X);continue}let k=X-Y,M=E-T,L=k*(b-g)-M*(v-x);if(Math.abs(L)>1e-6){let U=(M*(x-Y)-k*(g-T))/L;r.push(g+(b-g)*U),r.push(x+(v-x)*U)}else r.push(g),r.push(x)}else if(R){let k=X-Y,M=E-T,L=k*(b-g)-M*(v-x);if(Math.abs(L)>1e-6){let U=(M*(x-Y)-k*(g-T))/L;r.push(g+(b-g)*U),r.push(x+(v-x)*U)}else r.push(g),r.push(x);r.push(E),r.push(X)}n=!0}if(A==r.length)return l.length=0,!0;if(r.push(r[0]),r.push(r[1]),u==d)break;let S=r;r=c,r.length=0,c=S}if(l!=r){l.length=0;for(let u=0,g=r.length-2;u<g;u++)l[u]=r[u]}else l.length=l.length-2;return n}static makeClockwise(e){let t=e,s=e.length,i=t[s-2]*t[1]-t[0]*t[s-1],a=0,h=0,o=0,r=0;for(let l=0,n=s-3;l<n;l+=2)a=t[l],h=t[l+1],o=t[l+2],r=t[l+3],i+=a*r-o*h;if(!(i<0))for(let l=0,n=s-2,c=s>>1;l<c;l+=2){let f=t[l],d=t[l+1],u=n-l;t[l]=t[u],t[l+1]=t[u+1],t[u]=f,t[u+1]=d}}},Sr=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new Bt,i=typeof e=="string"?JSON.parse(e):e,a=i.skeleton;if(a&&(s.hash=a.hash,s.version=a.spine,s.x=a.x,s.y=a.y,s.width=a.width,s.height=a.height,s.fps=a.fps,s.imagesPath=a.images),i.bones)for(let h=0;h<i.bones.length;h++){let o=i.bones[h],r=null,l=C(o,"parent",null);l&&(r=s.findBone(l));let n=new Mt(s.bones.length,o.name,r);n.length=C(o,"length",0)*t,n.x=C(o,"x",0)*t,n.y=C(o,"y",0)*t,n.rotation=C(o,"rotation",0),n.scaleX=C(o,"scaleX",1),n.scaleY=C(o,"scaleY",1),n.shearX=C(o,"shearX",0),n.shearY=C(o,"shearY",0),n.transformMode=P.enumValue(qe,C(o,"transform","Normal")),n.skinRequired=C(o,"skin",!1);let c=C(o,"color",null);c&&n.color.setFromString(c),s.bones.push(n)}if(i.slots)for(let h=0;h<i.slots.length;h++){let o=i.slots[h],r=s.findBone(o.bone);if(!r)throw new Error(`Couldn't find bone ${o.bone} for slot ${o.name}`);let l=new Lt(s.slots.length,o.name,r),n=C(o,"color",null);n&&l.color.setFromString(n);let c=C(o,"dark",null);c&&(l.darkColor=O.fromString(c)),l.attachmentName=C(o,"attachment",null),l.blendMode=P.enumValue(Ge,C(o,"blend","normal")),s.slots.push(l)}if(i.ik)for(let h=0;h<i.ik.length;h++){let o=i.ik[h],r=new Et(o.name);r.order=C(o,"order",0),r.skinRequired=C(o,"skin",!1);for(let n=0;n<o.bones.length;n++){let c=s.findBone(o.bones[n]);if(!c)throw new Error(`Couldn't find bone ${o.bones[n]} for IK constraint ${o.name}.`);r.bones.push(c)}let l=s.findBone(o.target);if(!l)throw new Error(`Couldn't find target bone ${o.target} for IK constraint ${o.name}.`);r.target=l,r.mix=C(o,"mix",1),r.softness=C(o,"softness",0)*t,r.bendDirection=C(o,"bendPositive",!0)?1:-1,r.compress=C(o,"compress",!1),r.stretch=C(o,"stretch",!1),r.uniform=C(o,"uniform",!1),s.ikConstraints.push(r)}if(i.transform)for(let h=0;h<i.transform.length;h++){let o=i.transform[h],r=new Dt(o.name);r.order=C(o,"order",0),r.skinRequired=C(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let f=o.bones[c],d=s.findBone(f);if(!d)throw new Error(`Couldn't find bone ${f} for transform constraint ${o.name}.`);r.bones.push(d)}let l=o.target,n=s.findBone(l);if(!n)throw new Error(`Couldn't find target bone ${l} for transform constraint ${o.name}.`);r.target=n,r.local=C(o,"local",!1),r.relative=C(o,"relative",!1),r.offsetRotation=C(o,"rotation",0),r.offsetX=C(o,"x",0)*t,r.offsetY=C(o,"y",0)*t,r.offsetScaleX=C(o,"scaleX",0),r.offsetScaleY=C(o,"scaleY",0),r.offsetShearY=C(o,"shearY",0),r.mixRotate=C(o,"mixRotate",1),r.mixX=C(o,"mixX",1),r.mixY=C(o,"mixY",r.mixX),r.mixScaleX=C(o,"mixScaleX",1),r.mixScaleY=C(o,"mixScaleY",r.mixScaleX),r.mixShearY=C(o,"mixShearY",1),s.transformConstraints.push(r)}if(i.path)for(let h=0;h<i.path.length;h++){let o=i.path[h],r=new Pt(o.name);r.order=C(o,"order",0),r.skinRequired=C(o,"skin",!1);for(let c=0;c<o.bones.length;c++){let f=o.bones[c],d=s.findBone(f);if(!d)throw new Error(`Couldn't find bone ${f} for path constraint ${o.name}.`);r.bones.push(d)}let l=o.target,n=s.findSlot(l);if(!n)throw new Error(`Couldn't find target slot ${l} for path constraint ${o.name}.`);r.target=n,r.positionMode=P.enumValue(We,C(o,"positionMode","Percent")),r.spacingMode=P.enumValue(ze,C(o,"spacingMode","Length")),r.rotateMode=P.enumValue($e,C(o,"rotateMode","Tangent")),r.offsetRotation=C(o,"rotation",0),r.position=C(o,"position",0),r.positionMode==0&&(r.position*=t),r.spacing=C(o,"spacing",0),(r.spacingMode==0||r.spacingMode==1)&&(r.spacing*=t),r.mixRotate=C(o,"mixRotate",1),r.mixX=C(o,"mixX",1),r.mixY=C(o,"mixY",r.mixX),s.pathConstraints.push(r)}if(i.skins)for(let h=0;h<i.skins.length;h++){let o=i.skins[h],r=new He(o.name);if(o.bones)for(let l=0;l<o.bones.length;l++){let n=o.bones[l],c=s.findBone(n);if(!c)throw new Error(`Couldn't find bone ${n} for skin ${o.name}.`);r.bones.push(c)}if(o.ik)for(let l=0;l<o.ik.length;l++){let n=o.ik[l],c=s.findIkConstraint(n);if(!c)throw new Error(`Couldn't find IK constraint ${n} for skin ${o.name}.`);r.constraints.push(c)}if(o.transform)for(let l=0;l<o.transform.length;l++){let n=o.transform[l],c=s.findTransformConstraint(n);if(!c)throw new Error(`Couldn't find transform constraint ${n} for skin ${o.name}.`);r.constraints.push(c)}if(o.path)for(let l=0;l<o.path.length;l++){let n=o.path[l],c=s.findPathConstraint(n);if(!c)throw new Error(`Couldn't find path constraint ${n} for skin ${o.name}.`);r.constraints.push(c)}for(let l in o.attachments){let n=s.findSlot(l);if(!n)throw new Error(`Couldn't find slot ${l} for skin ${o.name}.`);let c=o.attachments[l];for(let f in c){let d=this.readAttachment(c[f],r,n.index,f,s);d&&r.setAttachment(n.index,f,d)}}s.skins.push(r),r.name=="default"&&(s.defaultSkin=r)}for(let h=0,o=this.linkedMeshes.length;h<o;h++){let r=this.linkedMeshes[h],l=r.skin?s.findSkin(r.skin):s.defaultSkin;if(!l)throw new Error(`Skin not found: ${r.skin}`);let n=l.getAttachment(r.slotIndex,r.parent);if(!n)throw new Error(`Parent mesh not found: ${r.parent}`);r.mesh.timelineAttachment=r.inheritTimeline?n:r.mesh,r.mesh.setParentMesh(n),r.mesh.region!=null&&r.mesh.updateRegion()}if(this.linkedMeshes.length=0,i.events)for(let h in i.events){let o=i.events[h],r=new Rt(h);r.intValue=C(o,"int",0),r.floatValue=C(o,"float",0),r.stringValue=C(o,"string",""),r.audioPath=C(o,"audio",null),r.audioPath&&(r.volume=C(o,"volume",1),r.balance=C(o,"balance",0)),s.events.push(r)}if(i.animations)for(let h in i.animations){let o=i.animations[h];this.readAnimation(o,h,s)}return s}readAttachment(e,t,s,i,a){let h=this.scale;switch(i=C(e,"name",i),C(e,"type","region")){case"region":{let o=C(e,"path",i),r=this.readSequence(C(e,"sequence",null)),l=this.attachmentLoader.newRegionAttachment(t,i,o,r);if(!l)return null;l.path=o,l.x=C(e,"x",0)*h,l.y=C(e,"y",0)*h,l.scaleX=C(e,"scaleX",1),l.scaleY=C(e,"scaleY",1),l.rotation=C(e,"rotation",0),l.width=e.width*h,l.height=e.height*h,l.sequence=r;let n=C(e,"color",null);return n&&l.color.setFromString(n),l.region!=null&&l.updateRegion(),l}case"boundingbox":{let o=this.attachmentLoader.newBoundingBoxAttachment(t,i);if(!o)return null;this.readVertices(e,o,e.vertexCount<<1);let r=C(e,"color",null);return r&&o.color.setFromString(r),o}case"mesh":case"linkedmesh":{let o=C(e,"path",i),r=this.readSequence(C(e,"sequence",null)),l=this.attachmentLoader.newMeshAttachment(t,i,o,r);if(!l)return null;l.path=o;let n=C(e,"color",null);n&&l.color.setFromString(n),l.width=C(e,"width",0)*h,l.height=C(e,"height",0)*h,l.sequence=r;let c=C(e,"parent",null);if(c)return this.linkedMeshes.push(new Cr(l,C(e,"skin",null),s,c,C(e,"timelines",!0))),l;let f=e.uvs;return this.readVertices(e,l,f.length),l.triangles=e.triangles,l.regionUVs=f,l.region!=null&&l.updateRegion(),l.edges=C(e,"edges",null),l.hullLength=C(e,"hull",0)*2,l}case"path":{let o=this.attachmentLoader.newPathAttachment(t,i);if(!o)return null;o.closed=C(e,"closed",!1),o.constantSpeed=C(e,"constantSpeed",!0);let r=e.vertexCount;this.readVertices(e,o,r<<1);let l=P.newArray(r/3,0);for(let c=0;c<e.lengths.length;c++)l[c]=e.lengths[c]*h;o.lengths=l;let n=C(e,"color",null);return n&&o.color.setFromString(n),o}case"point":{let o=this.attachmentLoader.newPointAttachment(t,i);if(!o)return null;o.x=C(e,"x",0)*h,o.y=C(e,"y",0)*h,o.rotation=C(e,"rotation",0);let r=C(e,"color",null);return r&&o.color.setFromString(r),o}case"clipping":{let o=this.attachmentLoader.newClippingAttachment(t,i);if(!o)return null;let r=C(e,"end",null);r&&(o.endSlot=a.findSlot(r));let l=e.vertexCount;this.readVertices(e,o,l<<1);let n=C(e,"color",null);return n&&o.color.setFromString(n),o}}return null}readSequence(e){if(e==null)return null;let t=new et(C(e,"count",0));return t.start=C(e,"start",1),t.digits=C(e,"digits",0),t.setupIndex=C(e,"setup",0),t}readVertices(e,t,s){let i=this.scale;t.worldVerticesLength=s;let a=e.vertices;if(s==a.length){let r=P.toFloatArray(a);if(i!=1)for(let l=0,n=a.length;l<n;l++)r[l]*=i;t.vertices=r;return}let h=new Array,o=new Array;for(let r=0,l=a.length;r<l;){let n=a[r++];o.push(n);for(let c=r+n*4;r<c;r+=4)o.push(a[r]),h.push(a[r+1]*i),h.push(a[r+2]*i),h.push(a[r+3])}t.bones=o,t.vertices=P.toFloatArray(h)}readAnimation(e,t,s){let i=this.scale,a=new Array;if(e.slots)for(let o in e.slots){let r=e.slots[o],l=s.findSlot(o);if(!l)throw new Error("Slot not found: "+o);let n=l.index;for(let c in r){let f=r[c];if(!f)continue;let d=f.length;if(c=="attachment"){let u=new be(d,n);for(let g=0;g<d;g++){let x=f[g];u.setFrame(g,C(x,"time",0),C(x,"name",null))}a.push(u)}else if(c=="rgba"){let u=new ct(d,d<<2,n),g=f[0],x=C(g,"time",0),b=O.fromString(g.color);for(let v=0,w=0;;v++){u.setFrame(v,x,b.r,b.g,b.b,b.a);let m=f[v+1];if(!m){u.shrink(w);break}let p=C(m,"time",0),y=O.fromString(m.color),A=g.curve;A&&(w=H(A,u,w,v,0,x,p,b.r,y.r,1),w=H(A,u,w,v,1,x,p,b.g,y.g,1),w=H(A,u,w,v,2,x,p,b.b,y.b,1),w=H(A,u,w,v,3,x,p,b.a,y.a,1)),x=p,b=y,g=m}a.push(u)}else if(c=="rgb"){let u=new dt(d,d*3,n),g=f[0],x=C(g,"time",0),b=O.fromString(g.color);for(let v=0,w=0;;v++){u.setFrame(v,x,b.r,b.g,b.b);let m=f[v+1];if(!m){u.shrink(w);break}let p=C(m,"time",0),y=O.fromString(m.color),A=g.curve;A&&(w=H(A,u,w,v,0,x,p,b.r,y.r,1),w=H(A,u,w,v,1,x,p,b.g,y.g,1),w=H(A,u,w,v,2,x,p,b.b,y.b,1)),x=p,b=y,g=m}a.push(u)}else if(c=="alpha")a.push(ce(f,new ft(d,d,n),0,1));else if(c=="rgba2"){let u=new ut(d,d*7,n),g=f[0],x=C(g,"time",0),b=O.fromString(g.light),v=O.fromString(g.dark);for(let w=0,m=0;;w++){u.setFrame(w,x,b.r,b.g,b.b,b.a,v.r,v.g,v.b);let p=f[w+1];if(!p){u.shrink(m);break}let y=C(p,"time",0),A=O.fromString(p.light),S=O.fromString(p.dark),I=g.curve;I&&(m=H(I,u,m,w,0,x,y,b.r,A.r,1),m=H(I,u,m,w,1,x,y,b.g,A.g,1),m=H(I,u,m,w,2,x,y,b.b,A.b,1),m=H(I,u,m,w,3,x,y,b.a,A.a,1),m=H(I,u,m,w,4,x,y,v.r,S.r,1),m=H(I,u,m,w,5,x,y,v.g,S.g,1),m=H(I,u,m,w,6,x,y,v.b,S.b,1)),x=y,b=A,v=S,g=p}a.push(u)}else if(c=="rgb2"){let u=new mt(d,d*6,n),g=f[0],x=C(g,"time",0),b=O.fromString(g.light),v=O.fromString(g.dark);for(let w=0,m=0;;w++){u.setFrame(w,x,b.r,b.g,b.b,v.r,v.g,v.b);let p=f[w+1];if(!p){u.shrink(m);break}let y=C(p,"time",0),A=O.fromString(p.light),S=O.fromString(p.dark),I=g.curve;I&&(m=H(I,u,m,w,0,x,y,b.r,A.r,1),m=H(I,u,m,w,1,x,y,b.g,A.g,1),m=H(I,u,m,w,2,x,y,b.b,A.b,1),m=H(I,u,m,w,3,x,y,v.r,S.r,1),m=H(I,u,m,w,4,x,y,v.g,S.g,1),m=H(I,u,m,w,5,x,y,v.b,S.b,1)),x=y,b=A,v=S,g=p}a.push(u)}}}if(e.bones)for(let o in e.bones){let r=e.bones[o],l=s.findBone(o);if(!l)throw new Error("Bone not found: "+o);let n=l.index;for(let c in r){let f=r[c],d=f.length;if(d!=0){if(c==="rotate")a.push(ce(f,new Ye(d,d,n),0,1));else if(c==="translate"){let u=new tt(d,d<<1,n);a.push(_t(f,u,"x","y",0,i))}else if(c==="translatex"){let u=new st(d,d,n);a.push(ce(f,u,0,i))}else if(c==="translatey"){let u=new rt(d,d,n);a.push(ce(f,u,0,i))}else if(c==="scale"){let u=new it(d,d<<1,n);a.push(_t(f,u,"x","y",1,1))}else if(c==="scalex"){let u=new at(d,d,n);a.push(ce(f,u,1,1))}else if(c==="scaley"){let u=new nt(d,d,n);a.push(ce(f,u,1,1))}else if(c==="shear"){let u=new lt(d,d<<1,n);a.push(_t(f,u,"x","y",0,1))}else if(c==="shearx"){let u=new ot(d,d,n);a.push(ce(f,u,0,1))}else if(c==="sheary"){let u=new ht(d,d,n);a.push(ce(f,u,0,1))}}}}if(e.ik)for(let o in e.ik){let r=e.ik[o],l=r[0];if(!l)continue;let n=s.findIkConstraint(o);if(!n)throw new Error("IK Constraint not found: "+o);let c=s.ikConstraints.indexOf(n),f=new xt(r.length,r.length<<1,c),d=C(l,"time",0),u=C(l,"mix",1),g=C(l,"softness",0)*i;for(let x=0,b=0;;x++){f.setFrame(x,d,u,g,C(l,"bendPositive",!0)?1:-1,C(l,"compress",!1),C(l,"stretch",!1));let v=r[x+1];if(!v){f.shrink(b);break}let w=C(v,"time",0),m=C(v,"mix",1),p=C(v,"softness",0)*i,y=l.curve;y&&(b=H(y,f,b,x,0,d,w,u,m,1),b=H(y,f,b,x,1,d,w,g,p,i)),d=w,u=m,g=p,l=v}a.push(f)}if(e.transform)for(let o in e.transform){let r=e.transform[o],l=r[0];if(!l)continue;let n=s.findTransformConstraint(o);if(!n)throw new Error("Transform constraint not found: "+o);let c=s.transformConstraints.indexOf(n),f=new wt(r.length,r.length*6,c),d=C(l,"time",0),u=C(l,"mixRotate",1),g=C(l,"mixX",1),x=C(l,"mixY",g),b=C(l,"mixScaleX",1),v=C(l,"mixScaleY",b),w=C(l,"mixShearY",1);for(let m=0,p=0;;m++){f.setFrame(m,d,u,g,x,b,v,w);let y=r[m+1];if(!y){f.shrink(p);break}let A=C(y,"time",0),S=C(y,"mixRotate",1),I=C(y,"mixX",1),T=C(y,"mixY",I),Y=C(y,"mixScaleX",1),E=C(y,"mixScaleY",Y),X=C(y,"mixShearY",1),R=l.curve;R&&(p=H(R,f,p,m,0,d,A,u,S,1),p=H(R,f,p,m,1,d,A,g,I,1),p=H(R,f,p,m,2,d,A,x,T,1),p=H(R,f,p,m,3,d,A,b,Y,1),p=H(R,f,p,m,4,d,A,v,E,1),p=H(R,f,p,m,5,d,A,w,X,1)),d=A,u=S,g=I,x=T,b=Y,v=E,b=Y,l=y}a.push(f)}if(e.path)for(let o in e.path){let r=e.path[o],l=s.findPathConstraint(o);if(!l)throw new Error("Path constraint not found: "+o);let n=s.pathConstraints.indexOf(l);for(let c in r){let f=r[c],d=f[0];if(!d)continue;let u=f.length;if(c==="position"){let g=new bt(u,u,n);a.push(ce(f,g,0,l.positionMode==0?i:1))}else if(c==="spacing"){let g=new pt(u,u,n);a.push(ce(f,g,0,l.spacingMode==0||l.spacingMode==1?i:1))}else if(c==="mix"){let g=new yt(u,u*3,n),x=C(d,"time",0),b=C(d,"mixRotate",1),v=C(d,"mixX",1),w=C(d,"mixY",v);for(let m=0,p=0;;m++){g.setFrame(m,x,b,v,w);let y=f[m+1];if(!y){g.shrink(p);break}let A=C(y,"time",0),S=C(y,"mixRotate",1),I=C(y,"mixX",1),T=C(y,"mixY",I),Y=d.curve;Y&&(p=H(Y,g,p,m,0,x,A,b,S,1),p=H(Y,g,p,m,1,x,A,v,I,1),p=H(Y,g,p,m,2,x,A,w,T,1)),x=A,b=S,v=I,w=T,d=y}a.push(g)}}}if(e.attachments)for(let o in e.attachments){let r=e.attachments[o],l=s.findSkin(o);if(!l)throw new Error("Skin not found: "+o);for(let n in r){let c=r[n],f=s.findSlot(n);if(!f)throw new Error("Slot not found: "+n);let d=f.index;for(let u in c){let g=c[u],x=l.getAttachment(d,u);for(let b in g){let v=g[b],w=v[0];if(w){if(b=="deform"){let m=x.bones,p=x.vertices,y=m?p.length/3*2:p.length,A=new gt(v.length,v.length,d,x),S=C(w,"time",0);for(let I=0,T=0;;I++){let Y,E=C(w,"vertices",null);if(!E)Y=m?P.newFloatArray(y):p;else{Y=P.newFloatArray(y);let M=C(w,"offset",0);if(P.arrayCopy(E,0,Y,M,E.length),i!=1)for(let L=M,U=L+E.length;L<U;L++)Y[L]*=i;if(!m)for(let L=0;L<y;L++)Y[L]+=p[L]}A.setFrame(I,S,Y);let X=v[I+1];if(!X){A.shrink(T);break}let R=C(X,"time",0),k=w.curve;k&&(T=H(k,A,T,I,0,S,R,0,1,1)),S=R,w=X}a.push(A)}else if(b=="sequence"){let m=new Ae(v.length,d,x),p=0;for(let y=0;y<v.length;y++){let A=C(w,"delay",p),S=C(w,"time",0),I=jt[C(w,"mode","hold")],T=C(w,"index",0);m.setFrame(y,S,I,T,A),p=A,w=v[y+1]}a.push(m)}}}}}}if(e.drawOrder){let o=new pe(e.drawOrder.length),r=s.slots.length,l=0;for(let n=0;n<e.drawOrder.length;n++,l++){let c=e.drawOrder[n],f=null,d=C(c,"offsets",null);if(d){f=P.newArray(r,-1);let u=P.newArray(r-d.length,0),g=0,x=0;for(let b=0;b<d.length;b++){let v=d[b],w=s.findSlot(v.slot);if(!w)throw new Error("Slot not found: "+w);let m=w.index;for(;g!=m;)u[x++]=g++;f[g+v.offset]=g++}for(;g<r;)u[x++]=g++;for(let b=r-1;b>=0;b--)f[b]==-1&&(f[b]=u[--x])}o.setFrame(l,C(c,"time",0),f)}a.push(o)}if(e.events){let o=new Xe(e.events.length),r=0;for(let l=0;l<e.events.length;l++,r++){let n=e.events[l],c=s.findEvent(n.name);if(!c)throw new Error("Event not found: "+n.name);let f=new Ft(P.toSinglePrecision(C(n,"time",0)),c);f.intValue=C(n,"int",c.intValue),f.floatValue=C(n,"float",c.floatValue),f.stringValue=C(n,"string",c.stringValue),f.data.audioPath&&(f.volume=C(n,"volume",1),f.balance=C(n,"balance",0)),o.setFrame(r,f)}a.push(o)}let h=0;for(let o=0,r=a.length;o<r;o++)h=Math.max(h,a[o].getDuration());s.animations.push(new Be(t,a,h))}},Cr=class{parent;skin;slotIndex;mesh;inheritTimeline;constructor(e,t,s,i,a){this.mesh=e,this.skin=t,this.slotIndex=s,this.parent=i,this.inheritTimeline=a}};function ce(e,t,s,i){let a=e[0],h=C(a,"time",0),o=C(a,"value",s)*i,r=0;for(let l=0;;l++){t.setFrame(l,h,o);let n=e[l+1];if(!n)return t.shrink(r),t;let c=C(n,"time",0),f=C(n,"value",s)*i;a.curve&&(r=H(a.curve,t,r,l,0,h,c,o,f,i)),h=c,o=f,a=n}}function _t(e,t,s,i,a,h){let o=e[0],r=C(o,"time",0),l=C(o,s,a)*h,n=C(o,i,a)*h,c=0;for(let f=0;;f++){t.setFrame(f,r,l,n);let d=e[f+1];if(!d)return t.shrink(c),t;let u=C(d,"time",0),g=C(d,s,a)*h,x=C(d,i,a)*h,b=o.curve;b&&(c=H(b,t,c,f,0,r,u,l,g,h),c=H(b,t,c,f,1,r,u,n,x,h)),r=u,l=g,n=x,o=d}}function H(e,t,s,i,a,h,o,r,l,n){if(e=="stepped")return t.setStepped(i),s;let c=a<<2,f=e[c],d=e[c+1]*n,u=e[c+2],g=e[c+3]*n;return t.setBezier(s,i,a,h,r,f,d,u,g,o,l),s+1}function C(e,t,s){return e[t]!==void 0?e[t]:s}typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1)));var vs=class extends It{constructor(e){super(e)}setFilters(e,t){}setWraps(e,t){}dispose(){}},Ir=class extends us{constructor(e="",t=new Xt){super(s=>new vs(s),e,t)}},kr=P.newFloatArray(8),je=class{ctx;triangleRendering=!1;debugRendering=!1;vertices=P.newFloatArray(8*1024);tempColor=new O;constructor(e){this.ctx=e}draw(e){this.triangleRendering?this.drawTriangles(e):this.drawImages(e)}drawImages(e){let t=this.ctx,s=this.tempColor,i=e.color,a=e.drawOrder;this.debugRendering&&(t.strokeStyle="green");for(let h=0,o=a.length;h<o;h++){let r=a[h],l=r.bone;if(!l.active)continue;let n=r.getAttachment();if(!(n instanceof V))continue;n.computeWorldVertices(r,kr,0,2);let c=n.region,f=c.texture.getImage(),d=r.color,u=n.color;s.set(i.r*d.r*u.r,i.g*d.g*u.g,i.b*d.b*u.b,i.a*d.a*u.a),t.save(),t.transform(l.a,l.c,l.b,l.d,l.worldX,l.worldY),t.translate(n.offset[0],n.offset[1]),t.rotate(n.rotation*Math.PI/180);let g=n.width/c.originalWidth;t.scale(g*n.scaleX,g*n.scaleY);let x=c.width,b=c.height;if(t.translate(x/2,b/2),n.region.degrees==90){let v=x;x=b,b=v,t.rotate(-Math.PI/2)}t.scale(1,-1),t.translate(-x/2,-b/2),t.globalAlpha=s.a,t.drawImage(f,f.width*c.u,f.height*c.v,x,b,0,0,x,b),this.debugRendering&&t.strokeRect(0,0,x,b),t.restore()}}drawTriangles(e){let t=this.ctx,s=this.tempColor,i=e.color,a=e.drawOrder,h=null,o=this.vertices,r=null;for(let n=0,c=a.length;n<c;n++){let f=a[n],d=f.getAttachment(),u,g;if(d instanceof V){let x=d;o=this.computeRegionVertices(f,x,!1),r=je.QUAD_TRIANGLES,u=x.region.texture.getImage()}else if(d instanceof ye){let x=d;o=this.computeMeshVertices(f,x,!1),r=x.triangles,u=x.region.texture.getImage()}else continue;if(u){f.data.blendMode!=h&&(h=f.data.blendMode);let x=f.color,b=d.color;s.set(i.r*x.r*b.r,i.g*x.g*b.g,i.b*x.b*b.b,i.a*x.a*b.a),t.globalAlpha=s.a;for(var l=0;l<r.length;l+=3){let v=r[l]*8,w=r[l+1]*8,m=r[l+2]*8,p=o[v],y=o[v+1],A=o[v+6],S=o[v+7],I=o[w],T=o[w+1],Y=o[w+6],E=o[w+7],X=o[m],R=o[m+1],k=o[m+6],M=o[m+7];this.drawTriangle(u,p,y,A,S,I,T,Y,E,X,R,k,M),this.debugRendering&&(t.strokeStyle="green",t.beginPath(),t.moveTo(p,y),t.lineTo(I,T),t.lineTo(X,R),t.lineTo(p,y),t.stroke())}}}this.ctx.globalAlpha=1}drawTriangle(e,t,s,i,a,h,o,r,l,n,c,f,d){let u=this.ctx;i*=e.width,a*=e.height,r*=e.width,l*=e.height,f*=e.width,d*=e.height,u.beginPath(),u.moveTo(t,s),u.lineTo(h,o),u.lineTo(n,c),u.closePath(),h-=t,o-=s,n-=t,c-=s,r-=i,l-=a,f-=i,d-=a;var g=1/(r*d-f*l),x=(d*h-l*n)*g,b=(d*o-l*c)*g,v=(r*n-f*h)*g,w=(r*c-f*o)*g,m=t-x*i-v*a,p=s-b*i-w*a;u.save(),u.transform(x,b,v,w,m,p),u.clip(),u.drawImage(e,0,0),u.restore()}computeRegionVertices(e,t,s){let i=e.bone.skeleton.color,a=e.color,h=t.color,o=i.a*a.a*h.a,r=s?o:1,l=this.tempColor;l.set(i.r*a.r*h.r*r,i.g*a.g*h.g*r,i.b*a.b*h.b*r,o),t.computeWorldVertices(e,this.vertices,0,je.VERTEX_SIZE);let n=this.vertices,c=t.uvs;return n[V.C1R]=l.r,n[V.C1G]=l.g,n[V.C1B]=l.b,n[V.C1A]=l.a,n[V.U1]=c[0],n[V.V1]=c[1],n[V.C2R]=l.r,n[V.C2G]=l.g,n[V.C2B]=l.b,n[V.C2A]=l.a,n[V.U2]=c[2],n[V.V2]=c[3],n[V.C3R]=l.r,n[V.C3G]=l.g,n[V.C3B]=l.b,n[V.C3A]=l.a,n[V.U3]=c[4],n[V.V3]=c[5],n[V.C4R]=l.r,n[V.C4G]=l.g,n[V.C4B]=l.b,n[V.C4A]=l.a,n[V.U4]=c[6],n[V.V4]=c[7],n}computeMeshVertices(e,t,s){let i=e.bone.skeleton.color,a=e.color,h=t.color,o=i.a*a.a*h.a,r=s?o:1,l=this.tempColor;l.set(i.r*a.r*h.r*r,i.g*a.g*h.g*r,i.b*a.b*h.b*r,o);let n=t.worldVerticesLength/2,c=this.vertices;c.length<t.worldVerticesLength&&(this.vertices=c=P.newFloatArray(t.worldVerticesLength)),t.computeWorldVertices(e,0,t.worldVerticesLength,c,0,je.VERTEX_SIZE);let f=t.uvs;for(let d=0,u=0,g=2;d<n;d++)c[g++]=l.r,c[g++]=l.g,c[g++]=l.b,c[g++]=l.a,c[g++]=f[u++],c[g++]=f[u++],g+=2;return c}},qt=je;return B(qt,"QUAD_TRIANGLES",[0,1,2,2,3,0]),B(qt,"VERTEX_SIZE",8),Es(zt)})();