@esotericsoftware/spine-webgl
Version:
The official Spine Runtimes for the web.
1 lines • 247 kB
JavaScript
"use strict";var Bn=class{array=[];add(e){const t=this.contains(e);return this.array[e|0]=e|0,!t}contains(e){return this.array[e|0]!==void 0}remove(e){this.array[e|0]=void 0}clear(){this.array.length=0}},Pi=class{entries={};size=0;add(e){const t=this.entries[e];return this.entries[e]=!0,t?!1:(this.size++,!0)}addAll(e){const t=this.size;for(let 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}},it=class Qt{constructor(t=0,s=0,i=0,n=0){this.r=t,this.g=s,this.b=i,this.a=n}static WHITE=new Qt(1,1,1,1);static RED=new Qt(1,0,0,1);static GREEN=new Qt(0,1,0,1);static BLUE=new Qt(0,0,1,1);static MAGENTA=new Qt(1,0,1,1);set(t,s,i,n){return this.r=t,this.g=s,this.b=i,this.a=n,this.clamp()}setFromColor(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}setFromString(t){return t=t.charAt(0)==="#"?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=t.length!==8?1:parseInt(t.substr(6,2),16)/255,this}add(t,s,i,n){return this.r+=t,this.g+=s,this.b+=i,this.a+=n,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(t,s){t.r=((s&4278190080)>>>24)/255,t.g=((s&16711680)>>>16)/255,t.b=((s&65280)>>>8)/255,t.a=(s&255)/255}static rgb888ToColor(t,s){t.r=((s&16711680)>>>16)/255,t.g=((s&65280)>>>8)/255,t.b=(s&255)/255}toRgb888(){const t=s=>`0${(s*255).toString(16)}`.slice(-2);return+`0x${t(this.r)}${t(this.g)}${t(this.b)}`}static fromString(t,s=new Qt){return s.setFromString(t)}},B=class Mt{static epsilon=1e-5;static epsilon2=Mt.epsilon*Mt.epsilon;static PI=3.1415927;static PI2=Mt.PI*2;static invPI2=1/Mt.PI2;static radiansToDegrees=180/Mt.PI;static radDeg=Mt.radiansToDegrees;static degreesToRadians=Mt.PI/180;static degRad=Mt.degreesToRadians;static clamp(t,s,i){return t<s?s:t>i?i:t}static cosDeg(t){return Math.cos(t*Mt.degRad)}static sinDeg(t){return Math.sin(t*Mt.degRad)}static atan2Deg(t,s){return Math.atan2(t,s)*Mt.radDeg}static signum(t){return t>0?1:t<0?-1:0}static toInt(t){return t>0?Math.floor(t):Math.ceil(t)}static cbrt(t){const s=Math.pow(Math.abs(t),.3333333333333333);return t<0?-s:s}static randomTriangular(t,s){return Mt.randomTriangularWith(t,s,(t+s)*.5)}static randomTriangularWith(t,s,i){const n=Math.random(),r=s-t;return n<=(i-t)/r?t+Math.sqrt(n*r*(i-t)):s-Math.sqrt((1-n)*r*(s-i))}static isPowerOfTwo(t){return t&&(t&t-1)===0}},ue=class he{static linear=new class extends he{applyInternal(t){return t}};static smooth=new class extends he{applyInternal(t){return t*t*(3-2*t)}};static slowFast=new class extends he{applyInternal(t){return t*t}};static fastSlow=new class extends he{applyInternal(t){return(t-1)*(t-1)*-1+1}};static circle=new class extends he{applyInternal(t){return t<=.5?(t*=2,(1-Math.sqrt(1-t*t))/2):(t--,t*=2,(Math.sqrt(1-t*t)+1)/2)}};apply(t,s,i){return s===void 0||i===void 0?this.applyInternal(t):t+(s-t)*this.applyInternal(i)}},Xi=class extends ue{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}},On=class extends Xi{constructor(e){super(e)}applyInternal(e){return Math.pow(e-1,this.power)*(this.power%2===0?-1:1)+1}},O=class de{static SUPPORTS_TYPED_ARRAYS=typeof Float32Array<"u";static arrayCopy(t,s,i,n,r){for(let a=s,h=n;a<s+r;a++,h++)i[h]=t[a]}static arrayFill(t,s,i,n){for(let r=s;r<i;r++)t[r]=n}static setArraySize(t,s,i=0){const n=t.length;if(n===s)return t;if(t.length=s,n<s)for(let r=n;r<s;r++)t[r]=i;return t}static ensureArrayCapacity(t,s,i=0){return t.length>=s?t:de.setArraySize(t,s,i)}static newArray(t,s){const i=[];for(let n=0;n<t;n++)i[n]=s;return i}static newFloatArray(t){if(de.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{const s=[];for(let i=0;i<s.length;i++)s[i]=0;return s}}static newShortArray(t){if(de.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{const s=[];for(let i=0;i<s.length;i++)s[i]=0;return s}}static toFloatArray(t){return de.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return de.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t){}static contains(t,s,i=!0){for(let n=0;n<t.length;n++)if(t[n]===s)return!0;return!1}static enumValue(t,s){return t[s[0].toUpperCase()+s.slice(1)]}},Un=class{static logBones(e){for(let t=0;t<e.bones.length;t++){const s=e.bones[t].appliedPose;console.log(`${s.bone.data.name}, ${s.a}, ${s.b}, ${s.c}, ${s.d}, ${s.worldX}, ${s.worldY}`)}}},me=class{items=[];instantiator;constructor(e){this.instantiator=e}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(e){e.reset?.(),this.items.push(e)}freeAll(e){for(let t=0;t<e.length;t++)this.free(e[t])}clear(){this.items.length=0}},Ee=class{constructor(e=0,t=0){this.x=e,this.y=t}set(e,t){return this.x=e,this.y=t,this}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}normalize(){const e=this.length();return e!==0&&(this.x/=e,this.y/=e),this}},as=class{maxDelta=.064;framesPerSecond=0;delta=0;totalTime=0;lastTime=Date.now()/1e3;frameCount=0;frameTime=0;update(){const 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)}},Nn=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}},cs=class{_image;constructor(e){this._image=e}getImage(){return this._image}},Ye=(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))(Ye||{}),ki=(e=>(e[e.MirroredRepeat=33648]="MirroredRepeat",e[e.ClampToEdge=33071]="ClampToEdge",e[e.Repeat=10497]="Repeat",e))(ki||{}),Vi=class{texture;u=0;v=0;u2=0;v2=0;width=0;height=0;degrees=0;offsetX=0;offsetY=0;originalWidth=0;originalHeight=0},Dn=class extends cs{setFilters(e,t){}setWraps(e,t){}dispose(){}},ls=class{pages=[];regions=[];constructor(e){const t=new zn(e),s=new Array(4),i={};i.size=o=>{o.width=parseInt(s[1]),o.height=parseInt(s[2])},i.format=()=>{},i.filter=o=>{o.minFilter=O.enumValue(Ye,s[1]),o.magFilter=O.enumValue(Ye,s[2])},i.repeat=o=>{s[1].indexOf("x")!==-1&&(o.uWrap=10497),s[1].indexOf("y")!==-1&&(o.vWrap=10497)},i.pma=o=>{o.pma=s[1]==="true"};var n={};n.xy=o=>{o.x=parseInt(s[1]),o.y=parseInt(s[2])},n.size=o=>{o.width=parseInt(s[1]),o.height=parseInt(s[2])},n.bounds=o=>{o.x=parseInt(s[1]),o.y=parseInt(s[2]),o.width=parseInt(s[3]),o.height=parseInt(s[4])},n.offset=o=>{o.offsetX=parseInt(s[1]),o.offsetY=parseInt(s[2])},n.orig=o=>{o.originalWidth=parseInt(s[1]),o.originalHeight=parseInt(s[2])},n.offsets=o=>{o.offsetX=parseInt(s[1]),o.offsetY=parseInt(s[2]),o.originalWidth=parseInt(s[3]),o.originalHeight=parseInt(s[4])},n.rotate=o=>{const l=s[1];l==="true"?o.degrees=90:l!=="false"&&(o.degrees=parseInt(l))},n.index=o=>{o.index=parseInt(s[1])};let r=t.readLine();for(;r&&r.trim().length===0;)r=t.readLine();for(;!(!r||r.trim().length===0||t.readEntry(s,r)===0);)r=t.readLine();let a=null,h=null,c=null;for(;r!==null;)if(r.trim().length===0)a=null,r=t.readLine();else if(a){const o=new hs(a,r);for(;;){const l=t.readEntry(s,r=t.readLine());if(l===0)break;const d=n[s[0]];if(d)d(o);else{h||(h=[]),c||(c=[]),h.push(s[0]);const m=[];for(let f=0;f<l;f++)m.push(parseInt(s[f+1]));c.push(m)}}o.originalWidth===0&&o.originalHeight===0&&(o.originalWidth=o.width,o.originalHeight=o.height),h&&h.length>0&&c&&c.length>0&&(o.names=h,o.values=c,h=null,c=null),o.u=o.x/a.width,o.v=o.y/a.height,o.degrees===90?(o.u2=(o.x+o.height)/a.width,o.v2=(o.y+o.width)/a.height):(o.u2=(o.x+o.width)/a.width,o.v2=(o.y+o.height)/a.height),this.regions.push(o)}else{for(a=new Bi(r.trim());t.readEntry(s,r=t.readLine())!==0;){const o=i[s[0]];o&&o(a)}this.pages.push(a)}}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(const 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()}},zn=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;const s=t.indexOf(":");if(s===-1)return 0;e[0]=t.substr(0,s).trim();for(let i=1,n=s+1;;i++){const r=t.indexOf(",",n);if(r===-1)return e[i]=t.substr(n).trim(),i;if(e[i]=t.substr(n,r-n).trim(),n=r+1,i===4)return 4}}},Bi=class{name;minFilter=9728;magFilter=9728;uWrap=33071;vWrap=33071;texture=null;width=0;height=0;pma=!1;regions=[];constructor(e){this.name=e}setTexture(e){this.texture=e,e.setFilters(this.minFilter,this.magFilter),e.setWraps(this.uWrap,this.vWrap);for(const t of this.regions)t.texture=e}},hs=class extends Vi{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)}},ds=class Tn{static empty=[];name;timelineAttachment;timelineSlots=Tn.empty;constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t,this.timelineAttachment=this}isTimelineActive(t,s,i){let n=t[s];if(n.bone.isActive()){const r=(i?n.getAppliedPose():n.getPose()).getAttachment();if(r!=null&&r.timelineAttachment===this)return!0}for(let r=0,a=this.timelineSlots.length;r<a;r++){if(n=t[this.timelineSlots[r]],!n.bone.isActive())continue;const h=(i?n.getAppliedPose():n.getPose()).getAttachment();if(h!=null&&h.timelineAttachment===this)return!0}return!1}},Dt=class An extends ds{static nextID=0;id=An.nextID++;bones=null;vertices=[];worldVerticesLength=0;constructor(t){super(t)}computeWorldVertices(t,s,i,n,r,a,h){n=a+(n>>1)*h;const c=s.appliedPose.deform;let o=this.vertices;const l=this.bones;if(!l){c.length>0&&(o=c);const u=s.bone.appliedPose,p=u.worldX,g=u.worldY,x=u.a,b=u.b,w=u.c,v=u.d;for(let y=i,T=a;T<n;y+=2,T+=h){const A=o[y],S=o[y+1];r[T]=A*x+S*b+p,r[T+1]=A*w+S*v+g}return}let d=0,m=0;for(let u=0;u<i;u+=2){const p=l[d];d+=p+1,m+=p}const f=t.bones;if(c.length===0)for(let u=a,p=m*3;u<n;u+=h){let g=0,x=0,b=l[d++];for(b+=d;d<b;d++,p+=3){const w=f[l[d]].appliedPose,v=o[p],y=o[p+1],T=o[p+2];g+=(v*w.a+y*w.b+w.worldX)*T,x+=(v*w.c+y*w.d+w.worldY)*T}r[u]=g,r[u+1]=x}else{const u=c;for(let p=a,g=m*3,x=m<<1;p<n;p+=h){let b=0,w=0,v=l[d++];for(v+=d;d<v;d++,g+=3,x+=2){const y=f[l[d]].appliedPose,T=o[g]+u[x],A=o[g+1]+u[x+1],S=o[g+2];b+=(T*y.a+A*y.b+y.worldX)*S,w+=(T*y.c+A*y.d+y.worldY)*S}r[p]=b,r[p+1]=w}}}copyTo(t){this.bones?(t.bones=[],O.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=O.newFloatArray(this.vertices.length),O.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment,t.timelineSlots=this.timelineSlots}},Ut=class Ii extends Dt{sequence;regionUVs=[];triangles=[];hullLength=0;path;color=new it(1,1,1,1);sourceMesh=null;edges=[];width=0;height=0;tempColor=new it(0,0,0,0);constructor(t,s){super(t),this.sequence=s}copy(){if(this.sourceMesh)return this.newLinkedMesh();const t=new Ii(this.name,this.sequence.copy());return t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=[],O.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.triangles=[],O.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges&&(t.edges=[],O.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t}updateSequence(){this.sequence.update(this)}getSourceMesh(){return this.sourceMesh}setSourceMesh(t){this.sourceMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength,this.edges=t.edges,this.width=t.width,this.height=t.height)}newLinkedMesh(){const t=new Ii(this.name,this.sequence.copy());return t.timelineAttachment=this.timelineAttachment,t.path=this.path,t.color.setFromColor(this.color),t.setSourceMesh(this.sourceMesh?this.sourceMesh:this),t.updateSequence(),t}static computeUVs(t,s,i){if(!t)throw new Error("Region not set.");const n=i.length;let r=t.u,a=t.v,h=0,c=0;if(t instanceof hs){const o=t.page,l=o.width,d=o.height;switch(t.degrees){case 90:r-=(t.originalHeight-t.offsetY-t.height)/l,a-=(t.originalWidth-t.offsetX-t.width)/d,h=t.originalHeight/l,c=t.originalWidth/d;for(let m=0;m<n;m+=2)i[m]=r+s[m+1]*h,i[m+1]=a+(1-s[m])*c;return;case 180:r-=(t.originalWidth-t.offsetX-t.width)/l,a-=t.offsetY/d,h=t.originalWidth/l,c=t.originalHeight/d;for(let m=0;m<n;m+=2)i[m]=r+(1-s[m])*h,i[m+1]=a+(1-s[m+1])*c;return;case 270:r-=t.offsetY/l,a-=t.offsetX/d,h=t.originalHeight/l,c=t.originalWidth/d;for(let m=0;m<n;m+=2)i[m]=r+(1-s[m+1])*h,i[m+1]=a+s[m]*c;return;default:r-=t.offsetX/l,a-=(t.originalHeight-t.offsetY-t.height)/d,h=t.originalWidth/l,c=t.originalHeight/d}}else t?(h=t.u2-r,c=t.v2-a):(r=a=0,h=c=1);for(let o=0;o<n;o+=2)i[o]=r+s[o]*h,i[o+1]=a+s[o+1]*c}},zt=class Sn extends ds{sequence;x=0;y=0;scaleX=1;scaleY=1;rotation=0;width=0;height=0;path;color=new it(1,1,1,1);tempColor=new it(1,1,1,1);constructor(t,s){super(t),this.sequence=s}copy(){const t=new Sn(this.name,this.sequence.copy());return t.path=this.path,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,t.color.setFromColor(this.color),t}computeWorldVertices(t,s,i,n,r){const a=t.bone.appliedPose,h=a.worldX,c=a.worldY,o=a.a,l=a.b,d=a.c,m=a.d;let f=s[0],u=s[1];i[n]=f*o+u*l+h,i[n+1]=f*d+u*m+c,n+=r,f=s[2],u=s[3],i[n]=f*o+u*l+h,i[n+1]=f*d+u*m+c,n+=r,f=s[4],u=s[5],i[n]=f*o+u*l+h,i[n+1]=f*d+u*m+c,n+=r,f=s[6],u=s[7],i[n]=f*o+u*l+h,i[n+1]=f*d+u*m+c}getOffsets(t){return this.sequence.offsets[this.sequence.resolveIndex(t)]}updateSequence(){this.sequence.update(this)}static computeUVs(t,s,i,n,r,a,h,c,o,l){if(!t)throw new Error("Region not set.");const d=h/t.originalWidth*n,m=c/t.originalHeight*r,f=-h/2*n+t.offsetX*d,u=-c/2*r+t.offsetY*m,p=f+t.width*d,g=u+t.height*m,x=a*B.degRad,b=Math.cos(x),w=Math.sin(x),v=f*b+s,y=f*w,T=u*b+i,A=u*w,S=p*b+s,C=p*w,I=g*b+i,Y=g*w;o[0]=v-A,o[1]=T+y,o[2]=v-Y,o[3]=I+y,o[4]=S-Y,o[5]=I+C,o[6]=S-A,o[7]=T+C,t==null?(l[0]=0,l[1]=0,l[2]=0,l[3]=1,l[4]=1,l[5]=1,l[6]=1,l[7]=0):(l[1]=t.v2,l[2]=t.u,l[5]=t.v,l[6]=t.u2,t.degrees===90?(l[0]=t.u2,l[3]=t.v2,l[4]=t.u,l[7]=t.v):(l[0]=t.u,l[3]=t.v,l[4]=t.u2,l[7]=t.v2))}static X1=0;static Y1=1;static C1R=2;static C1G=3;static C1B=4;static C1A=5;static U1=6;static V1=7;static X2=8;static Y2=9;static C2R=10;static C2G=11;static C2B=12;static C2A=13;static U2=14;static V2=15;static X3=16;static Y3=17;static C3R=18;static C3G=19;static C3B=20;static C3A=21;static U3=22;static V3=23;static X4=24;static Y4=25;static C4R=26;static C4G=27;static C4B=28;static C4A=29;static U4=30;static V4=31},ge=class ns{static _nextID=0;id=ns.nextID();regions;pathSuffix;uvs;offsets;start=0;digits=0;setupIndex=0;constructor(t,s){this.regions=new Array(t),this.pathSuffix=s}copy(){const t=this.regions.length,s=new ns(t,this.pathSuffix);if(O.arrayCopy(this.regions,0,s.regions,0,t),s.start=this.start,s.digits=this.digits,s.setupIndex=this.setupIndex,this.uvs!=null){const i=this.uvs[0].length;s.uvs=[];for(let n=0;n<t;n++)s.uvs[n]=O.newFloatArray(i),O.arrayCopy(this.uvs[n],0,s.uvs[n],0,i)}if(this.offsets!=null){s.offsets=[];for(let i=0;i<t;i++)s.offsets[i]=[],O.arrayCopy(this.offsets[i],0,s.offsets[i],0,8)}return s}update(t){const s=this.regions.length;if(t instanceof zt){this.uvs=[],this.offsets=[];for(let i=0;i<s;i++)this.uvs[i]=O.newFloatArray(8),this.offsets[i]=[],zt.computeUVs(this.regions[i],t.x,t.y,t.scaleX,t.scaleY,t.rotation,t.width,t.height,this.offsets[i],this.uvs[i])}else if(t instanceof Ut){const i=t.regionUVs;this.uvs=[],this.offsets=void 0;for(let n=0;n<s;n++)this.uvs[n]=O.newFloatArray(i.length),Ut.computeUVs(this.regions[n],i,this.uvs[n])}}resolveIndex(t){let s=t.sequenceIndex;return s===-1&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1),s}getUVs(t){return this.uvs[t]}hasPathSuffix(){return this.pathSuffix}getPath(t,s){if(!this.pathSuffix)return t;let i=t;const n=(this.start+s).toString();for(let r=this.digits-n.length;r>0;r--)i+="0";return i+=n,i}static nextID(){return ns._nextID++}},fs=(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))(fs||{}),us=[0,1,2,3,4,5,6],Re=class{name;timelines=[];timelineIds;bones;color=new it(1,1,1,1);duration;constructor(e,t,s){if(!e)throw new Error("name cannot be null.");this.name=e,this.duration=s,this.timelineIds=new Pi,this.bones=[],this.setTimelines(t)}setTimelines(e){if(!e)throw new Error("timelines cannot be null.");this.timelines=e;const t=e.length;this.timelineIds.clear(),this.bones.length=0;const s=new Set,i=e;for(let n=0;n<t;n++){const r=i[n];this.timelineIds.addAll(r.propertyIds),Di(r)&&s.add(r.boneIndex)&&this.bones.push(r.boneIndex)}}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,n,r,a,h,c,o){if(!e)throw new Error("skeleton cannot be null.");i&&this.duration!==0&&(s%=this.duration,t>0&&(t%=this.duration));const l=this.timelines;for(let d=0,m=l.length;d<m;d++)l[d].apply(e,t,s,n,r,a,h,c,o)}},Oi=(e=>(e[e.current=0]="current",e[e.setup=1]="setup",e[e.first=2]="first",e))(Oi||{}),Ui=(e=>(e[e.rotate=0]="rotate",e[e.x=1]="x",e[e.y=2]="y",e[e.scaleX=3]="scaleX",e[e.scaleY=4]="scaleY",e[e.shearX=5]="shearX",e[e.shearY=6]="shearY",e[e.inherit=7]="inherit",e[e.rgb=8]="rgb",e[e.alpha=9]="alpha",e[e.rgb2=10]="rgb2",e[e.attachment=11]="attachment",e[e.deform=12]="deform",e[e.event=13]="event",e[e.drawOrder=14]="drawOrder",e[e.drawOrderFolder=15]="drawOrderFolder",e[e.ikConstraint=16]="ikConstraint",e[e.transformConstraint=17]="transformConstraint",e[e.pathConstraintPosition=18]="pathConstraintPosition",e[e.pathConstraintSpacing=19]="pathConstraintSpacing",e[e.pathConstraintMix=20]="pathConstraintMix",e[e.physicsConstraintInertia=21]="physicsConstraintInertia",e[e.physicsConstraintStrength=22]="physicsConstraintStrength",e[e.physicsConstraintDamping=23]="physicsConstraintDamping",e[e.physicsConstraintMass=24]="physicsConstraintMass",e[e.physicsConstraintWind=25]="physicsConstraintWind",e[e.physicsConstraintGravity=26]="physicsConstraintGravity",e[e.physicsConstraintMix=27]="physicsConstraintMix",e[e.physicsConstraintReset=28]="physicsConstraintReset",e[e.sequence=29]="sequence",e[e.sliderTime=30]="sliderTime",e[e.sliderMix=31]="sliderMix",e))(Ui||{}),gt=class{propertyIds;frames;additive=!1;instant=!1;constructor(e,...t){this.propertyIds=t,this.frames=O.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 search(e,t,s=1){const i=e.length;for(let n=s;n<i;n+=s)if(e[n]>t)return n-s;return i-s}};function Ni(e){return typeof e=="object"&&e!==null&&typeof e.slotIndex=="number"}var qt=class extends gt{curves;constructor(e,t,...s){super(e,...s),this.curves=O.newFloatArray(e+t*18),this.curves[e-1]=1}setLinear(e){this.curves[e]=0}setStepped(e){this.curves[e]=1}shrink(e){const t=this.getFrameCount()+e*18;if(this.curves.length>t){const s=O.newFloatArray(t);O.arrayCopy(this.curves,0,s,0,t),this.curves=s}}setBezier(e,t,s,i,n,r,a,h,c,o,l){const d=this.curves;let m=this.getFrameCount()+e*18;s===0&&(d[t]=2+m);const f=(i-r*2+h)*.03,u=(n-a*2+c)*.03,p=((r-h)*3-i+o)*.006,g=((a-c)*3-n+l)*.006;let x=f*2+p,b=u*2+g,w=(r-i)*.3+f+p*.16666667,v=(a-n)*.3+u+g*.16666667,y=i+w,T=n+v;for(let A=m+18;m<A;m+=2)d[m]=y,d[m+1]=T,w+=x,v+=b,x+=p,b+=g,y+=w,T+=v}getBezierValue(e,t,s,i){const n=this.curves;if(n[i]>e){const c=this.frames[t],o=this.frames[t+s];return o+(e-c)/(n[i]-c)*(n[i+1]-o)}const r=i+18;for(i+=2;i<r;i+=2)if(n[i]>=e){const c=n[i-2],o=n[i-1];return o+(e-c)/(n[i]-c)*(n[i+1]-o)}t+=this.getFrameEntries();const a=n[r-2],h=n[r-1];return h+(e-a)/(this.frames[t]-a)*(this.frames[t+s]-h)}},pe=class Ie extends qt{constructor(t,s,i){super(t,s,i)}getFrameEntries(){return 2}setFrame(t,s,i){t<<=1,this.frames[t]=s,this.frames[t+1]=i}getCurveValue(t){const s=this.frames;let i=s.length-2;for(let r=2;r<=i;r+=2)if(s[r]>t){i=r-2;break}const n=this.curves[i>>1];switch(n){case 0:{const r=s[i],a=s[i+1];return a+(t-r)/(s[i+2]-r)*(s[i+2+1]-a)}case 1:return s[i+1]}return this.getBezierValue(t,i,1,n-2)}getRelativeValue(t,s,i,n,r,a){if(t<this.frames[0])return Ie.beforeFirstKey(i,s,r,a);const h=this.getCurveValue(t);return i===1?a+h*s:r+(n?h:h+a-r)*s}getAbsoluteValue(t,s,i,n,r,a,h){return h===void 0?this.getAbsoluteValue1(t,s,i,n,r,a):this.getAbsoluteValue2(t,s,i,n,r,a,h)}getAbsoluteValue1(t,s,i,n,r,a){if(t<this.frames[0])return Ie.beforeFirstKey(i,s,r,a);const h=this.getCurveValue(t);return i===1?a+(n?h:h-a)*s:r+(n?h:h-r)*s}getAbsoluteValue2(t,s,i,n,r,a,h){return t<this.frames[0]?Ie.beforeFirstKey(i,s,r,a):i===1?a+(n?h:h-a)*s:r+(n?h:h-r)*s}getScaleValue(t,s,i,n,r,a,h){if(t<this.frames[0])return Ie.beforeFirstKey(i,s,a,h);const c=this.getCurveValue(t)*h;if(s===1&&!n)return c;let o=i===1?h:a;return n?o+(c-h)*s:r?o+(Math.abs(c)*Math.sign(o)-o)*s:(o=Math.abs(o)*Math.sign(c),o+(c-o)*s)}static beforeFirstKey(t,s,i,n){switch(t){case 1:return n;case 2:return i+(n-i)*s;case 0:return i}}};function Di(e){return typeof e=="object"&&e!==null&&typeof e.boneIndex=="number"}var Wt=class extends pe{boneIndex;constructor(e,t,s,i){super(e,t,`${i}|${s}`),this.boneIndex=s,this.additive=!0}apply(e,t,s,i,n,r,a,h,c){const o=e.bones[this.boneIndex];o.active&&this.apply1(c?o.appliedPose:o.pose,o.data.setupPose,s,n,r,a,h)}},Fe=class extends qt{boneIndex;constructor(e,t,s,i,n){super(e,t,`${i}|${s}`,`${n}|${s}`),this.boneIndex=s,this.additive=!0}getFrameEntries(){return 3}setFrame(e,t,s,i){e*=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i}apply(e,t,s,i,n,r,a,h,c){const o=e.bones[this.boneIndex];o.active&&this.apply1(c?o.appliedPose:o.pose,o.data.setupPose,s,n,r,a,h)}},xe=class extends Wt{constructor(e,t,s){super(e,t,s,0)}apply1(e,t,s,i,n,r,a){e.rotation=this.getRelativeValue(s,i,n,r,e.rotation,t.rotation)}},ms=class extends Fe{constructor(e,t,s){super(e,t,s,1,2)}apply1(e,t,s,i,n,r,a){const h=this.frames;if(s<h[0]){switch(n){case 1:e.x=t.x,e.y=t.y;break;case 2:e.x+=(t.x-e.x)*i,e.y+=(t.y-e.y)*i;break}return}let c=0,o=0;const l=gt.search(h,s,3),d=this.curves[l/3];switch(d){case 0:{const m=h[l];c=h[l+1],o=h[l+2];const f=(s-m)/(h[l+3]-m);c+=(h[l+3+1]-c)*f,o+=(h[l+3+2]-o)*f;break}case 1:c=h[l+1],o=h[l+2];break;default:c=this.getBezierValue(s,l,1,d-2),o=this.getBezierValue(s,l,2,d+18-2)}n===1?(e.x=t.x+c*i,e.y=t.y+o*i):r?(e.x+=c*i,e.y+=o*i):(e.x+=(t.x+c-e.x)*i,e.y+=(t.y+o-e.y)*i)}},gs=class extends Wt{constructor(e,t,s){super(e,t,s,1)}apply1(e,t,s,i,n,r,a){e.x=this.getRelativeValue(s,i,n,r,e.x,t.x)}},ps=class extends Wt{constructor(e,t,s){super(e,t,s,2)}apply1(e,t,s,i,n,r,a){e.y=this.getRelativeValue(s,i,n,r,e.y,t.y)}},xs=class extends Fe{constructor(e,t,s){super(e,t,s,3,4)}apply1(e,t,s,i,n,r,a){const h=this.frames;if(s<h[0]){switch(n){case 1:e.scaleX=t.scaleX,e.scaleY=t.scaleY;break;case 2:e.scaleX+=(t.scaleX-e.scaleX)*i,e.scaleY+=(t.scaleY-e.scaleY)*i;break}return}let c,o;const l=gt.search(h,s,3),d=this.curves[l/3];switch(d){case 0:{const m=h[l];c=h[l+1],o=h[l+2];const f=(s-m)/(h[l+3]-m);c+=(h[l+3+1]-c)*f,o+=(h[l+3+2]-o)*f;break}case 1:c=h[l+1],o=h[l+2];break;default:c=this.getBezierValue(s,l,1,d-2),o=this.getBezierValue(s,l,2,d+18-2)}if(c*=t.scaleX,o*=t.scaleY,i===1&&!r)e.scaleX=c,e.scaleY=o;else{let m=0,f=0;n===1?(m=t.scaleX,f=t.scaleY):(m=e.scaleX,f=e.scaleY),r?(e.scaleX=m+(c-t.scaleX)*i,e.scaleY=f+(o-t.scaleY)*i):a?(e.scaleX=m+(Math.abs(c)*Math.sign(m)-m)*i,e.scaleY=f+(Math.abs(o)*Math.sign(f)-f)*i):(m=Math.abs(m)*Math.sign(c),f=Math.abs(f)*Math.sign(o),e.scaleX=m+(c-m)*i,e.scaleY=f+(o-f)*i)}}},bs=class extends Wt{constructor(e,t,s){super(e,t,s,3)}apply1(e,t,s,i,n,r,a){e.scaleX=this.getScaleValue(s,i,n,r,a,e.scaleX,t.scaleX)}},ws=class extends Wt{constructor(e,t,s){super(e,t,s,4)}apply1(e,t,s,i,n,r,a){e.scaleY=this.getScaleValue(s,i,n,r,a,e.scaleY,t.scaleY)}},ys=class extends Fe{constructor(e,t,s){super(e,t,s,5,6)}apply1(e,t,s,i,n,r,a){const h=this.frames;if(s<h[0]){switch(n){case 1:e.shearX=t.shearX,e.shearY=t.shearY;break;case 2:e.shearX+=(t.shearX-e.shearX)*i,e.shearY+=(t.shearY-e.shearY)*i;break}return}let c=0,o=0;const l=gt.search(h,s,3),d=this.curves[l/3];switch(d){case 0:{const m=h[l];c=h[l+1],o=h[l+2];const f=(s-m)/(h[l+3]-m);c+=(h[l+3+1]-c)*f,o+=(h[l+3+2]-o)*f;break}case 1:c=h[l+1],o=h[l+2];break;default:c=this.getBezierValue(s,l,1,d-2),o=this.getBezierValue(s,l,2,d+18-2)}n===1?(e.shearX=t.shearX+c*i,e.shearY=t.shearY+o*i):r?(e.shearX+=c*i,e.shearY+=o*i):(e.shearX+=(t.shearX+c-e.shearX)*i,e.shearY+=(t.shearY+o-e.shearY)*i)}},vs=class extends Wt{constructor(e,t,s){super(e,t,s,5)}apply1(e,t,s,i,n,r,a){e.shearX=this.getRelativeValue(s,i,n,r,e.shearX,t.shearX)}},Ts=class extends Wt{constructor(e,t,s){super(e,t,s,6)}apply1(e,t,s,i,n,r,a){e.shearY=this.getRelativeValue(s,i,n,r,e.shearY,t.shearY)}},As=class extends gt{boneIndex;constructor(e,t){super(e,`7|${t}`),this.boneIndex=t,this.instant=!0}getFrameEntries(){return 2}setFrame(e,t,s){e*=2,this.frames[e]=t,this.frames[e+1]=s}apply(e,t,s,i,n,r,a,h,c){const o=e.bones[this.boneIndex];if(!o.active)return;const l=c?o.appliedPose:o.pose;if(h)r!==0&&(l.inherit=o.data.setupPose.inherit);else{const d=this.frames;s<d[0]?r!==0&&(l.inherit=o.data.setupPose.inherit):l.inherit=this.frames[gt.search(d,s,2)+1]}}},be=class extends qt{slotIndex;constructor(e,t,s,...i){super(e,t,...i),this.slotIndex=s}apply(e,t,s,i,n,r,a,h,c){const o=e.slots[this.slotIndex];o.bone.active&&this.apply1(o,c?o.appliedPose:o.pose,s,n,r,a)}},Ss=class extends be{constructor(e,t,s){super(e,t,s,`8|${s}`,`9|${s}`)}getFrameEntries(){return 5}setFrame(e,t,s,i,n,r){e*=5,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=n,this.frames[e+4]=r}apply1(e,t,s,i,n,r){const a=t.color,h=this.frames;if(s<h[0]){const u=e.data.setupPose.color;switch(n){case 1:a.setFromColor(u);break;case 2:a.add((u.r-a.r)*i,(u.g-a.g)*i,(u.b-a.b)*i,(u.a-a.a)*i);break}return}let c=0,o=0,l=0,d=0;const m=gt.search(h,s,5),f=this.curves[m/5];switch(f){case 0:{const u=h[m];c=h[m+1],o=h[m+2],l=h[m+3],d=h[m+4];const p=(s-u)/(h[m+5]-u);c+=(h[m+5+1]-c)*p,o+=(h[m+5+2]-o)*p,l+=(h[m+5+3]-l)*p,d+=(h[m+5+4]-d)*p;break}case 1:c=h[m+1],o=h[m+2],l=h[m+3],d=h[m+4];break;default:c=this.getBezierValue(s,m,1,f-2),o=this.getBezierValue(s,m,2,f+18-2),l=this.getBezierValue(s,m,3,f+18*2-2),d=this.getBezierValue(s,m,4,f+18*3-2)}if(i===1)a.set(c,o,l,d);else if(n===1){const u=e.data.setupPose.color;a.set(u.r+(c-u.r)*i,u.g+(o-u.g)*i,u.b+(l-u.b)*i,u.a+(d-u.a)*i)}else a.add((c-a.r)*i,(o-a.g)*i,(l-a.b)*i,(d-a.a)*i)}},Cs=class extends be{constructor(e,t,s){super(e,t,s,`8|${s}`)}getFrameEntries(){return 4}setFrame(e,t,s,i,n){e<<=2,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=n}apply1(e,t,s,i,n,r){const a=t.color;let h=0,c=0,o=0;const l=this.frames;if(s<l[0]){const f=e.data.setupPose.color;switch(n){case 1:{a.r=f.r,a.g=f.g,a.b=f.b;break}case 2:{a.r+=(f.r-a.r)*i,a.g+=(f.g-a.g)*i,a.b+=(f.b-a.b)*i;break}}return}const d=gt.search(l,s,4),m=this.curves[d>>2];switch(m){case 0:{const f=l[d];h=l[d+1],c=l[d+2],o=l[d+3];const u=(s-f)/(l[d+4]-f);h+=(l[d+4+1]-h)*u,c+=(l[d+4+2]-c)*u,o+=(l[d+4+3]-o)*u;break}case 1:h=l[d+1],c=l[d+2],o=l[d+3];break;default:h=this.getBezierValue(s,d,1,m-2),c=this.getBezierValue(s,d,2,m+18-2),o=this.getBezierValue(s,d,3,m+18*2-2)}if(i!==1)if(n===1){const f=e.data.setupPose.color;h=f.r+(h-f.r)*i,c=f.g+(c-f.g)*i,o=f.b+(o-f.b)*i}else h=a.r+(h-a.r)*i,c=a.g+(c-a.g)*i,o=a.b+(o-a.b)*i;a.r=h<0?0:h>1?1:h,a.g=c<0?0:c>1?1:c,a.b=o<0?0:o>1?1:o}},Is=class extends pe{slotIndex=0;constructor(e,t,s){super(e,t,`9|${s}`),this.slotIndex=s}apply(e,t,s,i,n,r,a,h,c){const o=e.slots[this.slotIndex];if(!o.bone.active)return;const l=(c?o.appliedPose:o.pose).color;let d=0;const m=this.frames;if(s<m[0]){const f=o.data.setupPose.color.a;switch(r){case 1:l.a=f;break;case 2:l.a+=(f-l.a)*n;break}return}if(d=this.getCurveValue(s),n!==1)if(r===1){const f=o.data.setupPose.color;d=f.a+(d-f.a)*n}else d=l.a+(d-l.a)*n;l.a=d<0?0:d>1?1:d}},Ms=class extends be{constructor(e,t,s){super(e,t,s,`8|${s}`,`9|${s}`,`10|${s}`)}getFrameEntries(){return 8}setFrame(e,t,s,i,n,r,a,h,c){e<<=3,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=n,this.frames[e+4]=r,this.frames[e+5]=a,this.frames[e+6]=h,this.frames[e+7]=c}apply1(e,t,s,i,n,r){const a=t.color,h=t.darkColor;let c=0,o=0,l=0;const d=this.frames;if(s<d[0]){const b=e.data.setupPose,w=b.color,v=b.darkColor;switch(n){case 1:{a.setFromColor(w),h.r=v.r,h.g=v.g,h.b=v.b;break}case 2:{a.add((w.r-a.r)*i,(w.g-a.g)*i,(w.b-a.b)*i,(w.a-a.a)*i),h.r+=(v.r-h.r)*i,h.g+=(v.g-h.g)*i,h.b+=(v.b-h.b)*i;break}}return}let m=0,f=0,u=0,p=0;const g=gt.search(d,s,8),x=this.curves[g>>3];switch(x){case 0:{const b=d[g];m=d[g+1],f=d[g+2],u=d[g+3],p=d[g+4],c=d[g+5],o=d[g+6],l=d[g+7];const w=(s-b)/(d[g+8]-b);m+=(d[g+8+1]-m)*w,f+=(d[g+8+2]-f)*w,u+=(d[g+8+3]-u)*w,p+=(d[g+8+4]-p)*w,c+=(d[g+8+5]-c)*w,o+=(d[g+8+6]-o)*w,l+=(d[g+8+7]-l)*w;break}case 1:m=d[g+1],f=d[g+2],u=d[g+3],p=d[g+4],c=d[g+5],o=d[g+6],l=d[g+7];break;default:m=this.getBezierValue(s,g,1,x-2),f=this.getBezierValue(s,g,2,x+18-2),u=this.getBezierValue(s,g,3,x+18*2-2),p=this.getBezierValue(s,g,4,x+18*3-2),c=this.getBezierValue(s,g,5,x+18*4-2),o=this.getBezierValue(s,g,6,x+18*5-2),l=this.getBezierValue(s,g,7,x+18*6-2)}if(i===1)a.set(m,f,u,p);else if(n===1){const b=e.data.setupPose;let w=b.color;a.set(w.r+(m-w.r)*i,w.g+(f-w.g)*i,w.b+(u-w.b)*i,w.a+(p-w.a)*i),w=b.darkColor,c=w.r+(c-w.r)*i,o=w.g+(o-w.g)*i,l=w.b+(l-w.b)*i}else a.add((m-a.r)*i,(f-a.g)*i,(u-a.b)*i,(p-a.a)*i),c=h.r+(c-h.r)*i,o=h.g+(o-h.g)*i,l=h.b+(l-h.b)*i;h.r=c<0?0:c>1?1:c,h.g=o<0?0:o>1?1:o,h.b=l<0?0:l>1?1:l}},Es=class extends be{constructor(e,t,s){super(e,t,s,`8|${s}`,`10|${s}`)}getFrameEntries(){return 7}setFrame(e,t,s,i,n,r,a,h){e*=7,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=n,this.frames[e+4]=r,this.frames[e+5]=a,this.frames[e+6]=h}apply1(e,t,s,i,n,r){const a=t.color,h=t.darkColor;let c=0,o=0,l=0,d=0,m=0,f=0;const u=this.frames;if(s<u[0]){const x=e.data.setupPose,b=x.color,w=x.darkColor;switch(n){case 1:a.r=b.r,a.g=b.g,a.b=b.b,h.r=w.r,h.g=w.g,h.b=w.b;break;case 2:a.r+=(b.r-a.r)*i,a.g+=(b.g-a.g)*i,a.b+=(b.b-a.b)*i,h.r+=(w.r-h.r)*i,h.g+=(w.g-h.g)*i,h.b+=(w.b-h.b)*i;break}return}const p=gt.search(u,s,7),g=this.curves[p/7];switch(g){case 0:{const x=u[p];c=u[p+1],o=u[p+2],l=u[p+3],d=u[p+4],m=u[p+5],f=u[p+6];const b=(s-x)/(u[p+7]-x);c+=(u[p+7+1]-c)*b,o+=(u[p+7+2]-o)*b,l+=(u[p+7+3]-l)*b,d+=(u[p+7+4]-d)*b,m+=(u[p+7+5]-m)*b,f+=(u[p+7+6]-f)*b;break}case 1:c=u[p+1],o=u[p+2],l=u[p+3],d=u[p+4],m=u[p+5],f=u[p+6];break;default:c=this.getBezierValue(s,p,1,g-2),o=this.getBezierValue(s,p,2,g+18-2),l=this.getBezierValue(s,p,3,g+18*2-2),d=this.getBezierValue(s,p,4,g+18*3-2),m=this.getBezierValue(s,p,5,g+18*4-2),f=this.getBezierValue(s,p,6,g+18*5-2)}if(i!==1)if(n===1){const x=e.data.setupPose;let b=x.color;c=b.r+(c-b.r)*i,o=b.g+(o-b.g)*i,l=b.b+(l-b.b)*i,b=x.darkColor,d=b.r+(d-b.r)*i,m=b.g+(m-b.g)*i,f=b.b+(f-b.b)*i}else c=a.r+(c-a.r)*i,o=a.g+(o-a.g)*i,l=a.b+(l-a.b)*i,d=h.r+(d-h.r)*i,m=h.g+(m-h.g)*i,f=h.b+(f-h.b)*i;a.r=c<0?0:c>1?1:c,a.g=o<0?0:o>1?1:o,a.b=l<0?0:l>1?1:l,h.r=d<0?0:d>1?1:d,h.g=m<0?0:m>1?1:m,h.b=f<0?0:f>1?1:f}},ie=class extends gt{slotIndex=0;attachmentNames;constructor(e,t){super(e,`11|${t}`),this.slotIndex=t,this.attachmentNames=new Array(e),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.attachmentNames[e]=s}apply(e,t,s,i,n,r,a,h,c){const o=e.slots[this.slotIndex];if(!o.bone.active)return;const l=c?o.appliedPose:o.pose;h||s<this.frames[0]?r!==0&&this.setAttachment(e,l,o.data.attachmentName):this.setAttachment(e,l,this.attachmentNames[gt.search(this.frames,s)])}setAttachment(e,t,s){t.setAttachment(s?e.getAttachment(this.slotIndex,s):null)}},Ys=class extends qt{slotIndex;attachment;vertices;constructor(e,t,s,i){super(e,t,`12|${s}|${i.id}`),this.slotIndex=s,this.attachment=i,this.vertices=new Array(e),this.additive=!0}getFrameCount(){return this.frames.length}setFrame(e,t,s){this.frames[e]=t,this.vertices[e]=s}setBezier(e,t,s,i,n,r,a,h,c,o,l){const d=this.curves;let m=this.getFrameCount()+e*18;s===0&&(d[t]=2+m);const f=(i-r*2+h)*.03,u=c*.03-a*.06,p=((r-h)*3-i+o)*.006,g=(a-c+.33333333)*.018;let x=f*2+p,b=u*2+g,w=(r-i)*.3+f+p*.16666667,v=a*.3+u+g*.16666667,y=i+w,T=v;for(let A=m+18;m<A;m+=2)d[m]=y,d[m+1]=T,w+=x,v+=b,x+=p,b+=g,y+=w,T+=v}getCurvePercent(e,t){const s=this.curves;let i=s[t];switch(i){case 0:{const h=this.frames[t];return(e-h)/(this.frames[t+this.getFrameEntries()]-h)}case 1:return 0}if(i-=2,s[i]>e){const h=this.frames[t];return s[i+1]*(e-h)/(s[i]-h)}const n=i+18;for(i+=2;i<n;i+=2)if(s[i]>=e){const h=s[i-2],c=s[i-1];return c+(e-h)/(s[i]-h)*(s[i+1]-c)}const r=s[n-2],a=s[n-1];return a+(1-a)*(e-r)/(this.frames[t+this.getFrameEntries()]-r)}apply(e,t,s,i,n,r,a,h,c){const o=e.slots;if(!this.attachment.isTimelineActive(o,this.slotIndex,c))return;const l=this.attachment.timelineSlots,d=this.frames;if(s<d[0]){this.applyBeforeFirst(o[this.slotIndex],c,n,r);for(const g of l)this.applyBeforeFirst(o[g],c,n,r);return}let m,f,u;if(s>=d[d.length-1])u=0,m=this.vertices[d.length-1],f=null;else{const g=gt.search(d,s);u=this.getCurvePercent(s,g),m=this.vertices[g],f=this.vertices[g+1]}const p=this.vertices[0].length;this.applyToSlot(o[this.slotIndex],c,m,f,u,p,n,r,a);for(const g of l)this.applyToSlot(o[g],c,m,f,u,p,n,r,a)}applyBeforeFirst(e,t,s,i){if(!e.bone.active)return;const n=t?e.appliedPose:e.pose;if(n.attachment==null||n.attachment.timelineAttachment!==this.attachment)return;const r=n.deform;switch(r.length===0&&(i=1),i){case 1:r.length=0;break;case 2:{if(s===1){r.length=0;return}const a=this.vertices[0].length;r.length=a;const h=r,c=n.attachment;if(c.bones===null){const o=c.vertices;for(let l=0;l<a;l++)h[l]+=(o[l]-h[l])*s}else{s=1-s;for(let o=0;o<a;o++)h[o]*=s}}}}applyToSlot(e,t,s,i,n,r,a,h,c){if(!e.bone.active)return;const o=t?e.appliedPose:e.pose;if(o.attachment===null||o.attachment.timelineAttachment!==this.attachment)return;const l=o.attachment,d=o.deform;d.length===0&&(h=1);const m=h===1;if(d.length=r,i===null)if(a===1)if(c&&!m)if(l.bones)for(let f=0;f<r;f++)d[f]+=s[f];else{const f=l.vertices;for(let u=0;u<r;u++)d[u]+=s[u]-f[u]}else O.arrayCopy(s,0,d,0,r);else if(m)if(l.bones)for(let f=0;f<r;f++)d[f]=s[f]*a;else{const f=l.vertices;for(let u=0;u<r;u++){const p=f[u];d[u]=p+(s[u]-p)*a}}else if(c)if(l.bones)for(let f=0;f<r;f++)d[f]+=s[f]*a;else{const f=l.vertices;for(let u=0;u<r;u++)d[u]+=(s[u]-f[u])*a}else for(let f=0;f<r;f++)d[f]+=(s[f]-d[f])*a;else if(a===1)if(c&&!m)if(l.bones)for(let f=0;f<r;f++){const u=s[f];d[f]+=u+(i[f]-u)*n}else{const f=l.vertices;for(let u=0;u<r;u++){const p=s[u];d[u]+=p+(i[u]-p)*n-f[u]}}else if(n===0)O.arrayCopy(s,0,d,0,r);else for(let f=0;f<r;f++){const u=s[f];d[f]=u+(i[f]-u)*n}else if(m)if(l.bones)for(let f=0;f<r;f++){const u=s[f];d[f]=(u+(i[f]-u)*n)*a}else{const f=l.vertices;for(let u=0;u<r;u++){const p=s[u],g=f[u];d[u]=g+(p+(i[u]-p)*n-g)*a}}else if(c)if(l.bones)for(let f=0;f<r;f++){const u=s[f];d[f]+=(u+(i[f]-u)*n)*a}else{const f=l.vertices;for(let u=0;u<r;u++){const p=s[u];d[u]+=(p+(i[u]-p)*n-f[u])*a}}else for(let f=0;f<r;f++){const u=s[f];d[f]+=(u+(i[f]-u)*n-d[f])*a}}},Rs=class Ht extends gt{static ENTRIES=3;static MODE=1;static DELAY=2;slotIndex;attachment;constructor(t,s,i){super(t,`29|${s}|${i.sequence.id}`),this.slotIndex=s,this.attachment=i,this.instant=!0}getFrameEntries(){return Ht.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,s,i,n,r){const a=this.frames;t*=Ht.ENTRIES,a[t]=s,a[t+Ht.MODE]=i|n<<4,a[t+Ht.DELAY]=r}apply(t,s,i,n,r,a,h,c,o){const l=t.slots;if(!this.attachment.isTimelineActive(l,this.slotIndex,o))return;const d=this.attachment.timelineSlots,m=this.frames;if(c||i<m[0]){if(a!==0){this.setupPose(l[this.slotIndex],o);for(const x of d)this.setupPose(l[x],o)}return}const f=gt.search(m,i,Ht.ENTRIES),u=m[f],p=m[f+Ht.MODE],g=m[f+Ht.DELAY];this.applyToSlot(l[this.slotIndex],o,i,u,p,g);for(const x of d)this.applyToSlot(l[x],o,i,u,p,g)}setupPose(t,s){if(!t.bone.active)return;const i=s?t.appliedPose:t.pose;i.attachment===null||i.attachment.timelineAttachment!==this.attachment||(i.sequenceIndex=-1)}applyToSlot(t,s,i,n,r,a){if(!t.bone.active)return;const h=s?t.appliedPose:t.pose;if(h.attachment===null||h.attachment.timelineAttachment!==this.attachment)return;let c=r>>4,o=h.attachment.sequence.regions.length;const l=us[r&15];if(l!==0)switch(c+=(i-n)/a+1e-5|0,l){case 1:c=Math.min(o-1,c);break;case 2:c%=o;break;case 3:{const d=(o<<1)-2;c=d===0?0:c%d,c>=o&&(c=d-c);break}case 4:c=Math.max(o-1-c,0);break;case 5:c=o-1-c%o;break;case 6:{const d=(o<<1)-2;c=d===0?0:(c+o-1)%d,c>=o&&(c=d-c)}}h.sequenceIndex=c}},Le=class Cn extends gt{static propertyIds=["13"];events;constructor(t){super(t,...Cn.propertyIds),this.events=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s.time,this.events[t]=s}apply(t,s,i,n,r,a,h,c,o){if(!n)return;const l=this.frames,d=this.frames.length;if(s>i)this.apply(null,s,Number.MAX_VALUE,n,0,a,!1,!1,!1),s=-1;else if(s>=l[d-1])return;if(i<l[0])return;let m=0;if(s<l[0])m=0;else{m=gt.search(l,s)+1;const f=l[m];for(;m>0&&l[m-1]===f;)m--}for(;m<d&&i>=l[m];m++)n.push(this.events[m])}},jt=class Mi extends gt{static propertyID="14";static propertyIds=[Mi.propertyID];drawOrders;constructor(t){super(t,...Mi.propertyIds),this.drawOrders=new Array(t),this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s,i){this.frames[t]=s,this.drawOrders[t]=i}apply(t,s,i,n,r,a,h,c,o){const l=o?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(c||i<this.frames[0]){a!==0&&O.arrayCopy(d,0,l,0,t.slots.length);return}const m=this.drawOrders[gt.search(this.frames,i)];if(!m)O.arrayCopy(d,0,l,0,t.slots.length);else for(let f=0,u=m.length;f<u;f++)l[f]=d[m[f]]}},we=class Ei extends gt{static propertyID="15";slots;inFolder;drawOrders;constructor(t,s,i){super(t,...Ei.propertyIds(s)),this.slots=s,this.drawOrders=new Array(t),this.inFolder=new Array(i);for(const n of s)this.inFolder[n]=!0;this.instant=!0}static propertyIds(t){const s=t.length,i=new Array(s);for(let n=0;n<s;n++)i[n]=`${Ei.propertyID}|${t[n]}`;return i}getFrameCount(){return this.frames.length}getSlots(){return this.slots}getDrawOrders(){return this.drawOrders}setFrame(t,s,i){this.frames[t]=s,this.drawOrders[t]=i}apply(t,s,i,n,r,a,h,c,o){const l=o?t.drawOrder.appliedPose:t.drawOrder.pose,d=t.slots;if(c||i<this.frames[0])a!==0&&this.setup(l,d);else{const m=this.drawOrders[gt.search(this.frames,i)];if(!m)this.setup(l,d);else{const f=this.inFolder,u=this.slots;for(let p=0,g=0,x=u.length;!(f[l[p].data.index]&&(l[p]=d[u[m[g]]],++g===x));p++);}}}setup(t,s){const{inFolder:i,slots:n}=this;for(let r=0,a=0,h=n.length;!(i[t[r].data.index]&&(t[r]=s[n[a]],++a===h));r++);}};function zi(e){return typeof e=="object"&&e!==null&&typeof e.constraintIndex=="number"}var Fs=class extends qt{constraintIndex=0;constructor(e,t,s){super(e,t,`16|${s}`),this.constraintIndex=s}getFrameEntries(){return 6}setFrame(e,t,s,i,n,r,a){e*=6,this.frames[e]=t,this.frames[e+1]=s,this.frames[e+2]=i,this.frames[e+3]=n,this.frames[e+4]=r?1:0,this.frames[e+5]=a?1:0}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(!o.active)return;const l=c?o.appliedPose:o.pose,d=this.frames;if(s<d[0]){const x=o.data.setupPose;switch(r){case 1:{l.mix=x.mix,l.softness=x.softness,l.bendDirection=x.bendDirection,l.compress=x.compress,l.stretch=x.stretch;break}case 2:{l.mix+=(x.mix-l.mix)*n,l.softness+=(x.softness-l.softness)*n,l.bendDirection=x.bendDirection,l.compress=x.compress,l.stretch=x.stretch;break}}return}let m=0,f=0;const u=gt.search(d,s,6),p=this.curves[u/6];switch(p){case 0:{const x=d[u];m=d[u+1],f=d[u+2];const b=(s-x)/(d[u+6]-x);m+=(d[u+6+1]-m)*b,f+=(d[u+6+2]-f)*b;break}case 1:m=d[u+1],f=d[u+2];break;default:m=this.getBezierValue(s,u,1,p-2),f=this.getBezierValue(s,u,2,p+18-2)}const g=r===1?o.data.setupPose:l;l.mix=g.mix+(m-g.mix)*n,l.softness=g.softness+(f-g.softness)*n,h?r===1&&(l.bendDirection=g.bendDirection,l.compress=g.compress,l.stretch=g.stretch):(l.bendDirection=d[u+3],l.compress=d[u+4]!==0,l.stretch=d[u+5]!==0)}},Ls=class extends qt{constraintIndex=0;constructor(e,t,s){super(e,t,`17|${s}`),this.constraintIndex=s,this.additive=!0}getFrameEntries(){return 7}setFrame(e,t,s,i,n,r,a,h){const c=this.frames;e*=7,c[e]=t,c[e+1]=s,c[e+2]=i,c[e+3]=n,c[e+4]=r,c[e+5]=a,c[e+6]=h}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(!o.active)return;const l=c?o.appliedPose:o.pose,d=this.frames;if(s<d[0]){const y=o.data.setupPose;switch(r){case 1:{l.mixRotate=y.mixRotate,l.mixX=y.mixX,l.mixY=y.mixY,l.mixScaleX=y.mixScaleX,l.mixScaleY=y.mixScaleY,l.mixShearY=y.mixShearY;break}case 2:{l.mixRotate+=(y.mixRotate-l.mixRotate)*n,l.mixX+=(y.mixX-l.mixX)*n,l.mixY+=(y.mixY-l.mixY)*n,l.mixScaleX+=(y.mixScaleX-l.mixScaleX)*n,l.mixScaleY+=(y.mixScaleY-l.mixScaleY)*n,l.mixShearY+=(y.mixShearY-l.mixShearY)*n;break}}return}let m,f,u,p,g,x;const b=gt.search(d,s,7),w=this.curves[b/7];switch(w){case 0:{const y=d[b];m=d[b+1],f=d[b+2],u=d[b+3],p=d[b+4],g=d[b+5],x=d[b+6];const T=(s-y)/(d[b+7]-y);m+=(d[b+7+1]-m)*T,f+=(d[b+7+2]-f)*T,u+=(d[b+7+3]-u)*T,p+=(d[b+7+4]-p)*T,g+=(d[b+7+5]-g)*T,x+=(d[b+7+6]-x)*T;break}case 1:m=d[b+1],f=d[b+2],u=d[b+3],p=d[b+4],g=d[b+5],x=d[b+6];break;default:m=this.getBezierValue(s,b,1,w-2),f=this.getBezierValue(s,b,2,w+18-2),u=this.getBezierValue(s,b,3,w+18*2-2),p=this.getBezierValue(s,b,4,w+18*3-2),g=this.getBezierValue(s,b,5,w+18*4-2),x=this.getBezierValue(s,b,6,w+18*5-2)}const v=r===1?o.data.setupPose:l;a?(l.mixRotate=v.mixRotate+m*n,l.mixX=v.mixX+f*n,l.mixY=v.mixY+u*n,l.mixScaleX=v.mixScaleX+p*n,l.mixScaleY=v.mixScaleY+g*n,l.mixShearY=v.mixShearY+x*n):(l.mixRotate=v.mixRotate+(m-v.mixRotate)*n,l.mixX=v.mixX+(f-v.mixX)*n,l.mixY=v.mixY+(u-v.mixY)*n,l.mixScaleX=v.mixScaleX+(p-v.mixScaleX)*n,l.mixScaleY=v.mixScaleY+(g-v.mixScaleY)*n,l.mixShearY=v.mixShearY+(x-v.mixShearY)*n)}},ne=class extends pe{constraintIndex;constructor(e,t,s,i){super(e,t,`${i}|${s}`),this.constraintIndex=s}},Ps=class extends ne{constructor(e,t,s){super(e,t,s,18),this.additive=!0}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(o.active){const l=c?o.appliedPose:o.pose;l.position=this.getAbsoluteValue(s,n,r,a,l.position,o.data.setupPose.position)}}},Xs=class extends ne{constructor(e,t,s){super(e,t,s,19)}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(o.active){const l=c?o.appliedPose:o.pose;l.spacing=this.getAbsoluteValue(s,n,r,!1,l.spacing,o.data.setupPose.spacing)}}},ks=class extends qt{constraintIndex;constructor(e,t,s){super(e,t,`20|${s}`),this.constraintIndex=s}getFrameEntries(){return 4}setFrame(e,t,s,i,n){const r=this.frames;e<<=2,r[e]=t,r[e+1]=s,r[e+2]=i,r[e+3]=n}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(!o.active)return;const l=c?o.appliedPose:o.pose,d=this.frames;if(s<d[0]){const b=o.data.setupPose;switch(r){case 1:{l.mixRotate=b.mixRotate,l.mixX=b.mixX,l.mixY=b.mixY;break}case 2:{l.mixRotate+=(b.mixRotate-l.mixRotate)*n,l.mixX+=(b.mixX-l.mixX)*n,l.mixY+=(b.mixY-l.mixY)*n;break}}return}let m,f,u;const p=gt.search(d,s,4),g=this.curves[p>>2];switch(g){case 0:{const b=d[p];m=d[p+1],f=d[p+2],u=d[p+3];const w=(s-b)/(d[p+4]-b);m+=(d[p+4+1]-m)*w,f+=(d[p+4+2]-f)*w,u+=(d[p+4+3]-u)*w;break}case 1:m=d[p+1],f=d[p+2],u=d[p+3];break;default:m=this.getBezierValue(s,p,1,g-2),f=this.getBezierValue(s,p,2,g+18-2),u=this.getBezierValue(s,p,3,g+18*2-2)}const x=r===1?o.data.setupPose:l;a?(l.mixRotate=x.mixRotate+m*n,l.mixX=x.mixX+f*n,l.mixY=x.mixY+u*n):(l.mixRotate=x.mixRotate+(m-x.mixRotate)*n,l.mixX=x.mixX+(f-x.mixX)*n,l.mixY=x.mixY+(u-x.mixY)*n)}},Nt=class extends ne{constructor(e,t,s,i){super(e,t,s,i)}apply(e,t,s,i,n,r,a,h,c){if(a&&!this.additive&&(a=!1),this.constraintIndex===-1){const o=s>=this.frames[0]?this.getCurveValue(s):0,l=e.physics;for(const d of l)if(d.active&&this.global(d.data)){const m=c?d.appliedPose:d.pose;this.set(m,this.getAbsoluteValue(s,n,r,a,this.get(m),this.get(d.data.setupPose),o))}}else{const o=e.constraints[this.constraintIndex];if(o.active){const l=c?o.appliedPose:o.pose;this.set(l,this.getAbsoluteValue(s,n,r,a,this.get(l),this.get(o.data.setupPose)))}}}},Vs=class extends Nt{constructor(e,t,s){super(e,t,s,21)}get(e){return e.inertia}set(e,t){e.inertia=t}global(e){return e.inertiaGlobal}},Bs=class extends Nt{constructor(e,t,s){super(e,t,s,22)}get(e){return e.strength}set(e,t){e.strength=t}global(e){return e.strengthGlobal}},Os=class extends Nt{constructor(e,t,s){super(e,t,s,23)}get(e){return e.damping}set(e,t){e.damping=t}global(e){return e.dampingGlobal}},Us=class extends Nt{constructor(e,t,s){super(e,t,s,24)}get(e){return 1/e.massInverse}set(e,t){e.massInverse=1/t}global(e){return e.massGlobal}},Ns=class extends Nt{constructor(e,t,s){super(e,t,s,25),this.additive=!0}get(e){return e.wind}set(e,t){e.wind=t}global(e){return e.windGlobal}},Ds=class extends Nt{constructor(e,t,s){super(e,t,s,26),this.additive=!0}get(e){return e.gravity}set(e,t){e.gravity=t}global(e){return e.gravityGlobal}},zs=class extends Nt{constructor(e,t,s){super(e,t,s,27)}get(e){return e.mix}set(e,t){e.mix=t}global(e){return e.mixGlobal}},qs=class In extends gt{static propertyIds=["28"];constraintIndex;constructor(t,s){super(t,...In.propertyIds),this.constraintIndex=s,this.instant=!0}getFrameCount(){return this.frames.length}setFrame(t,s){this.frames[t]=s}apply(t,s,i,n,r,a,h,c,o){let l;if(this.constraintIndex!==-1&&(l=t.constraints[this.constraintIndex],!l.active))return;const d=this.frames;if(s>i)this.apply(t,s,Number.MAX_VALUE,[],r,a,!1,!1,!1),s=-1;else if(s>=d[d.length-1])return;if(!(i<d[0])&&(s<d[0]||i>=d[gt.search(d,s)+1]))if(l!=null)l.reset(t);else for(const m of t.physics)m.active&&m.reset(t)}},Ws=class extends ne{constructor(e,t,s){super(e,t,s,30)}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(o.active){const l=c?o.appliedPose:o.pose;l.time=this.getAbsoluteValue(s,n,r,a,l.time,o.data.setupPose.time)}}},Gs=class extends ne{constructor(e,t,s){super(e,t,s,31),this.additive=!0}apply(e,t,s,i,n,r,a,h,c){const o=e.constraints[this.constraintIndex];if(o.active){const l=c?o.appliedPose:o.pose;l.mix=this.getAbsoluteValue(s,n,r,a,l.mix,o.data.setupPose.mix)}}},qn=class Yi{static emptyAnimation=new Re("<empty>",[],0);data;tracks=[];timeScale=1;unkeyedState=0;events=[];listeners=[];queue=new Wi(this);propertyIds=new Map;animationsChanged=!1;trackEntryPool=new me(()=>new qi);constructor(t){this.data=t}update(t){t*=this.timeScale;const s=this.tracks;for(let i=0,n=s.length;i<n;i++){const r=s[i];if(!r)continue;r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;let a=t*r.timeScale;if(r.delay>0){if(r.delay-=a,r.delay>0)continue;a=-r.delay,r.delay=0}let h=r.next;if(h){const c=r.trackLast-h.delay;if(c>=0){for(h.delay=0,h.trackTime+=r.timeScale===0?0:(c/r.timeScale+t)*h.timeScale,r.trackTime+=a,this.setTrack(i,h,!0);h.mixingFrom;)h.mixTime+=t,h=h.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){s[i]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){let c=r.mixingFrom;for(r.mixingFrom=null,c&&(c.mixingTo=null);c;)this.queue.end(c),c=c.mixingFrom}r.trackTime+=a}this.queue.drain()}updateMixingFrom(t,s){const i=t.mixingFrom;if(!i)return!0;const n=this.updateMixingFrom(i,s);if(i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,t.nextTrackLast!==-1&&t.mixTime>=t.mixDuration){if(i.totalAlpha===0||t.mixDuration===0){if(t.mixingFrom=i.mixingFrom,i.mixingFrom!=null&&(i.mixingFrom.mixingTo=t),i.totalAlpha===0)for(let r=t;r.mixingTo!=null;r=r.mixingTo)r.keepHold=!0;this.queue.end(i)}return n}return i.trackTime+=s*i.timeScale,t.mixTime+=s,!1}apply(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();const s=this.events,i=this.tracks;let n=!1;for(let h=0,c=i.length;h<c;h++){const o=i[h];if(!o||o.delay>0)continue;n=!0;let l=o.alpha;o.mixingFrom?l*=this.applyMixingFrom(o,t):o.trackTime>=o.trackEnd&&!o.next&&(l=0);let d=o.animationLast,m=o.getAnimationTime(),f=m,u=s;o.reverse&&(f=o.animation.duration-f,u=null);const p=o.animation.timelines,g=p.length;if(h===0&&l===1)for(let x=0;x<g;x++){O.webkit602BugfixHelper(l);const b=p[x];b instanceof ie?this.applyAttachmentTimeline(b,t,f,1,!0):b.apply(t,d,f,u,l,1,!1,!1,!1)}else{const x=o.timelineMode,b=l>=o.alphaAttachmentThreshold,w=o.additive,v=w||o.shortestRotation,y=!v&&o.timelinesRotation.length!==g<<1;y&&(o.timelinesRotation.length=g<<1);for(let T=0;T<g;T++){const A=p[T],S=x[T]&js;!v&&A instanceof xe?this.applyRotateT