@esotericsoftware/spine-core 4.2.25 → 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.
- package/dist/Animation.d.ts +109 -16
- package/dist/Animation.js +392 -322
- package/dist/AnimationState.d.ts +21 -12
- package/dist/AnimationState.js +191 -168
- package/dist/AnimationStateData.d.ts +3 -3
- package/dist/AnimationStateData.js +6 -4
- package/dist/AssetManagerBase.d.ts +3 -3
- package/dist/AssetManagerBase.js +11 -11
- package/dist/AtlasAttachmentLoader.d.ts +10 -10
- package/dist/AtlasAttachmentLoader.js +8 -7
- package/dist/Bone.d.ts +19 -15
- package/dist/Bone.js +127 -106
- package/dist/BoneData.d.ts +6 -2
- package/dist/BoneData.js +37 -31
- package/dist/ConstraintData.js +4 -1
- package/dist/Event.d.ts +1 -1
- package/dist/Event.js +8 -7
- package/dist/EventData.js +8 -7
- package/dist/IkConstraint.d.ts +6 -5
- package/dist/IkConstraint.js +39 -22
- package/dist/IkConstraintData.d.ts +2 -2
- package/dist/IkConstraintData.js +20 -20
- package/dist/PathConstraint.d.ts +8 -7
- package/dist/PathConstraint.js +39 -29
- package/dist/PathConstraintData.d.ts +3 -3
- package/dist/PathConstraintData.js +21 -21
- package/dist/PhysicsConstraint.d.ts +74 -0
- package/dist/PhysicsConstraint.js +267 -0
- package/dist/PhysicsConstraintData.d.ts +61 -0
- package/dist/PhysicsConstraintData.js +68 -0
- package/dist/Skeleton.d.ts +36 -12
- package/dist/Skeleton.js +121 -90
- package/dist/SkeletonBinary.d.ts +2 -2
- package/dist/SkeletonBinary.js +30 -19
- package/dist/SkeletonBounds.d.ts +3 -3
- package/dist/SkeletonBounds.js +18 -20
- package/dist/SkeletonClipping.d.ts +3 -3
- package/dist/SkeletonClipping.js +11 -13
- package/dist/SkeletonData.d.ts +14 -7
- package/dist/SkeletonData.js +64 -50
- package/dist/SkeletonJson.d.ts +5 -5
- package/dist/SkeletonJson.js +26 -20
- package/dist/Skin.d.ts +7 -5
- package/dist/Skin.js +13 -5
- package/dist/Slot.d.ts +5 -5
- package/dist/Slot.js +23 -16
- package/dist/SlotData.d.ts +4 -2
- package/dist/SlotData.js +20 -14
- package/dist/Texture.js +14 -14
- package/dist/TextureAtlas.d.ts +3 -3
- package/dist/TextureAtlas.js +30 -27
- package/dist/TransformConstraint.d.ts +7 -6
- package/dist/TransformConstraint.js +28 -13
- package/dist/TransformConstraintData.d.ts +2 -2
- package/dist/TransformConstraintData.js +26 -26
- package/dist/Triangulator.d.ts +1 -1
- package/dist/Triangulator.js +13 -15
- package/dist/Updatable.d.ts +9 -4
- package/dist/Utils.d.ts +4 -2
- package/dist/Utils.js +41 -35
- package/dist/attachments/Attachment.d.ts +2 -2
- package/dist/attachments/Attachment.js +20 -19
- package/dist/attachments/AttachmentLoader.d.ts +8 -8
- package/dist/attachments/BoundingBoxAttachment.d.ts +2 -2
- package/dist/attachments/BoundingBoxAttachment.js +4 -4
- package/dist/attachments/ClippingAttachment.d.ts +3 -3
- package/dist/attachments/ClippingAttachment.js +10 -10
- package/dist/attachments/HasTextureRegion.d.ts +3 -3
- package/dist/attachments/MeshAttachment.d.ts +6 -6
- package/dist/attachments/MeshAttachment.js +29 -27
- package/dist/attachments/PathAttachment.d.ts +2 -2
- package/dist/attachments/PathAttachment.js +13 -13
- package/dist/attachments/PointAttachment.d.ts +3 -3
- package/dist/attachments/PointAttachment.js +13 -13
- package/dist/attachments/RegionAttachment.d.ts +6 -6
- package/dist/attachments/RegionAttachment.js +62 -60
- package/dist/attachments/Sequence.d.ts +3 -3
- package/dist/attachments/Sequence.js +9 -8
- package/dist/attachments/index.d.ts +8 -8
- package/dist/attachments/index.js +9 -9
- package/dist/iife/spine-core.js +1658 -1178
- package/dist/iife/spine-core.js.map +4 -4
- package/dist/iife/spine-core.min.js +2 -2
- package/dist/index.d.ts +39 -39
- package/dist/index.js +40 -40
- package/package.json +3 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var spine=(()=>{var Ge=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,ps=Object.getOwnPropertyNames,ys=Object.prototype.hasOwnProperty,vs=(e,s)=>{for(var t in s)Ge(e,t,{get:s[t],enumerable:!0})},Ss=(e,s,t,a)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of ps(s))!ys.call(e,r)&&r!==t&&Ge(e,r,{get:()=>s[r],enumerable:!(a=bs(s,r))||a.enumerable});return e},As=e=>Ss(Ge({},"__esModule",{value:!0}),e),Nt={};vs(Nt,{AlphaTimeline:()=>ht,Animation:()=>Ee,AnimationState:()=>jt,AnimationStateAdapter:()=>Xs,AnimationStateData:()=>Ms,AssetManagerBase:()=>Bs,AtlasAttachmentLoader:()=>Rs,Attachment:()=>Je,AttachmentTimeline:()=>xe,BinaryInput:()=>fs,BlendMode:()=>ze,Bone:()=>Yt,BoneData:()=>kt,BoundingBoxAttachment:()=>Ve,CURRENT:()=>Zt,ClippingAttachment:()=>vt,Color:()=>L,ConstraintData:()=>qe,CurveTimeline:()=>ie,CurveTimeline1:()=>re,CurveTimeline2:()=>Re,DebugUtils:()=>Is,DeformTimeline:()=>ft,Downloader:()=>ns,DrawOrderTimeline:()=>we,Event:()=>It,EventData:()=>Ct,EventQueue:()=>Kt,EventTimeline:()=>Te,EventType:()=>Q,FIRST:()=>bt,FakeTexture:()=>Fs,HOLD_FIRST:()=>De,HOLD_MIX:()=>Qt,HOLD_SUBSEQUENT:()=>pt,IkConstraint:()=>ls,IkConstraintData:()=>Tt,IkConstraintTimeline:()=>ut,IntSet:()=>ks,Interpolation:()=>qt,MathUtils:()=>X,MeshAttachment:()=>ye,MixBlend:()=>zt,MixDirection:()=>$t,PathAttachment:()=>ve,PathConstraint:()=>Se,PathConstraintData:()=>Xt,PathConstraintMixTimeline:()=>wt,PathConstraintPositionTimeline:()=>gt,PathConstraintSpacingTimeline:()=>xt,PointAttachment:()=>At,Pool:()=>Ie,PositionMode:()=>Oe,Pow:()=>Ot,PowOut:()=>Ys,RGB2Timeline:()=>dt,RGBA2Timeline:()=>ct,RGBATimeline:()=>lt,RGBTimeline:()=>ot,RegionAttachment:()=>W,RotateMode:()=>Ue,RotateTimeline:()=>Ce,SETUP:()=>yt,SUBSEQUENT:()=>Pe,ScaleTimeline:()=>tt,ScaleXTimeline:()=>st,ScaleYTimeline:()=>it,SequenceTimeline:()=>pe,ShearTimeline:()=>rt,ShearXTimeline:()=>at,ShearYTimeline:()=>nt,Skeleton:()=>ds,SkeletonBinary:()=>Ps,SkeletonBounds:()=>ai,SkeletonClipping:()=>Pt,SkeletonData:()=>Mt,SkeletonJson:()=>ni,Skin:()=>We,SkinEntry:()=>Ft,Slot:()=>os,SlotData:()=>Et,SpacingMode:()=>_e,StringSet:()=>je,Texture:()=>es,TextureAtlas:()=>is,TextureAtlasPage:()=>rs,TextureAtlasRegion:()=>St,TextureFilter:()=>Le,TextureRegion:()=>ss,TextureWrap:()=>ts,TimeKeeper:()=>Cs,Timeline:()=>j,TrackEntry:()=>Jt,TransformConstraint:()=>hs,TransformConstraintData:()=>Rt,TransformConstraintTimeline:()=>mt,TransformMode:()=>Ne,TranslateTimeline:()=>Qe,TranslateXTimeline:()=>Ze,TranslateYTimeline:()=>et,Triangulator:()=>Z,Utils:()=>B,Vector2:()=>Me,VertexAttachment:()=>se,WindowedMean:()=>Ts});var ks=class{constructor(){this.array=new Array}add(e){let s=this.contains(e);return this.array[e|0]=e|0,!s}contains(e){return this.array[e|0]!=null}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},je=class{constructor(){this.entries={},this.size=0}add(e){let s=this.entries[e];return this.entries[e]=!0,s?!1:(this.size++,!0)}addAll(e){let s=this.size;for(var t=0,a=e.length;t<a;t++)this.add(e[t]);return s!=this.size}contains(e){return this.entries[e]}clear(){this.entries={},this.size=0}},ge=class{constructor(e=0,s=0,t=0,a=0){this.r=e,this.g=s,this.b=t,this.a=a}set(e,s,t,a){return this.r=e,this.g=s,this.b=t,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,s,t,a){return this.r+=e,this.g+=s,this.b+=t,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,s){e.r=((s&4278190080)>>>24)/255,e.g=((s&16711680)>>>16)/255,e.b=((s&65280)>>>8)/255,e.a=(s&255)/255}static rgb888ToColor(e,s){e.r=((s&16711680)>>>16)/255,e.g=((s&65280)>>>8)/255,e.b=(s&255)/255}static fromString(e){return new ge().setFromString(e)}},L=ge;L.WHITE=new ge(1,1,1,1),L.RED=new ge(1,0,0,1),L.GREEN=new ge(0,1,0,1),L.BLUE=new ge(0,0,1,1),L.MAGENTA=new ge(1,0,1,1);var he=class{static clamp(e,s,t){return e<s?s:e>t?t:e}static cosDeg(e){return Math.cos(e*he.degRad)}static sinDeg(e){return Math.sin(e*he.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 s=Math.pow(Math.abs(e),.3333333333333333);return e<0?-s:s}static randomTriangular(e,s){return he.randomTriangularWith(e,s,(e+s)*.5)}static randomTriangularWith(e,s,t){let a=Math.random(),r=s-e;return a<=(t-e)/r?e+Math.sqrt(a*r*(t-e)):s-Math.sqrt((1-a)*r*(s-t))}static isPowerOfTwo(e){return e&&(e&e-1)===0}},X=he;X.PI=3.1415927,X.PI2=he.PI*2,X.radiansToDegrees=180/he.PI,X.radDeg=he.radiansToDegrees,X.degreesToRadians=he.PI/180,X.degRad=he.degreesToRadians;var qt=class{apply(e,s,t){return e+(s-e)*this.applyInternal(t)}},Ot=class extends qt{constructor(e){super(),this.power=2,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}},Ys=class extends Ot{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2==0?-1:1)+1}},be=class{static arrayCopy(e,s,t,a,r){for(let c=s,l=a;c<s+r;c++,l++)t[l]=e[c]}static arrayFill(e,s,t,a){for(let r=s;r<t;r++)e[r]=a}static setArraySize(e,s,t=0){let a=e.length;if(a==s)return e;if(e.length=s,a<s)for(let r=a;r<s;r++)e[r]=t;return e}static ensureArrayCapacity(e,s,t=0){return e.length>=s?e:be.setArraySize(e,s,t)}static newArray(e,s){let t=new Array(e);for(let a=0;a<e;a++)t[a]=s;return t}static newFloatArray(e){if(be.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);{let s=new Array(e);for(let t=0;t<s.length;t++)s[t]=0;return s}}static newShortArray(e){if(be.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);{let s=new Array(e);for(let t=0;t<s.length;t++)s[t]=0;return s}}static toFloatArray(e){return be.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e}static toSinglePrecision(e){return be.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e}static webkit602BugfixHelper(e,s){}static contains(e,s,t=!0){for(var a=0;a<e.length;a++)if(e[a]==s)return!0;return!1}static enumValue(e,s){return e[s[0].toUpperCase()+s.slice(1)]}},B=be;B.SUPPORTS_TYPED_ARRAYS=typeof Float32Array!="undefined";var Is=class{static logBones(e){for(let s=0;s<e.bones.length;s++){let t=e.bones[s];console.log(t.data.name+", "+t.a+", "+t.b+", "+t.c+", "+t.d+", "+t.worldX+", "+t.worldY)}}},Ie=class{constructor(e){this.items=new Array,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 s=0;s<e.length;s++)this.free(e[s])}clear(){this.items.length=0}},Me=class{constructor(e=0,s=0){this.x=e,this.y=s}set(e,s){return this.x=e,this.y=s,this}length(){let e=this.x,s=this.y;return Math.sqrt(e*e+s*s)}normalize(){let e=this.length();return e!=0&&(this.x/=e,this.y/=e),this}},Cs=class{constructor(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.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)}},Ts=class{constructor(e=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,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 s=0;s<this.values.length;s++)e+=this.values[s];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0}},Je=class{constructor(e){if(!e)throw new Error("name cannot be null.");this.name=e}},_t=class extends Je{constructor(e){super(e),this.id=_t.nextID++,this.bones=null,this.vertices=[],this.worldVerticesLength=0,this.timelineAttachment=this}computeWorldVertices(e,s,t,a,r,c){t=r+(t>>1)*c;let l=e.bone.skeleton,i=e.deform,o=this.vertices,n=this.bones;if(!n){i.length>0&&(o=i);let u=e.bone,x=u.worldX,w=u.worldY,p=u.a,y=u.b,m=u.c,g=u.d;for(let b=s,v=r;v<t;b+=2,v+=c){let S=o[b],A=o[b+1];a[v]=S*p+A*y+x,a[v+1]=S*m+A*g+w}return}let h=0,d=0;for(let u=0;u<s;u+=2){let x=n[h];h+=x+1,d+=x}let f=l.bones;if(i.length==0)for(let u=r,x=d*3;u<t;u+=c){let w=0,p=0,y=n[h++];for(y+=h;h<y;h++,x+=3){let m=f[n[h]],g=o[x],b=o[x+1],v=o[x+2];w+=(g*m.a+b*m.b+m.worldX)*v,p+=(g*m.c+b*m.d+m.worldY)*v}a[u]=w,a[u+1]=p}else{let u=i;for(let x=r,w=d*3,p=d<<1;x<t;x+=c){let y=0,m=0,g=n[h++];for(g+=h;h<g;h++,w+=3,p+=2){let b=f[n[h]],v=o[w]+u[p],S=o[w+1]+u[p+1],A=o[w+2];y+=(v*b.a+S*b.b+b.worldX)*A,m+=(v*b.c+S*b.d+b.worldY)*A}a[x]=y,a[x+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=_t;se.nextID=0;var Fe=class{constructor(e){this.id=Fe.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(e)}copy(){let e=new Fe(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,s){let t=e.sequenceIndex;t==-1&&(t=this.setupIndex),t>=this.regions.length&&(t=this.regions.length-1);let a=this.regions[t];s.region!=a&&(s.region=a,s.updateRegion())}getPath(e,s){let t=e,a=(this.start+s).toString();for(let r=this.digits-a.length;r>0;r--)t+="0";return t+=a,t}static nextID(){return Fe._nextID++}},Ke=Fe;Ke._nextID=0;var Ut=(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))(Ut||{}),Wt=[0,1,2,3,4,5,6],Ee=class{constructor(e,s,t){if(this.timelines=[],this.timelineIds=new je,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(s),this.duration=t}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e,this.timelineIds.clear();for(var s=0;s<e.length;s++)this.timelineIds.addAll(e[s].getPropertyIds())}hasTimeline(e){for(let s=0;s<e.length;s++)if(this.timelineIds.contains(e[s]))return!0;return!1}apply(e,s,t,a,r,c,l,i){if(!e)throw new Error("skeleton cannot be null.");a&&this.duration!=0&&(t%=this.duration,s>0&&(s%=this.duration));let o=this.timelines;for(let n=0,h=o.length;n<h;n++)o[n].apply(e,s,t,r,c,l,i)}},zt=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(zt||{}),$t=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))($t||{}),H={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{constructor(e,s){this.propertyIds=s,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,s){let t=e.length;for(let a=1;a<t;a++)if(e[a]>s)return a-1;return t-1}static search(e,s,t){let a=e.length;for(let r=t;r<a;r+=t)if(e[r]>s)return r-t;return a-t}},ie=class extends j{constructor(e,s,t){super(e,t),this.curves=B.newFloatArray(e+s*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){let s=this.getFrameCount()+e*18;if(this.curves.length>s){let t=B.newFloatArray(s);B.arrayCopy(this.curves,0,t,0,s),this.curves=t}}setBezier(e,s,t,a,r,c,l,i,o,n,h){let d=this.curves,f=this.getFrameCount()+e*18;t==0&&(d[s]=2+f);let u=(a-c*2+i)*.03,x=(r-l*2+o)*.03,w=((c-i)*3-a+n)*.006,p=((l-o)*3-r+h)*.006,y=u*2+w,m=x*2+p,g=(c-a)*.3+u+w*.16666667,b=(l-r)*.3+x+p*.16666667,v=a+g,S=r+b;for(let A=f+18;f<A;f+=2)d[f]=v,d[f+1]=S,g+=y,b+=m,y+=w,m+=p,v+=g,S+=b}getBezierValue(e,s,t,a){let r=this.curves;if(r[a]>e){let o=this.frames[s],n=this.frames[s+t];return n+(e-o)/(r[a]-o)*(r[a+1]-n)}let c=a+18;for(a+=2;a<c;a+=2)if(r[a]>=e){let o=r[a-2],n=r[a-1];return n+(e-o)/(r[a]-o)*(r[a+1]-n)}s+=this.getFrameEntries();let l=r[c-2],i=r[c-1];return i+(e-l)/(this.frames[s]-l)*(this.frames[s+t]-i)}},re=class extends ie{constructor(e,s,t){super(e,s,[t])}getFrameEntries(){return 2}setFrame(e,s,t){e<<=1,this.frames[e]=s,this.frames[e+1]=t}getCurveValue(e){let s=this.frames,t=s.length-2;for(let r=2;r<=t;r+=2)if(s[r]>e){t=r-2;break}let a=this.curves[t>>1];switch(a){case 0:let r=s[t],c=s[t+1];return c+(e-r)/(s[t+2]-r)*(s[t+2+1]-c);case 1:return s[t+1]}return this.getBezierValue(e,t,1,a-2)}},Re=class extends ie{constructor(e,s,t,a){super(e,s,[t,a])}getFrameEntries(){return 3}setFrame(e,s,t,a){e*=3,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a}},Ce=class extends re{constructor(e,s,t){super(e,s,H.rotate+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.rotation=i.data.rotation;return;case 1:i.rotation+=(i.data.rotation-i.rotation)*r}return}let n=this.getCurveValue(t);switch(c){case 0:i.rotation=i.data.rotation+n*r;break;case 1:case 2:n+=i.data.rotation-i.rotation;case 3:i.rotation+=n*r}}},Qe=class extends Re{constructor(e,s,t){super(e,s,H.x+"|"+t,H.y+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.x=i.data.x,i.y=i.data.y;return;case 1:i.x+=(i.data.x-i.x)*r,i.y+=(i.data.y-i.y)*r}return}let n=0,h=0,d=j.search(o,t,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];n=o[d+1],h=o[d+2];let x=(t-u)/(o[d+3]-u);n+=(o[d+3+1]-n)*x,h+=(o[d+3+2]-h)*x;break;case 1:n=o[d+1],h=o[d+2];break;default:n=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}switch(c){case 0:i.x=i.data.x+n*r,i.y=i.data.y+h*r;break;case 1:case 2:i.x+=(i.data.x+n-i.x)*r,i.y+=(i.data.y+h-i.y)*r;break;case 3:i.x+=n*r,i.y+=h*r}}},Ze=class extends re{constructor(e,s,t){super(e,s,H.x+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.x=i.data.x;return;case 1:i.x+=(i.data.x-i.x)*r}return}let n=this.getCurveValue(t);switch(c){case 0:i.x=i.data.x+n*r;break;case 1:case 2:i.x+=(i.data.x+n-i.x)*r;break;case 3:i.x+=n*r}}},et=class extends re{constructor(e,s,t){super(e,s,H.y+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.y=i.data.y;return;case 1:i.y+=(i.data.y-i.y)*r}return}let n=this.getCurveValue(t);switch(c){case 0:i.y=i.data.y+n*r;break;case 1:case 2:i.y+=(i.data.y+n-i.y)*r;break;case 3:i.y+=n*r}}},tt=class extends Re{constructor(e,s,t){super(e,s,H.scaleX+"|"+t,H.scaleY+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.scaleX=i.data.scaleX,i.scaleY=i.data.scaleY;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*r,i.scaleY+=(i.data.scaleY-i.scaleY)*r}return}let n,h,d=j.search(o,t,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];n=o[d+1],h=o[d+2];let x=(t-u)/(o[d+3]-u);n+=(o[d+3+1]-n)*x,h+=(o[d+3+2]-h)*x;break;case 1:n=o[d+1],h=o[d+2];break;default:n=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}if(n*=i.data.scaleX,h*=i.data.scaleY,r==1)c==3?(i.scaleX+=n-i.data.scaleX,i.scaleY+=h-i.data.scaleY):(i.scaleX=n,i.scaleY=h);else{let u=0,x=0;if(l==1)switch(c){case 0:u=i.data.scaleX,x=i.data.scaleY,i.scaleX=u+(Math.abs(n)*X.signum(u)-u)*r,i.scaleY=x+(Math.abs(h)*X.signum(x)-x)*r;break;case 1:case 2:u=i.scaleX,x=i.scaleY,i.scaleX=u+(Math.abs(n)*X.signum(u)-u)*r,i.scaleY=x+(Math.abs(h)*X.signum(x)-x)*r;break;case 3:i.scaleX+=(n-i.data.scaleX)*r,i.scaleY+=(h-i.data.scaleY)*r}else switch(c){case 0:u=Math.abs(i.data.scaleX)*X.signum(n),x=Math.abs(i.data.scaleY)*X.signum(h),i.scaleX=u+(n-u)*r,i.scaleY=x+(h-x)*r;break;case 1:case 2:u=Math.abs(i.scaleX)*X.signum(n),x=Math.abs(i.scaleY)*X.signum(h),i.scaleX=u+(n-u)*r,i.scaleY=x+(h-x)*r;break;case 3:i.scaleX+=(n-i.data.scaleX)*r,i.scaleY+=(h-i.data.scaleY)*r}}}},st=class extends re{constructor(e,s,t){super(e,s,H.scaleX+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.scaleX=i.data.scaleX;return;case 1:i.scaleX+=(i.data.scaleX-i.scaleX)*r}return}let n=this.getCurveValue(t)*i.data.scaleX;if(r==1)c==3?i.scaleX+=n-i.data.scaleX:i.scaleX=n;else{let h=0;if(l==1)switch(c){case 0:h=i.data.scaleX,i.scaleX=h+(Math.abs(n)*X.signum(h)-h)*r;break;case 1:case 2:h=i.scaleX,i.scaleX=h+(Math.abs(n)*X.signum(h)-h)*r;break;case 3:i.scaleX+=(n-i.data.scaleX)*r}else switch(c){case 0:h=Math.abs(i.data.scaleX)*X.signum(n),i.scaleX=h+(n-h)*r;break;case 1:case 2:h=Math.abs(i.scaleX)*X.signum(n),i.scaleX=h+(n-h)*r;break;case 3:i.scaleX+=(n-i.data.scaleX)*r}}}},it=class extends re{constructor(e,s,t){super(e,s,H.scaleY+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.scaleY=i.data.scaleY;return;case 1:i.scaleY+=(i.data.scaleY-i.scaleY)*r}return}let n=this.getCurveValue(t)*i.data.scaleY;if(r==1)c==3?i.scaleY+=n-i.data.scaleY:i.scaleY=n;else{let h=0;if(l==1)switch(c){case 0:h=i.data.scaleY,i.scaleY=h+(Math.abs(n)*X.signum(h)-h)*r;break;case 1:case 2:h=i.scaleY,i.scaleY=h+(Math.abs(n)*X.signum(h)-h)*r;break;case 3:i.scaleY+=(n-i.data.scaleY)*r}else switch(c){case 0:h=Math.abs(i.data.scaleY)*X.signum(n),i.scaleY=h+(n-h)*r;break;case 1:case 2:h=Math.abs(i.scaleY)*X.signum(n),i.scaleY=h+(n-h)*r;break;case 3:i.scaleY+=(n-i.data.scaleY)*r}}}},rt=class extends Re{constructor(e,s,t){super(e,s,H.shearX+"|"+t,H.shearY+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.shearX=i.data.shearX,i.shearY=i.data.shearY;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*r,i.shearY+=(i.data.shearY-i.shearY)*r}return}let n=0,h=0,d=j.search(o,t,3),f=this.curves[d/3];switch(f){case 0:let u=o[d];n=o[d+1],h=o[d+2];let x=(t-u)/(o[d+3]-u);n+=(o[d+3+1]-n)*x,h+=(o[d+3+2]-h)*x;break;case 1:n=o[d+1],h=o[d+2];break;default:n=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}switch(c){case 0:i.shearX=i.data.shearX+n*r,i.shearY=i.data.shearY+h*r;break;case 1:case 2:i.shearX+=(i.data.shearX+n-i.shearX)*r,i.shearY+=(i.data.shearY+h-i.shearY)*r;break;case 3:i.shearX+=n*r,i.shearY+=h*r}}},at=class extends re{constructor(e,s,t){super(e,s,H.shearX+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.shearX=i.data.shearX;return;case 1:i.shearX+=(i.data.shearX-i.shearX)*r}return}let n=this.getCurveValue(t);switch(c){case 0:i.shearX=i.data.shearX+n*r;break;case 1:case 2:i.shearX+=(i.data.shearX+n-i.shearX)*r;break;case 3:i.shearX+=n*r}}},nt=class extends re{constructor(e,s,t){super(e,s,H.shearY+"|"+t),this.boneIndex=0,this.boneIndex=t}apply(e,s,t,a,r,c,l){let i=e.bones[this.boneIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.shearY=i.data.shearY;return;case 1:i.shearY+=(i.data.shearY-i.shearY)*r}return}let n=this.getCurveValue(t);switch(c){case 0:i.shearY=i.data.shearY+n*r;break;case 1:case 2:i.shearY+=(i.data.shearY+n-i.shearY)*r;break;case 3:i.shearY+=n*r}}},lt=class extends ie{constructor(e,s,t){super(e,s,[H.rgb+"|"+t,H.alpha+"|"+t]),this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 5}setFrame(e,s,t,a,r,c){e*=5,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=this.frames,n=i.color;if(t<o[0]){let p=i.data.color;switch(c){case 0:n.setFromColor(p);return;case 1:n.add((p.r-n.r)*r,(p.g-n.g)*r,(p.b-n.b)*r,(p.a-n.a)*r)}return}let h=0,d=0,f=0,u=0,x=j.search(o,t,5),w=this.curves[x/5];switch(w){case 0:let p=o[x];h=o[x+1],d=o[x+2],f=o[x+3],u=o[x+4];let y=(t-p)/(o[x+5]-p);h+=(o[x+5+1]-h)*y,d+=(o[x+5+2]-d)*y,f+=(o[x+5+3]-f)*y,u+=(o[x+5+4]-u)*y;break;case 1:h=o[x+1],d=o[x+2],f=o[x+3],u=o[x+4];break;default:h=this.getBezierValue(t,x,1,w-2),d=this.getBezierValue(t,x,2,w+18-2),f=this.getBezierValue(t,x,3,w+18*2-2),u=this.getBezierValue(t,x,4,w+18*3-2)}r==1?n.set(h,d,f,u):(c==0&&n.setFromColor(i.data.color),n.add((h-n.r)*r,(d-n.g)*r,(f-n.b)*r,(u-n.a)*r))}},ot=class extends ie{constructor(e,s,t){super(e,s,[H.rgb+"|"+t]),this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 4}setFrame(e,s,t,a,r){e<<=2,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=this.frames,n=i.color;if(t<o[0]){let w=i.data.color;switch(c){case 0:n.r=w.r,n.g=w.g,n.b=w.b;return;case 1:n.r+=(w.r-n.r)*r,n.g+=(w.g-n.g)*r,n.b+=(w.b-n.b)*r}return}let h=0,d=0,f=0,u=j.search(o,t,4),x=this.curves[u>>2];switch(x){case 0:let w=o[u];h=o[u+1],d=o[u+2],f=o[u+3];let p=(t-w)/(o[u+4]-w);h+=(o[u+4+1]-h)*p,d+=(o[u+4+2]-d)*p,f+=(o[u+4+3]-f)*p;break;case 1:h=o[u+1],d=o[u+2],f=o[u+3];break;default:h=this.getBezierValue(t,u,1,x-2),d=this.getBezierValue(t,u,2,x+18-2),f=this.getBezierValue(t,u,3,x+18*2-2)}if(r==1)n.r=h,n.g=d,n.b=f;else{if(c==0){let w=i.data.color;n.r=w.r,n.g=w.g,n.b=w.b}n.r+=(h-n.r)*r,n.g+=(d-n.g)*r,n.b+=(f-n.b)*r}}},ht=class extends re{constructor(e,s,t){super(e,s,H.alpha+"|"+t),this.slotIndex=0,this.slotIndex=t}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=i.color;if(t<this.frames[0]){let h=i.data.color;switch(c){case 0:o.a=h.a;return;case 1:o.a+=(h.a-o.a)*r}return}let n=this.getCurveValue(t);r==1?o.a=n:(c==0&&(o.a=i.data.color.a),o.a+=(n-o.a)*r)}},ct=class extends ie{constructor(e,s,t){super(e,s,[H.rgb+"|"+t,H.alpha+"|"+t,H.rgb2+"|"+t]),this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 8}setFrame(e,s,t,a,r,c,l,i,o){e<<=3,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=l,this.frames[e+6]=i,this.frames[e+7]=o}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=this.frames,n=i.color,h=i.darkColor;if(t<o[0]){let b=i.data.color,v=i.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)*r,(b.g-n.g)*r,(b.b-n.b)*r,(b.a-n.a)*r),h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,x=0,w=0,p=0,y=0,m=j.search(o,t,8),g=this.curves[m>>3];switch(g){case 0:let b=o[m];d=o[m+1],f=o[m+2],u=o[m+3],x=o[m+4],w=o[m+5],p=o[m+6],y=o[m+7];let v=(t-b)/(o[m+8]-b);d+=(o[m+8+1]-d)*v,f+=(o[m+8+2]-f)*v,u+=(o[m+8+3]-u)*v,x+=(o[m+8+4]-x)*v,w+=(o[m+8+5]-w)*v,p+=(o[m+8+6]-p)*v,y+=(o[m+8+7]-y)*v;break;case 1:d=o[m+1],f=o[m+2],u=o[m+3],x=o[m+4],w=o[m+5],p=o[m+6],y=o[m+7];break;default:d=this.getBezierValue(t,m,1,g-2),f=this.getBezierValue(t,m,2,g+18-2),u=this.getBezierValue(t,m,3,g+18*2-2),x=this.getBezierValue(t,m,4,g+18*3-2),w=this.getBezierValue(t,m,5,g+18*4-2),p=this.getBezierValue(t,m,6,g+18*5-2),y=this.getBezierValue(t,m,7,g+18*6-2)}if(r==1)n.set(d,f,u,x),h.r=w,h.g=p,h.b=y;else{if(c==0){n.setFromColor(i.data.color);let b=i.data.darkColor;h.r=b.r,h.g=b.g,h.b=b.b}n.add((d-n.r)*r,(f-n.g)*r,(u-n.b)*r,(x-n.a)*r),h.r+=(w-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},dt=class extends ie{constructor(e,s,t){super(e,s,[H.rgb+"|"+t,H.rgb2+"|"+t]),this.slotIndex=0,this.slotIndex=t}getFrameEntries(){return 7}setFrame(e,s,t,a,r,c,l,i){e*=7,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c,this.frames[e+5]=l,this.frames[e+6]=i}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=this.frames,n=i.color,h=i.darkColor;if(t<o[0]){let b=i.data.color,v=i.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)*r,n.g+=(b.g-n.g)*r,n.b+=(b.b-n.b)*r,h.r+=(v.r-h.r)*r,h.g+=(v.g-h.g)*r,h.b+=(v.b-h.b)*r}return}let d=0,f=0,u=0,x=0,w=0,p=0,y=0,m=j.search(o,t,7),g=this.curves[m/7];switch(g){case 0:let b=o[m];d=o[m+1],f=o[m+2],u=o[m+3],w=o[m+4],p=o[m+5],y=o[m+6];let v=(t-b)/(o[m+7]-b);d+=(o[m+7+1]-d)*v,f+=(o[m+7+2]-f)*v,u+=(o[m+7+3]-u)*v,w+=(o[m+7+4]-w)*v,p+=(o[m+7+5]-p)*v,y+=(o[m+7+6]-y)*v;break;case 1:d=o[m+1],f=o[m+2],u=o[m+3],w=o[m+4],p=o[m+5],y=o[m+6];break;default:d=this.getBezierValue(t,m,1,g-2),f=this.getBezierValue(t,m,2,g+18-2),u=this.getBezierValue(t,m,3,g+18*2-2),w=this.getBezierValue(t,m,4,g+18*3-2),p=this.getBezierValue(t,m,5,g+18*4-2),y=this.getBezierValue(t,m,6,g+18*5-2)}if(r==1)n.r=d,n.g=f,n.b=u,h.r=w,h.g=p,h.b=y;else{if(c==0){let b=i.data.color,v=i.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)*r,n.g+=(f-n.g)*r,n.b+=(u-n.b)*r,h.r+=(w-h.r)*r,h.g+=(p-h.g)*r,h.b+=(y-h.b)*r}}},xe=class extends j{constructor(e,s){super(e,[H.attachment+"|"+s]),this.slotIndex=0,this.slotIndex=s,this.attachmentNames=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.attachmentNames[e]=t}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(i.bone.active){if(l==1){c==0&&this.setAttachment(e,i,i.data.attachmentName);return}if(t<this.frames[0]){(c==0||c==1)&&this.setAttachment(e,i,i.data.attachmentName);return}this.setAttachment(e,i,this.attachmentNames[j.search1(this.frames,t)])}}setAttachment(e,s,t){s.setAttachment(t?e.getAttachment(this.slotIndex,t):null)}},ft=class extends ie{constructor(e,s,t,a){super(e,s,[H.deform+"|"+t+"|"+a.id]),this.slotIndex=0,this.slotIndex=t,this.attachment=a,this.vertices=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.vertices[e]=t}setBezier(e,s,t,a,r,c,l,i,o,n,h){let d=this.curves,f=this.getFrameCount()+e*18;t==0&&(d[s]=2+f);let u=(a-c*2+i)*.03,x=o*.03-l*.06,w=((c-i)*3-a+n)*.006,p=(l-o+.33333333)*.018,y=u*2+w,m=x*2+p,g=(c-a)*.3+u+w*.16666667,b=l*.3+x+p*.16666667,v=a+g,S=b;for(let A=f+18;f<A;f+=2)d[f]=v,d[f+1]=S,g+=y,b+=m,y+=w,m+=p,v+=g,S+=b}getCurvePercent(e,s){let t=this.curves,a=t[s];switch(a){case 0:let i=this.frames[s];return(e-i)/(this.frames[s+this.getFrameEntries()]-i);case 1:return 0}if(a-=2,t[a]>e){let i=this.frames[s];return t[a+1]*(e-i)/(t[a]-i)}let r=a+18;for(a+=2;a<r;a+=2)if(t[a]>=e){let i=t[a-2],o=t[a-1];return o+(e-i)/(t[a]-i)*(t[a+1]-o)}let c=t[r-2],l=t[r-1];return l+(1-l)*(e-c)/(this.frames[s+this.getFrameEntries()]-c)}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=i.getAttachment();if(!o||!(o instanceof se)||o.timelineAttachment!=this.attachment)return;let n=i.deform;n.length==0&&(c=0);let h=this.vertices,d=h[0].length,f=this.frames;if(t<f[0]){switch(c){case 0:n.length=0;return;case 1:if(r==1){n.length=0;return}n.length=d;let m=o;if(m.bones){r=1-r;for(var u=0;u<d;u++)n[u]*=r}else{let g=m.vertices;for(var u=0;u<d;u++)n[u]+=(g[u]-n[u])*r}}return}if(n.length=d,t>=f[f.length-1]){let m=h[f.length-1];if(r==1)if(c==3){let g=o;if(g.bones)for(let b=0;b<d;b++)n[b]+=m[b];else{let b=g.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=o;if(b.bones)for(let v=0;v<d;v++)n[v]=m[v]*r;else{let v=b.vertices;for(let S=0;S<d;S++){let A=v[S];n[S]=A+(m[S]-A)*r}}break}case 1:case 2:for(let b=0;b<d;b++)n[b]+=(m[b]-n[b])*r;break;case 3:let g=o;if(g.bones)for(let b=0;b<d;b++)n[b]+=m[b]*r;else{let b=g.vertices;for(let v=0;v<d;v++)n[v]+=(m[v]-b[v])*r}}return}let x=j.search1(f,t),w=this.getCurvePercent(t,x),p=h[x],y=h[x+1];if(r==1)if(c==3){let m=o;if(m.bones)for(let g=0;g<d;g++){let b=p[g];n[g]+=b+(y[g]-b)*w}else{let g=m.vertices;for(let b=0;b<d;b++){let v=p[b];n[b]+=v+(y[b]-v)*w-g[b]}}}else for(let m=0;m<d;m++){let g=p[m];n[m]=g+(y[m]-g)*w}else switch(c){case 0:{let g=o;if(g.bones)for(let b=0;b<d;b++){let v=p[b];n[b]=(v+(y[b]-v)*w)*r}else{let b=g.vertices;for(let v=0;v<d;v++){let S=p[v],A=b[v];n[v]=A+(S+(y[v]-S)*w-A)*r}}break}case 1:case 2:for(let g=0;g<d;g++){let b=p[g];n[g]+=(b+(y[g]-b)*w-n[g])*r}break;case 3:let m=o;if(m.bones)for(let g=0;g<d;g++){let b=p[g];n[g]+=(b+(y[g]-b)*w)*r}else{let g=m.vertices;for(let b=0;b<d;b++){let v=p[b];n[b]+=(v+(y[b]-v)*w-g[b])*r}}}}},Ht=class extends j{constructor(e){super(e,Ht.propertyIds),this.events=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s){this.frames[e]=s.time,this.events[e]=s}apply(e,s,t,a,r,c,l){if(!a)return;let i=this.frames,o=this.frames.length;if(s>t)this.apply(e,s,Number.MAX_VALUE,a,r,c,l),s=-1;else if(s>=i[o-1])return;if(t<i[0])return;let n=0;if(s<i[0])n=0;else{n=j.search1(i,s)+1;let h=i[n];for(;n>0&&i[n-1]==h;)n--}for(;n<o&&t>=i[n];n++)a.push(this.events[n])}},Te=Ht;Te.propertyIds=[""+H.event];var Gt=class extends j{constructor(e){super(e,Gt.propertyIds),this.drawOrders=new Array(e)}getFrameCount(){return this.frames.length}setFrame(e,s,t){this.frames[e]=s,this.drawOrders[e]=t}apply(e,s,t,a,r,c,l){if(l==1){c==0&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}if(t<this.frames[0]){(c==0||c==1)&&B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);return}let i=j.search1(this.frames,t),o=this.drawOrders[i];if(!o)B.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let n=e.drawOrder,h=e.slots;for(let d=0,f=o.length;d<f;d++)n[d]=h[o[d]]}}},we=Gt;we.propertyIds=[""+H.drawOrder];var ut=class extends ie{constructor(e,s,t){super(e,s,[H.ikConstraint+"|"+t]),this.ikConstraintIndex=0,this.ikConstraintIndex=t}getFrameEntries(){return 6}setFrame(e,s,t,a,r,c,l){e*=6,this.frames[e]=s,this.frames[e+1]=t,this.frames[e+2]=a,this.frames[e+3]=r,this.frames[e+4]=c?1:0,this.frames[e+5]=l?1:0}apply(e,s,t,a,r,c,l){let i=e.ikConstraints[this.ikConstraintIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch;return;case 1:i.mix+=(i.data.mix-i.mix)*r,i.softness+=(i.data.softness-i.softness)*r,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}return}let n=0,h=0,d=j.search(o,t,6),f=this.curves[d/6];switch(f){case 0:let u=o[d];n=o[d+1],h=o[d+2];let x=(t-u)/(o[d+6]-u);n+=(o[d+6+1]-n)*x,h+=(o[d+6+2]-h)*x;break;case 1:n=o[d+1],h=o[d+2];break;default:n=this.getBezierValue(t,d,1,f-2),h=this.getBezierValue(t,d,2,f+18-2)}c==0?(i.mix=i.data.mix+(n-i.data.mix)*r,i.softness=i.data.softness+(h-i.data.softness)*r,l==1?(i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch):(i.bendDirection=o[d+3],i.compress=o[d+4]!=0,i.stretch=o[d+5]!=0)):(i.mix+=(n-i.mix)*r,i.softness+=(h-i.softness)*r,l==0&&(i.bendDirection=o[d+3],i.compress=o[d+4]!=0,i.stretch=o[d+5]!=0))}},mt=class extends ie{constructor(e,s,t){super(e,s,[H.transformConstraint+"|"+t]),this.transformConstraintIndex=0,this.transformConstraintIndex=t}getFrameEntries(){return 7}setFrame(e,s,t,a,r,c,l,i){let o=this.frames;e*=7,o[e]=s,o[e+1]=t,o[e+2]=a,o[e+3]=r,o[e+4]=c,o[e+5]=l,o[e+6]=i}apply(e,s,t,a,r,c,l){let i=e.transformConstraints[this.transformConstraintIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){let y=i.data;switch(c){case 0:i.mixRotate=y.mixRotate,i.mixX=y.mixX,i.mixY=y.mixY,i.mixScaleX=y.mixScaleX,i.mixScaleY=y.mixScaleY,i.mixShearY=y.mixShearY;return;case 1:i.mixRotate+=(y.mixRotate-i.mixRotate)*r,i.mixX+=(y.mixX-i.mixX)*r,i.mixY+=(y.mixY-i.mixY)*r,i.mixScaleX+=(y.mixScaleX-i.mixScaleX)*r,i.mixScaleY+=(y.mixScaleY-i.mixScaleY)*r,i.mixShearY+=(y.mixShearY-i.mixShearY)*r}return}let n,h,d,f,u,x,w=j.search(o,t,7),p=this.curves[w/7];switch(p){case 0:let y=o[w];n=o[w+1],h=o[w+2],d=o[w+3],f=o[w+4],u=o[w+5],x=o[w+6];let m=(t-y)/(o[w+7]-y);n+=(o[w+7+1]-n)*m,h+=(o[w+7+2]-h)*m,d+=(o[w+7+3]-d)*m,f+=(o[w+7+4]-f)*m,u+=(o[w+7+5]-u)*m,x+=(o[w+7+6]-x)*m;break;case 1:n=o[w+1],h=o[w+2],d=o[w+3],f=o[w+4],u=o[w+5],x=o[w+6];break;default:n=this.getBezierValue(t,w,1,p-2),h=this.getBezierValue(t,w,2,p+18-2),d=this.getBezierValue(t,w,3,p+18*2-2),f=this.getBezierValue(t,w,4,p+18*3-2),u=this.getBezierValue(t,w,5,p+18*4-2),x=this.getBezierValue(t,w,6,p+18*5-2)}if(c==0){let y=i.data;i.mixRotate=y.mixRotate+(n-y.mixRotate)*r,i.mixX=y.mixX+(h-y.mixX)*r,i.mixY=y.mixY+(d-y.mixY)*r,i.mixScaleX=y.mixScaleX+(f-y.mixScaleX)*r,i.mixScaleY=y.mixScaleY+(u-y.mixScaleY)*r,i.mixShearY=y.mixShearY+(x-y.mixShearY)*r}else i.mixRotate+=(n-i.mixRotate)*r,i.mixX+=(h-i.mixX)*r,i.mixY+=(d-i.mixY)*r,i.mixScaleX+=(f-i.mixScaleX)*r,i.mixScaleY+=(u-i.mixScaleY)*r,i.mixShearY+=(x-i.mixShearY)*r}},gt=class extends re{constructor(e,s,t){super(e,s,H.pathConstraintPosition+"|"+t),this.pathConstraintIndex=0,this.pathConstraintIndex=t}apply(e,s,t,a,r,c,l){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.position=i.data.position;return;case 1:i.position+=(i.data.position-i.position)*r}return}let n=this.getCurveValue(t);c==0?i.position=i.data.position+(n-i.data.position)*r:i.position+=(n-i.position)*r}},xt=class extends re{constructor(e,s,t){super(e,s,H.pathConstraintSpacing+"|"+t),this.pathConstraintIndex=0,this.pathConstraintIndex=t}apply(e,s,t,a,r,c,l){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.spacing=i.data.spacing;return;case 1:i.spacing+=(i.data.spacing-i.spacing)*r}return}let n=this.getCurveValue(t);c==0?i.spacing=i.data.spacing+(n-i.data.spacing)*r:i.spacing+=(n-i.spacing)*r}},wt=class extends ie{constructor(e,s,t){super(e,s,[H.pathConstraintMix+"|"+t]),this.pathConstraintIndex=0,this.pathConstraintIndex=t}getFrameEntries(){return 4}setFrame(e,s,t,a,r){let c=this.frames;e<<=2,c[e]=s,c[e+1]=t,c[e+2]=a,c[e+3]=r}apply(e,s,t,a,r,c,l){let i=e.pathConstraints[this.pathConstraintIndex];if(!i.active)return;let o=this.frames;if(t<o[0]){switch(c){case 0:i.mixRotate=i.data.mixRotate,i.mixX=i.data.mixX,i.mixY=i.data.mixY;return;case 1:i.mixRotate+=(i.data.mixRotate-i.mixRotate)*r,i.mixX+=(i.data.mixX-i.mixX)*r,i.mixY+=(i.data.mixY-i.mixY)*r}return}let n,h,d,f=j.search(o,t,4),u=this.curves[f>>2];switch(u){case 0:let x=o[f];n=o[f+1],h=o[f+2],d=o[f+3];let w=(t-x)/(o[f+4]-x);n+=(o[f+4+1]-n)*w,h+=(o[f+4+2]-h)*w,d+=(o[f+4+3]-d)*w;break;case 1:n=o[f+1],h=o[f+2],d=o[f+3];break;default:n=this.getBezierValue(t,f,1,u-2),h=this.getBezierValue(t,f,2,u+18-2),d=this.getBezierValue(t,f,3,u+18*2-2)}if(c==0){let x=i.data;i.mixRotate=x.mixRotate+(n-x.mixRotate)*r,i.mixX=x.mixX+(h-x.mixX)*r,i.mixY=x.mixY+(d-x.mixY)*r}else i.mixRotate+=(n-i.mixRotate)*r,i.mixX+=(h-i.mixX)*r,i.mixY+=(d-i.mixY)*r}},fe=class extends j{constructor(e,s,t){super(e,[H.sequence+"|"+s+"|"+t.sequence.id]),this.slotIndex=s,this.attachment=t}getFrameEntries(){return fe.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(e,s,t,a,r){let c=this.frames;e*=fe.ENTRIES,c[e]=s,c[e+fe.MODE]=t|a<<4,c[e+fe.DELAY]=r}apply(e,s,t,a,r,c,l){let i=e.slots[this.slotIndex];if(!i.bone.active)return;let o=i.attachment,n=this.attachment;if(o!=n&&(!(o instanceof se)||o.timelineAttachment!=n))return;let h=this.frames;if(t<h[0]){(c==0||c==1)&&(i.sequenceIndex=-1);return}let d=j.search(h,t,fe.ENTRIES),f=h[d],u=h[d+fe.MODE],x=h[d+fe.DELAY];if(!this.attachment.sequence)return;let w=u>>4,p=this.attachment.sequence.regions.length,y=Wt[u&15];if(y!=0)switch(w+=(t-f)/x+1e-5|0,y){case 1:w=Math.min(p-1,w);break;case 2:w%=p;break;case 3:{let m=(p<<1)-2;w=m==0?0:w%m,w>=p&&(w=m-w);break}case 4:w=Math.max(p-1-w,0);break;case 5:w=p-1-w%p;break;case 6:{let m=(p<<1)-2;w=m==0?0:(w+p-1)%m,w>=p&&(w=m-w)}}i.sequenceIndex=w}},pe=fe;pe.ENTRIES=3,pe.MODE=1,pe.DELAY=2;var Be=class{constructor(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Kt(this),this.propertyIDs=new je,this.animationsChanged=!1,this.trackEntryPool=new Ie(()=>new Jt),this.data=e}static emptyAnimation(){return Be._emptyAnimation}update(e){e*=this.timeScale;let s=this.tracks;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let c=e*r.timeScale;if(r.delay>0){if(r.delay-=c,r.delay>0)continue;c=-r.delay,r.delay=0}let l=r.next;if(l){let i=r.trackLast-l.delay;if(i>=0){for(l.delay=0,l.trackTime+=r.timeScale==0?0:(i/r.timeScale+e)*l.timeScale,r.trackTime+=c,this.setCurrent(t,l,!0);l.mixingFrom;)l.mixTime+=e,l=l.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){s[t]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,e)){let i=r.mixingFrom;for(r.mixingFrom=null,i&&(i.mixingTo=null);i;)this.queue.end(i),i=i.mixingFrom}r.trackTime+=c}this.queue.drain()}updateMixingFrom(e,s){let t=e.mixingFrom;if(!t)return!0;let a=this.updateMixingFrom(t,s);return t.animationLast=t.nextAnimationLast,t.trackLast=t.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((t.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=t.mixingFrom,t.mixingFrom&&(t.mixingFrom.mixingTo=e),e.interruptAlpha=t.interruptAlpha,this.queue.end(t)),a):(t.trackTime+=s*t.timeScale,e.mixTime+=s,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,t=this.tracks,a=!1;for(let d=0,f=t.length;d<f;d++){let u=t[d];if(!u||u.delay>0)continue;a=!0;let x=d==0?1:u.mixBlend,w=u.alpha;u.mixingFrom?w*=this.applyMixingFrom(u,e,x):u.trackTime>=u.trackEnd&&!u.next&&(w=0);let p=u.animationLast,y=u.getAnimationTime(),m=y,g=s;u.reverse&&(m=u.animation.duration-m,g=null);let b=u.animation.timelines,v=b.length;if(d==0&&w==1||x==3)for(let S=0;S<v;S++){B.webkit602BugfixHelper(w,x);var r=b[S];r instanceof xe?this.applyAttachmentTimeline(r,e,m,x,!0):r.apply(e,p,m,g,w,x,0)}else{let S=u.timelineMode,A=u.shortestRotation,Y=!A&&u.timelinesRotation.length!=v<<1;Y&&(u.timelinesRotation.length=v<<1);for(let C=0;C<v;C++){let M=b[C],R=S[C]==Pe?x:0;!A&&M instanceof Ce?this.applyRotateTimeline(M,e,m,w,R,u.timelinesRotation,C<<1,Y):M instanceof xe?this.applyAttachmentTimeline(M,e,m,x,!0):(B.webkit602BugfixHelper(w,x),M.apply(e,p,m,g,w,R,0))}}this.queueEvents(u,y),s.length=0,u.nextAnimationLast=y,u.nextTrackLast=u.trackTime}for(var c=this.unkeyedState+yt,l=e.slots,i=0,o=e.slots.length;i<o;i++){var n=l[i];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,s,t){let a=e.mixingFrom;a.mixingFrom&&this.applyMixingFrom(a,s,t);let r=0;e.mixDuration==0?(r=1,t==1&&(t=0)):(r=e.mixTime/e.mixDuration,r>1&&(r=1),t!=1&&(t=a.mixBlend));let c=r<a.attachmentThreshold,l=r<a.drawOrderThreshold,i=a.animation.timelines,o=i.length,n=a.alpha*e.interruptAlpha,h=n*(1-r),d=a.animationLast,f=a.getAnimationTime(),u=f,x=null;if(a.reverse?u=a.animation.duration-u:r<a.eventThreshold&&(x=this.events),t==3)for(let w=0;w<o;w++)i[w].apply(s,d,u,x,h,t,1);else{let w=a.timelineMode,p=a.timelineHoldMix,y=a.shortestRotation,m=!y&&a.timelinesRotation.length!=o<<1;m&&(a.timelinesRotation.length=o<<1),a.totalAlpha=0;for(let g=0;g<o;g++){let b=i[g],v=1,S,A=0;switch(w[g]){case Pe:if(!l&&b instanceof we)continue;S=t,A=h;break;case bt:S=0,A=h;break;case pt:S=t,A=n;break;case De:S=0,A=n;break;default:S=0;let Y=p[g];A=n*Math.max(0,1-Y.mixTime/Y.mixDuration);break}a.totalAlpha+=A,!y&&b instanceof Ce?this.applyRotateTimeline(b,s,u,A,S,a.timelinesRotation,g<<1,m):b instanceof xe?this.applyAttachmentTimeline(b,s,u,S,c):(B.webkit602BugfixHelper(A,t),l&&b instanceof we&&S==0&&(v=0),b.apply(s,d,u,x,A,S,v))}}return e.mixDuration>0&&this.queueEvents(a,f),this.events.length=0,a.nextAnimationLast=f,a.nextTrackLast=a.trackTime,r}applyAttachmentTimeline(e,s,t,a,r){var c=s.slots[e.slotIndex];c.bone.active&&(t<e.frames[0]?(a==0||a==1)&&this.setAttachment(s,c,c.data.attachmentName,r):this.setAttachment(s,c,e.attachmentNames[j.search1(e.frames,t)],r),c.attachmentState<=this.unkeyedState&&(c.attachmentState=this.unkeyedState+yt))}setAttachment(e,s,t,a){s.setAttachment(t?e.getAttachment(s.data.index,t):null),a&&(s.attachmentState=this.unkeyedState+Zt)}applyRotateTimeline(e,s,t,a,r,c,l,i){if(i&&(c[l]=0),a==1){e.apply(s,0,t,null,1,r,0);return}let o=s.bones[e.boneIndex];if(!o.active)return;let n=e.frames,h=0,d=0;if(t<n[0])switch(r){case 0:o.rotation=o.data.rotation;default:return;case 1:h=o.rotation,d=o.data.rotation}else h=r==0?o.data.rotation:o.rotation,d=o.data.rotation+e.getCurveValue(t);let f=0,u=d-h;if(u-=(16384-(16384.499999999996-u/360|0))*360,u==0)f=c[l];else{let x=0,w=0;i?(x=0,w=u):(x=c[l],w=c[l+1]);let p=x-x%360;f=u+p;let y=u>=0,m=x>=0;Math.abs(w)<=90&&X.signum(w)!=X.signum(u)&&(Math.abs(x-p)>180?(f+=360*X.signum(x),m=y):p!=0?f-=360*X.signum(x):m=y),m!=y&&(f+=360*X.signum(x)),c[l]=f}c[l+1]=u,o.rotation=h+f*a}queueEvents(e,s){let t=e.animationStart,a=e.animationEnd,r=a-t,c=e.trackLast%r,l=this.events,i=0,o=l.length;for(;i<o;i++){let h=l[i];if(h.time<c)break;h.time>a||this.queue.event(e,h)}let n=!1;for(e.loop?n=r==0||c>e.trackTime%r:n=s>=a&&e.animationLast<a,n&&this.queue.complete(e);i<o;i++){let h=l[i];h.time<t||this.queue.event(e,h)}}clearTracks(){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let s=0,t=this.tracks.length;s<t;s++)this.clearTrack(s);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()}clearTrack(e){if(e>=this.tracks.length)return;let s=this.tracks[e];if(!s)return;this.queue.end(s),this.clearNext(s);let t=s;for(;;){let a=t.mixingFrom;if(!a)break;this.queue.end(a),t.mixingFrom=null,t.mixingTo=null,t=a}this.tracks[s.trackIndex]=null,this.queue.drain()}setCurrent(e,s,t){let a=this.expandToIndex(e);this.tracks[e]=s,s.previous=null,a&&(t&&this.queue.interrupt(a),s.mixingFrom=a,a.mixingTo=s,s.mixTime=0,a.mixingFrom&&a.mixDuration>0&&(s.interruptAlpha*=Math.min(1,a.mixTime/a.mixDuration)),a.timelinesRotation.length=0),this.queue.start(s)}setAnimation(e,s,t=!1){let a=this.data.skeletonData.findAnimation(s);if(!a)throw new Error("Animation not found: "+s);return this.setAnimationWith(e,a,t)}setAnimationWith(e,s,t=!1){if(!s)throw new Error("animation cannot be null.");let a=!0,r=this.expandToIndex(e);r&&(r.nextTrackLast==-1?(this.tracks[e]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,a=!1):this.clearNext(r));let c=this.trackEntry(e,s,t,r);return this.setCurrent(e,c,a),this.queue.drain(),c}addAnimation(e,s,t=!1,a=0){let r=this.data.skeletonData.findAnimation(s);if(!r)throw new Error("Animation not found: "+s);return this.addAnimationWith(e,r,t,a)}addAnimationWith(e,s,t=!1,a=0){if(!s)throw new Error("animation cannot be null.");let r=this.expandToIndex(e);if(r)for(;r.next;)r=r.next;let c=this.trackEntry(e,s,t,r);return r?(r.next=c,c.previous=r,a<=0&&(a+=r.getTrackComplete()-c.mixDuration)):(this.setCurrent(e,c,!0),this.queue.drain()),c.delay=a,c}setEmptyAnimation(e,s=0){let t=this.setAnimationWith(e,Be.emptyAnimation(),!1);return t.mixDuration=s,t.trackEnd=s,t}addEmptyAnimation(e,s=0,t=0){let a=this.addAnimationWith(e,Be.emptyAnimation(),!1,t);return t<=0&&(a.delay+=a.mixDuration-s),a.mixDuration=s,a.trackEnd=s,a}setEmptyAnimations(e=0){let s=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,a=this.tracks.length;t<a;t++){let r=this.tracks[t];r&&this.setEmptyAnimation(r.trackIndex,e)}this.queue.drainDisabled=s,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,s,t,a){let r=this.trackEntryPool.obtain();return r.reset(),r.trackIndex=e,r.animation=s,r.loop=t,r.holdPrevious=!1,r.reverse=!1,r.shortestRotation=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=s.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.mixTime=0,r.mixDuration=a?this.data.getMix(a.animation,s):0,r.interruptAlpha=1,r.totalAlpha=0,r.mixBlend=2,r}clearNext(e){let s=e.next;for(;s;)this.queue.dispose(s),s=s.next;e.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let s=0,t=e.length;s<t;s++){let a=e[s];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 s=e.mixingTo,t=e.animation.timelines,a=e.animation.timelines.length,r=e.timelineMode;r.length=a;let c=e.timelineHoldMix;c.length=0;let l=this.propertyIDs;if(s&&s.holdPrevious){for(let i=0;i<a;i++)r[i]=l.addAll(t[i].getPropertyIds())?De:pt;return}e:for(let i=0;i<a;i++){let o=t[i],n=o.getPropertyIds();if(!l.addAll(n))r[i]=Pe;else if(!s||o instanceof xe||o instanceof we||o instanceof Te||!s.animation.hasTimeline(n))r[i]=bt;else{for(let h=s.mixingTo;h;h=h.mixingTo)if(!h.animation.hasTimeline(n)){if(e.mixDuration>0){r[i]=Qt,c[i]=h;continue e}break}r[i]=De}}}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 s=this.listeners.indexOf(e);s>=0&&this.listeners.splice(s,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}},jt=Be;jt._emptyAnimation=new Ee("<empty>",[],0);var Jt=class{constructor(){this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=2,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.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}},Kt=class{constructor(e){this.objects=[],this.drainDisabled=!1,this.animState=e}start(e){this.objects.push(Q.start),this.objects.push(e),this.animState.animationsChanged=!0}interrupt(e){this.objects.push(Q.interrupt),this.objects.push(e)}end(e){this.objects.push(Q.end),this.objects.push(e),this.animState.animationsChanged=!0}dispose(e){this.objects.push(Q.dispose),this.objects.push(e)}complete(e){this.objects.push(Q.complete),this.objects.push(e)}event(e,s){this.objects.push(Q.event),this.objects.push(e),this.objects.push(s)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let e=this.objects,s=this.animState.listeners;for(let t=0;t<e.length;t+=2){let a=e[t],r=e[t+1];switch(a){case Q.start:r.listener&&r.listener.start&&r.listener.start(r);for(let l=0;l<s.length;l++){let i=s[l];i.start&&i.start(r)}break;case Q.interrupt:r.listener&&r.listener.interrupt&&r.listener.interrupt(r);for(let l=0;l<s.length;l++){let i=s[l];i.interrupt&&i.interrupt(r)}break;case Q.end:r.listener&&r.listener.end&&r.listener.end(r);for(let l=0;l<s.length;l++){let i=s[l];i.end&&i.end(r)}case Q.dispose:r.listener&&r.listener.dispose&&r.listener.dispose(r);for(let l=0;l<s.length;l++){let i=s[l];i.dispose&&i.dispose(r)}this.animState.trackEntryPool.free(r);break;case Q.complete:r.listener&&r.listener.complete&&r.listener.complete(r);for(let l=0;l<s.length;l++){let i=s[l];i.complete&&i.complete(r)}break;case Q.event:let c=e[t+++2];r.listener&&r.listener.event&&r.listener.event(r,c);for(let l=0;l<s.length;l++){let i=s[l];i.event&&i.event(r,c)}break}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}},Q=(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))(Q||{}),Xs=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,s){}},Pe=0,bt=1,pt=2,De=3,Qt=4,yt=1,Zt=2,Ms=class{constructor(e){if(this.animationToMixTime={},this.defaultMix=0,!e)throw new Error("skeletonData cannot be null.");this.skeletonData=e}setMix(e,s,t){let a=this.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);let r=this.skeletonData.findAnimation(s);if(!r)throw new Error("Animation not found: "+s);this.setMixWith(a,r,t)}setMixWith(e,s,t){if(!e)throw new Error("from cannot be null.");if(!s)throw new Error("to cannot be null.");let a=e.name+"."+s.name;this.animationToMixTime[a]=t}getMix(e,s){let t=e.name+"."+s.name,a=this.animationToMixTime[t];return a===void 0?this.defaultMix:a}},Ve=class extends se{constructor(e){super(e),this.color=new L(1,1,1,1)}copy(){let e=new Ve(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e}},vt=class extends se{constructor(e){super(e),this.endSlot=null,this.color=new L(.2275,.2275,.8078,1)}copy(){let e=new vt(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},es=class{constructor(e){this._image=e}getImage(){return this._image}},Le=(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))(Le||{}),ts=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(ts||{}),ss=class{constructor(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.degrees=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}},Fs=class extends es{setFilters(e,s){}setWraps(e,s){}dispose(){}},is=class{constructor(e){this.pages=new Array,this.regions=new Array;let s=new Es(e),t=new Array(4),a={};a.size=n=>{n.width=parseInt(t[1]),n.height=parseInt(t[2])},a.format=()=>{},a.filter=n=>{n.minFilter=B.enumValue(Le,t[1]),n.magFilter=B.enumValue(Le,t[2])},a.repeat=n=>{t[1].indexOf("x")!=-1&&(n.uWrap=10497),t[1].indexOf("y")!=-1&&(n.vWrap=10497)},a.pma=n=>{n.pma=t[1]=="true"};var r={};r.xy=n=>{n.x=parseInt(t[1]),n.y=parseInt(t[2])},r.size=n=>{n.width=parseInt(t[1]),n.height=parseInt(t[2])},r.bounds=n=>{n.x=parseInt(t[1]),n.y=parseInt(t[2]),n.width=parseInt(t[3]),n.height=parseInt(t[4])},r.offset=n=>{n.offsetX=parseInt(t[1]),n.offsetY=parseInt(t[2])},r.orig=n=>{n.originalWidth=parseInt(t[1]),n.originalHeight=parseInt(t[2])},r.offsets=n=>{n.offsetX=parseInt(t[1]),n.offsetY=parseInt(t[2]),n.originalWidth=parseInt(t[3]),n.originalHeight=parseInt(t[4])},r.rotate=n=>{let h=t[1];h=="true"?n.degrees=90:h!="false"&&(n.degrees=parseInt(h))},r.index=n=>{n.index=parseInt(t[1])};let c=s.readLine();for(;c&&c.trim().length==0;)c=s.readLine();for(;!(!c||c.trim().length==0||s.readEntry(t,c)==0);)c=s.readLine();let l=null,i=null,o=null;for(;c!==null;)if(c.trim().length==0)l=null,c=s.readLine();else if(l){let n=new St(l,c);for(;;){let h=s.readEntry(t,c=s.readLine());if(h==0)break;let d=r[t[0]];if(d)d(n);else{i||(i=[]),o||(o=[]),i.push(t[0]);let f=[];for(let u=0;u<h;u++)f.push(parseInt(t[u+1]));o.push(f)}}n.originalWidth==0&&n.originalHeight==0&&(n.originalWidth=n.width,n.originalHeight=n.height),i&&i.length>0&&o&&o.length>0&&(n.names=i,n.values=o,i=null,o=null),n.u=n.x/l.width,n.v=n.y/l.height,n.degrees==90?(n.u2=(n.x+n.height)/l.width,n.v2=(n.y+n.width)/l.height):(n.u2=(n.x+n.width)/l.width,n.v2=(n.y+n.height)/l.height),this.regions.push(n)}else{for(l=new rs(c.trim());s.readEntry(t,c=s.readLine())!=0;){let n=a[t[0]];n&&n(l)}this.pages.push(l)}}findRegion(e){for(let s=0;s<this.regions.length;s++)if(this.regions[s].name==e)return this.regions[s];return null}setTextures(e,s=""){for(let t of this.pages)t.setTexture(e.get(s+t.name))}dispose(){var e;for(let s=0;s<this.pages.length;s++)(e=this.pages[s].texture)==null||e.dispose()}},Es=class{constructor(e){this.index=0,this.lines=e.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(e,s){if(!s||(s=s.trim(),s.length==0))return 0;let t=s.indexOf(":");if(t==-1)return 0;e[0]=s.substr(0,t).trim();for(let a=1,r=t+1;;a++){let c=s.indexOf(",",r);if(c==-1)return e[a]=s.substr(r).trim(),a;if(e[a]=s.substr(r,c-r).trim(),r=c+1,a==4)return 4}}},rs=class{constructor(e){this.minFilter=9728,this.magFilter=9728,this.uWrap=33071,this.vWrap=33071,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(let s of this.regions)s.texture=e}},St=class extends ss{constructor(e,s){super(),this.x=0,this.y=0,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0,this.index=0,this.degrees=0,this.names=null,this.values=null,this.page=e,this.name=s,e.regions.push(this)}},ye=class extends se{constructor(e,s){super(e),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new L(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new L(0,0,0,0),this.path=s}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 s=this.uvs,t=this.uvs.length,a=this.region.u,r=this.region.v,c=0,l=0;if(this.region instanceof St){let i=this.region,o=i.page,n=o.width,h=o.height;switch(i.degrees){case 90:a-=(i.originalHeight-i.offsetY-i.height)/n,r-=(i.originalWidth-i.offsetX-i.width)/h,c=i.originalHeight/n,l=i.originalWidth/h;for(let d=0;d<t;d+=2)s[d]=a+e[d+1]*c,s[d+1]=r+(1-e[d])*l;return;case 180:a-=(i.originalWidth-i.offsetX-i.width)/n,r-=i.offsetY/h,c=i.originalWidth/n,l=i.originalHeight/h;for(let d=0;d<t;d+=2)s[d]=a+(1-e[d])*c,s[d+1]=r+(1-e[d+1])*l;return;case 270:a-=i.offsetY/n,r-=i.offsetX/h,c=i.originalHeight/n,l=i.originalWidth/h;for(let d=0;d<t;d+=2)s[d]=a+(1-e[d+1])*c,s[d+1]=r+e[d]*l;return}a-=i.offsetX/n,r-=(i.originalHeight-i.offsetY-i.height)/h,c=i.originalWidth/n,l=i.originalHeight/h}else this.region?(c=this.region.u2-a,l=this.region.v2-r):(a=r=0,c=l=1);for(let i=0;i<t;i+=2)s[i]=a+e[i]*c,s[i+1]=r+e[i+1]*l}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),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,s,t,a,r,c){this.sequence!=null&&this.sequence.apply(e,this),super.computeWorldVertices(e,s,t,a,r,c)}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}},ve=class extends se{constructor(e){super(e),this.lengths=[],this.closed=!1,this.constantSpeed=!1,this.color=new L(1,1,1,1)}copy(){let e=new ve(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}},At=class extends se{constructor(e){super(e),this.x=0,this.y=0,this.rotation=0,this.color=new L(.38,.94,0,1)}computeWorldPosition(e,s){return s.x=this.x*e.a+this.y*e.b+e.worldX,s.y=this.x*e.c+this.y*e.d+e.worldY,s}computeWorldRotation(e){let s=X.cosDeg(this.rotation),t=X.sinDeg(this.rotation),a=s*e.a+t*e.b,r=s*e.c+t*e.d;return Math.atan2(r,a)*X.radDeg}copy(){let e=new At(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},as=class extends Je{constructor(e,s){super(e),this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.rotation=0,this.width=0,this.height=0,this.color=new L(1,1,1,1),this.region=null,this.sequence=null,this.offset=B.newFloatArray(8),this.uvs=B.newFloatArray(8),this.tempColor=new L(1,1,1,1),this.path=s}updateRegion(){if(!this.region)throw new Error("Region not set.");let e=this.region,s=this.uvs;if(e==null){s[0]=0,s[1]=0,s[2]=0,s[3]=1,s[4]=1,s[5]=1,s[6]=1,s[7]=0;return}let t=this.width/this.region.originalWidth*this.scaleX,a=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*t,c=-this.height/2*this.scaleY+this.region.offsetY*a,l=r+this.region.width*t,i=c+this.region.height*a,o=this.rotation*Math.PI/180,n=Math.cos(o),h=Math.sin(o),d=this.x,f=this.y,u=r*n+d,x=r*h,w=c*n+f,p=c*h,y=l*n+d,m=l*h,g=i*n+f,b=i*h,v=this.offset;v[0]=u-p,v[1]=w+x,v[2]=u-b,v[3]=g+x,v[4]=y-b,v[5]=g+m,v[6]=y-p,v[7]=w+m,e.degrees==90?(s[0]=e.u2,s[1]=e.v2,s[2]=e.u,s[3]=e.v2,s[4]=e.u,s[5]=e.v,s[6]=e.u2,s[7]=e.v):(s[0]=e.u,s[1]=e.v2,s[2]=e.u,s[3]=e.v,s[4]=e.u2,s[5]=e.v,s[6]=e.u2,s[7]=e.v2)}computeWorldVertices(e,s,t,a){this.sequence!=null&&this.sequence.apply(e,this);let r=e.bone,c=this.offset,l=r.worldX,i=r.worldY,o=r.a,n=r.b,h=r.c,d=r.d,f=0,u=0;f=c[0],u=c[1],s[t]=f*o+u*n+l,s[t+1]=f*h+u*d+i,t+=a,f=c[2],u=c[3],s[t]=f*o+u*n+l,s[t+1]=f*h+u*d+i,t+=a,f=c[4],u=c[5],s[t]=f*o+u*n+l,s[t+1]=f*h+u*d+i,t+=a,f=c[6],u=c[7],s[t]=f*o+u*n+l,s[t+1]=f*h+u*d+i}copy(){let e=new as(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}},W=as;W.X1=0,W.Y1=1,W.C1R=2,W.C1G=3,W.C1B=4,W.C1A=5,W.U1=6,W.V1=7,W.X2=8,W.Y2=9,W.C2R=10,W.C2G=11,W.C2B=12,W.C2A=13,W.U2=14,W.V2=15,W.X3=16,W.Y3=17,W.C3R=18,W.C3G=19,W.C3B=20,W.C3A=21,W.U3=22,W.V3=23,W.X4=24,W.Y4=25,W.C4R=26,W.C4G=27,W.C4B=28,W.C4A=29,W.U4=30,W.V4=31;var Rs=class{constructor(e){this.atlas=e}loadSequence(e,s,t){let a=t.regions;for(let r=0,c=a.length;r<c;r++){let l=t.getPath(s,r),i=this.atlas.findRegion(l);if(i==null)throw new Error("Region not found in atlas: "+l+" (sequence: "+e+")");a[r]=i}}newRegionAttachment(e,s,t,a){let r=new W(s,t);if(a!=null)this.loadSequence(s,t,a);else{let c=this.atlas.findRegion(t);if(!c)throw new Error("Region not found in atlas: "+t+" (region attachment: "+s+")");r.region=c}return r}newMeshAttachment(e,s,t,a){let r=new ye(s,t);if(a!=null)this.loadSequence(s,t,a);else{let c=this.atlas.findRegion(t);if(!c)throw new Error("Region not found in atlas: "+t+" (mesh attachment: "+s+")");r.region=c}return r}newBoundingBoxAttachment(e,s){return new Ve(s)}newPathAttachment(e,s){return new ve(s)}newPointAttachment(e,s){return new At(s)}newClippingAttachment(e,s){return new vt(s)}},kt=class{constructor(e,s,t){if(this.index=0,this.parent=null,this.length=0,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=Ne.Normal,this.skinRequired=!1,this.color=new L,e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");this.index=e,this.name=s,this.parent=t}},Ne=(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))(Ne||{}),Yt=class{constructor(e,s,t){if(this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=s,this.parent=t,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,s,t,a,r,c,l){this.ax=e,this.ay=s,this.arotation=t,this.ascaleX=a,this.ascaleY=r,this.ashearX=c,this.ashearY=l;let i=this.parent;if(!i){let f=this.skeleton,u=t+90+l,x=f.scaleX,w=f.scaleY;this.a=X.cosDeg(t+c)*a*x,this.b=X.cosDeg(u)*r*x,this.c=X.sinDeg(t+c)*a*w,this.d=X.sinDeg(u)*r*w,this.worldX=e*x+f.x,this.worldY=s*w+f.y;return}let o=i.a,n=i.b,h=i.c,d=i.d;switch(this.worldX=o*e+n*s+i.worldX,this.worldY=h*e+d*s+i.worldY,this.data.transformMode){case 0:{let f=t+90+l,u=X.cosDeg(t+c)*a,x=X.cosDeg(f)*r,w=X.sinDeg(t+c)*a,p=X.sinDeg(f)*r;this.a=o*u+n*w,this.b=o*x+n*p,this.c=h*u+d*w,this.d=h*x+d*p;return}case 1:{let f=t+90+l;this.a=X.cosDeg(t+c)*a,this.b=X.cosDeg(f)*r,this.c=X.sinDeg(t+c)*a,this.d=X.sinDeg(f)*r;break}case 2:{let f=o*o+h*h,u=0;f>1e-4?(f=Math.abs(o*d-n*h)/f,o/=this.skeleton.scaleX,h/=this.skeleton.scaleY,n=h*f,d=o*f,u=Math.atan2(h,o)*X.radDeg):(o=0,h=0,u=90-Math.atan2(d,n)*X.radDeg);let x=t+c-u,w=t+l-u+90,p=X.cosDeg(x)*a,y=X.cosDeg(w)*r,m=X.sinDeg(x)*a,g=X.sinDeg(w)*r;this.a=o*p-n*m,this.b=o*y-n*g,this.c=h*p+d*m,this.d=h*y+d*g;break}case 3:case 4:{let f=X.cosDeg(t),u=X.sinDeg(t),x=(o*f+n*u)/this.skeleton.scaleX,w=(h*f+d*u)/this.skeleton.scaleY,p=Math.sqrt(x*x+w*w);p>1e-5&&(p=1/p),x*=p,w*=p,p=Math.sqrt(x*x+w*w),this.data.transformMode==3&&o*d-n*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(p=-p);let y=Math.PI/2+Math.atan2(w,x),m=Math.cos(y)*p,g=Math.sin(y)*p,b=X.cosDeg(c)*a,v=X.cosDeg(90+l)*r,S=X.sinDeg(c)*a,A=X.sinDeg(90+l)*r;this.a=x*b+m*S,this.b=x*v+m*A,this.c=w*b+g*S,this.d=w*v+g*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}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 s=e.a,t=e.b,a=e.c,r=e.d,c=1/(s*r-t*a),l=r*c,i=t*c,o=a*c,n=s*c,h=this.worldX-e.worldX,d=this.worldY-e.worldY;this.ax=h*l-d*i,this.ay=d*n-h*o;let f,u,x,w;if(this.data.transformMode==1)f=this.a,u=this.b,x=this.c,w=this.d;else{switch(this.data.transformMode){case 2:{let b=Math.abs(s*r-t*a)/(s*s+a*a),v=s/this.skeleton.scaleX;t=-(a/this.skeleton.scaleY)*b*this.skeleton.scaleX,r=v*b*this.skeleton.scaleY,c=1/(s*r-t*a),l=r*c,i=t*c;break}case 3:case 4:let p=X.cosDeg(this.rotation),y=X.sinDeg(this.rotation);s=(s*p+t*y)/this.skeleton.scaleX,a=(a*p+r*y)/this.skeleton.scaleY;let m=Math.sqrt(s*s+a*a);m>1e-5&&(m=1/m),s*=m,a*=m,m=Math.sqrt(s*s+a*a),this.data.transformMode==3&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(m=-m);let g=X.PI/2+Math.atan2(a,s);t=Math.cos(g)*m,r=Math.sin(g)*m,c=1/(s*r-t*a),l=r*c,i=t*c,o=a*c,n=s*c}f=l*this.a-i*this.c,u=l*this.b-i*this.d,x=n*this.c-o*this.a,w=n*this.d-o*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+x*x),this.ascaleX>1e-4){let p=f*w-u*x;this.ascaleY=p/this.ascaleX,this.ashearY=-Math.atan2(f*u+x*w,p)*X.radDeg,this.arotation=Math.atan2(x,f)*X.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+w*w),this.ashearY=0,this.arotation=90-Math.atan2(w,u)*X.radDeg}worldToLocal(e){let s=1/(this.a*this.d-this.b*this.c),t=e.x-this.worldX,a=e.y-this.worldY;return e.x=t*this.d*s-a*this.b*s,e.y=a*this.a*s-t*this.c*s,e}localToWorld(e){let s=e.x,t=e.y;return e.x=s*this.a+t*this.b+this.worldX,e.y=s*this.c+t*this.d+this.worldY,e}worldToLocalRotation(e){let s=X.sinDeg(e),t=X.cosDeg(e);return Math.atan2(this.a*s-this.c*t,this.d*t-this.b*s)*X.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=X.sinDeg(e),t=X.cosDeg(e);return Math.atan2(t*this.c+s*this.d,t*this.a+s*this.b)*X.radDeg}rotateWorld(e){let s=this.a,t=this.b,a=this.c,r=this.d,c=X.cosDeg(e),l=X.sinDeg(e);this.a=c*s-l*a,this.b=c*t-l*r,this.c=l*s+c*a,this.d=l*t+c*r}},qe=class{constructor(e,s,t){this.name=e,this.order=s,this.skinRequired=t}},Bs=class{constructor(e,s="",t=new ns){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=s,this.downloader=t}start(e){return this.toLoad++,this.pathPrefix+e}success(e,s,t){this.toLoad--,this.loaded++,this.assets[s]=t,e&&e(s,t)}error(e,s,t){this.toLoad--,this.loaded++,this.errors[s]=t,e&&e(s,t)}loadAll(){return new Promise((s,t)=>{let a=()=>{if(this.isLoadingComplete()){this.hasErrors()?t(this.errors):s(this);return}requestAnimationFrame(a)};requestAnimationFrame(a)})}setRawDataURI(e,s){this.downloader.rawDataUris[this.pathPrefix+e]=s}loadBinary(e,s=()=>{},t=()=>{}){e=this.start(e),this.downloader.downloadBinary(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load binary ${e}: status ${a}, ${r}`)})}loadText(e,s=()=>{},t=()=>{}){e=this.start(e),this.downloader.downloadText(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load text ${e}: status ${a}, ${r}`)})}loadJson(e,s=()=>{},t=()=>{}){e=this.start(e),this.downloader.downloadJson(e,a=>{this.success(s,e,a)},(a,r)=>{this.error(t,e,`Couldn't load JSON ${e}: status ${a}, ${r}`)})}loadTexture(e,s=()=>{},t=()=>{}){if(e=this.start(e),!!!(typeof window!="undefined"&&typeof navigator!="undefined"&&window.document))fetch(e,{mode:"cors"}).then(c=>c.ok?c.blob():(this.error(t,e,`Couldn't load image: ${e}`),null)).then(c=>c?createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(c=>{c&&this.success(s,e,this.textureLoader(c))});else{let c=new Image;c.crossOrigin="anonymous",c.onload=()=>{this.success(s,e,this.textureLoader(c))},c.onerror=()=>{this.error(t,e,`Couldn't load image: ${e}`)},this.downloader.rawDataUris[e]&&(e=this.downloader.rawDataUris[e]),c.src=e}}loadTextureAtlas(e,s=()=>{},t=()=>{},a){let r=e.lastIndexOf("/"),c=r>=0?e.substring(0,r+1):"";e=this.start(e),this.downloader.downloadText(e,l=>{try{let i=new is(l),o=i.pages.length,n=!1;for(let h of i.pages)this.loadTexture(a?a[h.name]:c+h.name,(d,f)=>{n||(h.setTexture(f),--o==0&&this.success(s,e,i))},(d,f)=>{n||this.error(t,e,`Couldn't load texture atlas ${e} page image: ${d}`),n=!0})}catch(i){this.error(t,e,`Couldn't parse texture atlas ${e}: ${i.message}`)}},(l,i)=>{this.error(t,e,`Couldn't load texture atlas ${e}: status ${l}, ${i}`)})}get(e){return this.assets[this.pathPrefix+e]}require(e){e=this.pathPrefix+e;let s=this.assets[e];if(s)return s;let t=this.errors[e];throw Error("Asset not found: "+e+(t?`
|
|
2
|
-
`+t:""))}remove(e){e=this.pathPrefix+e;let s=this.assets[e];return s.dispose&&s.dispose(),delete this.assets[e],s}removeAll(){for(let e in this.assets){let s=this.assets[e];s.dispose&&s.dispose()}this.assets={}}isLoadingComplete(){return this.toLoad==0}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}},ns=class{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let s=e.indexOf("base64,");return s!=-1?(s+=7,atob(e.substr(s))):e.substr(e.indexOf(",")+1)}base64ToUint8Array(e){for(var s=window.atob(e),t=s.length,a=new Uint8Array(t),r=0;r<t;r++)a[r]=s.charCodeAt(r);return a}dataUriToUint8Array(e){if(!e.startsWith("data:"))throw new Error("Not a data URI.");let s=e.indexOf("base64,");if(s==-1)throw new Error("Not a binary data URI.");return s+=7,this.base64ToUint8Array(e.substr(s))}downloadText(e,s,t){if(this.start(e,s,t))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 r=()=>{this.finish(e,a.status,a.responseText)};a.onload=r,a.onerror=r,a.send()}downloadJson(e,s,t){this.downloadText(e,a=>{s(JSON.parse(a))},t)}downloadBinary(e,s,t){if(this.start(e,s,t))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 r=()=>{this.finish(e,a.status,a.response)};a.onload=()=>{a.status==200||a.status==0?this.finish(e,200,new Uint8Array(a.response)):r()},a.onerror=r,a.send()}start(e,s,t){let a=this.callbacks[e];try{if(a)return!0;this.callbacks[e]=a=[]}finally{a.push(s,t)}}finish(e,s,t){let a=this.callbacks[e];delete this.callbacks[e];let r=s==200||s==0?[t]:[s,t];for(let c=r.length-1,l=a.length;c<l;c+=2)a[c].apply(null,r)}},It=class{constructor(e,s){if(this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!s)throw new Error("data cannot be null.");this.time=e,this.data=s}},Ct=class{constructor(e){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=e}},ls=class{constructor(e,s){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)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 r=s.findBone(e.bones[a].name);if(!r)throw new Error(`Couldn't find bone ${e.bones[a].name}`);this.bones.push(r)}let t=s.findBone(e.target.name);if(!t)throw new Error(`Couldn't find bone ${e.target.name}`);this.target=t}isActive(){return this.active}update(){if(this.mix==0)return;let e=this.target,s=this.bones;switch(s.length){case 1:this.apply1(s[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(s[0],s[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix);break}}apply1(e,s,t,a,r,c,l){let i=e.parent;if(!i)throw new Error("IK bone must have parent.");let o=i.a,n=i.b,h=i.c,d=i.d,f=-e.ashearX-e.arotation,u=0,x=0;switch(e.data.transformMode){case 1:u=s-e.worldX,x=t-e.worldY;break;case 2:let y=Math.abs(o*d-n*h)/Math.max(1e-4,o*o+h*h),m=o/e.skeleton.scaleX,g=h/e.skeleton.scaleY;n=-g*y*e.skeleton.scaleX,d=m*y*e.skeleton.scaleY,f+=Math.atan2(g,m)*X.radDeg;default:let b=s-i.worldX,v=t-i.worldY,S=o*d-n*h;Math.abs(S)<=1e-4?(u=0,x=0):(u=(b*d-v*n)/S-e.ax,x=(v*o-b*h)/S-e.ay)}f+=Math.atan2(x,u)*X.radDeg,e.ascaleX<0&&(f+=180),f>180?f-=360:f<-180&&(f+=360);let w=e.ascaleX,p=e.ascaleY;if(a||r){switch(e.data.transformMode){case 3:case 4:u=s-e.worldX,x=t-e.worldY}let y=e.data.length*w,m=Math.sqrt(u*u+x*x);if(a&&m<y||r&&m>y&&y>1e-4){let g=(m/y-1)*l+1;w*=g,c&&(p*=g)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+f*l,w,p,e.ashearX,e.ashearY)}apply2(e,s,t,a,r,c,l,i,o){let n=e.ax,h=e.ay,d=e.ascaleX,f=e.ascaleY,u=d,x=f,w=s.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),w<0?(w=-w,y=180):y=0;let g=s.ax,b=0,v=0,S=0,A=e.a,Y=e.b,C=e.c,M=e.d,R=Math.abs(d-f)<=1e-4;!R||c?(b=0,v=A*g+e.worldX,S=C*g+e.worldY):(b=s.ay,v=A*g+Y*b+e.worldX,S=C*g+M*b+e.worldY);let E=e.parent;if(!E)throw new Error("IK parent must itself have a parent.");A=E.a,Y=E.b,C=E.c,M=E.d;let F=A*M-Y*C,I=v-E.worldX,T=S-E.worldY;F=Math.abs(F)<=1e-4?0:1/F;let P=(I*M-T*Y)*F-n,O=(T*A-I*C)*F-h,D=Math.sqrt(P*P+O*O),U=s.data.length*w,N,$;if(D<1e-4){this.apply1(e,t,a,!1,c,!1,o),s.updateWorldTransformWith(g,b,0,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY);return}I=t-E.worldX,T=a-E.worldY;let q=(I*M-T*Y)*F-n,V=(T*A-I*C)*F-h,G=q*q+V*V;if(i!=0){i*=d*(w+1)*.5;let J=Math.sqrt(G),ee=J-D-U*d+i;if(ee>0){let te=Math.min(1,ee/(i*2))-1;te=(ee-i*(1-te*te))/J,q-=te*q,V-=te*V,G=q*q+V*V}}e:if(R){U*=d;let J=(G-D*D-U*U)/(2*D*U);J<-1?(J=-1,$=Math.PI*r):J>1?(J=1,$=0,c&&(A=(Math.sqrt(G)/(D+U)-1)*o+1,u*=A,l&&(x*=A))):$=Math.acos(J)*r,A=D+U*J,Y=U*Math.sin($),N=Math.atan2(V*A-q*Y,q*A+V*Y)}else{A=d*U,Y=f*U;let J=A*A,ee=Y*Y,te=Math.atan2(V,q);C=ee*D*D+J*G-J*ee;let me=-2*ee*D,Ae=ee-J;if(M=me*me-4*Ae*C,M>=0){let ke=Math.sqrt(M);me<0&&(ke=-ke),ke=-(me+ke)*.5;let xs=ke/Ae,ws=C/ke,Ye=Math.abs(xs)<Math.abs(ws)?xs:ws;if(Ye*Ye<=G){T=Math.sqrt(G-Ye*Ye)*r,N=te-Math.atan2(T,Ye),$=Math.atan2(T/f,(Ye-D)/d);break e}}let Xe=X.PI,$e=D-A,Vt=$e*$e,us=0,ms=0,He=D+A,Lt=He*He,gs=0;C=-A*D/(J-ee),C>=-1&&C<=1&&(C=Math.acos(C),I=A*Math.cos(C)+D,T=Y*Math.sin(C),M=I*I+T*T,M<Vt&&(Xe=C,Vt=M,$e=I,us=T),M>Lt&&(ms=C,Lt=M,He=I,gs=T)),G<=(Vt+Lt)*.5?(N=te-Math.atan2(us*r,$e),$=Xe*r):(N=te-Math.atan2(gs*r,He),$=ms*r)}let K=Math.atan2(b,g)*m,le=e.arotation;N=(N-K)*X.radDeg+p-le,N>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(n,h,le+N*o,u,x,0,0),le=s.arotation,$=(($+K)*X.radDeg-s.ashearX)*m+y-le,$>180?$-=360:$<-180&&($+=360),s.updateWorldTransformWith(g,b,le+$*o,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}},Tt=class extends qe{constructor(e){super(e,0,!1),this.bones=new Array,this._target=null,this.bendDirection=1,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=1,this.softness=0}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Xt=class extends qe{constructor(e){super(e,0,!1),this.bones=new Array,this._target=null,this.positionMode=Oe.Fixed,this.spacingMode=_e.Fixed,this.rotateMode=Ue.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}},Oe=(e=>(e[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",e))(Oe||{}),_e=(e=>(e[e.Length=0]="Length",e[e.Fixed=1]="Fixed",e[e.Percent=2]="Percent",e[e.Proportional=3]="Proportional",e))(_e||{}),Ue=(e=>(e[e.Tangent=0]="Tangent",e[e.Chain=1]="Chain",e[e.ChainScale=2]="ChainScale",e))(Ue||{}),ce=class{constructor(e,s){if(this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(let a=0,r=e.bones.length;a<r;a++){let c=s.findBone(e.bones[a].name);if(!c)throw new Error(`Couldn't find bone ${e.bones[a].name}.`);this.bones.push(c)}let t=s.findSlot(e.target.name);if(!t)throw new Error(`Couldn't find target bone ${e.target.name}`);this.target=t,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 ve))return;let s=this.mixRotate,t=this.mixX,a=this.mixY;if(s==0&&t==0&&a==0)return;let r=this.data,c=r.rotateMode==0,l=r.rotateMode==2,i=this.bones,o=i.length,n=c?o:o+1,h=B.setArraySize(this.spaces,n),d=l?this.lengths=B.setArraySize(this.lengths,o):[],f=this.spacing;switch(r.spacingMode){case 2:if(l)for(let b=0,v=n-1;b<v;b++){let S=i[b],A=S.data.length;if(A<ce.epsilon)d[b]=0;else{let Y=A*S.a,C=A*S.c;d[b]=Math.sqrt(Y*Y+C*C)}}B.arrayFill(h,1,n,f);break;case 3:let m=0;for(let b=0,v=n-1;b<v;){let S=i[b],A=S.data.length;if(A<ce.epsilon)l&&(d[b]=0),h[++b]=f;else{let Y=A*S.a,C=A*S.c,M=Math.sqrt(Y*Y+C*C);l&&(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 g=r.spacingMode==0;for(let b=0,v=n-1;b<v;){let S=i[b],A=S.data.length;if(A<ce.epsilon)l&&(d[b]=0),h[++b]=f;else{let Y=A*S.a,C=A*S.c,M=Math.sqrt(Y*Y+C*C);l&&(d[b]=M),h[++b]=(g?A+f:f)*M/A}}}let u=this.computeWorldPositions(e,n,c),x=u[0],w=u[1],p=r.offsetRotation,y=!1;if(p==0)y=r.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,g=3;m<o;m++,g+=3){let b=i[m];b.worldX+=(x-b.worldX)*t,b.worldY+=(w-b.worldY)*a;let v=u[g],S=u[g+1],A=v-x,Y=S-w;if(l){let C=d[m];if(C!=0){let M=(Math.sqrt(A*A+Y*Y)/C-1)*s+1;b.a*=M,b.c*=M}}if(x=v,w=S,s>0){let C=b.a,M=b.b,R=b.c,E=b.d,F=0,I=0,T=0;if(c?F=u[g-1]:h[m+1]==0?F=u[g+2]:F=Math.atan2(Y,A),F-=Math.atan2(R,C),y){I=Math.cos(F),T=Math.sin(F);let P=b.data.length;x+=(P*(I*C-T*R)-A)*s,w+=(P*(T*C+I*R)-Y)*s}else F+=p;F>X.PI?F-=X.PI2:F<-X.PI&&(F+=X.PI2),F*=s,I=Math.cos(F),T=Math.sin(F),b.a=I*C-T*R,b.b=I*M-T*E,b.c=T*C+I*R,b.d=T*M+I*E}b.updateAppliedTransform()}}computeWorldPositions(e,s,t){let a=this.target,r=this.position,c=this.spaces,l=B.setArraySize(this.positions,s*3+2),i=this.world,o=e.closed,n=e.worldVerticesLength,h=n/6,d=ce.NONE;if(!e.constantSpeed){let O=e.lengths;h-=o?1:2;let D=O[h];this.data.positionMode==1&&(r*=D);let U;switch(this.data.spacingMode){case 2:U=D;break;case 3:U=D/s;break;default:U=1}i=B.setArraySize(this.world,8);for(let N=0,$=0,q=0;N<s;N++,$+=3){let V=c[N]*U;r+=V;let G=r;if(o)G%=D,G<0&&(G+=D),q=0;else if(G<0){d!=ce.BEFORE&&(d=ce.BEFORE,e.computeWorldVertices(a,2,4,i,0,2)),this.addBeforePosition(G,i,0,l,$);continue}else if(G>D){d!=ce.AFTER&&(d=ce.AFTER,e.computeWorldVertices(a,n-6,4,i,0,2)),this.addAfterPosition(G-D,i,0,l,$);continue}for(;;q++){let K=O[q];if(!(G>K)){if(q==0)G/=K;else{let le=O[q-1];G=(G-le)/(K-le)}break}}q!=d&&(d=q,o&&q==h?(e.computeWorldVertices(a,n-4,4,i,0,2),e.computeWorldVertices(a,0,4,i,4,2)):e.computeWorldVertices(a,q*6+2,8,i,0,2)),this.addCurvePosition(G,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],l,$,t||N>0&&V==0)}return l}o?(n+=2,i=B.setArraySize(this.world,n),e.computeWorldVertices(a,2,n-4,i,0,2),e.computeWorldVertices(a,0,2,i,n-4,2),i[n-2]=i[0],i[n-1]=i[1]):(h--,n-=4,i=B.setArraySize(this.world,n),e.computeWorldVertices(a,2,n,i,0,2));let f=B.setArraySize(this.curves,h),u=0,x=i[0],w=i[1],p=0,y=0,m=0,g=0,b=0,v=0,S=0,A=0,Y=0,C=0,M=0,R=0,E=0,F=0;for(let O=0,D=2;O<h;O++,D+=6)p=i[D],y=i[D+1],m=i[D+2],g=i[D+3],b=i[D+4],v=i[D+5],S=(x-p*2+m)*.1875,A=(w-y*2+g)*.1875,Y=((p-m)*3-x+b)*.09375,C=((y-g)*3-w+v)*.09375,M=S*2+Y,R=A*2+C,E=(p-x)*.75+S+Y*.16666667,F=(y-w)*.75+A+C*.16666667,u+=Math.sqrt(E*E+F*F),E+=M,F+=R,M+=Y,R+=C,u+=Math.sqrt(E*E+F*F),E+=M,F+=R,u+=Math.sqrt(E*E+F*F),E+=M+Y,F+=R+C,u+=Math.sqrt(E*E+F*F),f[O]=u,x=b,w=v;this.data.positionMode==1&&(r*=u);let I;switch(this.data.spacingMode){case 2:I=u;break;case 3:I=u/s;break;default:I=1}let T=this.segments,P=0;for(let O=0,D=0,U=0,N=0;O<s;O++,D+=3){let $=c[O]*I;r+=$;let q=r;if(o)q%=u,q<0&&(q+=u),U=0;else if(q<0){this.addBeforePosition(q,i,0,l,D);continue}else if(q>u){this.addAfterPosition(q-u,i,n-4,l,D);continue}for(;;U++){let V=f[U];if(!(q>V)){if(U==0)q/=V;else{let G=f[U-1];q=(q-G)/(V-G)}break}}if(U!=d){d=U;let V=U*6;for(x=i[V],w=i[V+1],p=i[V+2],y=i[V+3],m=i[V+4],g=i[V+5],b=i[V+6],v=i[V+7],S=(x-p*2+m)*.03,A=(w-y*2+g)*.03,Y=((p-m)*3-x+b)*.006,C=((y-g)*3-w+v)*.006,M=S*2+Y,R=A*2+C,E=(p-x)*.3+S+Y*.16666667,F=(y-w)*.3+A+C*.16666667,P=Math.sqrt(E*E+F*F),T[0]=P,V=1;V<8;V++)E+=M,F+=R,M+=Y,R+=C,P+=Math.sqrt(E*E+F*F),T[V]=P;E+=M,F+=R,P+=Math.sqrt(E*E+F*F),T[8]=P,E+=M+Y,F+=R+C,P+=Math.sqrt(E*E+F*F),T[9]=P,N=0}for(q*=P;;N++){let V=T[N];if(!(q>V)){if(N==0)q/=V;else{let G=T[N-1];q=N+(q-G)/(V-G)}break}}this.addCurvePosition(q*.1,x,w,p,y,m,g,b,v,l,D,t||O>0&&$==0)}return l}addBeforePosition(e,s,t,a,r){let c=s[t],l=s[t+1],i=s[t+2]-c,o=s[t+3]-l,n=Math.atan2(o,i);a[r]=c+e*Math.cos(n),a[r+1]=l+e*Math.sin(n),a[r+2]=n}addAfterPosition(e,s,t,a,r){let c=s[t+2],l=s[t+3],i=c-s[t],o=l-s[t+1],n=Math.atan2(o,i);a[r]=c+e*Math.cos(n),a[r+1]=l+e*Math.sin(n),a[r+2]=n}addCurvePosition(e,s,t,a,r,c,l,i,o,n,h,d){if(e==0||isNaN(e)){n[h]=s,n[h+1]=t,n[h+2]=Math.atan2(r-t,a-s);return}let f=e*e,u=f*e,x=1-e,w=x*x,p=w*x,y=x*e,m=y*3,g=x*m,b=m*e,v=s*p+a*g+c*b+i*u,S=t*p+r*g+l*b+o*u;n[h]=v,n[h+1]=S,d&&(e<.001?n[h+2]=Math.atan2(r-t,a-s):n[h+2]=Math.atan2(S-(t*w+r*y*2+l*f),v-(s*w+a*y*2+c*f)))}},Se=ce;Se.NONE=-1,Se.BEFORE=-2,Se.AFTER=-3,Se.epsilon=1e-5;var os=class{constructor(e,s){if(this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!s)throw new Error("bone cannot be null.");this.data=e,this.bone=s,this.color=new L,this.darkColor=e.darkColor?new L: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}},hs=class{constructor(e,s){if(this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new Me,this.active=!1,!e)throw new Error("data cannot be null.");if(!s)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 r=s.findBone(e.bones[a].name);if(!r)throw new Error(`Couldn't find bone ${e.bones[a].name}.`);this.bones.push(r)}let t=s.findBone(e.target.name);if(!t)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=t}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,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=s!=0||t!=0,i=this.target,o=i.a,n=i.b,h=i.c,d=i.d,f=o*d-n*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,x=this.data.offsetShearY*f,w=this.bones;for(let p=0,y=w.length;p<y;p++){let m=w[p];if(e!=0){let g=m.a,b=m.b,v=m.c,S=m.d,A=Math.atan2(h,o)-Math.atan2(v,g)+u;A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A*=e;let Y=Math.cos(A),C=Math.sin(A);m.a=Y*g-C*v,m.b=Y*b-C*S,m.c=C*g+Y*v,m.d=C*b+Y*S}if(l){let g=this.temp;i.localToWorld(g.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(g.x-m.worldX)*s,m.worldY+=(g.y-m.worldY)*t}if(a!=0){let g=Math.sqrt(m.a*m.a+m.c*m.c);g!=0&&(g=(g+(Math.sqrt(o*o+h*h)-g+this.data.offsetScaleX)*a)/g),m.a*=g,m.c*=g}if(r!=0){let g=Math.sqrt(m.b*m.b+m.d*m.d);g!=0&&(g=(g+(Math.sqrt(n*n+d*d)-g+this.data.offsetScaleY)*r)/g),m.b*=g,m.d*=g}if(c>0){let g=m.b,b=m.d,v=Math.atan2(b,g),S=Math.atan2(d,n)-Math.atan2(h,o)-(v-Math.atan2(m.c,m.a));S>X.PI?S-=X.PI2:S<-X.PI&&(S+=X.PI2),S=v+(S+x)*c;let A=Math.sqrt(g*g+b*b);m.b=Math.cos(S)*A,m.d=Math.sin(S)*A}m.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=s!=0||t!=0,i=this.target,o=i.a,n=i.b,h=i.c,d=i.d,f=o*d-n*h>0?X.degRad:-X.degRad,u=this.data.offsetRotation*f,x=this.data.offsetShearY*f,w=this.bones;for(let p=0,y=w.length;p<y;p++){let m=w[p];if(e!=0){let g=m.a,b=m.b,v=m.c,S=m.d,A=Math.atan2(h,o)+u;A>X.PI?A-=X.PI2:A<-X.PI&&(A+=X.PI2),A*=e;let Y=Math.cos(A),C=Math.sin(A);m.a=Y*g-C*v,m.b=Y*b-C*S,m.c=C*g+Y*v,m.d=C*b+Y*S}if(l){let g=this.temp;i.localToWorld(g.set(this.data.offsetX,this.data.offsetY)),m.worldX+=g.x*s,m.worldY+=g.y*t}if(a!=0){let g=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*a+1;m.a*=g,m.c*=g}if(r!=0){let g=(Math.sqrt(n*n+d*d)-1+this.data.offsetScaleY)*r+1;m.b*=g,m.d*=g}if(c>0){let g=Math.atan2(d,n)-Math.atan2(h,o);g>X.PI?g-=X.PI2:g<-X.PI&&(g+=X.PI2);let b=m.b,v=m.d;g=Math.atan2(v,b)+(g-X.PI/2+x)*c;let S=Math.sqrt(b*b+v*v);m.b=Math.cos(g)*S,m.d=Math.sin(g)*S}m.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=this.target,i=this.bones;for(let o=0,n=i.length;o<n;o++){let h=i[o],d=h.arotation;if(e!=0){let y=l.arotation-d+this.data.offsetRotation;y-=(16384-(16384.499999999996-y/360|0))*360,d+=y*e}let f=h.ax,u=h.ay;f+=(l.ax-f+this.data.offsetX)*s,u+=(l.ay-u+this.data.offsetY)*t;let x=h.ascaleX,w=h.ascaleY;a!=0&&x!=0&&(x=(x+(l.ascaleX-x+this.data.offsetScaleX)*a)/x),r!=0&&w!=0&&(w=(w+(l.ascaleY-w+this.data.offsetScaleY)*r)/w);let p=h.ashearY;if(c!=0){let y=l.ashearY-p+this.data.offsetShearY;y-=(16384-(16384.499999999996-y/360|0))*360,p+=y*c}h.updateWorldTransformWith(f,u,d,x,w,h.ashearX,p)}}applyRelativeLocal(){let e=this.mixRotate,s=this.mixX,t=this.mixY,a=this.mixScaleX,r=this.mixScaleY,c=this.mixShearY,l=this.target,i=this.bones;for(let o=0,n=i.length;o<n;o++){let h=i[o],d=h.arotation+(l.arotation+this.data.offsetRotation)*e,f=h.ax+(l.ax+this.data.offsetX)*s,u=h.ay+(l.ay+this.data.offsetY)*t,x=h.ascaleX*((l.ascaleX-1+this.data.offsetScaleX)*a+1),w=h.ascaleY*((l.ascaleY-1+this.data.offsetScaleY)*r+1),p=h.ashearY+(l.ashearY+this.data.offsetShearY)*c;h.updateWorldTransformWith(f,u,d,x,w,h.ashearX,p)}}},cs=class{constructor(e){if(this._updateCache=new Array,this.skin=null,this.scaleX=1,this._scaleY=1,this.x=0,this.y=0,!e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(let s=0;s<e.bones.length;s++){let t=e.bones[s],a;if(!t.parent)a=new Yt(t,this,null);else{let r=this.bones[t.parent.index];a=new Yt(t,this,r),r.children.push(a)}this.bones.push(a)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<e.slots.length;s++){let t=e.slots[s],a=this.bones[t.boneData.index],r=new os(t,a);this.slots.push(r),this.drawOrder.push(r)}this.ikConstraints=new Array;for(let s=0;s<e.ikConstraints.length;s++){let t=e.ikConstraints[s];this.ikConstraints.push(new ls(t,this))}this.transformConstraints=new Array;for(let s=0;s<e.transformConstraints.length;s++){let t=e.transformConstraints[s];this.transformConstraints.push(new hs(t,this))}this.pathConstraints=new Array;for(let s=0;s<e.pathConstraints.length;s++){let t=e.pathConstraints[s];this.pathConstraints.push(new Se(t,this))}this.color=new L(1,1,1,1),this.updateCache()}get scaleY(){return cs.yDown?-this._scaleY:this._scaleY}set scaleY(e){this._scaleY=e}updateCache(){let e=this._updateCache;e.length=0;let s=this.bones;for(let n=0,h=s.length;n<h;n++){let d=s[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 t=this.ikConstraints,a=this.transformConstraints,r=this.pathConstraints,c=t.length,l=a.length,i=r.length,o=c+l+i;e:for(let n=0;n<o;n++){for(let h=0;h<c;h++){let d=t[h];if(d.data.order==n){this.sortIkConstraint(d);continue e}}for(let h=0;h<l;h++){let d=a[h];if(d.data.order==n){this.sortTransformConstraint(d);continue e}}for(let h=0;h<i;h++){let d=r[h];if(d.data.order==n){this.sortPathConstraint(d);continue e}}}for(let n=0,h=s.length;n<h;n++)this.sortBone(s[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 s=e.target;this.sortBone(s);let t=e.bones,a=t[0];if(this.sortBone(a),t.length==1)this._updateCache.push(e),this.sortReset(a.children);else{let r=t[t.length-1];this.sortBone(r),this._updateCache.push(e),this.sortReset(a.children),r.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 s=e.target,t=s.data.index,a=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,t,a),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,t,a);for(let i=0,o=this.data.skins.length;i<o;i++)this.sortPathConstraintAttachment(this.data.skins[i],t,a);let r=s.getAttachment();r instanceof ve&&this.sortPathConstraintAttachmentWith(r,a);let c=e.bones,l=c.length;for(let i=0;i<l;i++)this.sortBone(c[i]);this._updateCache.push(e);for(let i=0;i<l;i++)this.sortReset(c[i].children);for(let i=0;i<l;i++)c[i].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 s=e.bones,t=s.length;if(e.data.local)for(let a=0;a<t;a++){let r=s[a];this.sortBone(r.parent),this.sortBone(r)}else for(let a=0;a<t;a++)this.sortBone(s[a]);this._updateCache.push(e);for(let a=0;a<t;a++)this.sortReset(s[a].children);for(let a=0;a<t;a++)s[a].sorted=!0}sortPathConstraintAttachment(e,s,t){let a=e.attachments[s];if(a)for(let r in a)this.sortPathConstraintAttachmentWith(a[r],t)}sortPathConstraintAttachmentWith(e,s){if(!(e instanceof ve))return;let t=e.bones;if(!t)this.sortBone(s);else{let a=this.bones;for(let r=0,c=t.length;r<c;){let l=t[r++];for(l+=r;r<l;)this.sortBone(a[t[r++]])}}}sortBone(e){if(!e||e.sorted)return;let s=e.parent;s&&this.sortBone(s),e.sorted=!0,this._updateCache.push(e)}sortReset(e){for(let s=0,t=e.length;s<t;s++){let a=e[s];a.active&&(a.sorted&&this.sortReset(a.children),a.sorted=!1)}}updateWorldTransform(){let e=this.bones;for(let t=0,a=e.length;t<a;t++){let r=e[t];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY}let s=this._updateCache;for(let t=0,a=s.length;t<a;t++)s[t].update()}updateWorldTransformWith(e){let s=this.getRootBone();if(!s)throw new Error("Root bone must not be null.");let t=e.a,a=e.b,r=e.c,c=e.d;s.worldX=t*this.x+a*this.y+e.worldX,s.worldY=r*this.x+c*this.y+e.worldY;let l=s.rotation+90+s.shearY,i=X.cosDeg(s.rotation+s.shearX)*s.scaleX,o=X.cosDeg(l)*s.scaleY,n=X.sinDeg(s.rotation+s.shearX)*s.scaleX,h=X.sinDeg(l)*s.scaleY;s.a=(t*i+a*n)*this.scaleX,s.b=(t*o+a*h)*this.scaleX,s.c=(r*i+c*n)*this.scaleY,s.d=(r*o+c*h)*this.scaleY;let d=this._updateCache;for(let f=0,u=d.length;f<u;f++){let x=d[f];x!=s&&x.update()}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){let e=this.bones;for(let r=0,c=e.length;r<c;r++)e[r].setToSetupPose();let s=this.ikConstraints;for(let r=0,c=s.length;r<c;r++){let l=s[r];l.mix=l.data.mix,l.softness=l.data.softness,l.bendDirection=l.data.bendDirection,l.compress=l.data.compress,l.stretch=l.data.stretch}let t=this.transformConstraints;for(let r=0,c=t.length;r<c;r++){let l=t[r],i=l.data;l.mixRotate=i.mixRotate,l.mixX=i.mixX,l.mixY=i.mixY,l.mixScaleX=i.mixScaleX,l.mixScaleY=i.mixScaleY,l.mixShearY=i.mixShearY}let a=this.pathConstraints;for(let r=0,c=a.length;r<c;r++){let l=a[r],i=l.data;l.position=i.position,l.spacing=i.spacing,l.mixRotate=i.mixRotate,l.mixX=i.mixX,l.mixY=i.mixY}}setSlotsToSetupPose(){let e=this.slots;B.arrayCopy(e,0,this.drawOrder,0,e.length);for(let s=0,t=e.length;s<t;s++)e[s].setToSetupPose()}getRootBone(){return this.bones.length==0?null:this.bones[0]}findBone(e){if(!e)throw new Error("boneName cannot be null.");let s=this.bones;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}setSkinByName(e){let s=this.data.findSkin(e);if(!s)throw new Error("Skin not found: "+e);this.setSkin(s)}setSkin(e){if(e!=this.skin){if(e)if(this.skin)e.attachAll(this,this.skin);else{let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t],c=r.data.attachmentName;if(c){let l=e.getAttachment(t,c);l&&r.setAttachment(l)}}}this.skin=e,this.updateCache()}}getAttachmentByName(e,s){let t=this.data.findSlot(e);if(!t)throw new Error(`Can't find slot with name ${e}`);return this.getAttachment(t.index,s)}getAttachment(e,s){if(!s)throw new Error("attachmentName cannot be null.");if(this.skin){let t=this.skin.getAttachment(e,s);if(t)return t}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(e,s):null}setAttachment(e,s){if(!e)throw new Error("slotName cannot be null.");let t=this.slots;for(let a=0,r=t.length;a<r;a++){let c=t[a];if(c.data.name==e){let l=null;if(s&&(l=this.getAttachment(a,s),!l))throw new Error("Attachment not found: "+s+", for slot: "+e);c.setAttachment(l);return}}throw new Error("Slot not found: "+e)}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.ikConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.transformConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.pathConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.data.name==e)return r}return null}getBoundsRect(){let e=new Me,s=new Me;return this.getBounds(e,s),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(e,s,t=new Array(2)){if(!e)throw new Error("offset cannot be null.");if(!s)throw new Error("size cannot be null.");let a=this.drawOrder,r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let o=0,n=a.length;o<n;o++){let h=a[o];if(!h.bone.active)continue;let d=0,f=null,u=h.getAttachment();if(u instanceof W)d=8,f=B.setArraySize(t,d,0),u.computeWorldVertices(h,f,0,2);else if(u instanceof ye){let x=u;d=x.worldVerticesLength,f=B.setArraySize(t,d,0),x.computeWorldVertices(h,0,d,f,0,2)}if(f)for(let x=0,w=f.length;x<w;x+=2){let p=f[x],y=f[x+1];r=Math.min(r,p),c=Math.min(c,y),l=Math.max(l,p),i=Math.max(i,y)}}e.set(r,c),s.set(l-r,i-c)}},ds=cs;ds.yDown=!1;var Mt=class{constructor(){this.name=null,this.bones=new Array,this.slots=new Array,this.skins=new Array,this.defaultSkin=null,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(e){if(!e)throw new Error("boneName cannot be null.");let s=this.bones;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findSlot(e){if(!e)throw new Error("slotName cannot be null.");let s=this.slots;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findSkin(e){if(!e)throw new Error("skinName cannot be null.");let s=this.skins;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findEvent(e){if(!e)throw new Error("eventDataName cannot be null.");let s=this.events;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findAnimation(e){if(!e)throw new Error("animationName cannot be null.");let s=this.animations;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findIkConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.ikConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findTransformConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.transformConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}findPathConstraint(e){if(!e)throw new Error("constraintName cannot be null.");let s=this.pathConstraints;for(let t=0,a=s.length;t<a;t++){let r=s[t];if(r.name==e)return r}return null}},Ft=class{constructor(e=0,s,t){this.slotIndex=e,this.name=s,this.attachment=t}},We=class{constructor(e){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}setAttachment(e,s,t){if(!t)throw new Error("attachment cannot be null.");let a=this.attachments;e>=a.length&&(a.length=e+1),a[e]||(a[e]={}),a[e][s]=t}addSkin(e){for(let a=0;a<e.bones.length;a++){let r=e.bones[a],c=!1;for(let l=0;l<this.bones.length;l++)if(this.bones[l]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<e.constraints.length;a++){let r=e.constraints[a],c=!1;for(let l=0;l<this.constraints.length;l++)if(this.constraints[l]==r){c=!0;break}c||this.constraints.push(r)}let s=e.getAttachments();for(let a=0;a<s.length;a++){var t=s[a];this.setAttachment(t.slotIndex,t.name,t.attachment)}}copySkin(e){for(let a=0;a<e.bones.length;a++){let r=e.bones[a],c=!1;for(let l=0;l<this.bones.length;l++)if(this.bones[l]==r){c=!0;break}c||this.bones.push(r)}for(let a=0;a<e.constraints.length;a++){let r=e.constraints[a],c=!1;for(let l=0;l<this.constraints.length;l++)if(this.constraints[l]==r){c=!0;break}c||this.constraints.push(r)}let s=e.getAttachments();for(let a=0;a<s.length;a++){var t=s[a];t.attachment&&(t.attachment instanceof ye?(t.attachment=t.attachment.newLinkedMesh(),this.setAttachment(t.slotIndex,t.name,t.attachment)):(t.attachment=t.attachment.copy(),this.setAttachment(t.slotIndex,t.name,t.attachment)))}}getAttachment(e,s){let t=this.attachments[e];return t?t[s]:null}removeAttachment(e,s){let t=this.attachments[e];t&&delete t[s]}getAttachments(){let e=new Array;for(var s=0;s<this.attachments.length;s++){let t=this.attachments[s];if(t)for(let a in t){let r=t[a];r&&e.push(new Ft(s,a,r))}}return e}getAttachmentsForSlot(e,s){let t=this.attachments[e];if(t)for(let a in t){let r=t[a];r&&s.push(new Ft(e,a,r))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(e,s){let t=0;for(let a=0;a<e.slots.length;a++){let r=e.slots[a],c=r.getAttachment();if(c&&t<s.attachments.length){let l=s.attachments[t];for(let i in l){let o=l[i];if(c==o){let n=this.getAttachment(t,i);n&&r.setAttachment(n);break}}}t++}}},Et=class{constructor(e,s,t){if(this.index=0,this.color=new L(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=ze.Normal,e<0)throw new Error("index must be >= 0.");if(!s)throw new Error("name cannot be null.");if(!t)throw new Error("boneData cannot be null.");this.index=e,this.name=s,this.boneData=t}},ze=(e=>(e[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen",e))(ze||{}),Rt=class extends qe{constructor(e){super(e,0,!1),this.bones=new Array,this._target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1}set target(e){this._target=e}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}},Ps=class{constructor(e){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let s=this.scale,t=new Mt;t.name="";let a=new fs(e),r=a.readInt32(),c=a.readInt32();t.hash=c==0&&r==0?null:c.toString(16)+r.toString(16),t.version=a.readString(),t.x=a.readFloat(),t.y=a.readFloat(),t.width=a.readFloat(),t.height=a.readFloat();let l=a.readBoolean();l&&(t.fps=a.readFloat(),t.imagesPath=a.readString(),t.audioPath=a.readString());let i=0;i=a.readInt(!0);for(let n=0;n<i;n++){let h=a.readString();if(!h)throw new Error("String in string table must not be null.");a.strings.push(h)}i=a.readInt(!0);for(let n=0;n<i;n++){let h=a.readString();if(!h)throw new Error("Bone name must not be null.");let d=n==0?null:t.bones[a.readInt(!0)],f=new kt(n,h,d);f.rotation=a.readFloat(),f.x=a.readFloat()*s,f.y=a.readFloat()*s,f.scaleX=a.readFloat(),f.scaleY=a.readFloat(),f.shearX=a.readFloat(),f.shearY=a.readFloat(),f.length=a.readFloat()*s,f.transformMode=a.readInt(!0),f.skinRequired=a.readBoolean(),l&&L.rgba8888ToColor(f.color,a.readInt32()),t.bones.push(f)}i=a.readInt(!0);for(let n=0;n<i;n++){let h=a.readString();if(!h)throw new Error("Slot name must not be null.");let d=t.bones[a.readInt(!0)],f=new Et(n,h,d);L.rgba8888ToColor(f.color,a.readInt32());let u=a.readInt32();u!=-1&&L.rgb888ToColor(f.darkColor=new L,u),f.attachmentName=a.readStringRef(),f.blendMode=a.readInt(!0),t.slots.push(f)}i=a.readInt(!0);for(let n=0,h;n<i;n++){let d=a.readString();if(!d)throw new Error("IK constraint data name must not be null.");let f=new Tt(d);f.order=a.readInt(!0),f.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let u=0;u<h;u++)f.bones.push(t.bones[a.readInt(!0)]);f.target=t.bones[a.readInt(!0)],f.mix=a.readFloat(),f.softness=a.readFloat()*s,f.bendDirection=a.readByte(),f.compress=a.readBoolean(),f.stretch=a.readBoolean(),f.uniform=a.readBoolean(),t.ikConstraints.push(f)}i=a.readInt(!0);for(let n=0,h;n<i;n++){let d=a.readString();if(!d)throw new Error("Transform 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(t.bones[a.readInt(!0)]);f.target=t.bones[a.readInt(!0)],f.local=a.readBoolean(),f.relative=a.readBoolean(),f.offsetRotation=a.readFloat(),f.offsetX=a.readFloat()*s,f.offsetY=a.readFloat()*s,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(),t.transformConstraints.push(f)}i=a.readInt(!0);for(let n=0,h;n<i;n++){let d=a.readString();if(!d)throw new Error("Path constraint data name must not be null.");let f=new Xt(d);f.order=a.readInt(!0),f.skinRequired=a.readBoolean(),h=a.readInt(!0);for(let u=0;u<h;u++)f.bones.push(t.bones[a.readInt(!0)]);f.target=t.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*=s),f.spacing=a.readFloat(),(f.spacingMode==0||f.spacingMode==1)&&(f.spacing*=s),f.mixRotate=a.readFloat(),f.mixX=a.readFloat(),f.mixY=a.readFloat(),t.pathConstraints.push(f)}let o=this.readSkin(a,t,!0,l);o&&(t.defaultSkin=o,t.skins.push(o));{let n=t.skins.length;for(B.setArraySize(t.skins,i=n+a.readInt(!0));n<i;n++){let h=this.readSkin(a,t,!1,l);if(!h)throw new Error("readSkin() should not have returned null.");t.skins[n]=h}}i=this.linkedMeshes.length;for(let n=0;n<i;n++){let h=this.linkedMeshes[n],d=h.skin?t.findSkin(h.skin):t.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,i=a.readInt(!0);for(let n=0;n<i;n++){let h=a.readStringRef();if(!h)throw new Error;let d=new Ct(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()),t.events.push(d)}i=a.readInt(!0);for(let n=0;n<i;n++){let h=a.readString();if(!h)throw new Error("Animatio name must not be null.");t.animations.push(this.readAnimation(a,h,t))}return t}readSkin(e,s,t,a){let r=null,c=0;if(t){if(c=e.readInt(!0),c==0)return null;r=new We("default")}else{let l=e.readStringRef();if(!l)throw new Error("Skin name must not be null.");r=new We(l),r.bones.length=e.readInt(!0);for(let i=0,o=r.bones.length;i<o;i++)r.bones[i]=s.bones[e.readInt(!0)];for(let i=0,o=e.readInt(!0);i<o;i++)r.constraints.push(s.ikConstraints[e.readInt(!0)]);for(let i=0,o=e.readInt(!0);i<o;i++)r.constraints.push(s.transformConstraints[e.readInt(!0)]);for(let i=0,o=e.readInt(!0);i<o;i++)r.constraints.push(s.pathConstraints[e.readInt(!0)]);c=e.readInt(!0)}for(let l=0;l<c;l++){let i=e.readInt(!0);for(let o=0,n=e.readInt(!0);o<n;o++){let h=e.readStringRef();if(!h)throw new Error("Attachment name must not be null");let d=this.readAttachment(e,s,r,i,h,a);d&&r.setAttachment(i,h,d)}}return r}readAttachment(e,s,t,a,r,c){let l=this.scale,i=e.readStringRef();switch(i||(i=r),e.readByte()){case ue.Region:{let o=e.readStringRef(),n=e.readFloat(),h=e.readFloat(),d=e.readFloat(),f=e.readFloat(),u=e.readFloat(),x=e.readFloat(),w=e.readFloat(),p=e.readInt32(),y=this.readSequence(e);o||(o=i);let m=this.attachmentLoader.newRegionAttachment(t,i,o,y);return m?(m.path=o,m.x=h*l,m.y=d*l,m.scaleX=f,m.scaleY=u,m.rotation=n,m.width=x*l,m.height=w*l,L.rgba8888ToColor(m.color,p),m.sequence=y,y==null&&m.updateRegion(),m):null}case ue.BoundingBox:{let o=e.readInt(!0),n=this.readVertices(e,o),h=c?e.readInt32():0,d=this.attachmentLoader.newBoundingBoxAttachment(t,i);return d?(d.worldVerticesLength=o<<1,d.vertices=n.vertices,d.bones=n.bones,c&&L.rgba8888ToColor(d.color,h),d):null}case ue.Mesh:{let o=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),x=e.readInt(!0),w=this.readSequence(e),p=[],y=0,m=0;c&&(p=this.readShortArray(e),y=e.readFloat(),m=e.readFloat()),o||(o=i);let g=this.attachmentLoader.newMeshAttachment(t,i,o,w);return g?(g.path=o,L.rgba8888ToColor(g.color,n),g.bones=u.bones,g.vertices=u.vertices,g.worldVerticesLength=h<<1,g.triangles=f,g.regionUVs=d,w==null&&g.updateRegion(),g.hullLength=x<<1,g.sequence=w,c&&(g.edges=p,g.width=y*l,g.height=m*l),g):null}case ue.LinkedMesh:{let o=e.readStringRef(),n=e.readInt32(),h=e.readStringRef(),d=e.readStringRef(),f=e.readBoolean(),u=this.readSequence(e),x=0,w=0;c&&(x=e.readFloat(),w=e.readFloat()),o||(o=i);let p=this.attachmentLoader.newMeshAttachment(t,i,o,u);return p?(p.path=o,L.rgba8888ToColor(p.color,n),p.sequence=u,c&&(p.width=x*l,p.height=w*l),this.linkedMeshes.push(new Ds(p,h,a,d,f)),p):null}case ue.Path:{let o=e.readBoolean(),n=e.readBoolean(),h=e.readInt(!0),d=this.readVertices(e,h),f=B.newArray(h/3,0);for(let w=0,p=f.length;w<p;w++)f[w]=e.readFloat()*l;let u=c?e.readInt32():0,x=this.attachmentLoader.newPathAttachment(t,i);return x?(x.closed=o,x.constantSpeed=n,x.worldVerticesLength=h<<1,x.vertices=d.vertices,x.bones=d.bones,x.lengths=f,c&&L.rgba8888ToColor(x.color,u),x):null}case ue.Point:{let o=e.readFloat(),n=e.readFloat(),h=e.readFloat(),d=c?e.readInt32():0,f=this.attachmentLoader.newPointAttachment(t,i);return f?(f.x=n*l,f.y=h*l,f.rotation=o,c&&L.rgba8888ToColor(f.color,d),f):null}case ue.Clipping:{let o=e.readInt(!0),n=e.readInt(!0),h=this.readVertices(e,n),d=c?e.readInt32():0,f=this.attachmentLoader.newClippingAttachment(t,i);return f?(f.endSlot=s.slots[o],f.worldVerticesLength=n<<1,f.vertices=h.vertices,f.bones=h.bones,c&&L.rgba8888ToColor(f.color,d),f):null}}return null}readSequence(e){if(!e.readBoolean())return null;let s=new Ke(e.readInt(!0));return s.start=e.readInt(!0),s.digits=e.readInt(!0),s.setupIndex=e.readInt(!0),s}readVertices(e,s){let t=this.scale,a=s<<1,r=new Vs;if(!e.readBoolean())return r.vertices=this.readFloatArray(e,a,t),r;let c=new Array,l=new Array;for(let i=0;i<s;i++){let o=e.readInt(!0);l.push(o);for(let n=0;n<o;n++)l.push(e.readInt(!0)),c.push(e.readFloat()*t),c.push(e.readFloat()*t),c.push(e.readFloat())}return r.vertices=B.toFloatArray(c),r.bones=l,r}readFloatArray(e,s,t){let a=new Array(s);if(t==1)for(let r=0;r<s;r++)a[r]=e.readFloat();else for(let r=0;r<s;r++)a[r]=e.readFloat()*t;return a}readShortArray(e){let s=e.readInt(!0),t=new Array(s);for(let a=0;a<s;a++)t[a]=e.readShort();return t}readAnimation(e,s,t){e.readInt(!0);let a=new Array,r=this.scale,c=new L,l=new L;for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,x=e.readInt(!0);u<x;u++){let w=e.readByte(),p=e.readInt(!0),y=p-1;switch(w){case Gs:{let m=new xe(p,f);for(let g=0;g<p;g++)m.setFrame(g,e.readFloat(),e.readStringRef());a.push(m);break}case js:{let m=e.readInt(!0),g=new lt(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255;for(let C=0,M=0;g.setFrame(C,b,v,S,A,Y),C!=y;C++){let R=e.readFloat(),E=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255;switch(e.readByte()){case ae:g.setStepped(C);break;case ne:_(e,g,M++,C,0,b,R,v,E,1),_(e,g,M++,C,1,b,R,S,F,1),_(e,g,M++,C,2,b,R,A,I,1),_(e,g,M++,C,3,b,R,Y,T,1)}b=R,v=E,S=F,A=I,Y=T}a.push(g);break}case Js:{let m=e.readInt(!0),g=new ot(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;for(let Y=0,C=0;g.setFrame(Y,b,v,S,A),Y!=y;Y++){let M=e.readFloat(),R=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,F=e.readUnsignedByte()/255;switch(e.readByte()){case ae:g.setStepped(Y);break;case ne:_(e,g,C++,Y,0,b,M,v,R,1),_(e,g,C++,Y,1,b,M,S,E,1),_(e,g,C++,Y,2,b,M,A,F,1)}b=M,v=R,S=E,A=F}a.push(g);break}case Ks:{let m=e.readInt(!0),g=new ct(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255;for(let E=0,F=0;g.setFrame(E,b,v,S,A,Y,C,M,R),E!=y;E++){let I=e.readFloat(),T=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255,N=e.readUnsignedByte()/255,$=e.readUnsignedByte()/255;switch(e.readByte()){case ae:g.setStepped(E);break;case ne:_(e,g,F++,E,0,b,I,v,T,1),_(e,g,F++,E,1,b,I,S,P,1),_(e,g,F++,E,2,b,I,A,O,1),_(e,g,F++,E,3,b,I,Y,D,1),_(e,g,F++,E,4,b,I,C,U,1),_(e,g,F++,E,5,b,I,M,N,1),_(e,g,F++,E,6,b,I,R,$,1)}b=I,v=T,S=P,A=O,Y=D,C=U,M=N,R=$}a.push(g);break}case Qs:{let m=e.readInt(!0),g=new dt(p,m,f),b=e.readFloat(),v=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,C=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let R=0,E=0;g.setFrame(R,b,v,S,A,Y,C,M),R!=y;R++){let F=e.readFloat(),I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,P=e.readUnsignedByte()/255,O=e.readUnsignedByte()/255,D=e.readUnsignedByte()/255,U=e.readUnsignedByte()/255;switch(e.readByte()){case ae:g.setStepped(R);break;case ne:_(e,g,E++,R,0,b,F,v,I,1),_(e,g,E++,R,1,b,F,S,T,1),_(e,g,E++,R,2,b,F,A,P,1),_(e,g,E++,R,3,b,F,Y,O,1),_(e,g,E++,R,4,b,F,C,D,1),_(e,g,E++,R,5,b,F,M,U,1)}b=F,v=I,S=T,A=P,Y=O,C=D,M=U}a.push(g);break}case Zs:{let m=new ht(p,e.readInt(!0),f),g=e.readFloat(),b=e.readUnsignedByte()/255;for(let v=0,S=0;m.setFrame(v,g,b),v!=y;v++){let A=e.readFloat(),Y=e.readUnsignedByte()/255;switch(e.readByte()){case ae:m.setStepped(v);break;case ne:_(e,m,S++,v,0,g,A,b,Y,1)}g=A,b=Y}a.push(m)}}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0);for(let u=0,x=e.readInt(!0);u<x;u++){let w=e.readByte(),p=e.readInt(!0),y=e.readInt(!0);switch(w){case Ls:a.push(de(e,new Ce(p,y,f),1));break;case Ns:a.push(Bt(e,new Qe(p,y,f),r));break;case qs:a.push(de(e,new Ze(p,y,f),r));break;case Os:a.push(de(e,new et(p,y,f),r));break;case _s:a.push(Bt(e,new tt(p,y,f),1));break;case Us:a.push(de(e,new st(p,y,f),1));break;case Ws:a.push(de(e,new it(p,y,f),1));break;case zs:a.push(Bt(e,new rt(p,y,f),1));break;case $s:a.push(de(e,new at(p,y,f),1));break;case Hs:a.push(de(e,new nt(p,y,f),1))}}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),x=u-1,w=new ut(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),m=e.readFloat()*r;for(let g=0,b=0;w.setFrame(g,p,y,m,e.readByte(),e.readBoolean(),e.readBoolean()),g!=x;g++){let v=e.readFloat(),S=e.readFloat(),A=e.readFloat()*r;switch(e.readByte()){case ae:w.setStepped(g);break;case ne:_(e,w,b++,g,0,p,v,y,S,1),_(e,w,b++,g,1,p,v,m,A,r)}p=v,y=S,m=A}a.push(w)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=e.readInt(!0),x=u-1,w=new mt(u,e.readInt(!0),f),p=e.readFloat(),y=e.readFloat(),m=e.readFloat(),g=e.readFloat(),b=e.readFloat(),v=e.readFloat(),S=e.readFloat();for(let A=0,Y=0;w.setFrame(A,p,y,m,g,b,v,S),A!=x;A++){let C=e.readFloat(),M=e.readFloat(),R=e.readFloat(),E=e.readFloat(),F=e.readFloat(),I=e.readFloat(),T=e.readFloat();switch(e.readByte()){case ae:w.setStepped(A);break;case ne:_(e,w,Y++,A,0,p,C,y,M,1),_(e,w,Y++,A,1,p,C,m,R,1),_(e,w,Y++,A,2,p,C,g,E,1),_(e,w,Y++,A,3,p,C,b,F,1),_(e,w,Y++,A,4,p,C,v,I,1),_(e,w,Y++,A,5,p,C,S,T,1)}p=C,y=M,m=R,g=E,b=F,v=I,S=T}a.push(w)}for(let h=0,d=e.readInt(!0);h<d;h++){let f=e.readInt(!0),u=t.pathConstraints[f];for(let x=0,w=e.readInt(!0);x<w;x++)switch(e.readByte()){case si:a.push(de(e,new gt(e.readInt(!0),e.readInt(!0),f),u.positionMode==0?r:1));break;case ii:a.push(de(e,new xt(e.readInt(!0),e.readInt(!0),f),u.spacingMode==0||u.spacingMode==1?r:1));break;case ri:let p=new wt(e.readInt(!0),e.readInt(!0),f),y=e.readFloat(),m=e.readFloat(),g=e.readFloat(),b=e.readFloat();for(let v=0,S=0,A=p.getFrameCount()-1;p.setFrame(v,y,m,g,b),v!=A;v++){let Y=e.readFloat(),C=e.readFloat(),M=e.readFloat(),R=e.readFloat();switch(e.readByte()){case ae:p.setStepped(v);break;case ne:_(e,p,S++,v,0,y,Y,m,C,1),_(e,p,S++,v,1,y,Y,g,M,1),_(e,p,S++,v,2,y,Y,b,R,1)}y=Y,m=C,g=M,b=R}a.push(p)}}for(let h=0,d=e.readInt(!0);h<d;h++){let f=t.skins[e.readInt(!0)];for(let u=0,x=e.readInt(!0);u<x;u++){let w=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 g=f.getAttachment(w,m),b=e.readByte(),v=e.readInt(!0),S=v-1;switch(b){case ei:{let A=g,Y=A.bones,C=A.vertices,M=Y?C.length/3*2:C.length,R=e.readInt(!0),E=new ft(v,R,w,A),F=e.readFloat();for(let I=0,T=0;;I++){let P,O=e.readInt(!0);if(O==0)P=Y?B.newFloatArray(M):C;else{P=B.newFloatArray(M);let U=e.readInt(!0);if(O+=U,r==1)for(let N=U;N<O;N++)P[N]=e.readFloat();else for(let N=U;N<O;N++)P[N]=e.readFloat()*r;if(!Y)for(let N=0,$=P.length;N<$;N++)P[N]+=C[N]}if(E.setFrame(I,F,P),I==S)break;let D=e.readFloat();switch(e.readByte()){case ae:E.setStepped(I);break;case ne:_(e,E,T++,I,0,F,D,0,1,1)}F=D}a.push(E);break}case ti:{let A=new pe(v,w,g);for(let Y=0;Y<v;Y++){let C=e.readFloat(),M=e.readInt32();A.setFrame(Y,C,Wt[M&15],M>>4,e.readFloat())}a.push(A);break}}}}}let i=e.readInt(!0);if(i>0){let h=new we(i),d=t.slots.length;for(let f=0;f<i;f++){let u=e.readFloat(),x=e.readInt(!0),w=B.newArray(d,0);for(let g=d-1;g>=0;g--)w[g]=-1;let p=B.newArray(d-x,0),y=0,m=0;for(let g=0;g<x;g++){let b=e.readInt(!0);for(;y!=b;)p[m++]=y++;w[y+e.readInt(!0)]=y++}for(;y<d;)p[m++]=y++;for(let g=d-1;g>=0;g--)w[g]==-1&&(w[g]=p[--m]);h.setFrame(f,u,w)}a.push(h)}let o=e.readInt(!0);if(o>0){let h=new Te(o);for(let d=0;d<o;d++){let f=e.readFloat(),u=t.events[e.readInt(!0)],x=new It(f,u);x.intValue=e.readInt(!1),x.floatValue=e.readFloat(),x.stringValue=e.readBoolean()?e.readString():u.stringValue,x.data.audioPath&&(x.volume=e.readFloat(),x.balance=e.readFloat()),h.setFrame(d,x)}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 Ee(s,a,n)}},fs=class{constructor(e,s=new Array,t=0,a=new DataView(e.buffer)){this.strings=s,this.index=t,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 s=this.readByte(),t=s&127;return s&128&&(s=this.readByte(),t|=(s&127)<<7,s&128&&(s=this.readByte(),t|=(s&127)<<14,s&128&&(s=this.readByte(),t|=(s&127)<<21,s&128&&(s=this.readByte(),t|=(s&127)<<28)))),e?t:t>>>1^-(t&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 s="",t=0;for(let a=0;a<e;){let r=this.readUnsignedByte();switch(r>>4){case 12:case 13:s+=String.fromCharCode((r&31)<<6|this.readByte()&63),a+=2;break;case 14:s+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),a+=3;break;default:s+=String.fromCharCode(r),a++}}return s}readFloat(){let e=this.buffer.getFloat32(this.index);return this.index+=4,e}readBoolean(){return this.readByte()!=0}},Ds=class{constructor(e,s,t,a,r){this.mesh=e,this.skin=s,this.slotIndex=t,this.parent=a,this.inheritTimeline=r}},Vs=class{constructor(e=null,s=null){this.bones=e,this.vertices=s}},ue=(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))(ue||{});function de(e,s,t){let a=e.readFloat(),r=e.readFloat()*t;for(let c=0,l=0,i=s.getFrameCount()-1;s.setFrame(c,a,r),c!=i;c++){let o=e.readFloat(),n=e.readFloat()*t;switch(e.readByte()){case ae:s.setStepped(c);break;case ne:_(e,s,l++,c,0,a,o,r,n,t)}a=o,r=n}return s}function Bt(e,s,t){let a=e.readFloat(),r=e.readFloat()*t,c=e.readFloat()*t;for(let l=0,i=0,o=s.getFrameCount()-1;s.setFrame(l,a,r,c),l!=o;l++){let n=e.readFloat(),h=e.readFloat()*t,d=e.readFloat()*t;switch(e.readByte()){case ae:s.setStepped(l);break;case ne:_(e,s,i++,l,0,a,n,r,h,t),_(e,s,i++,l,1,a,n,c,d,t)}a=n,r=h,c=d}return s}function _(e,s,t,a,r,c,l,i,o,n){s.setBezier(t,a,r,c,i,e.readFloat(),e.readFloat()*n,e.readFloat(),e.readFloat()*n,l,o)}var Ls=0,Ns=1,qs=2,Os=3,_s=4,Us=5,Ws=6,zs=7,$s=8,Hs=9,Gs=0,js=1,Js=2,Ks=3,Qs=4,Zs=5,ei=0,ti=1,si=0,ii=1,ri=2,ae=1,ne=2,ai=class{constructor(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new Ie(()=>B.newFloatArray(16))}update(e,s){if(!e)throw new Error("skeleton cannot be null.");let t=this.boundingBoxes,a=this.polygons,r=this.polygonPool,c=e.slots,l=c.length;t.length=0,r.freeAll(a),a.length=0;for(let i=0;i<l;i++){let o=c[i];if(!o.bone.active)continue;let n=o.getAttachment();if(n instanceof Ve){let h=n;t.push(h);let d=r.obtain();d.length!=h.worldVerticesLength&&(d=B.newFloatArray(h.worldVerticesLength)),a.push(d),h.computeWorldVertices(o,0,h.worldVerticesLength,d,0,2)}}s?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,s=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,a=Number.NEGATIVE_INFINITY,r=this.polygons;for(let c=0,l=r.length;c<l;c++){let i=r[c],o=i;for(let n=0,h=i.length;n<h;n+=2){let d=o[n],f=o[n+1];e=Math.min(e,d),s=Math.min(s,f),t=Math.max(t,d),a=Math.max(a,f)}}this.minX=e,this.minY=s,this.maxX=t,this.maxY=a}aabbContainsPoint(e,s){return e>=this.minX&&e<=this.maxX&&s>=this.minY&&s<=this.maxY}aabbIntersectsSegment(e,s,t,a){let r=this.minX,c=this.minY,l=this.maxX,i=this.maxY;if(e<=r&&t<=r||s<=c&&a<=c||e>=l&&t>=l||s>=i&&a>=i)return!1;let o=(a-s)/(t-e),n=o*(r-e)+s;if(n>c&&n<i||(n=o*(l-e)+s,n>c&&n<i))return!0;let h=(c-s)/o+e;return h>r&&h<l||(h=(i-s)/o+e,h>r&&h<l)}aabbIntersectsSkeleton(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}containsPoint(e,s){let t=this.polygons;for(let a=0,r=t.length;a<r;a++)if(this.containsPointPolygon(t[a],e,s))return this.boundingBoxes[a];return null}containsPointPolygon(e,s,t){let a=e,r=e.length,c=r-2,l=!1;for(let i=0;i<r;i+=2){let o=a[i+1],n=a[c+1];if(o<t&&n>=t||n<t&&o>=t){let h=a[i];h+(t-o)/(n-o)*(a[c]-h)<s&&(l=!l)}c=i}return l}intersectsSegment(e,s,t,a){let r=this.polygons;for(let c=0,l=r.length;c<l;c++)if(this.intersectsSegmentPolygon(r[c],e,s,t,a))return this.boundingBoxes[c];return null}intersectsSegmentPolygon(e,s,t,a,r){let c=e,l=e.length,i=s-a,o=t-r,n=s*r-t*a,h=c[l-2],d=c[l-1];for(let f=0;f<l;f+=2){let u=c[f],x=c[f+1],w=h*x-d*u,p=h-u,y=d-x,m=i*y-o*p,g=(n*p-i*w)/m;if((g>=h&&g<=u||g>=u&&g<=h)&&(g>=s&&g<=a||g>=a&&g<=s)){let b=(n*y-o*w)/m;if((b>=d&&b<=x||b>=x&&b<=d)&&(b>=t&&b<=r||b>=r&&b<=t))return!0}h=u,d=x}return!1}getPolygon(e){if(!e)throw new Error("boundingBox cannot be null.");let s=this.boundingBoxes.indexOf(e);return s==-1?null:this.polygons[s]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}},Z=class{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new Ie(()=>new Array),this.polygonIndicesPool=new Ie(()=>new Array)}triangulate(e){let s=e,t=e.length>>1,a=this.indicesArray;a.length=0;for(let l=0;l<t;l++)a[l]=l;let r=this.isConcaveArray;r.length=0;for(let l=0,i=t;l<i;++l)r[l]=Z.isConcave(l,t,s,a);let c=this.triangles;for(c.length=0;t>3;){let l=t-1,i=0,o=1;for(;;){e:if(!r[i]){let d=a[l]<<1,f=a[i]<<1,u=a[o]<<1,x=s[d],w=s[d+1],p=s[f],y=s[f+1],m=s[u],g=s[u+1];for(let b=(o+1)%t;b!=l;b=(b+1)%t){if(!r[b])continue;let v=a[b]<<1,S=s[v],A=s[v+1];if(Z.positiveArea(m,g,x,w,S,A)&&Z.positiveArea(x,w,p,y,S,A)&&Z.positiveArea(p,y,m,g,S,A))break e}break}if(o==0){do{if(!r[i])break;i--}while(i>0);break}l=i,i=o,o=(o+1)%t}c.push(a[(t+i-1)%t]),c.push(a[i]),c.push(a[(i+1)%t]),a.splice(i,1),r.splice(i,1),t--;let n=(t+i-1)%t,h=i==t?0:i;r[n]=Z.isConcave(n,t,s,a),r[h]=Z.isConcave(h,t,s,a)}return t==3&&(c.push(a[2]),c.push(a[0]),c.push(a[1])),c}decompose(e,s){let t=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;let r=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(r),r.length=0;let c=this.polygonIndicesPool.obtain();c.length=0;let l=this.polygonPool.obtain();l.length=0;let i=-1,o=0;for(let n=0,h=s.length;n<h;n+=3){let d=s[n]<<1,f=s[n+1]<<1,u=s[n+2]<<1,x=t[d],w=t[d+1],p=t[f],y=t[f+1],m=t[u],g=t[u+1],b=!1;if(i==d){let v=l.length-4,S=Z.winding(l[v],l[v+1],l[v+2],l[v+3],m,g),A=Z.winding(m,g,l[0],l[1],l[2],l[3]);S==o&&A==o&&(l.push(m),l.push(g),c.push(u),b=!0)}b||(l.length>0?(a.push(l),r.push(c)):(this.polygonPool.free(l),this.polygonIndicesPool.free(c)),l=this.polygonPool.obtain(),l.length=0,l.push(x),l.push(w),l.push(p),l.push(y),l.push(m),l.push(g),c=this.polygonIndicesPool.obtain(),c.length=0,c.push(d),c.push(f),c.push(u),o=Z.winding(x,w,p,y,m,g),i=d)}l.length>0&&(a.push(l),r.push(c));for(let n=0,h=a.length;n<h;n++){if(c=r[n],c.length==0)continue;let d=c[0],f=c[c.length-1];l=a[n];let u=l.length-4,x=l[u],w=l[u+1],p=l[u+2],y=l[u+3],m=l[0],g=l[1],b=l[2],v=l[3],S=Z.winding(x,w,p,y,m,g);for(let A=0;A<h;A++){if(A==n)continue;let Y=r[A];if(Y.length!=3)continue;let C=Y[0],M=Y[1],R=Y[2],E=a[A],F=E[E.length-2],I=E[E.length-1];if(C!=d||M!=f)continue;let T=Z.winding(x,w,p,y,F,I),P=Z.winding(F,I,m,g,b,v);T==S&&P==S&&(E.length=0,Y.length=0,l.push(F),l.push(I),c.push(R),x=p,w=y,p=F,y=I,A=0)}}for(let n=a.length-1;n>=0;n--)l=a[n],l.length==0&&(a.splice(n,1),this.polygonPool.free(l),c=r[n],r.splice(n,1),this.polygonIndicesPool.free(c));return a}static isConcave(e,s,t,a){let r=a[(s+e-1)%s]<<1,c=a[e]<<1,l=a[(e+1)%s]<<1;return!this.positiveArea(t[r],t[r+1],t[c],t[c+1],t[l],t[l+1])}static positiveArea(e,s,t,a,r,c){return e*(c-a)+t*(s-c)+r*(a-s)>=0}static winding(e,s,t,a,r,c){let l=t-e,i=a-s;return r*i-c*l+l*s-e*i>=0?1:-1}},Pt=class{constructor(){this.triangulator=new Z,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(e,s){if(this.clipAttachment)return 0;this.clipAttachment=s;let t=s.worldVerticesLength,a=B.setArraySize(this.clippingPolygon,t);s.computeWorldVertices(e,0,t,a,0,2);let r=this.clippingPolygon;Pt.makeClockwise(r);let c=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let l=0,i=c.length;l<i;l++){let o=c[l];Pt.makeClockwise(o),o.push(o[0]),o.push(o[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,s,t,a,r,c,l,i){let o=this.clipOutput,n=this.clippedVertices,h=this.clippedTriangles,d=this.clippingPolygons,f=d.length,u=i?12:8,x=0;n.length=0,h.length=0;e:for(let w=0;w<a;w+=3){let p=t[w]<<1,y=e[p],m=e[p+1],g=r[p],b=r[p+1];p=t[w+1]<<1;let v=e[p],S=e[p+1],A=r[p],Y=r[p+1];p=t[w+2]<<1;let C=e[p],M=e[p+1],R=r[p],E=r[p+1];for(let F=0;F<f;F++){let I=n.length;if(this.clip(y,m,v,S,C,M,d[F],o)){let T=o.length;if(T==0)continue;let P=S-M,O=C-v,D=y-C,U=M-m,N=1/(P*D+O*(m-M)),$=T>>1,q=this.clipOutput,V=B.setArraySize(n,I+$*u);for(let K=0;K<T;K+=2){let le=q[K],J=q[K+1];V[I]=le,V[I+1]=J,V[I+2]=c.r,V[I+3]=c.g,V[I+4]=c.b,V[I+5]=c.a;let ee=le-C,te=J-M,me=(P*ee+O*te)*N,Ae=(U*ee+D*te)*N,Xe=1-me-Ae;V[I+6]=g*me+A*Ae+R*Xe,V[I+7]=b*me+Y*Ae+E*Xe,i&&(V[I+8]=l.r,V[I+9]=l.g,V[I+10]=l.b,V[I+11]=l.a),I+=u}I=h.length;let G=B.setArraySize(h,I+3*($-2));$--;for(let K=1;K<$;K++)G[I]=x,G[I+1]=x+K,G[I+2]=x+K+1,I+=3;x+=$+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,i?(T[I+6]=g,T[I+7]=b,T[I+8]=l.r,T[I+9]=l.g,T[I+10]=l.b,T[I+11]=l.a,T[I+12]=v,T[I+13]=S,T[I+14]=c.r,T[I+15]=c.g,T[I+16]=c.b,T[I+17]=c.a,T[I+18]=A,T[I+19]=Y,T[I+20]=l.r,T[I+21]=l.g,T[I+22]=l.b,T[I+23]=l.a,T[I+24]=C,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]=l.r,T[I+33]=l.g,T[I+34]=l.b,T[I+35]=l.a):(T[I+6]=g,T[I+7]=b,T[I+8]=v,T[I+9]=S,T[I+10]=c.r,T[I+11]=c.g,T[I+12]=c.b,T[I+13]=c.a,T[I+14]=A,T[I+15]=Y,T[I+16]=C,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 P=B.setArraySize(h,I+3);P[I]=x,P[I+1]=x+1,P[I+2]=x+2,x+=3;continue e}}}}clip(e,s,t,a,r,c,l,i){let o=i,n=!1,h;l.length%4>=2?(h=i,i=this.scratch):h=this.scratch,h.length=0,h.push(e),h.push(s),h.push(t),h.push(a),h.push(r),h.push(c),h.push(e),h.push(s),i.length=0;let d=l,f=l.length-4;for(let u=0;;u+=2){let x=d[u],w=d[u+1],p=d[u+2],y=d[u+3],m=x-p,g=w-y,b=h,v=h.length-2,S=i.length;for(let Y=0;Y<v;Y+=2){let C=b[Y],M=b[Y+1],R=b[Y+2],E=b[Y+3],F=m*(E-y)-g*(R-p)>0;if(m*(M-y)-g*(C-p)>0){if(F){i.push(R),i.push(E);continue}let I=E-M,T=R-C,P=I*(p-x)-T*(y-w);if(Math.abs(P)>1e-6){let O=(T*(w-M)-I*(x-C))/P;i.push(x+(p-x)*O),i.push(w+(y-w)*O)}else i.push(x),i.push(w)}else if(F){let I=E-M,T=R-C,P=I*(p-x)-T*(y-w);if(Math.abs(P)>1e-6){let O=(T*(w-M)-I*(x-C))/P;i.push(x+(p-x)*O),i.push(w+(y-w)*O)}else i.push(x),i.push(w);i.push(R),i.push(E)}n=!0}if(S==i.length)return o.length=0,!0;if(i.push(i[0]),i.push(i[1]),u==f)break;let A=i;i=h,i.length=0,h=A}if(o!=i){o.length=0;for(let u=0,x=i.length-2;u<x;u++)o[u]=i[u]}else o.length=o.length-2;return n}static makeClockwise(e){let s=e,t=e.length,a=s[t-2]*s[1]-s[0]*s[t-1],r=0,c=0,l=0,i=0;for(let o=0,n=t-3;o<n;o+=2)r=s[o],c=s[o+1],l=s[o+2],i=s[o+3],a+=r*i-l*c;if(!(a<0))for(let o=0,n=t-2,h=t>>1;o<h;o+=2){let d=s[o],f=s[o+1],u=n-o;s[o]=s[u],s[o+1]=s[u+1],s[u]=d,s[u+1]=f}}},ni=class{constructor(e){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}readSkeletonData(e){let s=this.scale,t=new Mt,a=typeof e=="string"?JSON.parse(e):e,r=a.skeleton;if(r&&(t.hash=r.hash,t.version=r.spine,t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t.fps=r.fps,t.imagesPath=r.images),a.bones)for(let c=0;c<a.bones.length;c++){let l=a.bones[c],i=null,o=k(l,"parent",null);o&&(i=t.findBone(o));let n=new kt(t.bones.length,l.name,i);n.length=k(l,"length",0)*s,n.x=k(l,"x",0)*s,n.y=k(l,"y",0)*s,n.rotation=k(l,"rotation",0),n.scaleX=k(l,"scaleX",1),n.scaleY=k(l,"scaleY",1),n.shearX=k(l,"shearX",0),n.shearY=k(l,"shearY",0),n.transformMode=B.enumValue(Ne,k(l,"transform","Normal")),n.skinRequired=k(l,"skin",!1);let h=k(l,"color",null);h&&n.color.setFromString(h),t.bones.push(n)}if(a.slots)for(let c=0;c<a.slots.length;c++){let l=a.slots[c],i=t.findBone(l.bone);if(!i)throw new Error(`Couldn't find bone ${l.bone} for slot ${l.name}`);let o=new Et(t.slots.length,l.name,i),n=k(l,"color",null);n&&o.color.setFromString(n);let h=k(l,"dark",null);h&&(o.darkColor=L.fromString(h)),o.attachmentName=k(l,"attachment",null),o.blendMode=B.enumValue(ze,k(l,"blend","normal")),t.slots.push(o)}if(a.ik)for(let c=0;c<a.ik.length;c++){let l=a.ik[c],i=new Tt(l.name);i.order=k(l,"order",0),i.skinRequired=k(l,"skin",!1);for(let n=0;n<l.bones.length;n++){let h=t.findBone(l.bones[n]);if(!h)throw new Error(`Couldn't find bone ${l.bones[n]} for IK constraint ${l.name}.`);i.bones.push(h)}let o=t.findBone(l.target);if(!o)throw new Error(`Couldn't find target bone ${l.target} for IK constraint ${l.name}.`);i.target=o,i.mix=k(l,"mix",1),i.softness=k(l,"softness",0)*s,i.bendDirection=k(l,"bendPositive",!0)?1:-1,i.compress=k(l,"compress",!1),i.stretch=k(l,"stretch",!1),i.uniform=k(l,"uniform",!1),t.ikConstraints.push(i)}if(a.transform)for(let c=0;c<a.transform.length;c++){let l=a.transform[c],i=new Rt(l.name);i.order=k(l,"order",0),i.skinRequired=k(l,"skin",!1);for(let h=0;h<l.bones.length;h++){let d=l.bones[h],f=t.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for transform constraint ${l.name}.`);i.bones.push(f)}let o=l.target,n=t.findBone(o);if(!n)throw new Error(`Couldn't find target bone ${o} for transform constraint ${l.name}.`);i.target=n,i.local=k(l,"local",!1),i.relative=k(l,"relative",!1),i.offsetRotation=k(l,"rotation",0),i.offsetX=k(l,"x",0)*s,i.offsetY=k(l,"y",0)*s,i.offsetScaleX=k(l,"scaleX",0),i.offsetScaleY=k(l,"scaleY",0),i.offsetShearY=k(l,"shearY",0),i.mixRotate=k(l,"mixRotate",1),i.mixX=k(l,"mixX",1),i.mixY=k(l,"mixY",i.mixX),i.mixScaleX=k(l,"mixScaleX",1),i.mixScaleY=k(l,"mixScaleY",i.mixScaleX),i.mixShearY=k(l,"mixShearY",1),t.transformConstraints.push(i)}if(a.path)for(let c=0;c<a.path.length;c++){let l=a.path[c],i=new Xt(l.name);i.order=k(l,"order",0),i.skinRequired=k(l,"skin",!1);for(let h=0;h<l.bones.length;h++){let d=l.bones[h],f=t.findBone(d);if(!f)throw new Error(`Couldn't find bone ${d} for path constraint ${l.name}.`);i.bones.push(f)}let o=l.target,n=t.findSlot(o);if(!n)throw new Error(`Couldn't find target slot ${o} for path constraint ${l.name}.`);i.target=n,i.positionMode=B.enumValue(Oe,k(l,"positionMode","Percent")),i.spacingMode=B.enumValue(_e,k(l,"spacingMode","Length")),i.rotateMode=B.enumValue(Ue,k(l,"rotateMode","Tangent")),i.offsetRotation=k(l,"rotation",0),i.position=k(l,"position",0),i.positionMode==0&&(i.position*=s),i.spacing=k(l,"spacing",0),(i.spacingMode==0||i.spacingMode==1)&&(i.spacing*=s),i.mixRotate=k(l,"mixRotate",1),i.mixX=k(l,"mixX",1),i.mixY=k(l,"mixY",i.mixX),t.pathConstraints.push(i)}if(a.skins)for(let c=0;c<a.skins.length;c++){let l=a.skins[c],i=new We(l.name);if(l.bones)for(let o=0;o<l.bones.length;o++){let n=l.bones[o],h=t.findBone(n);if(!h)throw new Error(`Couldn't find bone ${n} for skin ${l.name}.`);i.bones.push(h)}if(l.ik)for(let o=0;o<l.ik.length;o++){let n=l.ik[o],h=t.findIkConstraint(n);if(!h)throw new Error(`Couldn't find IK constraint ${n} for skin ${l.name}.`);i.constraints.push(h)}if(l.transform)for(let o=0;o<l.transform.length;o++){let n=l.transform[o],h=t.findTransformConstraint(n);if(!h)throw new Error(`Couldn't find transform constraint ${n} for skin ${l.name}.`);i.constraints.push(h)}if(l.path)for(let o=0;o<l.path.length;o++){let n=l.path[o],h=t.findPathConstraint(n);if(!h)throw new Error(`Couldn't find path constraint ${n} for skin ${l.name}.`);i.constraints.push(h)}for(let o in l.attachments){let n=t.findSlot(o);if(!n)throw new Error(`Couldn't find slot ${o} for skin ${l.name}.`);let h=l.attachments[o];for(let d in h){let f=this.readAttachment(h[d],i,n.index,d,t);f&&i.setAttachment(n.index,d,f)}}t.skins.push(i),i.name=="default"&&(t.defaultSkin=i)}for(let c=0,l=this.linkedMeshes.length;c<l;c++){let i=this.linkedMeshes[c],o=i.skin?t.findSkin(i.skin):t.defaultSkin;if(!o)throw new Error(`Skin not found: ${i.skin}`);let n=o.getAttachment(i.slotIndex,i.parent);if(!n)throw new Error(`Parent mesh not found: ${i.parent}`);i.mesh.timelineAttachment=i.inheritTimeline?n:i.mesh,i.mesh.setParentMesh(n),i.mesh.region!=null&&i.mesh.updateRegion()}if(this.linkedMeshes.length=0,a.events)for(let c in a.events){let l=a.events[c],i=new Ct(c);i.intValue=k(l,"int",0),i.floatValue=k(l,"float",0),i.stringValue=k(l,"string",""),i.audioPath=k(l,"audio",null),i.audioPath&&(i.volume=k(l,"volume",1),i.balance=k(l,"balance",0)),t.events.push(i)}if(a.animations)for(let c in a.animations){let l=a.animations[c];this.readAnimation(l,c,t)}return t}readAttachment(e,s,t,a,r){let c=this.scale;switch(a=k(e,"name",a),k(e,"type","region")){case"region":{let l=k(e,"path",a),i=this.readSequence(k(e,"sequence",null)),o=this.attachmentLoader.newRegionAttachment(s,a,l,i);if(!o)return null;o.path=l,o.x=k(e,"x",0)*c,o.y=k(e,"y",0)*c,o.scaleX=k(e,"scaleX",1),o.scaleY=k(e,"scaleY",1),o.rotation=k(e,"rotation",0),o.width=e.width*c,o.height=e.height*c,o.sequence=i;let n=k(e,"color",null);return n&&o.color.setFromString(n),o.region!=null&&o.updateRegion(),o}case"boundingbox":{let l=this.attachmentLoader.newBoundingBoxAttachment(s,a);if(!l)return null;this.readVertices(e,l,e.vertexCount<<1);let i=k(e,"color",null);return i&&l.color.setFromString(i),l}case"mesh":case"linkedmesh":{let l=k(e,"path",a),i=this.readSequence(k(e,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(s,a,l,i);if(!o)return null;o.path=l;let n=k(e,"color",null);n&&o.color.setFromString(n),o.width=k(e,"width",0)*c,o.height=k(e,"height",0)*c,o.sequence=i;let h=k(e,"parent",null);if(h)return this.linkedMeshes.push(new li(o,k(e,"skin",null),t,h,k(e,"timelines",!0))),o;let d=e.uvs;return this.readVertices(e,o,d.length),o.triangles=e.triangles,o.regionUVs=d,o.region!=null&&o.updateRegion(),o.edges=k(e,"edges",null),o.hullLength=k(e,"hull",0)*2,o}case"path":{let l=this.attachmentLoader.newPathAttachment(s,a);if(!l)return null;l.closed=k(e,"closed",!1),l.constantSpeed=k(e,"constantSpeed",!0);let i=e.vertexCount;this.readVertices(e,l,i<<1);let o=B.newArray(i/3,0);for(let h=0;h<e.lengths.length;h++)o[h]=e.lengths[h]*c;l.lengths=o;let n=k(e,"color",null);return n&&l.color.setFromString(n),l}case"point":{let l=this.attachmentLoader.newPointAttachment(s,a);if(!l)return null;l.x=k(e,"x",0)*c,l.y=k(e,"y",0)*c,l.rotation=k(e,"rotation",0);let i=k(e,"color",null);return i&&l.color.setFromString(i),l}case"clipping":{let l=this.attachmentLoader.newClippingAttachment(s,a);if(!l)return null;let i=k(e,"end",null);i&&(l.endSlot=r.findSlot(i));let o=e.vertexCount;this.readVertices(e,l,o<<1);let n=k(e,"color",null);return n&&l.color.setFromString(n),l}}return null}readSequence(e){if(e==null)return null;let s=new Ke(k(e,"count",0));return s.start=k(e,"start",1),s.digits=k(e,"digits",0),s.setupIndex=k(e,"setup",0),s}readVertices(e,s,t){let a=this.scale;s.worldVerticesLength=t;let r=e.vertices;if(t==r.length){let i=B.toFloatArray(r);if(a!=1)for(let o=0,n=r.length;o<n;o++)i[o]*=a;s.vertices=i;return}let c=new Array,l=new Array;for(let i=0,o=r.length;i<o;){let n=r[i++];l.push(n);for(let h=i+n*4;i<h;i+=4)l.push(r[i]),c.push(r[i+1]*a),c.push(r[i+2]*a),c.push(r[i+3])}s.bones=l,s.vertices=B.toFloatArray(c)}readAnimation(e,s,t){let a=this.scale,r=new Array;if(e.slots)for(let l in e.slots){let i=e.slots[l],o=t.findSlot(l);if(!o)throw new Error("Slot not found: "+l);let n=o.index;for(let h in i){let d=i[h];if(!d)continue;let f=d.length;if(h=="attachment"){let u=new xe(f,n);for(let x=0;x<f;x++){let w=d[x];u.setFrame(x,k(w,"time",0),k(w,"name",null))}r.push(u)}else if(h=="rgba"){let u=new lt(f,f<<2,n),x=d[0],w=k(x,"time",0),p=L.fromString(x.color);for(let y=0,m=0;;y++){u.setFrame(y,w,p.r,p.g,p.b,p.a);let g=d[y+1];if(!g){u.shrink(m);break}let b=k(g,"time",0),v=L.fromString(g.color),S=x.curve;S&&(m=z(S,u,m,y,0,w,b,p.r,v.r,1),m=z(S,u,m,y,1,w,b,p.g,v.g,1),m=z(S,u,m,y,2,w,b,p.b,v.b,1),m=z(S,u,m,y,3,w,b,p.a,v.a,1)),w=b,p=v,x=g}r.push(u)}else if(h=="rgb"){let u=new ot(f,f*3,n),x=d[0],w=k(x,"time",0),p=L.fromString(x.color);for(let y=0,m=0;;y++){u.setFrame(y,w,p.r,p.g,p.b);let g=d[y+1];if(!g){u.shrink(m);break}let b=k(g,"time",0),v=L.fromString(g.color),S=x.curve;S&&(m=z(S,u,m,y,0,w,b,p.r,v.r,1),m=z(S,u,m,y,1,w,b,p.g,v.g,1),m=z(S,u,m,y,2,w,b,p.b,v.b,1)),w=b,p=v,x=g}r.push(u)}else if(h=="alpha")r.push(oe(d,new ht(f,f,n),0,1));else if(h=="rgba2"){let u=new ct(f,f*7,n),x=d[0],w=k(x,"time",0),p=L.fromString(x.light),y=L.fromString(x.dark);for(let m=0,g=0;;m++){u.setFrame(m,w,p.r,p.g,p.b,p.a,y.r,y.g,y.b);let b=d[m+1];if(!b){u.shrink(g);break}let v=k(b,"time",0),S=L.fromString(b.light),A=L.fromString(b.dark),Y=x.curve;Y&&(g=z(Y,u,g,m,0,w,v,p.r,S.r,1),g=z(Y,u,g,m,1,w,v,p.g,S.g,1),g=z(Y,u,g,m,2,w,v,p.b,S.b,1),g=z(Y,u,g,m,3,w,v,p.a,S.a,1),g=z(Y,u,g,m,4,w,v,y.r,A.r,1),g=z(Y,u,g,m,5,w,v,y.g,A.g,1),g=z(Y,u,g,m,6,w,v,y.b,A.b,1)),w=v,p=S,y=A,x=b}r.push(u)}else if(h=="rgb2"){let u=new dt(f,f*6,n),x=d[0],w=k(x,"time",0),p=L.fromString(x.light),y=L.fromString(x.dark);for(let m=0,g=0;;m++){u.setFrame(m,w,p.r,p.g,p.b,y.r,y.g,y.b);let b=d[m+1];if(!b){u.shrink(g);break}let v=k(b,"time",0),S=L.fromString(b.light),A=L.fromString(b.dark),Y=x.curve;Y&&(g=z(Y,u,g,m,0,w,v,p.r,S.r,1),g=z(Y,u,g,m,1,w,v,p.g,S.g,1),g=z(Y,u,g,m,2,w,v,p.b,S.b,1),g=z(Y,u,g,m,3,w,v,y.r,A.r,1),g=z(Y,u,g,m,4,w,v,y.g,A.g,1),g=z(Y,u,g,m,5,w,v,y.b,A.b,1)),w=v,p=S,y=A,x=b}r.push(u)}}}if(e.bones)for(let l in e.bones){let i=e.bones[l],o=t.findBone(l);if(!o)throw new Error("Bone not found: "+l);let n=o.index;for(let h in i){let d=i[h],f=d.length;if(f!=0){if(h==="rotate")r.push(oe(d,new Ce(f,f,n),0,1));else if(h==="translate"){let u=new Qe(f,f<<1,n);r.push(Dt(d,u,"x","y",0,a))}else if(h==="translatex"){let u=new Ze(f,f,n);r.push(oe(d,u,0,a))}else if(h==="translatey"){let u=new et(f,f,n);r.push(oe(d,u,0,a))}else if(h==="scale"){let u=new tt(f,f<<1,n);r.push(Dt(d,u,"x","y",1,1))}else if(h==="scalex"){let u=new st(f,f,n);r.push(oe(d,u,1,1))}else if(h==="scaley"){let u=new it(f,f,n);r.push(oe(d,u,1,1))}else if(h==="shear"){let u=new rt(f,f<<1,n);r.push(Dt(d,u,"x","y",0,1))}else if(h==="shearx"){let u=new at(f,f,n);r.push(oe(d,u,0,1))}else if(h==="sheary"){let u=new nt(f,f,n);r.push(oe(d,u,0,1))}}}}if(e.ik)for(let l in e.ik){let i=e.ik[l],o=i[0];if(!o)continue;let n=t.findIkConstraint(l);if(!n)throw new Error("IK Constraint not found: "+l);let h=t.ikConstraints.indexOf(n),d=new ut(i.length,i.length<<1,h),f=k(o,"time",0),u=k(o,"mix",1),x=k(o,"softness",0)*a;for(let w=0,p=0;;w++){d.setFrame(w,f,u,x,k(o,"bendPositive",!0)?1:-1,k(o,"compress",!1),k(o,"stretch",!1));let y=i[w+1];if(!y){d.shrink(p);break}let m=k(y,"time",0),g=k(y,"mix",1),b=k(y,"softness",0)*a,v=o.curve;v&&(p=z(v,d,p,w,0,f,m,u,g,1),p=z(v,d,p,w,1,f,m,x,b,a)),f=m,u=g,x=b,o=y}r.push(d)}if(e.transform)for(let l in e.transform){let i=e.transform[l],o=i[0];if(!o)continue;let n=t.findTransformConstraint(l);if(!n)throw new Error("Transform constraint not found: "+l);let h=t.transformConstraints.indexOf(n),d=new mt(i.length,i.length*6,h),f=k(o,"time",0),u=k(o,"mixRotate",1),x=k(o,"mixX",1),w=k(o,"mixY",x),p=k(o,"mixScaleX",1),y=k(o,"mixScaleY",p),m=k(o,"mixShearY",1);for(let g=0,b=0;;g++){d.setFrame(g,f,u,x,w,p,y,m);let v=i[g+1];if(!v){d.shrink(b);break}let S=k(v,"time",0),A=k(v,"mixRotate",1),Y=k(v,"mixX",1),C=k(v,"mixY",Y),M=k(v,"mixScaleX",1),R=k(v,"mixScaleY",M),E=k(v,"mixShearY",1),F=o.curve;F&&(b=z(F,d,b,g,0,f,S,u,A,1),b=z(F,d,b,g,1,f,S,x,Y,1),b=z(F,d,b,g,2,f,S,w,C,1),b=z(F,d,b,g,3,f,S,p,M,1),b=z(F,d,b,g,4,f,S,y,R,1),b=z(F,d,b,g,5,f,S,m,E,1)),f=S,u=A,x=Y,w=C,p=M,y=R,p=M,o=v}r.push(d)}if(e.path)for(let l in e.path){let i=e.path[l],o=t.findPathConstraint(l);if(!o)throw new Error("Path constraint not found: "+l);let n=t.pathConstraints.indexOf(o);for(let h in i){let d=i[h],f=d[0];if(!f)continue;let u=d.length;if(h==="position"){let x=new gt(u,u,n);r.push(oe(d,x,0,o.positionMode==0?a:1))}else if(h==="spacing"){let x=new xt(u,u,n);r.push(oe(d,x,0,o.spacingMode==0||o.spacingMode==1?a:1))}else if(h==="mix"){let x=new wt(u,u*3,n),w=k(f,"time",0),p=k(f,"mixRotate",1),y=k(f,"mixX",1),m=k(f,"mixY",y);for(let g=0,b=0;;g++){x.setFrame(g,w,p,y,m);let v=d[g+1];if(!v){x.shrink(b);break}let S=k(v,"time",0),A=k(v,"mixRotate",1),Y=k(v,"mixX",1),C=k(v,"mixY",Y),M=f.curve;M&&(b=z(M,x,b,g,0,w,S,p,A,1),b=z(M,x,b,g,1,w,S,y,Y,1),b=z(M,x,b,g,2,w,S,m,C,1)),w=S,p=A,y=Y,m=C,f=v}r.push(x)}}}if(e.attachments)for(let l in e.attachments){let i=e.attachments[l],o=t.findSkin(l);if(!o)throw new Error("Skin not found: "+l);for(let n in i){let h=i[n],d=t.findSlot(n);if(!d)throw new Error("Slot not found: "+n);let f=d.index;for(let u in h){let x=h[u],w=o.getAttachment(f,u);for(let p in x){let y=x[p],m=y[0];if(m){if(p=="deform"){let g=w.bones,b=w.vertices,v=g?b.length/3*2:b.length,S=new ft(y.length,y.length,f,w),A=k(m,"time",0);for(let Y=0,C=0;;Y++){let M,R=k(m,"vertices",null);if(!R)M=g?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 P=T,O=P+R.length;P<O;P++)M[P]*=a;if(!g)for(let P=0;P<v;P++)M[P]+=b[P]}S.setFrame(Y,A,M);let E=y[Y+1];if(!E){S.shrink(C);break}let F=k(E,"time",0),I=m.curve;I&&(C=z(I,S,C,Y,0,A,F,0,1,1)),A=F,m=E}r.push(S)}else if(p=="sequence"){let g=new pe(y.length,f,w),b=0;for(let v=0;v<y.length;v++){let S=k(m,"delay",b),A=k(m,"time",0),Y=Ut[k(m,"mode","hold")],C=k(m,"index",0);g.setFrame(v,A,Y,C,S),b=S,m=y[v+1]}r.push(g)}}}}}}if(e.drawOrder){let l=new we(e.drawOrder.length),i=t.slots.length,o=0;for(let n=0;n<e.drawOrder.length;n++,o++){let h=e.drawOrder[n],d=null,f=k(h,"offsets",null);if(f){d=B.newArray(i,-1);let u=B.newArray(i-f.length,0),x=0,w=0;for(let p=0;p<f.length;p++){let y=f[p],m=t.findSlot(y.slot);if(!m)throw new Error("Slot not found: "+m);let g=m.index;for(;x!=g;)u[w++]=x++;d[x+y.offset]=x++}for(;x<i;)u[w++]=x++;for(let p=i-1;p>=0;p--)d[p]==-1&&(d[p]=u[--w])}l.setFrame(o,k(h,"time",0),d)}r.push(l)}if(e.events){let l=new Te(e.events.length),i=0;for(let o=0;o<e.events.length;o++,i++){let n=e.events[o],h=t.findEvent(n.name);if(!h)throw new Error("Event not found: "+n.name);let d=new It(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)),l.setFrame(i,d)}r.push(l)}let c=0;for(let l=0,i=r.length;l<i;l++)c=Math.max(c,r[l].getDuration());t.animations.push(new Ee(s,r,c))}},li=class{constructor(e,s,t,a,r){this.mesh=e,this.skin=s,this.slotIndex=t,this.parent=a,this.inheritTimeline=r}};function oe(e,s,t,a){let r=e[0],c=k(r,"time",0),l=k(r,"value",t)*a,i=0;for(let o=0;;o++){s.setFrame(o,c,l);let n=e[o+1];if(!n)return s.shrink(i),s;let h=k(n,"time",0),d=k(n,"value",t)*a;r.curve&&(i=z(r.curve,s,i,o,0,c,h,l,d,a)),c=h,l=d,r=n}}function Dt(e,s,t,a,r,c){let l=e[0],i=k(l,"time",0),o=k(l,t,r)*c,n=k(l,a,r)*c,h=0;for(let d=0;;d++){s.setFrame(d,i,o,n);let f=e[d+1];if(!f)return s.shrink(h),s;let u=k(f,"time",0),x=k(f,t,r)*c,w=k(f,a,r)*c,p=l.curve;p&&(h=z(p,s,h,d,0,i,u,o,x,c),h=z(p,s,h,d,1,i,u,n,w,c)),i=u,o=x,n=w,l=f}}function z(e,s,t,a,r,c,l,i,o,n){if(e=="stepped")return s.setStepped(a),t;let h=r<<2,d=e[h],f=e[h+1]*n,u=e[h+2],x=e[h+3]*n;return s.setBezier(t,a,r,c,i,d,f,u,x,l,o),t+1}function k(e,s,t){return e[s]!==void 0?e[s]:t}return typeof Math.fround=="undefined"&&(Math.fround=function(e){return function(s){return e[0]=s,e[0]}}(new Float32Array(1))),As(Nt)})();
|
|
1
|
+
"use strict";var spine=(()=>{var Ee=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Cs=Object.getOwnPropertyNames,Is=Object.prototype.hasOwnProperty,ks=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ts=(e,t)=>{for(var s in t)Ee(e,s,{get:t[s],enumerable:!0})},Ys=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Cs(t))!Is.call(e,a)&&a!==s&&Ee(e,a,{get:()=>t[a],enumerable:!(i=As(t,a))||i.enumerable});return e},Ms=e=>Ys(Ee({},"__esModule",{value:!0}),e),V=(e,t,s)=>(ks(e,typeof t!="symbol"?t+"":t,s),s),_t={};Ts(_t,{AlphaTimeline:()=>dt,Animation:()=>Be,AnimationState:()=>Zt,AnimationStateAdapter:()=>qs,AnimationStateData:()=>Us,AssetManagerBase:()=>Hs,AtlasAttachmentLoader:()=>$s,Attachment:()=>Qe,AttachmentTimeline:()=>be,BinaryInput:()=>ws,BlendMode:()=>Ge,Bone:()=>Tt,BoneData:()=>kt,BoundingBoxAttachment:()=>Ne,CURRENT:()=>rs,ClippingAttachment:()=>At,Color:()=>D,ConstraintData:()=>Ue,CurveTimeline:()=>ne,CurveTimeline1:()=>te,CurveTimeline2:()=>Ve,DebugUtils:()=>Es,DeformTimeline:()=>mt,Downloader:()=>cs,DrawOrderTimeline:()=>pe,Event:()=>Yt,EventData:()=>Mt,EventQueue:()=>ts,EventTimeline:()=>Xe,EventType:()=>Z,FIRST:()=>yt,FakeTexture:()=>Ws,HOLD_FIRST:()=>Oe,HOLD_MIX:()=>ss,HOLD_SUBSEQUENT:()=>vt,IkConstraint:()=>ds,IkConstraintData:()=>Xt,IkConstraintTimeline:()=>gt,IntSet:()=>Xs,Interpolation:()=>qt,MathUtils:()=>F,MeshAttachment:()=>Se,MixBlend:()=>Ht,MixDirection:()=>Gt,PathAttachment:()=>Ae,PathConstraint:()=>Ce,PathConstraintData:()=>Ft,PathConstraintMixTimeline:()=>pt,PathConstraintPositionTimeline:()=>wt,PathConstraintSpacingTimeline:()=>bt,Physics:()=>xs,PhysicsConstraintDampingTimeline:()=>Ls,PhysicsConstraintGravityTimeline:()=>Ns,PhysicsConstraintInertiaTimeline:()=>Bs,PhysicsConstraintMassTimeline:()=>Ds,PhysicsConstraintMixTimeline:()=>_s,PhysicsConstraintResetTimeline:()=>Qt,PhysicsConstraintStrengthTimeline:()=>Vs,PhysicsConstraintTimeline:()=>fe,PhysicsConstraintWindTimeline:()=>Os,PointAttachment:()=>It,Pool:()=>Ye,PositionMode:()=>We,Pow:()=>Ut,PowOut:()=>Fs,RGB2Timeline:()=>ut,RGBA2Timeline:()=>ft,RGBATimeline:()=>ht,RGBTimeline:()=>ct,RegionAttachment:()=>$,RotateMode:()=>$e,RotateTimeline:()=>Me,SETUP:()=>St,SUBSEQUENT:()=>De,ScaleTimeline:()=>rt,ScaleXTimeline:()=>it,ScaleYTimeline:()=>at,SequenceTimeline:()=>ve,ShearTimeline:()=>nt,ShearXTimeline:()=>lt,ShearYTimeline:()=>ot,Skeleton:()=>gs,SkeletonBinary:()=>js,SkeletonBounds:()=>pr,SkeletonClipping:()=>Lt,SkeletonData:()=>Et,SkeletonJson:()=>yr,Skin:()=>He,SkinEntry:()=>Rt,Slot:()=>fs,SlotData:()=>Pt,SpacingMode:()=>ze,StringSet:()=>Ke,Texture:()=>is,TextureAtlas:()=>ls,TextureAtlasPage:()=>os,TextureAtlasRegion:()=>Ct,TextureFilter:()=>_e,TextureRegion:()=>ns,TextureWrap:()=>as,TimeKeeper:()=>Rs,Timeline:()=>J,TrackEntry:()=>es,TransformConstraint:()=>us,TransformConstraintData:()=>Bt,TransformConstraintTimeline:()=>xt,TransformMode:()=>qe,TranslateTimeline:()=>et,TranslateXTimeline:()=>tt,TranslateYTimeline:()=>st,Triangulator:()=>ee,Utils:()=>P,Vector2:()=>Re,VertexAttachment:()=>ae,WindowedMean:()=>Ps});var Xs=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 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)}},D=we;V(D,"WHITE",new we(1,1,1,1)),V(D,"RED",new we(1,0,0,1)),V(D,"GREEN",new we(0,1,0,1)),V(D,"BLUE",new we(0,0,1,1)),V(D,"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;V(F,"PI",3.1415927),V(F,"PI2",ie.PI*2),V(F,"invPI2",1/ie.PI2),V(F,"radiansToDegrees",180/ie.PI),V(F,"radDeg",ie.radiansToDegrees),V(F,"degreesToRadians",ie.PI/180),V(F,"degRad",ie.degreesToRadians);var qt=class{apply(e,t,s){return e+(t-e)*this.applyInternal(s)}},Ut=class extends qt{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}},Fs=class extends Ut{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,s,i,a){for(let h=t,l=i;h<t+a;h++,l++)s[l]=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:ye.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(ye.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(ye.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 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,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=ye;V(P,"SUPPORTS_TYPED_ARRAYS",typeof Float32Array<"u");var Es=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)}}},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}},Re=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}},Rs=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)}},Ps=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}},Wt=class extends Qe{id=Wt.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 l=e.bone.skeleton,r=e.deform,o=this.vertices,n=this.bones;if(!n){r.length>0&&(o=r);let u=e.bone,g=u.worldX,w=u.worldY,b=u.a,v=u.b,x=u.c,m=u.d;for(let p=t,y=a;y<s;p+=2,y+=h){let S=o[p],A=o[p+1];i[y]=S*b+A*v+g,i[y+1]=S*x+A*m+w}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=l.bones;if(r.length==0)for(let u=a,g=f*3;u<s;u+=h){let w=0,b=0,v=n[c++];for(v+=c;c<v;c++,g+=3){let x=d[n[c]],m=o[g],p=o[g+1],y=o[g+2];w+=(m*x.a+p*x.b+x.worldX)*y,b+=(m*x.c+p*x.d+x.worldY)*y}i[u]=w,i[u+1]=b}else{let u=r;for(let g=a,w=f*3,b=f<<1;g<s;g+=h){let v=0,x=0,m=n[c++];for(m+=c;c<m;c++,w+=3,b+=2){let p=d[n[c]],y=o[w]+u[b],S=o[w+1]+u[b+1],A=o[w+2];v+=(y*p.a+S*p.b+p.worldX)*A,x+=(y*p.c+S*p.d+p.worldY)*A}i[g]=v,i[g+1]=x}}}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=Wt;V(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++}},Ze=Pe;V(Ze,"_nextID",0);var zt=(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))(zt||{}),$t=[0,1,2,3,4,5,6],Be=class{name;timelines=[];timelineIds=new Ke;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,l,r){if(!e)throw new Error("skeleton cannot be null.");i&&this.duration!=0&&(s%=this.duration,t>0&&(t%=this.duration));let o=this.timelines;for(let n=0,c=o.length;n<c;n++)o[n].apply(e,t,s,a,h,l,r)}},Ht=(e=>(e[e.setup=0]="setup",e[e.first=1]="first",e[e.replace=2]="replace",e[e.add=3]="add",e))(Ht||{}),Gt=(e=>(e[e.mixIn=0]="mixIn",e[e.mixOut=1]="mixOut",e))(Gt||{}),_={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,l,r,o,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-l*2+o)*.03,w=((h-r)*3-i+n)*.006,b=((l-o)*3-a+c)*.006,v=u*2+w,x=g*2+b,m=(h-i)*.3+u+w*.16666667,p=(l-a)*.3+g+b*.16666667,y=i+m,S=a+p;for(let A=d+18;d<A;d+=2)f[d]=y,f[d+1]=S,m+=v,p+=x,v+=w,x+=b,y+=m,S+=p}getBezierValue(e,t,s,i){let a=this.curves;if(a[i]>e){let o=this.frames[t],n=this.frames[t+s];return n+(e-o)/(a[i]-o)*(a[i+1]-n)}let h=i+18;for(i+=2;i<h;i+=2)if(a[i]>=e){let o=a[i-2],n=a[i-1];return n+(e-o)/(a[i]-o)*(a[i+1]-n)}t+=this.getFrameEntries();let l=a[h-2],r=a[h-1];return r+(e-l)/(this.frames[t]-l)*(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 l=this.frames;if(e<l[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 o=0;switch(s){case 0:return o=Math.abs(h)*F.signum(r),o+(r-o)*t;case 1:case 2:return o=Math.abs(a)*F.signum(r),o+(r-o)*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}},Me=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.rotate+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.rotation=this.getRelativeValue(s,a,h,r.rotation,r.data.rotation))}},et=class extends Ve{boneIndex=0;constructor(e,t,s){super(e,t,_.x+"|"+s,_.y+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(s<o[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(o,s,3),d=this.curves[f/3];switch(d){case 0:let u=o[f];n=o[f+1],c=o[f+2];let g=(s-u)/(o[f+3]-u);n+=(o[f+3+1]-n)*g,c+=(o[f+3+2]-c)*g;break;case 1:n=o[f+1],c=o[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}}},tt=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.x+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.x=this.getRelativeValue(s,a,h,r.x,r.data.x))}},st=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.y+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.y=this.getRelativeValue(s,a,h,r.y,r.data.y))}},rt=class extends Ve{boneIndex=0;constructor(e,t,s){super(e,t,_.scaleX+"|"+s,_.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(s<o[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(o,s,3),d=this.curves[f/3];switch(d){case 0:let u=o[f];n=o[f+1],c=o[f+2];let g=(s-u)/(o[f+3]-u);n+=(o[f+3+1]-n)*g,c+=(o[f+3+2]-c)*g;break;case 1:n=o[f+1],c=o[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(l==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}}}},it=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.scaleX+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.scaleX=this.getScaleValue(s,a,h,l,r.scaleX,r.data.scaleX))}},at=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.scaleY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.scaleY=this.getScaleValue(s,a,h,l,r.scaleX,r.data.scaleY))}},nt=class extends Ve{boneIndex=0;constructor(e,t,s){super(e,t,_.shearX+"|"+s,_.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];if(!r.active)return;let o=this.frames;if(s<o[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(o,s,3),d=this.curves[f/3];switch(d){case 0:let u=o[f];n=o[f+1],c=o[f+2];let g=(s-u)/(o[f+3]-u);n+=(o[f+3+1]-n)*g,c+=(o[f+3+2]-c)*g;break;case 1:n=o[f+1],c=o[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}}},lt=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.shearX+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.shearX=this.getRelativeValue(s,a,h,r.shearX,r.data.shearX))}},ot=class extends te{boneIndex=0;constructor(e,t,s){super(e,t,_.shearY+"|"+s),this.boneIndex=s}apply(e,t,s,i,a,h,l){let r=e.bones[this.boneIndex];r.active&&(r.shearY=this.getRelativeValue(s,a,h,r.shearX,r.data.shearY))}},ht=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[_.rgb+"|"+s,_.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,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,n=r.color;if(s<o[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(o,s,5),w=this.curves[g/5];switch(w){case 0:let b=o[g];c=o[g+1],f=o[g+2],d=o[g+3],u=o[g+4];let v=(s-b)/(o[g+5]-b);c+=(o[g+5+1]-c)*v,f+=(o[g+5+2]-f)*v,d+=(o[g+5+3]-d)*v,u+=(o[g+5+4]-u)*v;break;case 1:c=o[g+1],f=o[g+2],d=o[g+3],u=o[g+4];break;default:c=this.getBezierValue(s,g,1,w-2),f=this.getBezierValue(s,g,2,w+18-2),d=this.getBezierValue(s,g,3,w+18*2-2),u=this.getBezierValue(s,g,4,w+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))}},ct=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[_.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,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,n=r.color;if(s<o[0]){let w=r.data.color;switch(h){case 0:n.r=w.r,n.g=w.g,n.b=w.b;return;case 1:n.r+=(w.r-n.r)*a,n.g+=(w.g-n.g)*a,n.b+=(w.b-n.b)*a}return}let c=0,f=0,d=0,u=J.search(o,s,4),g=this.curves[u>>2];switch(g){case 0:let w=o[u];c=o[u+1],f=o[u+2],d=o[u+3];let b=(s-w)/(o[u+4]-w);c+=(o[u+4+1]-c)*b,f+=(o[u+4+2]-f)*b,d+=(o[u+4+3]-d)*b;break;case 1:c=o[u+1],f=o[u+2],d=o[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 w=r.data.color;n.r=w.r,n.g=w.g,n.b=w.b}n.r+=(c-n.r)*a,n.g+=(f-n.g)*a,n.b+=(d-n.b)*a}}},dt=class extends te{slotIndex=0;constructor(e,t,s){super(e,t,_.alpha+"|"+s),this.slotIndex=s}apply(e,t,s,i,a,h,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=r.color;if(s<this.frames[0]){let c=r.data.color;switch(h){case 0:o.a=c.a;return;case 1:o.a+=(c.a-o.a)*a}return}let n=this.getCurveValue(s);a==1?o.a=n:(h==0&&(o.a=r.data.color.a),o.a+=(n-o.a)*a)}},ft=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[_.rgb+"|"+s,_.alpha+"|"+s,_.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 8}setFrame(e,t,s,i,a,h,l,r,o){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]=l,this.frames[e+6]=r,this.frames[e+7]=o}apply(e,t,s,i,a,h,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,n=r.color,c=r.darkColor;if(s<o[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,w=0,b=0,v=0,x=J.search(o,s,8),m=this.curves[x>>3];switch(m){case 0:let p=o[x];f=o[x+1],d=o[x+2],u=o[x+3],g=o[x+4],w=o[x+5],b=o[x+6],v=o[x+7];let y=(s-p)/(o[x+8]-p);f+=(o[x+8+1]-f)*y,d+=(o[x+8+2]-d)*y,u+=(o[x+8+3]-u)*y,g+=(o[x+8+4]-g)*y,w+=(o[x+8+5]-w)*y,b+=(o[x+8+6]-b)*y,v+=(o[x+8+7]-v)*y;break;case 1:f=o[x+1],d=o[x+2],u=o[x+3],g=o[x+4],w=o[x+5],b=o[x+6],v=o[x+7];break;default:f=this.getBezierValue(s,x,1,m-2),d=this.getBezierValue(s,x,2,m+18-2),u=this.getBezierValue(s,x,3,m+18*2-2),g=this.getBezierValue(s,x,4,m+18*3-2),w=this.getBezierValue(s,x,5,m+18*4-2),b=this.getBezierValue(s,x,6,m+18*5-2),v=this.getBezierValue(s,x,7,m+18*6-2)}if(a==1)n.set(f,d,u,g),c.r=w,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+=(w-c.r)*a,c.g+=(b-c.g)*a,c.b+=(v-c.b)*a}}},ut=class extends ne{slotIndex=0;constructor(e,t,s){super(e,t,[_.rgb+"|"+s,_.rgb2+"|"+s]),this.slotIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,i,a,h,l,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]=l,this.frames[e+6]=r}apply(e,t,s,i,a,h,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=this.frames,n=r.color,c=r.darkColor;if(s<o[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,w=0,b=0,v=0,x=J.search(o,s,7),m=this.curves[x/7];switch(m){case 0:let p=o[x];f=o[x+1],d=o[x+2],u=o[x+3],w=o[x+4],b=o[x+5],v=o[x+6];let y=(s-p)/(o[x+7]-p);f+=(o[x+7+1]-f)*y,d+=(o[x+7+2]-d)*y,u+=(o[x+7+3]-u)*y,w+=(o[x+7+4]-w)*y,b+=(o[x+7+5]-b)*y,v+=(o[x+7+6]-v)*y;break;case 1:f=o[x+1],d=o[x+2],u=o[x+3],w=o[x+4],b=o[x+5],v=o[x+6];break;default:f=this.getBezierValue(s,x,1,m-2),d=this.getBezierValue(s,x,2,m+18-2),u=this.getBezierValue(s,x,3,m+18*2-2),w=this.getBezierValue(s,x,4,m+18*3-2),b=this.getBezierValue(s,x,5,m+18*4-2),v=this.getBezierValue(s,x,6,m+18*5-2)}if(a==1)n.r=f,n.g=d,n.b=u,c.r=w,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+=(w-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,[_.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,l){let r=e.slots[this.slotIndex];if(r.bone.active){if(l==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)}},mt=class extends ne{slotIndex=0;attachment;vertices;constructor(e,t,s,i){super(e,t,[_.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,l,r,o,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=o*.03-l*.06,w=((h-r)*3-i+n)*.006,b=(l-o+.33333333)*.018,v=u*2+w,x=g*2+b,m=(h-i)*.3+u+w*.16666667,p=l*.3+g+b*.16666667,y=i+m,S=p;for(let A=d+18;d<A;d+=2)f[d]=y,f[d+1]=S,m+=v,p+=x,v+=w,x+=b,y+=m,S+=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],o=s[i-1];return o+(e-r)/(s[i]-r)*(s[i+1]-o)}let h=s[a-2],l=s[a-1];return l+(1-l)*(e-h)/(this.frames[t+this.getFrameEntries()]-h)}apply(e,t,s,i,a,h,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=r.getAttachment();if(!o||!(o instanceof ae)||o.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 x=o;if(x.bones){a=1-a;for(var u=0;u<f;u++)n[u]*=a}else{let m=x.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 x=c[d.length-1];if(a==1)if(h==3){let m=o;if(m.bones)for(let p=0;p<f;p++)n[p]+=x[p];else{let p=m.vertices;for(let y=0;y<f;y++)n[y]+=x[y]-p[y]}}else P.arrayCopy(x,0,n,0,f);else switch(h){case 0:{let p=o;if(p.bones)for(let y=0;y<f;y++)n[y]=x[y]*a;else{let y=p.vertices;for(let S=0;S<f;S++){let A=y[S];n[S]=A+(x[S]-A)*a}}break}case 1:case 2:for(let p=0;p<f;p++)n[p]+=(x[p]-n[p])*a;break;case 3:let m=o;if(m.bones)for(let p=0;p<f;p++)n[p]+=x[p]*a;else{let p=m.vertices;for(let y=0;y<f;y++)n[y]+=(x[y]-p[y])*a}}return}let g=J.search1(d,s),w=this.getCurvePercent(s,g),b=c[g],v=c[g+1];if(a==1)if(h==3){let x=o;if(x.bones)for(let m=0;m<f;m++){let p=b[m];n[m]+=p+(v[m]-p)*w}else{let m=x.vertices;for(let p=0;p<f;p++){let y=b[p];n[p]+=y+(v[p]-y)*w-m[p]}}}else for(let x=0;x<f;x++){let m=b[x];n[x]=m+(v[x]-m)*w}else switch(h){case 0:{let m=o;if(m.bones)for(let p=0;p<f;p++){let y=b[p];n[p]=(y+(v[p]-y)*w)*a}else{let p=m.vertices;for(let y=0;y<f;y++){let S=b[y],A=p[y];n[y]=A+(S+(v[y]-S)*w-A)*a}}break}case 1:case 2:for(let m=0;m<f;m++){let p=b[m];n[m]+=(p+(v[m]-p)*w-n[m])*a}break;case 3:let x=o;if(x.bones)for(let m=0;m<f;m++){let p=b[m];n[m]+=(p+(v[m]-p)*w)*a}else{let m=x.vertices;for(let p=0;p<f;p++){let y=b[p];n[p]+=(y+(v[p]-y)*w-m[p])*a}}}}},jt=class extends J{events;constructor(e){super(e,jt.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,l){if(!i)return;let r=this.frames,o=this.frames.length;if(t>s)this.apply(e,t,Number.MAX_VALUE,i,a,h,l),t=-1;else if(t>=r[o-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<o&&s>=r[n];n++)i.push(this.events[n])}},Xe=jt;V(Xe,"propertyIds",[""+_.event]);var Jt=class extends J{drawOrders;constructor(e){super(e,Jt.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,l){if(l==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),o=this.drawOrders[r];if(!o)P.arrayCopy(e.slots,0,e.drawOrder,0,e.slots.length);else{let n=e.drawOrder,c=e.slots;for(let f=0,d=o.length;f<d;f++)n[f]=c[o[f]]}}},pe=Jt;V(pe,"propertyIds",[""+_.drawOrder]);var gt=class extends ne{constraintIndex=0;constructor(e,t,s){super(e,t,[_.ikConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,i,a,h,l){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]=l?1:0}apply(e,t,s,i,a,h,l){let r=e.ikConstraints[this.constraintIndex];if(!r.active)return;let o=this.frames;if(s<o[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(o,s,6),d=this.curves[f/6];switch(d){case 0:let u=o[f];n=o[f+1],c=o[f+2];let g=(s-u)/(o[f+6]-u);n+=(o[f+6+1]-n)*g,c+=(o[f+6+2]-c)*g;break;case 1:n=o[f+1],c=o[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,l==1?(r.bendDirection=r.data.bendDirection,r.compress=r.data.compress,r.stretch=r.data.stretch):(r.bendDirection=o[f+3],r.compress=o[f+4]!=0,r.stretch=o[f+5]!=0)):(r.mix+=(n-r.mix)*a,r.softness+=(c-r.softness)*a,l==0&&(r.bendDirection=o[f+3],r.compress=o[f+4]!=0,r.stretch=o[f+5]!=0))}},xt=class extends ne{constraintIndex=0;constructor(e,t,s){super(e,t,[_.transformConstraint+"|"+s]),this.constraintIndex=s}getFrameEntries(){return 7}setFrame(e,t,s,i,a,h,l,r){let o=this.frames;e*=7,o[e]=t,o[e+1]=s,o[e+2]=i,o[e+3]=a,o[e+4]=h,o[e+5]=l,o[e+6]=r}apply(e,t,s,i,a,h,l){let r=e.transformConstraints[this.constraintIndex];if(!r.active)return;let o=this.frames;if(s<o[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,w=J.search(o,s,7),b=this.curves[w/7];switch(b){case 0:let v=o[w];n=o[w+1],c=o[w+2],f=o[w+3],d=o[w+4],u=o[w+5],g=o[w+6];let x=(s-v)/(o[w+7]-v);n+=(o[w+7+1]-n)*x,c+=(o[w+7+2]-c)*x,f+=(o[w+7+3]-f)*x,d+=(o[w+7+4]-d)*x,u+=(o[w+7+5]-u)*x,g+=(o[w+7+6]-g)*x;break;case 1:n=o[w+1],c=o[w+2],f=o[w+3],d=o[w+4],u=o[w+5],g=o[w+6];break;default:n=this.getBezierValue(s,w,1,b-2),c=this.getBezierValue(s,w,2,b+18-2),f=this.getBezierValue(s,w,3,b+18*2-2),d=this.getBezierValue(s,w,4,b+18*3-2),u=this.getBezierValue(s,w,5,b+18*4-2),g=this.getBezierValue(s,w,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}},wt=class extends te{constraintIndex=0;constructor(e,t,s){super(e,t,_.pathConstraintPosition+"|"+s),this.constraintIndex=s}apply(e,t,s,i,a,h,l){let r=e.pathConstraints[this.constraintIndex];r.active&&(r.position=this.getAbsoluteValue(s,a,h,r.position,r.data.position))}},bt=class extends te{constraintIndex=0;constructor(e,t,s){super(e,t,_.pathConstraintSpacing+"|"+s),this.constraintIndex=s}apply(e,t,s,i,a,h,l){let r=e.pathConstraints[this.constraintIndex];r.active&&(r.spacing=this.getAbsoluteValue(s,a,h,r.spacing,r.data.spacing))}},pt=class extends ne{constraintIndex=0;constructor(e,t,s){super(e,t,[_.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,l){let r=e.pathConstraints[this.constraintIndex];if(!r.active)return;let o=this.frames;if(s<o[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(o,s,4),u=this.curves[d>>2];switch(u){case 0:let g=o[d];n=o[d+1],c=o[d+2],f=o[d+3];let w=(s-g)/(o[d+4]-g);n+=(o[d+4+1]-n)*w,c+=(o[d+4+2]-c)*w,f+=(o[d+4+3]-f)*w;break;case 1:n=o[d+1],c=o[d+2],f=o[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,l){let r;if(this.constraintIndex==-1){const o=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),o))}else r=e.physicsConstraints[this.constraintIndex],r.active&&this.set(r,this.getAbsoluteValue(s,a,h,this.get(r),this.setup(r)))}},Bs=class extends fe{constructor(e,t,s,i){super(e,t,s,_.physicsConstraintInertia)}setup(e){return e.data.inertia}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Vs=class extends fe{constructor(e,t,s,i){super(e,t,s,_.physicsConstraintStrength)}setup(e){return e.data.strength}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},Ls=class extends fe{constructor(e,t,s,i){super(e,t,s,_.physicsConstraintDamping)}setup(e){return e.data.damping}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},Ds=class extends fe{constructor(e,t,s,i){super(e,t,s,_.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}},Os=class extends fe{constructor(e,t,s,i){super(e,t,s,_.physicsConstraintWind)}setup(e){return e.data.wind}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},Ns=class extends fe{constructor(e,t,s,i){super(e,t,s,_.physicsConstraintGravity)}setup(e){return e.data.gravity}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},_s=class extends fe{constructor(e,t,s,i){super(e,t,s,_.physicsConstraintMix)}setup(e){return e.data.mix}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},Kt=class extends J{constraintIndex;constructor(e,t){super(e,Kt.propertyIds),this.constraintIndex=t}getFrameCount(){return this.frames.length}setFrame(e,t){this.frames[e]=t}apply(e,t,s,i,a,h,l){let r;if(this.constraintIndex!=-1&&(r=e.physicsConstraints[this.constraintIndex],!r.active))return;const o=this.frames;if(t>s)this.apply(e,t,Number.MAX_VALUE,[],a,h,l),t=-1;else if(t>=o[o.length-1])return;if(!(s<o[0])&&(t<o[0]||s>=o[J.search1(o,t)+1]))if(r!=null)r.reset();else for(const n of e.physicsConstraints)n.active&&n.reset()}},Qt=Kt;V(Qt,"propertyIds",[_.physicsConstraintReset.toString()]);var ue=class extends J{slotIndex;attachment;constructor(e,t,s){super(e,[_.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,l){let r=e.slots[this.slotIndex];if(!r.bone.active)return;let o=r.attachment,n=this.attachment;if(o!=n&&(!(o instanceof ae)||o.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 w=u>>4,b=this.attachment.sequence.regions.length,v=$t[u&15];if(v!=0)switch(w+=(s-d)/g+1e-5|0,v){case 1:w=Math.min(b-1,w);break;case 2:w%=b;break;case 3:{let x=(b<<1)-2;w=x==0?0:w%x,w>=b&&(w=x-w);break}case 4:w=Math.max(b-1-w,0);break;case 5:w=b-1-w%b;break;case 6:{let x=(b<<1)-2;w=x==0?0:(w+b-1)%x,w>=b&&(w=x-w)}}r.sequenceIndex=w}},ve=ue;V(ve,"ENTRIES",3),V(ve,"MODE",1),V(ve,"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 ts(this);propertyIDs=new Ke;animationsChanged=!1;trackEntryPool=new Ye(()=>new es);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 l=a.next;if(l){let r=a.trackLast-l.delay;if(r>=0){for(l.delay=0,l.trackTime+=a.timeScale==0?0:(r/a.timeScale+e)*l.timeScale,a.trackTime+=h,this.setCurrent(s,l,!0);l.mixingFrom;)l.mixTime+=e,l=l.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,w=u.alpha;u.mixingFrom?w*=this.applyMixingFrom(u,e,g):u.trackTime>=u.trackEnd&&!u.next&&(w=0);let b=w>=u.alphaAttachmentThreshold,v=u.animationLast,x=u.getAnimationTime(),m=x,p=t;u.reverse&&(m=u.animation.duration-m,p=null);let y=u.animation.timelines,S=y.length;if(f==0&&w==1||g==3){f==0&&(b=!0);for(let A=0;A<S;A++){P.webkit602BugfixHelper(w,g);var a=y[A];a instanceof be?this.applyAttachmentTimeline(a,e,m,g,b):a.apply(e,v,m,p,w,g,0)}}else{let A=u.timelineMode,I=u.shortestRotation,T=!I&&u.timelinesRotation.length!=S<<1;T&&(u.timelinesRotation.length=S<<1);for(let M=0;M<S;M++){let R=y[M],X=A[M]==De?g:0;!I&&R instanceof Me?this.applyRotateTimeline(R,e,m,w,X,u.timelinesRotation,M<<1,T):R instanceof be?this.applyAttachmentTimeline(R,e,m,g,b):(P.webkit602BugfixHelper(w,g),R.apply(e,v,m,p,w,X,0))}}this.queueEvents(u,x),t.length=0,u.nextAnimationLast=x,u.nextTrackLast=u.trackTime}for(var h=this.unkeyedState+St,l=e.slots,r=0,o=e.slots.length;r<o;r++){var n=l[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,l=a<i.mixDrawOrderThreshold,r=i.animation.timelines,o=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 w=0;w<o;w++)r[w].apply(t,f,u,g,c,s,1);else{let w=i.timelineMode,b=i.timelineHoldMix,v=i.shortestRotation,x=!v&&i.timelinesRotation.length!=o<<1;x&&(i.timelinesRotation.length=o<<1),i.totalAlpha=0;for(let m=0;m<o;m++){let p=r[m],y=1,S,A=0;switch(w[m]){case De:if(!l&&p instanceof pe)continue;S=s,A=c;break;case yt:S=0,A=c;break;case vt:S=s,A=n;break;case Oe:S=0,A=n;break;default:S=0;let I=b[m];A=n*Math.max(0,1-I.mixTime/I.mixDuration);break}i.totalAlpha+=A,!v&&p instanceof Me?this.applyRotateTimeline(p,t,u,A,S,i.timelinesRotation,m<<1,x):p instanceof be?this.applyAttachmentTimeline(p,t,u,S,h&&A>=i.alphaAttachmentThreshold):(P.webkit602BugfixHelper(A,s),l&&p instanceof pe&&S==0&&(y=0),p.apply(t,f,u,g,A,S,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+rs)}applyRotateTimeline(e,t,s,i,a,h,l,r){if(r&&(h[l]=0),i==1){e.apply(t,0,s,null,1,a,0);return}let o=t.bones[e.boneIndex];if(!o.active)return;let n=e.frames,c=0,f=0;if(s<n[0])switch(a){case 0:o.rotation=o.data.rotation;default:return;case 1:c=o.rotation,f=o.data.rotation}else c=a==0?o.data.rotation:o.rotation,f=o.data.rotation+e.getCurveValue(s);let d=0,u=f-c;if(u-=Math.ceil(u/360-.5)*360,u==0)d=h[l];else{let g=0,w=0;r?(g=0,w=u):(g=h[l],w=h[l+1]);let b=g-g%360;d=u+b;let v=u>=0,x=g>=0;Math.abs(w)<=90&&F.signum(w)!=F.signum(u)&&(Math.abs(g-b)>180?(d+=360*F.signum(g),x=v):b!=0?d-=360*F.signum(g):x=v),x!=v&&(d+=360*F.signum(g)),h[l]=d}h[l+1]=u,o.rotation=c+d*i}queueEvents(e,t){let s=e.animationStart,i=e.animationEnd,a=i-s,h=e.trackLast%a,l=this.events,r=0,o=l.length;for(;r<o;r++){let c=l[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<o;r++){let c=l[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 l=this.propertyIDs;if(t&&t.holdPrevious){for(let r=0;r<i;r++)a[r]=l.addAll(s[r].getPropertyIds())?Oe:vt;return}e:for(let r=0;r<i;r++){let o=s[r],n=o.getPropertyIds();if(!l.addAll(n))a[r]=De;else if(!t||o instanceof be||o instanceof pe||o instanceof Xe||!t.animation.hasTimeline(n))a[r]=yt;else{for(let c=t.mixingTo;c;c=c.mixingTo)if(!c.animation.hasTimeline(n)){if(e.mixDuration>0){a[r]=ss,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()}},Zt=Le;V(Zt,"_emptyAnimation",new Be("<empty>",[],0));var es=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}},ts=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 l=0;l<t.length;l++){let r=t[l];r.start&&r.start(a)}break;case Z.interrupt:a.listener&&a.listener.interrupt&&a.listener.interrupt(a);for(let l=0;l<t.length;l++){let r=t[l];r.interrupt&&r.interrupt(a)}break;case Z.end:a.listener&&a.listener.end&&a.listener.end(a);for(let l=0;l<t.length;l++){let r=t[l];r.end&&r.end(a)}case Z.dispose:a.listener&&a.listener.dispose&&a.listener.dispose(a);for(let l=0;l<t.length;l++){let r=t[l];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 l=0;l<t.length;l++){let r=t[l];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 l=0;l<t.length;l++){let r=t[l];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||{}),qs=class{start(e){}interrupt(e){}end(e){}dispose(e){}complete(e){}event(e,t){}},De=0,yt=1,vt=2,Oe=3,ss=4,St=1,rs=2,Us=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 D(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}},At=class extends ae{endSlot=null;color=new D(.2275,.2275,.8078,1);constructor(e){super(e)}copy(){let e=new At(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e}},is=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||{}),as=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(as||{}),ns=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},Ws=class extends is{setFilters(e,t){}setWraps(e,t){}dispose(){}},ls=class{pages=new Array;regions=new Array;constructor(e){let t=new zs(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 l=null,r=null,o=null;for(;h!==null;)if(h.trim().length==0)l=null,h=t.readLine();else if(l){let n=new Ct(l,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=[]),o||(o=[]),r.push(s[0]);let d=[];for(let u=0;u<c;u++)d.push(parseInt(s[u+1]));o.push(d)}}n.originalWidth==0&&n.originalHeight==0&&(n.originalWidth=n.width,n.originalHeight=n.height),r&&r.length>0&&o&&o.length>0&&(n.names=r,n.values=o,r=null,o=null),n.u=n.x/l.width,n.v=n.y/l.height,n.degrees==90?(n.u2=(n.x+n.height)/l.width,n.v2=(n.y+n.width)/l.height):(n.u2=(n.x+n.width)/l.width,n.v2=(n.y+n.height)/l.height),this.regions.push(n)}else{for(l=new os(h.trim());t.readEntry(s,h=t.readLine())!=0;){let n=i[s[0]];n&&n(l)}this.pages.push(l)}}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()}},zs=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}}},os=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 ns{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)}},Se=class extends ae{region=null;path;regionUVs=[];uvs=[];triangles=[];color=new D(1,1,1,1);width=0;height=0;hullLength=0;edges=[];parentMesh=null;sequence=null;tempColor=new D(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,l=0;if(this.region instanceof Ct){let r=this.region,o=r.page,n=o.width,c=o.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,l=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])*l;return;case 180:i-=(r.originalWidth-r.offsetX-r.width)/n,a-=r.offsetY/c,h=r.originalWidth/n,l=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])*l;return;case 270:i-=r.offsetY/n,a-=r.offsetX/c,h=r.originalHeight/n,l=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]*l;return}i-=r.offsetX/n,a-=(r.originalHeight-r.offsetY-r.height)/c,h=r.originalWidth/n,l=r.originalHeight/c}else this.region?(h=this.region.u2-i,l=this.region.v2-a):(i=a=0,h=l=1);for(let r=0;r<s;r+=2)t[r]=i+e[r]*h,t[r+1]=a+e[r+1]*l}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 Se(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 Se(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 ae{lengths=[];closed=!1;constantSpeed=!1;color=new D(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),P.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 ae{x=0;y=0;rotation=0;color=new D(.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 It(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e}},hs=class extends Qe{x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;color=new D(1,1,1,1);path;region=null;sequence=null;offset=P.newFloatArray(8);uvs=P.newFloatArray(8);tempColor=new D(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,l=a+this.region.width*s,r=h+this.region.height*i,o=this.rotation*F.degRad,n=Math.cos(o),c=Math.sin(o),f=this.x,d=this.y,u=a*n+f,g=a*c,w=h*n+d,b=h*c,v=l*n+f,x=l*c,m=r*n+d,p=r*c,y=this.offset;y[0]=u-b,y[1]=w+g,y[2]=u-p,y[3]=m+g,y[4]=v-p,y[5]=m+x,y[6]=v-b,y[7]=w+x,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,l=a.worldX,r=a.worldY,o=a.a,n=a.b,c=a.c,f=a.d,d=0,u=0;d=h[0],u=h[1],t[s]=d*o+u*n+l,t[s+1]=d*c+u*f+r,s+=i,d=h[2],u=h[3],t[s]=d*o+u*n+l,t[s+1]=d*c+u*f+r,s+=i,d=h[4],u=h[5],t[s]=d*o+u*n+l,t[s+1]=d*c+u*f+r,s+=i,d=h[6],u=h[7],t[s]=d*o+u*n+l,t[s+1]=d*c+u*f+r}copy(){let e=new hs(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}},$=hs;V($,"X1",0),V($,"Y1",1),V($,"C1R",2),V($,"C1G",3),V($,"C1B",4),V($,"C1A",5),V($,"U1",6),V($,"V1",7),V($,"X2",8),V($,"Y2",9),V($,"C2R",10),V($,"C2G",11),V($,"C2B",12),V($,"C2A",13),V($,"U2",14),V($,"V2",15),V($,"X3",16),V($,"Y3",17),V($,"C3R",18),V($,"C3G",19),V($,"C3B",20),V($,"C3A",21),V($,"U3",22),V($,"V3",23),V($,"X4",24),V($,"Y4",25),V($,"C4R",26),V($,"C4G",27),V($,"C4B",28),V($,"C4A",29),V($,"U4",30),V($,"V4",31);var $s=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 l=s.getPath(t,a),r=this.atlas.findRegion(l);if(r==null)throw new Error("Region not found in atlas: "+l+" (sequence: "+e+")");i[a]=r}}newRegionAttachment(e,t,s,i){let a=new $(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 Se(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 Ae(t)}newPointAttachment(e,t){return new It(t)}newClippingAttachment(e,t){return new At(t)}},kt=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 D;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||{}),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,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,l){this.ax=e,this.ay=t,this.arotation=s,this.ascaleX=i,this.ascaleY=a,this.ashearX=h,this.ashearY=l;let r=this.parent;if(!r){let d=this.skeleton;const u=d.scaleX,g=d.scaleY,w=(s+h)*F.degRad,b=(s+90+l)*F.degRad;this.a=Math.cos(w)*i*u,this.b=Math.cos(b)*a*u,this.c=Math.sin(w)*i*g,this.d=Math.sin(b)*a*g,this.worldX=e*u+d.x,this.worldY=t*g+d.y;return}let o=r.a,n=r.b,c=r.c,f=r.d;switch(this.worldX=o*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+l)*F.degRad,g=Math.cos(d)*i,w=Math.cos(u)*a,b=Math.sin(d)*i,v=Math.sin(u)*a;this.a=o*g+n*b,this.b=o*w+n*v,this.c=c*g+f*b,this.d=c*w+f*v;return}case 1:{const d=(s+h)*F.degRad,u=(s+90+l)*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=o*o+c*c,u=0;d>1e-4?(d=Math.abs(o*f-n*c)/d,o/=this.skeleton.scaleX,c/=this.skeleton.scaleY,n=c*d,f=o*d,u=Math.atan2(c,o)*F.radDeg):(o=0,c=0,u=90-Math.atan2(f,n)*F.radDeg);const g=(s+h-u)*F.degRad,w=(s+l-u+90)*F.degRad,b=Math.cos(g)*i,v=Math.cos(w)*a,x=Math.sin(g)*i,m=Math.sin(w)*a;this.a=o*b-n*x,this.b=o*v-n*m,this.c=c*b+f*x,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=(o*d+n*u)/this.skeleton.scaleX,w=(c*d+f*u)/this.skeleton.scaleY,b=Math.sqrt(g*g+w*w);b>1e-5&&(b=1/b),g*=b,w*=b,b=Math.sqrt(g*g+w*w),this.data.transformMode==3&&o*f-n*c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(b=-b),s=Math.PI/2+Math.atan2(w,g);const v=Math.cos(s)*b,x=Math.sin(s)*b;h*=F.degRad,l=(90+l)*F.degRad;const m=Math.cos(h)*i,p=Math.cos(l)*a,y=Math.sin(h)*i,S=Math.sin(l)*a;this.a=g*m+v*y,this.b=g*p+v*S,this.c=w*m+x*y,this.d=w*p+x*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}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),l=a*h,r=s*h,o=i*h,n=t*h,c=this.worldX-e.worldX,f=this.worldY-e.worldY;this.ax=c*l-f*r,this.ay=f*n-c*o;let d,u,g,w;if(this.data.transformMode==1)d=this.a,u=this.b,g=this.c,w=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),l=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 x=Math.sqrt(t*t+i*i);x>1e-5&&(x=1/x),t*=x,i*=x,x=Math.sqrt(t*t+i*i),this.data.transformMode==3&&h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x);let m=F.PI/2+Math.atan2(i,t);s=Math.cos(m)*x,a=Math.sin(m)*x,h=1/(t*a-s*i),l=a*h,r=s*h,o=i*h,n=t*h}d=l*this.a-r*this.c,u=l*this.b-r*this.d,g=n*this.c-o*this.a,w=n*this.d-o*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+g*g),this.ascaleX>1e-4){let b=d*w-u*g;this.ascaleY=b/this.ascaleX,this.ashearY=-Math.atan2(d*u+g*w,b)*F.radDeg,this.arotation=Math.atan2(g,d)*F.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(u*u+w*w),this.ashearY=0,this.arotation=90-Math.atan2(w,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}},Hs=class{pathPrefix="";textureLoader;downloader;assets={};errors={};toLoad=0;loaded=0;constructor(e,t="",s=new cs){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,l=>{try{let r=new ls(l),o=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),--o==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}`)}},(l,r)=>{this.error(s,e,`Couldn't load texture atlas ${e}: status ${l}, ${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}},cs=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,l=i.length;h<l;h+=2)i[h].apply(null,a)}},Yt=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}},Mt=class{name;intValue=0;floatValue=0;stringValue=null;audioPath=null;volume=0;balance=0;constructor(e){this.name=e}},ds=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,l){let r=e.parent;if(!r)throw new Error("IK bone must have parent.");let o=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(o*f-n*c)/Math.max(1e-4,o*o+c*c),x=o/e.skeleton.scaleX,m=c/e.skeleton.scaleY;n=-m*v*e.skeleton.scaleX,f=x*v*e.skeleton.scaleY,d+=Math.atan2(m,x)*F.radDeg;default:let p=t-r.worldX,y=s-r.worldY,S=o*f-n*c;Math.abs(S)<=1e-4?(u=0,g=0):(u=(p*f-y*n)/S-e.ax,g=(y*o-p*c)/S-e.ay)}d+=Math.atan2(g,u)*F.radDeg,e.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360);let w=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*w;if(v>1e-4){const x=u*u+g*g;if(i&&x<v*v||a&&x>v*v){const m=(Math.sqrt(x)/v-1)*l+1;w*=m,h&&(b*=m)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*l,w,b,e.ashearX,e.ashearY)}apply2(e,t,s,i,a,h,l,r,o){let n=e.ax,c=e.ay,f=e.ascaleX,d=e.ascaleY,u=f,g=d,w=t.ascaleX,b=0,v=0,x=0;f<0?(f=-f,b=180,x=-1):(b=0,x=1),d<0&&(d=-d,x=-x),w<0?(w=-w,v=180):v=0;let m=t.ax,p=0,y=0,S=0,A=e.a,I=e.b,T=e.c,M=e.d,R=Math.abs(f-d)<=1e-4;!R||h?(p=0,y=A*m+e.worldX,S=T*m+e.worldY):(p=t.ay,y=A*m+I*p+e.worldX,S=T*m+M*p+e.worldY);let X=e.parent;if(!X)throw new Error("IK parent must itself have a parent.");A=X.a,I=X.b,T=X.c,M=X.d;let E=A*M-I*T,k=y-X.worldX,Y=S-X.worldY;E=Math.abs(E)<=1e-4?0:1/E;let B=(k*M-Y*I)*E-n,q=(Y*A-k*T)*E-c,L=Math.sqrt(B*B+q*q),z=t.data.length*w,N,G;if(L<1e-4){this.apply1(e,s,i,!1,h,!1,o),t.updateWorldTransformWith(m,p,0,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY);return}k=s-X.worldX,Y=i-X.worldY;let U=(k*M-Y*I)*E-n,O=(Y*A-k*T)*E-c,j=U*U+O*O;if(r!=0){r*=f*(w+1)*.5;let K=Math.sqrt(j),se=K-L-z*f+r;if(se>0){let re=Math.min(1,se/(r*2))-1;re=(se-r*(1-re*re))/K,U-=re*U,O-=re*O,j=U*U+O*O}}e:if(R){z*=f;let K=(j-L*L-z*z)/(2*L*z);K<-1?(K=-1,G=Math.PI*a):K>1?(K=1,G=0,h&&(A=(Math.sqrt(j)/(L+z)-1)*o+1,u*=A,l&&(g*=A))):G=Math.acos(K)*a,A=L+z*K,I=z*Math.sin(G),N=Math.atan2(O*A-U*I,U*A+O*I)}else{A=f*z,I=d*z;let K=A*A,se=I*I,re=Math.atan2(O,U);T=se*L*L+K*j-K*se;let xe=-2*se*L,Ie=se-K;if(M=xe*xe-4*Ie*T,M>=0){let ke=Math.sqrt(M);xe<0&&(ke=-ke),ke=-(xe+ke)*.5;let vs=ke/Ie,Ss=T/ke,Te=Math.abs(vs)<Math.abs(Ss)?vs:Ss;if(Te*Te<=j){Y=Math.sqrt(j-Te*Te)*a,N=re-Math.atan2(Y,Te),G=Math.atan2(Y/d,(Te-L)/f);break e}}let Fe=F.PI,je=L-A,Ot=je*je,bs=0,ps=0,Je=L+A,Nt=Je*Je,ys=0;T=-A*L/(K-se),T>=-1&&T<=1&&(T=Math.acos(T),k=A*Math.cos(T)+L,Y=I*Math.sin(T),M=k*k+Y*Y,M<Ot&&(Fe=T,Ot=M,je=k,bs=Y),M>Nt&&(ps=T,Nt=M,Je=k,ys=Y)),j<=(Ot+Nt)*.5?(N=re-Math.atan2(bs*a,je),G=Fe*a):(N=re-Math.atan2(ys*a,Je),G=ps*a)}let Q=Math.atan2(p,m)*x,he=e.arotation;N=(N-Q)*F.radDeg+b-he,N>180?N-=360:N<-180&&(N+=360),e.updateWorldTransformWith(n,c,he+N*o,u,g,0,0),he=t.arotation,G=((G+Q)*F.radDeg-t.ashearX)*x+v-he,G>180?G-=360:G<-180&&(G+=360),t.updateWorldTransformWith(m,p,he+G*o,t.ascaleX,t.ascaleY,t.ashearX,t.ashearY)}},Xt=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)}},Ft=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 Ae))return;let s=this.mixRotate,i=this.mixX,a=this.mixY;if(s==0&&i==0&&a==0)return;let h=this.data,l=h.rotateMode==0,r=h.rotateMode==2,o=this.bones,n=o.length,c=l?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,S=c-1;y<S;y++){let A=o[y],I=A.data.length,T=I*A.a,M=I*A.c;d[y]=Math.sqrt(T*T+M*M)}P.arrayFill(f,1,c,u);break;case 3:let m=0;for(let y=0,S=c-1;y<S;){let A=o[y],I=A.data.length;if(I<me.epsilon)r&&(d[y]=0),f[++y]=u;else{let T=I*A.a,M=I*A.c,R=Math.sqrt(T*T+M*M);r&&(d[y]=R),f[++y]=R,m+=R}}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,S=c-1;y<S;){let A=o[y],I=A.data.length;if(I<me.epsilon)r&&(d[y]=0),f[++y]=u;else{let T=I*A.a,M=I*A.c,R=Math.sqrt(T*T+M*M);r&&(d[y]=R),f[++y]=(p?I+u:u)*R/I}}}let g=this.computeWorldPositions(t,c,l),w=g[0],b=g[1],v=h.offsetRotation,x=!1;if(v==0)x=h.rotateMode==1;else{x=!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=o[m];y.worldX+=(w-y.worldX)*i,y.worldY+=(b-y.worldY)*a;let S=g[p],A=g[p+1],I=S-w,T=A-b;if(r){let M=d[m];if(M!=0){let R=(Math.sqrt(I*I+T*T)/M-1)*s+1;y.a*=R,y.c*=R}}if(w=S,b=A,s>0){let M=y.a,R=y.b,X=y.c,E=y.d,k=0,Y=0,B=0;if(l?k=g[p-1]:f[m+1]==0?k=g[p+2]:k=Math.atan2(T,I),k-=Math.atan2(X,M),x){Y=Math.cos(k),B=Math.sin(k);let q=y.data.length;w+=(q*(Y*M-B*X)-I)*s,b+=(q*(B*M+Y*X)-T)*s}else k+=v;k>F.PI?k-=F.PI2:k<-F.PI&&(k+=F.PI2),k*=s,Y=Math.cos(k),B=Math.sin(k),y.a=Y*M-B*X,y.b=Y*R-B*E,y.c=B*M+Y*X,y.d=B*R+Y*E}y.updateAppliedTransform()}}computeWorldPositions(e,t,s){let i=this.target,a=this.position,h=this.spaces,l=P.setArraySize(this.positions,t*3+2),r=this.world,o=e.closed,n=e.worldVerticesLength,c=n/6,f=me.NONE;if(!e.constantSpeed){let q=e.lengths;c-=o?1:2;let L=q[c];this.data.positionMode==1&&(a*=L);let z;switch(this.data.spacingMode){case 2:z=L;break;case 3:z=L/t;break;default:z=1}r=P.setArraySize(this.world,8);for(let N=0,G=0,U=0;N<t;N++,G+=3){let O=h[N]*z;a+=O;let j=a;if(o)j%=L,j<0&&(j+=L),U=0;else if(j<0){f!=me.BEFORE&&(f=me.BEFORE,e.computeWorldVertices(i,2,4,r,0,2)),this.addBeforePosition(j,r,0,l,G);continue}else if(j>L){f!=me.AFTER&&(f=me.AFTER,e.computeWorldVertices(i,n-6,4,r,0,2)),this.addAfterPosition(j-L,r,0,l,G);continue}for(;;U++){let Q=q[U];if(!(j>Q)){if(U==0)j/=Q;else{let he=q[U-1];j=(j-he)/(Q-he)}break}}U!=f&&(f=U,o&&U==c?(e.computeWorldVertices(i,n-4,4,r,0,2),e.computeWorldVertices(i,0,4,r,4,2)):e.computeWorldVertices(i,U*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],l,G,s||N>0&&O==0)}return l}o?(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],w=r[1],b=0,v=0,x=0,m=0,p=0,y=0,S=0,A=0,I=0,T=0,M=0,R=0,X=0,E=0;for(let q=0,L=2;q<c;q++,L+=6)b=r[L],v=r[L+1],x=r[L+2],m=r[L+3],p=r[L+4],y=r[L+5],S=(g-b*2+x)*.1875,A=(w-v*2+m)*.1875,I=((b-x)*3-g+p)*.09375,T=((v-m)*3-w+y)*.09375,M=S*2+I,R=A*2+T,X=(b-g)*.75+S+I*.16666667,E=(v-w)*.75+A+T*.16666667,u+=Math.sqrt(X*X+E*E),X+=M,E+=R,M+=I,R+=T,u+=Math.sqrt(X*X+E*E),X+=M,E+=R,u+=Math.sqrt(X*X+E*E),X+=M+I,E+=R+T,u+=Math.sqrt(X*X+E*E),d[q]=u,g=p,w=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 Y=this.segments,B=0;for(let q=0,L=0,z=0,N=0;q<t;q++,L+=3){let G=h[q]*k;a+=G;let U=a;if(o)U%=u,U<0&&(U+=u),z=0;else if(U<0){this.addBeforePosition(U,r,0,l,L);continue}else if(U>u){this.addAfterPosition(U-u,r,n-4,l,L);continue}for(;;z++){let O=d[z];if(!(U>O)){if(z==0)U/=O;else{let j=d[z-1];U=(U-j)/(O-j)}break}}if(z!=f){f=z;let O=z*6;for(g=r[O],w=r[O+1],b=r[O+2],v=r[O+3],x=r[O+4],m=r[O+5],p=r[O+6],y=r[O+7],S=(g-b*2+x)*.03,A=(w-v*2+m)*.03,I=((b-x)*3-g+p)*.006,T=((v-m)*3-w+y)*.006,M=S*2+I,R=A*2+T,X=(b-g)*.3+S+I*.16666667,E=(v-w)*.3+A+T*.16666667,B=Math.sqrt(X*X+E*E),Y[0]=B,O=1;O<8;O++)X+=M,E+=R,M+=I,R+=T,B+=Math.sqrt(X*X+E*E),Y[O]=B;X+=M,E+=R,B+=Math.sqrt(X*X+E*E),Y[8]=B,X+=M+I,E+=R+T,B+=Math.sqrt(X*X+E*E),Y[9]=B,N=0}for(U*=B;;N++){let O=Y[N];if(!(U>O)){if(N==0)U/=O;else{let j=Y[N-1];U=N+(U-j)/(O-j)}break}}this.addCurvePosition(U*.1,g,w,b,v,x,m,p,y,l,L,s||q>0&&G==0)}return l}addBeforePosition(e,t,s,i,a){let h=t[s],l=t[s+1],r=t[s+2]-h,o=t[s+3]-l,n=Math.atan2(o,r);i[a]=h+e*Math.cos(n),i[a+1]=l+e*Math.sin(n),i[a+2]=n}addAfterPosition(e,t,s,i,a){let h=t[s+2],l=t[s+3],r=h-t[s],o=l-t[s+1],n=Math.atan2(o,r);i[a]=h+e*Math.cos(n),i[a+1]=l+e*Math.sin(n),i[a+2]=n}addCurvePosition(e,t,s,i,a,h,l,r,o,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,w=g*g,b=w*g,v=g*e,x=v*3,m=g*x,p=x*e,y=t*b+i*m+h*p+r*u,S=s*b+a*m+l*p+o*u;n[c]=y,n[c+1]=S,f&&(e<.001?n[c+2]=Math.atan2(a-s,i-t):n[c+2]=Math.atan2(S-(s*w+a*v*2+l*d),y-(t*w+i*v*2+h*d)))}},Ce=me;V(Ce,"NONE",-1),V(Ce,"BEFORE",-2),V(Ce,"AFTER",-3),V(Ce,"epsilon",1e-5);var Gs=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,l=this.bone,r=l.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 o=l.worldX,n=l.worldY;if(this._reset)this._reset=!1,this.ux=o,this.uy=n;else{let c=this.remaining,f=this.inertia,d=this.data.step;if(s||i){if(s&&(this.xOffset+=(this.ux-o)*f,this.ux=o),i&&(this.yOffset+=(this.uy-n)*f,this.uy=n),c>=d){const u=this.massInverse*d,g=this.strength,w=this.wind*100,b=this.gravity*-100,v=Math.pow(this.damping,60*d);do s&&(this.xVelocity+=(w-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&&(l.worldX+=this.xOffset*t*this.data.x),i&&(l.worldY+=this.yOffset*t*this.data.y)}if(a||h){let u=Math.atan2(l.c,l.a),g=0,w=0,b=0;if(a){b=t*this.data.rotate;let v=this.cx-l.worldX,x=this.cy-l.worldY,m=Math.atan2(x+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),w=Math.sin(m),h&&(m=r*l.getWorldScaleX(),m>0&&(this.scaleOffset+=(v*g+x*w)*f/m))}else{g=Math.cos(u),w=Math.sin(u);const v=r*l.getWorldScaleX();v>0&&(this.scaleOffset+=((this.cx-l.worldX)*g+(this.cy-l.worldY)*w)*f/v)}if(c=this.remaining,c>=d){const v=this.massInverse*d,x=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*w-this.scaleOffset*x)*v,this.scaleOffset+=this.scaleVelocity*d,this.scaleVelocity*=y),a){if(this.rotateVelocity+=(-.01*r*(m*w+p*g)-this.rotateOffset*x)*v,this.rotateOffset+=this.rotateVelocity*d,this.rotateVelocity*=y,c<d)break;const S=this.rotateOffset*b+u;g=Math.cos(S),w=Math.sin(S)}else if(c<d)break}}this.remaining=c}this.cx=l.worldX,this.cy=l.worldY;break;case 3:s&&(l.worldX+=this.xOffset*t*this.data.x),i&&(l.worldY+=this.yOffset*t*this.data.y)}if(a){let o=this.rotateOffset*t,n=0,c=0,f=0;if(this.data.shearX>0){let d=0;this.data.rotate>0&&(d=o*this.data.rotate,n=Math.sin(d),c=Math.cos(d),f=l.b,l.b=c*f-n*l.d,l.d=n*f+c*l.d),d+=o*this.data.shearX,n=Math.sin(d),c=Math.cos(d),f=l.a,l.a=c*f-n*l.c,l.c=n*f+c*l.c}else o*=this.data.rotate,n=Math.sin(o),c=Math.cos(o),f=l.a,l.a=c*f-n*l.c,l.c=n*f+c*l.c,f=l.b,l.b=c*f-n*l.d,l.d=n*f+c*l.d}if(h){const o=1+this.scaleOffset*t*this.data.scaleX;l.a*=o,l.c*=o}e!=3&&(this.tx=r*l.a,this.ty=r*l.c),l.updateAppliedTransform()}},fs=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 D,this.darkColor=e.darkColor?new D: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}},us=class{data;bones;target;mixRotate=0;mixX=0;mixY=0;mixScaleX=0;mixScaleY=0;mixShearY=0;temp=new Re;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,l=t!=0||s!=0,r=this.target,o=r.a,n=r.b,c=r.c,f=r.d,d=o*f-n*c>0?F.degRad:-F.degRad,u=this.data.offsetRotation*d,g=this.data.offsetShearY*d,w=this.bones;for(let b=0,v=w.length;b<v;b++){let x=w[b];if(e!=0){let m=x.a,p=x.b,y=x.c,S=x.d,A=Math.atan2(c,o)-Math.atan2(y,m)+u;A>F.PI?A-=F.PI2:A<-F.PI&&(A+=F.PI2),A*=e;let I=Math.cos(A),T=Math.sin(A);x.a=I*m-T*y,x.b=I*p-T*S,x.c=T*m+I*y,x.d=T*p+I*S}if(l){let m=this.temp;r.localToWorld(m.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(m.x-x.worldX)*t,x.worldY+=(m.y-x.worldY)*s}if(i!=0){let m=Math.sqrt(x.a*x.a+x.c*x.c);m!=0&&(m=(m+(Math.sqrt(o*o+c*c)-m+this.data.offsetScaleX)*i)/m),x.a*=m,x.c*=m}if(a!=0){let m=Math.sqrt(x.b*x.b+x.d*x.d);m!=0&&(m=(m+(Math.sqrt(n*n+f*f)-m+this.data.offsetScaleY)*a)/m),x.b*=m,x.d*=m}if(h>0){let m=x.b,p=x.d,y=Math.atan2(p,m),S=Math.atan2(f,n)-Math.atan2(c,o)-(y-Math.atan2(x.c,x.a));S>F.PI?S-=F.PI2:S<-F.PI&&(S+=F.PI2),S=y+(S+g)*h;let A=Math.sqrt(m*m+p*p);x.b=Math.cos(S)*A,x.d=Math.sin(S)*A}x.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,l=t!=0||s!=0,r=this.target,o=r.a,n=r.b,c=r.c,f=r.d,d=o*f-n*c>0?F.degRad:-F.degRad,u=this.data.offsetRotation*d,g=this.data.offsetShearY*d,w=this.bones;for(let b=0,v=w.length;b<v;b++){let x=w[b];if(e!=0){let m=x.a,p=x.b,y=x.c,S=x.d,A=Math.atan2(c,o)+u;A>F.PI?A-=F.PI2:A<-F.PI&&(A+=F.PI2),A*=e;let I=Math.cos(A),T=Math.sin(A);x.a=I*m-T*y,x.b=I*p-T*S,x.c=T*m+I*y,x.d=T*p+I*S}if(l){let m=this.temp;r.localToWorld(m.set(this.data.offsetX,this.data.offsetY)),x.worldX+=m.x*t,x.worldY+=m.y*s}if(i!=0){let m=(Math.sqrt(o*o+c*c)-1+this.data.offsetScaleX)*i+1;x.a*=m,x.c*=m}if(a!=0){let m=(Math.sqrt(n*n+f*f)-1+this.data.offsetScaleY)*a+1;x.b*=m,x.d*=m}if(h>0){let m=Math.atan2(f,n)-Math.atan2(c,o);m>F.PI?m-=F.PI2:m<-F.PI&&(m+=F.PI2);let p=x.b,y=x.d;m=Math.atan2(y,p)+(m-F.PI/2+g)*h;let S=Math.sqrt(p*p+y*y);x.b=Math.cos(m)*S,x.d=Math.sin(m)*S}x.updateAppliedTransform()}}applyAbsoluteLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,l=this.target,r=this.bones;for(let o=0,n=r.length;o<n;o++){let c=r[o],f=c.arotation;if(e!=0){let v=l.arotation-f+this.data.offsetRotation;v-=Math.ceil(v/360-.5)*360,f+=v*e}let d=c.ax,u=c.ay;d+=(l.ax-d+this.data.offsetX)*t,u+=(l.ay-u+this.data.offsetY)*s;let g=c.ascaleX,w=c.ascaleY;i!=0&&g!=0&&(g=(g+(l.ascaleX-g+this.data.offsetScaleX)*i)/g),a!=0&&w!=0&&(w=(w+(l.ascaleY-w+this.data.offsetScaleY)*a)/w);let b=c.ashearY;if(h!=0){let v=l.ashearY-b+this.data.offsetShearY;v-=Math.ceil(v/360-.5)*360,b+=v*h}c.updateWorldTransformWith(d,u,f,g,w,c.ashearX,b)}}applyRelativeLocal(){let e=this.mixRotate,t=this.mixX,s=this.mixY,i=this.mixScaleX,a=this.mixScaleY,h=this.mixShearY,l=this.target,r=this.bones;for(let o=0,n=r.length;o<n;o++){let c=r[o],f=c.arotation+(l.arotation+this.data.offsetRotation)*e,d=c.ax+(l.ax+this.data.offsetX)*t,u=c.ay+(l.ay+this.data.offsetY)*s,g=c.ascaleX*((l.ascaleX-1+this.data.offsetScaleX)*i+1),w=c.ascaleY*((l.ascaleY-1+this.data.offsetScaleY)*a+1),b=c.ashearY+(l.ashearY+this.data.offsetShearY)*h;c.updateWorldTransformWith(d,u,f,g,w,c.ashearX,b)}}},ms=class{data;bones;slots;drawOrder;ikConstraints;transformConstraints;pathConstraints;physicsConstraints;_updateCache=new Array;skin=null;color;scaleX=1;_scaleY=1;get scaleY(){return ms.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 Tt(s,this,null);else{let a=this.bones[s.parent.index];i=new Tt(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 fs(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 ds(s,this))}this.transformConstraints=new Array;for(let t=0;t<e.transformConstraints.length;t++){let s=e.transformConstraints[t];this.transformConstraints.push(new us(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 Gs(s,this))}this.color=new D(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,l=s.length,r=i.length,o=a.length,n=this.physicsConstraints.length,c=l+r+o+n;e:for(let f=0;f<c;f++){for(let d=0;d<l;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<o;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,o=this.data.skins.length;r<o;r++)this.sortPathConstraintAttachment(this.data.skins[r],s,i);let a=t.getAttachment();a instanceof Ae&&this.sortPathConstraintAttachmentWith(a,i);let h=e.bones,l=h.length;for(let r=0;r<l;r++)this.sortBone(h[r]);this._updateCache.push(e);for(let r=0;r<l;r++)this.sortReset(h[r].children);for(let r=0;r<l;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 Ae))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 l=s[a++];for(l+=a;a<l;)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,l=t.d;s.worldX=i*this.x+a*this.y+t.worldX,s.worldY=h*this.x+l*this.y+t.worldY;const r=(s.rotation+s.shearX)*F.degRad,o=(s.rotation+90+s.shearY)*F.degRad,n=Math.cos(r)*s.scaleX,c=Math.cos(o)*s.scaleY,f=Math.sin(r)*s.scaleX,d=Math.sin(o)*s.scaleY;s.a=(i*n+a*f)*this.scaleX,s.b=(i*c+a*d)*this.scaleX,s.c=(h*n+l*f)*this.scaleY,s.d=(h*c+l*d)*this.scaleY;let u=this._updateCache;for(let g=0,w=u.length;g<w;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 l=e.getAttachment(s,h);l&&a.setAttachment(l)}}}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 l=null;if(t&&(l=this.getAttachment(i,t),!l))throw new Error("Attachment not found: "+t+", for slot: "+e);h.setAttachment(l);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 Re,t=new Re;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,l=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let o=0,n=i.length;o<n;o++){let c=i[o];if(!c.bone.active)continue;let f=0,d=null,u=c.getAttachment();if(u instanceof $)f=8,d=P.setArraySize(s,f,0),u.computeWorldVertices(c,d,0,2);else if(u instanceof Se){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,w=d.length;g<w;g+=2){let b=d[g],v=d[g+1];a=Math.min(a,b),h=Math.min(h,v),l=Math.max(l,b),r=Math.max(r,v)}}e.set(a,h),t.set(l-a,r-h)}update(e){this.time+=e}},gs=ms;V(gs,"yDown",!1);var xs=(e=>(e[e.none=0]="none",e[e.reset=1]="reset",e[e.update=2]="update",e[e.pose=3]="pose",e))(xs||{}),Et=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}},Rt=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 D(.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 l=0;l<this.bones.length;l++)if(this.bones[l]==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 l=0;l<this.constraints.length;l++)if(this.constraints[l]==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 l=0;l<this.bones.length;l++)if(this.bones[l]==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 l=0;l<this.constraints.length;l++)if(this.constraints[l]==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 Se?(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 Rt(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 Rt(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 l=t.attachments[s];for(let r in l){let o=l[r];if(h==o){let n=this.getAttachment(s,r);n&&a.setAttachment(n);break}}}s++}}},Pt=class{index=0;name;boneData;color=new D(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||{}),Bt=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)}},js=class{scale=1;attachmentLoader;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new Et;s.name="";let i=new ws(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 l=i.readBoolean();l&&(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 kt(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(),l&&D.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 Pt(n,c,f);D.rgba8888ToColor(d.color,i.readInt32());let u=i.readInt32();u!=-1&&D.rgb888ToColor(d.darkColor=new D,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 Xt(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 Bt(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 Ft(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 o=this.readSkin(i,s,!0,l);o&&(s.defaultSkin=o,s.skins.push(o));{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,l);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 Mt(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 l=e.readStringRef();if(!l)throw new Error("Skin name must not be null.");a=new He(l),a.bones.length=e.readInt(!0);for(let r=0,o=a.bones.length;r<o;r++)a.bones[r]=t.bones[e.readInt(!0)];for(let r=0,o=e.readInt(!0);r<o;r++)a.constraints.push(t.ikConstraints[e.readInt(!0)]);for(let r=0,o=e.readInt(!0);r<o;r++)a.constraints.push(t.transformConstraints[e.readInt(!0)]);for(let r=0,o=e.readInt(!0);r<o;r++)a.constraints.push(t.pathConstraints[e.readInt(!0)]);h=e.readInt(!0)}for(let l=0;l<h;l++){let r=e.readInt(!0);for(let o=0,n=e.readInt(!0);o<n;o++){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 l=this.scale,r=e.readStringRef();switch(r||(r=a),e.readByte()){case ge.Region:{let o=e.readStringRef(),n=e.readFloat(),c=e.readFloat(),f=e.readFloat(),d=e.readFloat(),u=e.readFloat(),g=e.readFloat(),w=e.readFloat(),b=e.readInt32(),v=this.readSequence(e);o||(o=r);let x=this.attachmentLoader.newRegionAttachment(s,r,o,v);return x?(x.path=o,x.x=c*l,x.y=f*l,x.scaleX=d,x.scaleY=u,x.rotation=n,x.width=g*l,x.height=w*l,D.rgba8888ToColor(x.color,b),x.sequence=v,v==null&&x.updateRegion(),x):null}case ge.BoundingBox:{let o=e.readInt(!0),n=this.readVertices(e,o),c=h?e.readInt32():0,f=this.attachmentLoader.newBoundingBoxAttachment(s,r);return f?(f.worldVerticesLength=o<<1,f.vertices=n.vertices,f.bones=n.bones,h&&D.rgba8888ToColor(f.color,c),f):null}case ge.Mesh:{let o=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),w=this.readSequence(e),b=[],v=0,x=0;h&&(b=this.readShortArray(e),v=e.readFloat(),x=e.readFloat()),o||(o=r);let m=this.attachmentLoader.newMeshAttachment(s,r,o,w);return m?(m.path=o,D.rgba8888ToColor(m.color,n),m.bones=u.bones,m.vertices=u.vertices,m.worldVerticesLength=c<<1,m.triangles=d,m.regionUVs=f,w==null&&m.updateRegion(),m.hullLength=g<<1,m.sequence=w,h&&(m.edges=b,m.width=v*l,m.height=x*l),m):null}case ge.LinkedMesh:{let o=e.readStringRef(),n=e.readInt32(),c=e.readStringRef(),f=e.readStringRef(),d=e.readBoolean(),u=this.readSequence(e),g=0,w=0;h&&(g=e.readFloat(),w=e.readFloat()),o||(o=r);let b=this.attachmentLoader.newMeshAttachment(s,r,o,u);return b?(b.path=o,D.rgba8888ToColor(b.color,n),b.sequence=u,h&&(b.width=g*l,b.height=w*l),this.linkedMeshes.push(new Js(b,c,i,f,d)),b):null}case ge.Path:{let o=e.readBoolean(),n=e.readBoolean(),c=e.readInt(!0),f=this.readVertices(e,c),d=P.newArray(c/3,0);for(let w=0,b=d.length;w<b;w++)d[w]=e.readFloat()*l;let u=h?e.readInt32():0,g=this.attachmentLoader.newPathAttachment(s,r);return g?(g.closed=o,g.constantSpeed=n,g.worldVerticesLength=c<<1,g.vertices=f.vertices,g.bones=f.bones,g.lengths=d,h&&D.rgba8888ToColor(g.color,u),g):null}case ge.Point:{let o=e.readFloat(),n=e.readFloat(),c=e.readFloat(),f=h?e.readInt32():0,d=this.attachmentLoader.newPointAttachment(s,r);return d?(d.x=n*l,d.y=c*l,d.rotation=o,h&&D.rgba8888ToColor(d.color,f),d):null}case ge.Clipping:{let o=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[o],d.worldVerticesLength=n<<1,d.vertices=c.vertices,d.bones=c.bones,h&&D.rgba8888ToColor(d.color,f),d):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 s=this.scale,i=t<<1,a=new Ks;if(!e.readBoolean())return a.vertices=this.readFloatArray(e,i,s),a;let h=new Array,l=new Array;for(let r=0;r<t;r++){let o=e.readInt(!0);l.push(o);for(let n=0;n<o;n++)l.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=l,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 D,l=new D;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 w=e.readByte(),b=e.readInt(!0),v=b-1;switch(w){case or:{let x=new be(b,d);for(let m=0;m<b;m++)x.setFrame(m,e.readFloat(),e.readStringRef());i.push(x);break}case hr:{let x=e.readInt(!0),m=new ht(b,x,d),p=e.readFloat(),y=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255;for(let T=0,M=0;m.setFrame(T,p,y,S,A,I),T!=v;T++){let R=e.readFloat(),X=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255,k=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(T);break;case oe:W(e,m,M++,T,0,p,R,y,X,1),W(e,m,M++,T,1,p,R,S,E,1),W(e,m,M++,T,2,p,R,A,k,1),W(e,m,M++,T,3,p,R,I,Y,1)}p=R,y=X,S=E,A=k,I=Y}i.push(m);break}case cr:{let x=e.readInt(!0),m=new ct(b,x,d),p=e.readFloat(),y=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255;for(let I=0,T=0;m.setFrame(I,p,y,S,A),I!=v;I++){let M=e.readFloat(),R=e.readUnsignedByte()/255,X=e.readUnsignedByte()/255,E=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(I);break;case oe:W(e,m,T++,I,0,p,M,y,R,1),W(e,m,T++,I,1,p,M,S,X,1),W(e,m,T++,I,2,p,M,A,E,1)}p=M,y=R,S=X,A=E}i.push(m);break}case dr:{let x=e.readInt(!0),m=new ft(b,x,d),p=e.readFloat(),y=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255,R=e.readUnsignedByte()/255;for(let X=0,E=0;m.setFrame(X,p,y,S,A,I,T,M,R),X!=v;X++){let k=e.readFloat(),Y=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,q=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,z=e.readUnsignedByte()/255,N=e.readUnsignedByte()/255,G=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(X);break;case oe:W(e,m,E++,X,0,p,k,y,Y,1),W(e,m,E++,X,1,p,k,S,B,1),W(e,m,E++,X,2,p,k,A,q,1),W(e,m,E++,X,3,p,k,I,L,1),W(e,m,E++,X,4,p,k,T,z,1),W(e,m,E++,X,5,p,k,M,N,1),W(e,m,E++,X,6,p,k,R,G,1)}p=k,y=Y,S=B,A=q,I=L,T=z,M=N,R=G}i.push(m);break}case fr:{let x=e.readInt(!0),m=new ut(b,x,d),p=e.readFloat(),y=e.readUnsignedByte()/255,S=e.readUnsignedByte()/255,A=e.readUnsignedByte()/255,I=e.readUnsignedByte()/255,T=e.readUnsignedByte()/255,M=e.readUnsignedByte()/255;for(let R=0,X=0;m.setFrame(R,p,y,S,A,I,T,M),R!=v;R++){let E=e.readFloat(),k=e.readUnsignedByte()/255,Y=e.readUnsignedByte()/255,B=e.readUnsignedByte()/255,q=e.readUnsignedByte()/255,L=e.readUnsignedByte()/255,z=e.readUnsignedByte()/255;switch(e.readByte()){case le:m.setStepped(R);break;case oe:W(e,m,X++,R,0,p,E,y,k,1),W(e,m,X++,R,1,p,E,S,Y,1),W(e,m,X++,R,2,p,E,A,B,1),W(e,m,X++,R,3,p,E,I,q,1),W(e,m,X++,R,4,p,E,T,L,1),W(e,m,X++,R,5,p,E,M,z,1)}p=E,y=k,S=Y,A=B,I=q,T=L,M=z}i.push(m);break}case ur:{let x=new dt(b,e.readInt(!0),d),m=e.readFloat(),p=e.readUnsignedByte()/255;for(let y=0,S=0;x.setFrame(y,m,p),y!=v;y++){let A=e.readFloat(),I=e.readUnsignedByte()/255;switch(e.readByte()){case le:x.setStepped(y);break;case oe:W(e,x,S++,y,0,m,A,p,I,1)}m=A,p=I}i.push(x)}}}}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 w=e.readByte(),b=e.readInt(!0),v=e.readInt(!0);switch(w){case Qs:i.push(de(e,new Me(b,v,d),1));break;case Zs:i.push(Vt(e,new et(b,v,d),a));break;case er:i.push(de(e,new tt(b,v,d),a));break;case tr:i.push(de(e,new st(b,v,d),a));break;case sr:i.push(Vt(e,new rt(b,v,d),1));break;case rr:i.push(de(e,new it(b,v,d),1));break;case ir:i.push(de(e,new at(b,v,d),1));break;case ar:i.push(Vt(e,new nt(b,v,d),1));break;case nr:i.push(de(e,new lt(b,v,d),1));break;case lr:i.push(de(e,new ot(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,w=new gt(u,e.readInt(!0),d),b=e.readFloat(),v=e.readFloat(),x=e.readFloat()*a;for(let m=0,p=0;w.setFrame(m,b,v,x,e.readByte(),e.readBoolean(),e.readBoolean()),m!=g;m++){let y=e.readFloat(),S=e.readFloat(),A=e.readFloat()*a;switch(e.readByte()){case le:w.setStepped(m);break;case oe:W(e,w,p++,m,0,b,y,v,S,1),W(e,w,p++,m,1,b,y,x,A,a)}b=y,v=S,x=A}i.push(w)}for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0),u=e.readInt(!0),g=u-1,w=new xt(u,e.readInt(!0),d),b=e.readFloat(),v=e.readFloat(),x=e.readFloat(),m=e.readFloat(),p=e.readFloat(),y=e.readFloat(),S=e.readFloat();for(let A=0,I=0;w.setFrame(A,b,v,x,m,p,y,S),A!=g;A++){let T=e.readFloat(),M=e.readFloat(),R=e.readFloat(),X=e.readFloat(),E=e.readFloat(),k=e.readFloat(),Y=e.readFloat();switch(e.readByte()){case le:w.setStepped(A);break;case oe:W(e,w,I++,A,0,b,T,v,M,1),W(e,w,I++,A,1,b,T,x,R,1),W(e,w,I++,A,2,b,T,m,X,1),W(e,w,I++,A,3,b,T,p,E,1),W(e,w,I++,A,4,b,T,y,k,1),W(e,w,I++,A,5,b,T,S,Y,1)}b=T,v=M,x=R,m=X,p=E,y=k,S=Y}i.push(w)}for(let c=0,f=e.readInt(!0);c<f;c++){let d=e.readInt(!0),u=s.pathConstraints[d];for(let g=0,w=e.readInt(!0);g<w;g++)switch(e.readByte()){case xr:i.push(de(e,new wt(e.readInt(!0),e.readInt(!0),d),u.positionMode==0?a:1));break;case wr:i.push(de(e,new bt(e.readInt(!0),e.readInt(!0),d),u.spacingMode==0||u.spacingMode==1?a:1));break;case br:let b=new pt(e.readInt(!0),e.readInt(!0),d),v=e.readFloat(),x=e.readFloat(),m=e.readFloat(),p=e.readFloat();for(let y=0,S=0,A=b.getFrameCount()-1;b.setFrame(y,v,x,m,p),y!=A;y++){let I=e.readFloat(),T=e.readFloat(),M=e.readFloat(),R=e.readFloat();switch(e.readByte()){case le:b.setStepped(y);break;case oe:W(e,b,S++,y,0,v,I,x,T,1),W(e,b,S++,y,1,v,I,m,M,1),W(e,b,S++,y,2,v,I,p,R,1)}v=I,x=T,m=M,p=R}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 w=e.readInt(!0);for(let b=0,v=e.readInt(!0);b<v;b++){let x=e.readStringRef();if(!x)throw new Error("attachmentName must not be null.");let m=d.getAttachment(w,x),p=e.readByte(),y=e.readInt(!0),S=y-1;switch(p){case mr:{let A=m,I=A.bones,T=A.vertices,M=I?T.length/3*2:T.length,R=e.readInt(!0),X=new mt(y,R,w,A),E=e.readFloat();for(let k=0,Y=0;;k++){let B,q=e.readInt(!0);if(q==0)B=I?P.newFloatArray(M):T;else{B=P.newFloatArray(M);let z=e.readInt(!0);if(q+=z,a==1)for(let N=z;N<q;N++)B[N]=e.readFloat();else for(let N=z;N<q;N++)B[N]=e.readFloat()*a;if(!I)for(let N=0,G=B.length;N<G;N++)B[N]+=T[N]}if(X.setFrame(k,E,B),k==S)break;let L=e.readFloat();switch(e.readByte()){case le:X.setStepped(k);break;case oe:W(e,X,Y++,k,0,E,L,0,1,1)}E=L}i.push(X);break}case gr:{let A=new ve(y,w,m);for(let I=0;I<y;I++){let T=e.readFloat(),M=e.readInt32();A.setFrame(I,T,$t[M&15],M>>4,e.readFloat())}i.push(A);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),w=P.newArray(f,0);for(let m=f-1;m>=0;m--)w[m]=-1;let b=P.newArray(f-g,0),v=0,x=0;for(let m=0;m<g;m++){let p=e.readInt(!0);for(;v!=p;)b[x++]=v++;w[v+e.readInt(!0)]=v++}for(;v<f;)b[x++]=v++;for(let m=f-1;m>=0;m--)w[m]==-1&&(w[m]=b[--x]);c.setFrame(d,u,w)}i.push(c)}let o=e.readInt(!0);if(o>0){let c=new Xe(o);for(let f=0;f<o;f++){let d=e.readFloat(),u=s.events[e.readInt(!0)],g=new Yt(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)}},ws=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}},Js=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}},Ks=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,l=0,r=t.getFrameCount()-1;t.setFrame(h,i,a),h!=r;h++){let o=e.readFloat(),n=e.readFloat()*s;switch(e.readByte()){case le:t.setStepped(h);break;case oe:W(e,t,l++,h,0,i,o,a,n,s)}i=o,a=n}return t}function Vt(e,t,s){let i=e.readFloat(),a=e.readFloat()*s,h=e.readFloat()*s;for(let l=0,r=0,o=t.getFrameCount()-1;t.setFrame(l,i,a,h),l!=o;l++){let n=e.readFloat(),c=e.readFloat()*s,f=e.readFloat()*s;switch(e.readByte()){case le:t.setStepped(l);break;case oe:W(e,t,r++,l,0,i,n,a,c,s),W(e,t,r++,l,1,i,n,h,f,s)}i=n,a=c,h=f}return t}function W(e,t,s,i,a,h,l,r,o,n){t.setBezier(s,i,a,h,r,e.readFloat(),e.readFloat()*n,e.readFloat(),e.readFloat()*n,l,o)}var Qs=0,Zs=1,er=2,tr=3,sr=4,rr=5,ir=6,ar=7,nr=8,lr=9,or=0,hr=1,cr=2,dr=3,fr=4,ur=5,mr=0,gr=1,xr=0,wr=1,br=2,le=1,oe=2,pr=class{minX=0;minY=0;maxX=0;maxY=0;boundingBoxes=new Array;polygons=new Array;polygonPool=new Ye(()=>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,l=h.length;s.length=0,a.freeAll(i),i.length=0;for(let r=0;r<l;r++){let o=h[r];if(!o.bone.active)continue;let n=o.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(o,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,l=a.length;h<l;h++){let r=a[h],o=r;for(let n=0,c=r.length;n<c;n+=2){let f=o[n],d=o[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,l=this.maxX,r=this.maxY;if(e<=a&&s<=a||t<=h&&i<=h||e>=l&&s>=l||t>=r&&i>=r)return!1;let o=(i-t)/(s-e),n=o*(a-e)+t;if(n>h&&n<r||(n=o*(l-e)+t,n>h&&n<r))return!0;let c=(h-t)/o+e;return c>a&&c<l||(c=(r-t)/o+e,c>a&&c<l)}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,l=!1;for(let r=0;r<a;r+=2){let o=i[r+1],n=i[h+1];if(o<s&&n>=s||n<s&&o>=s){let c=i[r];c+(s-o)/(n-o)*(i[h]-c)<t&&(l=!l)}h=r}return l}intersectsSegment(e,t,s,i){let a=this.polygons;for(let h=0,l=a.length;h<l;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,l=e.length,r=t-i,o=s-a,n=t*a-s*i,c=h[l-2],f=h[l-1];for(let d=0;d<l;d+=2){let u=h[d],g=h[d+1],w=c*g-f*u,b=c-u,v=f-g,x=r*v-o*b,m=(n*b-r*w)/x;if((m>=c&&m<=u||m>=u&&m<=c)&&(m>=t&&m<=i||m>=i&&m<=t)){let p=(n*v-o*w)/x;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 Ye(()=>new Array);polygonIndicesPool=new Ye(()=>new Array);triangulate(e){let t=e,s=e.length>>1,i=this.indicesArray;i.length=0;for(let l=0;l<s;l++)i[l]=l;let a=this.isConcaveArray;a.length=0;for(let l=0,r=s;l<r;++l)a[l]=ee.isConcave(l,s,t,i);let h=this.triangles;for(h.length=0;s>3;){let l=s-1,r=0,o=1;for(;;){e:if(!a[r]){let f=i[l]<<1,d=i[r]<<1,u=i[o]<<1,g=t[f],w=t[f+1],b=t[d],v=t[d+1],x=t[u],m=t[u+1];for(let p=(o+1)%s;p!=l;p=(p+1)%s){if(!a[p])continue;let y=i[p]<<1,S=t[y],A=t[y+1];if(ee.positiveArea(x,m,g,w,S,A)&&ee.positiveArea(g,w,b,v,S,A)&&ee.positiveArea(b,v,x,m,S,A))break e}break}if(o==0){do{if(!a[r])break;r--}while(r>0);break}l=r,r=o,o=(o+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 l=this.polygonPool.obtain();l.length=0;let r=-1,o=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],w=s[f+1],b=s[d],v=s[d+1],x=s[u],m=s[u+1],p=!1;if(r==f){let y=l.length-4,S=ee.winding(l[y],l[y+1],l[y+2],l[y+3],x,m),A=ee.winding(x,m,l[0],l[1],l[2],l[3]);S==o&&A==o&&(l.push(x),l.push(m),h.push(u),p=!0)}p||(l.length>0?(i.push(l),a.push(h)):(this.polygonPool.free(l),this.polygonIndicesPool.free(h)),l=this.polygonPool.obtain(),l.length=0,l.push(g),l.push(w),l.push(b),l.push(v),l.push(x),l.push(m),h=this.polygonIndicesPool.obtain(),h.length=0,h.push(f),h.push(d),h.push(u),o=ee.winding(g,w,b,v,x,m),r=f)}l.length>0&&(i.push(l),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];l=i[n];let u=l.length-4,g=l[u],w=l[u+1],b=l[u+2],v=l[u+3],x=l[0],m=l[1],p=l[2],y=l[3],S=ee.winding(g,w,b,v,x,m);for(let A=0;A<c;A++){if(A==n)continue;let I=a[A];if(I.length!=3)continue;let T=I[0],M=I[1],R=I[2],X=i[A],E=X[X.length-2],k=X[X.length-1];if(T!=f||M!=d)continue;let Y=ee.winding(g,w,b,v,E,k),B=ee.winding(E,k,x,m,p,y);Y==S&&B==S&&(X.length=0,I.length=0,l.push(E),l.push(k),h.push(R),g=b,w=v,b=E,v=k,A=0)}}for(let n=i.length-1;n>=0;n--)l=i[n],l.length==0&&(i.splice(n,1),this.polygonPool.free(l),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,l=i[(e+1)%t]<<1;return!this.positiveArea(s[a],s[a+1],s[h],s[h+1],s[l],s[l+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 l=s-e,r=i-t;return a*r-h*l+l*t-e*r>=0?1:-1}},Lt=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;Lt.makeClockwise(a);let h=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a));for(let l=0,r=h.length;l<r;l++){let o=h[l];Lt.makeClockwise(o),o.push(o[0]),o.push(o[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,l,r){let o=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 w=0;w<i;w+=3){let b=s[w]<<1,v=e[b],x=e[b+1],m=a[b],p=a[b+1];b=s[w+1]<<1;let y=e[b],S=e[b+1],A=a[b],I=a[b+1];b=s[w+2]<<1;let T=e[b],M=e[b+1],R=a[b],X=a[b+1];for(let E=0;E<d;E++){let k=n.length;if(this.clip(v,x,y,S,T,M,f[E],o)){let Y=o.length;if(Y==0)continue;let B=S-M,q=T-y,L=v-T,z=M-x,N=1/(B*L+q*(x-M)),G=Y>>1,U=this.clipOutput,O=P.setArraySize(n,k+G*u);for(let Q=0;Q<Y;Q+=2){let he=U[Q],K=U[Q+1];O[k]=he,O[k+1]=K,O[k+2]=h.r,O[k+3]=h.g,O[k+4]=h.b,O[k+5]=h.a;let se=he-T,re=K-M,xe=(B*se+q*re)*N,Ie=(z*se+L*re)*N,Fe=1-xe-Ie;O[k+6]=m*xe+A*Ie+R*Fe,O[k+7]=p*xe+I*Ie+X*Fe,r&&(O[k+8]=l.r,O[k+9]=l.g,O[k+10]=l.b,O[k+11]=l.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 Y=P.setArraySize(n,k+3*u);Y[k]=v,Y[k+1]=x,Y[k+2]=h.r,Y[k+3]=h.g,Y[k+4]=h.b,Y[k+5]=h.a,r?(Y[k+6]=m,Y[k+7]=p,Y[k+8]=l.r,Y[k+9]=l.g,Y[k+10]=l.b,Y[k+11]=l.a,Y[k+12]=y,Y[k+13]=S,Y[k+14]=h.r,Y[k+15]=h.g,Y[k+16]=h.b,Y[k+17]=h.a,Y[k+18]=A,Y[k+19]=I,Y[k+20]=l.r,Y[k+21]=l.g,Y[k+22]=l.b,Y[k+23]=l.a,Y[k+24]=T,Y[k+25]=M,Y[k+26]=h.r,Y[k+27]=h.g,Y[k+28]=h.b,Y[k+29]=h.a,Y[k+30]=R,Y[k+31]=X,Y[k+32]=l.r,Y[k+33]=l.g,Y[k+34]=l.b,Y[k+35]=l.a):(Y[k+6]=m,Y[k+7]=p,Y[k+8]=y,Y[k+9]=S,Y[k+10]=h.r,Y[k+11]=h.g,Y[k+12]=h.b,Y[k+13]=h.a,Y[k+14]=A,Y[k+15]=I,Y[k+16]=T,Y[k+17]=M,Y[k+18]=h.r,Y[k+19]=h.g,Y[k+20]=h.b,Y[k+21]=h.a,Y[k+22]=R,Y[k+23]=X),k=c.length;let B=P.setArraySize(c,k+3);B[k]=g,B[k+1]=g+1,B[k+2]=g+2,g+=3;continue e}}}}clip(e,t,s,i,a,h,l,r){let o=r,n=!1,c;l.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=l,d=l.length-4;for(let u=0;;u+=2){let g=f[u],w=f[u+1],b=f[u+2],v=f[u+3],x=g-b,m=w-v,p=c,y=c.length-2,S=r.length;for(let I=0;I<y;I+=2){let T=p[I],M=p[I+1],R=p[I+2],X=p[I+3],E=x*(X-v)-m*(R-b)>0;if(x*(M-v)-m*(T-b)>0){if(E){r.push(R),r.push(X);continue}let k=X-M,Y=R-T,B=k*(b-g)-Y*(v-w);if(Math.abs(B)>1e-6){let q=(Y*(w-M)-k*(g-T))/B;r.push(g+(b-g)*q),r.push(w+(v-w)*q)}else r.push(g),r.push(w)}else if(E){let k=X-M,Y=R-T,B=k*(b-g)-Y*(v-w);if(Math.abs(B)>1e-6){let q=(Y*(w-M)-k*(g-T))/B;r.push(g+(b-g)*q),r.push(w+(v-w)*q)}else r.push(g),r.push(w);r.push(R),r.push(X)}n=!0}if(S==r.length)return o.length=0,!0;if(r.push(r[0]),r.push(r[1]),u==d)break;let A=r;r=c,r.length=0,c=A}if(o!=r){o.length=0;for(let u=0,g=r.length-2;u<g;u++)o[u]=r[u]}else o.length=o.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,l=0,r=0;for(let o=0,n=s-3;o<n;o+=2)a=t[o],h=t[o+1],l=t[o+2],r=t[o+3],i+=a*r-l*h;if(!(i<0))for(let o=0,n=s-2,c=s>>1;o<c;o+=2){let f=t[o],d=t[o+1],u=n-o;t[o]=t[u],t[o+1]=t[u+1],t[u]=f,t[u+1]=d}}},yr=class{attachmentLoader;scale=1;linkedMeshes=new Array;constructor(e){this.attachmentLoader=e}readSkeletonData(e){let t=this.scale,s=new Et,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 l=i.bones[h],r=null,o=C(l,"parent",null);o&&(r=s.findBone(o));let n=new kt(s.bones.length,l.name,r);n.length=C(l,"length",0)*t,n.x=C(l,"x",0)*t,n.y=C(l,"y",0)*t,n.rotation=C(l,"rotation",0),n.scaleX=C(l,"scaleX",1),n.scaleY=C(l,"scaleY",1),n.shearX=C(l,"shearX",0),n.shearY=C(l,"shearY",0),n.transformMode=P.enumValue(qe,C(l,"transform","Normal")),n.skinRequired=C(l,"skin",!1);let c=C(l,"color",null);c&&n.color.setFromString(c),s.bones.push(n)}if(i.slots)for(let h=0;h<i.slots.length;h++){let l=i.slots[h],r=s.findBone(l.bone);if(!r)throw new Error(`Couldn't find bone ${l.bone} for slot ${l.name}`);let o=new Pt(s.slots.length,l.name,r),n=C(l,"color",null);n&&o.color.setFromString(n);let c=C(l,"dark",null);c&&(o.darkColor=D.fromString(c)),o.attachmentName=C(l,"attachment",null),o.blendMode=P.enumValue(Ge,C(l,"blend","normal")),s.slots.push(o)}if(i.ik)for(let h=0;h<i.ik.length;h++){let l=i.ik[h],r=new Xt(l.name);r.order=C(l,"order",0),r.skinRequired=C(l,"skin",!1);for(let n=0;n<l.bones.length;n++){let c=s.findBone(l.bones[n]);if(!c)throw new Error(`Couldn't find bone ${l.bones[n]} for IK constraint ${l.name}.`);r.bones.push(c)}let o=s.findBone(l.target);if(!o)throw new Error(`Couldn't find target bone ${l.target} for IK constraint ${l.name}.`);r.target=o,r.mix=C(l,"mix",1),r.softness=C(l,"softness",0)*t,r.bendDirection=C(l,"bendPositive",!0)?1:-1,r.compress=C(l,"compress",!1),r.stretch=C(l,"stretch",!1),r.uniform=C(l,"uniform",!1),s.ikConstraints.push(r)}if(i.transform)for(let h=0;h<i.transform.length;h++){let l=i.transform[h],r=new Bt(l.name);r.order=C(l,"order",0),r.skinRequired=C(l,"skin",!1);for(let c=0;c<l.bones.length;c++){let f=l.bones[c],d=s.findBone(f);if(!d)throw new Error(`Couldn't find bone ${f} for transform constraint ${l.name}.`);r.bones.push(d)}let o=l.target,n=s.findBone(o);if(!n)throw new Error(`Couldn't find target bone ${o} for transform constraint ${l.name}.`);r.target=n,r.local=C(l,"local",!1),r.relative=C(l,"relative",!1),r.offsetRotation=C(l,"rotation",0),r.offsetX=C(l,"x",0)*t,r.offsetY=C(l,"y",0)*t,r.offsetScaleX=C(l,"scaleX",0),r.offsetScaleY=C(l,"scaleY",0),r.offsetShearY=C(l,"shearY",0),r.mixRotate=C(l,"mixRotate",1),r.mixX=C(l,"mixX",1),r.mixY=C(l,"mixY",r.mixX),r.mixScaleX=C(l,"mixScaleX",1),r.mixScaleY=C(l,"mixScaleY",r.mixScaleX),r.mixShearY=C(l,"mixShearY",1),s.transformConstraints.push(r)}if(i.path)for(let h=0;h<i.path.length;h++){let l=i.path[h],r=new Ft(l.name);r.order=C(l,"order",0),r.skinRequired=C(l,"skin",!1);for(let c=0;c<l.bones.length;c++){let f=l.bones[c],d=s.findBone(f);if(!d)throw new Error(`Couldn't find bone ${f} for path constraint ${l.name}.`);r.bones.push(d)}let o=l.target,n=s.findSlot(o);if(!n)throw new Error(`Couldn't find target slot ${o} for path constraint ${l.name}.`);r.target=n,r.positionMode=P.enumValue(We,C(l,"positionMode","Percent")),r.spacingMode=P.enumValue(ze,C(l,"spacingMode","Length")),r.rotateMode=P.enumValue($e,C(l,"rotateMode","Tangent")),r.offsetRotation=C(l,"rotation",0),r.position=C(l,"position",0),r.positionMode==0&&(r.position*=t),r.spacing=C(l,"spacing",0),(r.spacingMode==0||r.spacingMode==1)&&(r.spacing*=t),r.mixRotate=C(l,"mixRotate",1),r.mixX=C(l,"mixX",1),r.mixY=C(l,"mixY",r.mixX),s.pathConstraints.push(r)}if(i.skins)for(let h=0;h<i.skins.length;h++){let l=i.skins[h],r=new He(l.name);if(l.bones)for(let o=0;o<l.bones.length;o++){let n=l.bones[o],c=s.findBone(n);if(!c)throw new Error(`Couldn't find bone ${n} for skin ${l.name}.`);r.bones.push(c)}if(l.ik)for(let o=0;o<l.ik.length;o++){let n=l.ik[o],c=s.findIkConstraint(n);if(!c)throw new Error(`Couldn't find IK constraint ${n} for skin ${l.name}.`);r.constraints.push(c)}if(l.transform)for(let o=0;o<l.transform.length;o++){let n=l.transform[o],c=s.findTransformConstraint(n);if(!c)throw new Error(`Couldn't find transform constraint ${n} for skin ${l.name}.`);r.constraints.push(c)}if(l.path)for(let o=0;o<l.path.length;o++){let n=l.path[o],c=s.findPathConstraint(n);if(!c)throw new Error(`Couldn't find path constraint ${n} for skin ${l.name}.`);r.constraints.push(c)}for(let o in l.attachments){let n=s.findSlot(o);if(!n)throw new Error(`Couldn't find slot ${o} for skin ${l.name}.`);let c=l.attachments[o];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,l=this.linkedMeshes.length;h<l;h++){let r=this.linkedMeshes[h],o=r.skin?s.findSkin(r.skin):s.defaultSkin;if(!o)throw new Error(`Skin not found: ${r.skin}`);let n=o.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 l=i.events[h],r=new Mt(h);r.intValue=C(l,"int",0),r.floatValue=C(l,"float",0),r.stringValue=C(l,"string",""),r.audioPath=C(l,"audio",null),r.audioPath&&(r.volume=C(l,"volume",1),r.balance=C(l,"balance",0)),s.events.push(r)}if(i.animations)for(let h in i.animations){let l=i.animations[h];this.readAnimation(l,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 l=C(e,"path",i),r=this.readSequence(C(e,"sequence",null)),o=this.attachmentLoader.newRegionAttachment(t,i,l,r);if(!o)return null;o.path=l,o.x=C(e,"x",0)*h,o.y=C(e,"y",0)*h,o.scaleX=C(e,"scaleX",1),o.scaleY=C(e,"scaleY",1),o.rotation=C(e,"rotation",0),o.width=e.width*h,o.height=e.height*h,o.sequence=r;let n=C(e,"color",null);return n&&o.color.setFromString(n),o.region!=null&&o.updateRegion(),o}case"boundingbox":{let l=this.attachmentLoader.newBoundingBoxAttachment(t,i);if(!l)return null;this.readVertices(e,l,e.vertexCount<<1);let r=C(e,"color",null);return r&&l.color.setFromString(r),l}case"mesh":case"linkedmesh":{let l=C(e,"path",i),r=this.readSequence(C(e,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(t,i,l,r);if(!o)return null;o.path=l;let n=C(e,"color",null);n&&o.color.setFromString(n),o.width=C(e,"width",0)*h,o.height=C(e,"height",0)*h,o.sequence=r;let c=C(e,"parent",null);if(c)return this.linkedMeshes.push(new vr(o,C(e,"skin",null),s,c,C(e,"timelines",!0))),o;let f=e.uvs;return this.readVertices(e,o,f.length),o.triangles=e.triangles,o.regionUVs=f,o.region!=null&&o.updateRegion(),o.edges=C(e,"edges",null),o.hullLength=C(e,"hull",0)*2,o}case"path":{let l=this.attachmentLoader.newPathAttachment(t,i);if(!l)return null;l.closed=C(e,"closed",!1),l.constantSpeed=C(e,"constantSpeed",!0);let r=e.vertexCount;this.readVertices(e,l,r<<1);let o=P.newArray(r/3,0);for(let c=0;c<e.lengths.length;c++)o[c]=e.lengths[c]*h;l.lengths=o;let n=C(e,"color",null);return n&&l.color.setFromString(n),l}case"point":{let l=this.attachmentLoader.newPointAttachment(t,i);if(!l)return null;l.x=C(e,"x",0)*h,l.y=C(e,"y",0)*h,l.rotation=C(e,"rotation",0);let r=C(e,"color",null);return r&&l.color.setFromString(r),l}case"clipping":{let l=this.attachmentLoader.newClippingAttachment(t,i);if(!l)return null;let r=C(e,"end",null);r&&(l.endSlot=a.findSlot(r));let o=e.vertexCount;this.readVertices(e,l,o<<1);let n=C(e,"color",null);return n&&l.color.setFromString(n),l}}return null}readSequence(e){if(e==null)return null;let t=new Ze(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 o=0,n=a.length;o<n;o++)r[o]*=i;t.vertices=r;return}let h=new Array,l=new Array;for(let r=0,o=a.length;r<o;){let n=a[r++];l.push(n);for(let c=r+n*4;r<c;r+=4)l.push(a[r]),h.push(a[r+1]*i),h.push(a[r+2]*i),h.push(a[r+3])}t.bones=l,t.vertices=P.toFloatArray(h)}readAnimation(e,t,s){let i=this.scale,a=new Array;if(e.slots)for(let l in e.slots){let r=e.slots[l],o=s.findSlot(l);if(!o)throw new Error("Slot not found: "+l);let n=o.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 w=f[g];u.setFrame(g,C(w,"time",0),C(w,"name",null))}a.push(u)}else if(c=="rgba"){let u=new ht(d,d<<2,n),g=f[0],w=C(g,"time",0),b=D.fromString(g.color);for(let v=0,x=0;;v++){u.setFrame(v,w,b.r,b.g,b.b,b.a);let m=f[v+1];if(!m){u.shrink(x);break}let p=C(m,"time",0),y=D.fromString(m.color),S=g.curve;S&&(x=H(S,u,x,v,0,w,p,b.r,y.r,1),x=H(S,u,x,v,1,w,p,b.g,y.g,1),x=H(S,u,x,v,2,w,p,b.b,y.b,1),x=H(S,u,x,v,3,w,p,b.a,y.a,1)),w=p,b=y,g=m}a.push(u)}else if(c=="rgb"){let u=new ct(d,d*3,n),g=f[0],w=C(g,"time",0),b=D.fromString(g.color);for(let v=0,x=0;;v++){u.setFrame(v,w,b.r,b.g,b.b);let m=f[v+1];if(!m){u.shrink(x);break}let p=C(m,"time",0),y=D.fromString(m.color),S=g.curve;S&&(x=H(S,u,x,v,0,w,p,b.r,y.r,1),x=H(S,u,x,v,1,w,p,b.g,y.g,1),x=H(S,u,x,v,2,w,p,b.b,y.b,1)),w=p,b=y,g=m}a.push(u)}else if(c=="alpha")a.push(ce(f,new dt(d,d,n),0,1));else if(c=="rgba2"){let u=new ft(d,d*7,n),g=f[0],w=C(g,"time",0),b=D.fromString(g.light),v=D.fromString(g.dark);for(let x=0,m=0;;x++){u.setFrame(x,w,b.r,b.g,b.b,b.a,v.r,v.g,v.b);let p=f[x+1];if(!p){u.shrink(m);break}let y=C(p,"time",0),S=D.fromString(p.light),A=D.fromString(p.dark),I=g.curve;I&&(m=H(I,u,m,x,0,w,y,b.r,S.r,1),m=H(I,u,m,x,1,w,y,b.g,S.g,1),m=H(I,u,m,x,2,w,y,b.b,S.b,1),m=H(I,u,m,x,3,w,y,b.a,S.a,1),m=H(I,u,m,x,4,w,y,v.r,A.r,1),m=H(I,u,m,x,5,w,y,v.g,A.g,1),m=H(I,u,m,x,6,w,y,v.b,A.b,1)),w=y,b=S,v=A,g=p}a.push(u)}else if(c=="rgb2"){let u=new ut(d,d*6,n),g=f[0],w=C(g,"time",0),b=D.fromString(g.light),v=D.fromString(g.dark);for(let x=0,m=0;;x++){u.setFrame(x,w,b.r,b.g,b.b,v.r,v.g,v.b);let p=f[x+1];if(!p){u.shrink(m);break}let y=C(p,"time",0),S=D.fromString(p.light),A=D.fromString(p.dark),I=g.curve;I&&(m=H(I,u,m,x,0,w,y,b.r,S.r,1),m=H(I,u,m,x,1,w,y,b.g,S.g,1),m=H(I,u,m,x,2,w,y,b.b,S.b,1),m=H(I,u,m,x,3,w,y,v.r,A.r,1),m=H(I,u,m,x,4,w,y,v.g,A.g,1),m=H(I,u,m,x,5,w,y,v.b,A.b,1)),w=y,b=S,v=A,g=p}a.push(u)}}}if(e.bones)for(let l in e.bones){let r=e.bones[l],o=s.findBone(l);if(!o)throw new Error("Bone not found: "+l);let n=o.index;for(let c in r){let f=r[c],d=f.length;if(d!=0){if(c==="rotate")a.push(ce(f,new Me(d,d,n),0,1));else if(c==="translate"){let u=new et(d,d<<1,n);a.push(Dt(f,u,"x","y",0,i))}else if(c==="translatex"){let u=new tt(d,d,n);a.push(ce(f,u,0,i))}else if(c==="translatey"){let u=new st(d,d,n);a.push(ce(f,u,0,i))}else if(c==="scale"){let u=new rt(d,d<<1,n);a.push(Dt(f,u,"x","y",1,1))}else if(c==="scalex"){let u=new it(d,d,n);a.push(ce(f,u,1,1))}else if(c==="scaley"){let u=new at(d,d,n);a.push(ce(f,u,1,1))}else if(c==="shear"){let u=new nt(d,d<<1,n);a.push(Dt(f,u,"x","y",0,1))}else if(c==="shearx"){let u=new lt(d,d,n);a.push(ce(f,u,0,1))}else if(c==="sheary"){let u=new ot(d,d,n);a.push(ce(f,u,0,1))}}}}if(e.ik)for(let l in e.ik){let r=e.ik[l],o=r[0];if(!o)continue;let n=s.findIkConstraint(l);if(!n)throw new Error("IK Constraint not found: "+l);let c=s.ikConstraints.indexOf(n),f=new gt(r.length,r.length<<1,c),d=C(o,"time",0),u=C(o,"mix",1),g=C(o,"softness",0)*i;for(let w=0,b=0;;w++){f.setFrame(w,d,u,g,C(o,"bendPositive",!0)?1:-1,C(o,"compress",!1),C(o,"stretch",!1));let v=r[w+1];if(!v){f.shrink(b);break}let x=C(v,"time",0),m=C(v,"mix",1),p=C(v,"softness",0)*i,y=o.curve;y&&(b=H(y,f,b,w,0,d,x,u,m,1),b=H(y,f,b,w,1,d,x,g,p,i)),d=x,u=m,g=p,o=v}a.push(f)}if(e.transform)for(let l in e.transform){let r=e.transform[l],o=r[0];if(!o)continue;let n=s.findTransformConstraint(l);if(!n)throw new Error("Transform constraint not found: "+l);let c=s.transformConstraints.indexOf(n),f=new xt(r.length,r.length*6,c),d=C(o,"time",0),u=C(o,"mixRotate",1),g=C(o,"mixX",1),w=C(o,"mixY",g),b=C(o,"mixScaleX",1),v=C(o,"mixScaleY",b),x=C(o,"mixShearY",1);for(let m=0,p=0;;m++){f.setFrame(m,d,u,g,w,b,v,x);let y=r[m+1];if(!y){f.shrink(p);break}let S=C(y,"time",0),A=C(y,"mixRotate",1),I=C(y,"mixX",1),T=C(y,"mixY",I),M=C(y,"mixScaleX",1),R=C(y,"mixScaleY",M),X=C(y,"mixShearY",1),E=o.curve;E&&(p=H(E,f,p,m,0,d,S,u,A,1),p=H(E,f,p,m,1,d,S,g,I,1),p=H(E,f,p,m,2,d,S,w,T,1),p=H(E,f,p,m,3,d,S,b,M,1),p=H(E,f,p,m,4,d,S,v,R,1),p=H(E,f,p,m,5,d,S,x,X,1)),d=S,u=A,g=I,w=T,b=M,v=R,b=M,o=y}a.push(f)}if(e.path)for(let l in e.path){let r=e.path[l],o=s.findPathConstraint(l);if(!o)throw new Error("Path constraint not found: "+l);let n=s.pathConstraints.indexOf(o);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 wt(u,u,n);a.push(ce(f,g,0,o.positionMode==0?i:1))}else if(c==="spacing"){let g=new bt(u,u,n);a.push(ce(f,g,0,o.spacingMode==0||o.spacingMode==1?i:1))}else if(c==="mix"){let g=new pt(u,u*3,n),w=C(d,"time",0),b=C(d,"mixRotate",1),v=C(d,"mixX",1),x=C(d,"mixY",v);for(let m=0,p=0;;m++){g.setFrame(m,w,b,v,x);let y=f[m+1];if(!y){g.shrink(p);break}let S=C(y,"time",0),A=C(y,"mixRotate",1),I=C(y,"mixX",1),T=C(y,"mixY",I),M=d.curve;M&&(p=H(M,g,p,m,0,w,S,b,A,1),p=H(M,g,p,m,1,w,S,v,I,1),p=H(M,g,p,m,2,w,S,x,T,1)),w=S,b=A,v=I,x=T,d=y}a.push(g)}}}if(e.attachments)for(let l in e.attachments){let r=e.attachments[l],o=s.findSkin(l);if(!o)throw new Error("Skin not found: "+l);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],w=o.getAttachment(d,u);for(let b in g){let v=g[b],x=v[0];if(x){if(b=="deform"){let m=w.bones,p=w.vertices,y=m?p.length/3*2:p.length,S=new mt(v.length,v.length,d,w),A=C(x,"time",0);for(let I=0,T=0;;I++){let M,R=C(x,"vertices",null);if(!R)M=m?P.newFloatArray(y):p;else{M=P.newFloatArray(y);let Y=C(x,"offset",0);if(P.arrayCopy(R,0,M,Y,R.length),i!=1)for(let B=Y,q=B+R.length;B<q;B++)M[B]*=i;if(!m)for(let B=0;B<y;B++)M[B]+=p[B]}S.setFrame(I,A,M);let X=v[I+1];if(!X){S.shrink(T);break}let E=C(X,"time",0),k=x.curve;k&&(T=H(k,S,T,I,0,A,E,0,1,1)),A=E,x=X}a.push(S)}else if(b=="sequence"){let m=new ve(v.length,d,w),p=0;for(let y=0;y<v.length;y++){let S=C(x,"delay",p),A=C(x,"time",0),I=zt[C(x,"mode","hold")],T=C(x,"index",0);m.setFrame(y,A,I,T,S),p=S,x=v[y+1]}a.push(m)}}}}}}if(e.drawOrder){let l=new pe(e.drawOrder.length),r=s.slots.length,o=0;for(let n=0;n<e.drawOrder.length;n++,o++){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,w=0;for(let b=0;b<d.length;b++){let v=d[b],x=s.findSlot(v.slot);if(!x)throw new Error("Slot not found: "+x);let m=x.index;for(;g!=m;)u[w++]=g++;f[g+v.offset]=g++}for(;g<r;)u[w++]=g++;for(let b=r-1;b>=0;b--)f[b]==-1&&(f[b]=u[--w])}l.setFrame(o,C(c,"time",0),f)}a.push(l)}if(e.events){let l=new Xe(e.events.length),r=0;for(let o=0;o<e.events.length;o++,r++){let n=e.events[o],c=s.findEvent(n.name);if(!c)throw new Error("Event not found: "+n.name);let f=new Yt(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)),l.setFrame(r,f)}a.push(l)}let h=0;for(let l=0,r=a.length;l<r;l++)h=Math.max(h,a[l].getDuration());s.animations.push(new Be(t,a,h))}},vr=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),l=C(a,"value",s)*i,r=0;for(let o=0;;o++){t.setFrame(o,h,l);let n=e[o+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,o,0,h,c,l,f,i)),h=c,l=f,a=n}}function Dt(e,t,s,i,a,h){let l=e[0],r=C(l,"time",0),o=C(l,s,a)*h,n=C(l,i,a)*h,c=0;for(let f=0;;f++){t.setFrame(f,r,o,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,w=C(d,i,a)*h,b=l.curve;b&&(c=H(b,t,c,f,0,r,u,o,g,h),c=H(b,t,c,f,1,r,u,n,w,h)),r=u,o=g,n=w,l=d}}function H(e,t,s,i,a,h,l,r,o,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,l,o),s+1}function C(e,t,s){return e[t]!==void 0?e[t]:s}return typeof Math.fround>"u"&&(Math.fround=function(e){return function(t){return e[0]=t,e[0]}}(new Float32Array(1))),Ms(_t)})();
|