var spine;!function(t){t.IntSet=class{constructor(){this.array=new Array}add(t){let e=this.contains(t);return this.array[0|t]=0|t,!e}contains(t){return null!=this.array[0|t]}remove(t){this.array[0|t]=void 0}clear(){this.array.length=0}};t.StringSet=class{constructor(){this.entries={},this.size=0}add(t){let e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}addAll(t){let e=this.size;for(var s=0,i=t.length;s<i;s++)this.add(t[s]);return e!=this.size}contains(t){return this.entries[t]}clear(){this.entries={},this.size=0}};class e{constructor(t=0,e=0,s=0,i=0){this.r=t,this.g=e,this.b=s,this.a=i}set(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,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=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}add(t,e,s,i){return this.r+=t,this.g+=e,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(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}static rgb888ToColor(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}toRgb888(){const t=t=>("0"+(255*t).toString(16)).slice(-2);return Number("0x"+t(this.r)+t(this.g)+t(this.b))}static fromString(t){return(new e).setFromString(t)}}e.WHITE=new e(1,1,1,1),e.RED=new e(1,0,0,1),e.GREEN=new e(0,1,0,1),e.BLUE=new e(0,0,1,1),e.MAGENTA=new e(1,0,1,1),t.Color=e;class s{static clamp(t,e,s){return t<e?e:t>s?s:t}static cosDeg(t){return Math.cos(t*s.degRad)}static sinDeg(t){return Math.sin(t*s.degRad)}static atan2Deg(t,e){return Math.atan2(t,e)*s.degRad}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){let e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}static randomTriangular(t,e){return s.randomTriangularWith(t,e,.5*(t+e))}static randomTriangularWith(t,e,s){let i=Math.random(),n=e-t;return i<=(s-t)/n?t+Math.sqrt(i*n*(s-t)):e-Math.sqrt((1-i)*n*(e-s))}static isPowerOfTwo(t){return t&&!(t&t-1)}}s.PI=3.1415927,s.PI2=2*s.PI,s.invPI2=1/s.PI2,s.radiansToDegrees=180/s.PI,s.radDeg=s.radiansToDegrees,s.degreesToRadians=s.PI/180,s.degRad=s.degreesToRadians,t.MathUtils=s;class i{apply(t,e,s){return t+(e-t)*this.applyInternal(s)}}t.Interpolation=i;class n extends i{constructor(t){super(),this.power=2,this.power=t}applyInternal(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}t.Pow=n;t.PowOut=class extends n{constructor(t){super(t)}applyInternal(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}};class a{static arrayCopy(t,e,s,i,n){for(let a=e,r=i;a<e+n;a++,r++)s[r]=t[a]}static arrayFill(t,e,s,i){for(let n=e;n<s;n++)t[n]=i}static setArraySize(t,e,s=0){let i=t.length;if(i==e)return t;if(t.length=e,i<e)for(let n=i;n<e;n++)t[n]=s;return t}static ensureArrayCapacity(t,e,s=0){return t.length>=e?t:a.setArraySize(t,e,s)}static newArray(t,e){let s=new Array(t);for(let i=0;i<t;i++)s[i]=e;return s}static newFloatArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static newShortArray(t){if(a.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);{let e=new Array(t);for(let t=0;t<e.length;t++)e[t]=0;return e}}static toFloatArray(t){return a.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t}static toSinglePrecision(t){return a.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t}static webkit602BugfixHelper(t,e){}static contains(t,e,s=!0){for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1}static enumValue(t,e){return t[e[0].toUpperCase()+e.slice(1)]}}a.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t.Utils=a;t.DebugUtils=class{static logBones(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e];console.log(s.data.name+", "+s.a+", "+s.b+", "+s.c+", "+s.d+", "+s.worldX+", "+s.worldY)}}};t.Pool=class{constructor(t){this.items=new Array,this.instantiator=t}obtain(){return this.items.length>0?this.items.pop():this.instantiator()}free(t){t.reset&&t.reset(),this.items.push(t)}freeAll(t){for(let e=0;e<t.length;e++)this.free(t[e])}clear(){this.items.length=0}};t.Vector2=class{constructor(t=0,e=0){this.x=t,this.y=e}set(t,e){return this.x=t,this.y=e,this}length(){let t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}normalize(){let t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}};t.TimeKeeper=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 t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}};t.WindowedMean=class{constructor(t=32){this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}hasEnoughData(){return this.addedValues>=this.values.length}addValue(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0}getMean(){if(this.hasEnoughData()){if(this.dirty){let t=0;for(let e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0}}}(spine||(spine={})),function(t){let e,s;t.Animation=class{constructor(e,s,i){if(this.timelines=[],this.timelineIds=new t.StringSet,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(s),this.duration=i}setTimelines(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e<t.length;e++)this.timelineIds.addAll(t[e].getPropertyIds())}hasTimeline(t){for(let e=0;e<t.length;e++)if(this.timelineIds.contains(t[e]))return!0;return!1}apply(t,e,s,i,n,a,r,o){if(!t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(s%=this.duration,e>0&&(e%=this.duration));let l=this.timelines;for(let i=0,h=l.length;i<h;i++)l[i].apply(t,e,s,n,a,r,o)}},function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(s=t.MixDirection||(t.MixDirection={}));const i={rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28};class n{constructor(e,s){this.propertyIds=s,this.frames=t.Utils.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(t,e){let s=t.length;for(let i=1;i<s;i++)if(t[i]>e)return i-1;return s-1}static search(t,e,s){let i=t.length;for(let n=s;n<i;n+=s)if(t[n]>e)return n-s;return i-s}}t.Timeline=n;class a extends n{constructor(e,s,i){super(e,i),this.curves=t.Utils.newFloatArray(e+18*s),this.curves[e-1]=1}setLinear(t){this.curves[t]=0}setStepped(t){this.curves[t]=1}shrink(e){let s=this.getFrameCount()+18*e;if(this.curves.length>s){let e=t.Utils.newFloatArray(s);t.Utils.arrayCopy(this.curves,0,e,0,s),this.curves=e}}setBezier(t,e,s,i,n,a,r,o,l,h,c){let d=this.curves,u=this.getFrameCount()+18*t;0==s&&(d[e]=2+u);let m=.03*(i-2*a+o),f=.03*(n-2*r+l),g=.006*(3*(a-o)-i+h),p=.006*(3*(r-l)-n+c),x=2*m+g,w=2*f+p,b=.3*(a-i)+m+.16666667*g,y=.3*(r-n)+f+.16666667*p,M=i+b,S=n+y;for(let t=u+18;u<t;u+=2)d[u]=M,d[u+1]=S,b+=x,y+=w,x+=g,w+=p,M+=b,S+=y}getBezierValue(t,e,s,i){let n=this.curves;if(n[i]>t){let a=this.frames[e],r=this.frames[e+s];return r+(t-a)/(n[i]-a)*(n[i+1]-r)}let a=i+18;for(i+=2;i<a;i+=2)if(n[i]>=t){let e=n[i-2],s=n[i-1];return s+(t-e)/(n[i]-e)*(n[i+1]-s)}e+=this.getFrameEntries();let r=n[a-2],o=n[a-1];return o+(t-r)/(this.frames[e]-r)*(this.frames[e+s]-o)}}t.CurveTimeline=a;class r extends a{constructor(t,e,s){super(t,e,[s])}getFrameEntries(){return 2}setFrame(t,e,s){t<<=1,this.frames[t]=e,this.frames[t+1]=s}getCurveValue(t){let e=this.frames,s=e.length-2;for(let i=2;i<=s;i+=2)if(e[i]>t){s=i-2;break}let i=this.curves[s>>1];switch(i){case 0:let i=e[s],n=e[s+1];return n+(t-i)/(e[s+2]-i)*(e[s+2+1]-n);case 1:return e[s+1]}return this.getBezierValue(t,s,1,i-2)}getRelativeValue(t,s,i,n,a){if(t<this.frames[0]){switch(i){case e.setup:return a;case e.first:return n+(a-n)*s}return n}let r=this.getCurveValue(t);switch(i){case e.setup:return a+r*s;case e.first:case e.replace:r+=a-n}return n+r*s}getAbsoluteValue(t,s,i,n,a){if(t<this.frames[0]){switch(i){case e.setup:return a;case e.first:return n+(a-n)*s}return n}let r=this.getCurveValue(t);return i==e.setup?a+(r-a)*s:n+(r-n)*s}getAbsoluteValue2(t,s,i,n,a,r){if(t<this.frames[0]){switch(i){case e.setup:return a;case e.first:return n+(a-n)*s}return n}return i==e.setup?a+(r-a)*s:n+(r-n)*s}getScaleValue(i,n,a,r,o,l){if(i<this.frames[0]){switch(a){case e.setup:return l;case e.first:return o+(l-o)*n}return o}let h=this.getCurveValue(i)*l;if(1==n)return a==e.add?o+h-l:h;if(r==s.mixOut)switch(a){case e.setup:return l+(Math.abs(h)*t.MathUtils.signum(l)-l)*n;case e.first:case e.replace:return o+(Math.abs(h)*t.MathUtils.signum(o)-o)*n}else{let s=0;switch(a){case e.setup:return s=Math.abs(l)*t.MathUtils.signum(h),s+(h-s)*n;case e.first:case e.replace:return s=Math.abs(o)*t.MathUtils.signum(h),s+(h-s)*n}}return o+(h-l)*n}}t.CurveTimeline1=r;class o extends a{constructor(t,e,s,i){super(t,e,[s,i])}getFrameEntries(){return 3}setFrame(t,e,s,i){t*=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i}}t.CurveTimeline2=o;t.RotateTimeline=class extends r{constructor(t,e,s){super(t,e,i.rotate+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.rotation=this.getRelativeValue(s,n,a,o.rotation,o.data.rotation))}};t.TranslateTimeline=class extends o{constructor(t,e,s){super(t,e,i.x+"|"+s,i.y+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,i,a,r,o,l){let h=t.bones[this.boneIndex];if(!h.active)return;let c=this.frames;if(i<c[0]){switch(o){case e.setup:return h.x=h.data.x,void(h.y=h.data.y);case e.first:h.x+=(h.data.x-h.x)*r,h.y+=(h.data.y-h.y)*r}return}let d=0,u=0,m=n.search(c,i,3),f=this.curves[m/3];switch(f){case 0:let t=c[m];d=c[m+1],u=c[m+2];let e=(i-t)/(c[m+3]-t);d+=(c[m+3+1]-d)*e,u+=(c[m+3+2]-u)*e;break;case 1:d=c[m+1],u=c[m+2];break;default:d=this.getBezierValue(i,m,1,f-2),u=this.getBezierValue(i,m,2,f+18-2)}switch(o){case e.setup:h.x=h.data.x+d*r,h.y=h.data.y+u*r;break;case e.first:case e.replace:h.x+=(h.data.x+d-h.x)*r,h.y+=(h.data.y+u-h.y)*r;break;case e.add:h.x+=d*r,h.y+=u*r}}};t.TranslateXTimeline=class extends r{constructor(t,e,s){super(t,e,i.x+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.x=this.getRelativeValue(s,n,a,o.x,o.data.x))}};t.TranslateYTimeline=class extends r{constructor(t,e,s){super(t,e,i.y+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.y=this.getRelativeValue(s,n,a,o.y,o.data.y))}};t.ScaleTimeline=class extends o{constructor(t,e,s){super(t,e,i.scaleX+"|"+s,i.scaleY+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(i,a,r,o,l,h,c){let d=i.bones[this.boneIndex];if(!d.active)return;let u,m,f=this.frames;if(r<f[0]){switch(h){case e.setup:return d.scaleX=d.data.scaleX,void(d.scaleY=d.data.scaleY);case e.first:d.scaleX+=(d.data.scaleX-d.scaleX)*l,d.scaleY+=(d.data.scaleY-d.scaleY)*l}return}let g=n.search(f,r,3),p=this.curves[g/3];switch(p){case 0:let t=f[g];u=f[g+1],m=f[g+2];let e=(r-t)/(f[g+3]-t);u+=(f[g+3+1]-u)*e,m+=(f[g+3+2]-m)*e;break;case 1:u=f[g+1],m=f[g+2];break;default:u=this.getBezierValue(r,g,1,p-2),m=this.getBezierValue(r,g,2,p+18-2)}if(u*=d.data.scaleX,m*=d.data.scaleY,1==l)h==e.add?(d.scaleX+=u-d.data.scaleX,d.scaleY+=m-d.data.scaleY):(d.scaleX=u,d.scaleY=m);else{let i=0,n=0;if(c==s.mixOut)switch(h){case e.setup:i=d.data.scaleX,n=d.data.scaleY,d.scaleX=i+(Math.abs(u)*t.MathUtils.signum(i)-i)*l,d.scaleY=n+(Math.abs(m)*t.MathUtils.signum(n)-n)*l;break;case e.first:case e.replace:i=d.scaleX,n=d.scaleY,d.scaleX=i+(Math.abs(u)*t.MathUtils.signum(i)-i)*l,d.scaleY=n+(Math.abs(m)*t.MathUtils.signum(n)-n)*l;break;case e.add:d.scaleX+=(u-d.data.scaleX)*l,d.scaleY+=(m-d.data.scaleY)*l}else switch(h){case e.setup:i=Math.abs(d.data.scaleX)*t.MathUtils.signum(u),n=Math.abs(d.data.scaleY)*t.MathUtils.signum(m),d.scaleX=i+(u-i)*l,d.scaleY=n+(m-n)*l;break;case e.first:case e.replace:i=Math.abs(d.scaleX)*t.MathUtils.signum(u),n=Math.abs(d.scaleY)*t.MathUtils.signum(m),d.scaleX=i+(u-i)*l,d.scaleY=n+(m-n)*l;break;case e.add:d.scaleX+=(u-d.data.scaleX)*l,d.scaleY+=(m-d.data.scaleY)*l}}}};t.ScaleXTimeline=class extends r{constructor(t,e,s){super(t,e,i.scaleX+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.scaleX=this.getScaleValue(s,n,a,r,o.scaleX,o.data.scaleX))}};t.ScaleYTimeline=class extends r{constructor(t,e,s){super(t,e,i.scaleY+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.scaleY=this.getScaleValue(s,n,a,r,o.scaleY,o.data.scaleY))}};t.ShearTimeline=class extends o{constructor(t,e,s){super(t,e,i.shearX+"|"+s,i.shearY+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,s,i,a,r,o,l){let h=t.bones[this.boneIndex];if(!h.active)return;let c=this.frames;if(i<c[0]){switch(o){case e.setup:return h.shearX=h.data.shearX,void(h.shearY=h.data.shearY);case e.first:h.shearX+=(h.data.shearX-h.shearX)*r,h.shearY+=(h.data.shearY-h.shearY)*r}return}let d=0,u=0,m=n.search(c,i,3),f=this.curves[m/3];switch(f){case 0:let t=c[m];d=c[m+1],u=c[m+2];let e=(i-t)/(c[m+3]-t);d+=(c[m+3+1]-d)*e,u+=(c[m+3+2]-u)*e;break;case 1:d=c[m+1],u=c[m+2];break;default:d=this.getBezierValue(i,m,1,f-2),u=this.getBezierValue(i,m,2,f+18-2)}switch(o){case e.setup:h.shearX=h.data.shearX+d*r,h.shearY=h.data.shearY+u*r;break;case e.first:case e.replace:h.shearX+=(h.data.shearX+d-h.shearX)*r,h.shearY+=(h.data.shearY+u-h.shearY)*r;break;case e.add:h.shearX+=d*r,h.shearY+=u*r}}};t.ShearXTimeline=class extends r{constructor(t,e,s){super(t,e,i.shearX+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.shearX=this.getRelativeValue(s,n,a,o.shearX,o.data.shearX))}};t.ShearYTimeline=class extends r{constructor(t,e,s){super(t,e,i.shearY+"|"+s),this.boneIndex=0,this.boneIndex=s}apply(t,e,s,i,n,a,r){let o=t.bones[this.boneIndex];o.active&&(o.shearY=this.getRelativeValue(s,n,a,o.shearY,o.data.shearY))}};t.InheritTimeline=class extends n{constructor(t,e){super(t,[i.inherit+"|"+e]),this.boneIndex=0,this.boneIndex=e}getFrameEntries(){return 2}setFrame(t,e,s){t*=2,this.frames[t]=e,this.frames[t+1]=s}apply(t,i,a,r,o,l,h){let c=t.bones[this.boneIndex];if(!c.active)return;if(h==s.mixOut)return void(l==e.setup&&(c.inherit=c.data.inherit));let d=this.frames;a<d[0]?l!=e.setup&&l!=e.first||(c.inherit=c.data.inherit):c.inherit=this.frames[n.search(d,a,2)+1]}};t.RGBATimeline=class extends a{constructor(t,e,s){super(t,e,[i.rgb+"|"+s,i.alpha+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 5}setFrame(t,e,s,i,n,a){t*=5,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=a}apply(t,s,i,a,r,o,l){let h=t.slots[this.slotIndex];if(!h.bone.active)return;let c=this.frames,d=h.color;if(i<c[0]){let t=h.data.color;switch(o){case e.setup:return void d.setFromColor(t);case e.first:d.add((t.r-d.r)*r,(t.g-d.g)*r,(t.b-d.b)*r,(t.a-d.a)*r)}return}let u=0,m=0,f=0,g=0,p=n.search(c,i,5),x=this.curves[p/5];switch(x){case 0:let t=c[p];u=c[p+1],m=c[p+2],f=c[p+3],g=c[p+4];let e=(i-t)/(c[p+5]-t);u+=(c[p+5+1]-u)*e,m+=(c[p+5+2]-m)*e,f+=(c[p+5+3]-f)*e,g+=(c[p+5+4]-g)*e;break;case 1:u=c[p+1],m=c[p+2],f=c[p+3],g=c[p+4];break;default:u=this.getBezierValue(i,p,1,x-2),m=this.getBezierValue(i,p,2,x+18-2),f=this.getBezierValue(i,p,3,x+36-2),g=this.getBezierValue(i,p,4,x+54-2)}1==r?d.set(u,m,f,g):(o==e.setup&&d.setFromColor(h.data.color),d.add((u-d.r)*r,(m-d.g)*r,(f-d.b)*r,(g-d.a)*r))}};t.RGBTimeline=class extends a{constructor(t,e,s){super(t,e,[i.rgb+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,i,n){t<<=2,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n}apply(t,s,i,a,r,o,l){let h=t.slots[this.slotIndex];if(!h.bone.active)return;let c=this.frames,d=h.color;if(i<c[0]){let t=h.data.color;switch(o){case e.setup:return d.r=t.r,d.g=t.g,void(d.b=t.b);case e.first:d.r+=(t.r-d.r)*r,d.g+=(t.g-d.g)*r,d.b+=(t.b-d.b)*r}return}let u=0,m=0,f=0,g=n.search(c,i,4),p=this.curves[g>>2];switch(p){case 0:let t=c[g];u=c[g+1],m=c[g+2],f=c[g+3];let e=(i-t)/(c[g+4]-t);u+=(c[g+4+1]-u)*e,m+=(c[g+4+2]-m)*e,f+=(c[g+4+3]-f)*e;break;case 1:u=c[g+1],m=c[g+2],f=c[g+3];break;default:u=this.getBezierValue(i,g,1,p-2),m=this.getBezierValue(i,g,2,p+18-2),f=this.getBezierValue(i,g,3,p+36-2)}if(1==r)d.r=u,d.g=m,d.b=f;else{if(o==e.setup){let t=h.data.color;d.r=t.r,d.g=t.g,d.b=t.b}d.r+=(u-d.r)*r,d.g+=(m-d.g)*r,d.b+=(f-d.b)*r}}};t.AlphaTimeline=class extends r{constructor(t,e,s){super(t,e,i.alpha+"|"+s),this.slotIndex=0,this.slotIndex=s}apply(t,s,i,n,a,r,o){let l=t.slots[this.slotIndex];if(!l.bone.active)return;let h=l.color;if(i<this.frames[0]){let t=l.data.color;switch(r){case e.setup:return void(h.a=t.a);case e.first:h.a+=(t.a-h.a)*a}return}let c=this.getCurveValue(i);1==a?h.a=c:(r==e.setup&&(h.a=l.data.color.a),h.a+=(c-h.a)*a)}};t.RGBA2Timeline=class extends a{constructor(t,e,s){super(t,e,[i.rgb+"|"+s,i.alpha+"|"+s,i.rgb2+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 8}setFrame(t,e,s,i,n,a,r,o,l){t<<=3,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=a,this.frames[t+5]=r,this.frames[t+6]=o,this.frames[t+7]=l}apply(t,s,i,a,r,o,l){let h=t.slots[this.slotIndex];if(!h.bone.active)return;let c=this.frames,d=h.color,u=h.darkColor;if(i<c[0]){let t=h.data.color,s=h.data.darkColor;switch(o){case e.setup:return d.setFromColor(t),u.r=s.r,u.g=s.g,void(u.b=s.b);case e.first:d.add((t.r-d.r)*r,(t.g-d.g)*r,(t.b-d.b)*r,(t.a-d.a)*r),u.r+=(s.r-u.r)*r,u.g+=(s.g-u.g)*r,u.b+=(s.b-u.b)*r}return}let m=0,f=0,g=0,p=0,x=0,w=0,b=0,y=n.search(c,i,8),M=this.curves[y>>3];switch(M){case 0:let t=c[y];m=c[y+1],f=c[y+2],g=c[y+3],p=c[y+4],x=c[y+5],w=c[y+6],b=c[y+7];let e=(i-t)/(c[y+8]-t);m+=(c[y+8+1]-m)*e,f+=(c[y+8+2]-f)*e,g+=(c[y+8+3]-g)*e,p+=(c[y+8+4]-p)*e,x+=(c[y+8+5]-x)*e,w+=(c[y+8+6]-w)*e,b+=(c[y+8+7]-b)*e;break;case 1:m=c[y+1],f=c[y+2],g=c[y+3],p=c[y+4],x=c[y+5],w=c[y+6],b=c[y+7];break;default:m=this.getBezierValue(i,y,1,M-2),f=this.getBezierValue(i,y,2,M+18-2),g=this.getBezierValue(i,y,3,M+36-2),p=this.getBezierValue(i,y,4,M+54-2),x=this.getBezierValue(i,y,5,M+72-2),w=this.getBezierValue(i,y,6,M+90-2),b=this.getBezierValue(i,y,7,M+108-2)}if(1==r)d.set(m,f,g,p),u.r=x,u.g=w,u.b=b;else{if(o==e.setup){d.setFromColor(h.data.color);let t=h.data.darkColor;u.r=t.r,u.g=t.g,u.b=t.b}d.add((m-d.r)*r,(f-d.g)*r,(g-d.b)*r,(p-d.a)*r),u.r+=(x-u.r)*r,u.g+=(w-u.g)*r,u.b+=(b-u.b)*r}}};t.RGB2Timeline=class extends a{constructor(t,e,s){super(t,e,[i.rgb+"|"+s,i.rgb2+"|"+s]),this.slotIndex=0,this.slotIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,i,n,a,r,o){t*=7,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=a,this.frames[t+5]=r,this.frames[t+6]=o}apply(t,s,i,a,r,o,l){let h=t.slots[this.slotIndex];if(!h.bone.active)return;let c=this.frames,d=h.color,u=h.darkColor;if(i<c[0]){let t=h.data.color,s=h.data.darkColor;switch(o){case e.setup:return d.r=t.r,d.g=t.g,d.b=t.b,u.r=s.r,u.g=s.g,void(u.b=s.b);case e.first:d.r+=(t.r-d.r)*r,d.g+=(t.g-d.g)*r,d.b+=(t.b-d.b)*r,u.r+=(s.r-u.r)*r,u.g+=(s.g-u.g)*r,u.b+=(s.b-u.b)*r}return}let m=0,f=0,g=0,p=0,x=0,w=0,b=n.search(c,i,7),y=this.curves[b/7];switch(y){case 0:let t=c[b];m=c[b+1],f=c[b+2],g=c[b+3],p=c[b+4],x=c[b+5],w=c[b+6];let e=(i-t)/(c[b+7]-t);m+=(c[b+7+1]-m)*e,f+=(c[b+7+2]-f)*e,g+=(c[b+7+3]-g)*e,p+=(c[b+7+4]-p)*e,x+=(c[b+7+5]-x)*e,w+=(c[b+7+6]-w)*e;break;case 1:m=c[b+1],f=c[b+2],g=c[b+3],p=c[b+4],x=c[b+5],w=c[b+6];break;default:m=this.getBezierValue(i,b,1,y-2),f=this.getBezierValue(i,b,2,y+18-2),g=this.getBezierValue(i,b,3,y+36-2),p=this.getBezierValue(i,b,4,y+54-2),x=this.getBezierValue(i,b,5,y+72-2),w=this.getBezierValue(i,b,6,y+90-2)}if(1==r)d.r=m,d.g=f,d.b=g,u.r=p,u.g=x,u.b=w;else{if(o==e.setup){let t=h.data.color,e=h.data.darkColor;d.r=t.r,d.g=t.g,d.b=t.b,u.r=e.r,u.g=e.g,u.b=e.b}d.r+=(m-d.r)*r,d.g+=(f-d.g)*r,d.b+=(g-d.b)*r,u.r+=(p-u.r)*r,u.g+=(x-u.g)*r,u.b+=(w-u.b)*r}}};t.AttachmentTimeline=class extends n{constructor(t,e){super(t,[i.attachment+"|"+e]),this.slotIndex=0,this.slotIndex=e,this.attachmentNames=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.attachmentNames[t]=s}apply(t,i,a,r,o,l,h){let c=t.slots[this.slotIndex];c.bone.active&&(h!=s.mixOut?a<this.frames[0]?l!=e.setup&&l!=e.first||this.setAttachment(t,c,c.data.attachmentName):this.setAttachment(t,c,this.attachmentNames[n.search1(this.frames,a)]):l==e.setup&&this.setAttachment(t,c,c.data.attachmentName))}setAttachment(t,e,s){e.setAttachment(s?t.getAttachment(this.slotIndex,s):null)}};t.DeformTimeline=class extends a{constructor(t,e,s,n){super(t,e,[i.deform+"|"+s+"|"+n.id]),this.slotIndex=0,this.slotIndex=s,this.attachment=n,this.vertices=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.vertices[t]=s}setBezier(t,e,s,i,n,a,r,o,l,h,c){let d=this.curves,u=this.getFrameCount()+18*t;0==s&&(d[e]=2+u);let m=.03*(i-2*a+o),f=.03*l-.06*r,g=.006*(3*(a-o)-i+h),p=.018*(r-l+.33333333),x=2*m+g,w=2*f+p,b=.3*(a-i)+m+.16666667*g,y=.3*r+f+.16666667*p,M=i+b,S=y;for(let t=u+18;u<t;u+=2)d[u]=M,d[u+1]=S,b+=x,y+=w,x+=g,w+=p,M+=b,S+=y}getCurvePercent(t,e){let s=this.curves,i=s[e];switch(i){case 0:let s=this.frames[e];return(t-s)/(this.frames[e+this.getFrameEntries()]-s);case 1:return 0}if(i-=2,s[i]>t){let n=this.frames[e];return s[i+1]*(t-n)/(s[i]-n)}let n=i+18;for(i+=2;i<n;i+=2)if(s[i]>=t){let e=s[i-2],n=s[i-1];return n+(t-e)/(s[i]-e)*(s[i+1]-n)}let a=s[n-2],r=s[n-1];return r+(1-r)*(t-a)/(this.frames[e+this.getFrameEntries()]-a)}apply(s,i,a,r,o,l,h){let c=s.slots[this.slotIndex];if(!c.bone.active)return;let d=c.getAttachment();if(!d)return;if(!(d instanceof t.VertexAttachment)||d.timelineAttachment!=this.attachment)return;let u=c.deform;0==u.length&&(l=e.setup);let m=this.vertices,f=m[0].length,g=this.frames;if(a<g[0]){switch(l){case e.setup:return void(u.length=0);case e.first:if(1==o)return void(u.length=0);u.length=f;let t=d;if(t.bones){o=1-o;for(p=0;p<f;p++)u[p]*=o}else{let e=t.vertices;for(var p=0;p<f;p++)u[p]+=(e[p]-u[p])*o}}return}if(u.length=f,a>=g[g.length-1]){let s=m[g.length-1];if(1==o)if(l==e.add){let t=d;if(t.bones)for(let t=0;t<f;t++)u[t]+=s[t];else{let e=t.vertices;for(let t=0;t<f;t++)u[t]+=s[t]-e[t]}}else t.Utils.arrayCopy(s,0,u,0,f);else switch(l){case e.setup:{let t=d;if(t.bones)for(let t=0;t<f;t++)u[t]=s[t]*o;else{let e=t.vertices;for(let t=0;t<f;t++){let i=e[t];u[t]=i+(s[t]-i)*o}}break}case e.first:case e.replace:for(let t=0;t<f;t++)u[t]+=(s[t]-u[t])*o;break;case e.add:let t=d;if(t.bones)for(let t=0;t<f;t++)u[t]+=s[t]*o;else{let e=t.vertices;for(let t=0;t<f;t++)u[t]+=(s[t]-e[t])*o}}return}let x=n.search1(g,a),w=this.getCurvePercent(a,x),b=m[x],y=m[x+1];if(1==o)if(l==e.add){let t=d;if(t.bones)for(let t=0;t<f;t++){let e=b[t];u[t]+=e+(y[t]-e)*w}else{let e=t.vertices;for(let t=0;t<f;t++){let s=b[t];u[t]+=s+(y[t]-s)*w-e[t]}}}else for(let t=0;t<f;t++){let e=b[t];u[t]=e+(y[t]-e)*w}else switch(l){case e.setup:{let t=d;if(t.bones)for(let t=0;t<f;t++){let e=b[t];u[t]=(e+(y[t]-e)*w)*o}else{let e=t.vertices;for(let t=0;t<f;t++){let s=b[t],i=e[t];u[t]=i+(s+(y[t]-s)*w-i)*o}}break}case e.first:case e.replace:for(let t=0;t<f;t++){let e=b[t];u[t]+=(e+(y[t]-e)*w-u[t])*o}break;case e.add:let t=d;if(t.bones)for(let t=0;t<f;t++){let e=b[t];u[t]+=(e+(y[t]-e)*w)*o}else{let e=t.vertices;for(let t=0;t<f;t++){let s=b[t];u[t]+=(s+(y[t]-s)*w-e[t])*o}}}}};class l extends n{constructor(t){super(t,l.propertyIds),this.events=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e.time,this.events[t]=e}apply(t,e,s,i,a,r,o){if(!i)return;let l=this.frames,h=this.frames.length;if(e>s)this.apply(t,e,Number.MAX_VALUE,i,a,r,o),e=-1;else if(e>=l[h-1])return;if(s<l[0])return;let c=0;if(e<l[0])c=0;else{c=n.search1(l,e)+1;let t=l[c];for(;c>0&&l[c-1]==t;)c--}for(;c<h&&s>=l[c];c++)i.push(this.events[c])}}l.propertyIds=[""+i.event],t.EventTimeline=l;class h extends n{constructor(t){super(t,h.propertyIds),this.drawOrders=new Array(t)}getFrameCount(){return this.frames.length}setFrame(t,e,s){this.frames[t]=e,this.drawOrders[t]=s}apply(i,a,r,o,l,h,c){if(c==s.mixOut)return void(h==e.setup&&t.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length));if(r<this.frames[0])return void(h!=e.setup&&h!=e.first||t.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length));let d=n.search1(this.frames,r),u=this.drawOrders[d];if(u){let t=i.drawOrder,e=i.slots;for(let s=0,i=u.length;s<i;s++)t[s]=e[u[s]]}else t.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length)}}h.propertyIds=[""+i.drawOrder],t.DrawOrderTimeline=h;t.IkConstraintTimeline=class extends a{constructor(t,e,s){super(t,e,[i.ikConstraint+"|"+s]),this.constraintIndex=0,this.constraintIndex=s}getFrameEntries(){return 6}setFrame(t,e,s,i,n,a,r){t*=6,this.frames[t]=e,this.frames[t+1]=s,this.frames[t+2]=i,this.frames[t+3]=n,this.frames[t+4]=a?1:0,this.frames[t+5]=r?1:0}apply(t,i,a,r,o,l,h){let c=t.ikConstraints[this.constraintIndex];if(!c.active)return;let d=this.frames;if(a<d[0]){switch(l){case e.setup:return c.mix=c.data.mix,c.softness=c.data.softness,c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,void(c.stretch=c.data.stretch);case e.first:c.mix+=(c.data.mix-c.mix)*o,c.softness+=(c.data.softness-c.softness)*o,c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,c.stretch=c.data.stretch}return}let u=0,m=0,f=n.search(d,a,6),g=this.curves[f/6];switch(g){case 0:let t=d[f];u=d[f+1],m=d[f+2];let e=(a-t)/(d[f+6]-t);u+=(d[f+6+1]-u)*e,m+=(d[f+6+2]-m)*e;break;case 1:u=d[f+1],m=d[f+2];break;default:u=this.getBezierValue(a,f,1,g-2),m=this.getBezierValue(a,f,2,g+18-2)}l==e.setup?(c.mix=c.data.mix+(u-c.data.mix)*o,c.softness=c.data.softness+(m-c.data.softness)*o,h==s.mixOut?(c.bendDirection=c.data.bendDirection,c.compress=c.data.compress,c.stretch=c.data.stretch):(c.bendDirection=d[f+3],c.compress=0!=d[f+4],c.stretch=0!=d[f+5])):(c.mix+=(u-c.mix)*o,c.softness+=(m-c.softness)*o,h==s.mixIn&&(c.bendDirection=d[f+3],c.compress=0!=d[f+4],c.stretch=0!=d[f+5]))}};t.TransformConstraintTimeline=class extends a{constructor(t,e,s){super(t,e,[i.transformConstraint+"|"+s]),this.constraintIndex=0,this.constraintIndex=s}getFrameEntries(){return 7}setFrame(t,e,s,i,n,a,r,o){let l=this.frames;l[t*=7]=e,l[t+1]=s,l[t+2]=i,l[t+3]=n,l[t+4]=a,l[t+5]=r,l[t+6]=o}apply(t,s,i,a,r,o,l){let h=t.transformConstraints[this.constraintIndex];if(!h.active)return;let c,d,u,m,f,g,p=this.frames;if(i<p[0]){let t=h.data;switch(o){case e.setup:return h.mixRotate=t.mixRotate,h.mixX=t.mixX,h.mixY=t.mixY,h.mixScaleX=t.mixScaleX,h.mixScaleY=t.mixScaleY,void(h.mixShearY=t.mixShearY);case e.first:h.mixRotate+=(t.mixRotate-h.mixRotate)*r,h.mixX+=(t.mixX-h.mixX)*r,h.mixY+=(t.mixY-h.mixY)*r,h.mixScaleX+=(t.mixScaleX-h.mixScaleX)*r,h.mixScaleY+=(t.mixScaleY-h.mixScaleY)*r,h.mixShearY+=(t.mixShearY-h.mixShearY)*r}return}let x=n.search(p,i,7),w=this.curves[x/7];switch(w){case 0:let t=p[x];c=p[x+1],d=p[x+2],u=p[x+3],m=p[x+4],f=p[x+5],g=p[x+6];let e=(i-t)/(p[x+7]-t);c+=(p[x+7+1]-c)*e,d+=(p[x+7+2]-d)*e,u+=(p[x+7+3]-u)*e,m+=(p[x+7+4]-m)*e,f+=(p[x+7+5]-f)*e,g+=(p[x+7+6]-g)*e;break;case 1:c=p[x+1],d=p[x+2],u=p[x+3],m=p[x+4],f=p[x+5],g=p[x+6];break;default:c=this.getBezierValue(i,x,1,w-2),d=this.getBezierValue(i,x,2,w+18-2),u=this.getBezierValue(i,x,3,w+36-2),m=this.getBezierValue(i,x,4,w+54-2),f=this.getBezierValue(i,x,5,w+72-2),g=this.getBezierValue(i,x,6,w+90-2)}if(o==e.setup){let t=h.data;h.mixRotate=t.mixRotate+(c-t.mixRotate)*r,h.mixX=t.mixX+(d-t.mixX)*r,h.mixY=t.mixY+(u-t.mixY)*r,h.mixScaleX=t.mixScaleX+(m-t.mixScaleX)*r,h.mixScaleY=t.mixScaleY+(f-t.mixScaleY)*r,h.mixShearY=t.mixShearY+(g-t.mixShearY)*r}else h.mixRotate+=(c-h.mixRotate)*r,h.mixX+=(d-h.mixX)*r,h.mixY+=(u-h.mixY)*r,h.mixScaleX+=(m-h.mixScaleX)*r,h.mixScaleY+=(f-h.mixScaleY)*r,h.mixShearY+=(g-h.mixShearY)*r}};t.PathConstraintPositionTimeline=class extends r{constructor(t,e,s){super(t,e,i.pathConstraintPosition+"|"+s),this.constraintIndex=0,this.constraintIndex=s}apply(t,e,s,i,n,a,r){let o=t.pathConstraints[this.constraintIndex];o.active&&(o.position=this.getAbsoluteValue(s,n,a,o.position,o.data.position))}};t.PathConstraintSpacingTimeline=class extends r{constructor(t,e,s){super(t,e,i.pathConstraintSpacing+"|"+s),this.constraintIndex=0,this.constraintIndex=s}apply(t,e,s,i,n,a,r){let o=t.pathConstraints[this.constraintIndex];o.active&&(o.spacing=this.getAbsoluteValue(s,n,a,o.spacing,o.data.spacing))}};t.PathConstraintMixTimeline=class extends a{constructor(t,e,s){super(t,e,[i.pathConstraintMix+"|"+s]),this.constraintIndex=0,this.constraintIndex=s}getFrameEntries(){return 4}setFrame(t,e,s,i,n){let a=this.frames;a[t<<=2]=e,a[t+1]=s,a[t+2]=i,a[t+3]=n}apply(t,s,i,a,r,o,l){let h=t.pathConstraints[this.constraintIndex];if(!h.active)return;let c,d,u,m=this.frames;if(i<m[0]){switch(o){case e.setup:return h.mixRotate=h.data.mixRotate,h.mixX=h.data.mixX,void(h.mixY=h.data.mixY);case e.first:h.mixRotate+=(h.data.mixRotate-h.mixRotate)*r,h.mixX+=(h.data.mixX-h.mixX)*r,h.mixY+=(h.data.mixY-h.mixY)*r}return}let f=n.search(m,i,4),g=this.curves[f>>2];switch(g){case 0:let t=m[f];c=m[f+1],d=m[f+2],u=m[f+3];let e=(i-t)/(m[f+4]-t);c+=(m[f+4+1]-c)*e,d+=(m[f+4+2]-d)*e,u+=(m[f+4+3]-u)*e;break;case 1:c=m[f+1],d=m[f+2],u=m[f+3];break;default:c=this.getBezierValue(i,f,1,g-2),d=this.getBezierValue(i,f,2,g+18-2),u=this.getBezierValue(i,f,3,g+36-2)}if(o==e.setup){let t=h.data;h.mixRotate=t.mixRotate+(c-t.mixRotate)*r,h.mixX=t.mixX+(d-t.mixX)*r,h.mixY=t.mixY+(u-t.mixY)*r}else h.mixRotate+=(c-h.mixRotate)*r,h.mixX+=(d-h.mixX)*r,h.mixY+=(u-h.mixY)*r}};class c extends r{constructor(t,e,s,i){super(t,e,i+"|"+s),this.constraintIndex=0,this.constraintIndex=s}apply(t,e,s,i,n,a,r){let o;if(-1==this.constraintIndex){const e=s>=this.frames[0]?this.getCurveValue(s):0;for(const i of t.physicsConstraints)i.active&&this.global(i.data)&&this.set(i,this.getAbsoluteValue2(s,n,a,this.get(i),this.setup(i),e))}else o=t.physicsConstraints[this.constraintIndex],o.active&&this.set(o,this.getAbsoluteValue(s,n,a,this.get(o),this.setup(o)))}}t.PhysicsConstraintTimeline=c;t.PhysicsConstraintInertiaTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintInertia)}setup(t){return t.data.inertia}get(t){return t.inertia}set(t,e){t.inertia=e}global(t){return t.inertiaGlobal}};t.PhysicsConstraintStrengthTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintStrength)}setup(t){return t.data.strength}get(t){return t.strength}set(t,e){t.strength=e}global(t){return t.strengthGlobal}};t.PhysicsConstraintDampingTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintDamping)}setup(t){return t.data.damping}get(t){return t.damping}set(t,e){t.damping=e}global(t){return t.dampingGlobal}};t.PhysicsConstraintMassTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintMass)}setup(t){return 1/t.data.massInverse}get(t){return 1/t.massInverse}set(t,e){t.massInverse=1/e}global(t){return t.massGlobal}};t.PhysicsConstraintWindTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintWind)}setup(t){return t.data.wind}get(t){return t.wind}set(t,e){t.wind=e}global(t){return t.windGlobal}};t.PhysicsConstraintGravityTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintGravity)}setup(t){return t.data.gravity}get(t){return t.gravity}set(t,e){t.gravity=e}global(t){return t.gravityGlobal}};t.PhysicsConstraintMixTimeline=class extends c{constructor(t,e,s){super(t,e,s,i.physicsConstraintMix)}setup(t){return t.data.mix}get(t){return t.mix}set(t,e){t.mix=e}global(t){return t.mixGlobal}};class d extends n{constructor(t,e){super(t,d.propertyIds),this.constraintIndex=e}getFrameCount(){return this.frames.length}setFrame(t,e){this.frames[t]=e}apply(t,e,s,i,a,r,o){let l;if(-1!=this.constraintIndex&&(l=t.physicsConstraints[this.constraintIndex],!l.active))return;const h=this.frames;if(e>s)this.apply(t,e,Number.MAX_VALUE,[],a,r,o),e=-1;else if(e>=h[h.length-1])return;if(!(s<h[0])&&(e<h[0]||s>=h[n.search1(h,e)+1]))if(null!=l)l.reset();else for(const e of t.physicsConstraints)e.active&&e.reset()}}d.propertyIds=[i.physicsConstraintReset.toString()],t.PhysicsConstraintResetTimeline=d;class u extends n{constructor(t,e,s){super(t,[i.sequence+"|"+e+"|"+s.sequence.id]),this.slotIndex=e,this.attachment=s}getFrameEntries(){return u.ENTRIES}getSlotIndex(){return this.slotIndex}getAttachment(){return this.attachment}setFrame(t,e,s,i,n){let a=this.frames;a[t*=u.ENTRIES]=e,a[t+u.MODE]=s|i<<4,a[t+u.DELAY]=n}apply(s,i,a,r,o,l,h){let c=s.slots[this.slotIndex];if(!c.bone.active)return;let d=c.attachment,m=this.attachment;if(!(d==m||d instanceof t.VertexAttachment&&d.timelineAttachment==m))return;let f=this.frames;if(a<f[0])return void(l!=e.setup&&l!=e.first||(c.sequenceIndex=-1));let g=n.search(f,a,u.ENTRIES),p=f[g],x=f[g+u.MODE],w=f[g+u.DELAY];if(!this.attachment.sequence)return;let b=x>>4,y=this.attachment.sequence.regions.length,M=t.SequenceModeValues[15&x];if(M!=t.SequenceMode.hold)switch(b+=(a-p)/w+1e-5|0,M){case t.SequenceMode.once:b=Math.min(y-1,b);break;case t.SequenceMode.loop:b%=y;break;case t.SequenceMode.pingpong:{let t=(y<<1)-2;b=0==t?0:b%t,b>=y&&(b=t-b);break}case t.SequenceMode.onceReverse:b=Math.max(y-1-b,0);break;case t.SequenceMode.loopReverse:b=y-1-b%y;break;case t.SequenceMode.pingpongReverse:{let t=(y<<1)-2;b=0==t?0:(b+y-1)%t,b>=y&&(b=t-b)}}c.sequenceIndex=b}}u.ENTRIES=3,u.MODE=1,u.DELAY=2,t.SequenceTimeline=u}(spine||(spine={})),function(t){class e{constructor(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new i(this),this.propertyIDs=new t.StringSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool(()=>new s),this.data=e}static emptyAnimation(){return e._emptyAnimation}update(t){t*=this.timeScale;let e=this.tracks;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(!i)continue;i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast;let n=t*i.timeScale;if(i.delay>0){if(i.delay-=n,i.delay>0)continue;n=-i.delay,i.delay=0}let a=i.next;if(a){let e=i.trackLast-a.delay;if(e>=0){for(a.delay=0,a.trackTime+=0==i.timeScale?0:(e/i.timeScale+t)*a.timeScale,i.trackTime+=n,this.setCurrent(s,a,!0);a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&!i.mixingFrom){e[s]=null,this.queue.end(i),this.clearNext(i);continue}if(i.mixingFrom&&this.updateMixingFrom(i,t)){let t=i.mixingFrom;for(i.mixingFrom=null,t&&(t.mixingTo=null);t;)this.queue.end(t),t=t.mixingFrom}i.trackTime+=n}this.queue.drain()}updateMixingFrom(t,e){let s=t.mixingFrom;if(!s)return!0;let i=this.updateMixingFrom(s,e);return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=s.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=s.mixingFrom,s.mixingFrom&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),i):(s.trackTime+=e*s.timeScale,t.mixTime+=e,!1)}apply(e){if(!e)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();let s=this.events,i=this.tracks,n=!1;for(let r=0,o=i.length;r<o;r++){let o=i[r];if(!o||o.delay>0)continue;n=!0;let l=0==r?t.MixBlend.first:o.mixBlend,h=o.alpha;o.mixingFrom?h*=this.applyMixingFrom(o,e,l):o.trackTime>=o.trackEnd&&!o.next&&(h=0);let c=h>=o.alphaAttachmentThreshold,d=o.animationLast,u=o.getAnimationTime(),m=u,f=s;o.reverse&&(m=o.animation.duration-m,f=null);let g=o.animation.timelines,p=g.length;if(0==r&&1==h||l==t.MixBlend.add){0==r&&(c=!0);for(let s=0;s<p;s++){t.Utils.webkit602BugfixHelper(h,l);var a=g[s];a instanceof t.AttachmentTimeline?this.applyAttachmentTimeline(a,e,m,l,c):a.apply(e,d,m,f,h,l,t.MixDirection.mixIn)}}else{let s=o.timelineMode,i=o.shortestRotation,n=!i&&o.timelinesRotation.length!=p<<1;n&&(o.timelinesRotation.length=p<<1);for(let a=0;a<p;a++){let r=g[a],u=s[a]==t.SUBSEQUENT?l:t.MixBlend.setup;!i&&r instanceof t.RotateTimeline?this.applyRotateTimeline(r,e,m,h,u,o.timelinesRotation,a<<1,n):r instanceof t.AttachmentTimeline?this.applyAttachmentTimeline(r,e,m,l,c):(t.Utils.webkit602BugfixHelper(h,l),r.apply(e,d,m,f,h,u,t.MixDirection.mixIn))}}this.queueEvents(o,u),s.length=0,o.nextAnimationLast=u,o.nextTrackLast=o.trackTime}for(var r=this.unkeyedState+t.SETUP,o=e.slots,l=0,h=e.slots.length;l<h;l++){var c=o[l];if(c.attachmentState==r){var d=c.data.attachmentName;c.setAttachment(d?e.getAttachment(c.data.index,d):null)}}return this.unkeyedState+=2,this.queue.drain(),n}applyMixingFrom(e,s,i){let n=e.mixingFrom;n.mixingFrom&&this.applyMixingFrom(n,s,i);let a=0;0==e.mixDuration?(a=1,i==t.MixBlend.first&&(i=t.MixBlend.setup)):(a=e.mixTime/e.mixDuration,a>1&&(a=1),i!=t.MixBlend.first&&(i=n.mixBlend));let r=a<n.mixAttachmentThreshold,o=a<n.mixDrawOrderThreshold,l=n.animation.timelines,h=l.length,c=n.alpha*e.interruptAlpha,d=c*(1-a),u=n.animationLast,m=n.getAnimationTime(),f=m,g=null;if(n.reverse?f=n.animation.duration-f:a<n.eventThreshold&&(g=this.events),i==t.MixBlend.add)for(let e=0;e<h;e++)l[e].apply(s,u,f,g,d,i,t.MixDirection.mixOut);else{let e=n.timelineMode,a=n.timelineHoldMix,m=n.shortestRotation,p=!m&&n.timelinesRotation.length!=h<<1;p&&(n.timelinesRotation.length=h<<1),n.totalAlpha=0;for(let x=0;x<h;x++){let h,w=l[x],b=t.MixDirection.mixOut,y=0;switch(e[x]){case t.SUBSEQUENT:if(!o&&w instanceof t.DrawOrderTimeline)continue;h=i,y=d;break;case t.FIRST:h=t.MixBlend.setup,y=d;break;case t.HOLD_SUBSEQUENT:h=i,y=c;break;case t.HOLD_FIRST:h=t.MixBlend.setup,y=c;break;default:h=t.MixBlend.setup;let e=a[x];y=c*Math.max(0,1-e.mixTime/e.mixDuration)}n.totalAlpha+=y,!m&&w instanceof t.RotateTimeline?this.applyRotateTimeline(w,s,f,y,h,n.timelinesRotation,x<<1,p):w instanceof t.AttachmentTimeline?this.applyAttachmentTimeline(w,s,f,h,r&&y>=n.alphaAttachmentThreshold):(t.Utils.webkit602BugfixHelper(y,i),o&&w instanceof t.DrawOrderTimeline&&h==t.MixBlend.setup&&(b=t.MixDirection.mixIn),w.apply(s,u,f,g,y,h,b))}}return e.mixDuration>0&&this.queueEvents(n,m),this.events.length=0,n.nextAnimationLast=m,n.nextTrackLast=n.trackTime,a}applyAttachmentTimeline(e,s,i,n,a){var r=s.slots[e.slotIndex];r.bone.active&&(i<e.frames[0]?n!=t.MixBlend.setup&&n!=t.MixBlend.first||this.setAttachment(s,r,r.data.attachmentName,a):this.setAttachment(s,r,e.attachmentNames[t.Timeline.search1(e.frames,i)],a),r.attachmentState<=this.unkeyedState&&(r.attachmentState=this.unkeyedState+t.SETUP))}setAttachment(e,s,i,n){s.setAttachment(i?e.getAttachment(s.data.index,i):null),n&&(s.attachmentState=this.unkeyedState+t.CURRENT)}applyRotateTimeline(e,s,i,n,a,r,o,l){if(l&&(r[o]=0),1==n)return void e.apply(s,0,i,null,1,a,t.MixDirection.mixIn);let h=s.bones[e.boneIndex];if(!h.active)return;let c=0,d=0;if(i<e.frames[0])switch(a){case t.MixBlend.setup:h.rotation=h.data.rotation;default:return;case t.MixBlend.first:c=h.rotation,d=h.data.rotation}else c=a==t.MixBlend.setup?h.data.rotation:h.rotation,d=h.data.rotation+e.getCurveValue(i);let u=0,m=d-c;if(m-=360*Math.ceil(m/360-.5),0==m)u=r[o];else{let e=0,s=0;l?(e=0,s=m):(e=r[o],s=r[o+1]);let i=e-e%360;u=m+i;let n=m>=0,a=e>=0;Math.abs(s)<=90&&t.MathUtils.signum(s)!=t.MathUtils.signum(m)&&(Math.abs(e-i)>180?(u+=360*t.MathUtils.signum(e),a=n):0!=i?u-=360*t.MathUtils.signum(e):a=n),a!=n&&(u+=360*t.MathUtils.signum(e)),r[o]=u}r[o+1]=m,h.rotation=c+u*n}queueEvents(t,e){let s=t.animationStart,i=t.animationEnd,n=i-s,a=t.trackLast%n,r=this.events,o=0,l=r.length;for(;o<l;o++){let e=r[o];if(e.time<a)break;e.time>i||this.queue.event(t,e)}let h=!1;if(t.loop)if(0==n)h=!0;else{const e=Math.floor(t.trackTime/n);h=e>0&&e>Math.floor(t.trackLast/n)}else h=e>=i&&t.animationLast<i;for(h&&this.queue.complete(t);o<l;o++){let e=r[o];e.time<s||this.queue.event(t,e)}}clearTracks(){let t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let t=0,e=this.tracks.length;t<e;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()}clearTrack(t){if(t>=this.tracks.length)return;let e=this.tracks[t];if(!e)return;this.queue.end(e),this.clearNext(e);let s=e;for(;;){let t=s.mixingFrom;if(!t)break;this.queue.end(t),s.mixingFrom=null,s.mixingTo=null,s=t}this.tracks[e.trackIndex]=null,this.queue.drain()}setCurrent(t,e,s){let i=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,i&&(s&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)}setAnimation(t,e,s=!1){let i=this.data.skeletonData.findAnimation(e);if(!i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,s)}setAnimationWith(t,e,s=!1){if(!e)throw new Error("animation cannot be null.");let i=!0,n=this.expandToIndex(t);n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,i=!1):this.clearNext(n));let a=this.trackEntry(t,e,s,n);return this.setCurrent(t,a,i),this.queue.drain(),a}addAnimation(t,e,s=!1,i=0){let n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,n,s,i)}addAnimationWith(t,e,s=!1,i=0){if(!e)throw new Error("animation cannot be null.");let n=this.expandToIndex(t);if(n)for(;n.next;)n=n.next;let a=this.trackEntry(t,e,s,n);return n?(n.next=a,a.previous=n,i<=0&&(i+=n.getTrackComplete()-a.mixDuration)):(this.setCurrent(t,a,!0),this.queue.drain()),a.delay=i,a}setEmptyAnimation(t,s=0){let i=this.setAnimationWith(t,e.emptyAnimation(),!1);return i.mixDuration=s,i.trackEnd=s,i}addEmptyAnimation(t,s=0,i=0){let n=this.addAnimationWith(t,e.emptyAnimation(),!1,i);return i<=0&&(n.delay+=n.mixDuration-s),n.mixDuration=s,n.trackEnd=s,n}setEmptyAnimations(t=0){let e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(let e=0,s=this.tracks.length;e<s;e++){let s=this.tracks[e];s&&this.setEmptyAnimation(s.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()}expandToIndex(e){return e<this.tracks.length?this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)}trackEntry(e,s,i,n){let a=this.trackEntryPool.obtain();return a.reset(),a.trackIndex=e,a.animation=s,a.loop=i,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=s.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=n?this.data.getMix(n.animation,s):0,a.interruptAlpha=1,a.totalAlpha=0,a.mixBlend=t.MixBlend.replace,a}clearNext(t){let e=t.next;for(;e;)this.queue.dispose(e),e=e.next;t.next=null}_animationsChanged(){this.animationsChanged=!1,this.propertyIDs.clear();let e=this.tracks;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i){for(;i.mixingFrom;)i=i.mixingFrom;do{i.mixingTo&&i.mixBlend==t.MixBlend.add||this.computeHold(i),i=i.mixingTo}while(i)}}}computeHold(e){let s=e.mixingTo,i=e.animation.timelines,n=e.animation.timelines.length,a=e.timelineMode;a.length=n;let r=e.timelineHoldMix;r.length=0;let o=this.propertyIDs;if(s&&s.holdPrevious)for(let e=0;e<n;e++)a[e]=o.addAll(i[e].getPropertyIds())?t.HOLD_FIRST:t.HOLD_SUBSEQUENT;else t:for(let l=0;l<n;l++){let n=i[l],h=n.getPropertyIds();if(o.addAll(h))if(!s||n instanceof t.AttachmentTimeline||n instanceof t.DrawOrderTimeline||n instanceof t.EventTimeline||!s.animation.hasTimeline(h))a[l]=t.FIRST;else{for(let i=s.mixingTo;i;i=i.mixingTo)if(!i.animation.hasTimeline(h)){if(e.mixDuration>0){a[l]=t.HOLD_MIX,r[l]=i;continue t}break}a[l]=t.HOLD_FIRST}else a[l]=t.SUBSEQUENT}}getCurrent(t){return t>=this.tracks.length?null:this.tracks[t]}addListener(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}removeListener(t){let e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}clearListeners(){this.listeners.length=0}clearListenerNotifications(){this.queue.clear()}}e._emptyAnimation=new t.Animation("<empty>",[],0),t.AnimationState=e;class s{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.mixAttachmentThreshold=0,this.alphaAttachmentThreshold=0,this.mixDrawOrderThreshold=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=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}get mixDuration(){return this._mixDuration}set mixDuration(t){this._mixDuration=t}setMixDurationWithDelay(t,e){this._mixDuration=t,null!=this.previous&&e<=0&&(e+=this.previous.getTrackComplete()-t),this.delay=e}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 t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}setAnimationLast(t){this.animationLast=t,this.nextAnimationLast=t}isComplete(){return this.trackTime>=this.animationEnd-this.animationStart}resetRotationDirections(){this.timelinesRotation.length=0}getTrackComplete(){let t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime<t)return t}return this.trackTime}wasApplied(){return-1!=this.nextTrackLast}isNextReady(){return null!=this.next&&this.nextTrackLast-this.next.delay>=0}}t.TrackEntry=s;class i{constructor(t){this.objects=[],this.drainDisabled=!1,this.animState=t}start(t){this.objects.push(n.start),this.objects.push(t),this.animState.animationsChanged=!0}interrupt(t){this.objects.push(n.interrupt),this.objects.push(t)}end(t){this.objects.push(n.end),this.objects.push(t),this.animState.animationsChanged=!0}dispose(t){this.objects.push(n.dispose),this.objects.push(t)}complete(t){this.objects.push(n.complete),this.objects.push(t)}event(t,e){this.objects.push(n.event),this.objects.push(t),this.objects.push(e)}drain(){if(this.drainDisabled)return;this.drainDisabled=!0;let t=this.objects,e=this.animState.listeners;for(let s=0;s<t.length;s+=2){let i=t[s],a=t[s+1];switch(i){case n.start:a.listener&&a.listener.start&&a.listener.start(a);for(let t=0;t<e.length;t++){let s=e[t];s.start&&s.start(a)}break;case n.interrupt:a.listener&&a.listener.interrupt&&a.listener.interrupt(a);for(let t=0;t<e.length;t++){let s=e[t];s.interrupt&&s.interrupt(a)}break;case n.end:a.listener&&a.listener.end&&a.listener.end(a);for(let t=0;t<e.length;t++){let s=e[t];s.end&&s.end(a)}case n.dispose:a.listener&&a.listener.dispose&&a.listener.dispose(a);for(let t=0;t<e.length;t++){let s=e[t];s.dispose&&s.dispose(a)}this.animState.trackEntryPool.free(a);break;case n.complete:a.listener&&a.listener.complete&&a.listener.complete(a);for(let t=0;t<e.length;t++){let s=e[t];s.complete&&s.complete(a)}break;case n.event:let i=t[2+s++];a.listener&&a.listener.event&&a.listener.event(a,i);for(let t=0;t<e.length;t++){let s=e[t];s.event&&s.event(a,i)}}}this.clear(),this.drainDisabled=!1}clear(){this.objects.length=0}}let n;t.EventQueue=i,function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(n=t.EventType||(t.EventType={}));t.AnimationStateAdapter=class{start(t){}interrupt(t){}end(t){}dispose(t){}complete(t){}event(t,e){}},t.SUBSEQUENT=0,t.FIRST=1,t.HOLD_SUBSEQUENT=2,t.HOLD_FIRST=3,t.HOLD_MIX=4,t.SETUP=1,t.CURRENT=2}(spine||(spine={})),function(t){t.AnimationStateData=class{constructor(t){if(this.animationToMixTime={},this.defaultMix=0,!t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}setMix(t,e,s){let i=this.skeletonData.findAnimation(t);if(!i)throw new Error("Animation not found: "+t);let n=this.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);this.setMixWith(i,n,s)}setMixWith(t,e,s){if(!t)throw new Error("from cannot be null.");if(!e)throw new Error("to cannot be null.");let i=t.name+"."+e.name;this.animationToMixTime[i]=s}getMix(t,e){let s=t.name+"."+e.name,i=this.animationToMixTime[s];return void 0===i?this.defaultMix:i}}}(spine||(spine={})),function(t){t.AssetManagerBase=class{constructor(t,s="",i=new e){this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=s,this.downloader=i}start(t){return this.toLoad++,this.pathPrefix+t}success(t,e,s){this.toLoad--,this.loaded++,this.assets[e]=s,t&&t(e,s)}error(t,e,s){this.toLoad--,this.loaded++,this.errors[e]=s,t&&t(e,s)}loadAll(){return new Promise((t,e)=>{let s=()=>{this.isLoadingComplete()?this.hasErrors()?e(this.errors):t(this):requestAnimationFrame(s)};requestAnimationFrame(s)})}setRawDataURI(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}loadBinary(t,e=()=>{},s=()=>{}){t=this.start(t),this.downloader.downloadBinary(t,s=>{this.success(e,t,s)},(e,i)=>{this.error(s,t,`Couldn't load binary ${t}: status ${e}, ${i}`)})}loadText(t,e=()=>{},s=()=>{}){t=this.start(t),this.downloader.downloadText(t,s=>{this.success(e,t,s)},(e,i)=>{this.error(s,t,`Couldn't load text ${t}: status ${e}, ${i}`)})}loadJson(t,e=()=>{},s=()=>{}){t=this.start(t),this.downloader.downloadJson(t,s=>{this.success(e,t,s)},(e,i)=>{this.error(s,t,`Couldn't load JSON ${t}: status ${e}, ${i}`)})}loadTexture(t,e=()=>{},s=()=>{}){if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then(e=>e.ok?e.blob():(this.error(s,t,`Couldn't load image: ${t}`),null)).then(t=>t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null).then(s=>{s&&this.success(e,t,this.textureLoader(s))});else{let i=new Image;i.crossOrigin="anonymous",i.onload=()=>{this.success(e,t,this.textureLoader(i))},i.onerror=()=>{this.error(s,t,`Couldn't load image: ${t}`)},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),i.src=t}}loadTextureAtlas(e,s=()=>{},i=()=>{},n){let a=e.lastIndexOf("/"),r=a>=0?e.substring(0,a+1):"";e=this.start(e),this.downloader.downloadText(e,a=>{try{let o=new t.TextureAtlas(a),l=o.pages.length,h=!1;for(let t of o.pages)this.loadTexture(n?n[t.name]:r+t.name,(i,n)=>{h||(t.setTexture(n),0==--l&&this.success(s,e,o))},(t,s)=>{h||this.error(i,e,`Couldn't load texture atlas ${e} page image: ${t}`),h=!0})}catch(t){this.error(i,e,`Couldn't parse texture atlas ${e}: ${t.message}`)}},(t,s)=>{this.error(i,e,`Couldn't load texture atlas ${e}: status ${t}, ${s}`)})}get(t){return this.assets[this.pathPrefix+t]}require(t){t=this.pathPrefix+t;let e=this.assets[t];if(e)return e;let s=this.errors[t];throw Error("Asset not found: "+t+(s?"\n"+s:""))}remove(t){t=this.pathPrefix+t;let e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}removeAll(){for(let t in this.assets){let e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}isLoadingComplete(){return 0==this.toLoad}getToLoad(){return this.toLoad}getLoaded(){return this.loaded}dispose(){this.removeAll()}hasErrors(){return Object.keys(this.errors).length>0}getErrors(){return this.errors}};class e{constructor(){this.callbacks={},this.rawDataUris={}}dataUriToString(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}base64ToUint8Array(t){for(var e=window.atob(t),s=e.length,i=new Uint8Array(s),n=0;n<s;n++)i[n]=e.charCodeAt(n);return i}dataUriToUint8Array(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");let e=t.indexOf("base64,");if(-1==e)throw new Error("Not a binary data URI.");return e+=7,this.base64ToUint8Array(t.substr(e))}downloadText(t,e,s){if(this.start(t,e,s))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToString(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let i=new XMLHttpRequest;i.overrideMimeType("text/html"),i.open("GET",t,!0);let n=()=>{this.finish(t,i.status,i.responseText)};i.onload=n,i.onerror=n,i.send()}downloadJson(t,e,s){this.downloadText(t,t=>{e(JSON.parse(t))},s)}downloadBinary(t,e,s){if(this.start(t,e,s))return;if(this.rawDataUris[t]){try{let e=this.rawDataUris[t];this.finish(t,200,this.dataUriToUint8Array(e))}catch(e){this.finish(t,400,JSON.stringify(e))}return}let i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer";let n=()=>{this.finish(t,i.status,i.response)};i.onload=()=>{200==i.status||0==i.status?this.finish(t,200,new Uint8Array(i.response)):n()},i.onerror=n,i.send()}start(t,e,s){let i=this.callbacks[t];try{if(i)return!0;this.callbacks[t]=i=[]}finally{i.push(e,s)}}finish(t,e,s){let i=this.callbacks[t];delete this.callbacks[t];let n=200==e||0==e?[s]:[e,s];for(let t=n.length-1,e=i.length;t<e;t+=2)i[t].apply(null,n)}}t.Downloader=e}(spine||(spine={})),function(t){t.AtlasAttachmentLoader=class{constructor(t){this.atlas=t}loadSequence(t,e,s){let i=s.regions;for(let n=0,a=i.length;n<a;n++){let a=s.getPath(e,n),r=this.atlas.findRegion(a);if(null==r)throw new Error("Region not found in atlas: "+a+" (sequence: "+t+")");i[n]=r}}newRegionAttachment(e,s,i,n){let a=new t.RegionAttachment(s,i);if(null!=n)this.loadSequence(s,i,n);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (region attachment: "+s+")");a.region=t}return a}newMeshAttachment(e,s,i,n){let a=new t.MeshAttachment(s,i);if(null!=n)this.loadSequence(s,i,n);else{let t=this.atlas.findRegion(i);if(!t)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+s+")");a.region=t}return a}newBoundingBoxAttachment(e,s){return new t.BoundingBoxAttachment(s)}newPathAttachment(e,s){return new t.PathAttachment(s)}newPointAttachment(e,s){return new t.PointAttachment(s)}newClippingAttachment(e,s){return new t.ClippingAttachment(s)}}}(spine||(spine={})),function(t){class e{constructor(t){if(!t)throw new Error("name cannot be null.");this.name=t}}t.Attachment=e;class s extends e{constructor(t){super(t),this.id=s.nextID++,this.bones=null,this.vertices=[],this.worldVerticesLength=0,this.timelineAttachment=this}computeWorldVertices(t,e,s,i,n,a){s=n+(s>>1)*a;let r=t.bone.skeleton,o=t.deform,l=this.vertices,h=this.bones;if(!h){o.length>0&&(l=o);let r=t.bone,h=r.worldX,c=r.worldY,d=r.a,u=r.b,m=r.c,f=r.d;for(let t=e,r=n;r<s;t+=2,r+=a){let e=l[t],s=l[t+1];i[r]=e*d+s*u+h,i[r+1]=e*m+s*f+c}return}let c=0,d=0;for(let t=0;t<e;t+=2){let t=h[c];c+=t+1,d+=t}let u=r.bones;if(0==o.length)for(let t=n,e=3*d;t<s;t+=a){let s=0,n=0,a=h[c++];for(a+=c;c<a;c++,e+=3){let t=u[h[c]],i=l[e],a=l[e+1],r=l[e+2];s+=(i*t.a+a*t.b+t.worldX)*r,n+=(i*t.c+a*t.d+t.worldY)*r}i[t]=s,i[t+1]=n}else{let t=o;for(let e=n,r=3*d,o=d<<1;e<s;e+=a){let s=0,n=0,a=h[c++];for(a+=c;c<a;c++,r+=3,o+=2){let e=u[h[c]],i=l[r]+t[o],a=l[r+1]+t[o+1],d=l[r+2];s+=(i*e.a+a*e.b+e.worldX)*d,n+=(i*e.c+a*e.d+e.worldY)*d}i[e]=s,i[e+1]=n}}}copyTo(e){this.bones?(e.bones=new Array(this.bones.length),t.Utils.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,this.vertices&&(e.vertices=t.Utils.newFloatArray(this.vertices.length),t.Utils.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)),e.worldVerticesLength=this.worldVerticesLength,e.timelineAttachment=this.timelineAttachment}}s.nextID=0,t.VertexAttachment=s}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.color=new t.Color(1,1,1,1)}copy(){let t=new e(this.name);return this.copyTo(t),t.color.setFromColor(this.color),t}}t.BoundingBoxAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.endSlot=null,this.color=new t.Color(.2275,.2275,.8078,1)}copy(){let t=new e(this.name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t}}t.ClippingAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e,s){super(e),this.region=null,this.regionUVs=[],this.uvs=[],this.triangles=[],this.color=new t.Color(1,1,1,1),this.width=0,this.height=0,this.hullLength=0,this.edges=[],this.parentMesh=null,this.sequence=null,this.tempColor=new t.Color(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=t.Utils.newFloatArray(e.length));let s=this.uvs,i=this.uvs.length,n=this.region.u,a=this.region.v,r=0,o=0;if(this.region instanceof t.TextureAtlasRegion){let t=this.region,l=t.page,h=l.width,c=l.height;switch(t.degrees){case 90:n-=(t.originalHeight-t.offsetY-t.height)/h,a-=(t.originalWidth-t.offsetX-t.width)/c,r=t.originalHeight/h,o=t.originalWidth/c;for(let t=0;t<i;t+=2)s[t]=n+e[t+1]*r,s[t+1]=a+(1-e[t])*o;return;case 180:n-=(t.originalWidth-t.offsetX-t.width)/h,a-=t.offsetY/c,r=t.originalWidth/h,o=t.originalHeight/c;for(let t=0;t<i;t+=2)s[t]=n+(1-e[t])*r,s[t+1]=a+(1-e[t+1])*o;return;case 270:n-=t.offsetY/h,a-=t.offsetX/c,r=t.originalHeight/h,o=t.originalWidth/c;for(let t=0;t<i;t+=2)s[t]=n+(1-e[t+1])*r,s[t+1]=a+e[t]*o;return}n-=t.offsetX/h,a-=(t.originalHeight-t.offsetY-t.height)/c,r=t.originalWidth/h,o=t.originalHeight/c}else this.region?(r=this.region.u2-n,o=this.region.v2-a):(n=a=0,r=o=1);for(let t=0;t<i;t+=2)s[t]=n+e[t]*r,s[t+1]=a+e[t+1]*o}getParentMesh(){return this.parentMesh}setParentMesh(t){this.parentMesh=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)}copy(){if(this.parentMesh)return this.newLinkedMesh();let s=new e(this.name,this.path);return s.region=this.region,s.color.setFromColor(this.color),this.copyTo(s),s.regionUVs=new Array(this.regionUVs.length),t.Utils.arrayCopy(this.regionUVs,0,s.regionUVs,0,this.regionUVs.length),s.uvs=new Array(this.uvs.length),t.Utils.arrayCopy(this.uvs,0,s.uvs,0,this.uvs.length),s.triangles=new Array(this.triangles.length),t.Utils.arrayCopy(this.triangles,0,s.triangles,0,this.triangles.length),s.hullLength=this.hullLength,s.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(s.edges=new Array(this.edges.length),t.Utils.arrayCopy(this.edges,0,s.edges,0,this.edges.length)),s.width=this.width,s.height=this.height,s}computeWorldVertices(t,e,s,i,n,a){null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,e,s,i,n,a)}newLinkedMesh(){let t=new e(this.name,this.path);return t.region=this.region,t.color.setFromColor(this.color),t.timelineAttachment=this.timelineAttachment,t.setParentMesh(this.parentMesh?this.parentMesh:this),null!=t.region&&t.updateRegion(),t}}t.MeshAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.lengths=[],this.closed=!1,this.constantSpeed=!1,this.color=new t.Color(1,1,1,1)}copy(){let s=new e(this.name);return this.copyTo(s),s.lengths=new Array(this.lengths.length),t.Utils.arrayCopy(this.lengths,0,s.lengths,0,this.lengths.length),s.closed=closed,s.constantSpeed=this.constantSpeed,s.color.setFromColor(this.color),s}}t.PathAttachment=e}(spine||(spine={})),function(t){class e extends t.VertexAttachment{constructor(e){super(e),this.x=0,this.y=0,this.rotation=0,this.color=new t.Color(.38,.94,0,1)}computeWorldPosition(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e}computeWorldRotation(e){const s=this.rotation*t.MathUtils.degRad,i=Math.cos(s),n=Math.sin(s),a=i*e.a+n*e.b,r=i*e.c+n*e.d;return t.MathUtils.atan2Deg(r,a)}copy(){let t=new e(this.name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t}}t.PointAttachment=e}(spine||(spine={})),function(t){class e extends t.Attachment{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 t.Color(1,1,1,1),this.region=null,this.sequence=null,this.offset=t.Utils.newFloatArray(8),this.uvs=t.Utils.newFloatArray(8),this.tempColor=new t.Color(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(null==e)return s[0]=0,s[1]=0,s[2]=0,s[3]=1,s[4]=1,s[5]=1,s[6]=1,void(s[7]=0);let i=this.width/this.region.originalWidth*this.scaleX,n=this.height/this.region.originalHeight*this.scaleY,a=-this.width/2*this.scaleX+this.region.offsetX*i,r=-this.height/2*this.scaleY+this.region.offsetY*n,o=a+this.region.width*i,l=r+this.region.height*n,h=this.rotation*t.MathUtils.degRad,c=Math.cos(h),d=Math.sin(h),u=this.x,m=this.y,f=a*c+u,g=a*d,p=r*c+m,x=r*d,w=o*c+u,b=o*d,y=l*c+m,M=l*d,S=this.offset;S[0]=f-x,S[1]=p+g,S[2]=f-M,S[3]=y+g,S[4]=w-M,S[5]=y+b,S[6]=w-x,S[7]=p+b,90==e.degrees?(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(t,e,s,i){null!=this.sequence&&this.sequence.apply(t,this);let n=t.bone,a=this.offset,r=n.worldX,o=n.worldY,l=n.a,h=n.b,c=n.c,d=n.d,u=0,m=0;u=a[0],m=a[1],e[s]=u*l+m*h+r,e[s+1]=u*c+m*d+o,s+=i,u=a[2],m=a[3],e[s]=u*l+m*h+r,e[s+1]=u*c+m*d+o,s+=i,u=a[4],m=a[5],e[s]=u*l+m*h+r,e[s+1]=u*c+m*d+o,s+=i,u=a[6],m=a[7],e[s]=u*l+m*h+r,e[s+1]=u*c+m*d+o}copy(){let s=new e(this.name,this.path);return s.region=this.region,s.x=this.x,s.y=this.y,s.scaleX=this.scaleX,s.scaleY=this.scaleY,s.rotation=this.rotation,s.width=this.width,s.height=this.height,t.Utils.arrayCopy(this.uvs,0,s.uvs,0,8),t.Utils.arrayCopy(this.offset,0,s.offset,0,8),s.color.setFromColor(this.color),s.sequence=null!=this.sequence?this.sequence.copy():null,s}}e.X1=0,e.Y1=1,e.C1R=2,e.C1G=3,e.C1B=4,e.C1A=5,e.U1=6,e.V1=7,e.X2=8,e.Y2=9,e.C2R=10,e.C2G=11,e.C2B=12,e.C2A=13,e.U2=14,e.V2=15,e.X3=16,e.Y3=17,e.C3R=18,e.C3G=19,e.C3B=20,e.C3A=21,e.U3=22,e.V3=23,e.X4=24,e.Y4=25,e.C4R=26,e.C4G=27,e.C4B=28,e.C4A=29,e.U4=30,e.V4=31,t.RegionAttachment=e}(spine||(spine={})),function(t){class e{constructor(t){this.id=e.nextID(),this.start=0,this.digits=0,this.setupIndex=0,this.regions=new Array(t)}copy(){let s=new e(this.regions.length);return t.Utils.arrayCopy(this.regions,0,s.regions,0,this.regions.length),s.start=this.start,s.digits=this.digits,s.setupIndex=this.setupIndex,s}apply(t,e){let s=t.sequenceIndex;-1==s&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1);let i=this.regions[s];e.region!=i&&(e.region=i,e.updateRegion())}getPath(t,e){let s=t,i=(this.start+e).toString();for(let t=this.digits-i.length;t>0;t--)s+="0";return s+=i,s}static nextID(){return e._nextID++}}let s;e._nextID=0,t.Sequence=e,function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(s=t.SequenceMode||(t.SequenceMode={})),t.SequenceModeValues=[s.hold,s.once,s.loop,s.pingpong,s.onceReverse,s.loopReverse,s.pingpongReverse]}(spine||(spine={})),function(t){t.Bone=class{constructor(e,s,i){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.inherit=t.Inherit.Normal,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=i,this.setToSetupPose()}isActive(){return this.active}update(t){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,i,n,a,r,o){this.ax=e,this.ay=s,this.arotation=i,this.ascaleX=n,this.ascaleY=a,this.ashearX=r,this.ashearY=o;let l=this.parent;if(!l){let l=this.skeleton;const h=l.scaleX,c=l.scaleY,d=(i+r)*t.MathUtils.degRad,u=(i+90+o)*t.MathUtils.degRad;return this.a=Math.cos(d)*n*h,this.b=Math.cos(u)*a*h,this.c=Math.sin(d)*n*c,this.d=Math.sin(u)*a*c,this.worldX=e*h+l.x,void(this.worldY=s*c+l.y)}let h=l.a,c=l.b,d=l.c,u=l.d;switch(this.worldX=h*e+c*s+l.worldX,this.worldY=d*e+u*s+l.worldY,this.inherit){case t.Inherit.Normal:{const e=(i+r)*t.MathUtils.degRad,s=(i+90+o)*t.MathUtils.degRad,l=Math.cos(e)*n,m=Math.cos(s)*a,f=Math.sin(e)*n,g=Math.sin(s)*a;return this.a=h*l+c*f,this.b=h*m+c*g,this.c=d*l+u*f,void(this.d=d*m+u*g)}case t.Inherit.OnlyTranslation:{const e=(i+r)*t.MathUtils.degRad,s=(i+90+o)*t.MathUtils.degRad;this.a=Math.cos(e)*n,this.b=Math.cos(s)*a,this.c=Math.sin(e)*n,this.d=Math.sin(s)*a;break}case t.Inherit.NoRotationOrReflection:{let e=h*h+d*d,s=0;e>1e-4?(e=Math.abs(h*u-c*d)/e,h/=this.skeleton.scaleX,d/=this.skeleton.scaleY,c=d*e,u=h*e,s=Math.atan2(d,h)*t.MathUtils.radDeg):(h=0,d=0,s=90-Math.atan2(u,c)*t.MathUtils.radDeg);const l=(i+r-s)*t.MathUtils.degRad,m=(i+o-s+90)*t.MathUtils.degRad,f=Math.cos(l)*n,g=Math.cos(m)*a,p=Math.sin(l)*n,x=Math.sin(m)*a;this.a=h*f-c*p,this.b=h*g-c*x,this.c=d*f+u*p,this.d=d*g+u*x;break}case t.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:{i*=t.MathUtils.degRad;const e=Math.cos(i),s=Math.sin(i);let l=(h*e+c*s)/this.skeleton.scaleX,m=(d*e+u*s)/this.skeleton.scaleY,f=Math.sqrt(l*l+m*m);f>1e-5&&(f=1/f),l*=f,m*=f,f=Math.sqrt(l*l+m*m),this.inherit==t.Inherit.NoScale&&h*u-c*d<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(f=-f),i=Math.PI/2+Math.atan2(m,l);const g=Math.cos(i)*f,p=Math.sin(i)*f;r*=t.MathUtils.degRad,o=(90+o)*t.MathUtils.degRad;const x=Math.cos(r)*n,w=Math.cos(o)*a,b=Math.sin(r)*n,y=Math.sin(o)*a;this.a=l*x+g*b,this.b=l*w+g*y,this.c=m*x+p*b,this.d=m*w+p*y;break}}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}setToSetupPose(){let t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit}updateAppliedTransform(){let e=this.parent;if(!e)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);let s,i,n,a,r=e.a,o=e.b,l=e.c,h=e.d,c=1/(r*h-o*l),d=h*c,u=o*c,m=l*c,f=r*c,g=this.worldX-e.worldX,p=this.worldY-e.worldY;if(this.ax=g*d-p*u,this.ay=p*f-g*m,this.inherit==t.Inherit.OnlyTranslation)s=this.a,i=this.b,n=this.c,a=this.d;else{switch(this.inherit){case t.Inherit.NoRotationOrReflection:{let t=Math.abs(r*h-o*l)/(r*r+l*l),e=r/this.skeleton.scaleX;o=-(l/this.skeleton.scaleY)*t*this.skeleton.scaleX,h=e*t*this.skeleton.scaleY,c=1/(r*h-o*l),d=h*c,u=o*c;break}case t.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:let e=t.MathUtils.cosDeg(this.rotation),s=t.MathUtils.sinDeg(this.rotation);r=(r*e+o*s)/this.skeleton.scaleX,l=(l*e+h*s)/this.skeleton.scaleY;let i=Math.sqrt(r*r+l*l);i>1e-5&&(i=1/i),r*=i,l*=i,i=Math.sqrt(r*r+l*l),this.inherit==t.Inherit.NoScale&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(i=-i);let n=t.MathUtils.PI/2+Math.atan2(l,r);o=Math.cos(n)*i,h=Math.sin(n)*i,c=1/(r*h-o*l),d=h*c,u=o*c,m=l*c,f=r*c}s=d*this.a-u*this.c,i=d*this.b-u*this.d,n=f*this.c-m*this.a,a=f*this.d-m*this.b}if(this.ashearX=0,this.ascaleX=Math.sqrt(s*s+n*n),this.ascaleX>1e-4){let e=s*a-i*n;this.ascaleY=e/this.ascaleX,this.ashearY=-Math.atan2(s*i+n*a,e)*t.MathUtils.radDeg,this.arotation=Math.atan2(n,s)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(i*i+a*a),this.ashearY=0,this.arotation=90-Math.atan2(a,i)*t.MathUtils.radDeg}getWorldRotationX(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg}getWorldRotationY(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg}getWorldScaleX(){return Math.sqrt(this.a*this.a+this.c*this.c)}getWorldScaleY(){return Math.sqrt(this.b*this.b+this.d*this.d)}worldToLocal(t){let e=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,i=t.y-this.worldY;return t.x=s*this.d*e-i*this.b*e,t.y=i*this.a*e-s*this.c*e,t}localToWorld(t){let e=t.x,s=t.y;return t.x=e*this.a+s*this.b+this.worldX,t.y=e*this.c+s*this.d+this.worldY,t}worldToParent(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.worldToLocal(t)}parentToWorld(t){if(null==t)throw new Error("world cannot be null.");return null==this.parent?t:this.parent.localToWorld(t)}worldToLocalRotation(e){let s=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(this.a*s-this.c*i,this.d*i-this.b*s)*t.MathUtils.radDeg+this.rotation-this.shearX}localToWorldRotation(e){e-=this.rotation-this.shearX;let s=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(i*this.c+s*this.d,i*this.a+s*this.b)*t.MathUtils.radDeg}rotateWorld(e){e*=t.MathUtils.degRad;const s=Math.sin(e),i=Math.cos(e),n=this.a,a=this.b;this.a=i*n-s*this.c,this.b=i*a-s*this.d,this.c=s*n+i*this.c,this.d=s*a+i*this.d}}}(spine||(spine={})),function(t){let e;t.BoneData=class{constructor(s,i,n){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.inherit=e.Normal,this.skinRequired=!1,this.color=new t.Color,this.visible=!1,s<0)throw new Error("index must be >= 0.");if(!i)throw new Error("name cannot be null.");this.index=s,this.name=i,this.parent=n}},function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.Inherit||(t.Inherit={}))}(spine||(spine={})),function(t){t.ConstraintData=class{constructor(t,e,s){this.name=t,this.order=e,this.skinRequired=s}}}(spine||(spine={})),function(t){t.Event=class{constructor(t,e){if(this.intValue=0,this.floatValue=0,this.stringValue=null,this.time=0,this.volume=0,this.balance=0,!e)throw new Error("data cannot be null.");this.time=t,this.data=e}}}(spine||(spine={})),function(t){t.EventData=class{constructor(t){this.intValue=0,this.floatValue=0,this.stringValue=null,this.audioPath=null,this.volume=0,this.balance=0,this.name=t}}}(spine||(spine={})),function(t){t.IkConstraint=class{constructor(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0;s<t.bones.length;s++){let i=e.findBone(t.bones[s].name);if(!i)throw new Error(`Couldn't find bone ${t.bones[s].name}`);this.bones.push(i)}let s=e.findBone(t.target.name);if(!s)throw new Error(`Couldn't find bone ${t.target.name}`);this.target=s,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch}update(t){if(0==this.mix)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)}}apply1(e,s,i,n,a,r,o){let l=e.parent;if(!l)throw new Error("IK bone must have parent.");let h=l.a,c=l.b,d=l.c,u=l.d,m=-e.ashearX-e.arotation,f=0,g=0;switch(e.inherit){case t.Inherit.OnlyTranslation:f=(s-e.worldX)*t.MathUtils.signum(e.skeleton.scaleX),g=(i-e.worldY)*t.MathUtils.signum(e.skeleton.scaleY);break;case t.Inherit.NoRotationOrReflection:let n=Math.abs(h*u-c*d)/Math.max(1e-4,h*h+d*d),a=h/e.skeleton.scaleX,r=d/e.skeleton.scaleY;c=-r*n*e.skeleton.scaleX,u=a*n*e.skeleton.scaleY,m+=Math.atan2(r,a)*t.MathUtils.radDeg;default:let o=s-l.worldX,p=i-l.worldY,x=h*u-c*d;Math.abs(x)<=1e-4?(f=0,g=0):(f=(o*u-p*c)/x-e.ax,g=(p*h-o*d)/x-e.ay)}m+=Math.atan2(g,f)*t.MathUtils.radDeg,e.ascaleX<0&&(m+=180),m>180?m-=360:m<-180&&(m+=360);let p=e.ascaleX,x=e.ascaleY;if(n||a){switch(e.inherit){case t.Inherit.NoScale:case t.Inherit.NoScaleOrReflection:f=s-e.worldX,g=i-e.worldY}const l=e.data.length*p;if(l>1e-4){const t=f*f+g*g;if(n&&t<l*l||a&&t>l*l){const e=(Math.sqrt(t)/l-1)*o+1;p*=e,r&&(x*=e)}}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+m*o,p,x,e.ashearX,e.ashearY)}apply2(e,s,i,n,a,r,o,l,h){if(e.inherit!=t.Inherit.Normal||s.inherit!=t.Inherit.Normal)return;let c=e.ax,d=e.ay,u=e.ascaleX,m=e.ascaleY,f=u,g=m,p=s.ascaleX,x=0,w=0,b=0;u<0?(u=-u,x=180,b=-1):(x=0,b=1),m<0&&(m=-m,b=-b),p<0?(p=-p,w=180):w=0;let y=s.ax,M=0,S=0,A=0,I=e.a,k=e.b,T=e.c,v=e.d,C=Math.abs(u-m)<=1e-4;!C||r?(M=0,S=I*y+e.worldX,A=T*y+e.worldY):(M=s.ay,S=I*y+k*M+e.worldX,A=T*y+v*M+e.worldY);let F=e.parent;if(!F)throw new Error("IK parent must itself have a parent.");I=F.a,k=F.b,T=F.c,v=F.d;let Y=I*v-k*T,X=S-F.worldX,P=A-F.worldY;Y=Math.abs(Y)<=1e-4?0:1/Y;let R,U,E=(X*v-P*k)*Y-c,B=(P*I-X*T)*Y-d,V=Math.sqrt(E*E+B*B),D=s.data.length*p;if(V<1e-4)return this.apply1(e,i,n,!1,r,!1,h),void s.updateWorldTransformWith(y,M,0,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY);X=i-F.worldX,P=n-F.worldY;let N=(X*v-P*k)*Y-c,q=(P*I-X*T)*Y-d,L=N*N+q*q;if(0!=l){l*=u*(p+1)*.5;let t=Math.sqrt(L),e=t-V-D*u+l;if(e>0){let s=Math.min(1,e/(2*l))-1;s=(e-l*(1-s*s))/t,N-=s*N,q-=s*q,L=N*N+q*q}}t:if(C){D*=u;let t=(L-V*V-D*D)/(2*V*D);t<-1?(t=-1,U=Math.PI*a):t>1?(t=1,U=0,r&&(I=(Math.sqrt(L)/(V+D)-1)*h+1,f*=I,o&&(g*=I))):U=Math.acos(t)*a,I=V+D*t,k=D*Math.sin(U),R=Math.atan2(q*I-N*k,N*I+q*k)}else{I=u*D,k=m*D;let e=I*I,s=k*k,i=Math.atan2(q,N);T=s*V*V+e*L-e*s;let n=-2*s*V,r=s-e;if(v=n*n-4*r*T,v>=0){let t=Math.sqrt(v);n<0&&(t=-t),t=.5*-(n+t);let e=t/r,s=T/t,o=Math.abs(e)<Math.abs(s)?e:s;if(e=L-o*o,e>=0){P=Math.sqrt(e)*a,R=i-Math.atan2(P,o),U=Math.atan2(P/m,(o-V)/u);break t}}let o=t.MathUtils.PI,l=V-I,h=l*l,c=0,d=0,f=V+I,g=f*f,p=0;T=-I*V/(e-s),T>=-1&&T<=1&&(T=Math.acos(T),X=I*Math.cos(T)+V,P=k*Math.sin(T),v=X*X+P*P,v<h&&(o=T,h=v,l=X,c=P),v>g&&(d=T,g=v,f=X,p=P)),L<=.5*(h+g)?(R=i-Math.atan2(c*a,l),U=o*a):(R=i-Math.atan2(p*a,f),U=d*a)}let O=Math.atan2(M,y)*b,W=e.arotation;R=(R-O)*t.MathUtils.radDeg+x-W,R>180?R-=360:R<-180&&(R+=360),e.updateWorldTransformWith(c,d,W+R*h,f,g,0,0),W=s.arotation,U=((U+O)*t.MathUtils.radDeg-s.ashearX)*b+w-W,U>180?U-=360:U<-180&&(U+=360),s.updateWorldTransformWith(y,M,W+U*h,s.ascaleX,s.ascaleY,s.ashearX,s.ashearY)}}}(spine||(spine={})),function(t){class e extends t.ConstraintData{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.bendDirection=0,this.compress=!1,this.stretch=!1,this.uniform=!1,this.mix=0,this.softness=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}}t.IkConstraintData=e}(spine||(spine={})),function(t){class e{constructor(t,e){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,!t)throw new Error("data cannot be null.");if(!e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(let s=0,i=t.bones.length;s<i;s++){let i=e.findBone(t.bones[s].name);if(!i)throw new Error(`Couldn't find bone ${t.bones[s].name}.`);this.bones.push(i)}let s=e.findSlot(t.target.name);if(!s)throw new Error(`Couldn't find target bone ${t.target.name}`);this.target=s,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY}update(s){let i=this.target.getAttachment();if(!(i instanceof t.PathAttachment))return;let n=this.mixRotate,a=this.mixX,r=this.mixY;if(0==n&&0==a&&0==r)return;let o=this.data,l=o.rotateMode==t.RotateMode.Tangent,h=o.rotateMode==t.RotateMode.ChainScale,c=this.bones,d=c.length,u=l?d:d+1,m=t.Utils.setArraySize(this.spaces,u),f=h?this.lengths=t.Utils.setArraySize(this.lengths,d):[],g=this.spacing;switch(o.spacingMode){case t.SpacingMode.Percent:if(h)for(let t=0,e=u-1;t<e;t++){let e=c[t],s=e.data.length,i=s*e.a,n=s*e.c;f[t]=Math.sqrt(i*i+n*n)}t.Utils.arrayFill(m,1,u,g);break;case t.SpacingMode.Proportional:let s=0;for(let t=0,i=u-1;t<i;){let i=c[t],n=i.data.length;if(n<e.epsilon)h&&(f[t]=0),m[++t]=g;else{let e=n*i.a,a=n*i.c,r=Math.sqrt(e*e+a*a);h&&(f[t]=r),m[++t]=r,s+=r}}if(s>0){s=u/s*g;for(let t=1;t<u;t++)m[t]*=s}break;default:let i=o.spacingMode==t.SpacingMode.Length;for(let t=0,s=u-1;t<s;){let s=c[t],n=s.data.length;if(n<e.epsilon)h&&(f[t]=0),m[++t]=g;else{let e=n*s.a,a=n*s.c,r=Math.sqrt(e*e+a*a);h&&(f[t]=r),m[++t]=(i?n+g:g)*r/n}}}let p=this.computeWorldPositions(i,u,l),x=p[0],w=p[1],b=o.offsetRotation,y=!1;if(0==b)y=o.rotateMode==t.RotateMode.Chain;else{y=!1;let e=this.target.bone;b*=e.a*e.d-e.b*e.c>0?t.MathUtils.degRad:-t.MathUtils.degRad}for(let e=0,s=3;e<d;e++,s+=3){let i=c[e];i.worldX+=(x-i.worldX)*a,i.worldY+=(w-i.worldY)*r;let o=p[s],d=p[s+1],u=o-x,g=d-w;if(h){let t=f[e];if(0!=t){let e=(Math.sqrt(u*u+g*g)/t-1)*n+1;i.a*=e,i.c*=e}}if(x=o,w=d,n>0){let a=i.a,r=i.b,o=i.c,h=i.d,c=0,d=0,f=0;if(c=l?p[s-1]:0==m[e+1]?p[s+2]:Math.atan2(g,u),c-=Math.atan2(o,a),y){d=Math.cos(c),f=Math.sin(c);let t=i.data.length;x+=(t*(d*a-f*o)-u)*n,w+=(t*(f*a+d*o)-g)*n}else c+=b;c>t.MathUtils.PI?c-=t.MathUtils.PI2:c<-t.MathUtils.PI&&(c+=t.MathUtils.PI2),c*=n,d=Math.cos(c),f=Math.sin(c),i.a=d*a-f*o,i.b=d*r-f*h,i.c=f*a+d*o,i.d=f*r+d*h}i.updateAppliedTransform()}}computeWorldPositions(s,i,n){let a=this.target,r=this.position,o=this.spaces,l=t.Utils.setArraySize(this.positions,3*i+2),h=this.world,c=s.closed,d=s.worldVerticesLength,u=d/6,m=e.NONE;if(!s.constantSpeed){let f=s.lengths;u-=c?1:2;let g,p=f[u];switch(this.data.positionMode==t.PositionMode.Percent&&(r*=p),this.data.spacingMode){case t.SpacingMode.Percent:g=p;break;case t.SpacingMode.Proportional:g=p/i;break;default:g=1}h=t.Utils.setArraySize(this.world,8);for(let t=0,x=0,w=0;t<i;t++,x+=3){let i=o[t]*g;r+=i;let b=r;if(c)b%=p,b<0&&(b+=p),w=0;else{if(b<0){m!=e.BEFORE&&(m=e.BEFORE,s.computeWorldVertices(a,2,4,h,0,2)),this.addBeforePosition(b,h,0,l,x);continue}if(b>p){m!=e.AFTER&&(m=e.AFTER,s.computeWorldVertices(a,d-6,4,h,0,2)),this.addAfterPosition(b-p,h,0,l,x);continue}}for(;;w++){let t=f[w];if(!(b>t)){if(0==w)b/=t;else{let e=f[w-1];b=(b-e)/(t-e)}break}}w!=m&&(m=w,c&&w==u?(s.computeWorldVertices(a,d-4,4,h,0,2),s.computeWorldVertices(a,0,4,h,4,2)):s.computeWorldVertices(a,6*w+2,8,h,0,2)),this.addCurvePosition(b,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],l,x,n||t>0&&0==i)}return l}c?(d+=2,h=t.Utils.setArraySize(this.world,d),s.computeWorldVertices(a,2,d-4,h,0,2),s.computeWorldVertices(a,0,2,h,d-4,2),h[d-2]=h[0],h[d-1]=h[1]):(u--,d-=4,h=t.Utils.setArraySize(this.world,d),s.computeWorldVertices(a,2,d,h,0,2));let f,g=t.Utils.setArraySize(this.curves,u),p=0,x=h[0],w=h[1],b=0,y=0,M=0,S=0,A=0,I=0,k=0,T=0,v=0,C=0,F=0,Y=0,X=0,P=0;for(let t=0,e=2;t<u;t++,e+=6)b=h[e],y=h[e+1],M=h[e+2],S=h[e+3],A=h[e+4],I=h[e+5],k=.1875*(x-2*b+M),T=.1875*(w-2*y+S),v=.09375*(3*(b-M)-x+A),C=.09375*(3*(y-S)-w+I),F=2*k+v,Y=2*T+C,X=.75*(b-x)+k+.16666667*v,P=.75*(y-w)+T+.16666667*C,p+=Math.sqrt(X*X+P*P),X+=F,P+=Y,F+=v,Y+=C,p+=Math.sqrt(X*X+P*P),X+=F,P+=Y,p+=Math.sqrt(X*X+P*P),X+=F+v,P+=Y+C,p+=Math.sqrt(X*X+P*P),g[t]=p,x=A,w=I;switch(this.data.positionMode==t.PositionMode.Percent&&(r*=p),this.data.spacingMode){case t.SpacingMode.Percent:f=p;break;case t.SpacingMode.Proportional:f=p/i;break;default:f=1}let R=this.segments,U=0;for(let t=0,e=0,s=0,a=0;t<i;t++,e+=3){let i=o[t]*f;r+=i;let u=r;if(c)u%=p,u<0&&(u+=p),s=0;else{if(u<0){this.addBeforePosition(u,h,0,l,e);continue}if(u>p){this.addAfterPosition(u-p,h,d-4,l,e);continue}}for(;;s++){let t=g[s];if(!(u>t)){if(0==s)u/=t;else{let e=g[s-1];u=(u-e)/(t-e)}break}}if(s!=m){m=s;let t=6*s;for(x=h[t],w=h[t+1],b=h[t+2],y=h[t+3],M=h[t+4],S=h[t+5],A=h[t+6],I=h[t+7],k=.03*(x-2*b+M),T=.03*(w-2*y+S),v=.006*(3*(b-M)-x+A),C=.006*(3*(y-S)-w+I),F=2*k+v,Y=2*T+C,X=.3*(b-x)+k+.16666667*v,P=.3*(y-w)+T+.16666667*C,U=Math.sqrt(X*X+P*P),R[0]=U,t=1;t<8;t++)X+=F,P+=Y,F+=v,Y+=C,U+=Math.sqrt(X*X+P*P),R[t]=U;X+=F,P+=Y,U+=Math.sqrt(X*X+P*P),R[8]=U,X+=F+v,P+=Y+C,U+=Math.sqrt(X*X+P*P),R[9]=U,a=0}for(u*=U;;a++){let t=R[a];if(!(u>t)){if(0==a)u/=t;else{let e=R[a-1];u=a+(u-e)/(t-e)}break}}this.addCurvePosition(.1*u,x,w,b,y,M,S,A,I,l,e,n||t>0&&0==i)}return l}addBeforePosition(t,e,s,i,n){let a=e[s],r=e[s+1],o=e[s+2]-a,l=e[s+3]-r,h=Math.atan2(l,o);i[n]=a+t*Math.cos(h),i[n+1]=r+t*Math.sin(h),i[n+2]=h}addAfterPosition(t,e,s,i,n){let a=e[s+2],r=e[s+3],o=a-e[s],l=r-e[s+1],h=Math.atan2(l,o);i[n]=a+t*Math.cos(h),i[n+1]=r+t*Math.sin(h),i[n+2]=h}addCurvePosition(t,e,s,i,n,a,r,o,l,h,c,d){if(0==t||isNaN(t))return h[c]=e,h[c+1]=s,void(h[c+2]=Math.atan2(n-s,i-e));let u=t*t,m=u*t,f=1-t,g=f*f,p=g*f,x=f*t,w=3*x,b=f*w,y=w*t,M=e*p+i*b+a*y+o*m,S=s*p+n*b+r*y+l*m;h[c]=M,h[c+1]=S,d&&(h[c+2]=t<.001?Math.atan2(n-s,i-e):Math.atan2(S-(s*g+n*x*2+r*u),M-(e*g+i*x*2+a*u)))}}e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,t.PathConstraint=e}(spine||(spine={})),function(t){class e extends t.ConstraintData{constructor(t){super(t,0,!1),this.bones=new Array,this._target=null,this.positionMode=s.Fixed,this.spacingMode=i.Fixed,this.rotateMode=n.Chain,this.offsetRotation=0,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0}set target(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("SlotData not set.")}}let s,i,n;t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(s=t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(i=t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(n=t.RotateMode||(t.RotateMode={}))}(spine||(spine={})),function(t){t.PhysicsConstraint=class{constructor(t,e){this._bone=null,this.inertia=0,this.strength=0,this.damping=0,this.massInverse=0,this.wind=0,this.gravity=0,this.mix=0,this._reset=!0,this.ux=0,this.uy=0,this.cx=0,this.cy=0,this.tx=0,this.ty=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,this.active=!1,this.remaining=0,this.lastTime=0,this.data=t,this.skeleton=e,this.bone=e.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("Bone not set.")}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 t=this.data;this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix}isActive(){return this.active}update(e){const s=this.mix;if(0==s)return;const i=this.data.x>0,n=this.data.y>0,a=this.data.rotate>0||this.data.shearX>0,r=this.data.scaleX>0,o=this.bone,l=o.data.length;switch(e){case t.Physics.none:return;case t.Physics.reset:this.reset();case t.Physics.update:const e=this.skeleton,h=Math.max(this.skeleton.time-this.lastTime,0);this.remaining+=h,this.lastTime=e.time;const c=o.worldX,d=o.worldY;if(this._reset)this._reset=!1,this.ux=c,this.uy=d;else{let u=this.remaining,m=this.inertia,f=this.data.step,g=this.skeleton.data.referenceScale,p=-1,x=this.data.limit*h,w=x*Math.abs(e.scaleY);if(x*=Math.abs(e.scaleX),i||n){if(i){const t=(this.ux-c)*m;this.xOffset+=t>x?x:t<-x?-x:t,this.ux=c}if(n){const t=(this.uy-d)*m;this.yOffset+=t>w?w:t<-w?-w:t,this.uy=d}if(u>=f){p=Math.pow(this.damping,60*f);const e=this.massInverse*f,s=this.strength,a=this.wind*g,r=(t.Skeleton.yDown?-this.gravity:this.gravity)*g;do{i&&(this.xVelocity+=(a-this.xOffset*s)*e,this.xOffset+=this.xVelocity*f,this.xVelocity*=p),n&&(this.yVelocity-=(r+this.yOffset*s)*e,this.yOffset+=this.yVelocity*f,this.yVelocity*=p),u-=f}while(u>=f)}i&&(o.worldX+=this.xOffset*s*this.data.x),n&&(o.worldY+=this.yOffset*s*this.data.y)}if(a||r){let e=Math.atan2(o.c,o.a),i=0,n=0,h=0,c=this.cx-o.worldX,d=this.cy-o.worldY;if(c>x?c=x:c<-x&&(c=-x),d>w?d=w:d<-w&&(d=-w),a){h=(this.data.rotate+this.data.shearX)*s;let a=Math.atan2(d+this.ty,c+this.tx)-e-this.rotateOffset*h;this.rotateOffset+=(a-Math.ceil(a*t.MathUtils.invPI2-.5)*t.MathUtils.PI2)*m,a=this.rotateOffset*h+e,i=Math.cos(a),n=Math.sin(a),r&&(a=l*o.getWorldScaleX(),a>0&&(this.scaleOffset+=(c*i+d*n)*m/a))}else{i=Math.cos(e),n=Math.sin(e);const t=l*o.getWorldScaleX();t>0&&(this.scaleOffset+=(c*i+d*n)*m/t)}if(u=this.remaining,u>=f){-1==p&&(p=Math.pow(this.damping,60*f));const s=this.massInverse*f,o=this.strength,c=this.wind,d=t.Skeleton.yDown?-this.gravity:this.gravity,m=l/g;for(;;)if(u-=f,r&&(this.scaleVelocity+=(c*i-d*n-this.scaleOffset*o)*s,this.scaleOffset+=this.scaleVelocity*f,this.scaleVelocity*=p),a){if(this.rotateVelocity-=((c*n+d*i)*m+this.rotateOffset*o)*s,this.rotateOffset+=this.rotateVelocity*f,this.rotateVelocity*=p,u<f)break;const t=this.rotateOffset*h+e;i=Math.cos(t),n=Math.sin(t)}else if(u<f)break}}this.remaining=u}this.cx=o.worldX,this.cy=o.worldY;break;case t.Physics.pose:i&&(o.worldX+=this.xOffset*s*this.data.x),n&&(o.worldY+=this.yOffset*s*this.data.y)}if(a){let t=this.rotateOffset*s,e=0,i=0,n=0;if(this.data.shearX>0){let s=0;this.data.rotate>0&&(s=t*this.data.rotate,e=Math.sin(s),i=Math.cos(s),n=o.b,o.b=i*n-e*o.d,o.d=e*n+i*o.d),s+=t*this.data.shearX,e=Math.sin(s),i=Math.cos(s),n=o.a,o.a=i*n-e*o.c,o.c=e*n+i*o.c}else t*=this.data.rotate,e=Math.sin(t),i=Math.cos(t),n=o.a,o.a=i*n-e*o.c,o.c=e*n+i*o.c,n=o.b,o.b=i*n-e*o.d,o.d=e*n+i*o.d}if(r){const t=1+this.scaleOffset*s*this.data.scaleX;o.a*=t,o.c*=t}e!=t.Physics.pose&&(this.tx=l*o.a,this.ty=l*o.c),o.updateAppliedTransform()}translate(t,e){this.ux-=t,this.uy-=e,this.cx-=t,this.cy-=e}rotate(e,s,i){const n=i*t.MathUtils.degRad,a=Math.cos(n),r=Math.sin(n),o=this.cx-e,l=this.cy-s;this.translate(o*a-l*r-o,o*r+l*a-l)}}}(spine||(spine={})),function(t){class e extends t.ConstraintData{constructor(t){super(t,0,!1),this._bone=null,this.x=0,this.y=0,this.rotate=0,this.scaleX=0,this.shearX=0,this.limit=0,this.step=0,this.inertia=0,this.strength=0,this.damping=0,this.massInverse=0,this.wind=0,this.gravity=0,this.mix=0,this.inertiaGlobal=!1,this.strengthGlobal=!1,this.dampingGlobal=!1,this.massGlobal=!1,this.windGlobal=!1,this.gravityGlobal=!1,this.mixGlobal=!1}set bone(t){this._bone=t}get bone(){if(this._bone)return this._bone;throw new Error("BoneData not set.")}}t.PhysicsConstraintData=e}(spine||(spine={})),function(t){class e{constructor(e){if(this._updateCache=new Array,this.skin=null,this.scaleX=1,this._scaleY=1,this.x=0,this.y=0,this.time=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 i,n=e.bones[s];if(n.parent){let e=this.bones[n.parent.index];i=new t.Bone(n,this,e),e.children.push(i)}else i=new t.Bone(n,this,null);this.bones.push(i)}this.slots=new Array,this.drawOrder=new Array;for(let s=0;s<e.slots.length;s++){let i=e.slots[s],n=this.bones[i.boneData.index],a=new t.Slot(i,n);this.slots.push(a),this.drawOrder.push(a)}this.ikConstraints=new Array;for(let s=0;s<e.ikConstraints.length;s++){let i=e.ikConstraints[s];this.ikConstraints.push(new t.IkConstraint(i,this))}this.transformConstraints=new Array;for(let s=0;s<e.transformConstraints.length;s++){let i=e.transformConstraints[s];this.transformConstraints.push(new t.TransformConstraint(i,this))}this.pathConstraints=new Array;for(let s=0;s<e.pathConstraints.length;s++){let i=e.pathConstraints[s];this.pathConstraints.push(new t.PathConstraint(i,this))}this.physicsConstraints=new Array;for(let s=0;s<e.physicsConstraints.length;s++){let i=e.physicsConstraints[s];this.physicsConstraints.push(new t.PhysicsConstraint(i,this))}this.color=new t.Color(1,1,1,1),this.updateCache()}get scaleY(){return e.yDown?-this._scaleY:this._scaleY}set scaleY(t){this._scaleY=t}updateCache(){this._updateCache.length=0;let t=this.bones;for(let e=0,s=t.length;e<s;e++){let s=t[e];s.sorted=s.data.skinRequired,s.active=!s.sorted}if(this.skin){let t=this.skin.bones;for(let e=0,s=this.skin.bones.length;e<s;e++){let s=this.bones[t[e].index];do{s.sorted=!1,s.active=!0,s=s.parent}while(s)}}let e=this.ikConstraints,s=this.transformConstraints,i=this.pathConstraints,n=this.physicsConstraints,a=e.length,r=s.length,o=i.length,l=this.physicsConstraints.length,h=a+r+o+l;t:for(let t=0;t<h;t++){for(let s=0;s<a;s++){let i=e[s];if(i.data.order==t){this.sortIkConstraint(i);continue t}}for(let e=0;e<r;e++){let i=s[e];if(i.data.order==t){this.sortTransformConstraint(i);continue t}}for(let e=0;e<o;e++){let s=i[e];if(s.data.order==t){this.sortPathConstraint(s);continue t}}for(let e=0;e<l;e++){const s=n[e];if(s.data.order==t){this.sortPhysicsConstraint(s);continue t}}}for(let e=0,s=t.length;e<s;e++)this.sortBone(t[e])}sortIkConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target;this.sortBone(s);let i=e.bones,n=i[0];if(this.sortBone(n),1==i.length)this._updateCache.push(e),this.sortReset(n.children);else{let t=i[i.length-1];this.sortBone(t),this._updateCache.push(e),this.sortReset(n.children),t.sorted=!0}}sortPathConstraint(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;let s=e.target,i=s.data.index,n=s.bone;this.skin&&this.sortPathConstraintAttachment(this.skin,i,n),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,n);for(let t=0,e=this.data.skins.length;t<e;t++)this.sortPathConstraintAttachment(this.data.skins[t],i,n);let a=s.getAttachment();a instanceof t.PathAttachment&&this.sortPathConstraintAttachmentWith(a,n);let r=e.bones,o=r.length;for(let t=0;t<o;t++)this.sortBone(r[t]);this._updateCache.push(e);for(let t=0;t<o;t++)this.sortReset(r[t].children);for(let t=0;t<o;t++)r[t].sorted=!0}sortTransformConstraint(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),!e.active)return;this.sortBone(e.target);let s=e.bones,i=s.length;if(e.data.local)for(let t=0;t<i;t++){let e=s[t];this.sortBone(e.parent),this.sortBone(e)}else for(let t=0;t<i;t++)this.sortBone(s[t]);this._updateCache.push(e);for(let t=0;t<i;t++)this.sortReset(s[t].children);for(let t=0;t<i;t++)s[t].sorted=!0}sortPathConstraintAttachment(t,e,s){let i=t.attachments[e];if(i)for(let t in i)this.sortPathConstraintAttachmentWith(i[t],s)}sortPathConstraintAttachmentWith(e,s){if(!(e instanceof t.PathAttachment))return;let i=e.bones;if(i){let t=this.bones;for(let e=0,s=i.length;e<s;){let s=i[e++];for(s+=e;e<s;)this.sortBone(t[i[e++]])}}else this.sortBone(s)}sortPhysicsConstraint(e){const s=e.bone;e.active=s.active&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active&&(this.sortBone(s),this._updateCache.push(e),this.sortReset(s.children),s.sorted=!0)}sortBone(t){if(!t)return;if(t.sorted)return;let e=t.parent;e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}sortReset(t){for(let e=0,s=t.length;e<s;e++){let s=t[e];s.active&&(s.sorted&&this.sortReset(s.children),s.sorted=!1)}}updateWorldTransform(t){if(null==t)throw new Error("physics is undefined");let e=this.bones;for(let t=0,s=e.length;t<s;t++){let s=e[t];s.ax=s.x,s.ay=s.y,s.arotation=s.rotation,s.ascaleX=s.scaleX,s.ascaleY=s.scaleY,s.ashearX=s.shearX,s.ashearY=s.shearY}let s=this._updateCache;for(let e=0,i=s.length;e<i;e++)s[e].update(t)}updateWorldTransformWith(e,s){let i=this.getRootBone();if(!i)throw new Error("Root bone must not be null.");let n=s.a,a=s.b,r=s.c,o=s.d;i.worldX=n*this.x+a*this.y+s.worldX,i.worldY=r*this.x+o*this.y+s.worldY;const l=(i.rotation+i.shearX)*t.MathUtils.degRad,h=(i.rotation+90+i.shearY)*t.MathUtils.degRad,c=Math.cos(l)*i.scaleX,d=Math.cos(h)*i.scaleY,u=Math.sin(l)*i.scaleX,m=Math.sin(h)*i.scaleY;i.a=(n*c+a*u)*this.scaleX,i.b=(n*d+a*m)*this.scaleX,i.c=(r*c+o*u)*this.scaleY,i.d=(r*d+o*m)*this.scaleY;let f=this._updateCache;for(let t=0,s=f.length;t<s;t++){let s=f[t];s!=i&&s.update(e)}}setToSetupPose(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()}setBonesToSetupPose(){for(const t of this.bones)t.setToSetupPose();for(const t of this.ikConstraints)t.setToSetupPose();for(const t of this.transformConstraints)t.setToSetupPose();for(const t of this.pathConstraints)t.setToSetupPose();for(const t of this.physicsConstraints)t.setToSetupPose()}setSlotsToSetupPose(){let e=this.slots;t.Utils.arrayCopy(e,0,this.drawOrder,0,e.length);for(let t=0,s=e.length;t<s;t++)e[t].setToSetupPose()}getRootBone(){return 0==this.bones.length?null:this.bones[0]}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.data.name==t)return i}return null}setSkinByName(t){let e=this.data.findSkin(t);if(!e)throw new Error("Skin not found: "+t);this.setSkin(e)}setSkin(t){if(t!=this.skin){if(t)if(this.skin)t.attachAll(this,this.skin);else{let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s],n=i.data.attachmentName;if(n){let e=t.getAttachment(s,n);e&&i.setAttachment(e)}}}this.skin=t,this.updateCache()}}getAttachmentByName(t,e){let s=this.data.findSlot(t);if(!s)throw new Error(`Can't find slot with name ${t}`);return this.getAttachment(s.index,e)}getAttachment(t,e){if(!e)throw new Error("attachmentName cannot be null.");if(this.skin){let s=this.skin.getAttachment(t,e);if(s)return s}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null}setAttachment(t,e){if(!t)throw new Error("slotName cannot be null.");let s=this.slots;for(let i=0,n=s.length;i<n;i++){let n=s[i];if(n.data.name==t){let s=null;if(e&&(s=this.getAttachment(i,e),!s))throw new Error("Attachment not found: "+e+", for slot: "+t);return void n.setAttachment(s)}}throw new Error("Slot not found: "+t)}findIkConstraint(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.ikConstraints.find(e=>e.data.name==t))&&void 0!==e?e:null}findTransformConstraint(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.transformConstraints.find(e=>e.data.name==t))&&void 0!==e?e:null}findPathConstraint(t){var e;if(!t)throw new Error("constraintName cannot be null.");return null!==(e=this.pathConstraints.find(e=>e.data.name==t))&&void 0!==e?e:null}findPhysicsConstraint(t){var e;if(null==t)throw new Error("constraintName cannot be null.");return null!==(e=this.physicsConstraints.find(e=>e.data.name==t))&&void 0!==e?e:null}getBoundsRect(){let e=new t.Vector2,s=new t.Vector2;return this.getBounds(e,s),{x:e.x,y:e.y,width:s.x,height:s.y}}getBounds(s,i,n=new Array(2),a=null){if(!s)throw new Error("offset cannot be null.");if(!i)throw new Error("size cannot be null.");let r=this.drawOrder,o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(let s=0,i=r.length;s<i;s++){let i=r[s];if(!i.bone.active)continue;let d=0,u=null,m=null,f=i.getAttachment();if(f instanceof t.RegionAttachment)d=8,u=t.Utils.setArraySize(n,d,0),f.computeWorldVertices(i,u,0,2),m=e.quadTriangles;else if(f instanceof t.MeshAttachment){let e=f;d=e.worldVerticesLength,u=t.Utils.setArraySize(n,d,0),e.computeWorldVertices(i,0,d,u,0,2),m=e.triangles}else if(f instanceof t.ClippingAttachment&&null!=a){a.clipStart(i,f);continue}if(u&&m){null!=a&&a.isClipping()&&(a.clipTriangles(u,m,m.length),u=a.clippedVertices,d=a.clippedVertices.length);for(let t=0,e=u.length;t<e;t+=2){let e=u[t],s=u[t+1];o=Math.min(o,e),l=Math.min(l,s),h=Math.max(h,e),c=Math.max(c,s)}}null!=a&&a.clipEndWithSlot(i)}null!=a&&a.clipEnd(),s.set(o,l),i.set(h-o,c-l)}update(t){this.time+=t}physicsTranslate(t,e){const s=this.physicsConstraints;for(let i=0,n=s.length;i<n;i++)s[i].translate(t,e)}physicsRotate(t,e,s){const i=this.physicsConstraints;for(let n=0,a=i.length;n<a;n++)i[n].rotate(t,e,s)}}let s;e.quadTriangles=[0,1,2,2,3,0],e.yDown=!1,t.Skeleton=e,function(t){t[t.none=0]="none",t[t.reset=1]="reset",t[t.update=2]="update",t[t.pose=3]="pose"}(s=t.Physics||(t.Physics={}))}(spine||(spine={})),function(t){t.SkeletonBinary=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(s){var i;let n=this.scale,a=new t.SkeletonData;a.name="";let r=new e(s),o=r.readInt32(),l=r.readInt32();a.hash=0==l&&0==o?null:l.toString(16)+o.toString(16),a.version=r.readString(),a.x=r.readFloat(),a.y=r.readFloat(),a.width=r.readFloat(),a.height=r.readFloat(),a.referenceScale=r.readFloat()*n;let h=r.readBoolean();h&&(a.fps=r.readFloat(),a.imagesPath=r.readString(),a.audioPath=r.readString());let c=0;c=r.readInt(!0);for(let t=0;t<c;t++){let t=r.readString();if(!t)throw new Error("String in string table must not be null.");r.strings.push(t)}c=r.readInt(!0);for(let e=0;e<c;e++){let s=r.readString();if(!s)throw new Error("Bone name must not be null.");let o=0==e?null:a.bones[r.readInt(!0)],l=new t.BoneData(e,s,o);l.rotation=r.readFloat(),l.x=r.readFloat()*n,l.y=r.readFloat()*n,l.scaleX=r.readFloat(),l.scaleY=r.readFloat(),l.shearX=r.readFloat(),l.shearY=r.readFloat(),l.length=r.readFloat()*n,l.inherit=r.readByte(),l.skinRequired=r.readBoolean(),h&&(t.Color.rgba8888ToColor(l.color,r.readInt32()),l.icon=null!==(i=r.readString())&&void 0!==i?i:void 0,l.visible=r.readBoolean()),a.bones.push(l)}c=r.readInt(!0);for(let e=0;e<c;e++){let s=r.readString();if(!s)throw new Error("Slot name must not be null.");let i=a.bones[r.readInt(!0)],n=new t.SlotData(e,s,i);t.Color.rgba8888ToColor(n.color,r.readInt32());let o=r.readInt32();-1!=o&&t.Color.rgb888ToColor(n.darkColor=new t.Color,o),n.attachmentName=r.readStringRef(),n.blendMode=r.readInt(!0),h&&(n.visible=r.readBoolean()),a.slots.push(n)}c=r.readInt(!0);for(let e,s=0;s<c;s++){let s=r.readString();if(!s)throw new Error("IK constraint data name must not be null.");let i=new t.IkConstraintData(s);i.order=r.readInt(!0),e=r.readInt(!0);for(let t=0;t<e;t++)i.bones.push(a.bones[r.readInt(!0)]);i.target=a.bones[r.readInt(!0)];let o=r.readByte();i.skinRequired=!!(1&o),i.bendDirection=2&o?1:-1,i.compress=!!(4&o),i.stretch=!!(8&o),i.uniform=!!(16&o),32&o&&(i.mix=64&o?r.readFloat():1),128&o&&(i.softness=r.readFloat()*n),a.ikConstraints.push(i)}c=r.readInt(!0);for(let e,s=0;s<c;s++){let s=r.readString();if(!s)throw new Error("Transform constraint data name must not be null.");let i=new t.TransformConstraintData(s);i.order=r.readInt(!0),e=r.readInt(!0);for(let t=0;t<e;t++)i.bones.push(a.bones[r.readInt(!0)]);i.target=a.bones[r.readInt(!0)];let o=r.readByte();i.skinRequired=!!(1&o),i.local=!!(2&o),i.relative=!!(4&o),8&o&&(i.offsetRotation=r.readFloat()),16&o&&(i.offsetX=r.readFloat()*n),32&o&&(i.offsetY=r.readFloat()*n),64&o&&(i.offsetScaleX=r.readFloat()),128&o&&(i.offsetScaleY=r.readFloat()),o=r.readByte(),1&o&&(i.offsetShearY=r.readFloat()),2&o&&(i.mixRotate=r.readFloat()),4&o&&(i.mixX=r.readFloat()),8&o&&(i.mixY=r.readFloat()),16&o&&(i.mixScaleX=r.readFloat()),32&o&&(i.mixScaleY=r.readFloat()),64&o&&(i.mixShearY=r.readFloat()),a.transformConstraints.push(i)}c=r.readInt(!0);for(let e,s=0;s<c;s++){let s=r.readString();if(!s)throw new Error("Path constraint data name must not be null.");let i=new t.PathConstraintData(s);i.order=r.readInt(!0),i.skinRequired=r.readBoolean(),e=r.readInt(!0);for(let t=0;t<e;t++)i.bones.push(a.bones[r.readInt(!0)]);i.target=a.slots[r.readInt(!0)];const o=r.readByte();i.positionMode=1&o,i.spacingMode=o>>1&3,i.rotateMode=o>>3&3,128&o&&(i.offsetRotation=r.readFloat()),i.position=r.readFloat(),i.positionMode==t.PositionMode.Fixed&&(i.position*=n),i.spacing=r.readFloat(),i.spacingMode!=t.SpacingMode.Length&&i.spacingMode!=t.SpacingMode.Fixed||(i.spacing*=n),i.mixRotate=r.readFloat(),i.mixX=r.readFloat(),i.mixY=r.readFloat(),a.pathConstraints.push(i)}c=r.readInt(!0);for(let e=0;e<c;e++){const e=r.readString();if(!e)throw new Error("Physics constraint data name must not be null.");const s=new t.PhysicsConstraintData(e);s.order=r.readInt(!0),s.bone=a.bones[r.readInt(!0)];let i=r.readByte();s.skinRequired=!!(1&i),2&i&&(s.x=r.readFloat()),4&i&&(s.y=r.readFloat()),8&i&&(s.rotate=r.readFloat()),16&i&&(s.scaleX=r.readFloat()),32&i&&(s.shearX=r.readFloat()),s.limit=(64&i?r.readFloat():5e3)*n,s.step=1/r.readUnsignedByte(),s.inertia=r.readFloat(),s.strength=r.readFloat(),s.damping=r.readFloat(),s.massInverse=128&i?r.readFloat():1,s.wind=r.readFloat(),s.gravity=r.readFloat(),i=r.readByte(),1&i&&(s.inertiaGlobal=!0),2&i&&(s.strengthGlobal=!0),4&i&&(s.dampingGlobal=!0),8&i&&(s.massGlobal=!0),16&i&&(s.windGlobal=!0),32&i&&(s.gravityGlobal=!0),64&i&&(s.mixGlobal=!0),s.mix=128&i?r.readFloat():1,a.physicsConstraints.push(s)}let d=this.readSkin(r,a,!0,h);d&&(a.defaultSkin=d,a.skins.push(d));{let e=a.skins.length;for(t.Utils.setArraySize(a.skins,c=e+r.readInt(!0));e<c;e++){let t=this.readSkin(r,a,!1,h);if(!t)throw new Error("readSkin() should not have returned null.");a.skins[e]=t}}c=this.linkedMeshes.length;for(let t=0;t<c;t++){let e=this.linkedMeshes[t];const s=a.skins[e.skinIndex];if(!e.parent)throw new Error("Linked mesh parent must not be null");let i=s.getAttachment(e.slotIndex,e.parent);if(!i)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?i:e.mesh,e.mesh.setParentMesh(i),null!=e.mesh.region&&e.mesh.updateRegion()}this.linkedMeshes.length=0,c=r.readInt(!0);for(let e=0;e<c;e++){let e=r.readString();if(!e)throw new Error("Event data name must not be null");let s=new t.EventData(e);s.intValue=r.readInt(!1),s.floatValue=r.readFloat(),s.stringValue=r.readString(),s.audioPath=r.readString(),s.audioPath&&(s.volume=r.readFloat(),s.balance=r.readFloat()),a.events.push(s)}c=r.readInt(!0);for(let t=0;t<c;t++){let t=r.readString();if(!t)throw new Error("Animatio name must not be null.");a.animations.push(this.readAnimation(r,t,a))}return a}readSkin(e,s,i,n){let a=null,r=0;if(i){if(r=e.readInt(!0),0==r)return null;a=new t.Skin("default")}else{let i=e.readString();if(!i)throw new Error("Skin name must not be null.");a=new t.Skin(i),n&&t.Color.rgba8888ToColor(a.color,e.readInt32()),a.bones.length=e.readInt(!0);for(let t=0,i=a.bones.length;t<i;t++)a.bones[t]=s.bones[e.readInt(!0)];for(let t=0,i=e.readInt(!0);t<i;t++)a.constraints.push(s.ikConstraints[e.readInt(!0)]);for(let t=0,i=e.readInt(!0);t<i;t++)a.constraints.push(s.transformConstraints[e.readInt(!0)]);for(let t=0,i=e.readInt(!0);t<i;t++)a.constraints.push(s.pathConstraints[e.readInt(!0)]);for(let t=0,i=e.readInt(!0);t<i;t++)a.constraints.push(s.physicsConstraints[e.readInt(!0)]);r=e.readInt(!0)}for(let t=0;t<r;t++){let t=e.readInt(!0);for(let i=0,r=e.readInt(!0);i<r;i++){let i=e.readStringRef();if(!i)throw new Error("Attachment name must not be null");let r=this.readAttachment(e,s,a,t,i,n);r&&a.setAttachment(t,i,r)}}return a}readAttachment(e,i,a,r,o,l){let h=this.scale,c=e.readByte();const d=8&c?e.readStringRef():o;if(!d)throw new Error("Attachment name must not be null");switch(7&c){case n.Region:{let s=16&c?e.readStringRef():null;const i=32&c?e.readInt32():4294967295,n=64&c?this.readSequence(e):null;let r=128&c?e.readFloat():0,o=e.readFloat(),l=e.readFloat(),u=e.readFloat(),m=e.readFloat(),f=e.readFloat(),g=e.readFloat();s||(s=d);let p=this.attachmentLoader.newRegionAttachment(a,d,s,n);return p?(p.path=s,p.x=o*h,p.y=l*h,p.scaleX=u,p.scaleY=m,p.rotation=r,p.width=f*h,p.height=g*h,t.Color.rgba8888ToColor(p.color,i),p.sequence=n,null==n&&p.updateRegion(),p):null}case n.BoundingBox:{let s=this.readVertices(e,!!(16&c)),i=l?e.readInt32():0,n=this.attachmentLoader.newBoundingBoxAttachment(a,d);return n?(n.worldVerticesLength=s.length,n.vertices=s.vertices,n.bones=s.bones,l&&t.Color.rgba8888ToColor(n.color,i),n):null}case n.Mesh:{let s=16&c?e.readStringRef():d;const i=32&c?e.readInt32():4294967295,n=64&c?this.readSequence(e):null,r=e.readInt(!0),o=this.readVertices(e,!!(128&c)),u=this.readFloatArray(e,o.length,1),m=this.readShortArray(e,3*(o.length-r-2));let f=[],g=0,p=0;l&&(f=this.readShortArray(e,e.readInt(!0)),g=e.readFloat(),p=e.readFloat()),s||(s=d);let x=this.attachmentLoader.newMeshAttachment(a,d,s,n);return x?(x.path=s,t.Color.rgba8888ToColor(x.color,i),x.bones=o.bones,x.vertices=o.vertices,x.worldVerticesLength=o.length,x.triangles=m,x.regionUVs=u,null==n&&x.updateRegion(),x.hullLength=r<<1,x.sequence=n,l&&(x.edges=f,x.width=g*h,x.height=p*h),x):null}case n.LinkedMesh:{const i=16&c?e.readStringRef():d;if(null==i)throw new Error("Path of linked mesh must not be null");const n=32&c?e.readInt32():4294967295,o=64&c?this.readSequence(e):null,u=!!(128&c),m=e.readInt(!0),f=e.readStringRef();let g=0,p=0;l&&(g=e.readFloat(),p=e.readFloat());let x=this.attachmentLoader.newMeshAttachment(a,d,i,o);return x?(x.path=i,t.Color.rgba8888ToColor(x.color,n),x.sequence=o,l&&(x.width=g*h,x.height=p*h),this.linkedMeshes.push(new s(x,m,r,f,u)),x):null}case n.Path:{const s=!!(16&c),i=!!(32&c),n=this.readVertices(e,!!(64&c)),r=t.Utils.newArray(n.length/6,0);for(let t=0,s=r.length;t<s;t++)r[t]=e.readFloat()*h;const o=l?e.readInt32():0,u=this.attachmentLoader.newPathAttachment(a,d);return u?(u.closed=s,u.constantSpeed=i,u.worldVerticesLength=n.length,u.vertices=n.vertices,u.bones=n.bones,u.lengths=r,l&&t.Color.rgba8888ToColor(u.color,o),u):null}case n.Point:{const s=e.readFloat(),i=e.readFloat(),n=e.readFloat(),r=l?e.readInt32():0,o=this.attachmentLoader.newPointAttachment(a,d);return o?(o.x=i*h,o.y=n*h,o.rotation=s,l&&t.Color.rgba8888ToColor(o.color,r),o):null}case n.Clipping:{const s=e.readInt(!0),n=this.readVertices(e,!!(16&c));let r=l?e.readInt32():0,o=this.attachmentLoader.newClippingAttachment(a,d);return o?(o.endSlot=i.slots[s],o.worldVerticesLength=n.length,o.vertices=n.vertices,o.bones=n.bones,l&&t.Color.rgba8888ToColor(o.color,r),o):null}}return null}readSequence(e){let s=new t.Sequence(e.readInt(!0));return s.start=e.readInt(!0),s.digits=e.readInt(!0),s.setupIndex=e.readInt(!0),s}readVertices(e,s){const n=this.scale,a=e.readInt(!0),r=new i;if(r.length=a<<1,!s)return r.vertices=this.readFloatArray(e,r.length,n),r;let o=new Array,l=new Array;for(let t=0;t<a;t++){let t=e.readInt(!0);l.push(t);for(let s=0;s<t;s++)l.push(e.readInt(!0)),o.push(e.readFloat()*n),o.push(e.readFloat()*n),o.push(e.readFloat())}return r.vertices=t.Utils.toFloatArray(o),r.bones=l,r}readFloatArray(t,e,s){let i=new Array(e);if(1==s)for(let s=0;s<e;s++)i[s]=t.readFloat();else for(let n=0;n<e;n++)i[n]=t.readFloat()*s;return i}readShortArray(t,e){let s=new Array(e);for(let i=0;i<e;i++)s[i]=t.readInt(!0);return s}readAnimation(e,s,i){e.readInt(!0);let n=new Array,q=this.scale;for(let s=0,i=e.readInt(!0);s<i;s++){let s=e.readInt(!0);for(let i=0,a=e.readInt(!0);i<a;i++){let i=e.readByte(),a=e.readInt(!0),r=a-1;switch(i){case b:{let i=new t.AttachmentTimeline(a,s);for(let t=0;t<a;t++)i.setFrame(t,e.readFloat(),e.readStringRef());n.push(i);break}case y:{let i=e.readInt(!0),l=new t.RGBATimeline(a,i,s),h=e.readFloat(),c=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255,m=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,h,c,d,u,m),t!=r;t++){let i=e.readFloat(),n=e.readUnsignedByte()/255,a=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,f=e.readUnsignedByte()/255;switch(e.readByte()){case D:l.setStepped(t);break;case N:o(e,l,s++,t,0,h,i,c,n,1),o(e,l,s++,t,1,h,i,d,a,1),o(e,l,s++,t,2,h,i,u,r,1),o(e,l,s++,t,3,h,i,m,f,1)}h=i,c=n,d=a,u=r,m=f}n.push(l);break}case M:{let i=e.readInt(!0),l=new t.RGBTimeline(a,i,s),h=e.readFloat(),c=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,h,c,d,u),t!=r;t++){let i=e.readFloat(),n=e.readUnsignedByte()/255,a=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255;switch(e.readByte()){case D:l.setStepped(t);break;case N:o(e,l,s++,t,0,h,i,c,n,1),o(e,l,s++,t,1,h,i,d,a,1),o(e,l,s++,t,2,h,i,u,r,1)}h=i,c=n,d=a,u=r}n.push(l);break}case S:{let i=e.readInt(!0),l=new t.RGBA2Timeline(a,i,s),h=e.readFloat(),c=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255,m=e.readUnsignedByte()/255,f=e.readUnsignedByte()/255,g=e.readUnsignedByte()/255,p=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,h,c,d,u,m,f,g,p),t!=r;t++){let i=e.readFloat(),n=e.readUnsignedByte()/255,a=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255,b=e.readUnsignedByte()/255,y=e.readUnsignedByte()/255;switch(e.readByte()){case D:l.setStepped(t);break;case N:o(e,l,s++,t,0,h,i,c,n,1),o(e,l,s++,t,1,h,i,d,a,1),o(e,l,s++,t,2,h,i,u,r,1),o(e,l,s++,t,3,h,i,m,x,1),o(e,l,s++,t,4,h,i,f,w,1),o(e,l,s++,t,5,h,i,g,b,1),o(e,l,s++,t,6,h,i,p,y,1)}h=i,c=n,d=a,u=r,m=x,f=w,g=b,p=y}n.push(l);break}case A:{let i=e.readInt(!0),l=new t.RGB2Timeline(a,i,s),h=e.readFloat(),c=e.readUnsignedByte()/255,d=e.readUnsignedByte()/255,u=e.readUnsignedByte()/255,m=e.readUnsignedByte()/255,f=e.readUnsignedByte()/255,g=e.readUnsignedByte()/255;for(let t=0,s=0;l.setFrame(t,h,c,d,u,m,f,g),t!=r;t++){let i=e.readFloat(),n=e.readUnsignedByte()/255,a=e.readUnsignedByte()/255,r=e.readUnsignedByte()/255,p=e.readUnsignedByte()/255,x=e.readUnsignedByte()/255,w=e.readUnsignedByte()/255;switch(e.readByte()){case D:l.setStepped(t);break;case N:o(e,l,s++,t,0,h,i,c,n,1),o(e,l,s++,t,1,h,i,d,a,1),o(e,l,s++,t,2,h,i,u,r,1),o(e,l,s++,t,3,h,i,m,p,1),o(e,l,s++,t,4,h,i,f,x,1),o(e,l,s++,t,5,h,i,g,w,1)}h=i,c=n,d=a,u=r,m=p,f=x,g=w}n.push(l);break}case I:{let i=new t.AlphaTimeline(a,e.readInt(!0),s),l=e.readFloat(),h=e.readUnsignedByte()/255;for(let t=0,s=0;i.setFrame(t,l,h),t!=r;t++){let n=e.readFloat(),a=e.readUnsignedByte()/255;switch(e.readByte()){case D:i.setStepped(t);break;case N:o(e,i,s++,t,0,l,n,h,a,1)}l=n,h=a}n.push(i)}}}}for(let s=0,i=e.readInt(!0);s<i;s++){let s=e.readInt(!0);for(let i=0,o=e.readInt(!0);i<o;i++){let i=e.readByte(),o=e.readInt(!0);if(i==w){let i=new t.InheritTimeline(o,s);for(let t=0;t<o;t++)i.setFrame(t,e.readFloat(),e.readByte());n.push(i);continue}let b=e.readInt(!0);switch(i){case l:n.push(a(e,new t.RotateTimeline(o,b,s),1));break;case h:n.push(r(e,new t.TranslateTimeline(o,b,s),q));break;case c:n.push(a(e,new t.TranslateXTimeline(o,b,s),q));break;case d:n.push(a(e,new t.TranslateYTimeline(o,b,s),q));break;case u:n.push(r(e,new t.ScaleTimeline(o,b,s),1));break;case m:n.push(a(e,new t.ScaleXTimeline(o,b,s),1));break;case f:n.push(a(e,new t.ScaleYTimeline(o,b,s),1));break;case g:n.push(r(e,new t.ShearTimeline(o,b,s),1));break;case p:n.push(a(e,new t.ShearXTimeline(o,b,s),1));break;case x:n.push(a(e,new t.ShearYTimeline(o,b,s),1))}}}for(let s=0,i=e.readInt(!0);s<i;s++){let s=e.readInt(!0),i=e.readInt(!0),a=i-1,r=new t.IkConstraintTimeline(i,e.readInt(!0),s),l=e.readByte(),h=e.readFloat(),c=1&l?2&l?e.readFloat():1:0,d=4&l?e.readFloat()*q:0;for(let t=0,s=0;r.setFrame(t,h,c,d,8&l?1:-1,!!(16&l),!!(32&l)),t!=a;t++){l=e.readByte();const i=e.readFloat(),n=1&l?2&l?e.readFloat():1:0,a=4&l?e.readFloat()*q:0;64&l?r.setStepped(t):128&l&&(o(e,r,s++,t,0,h,i,c,n,1),o(e,r,s++,t,1,h,i,d,a,q)),h=i,c=n,d=a}n.push(r)}for(let s=0,i=e.readInt(!0);s<i;s++){let s=e.readInt(!0),i=e.readInt(!0),a=i-1,r=new t.TransformConstraintTimeline(i,e.readInt(!0),s),l=e.readFloat(),h=e.readFloat(),c=e.readFloat(),d=e.readFloat(),u=e.readFloat(),m=e.readFloat(),f=e.readFloat();for(let t=0,s=0;r.setFrame(t,l,h,c,d,u,m,f),t!=a;t++){let i=e.readFloat(),n=e.readFloat(),a=e.readFloat(),g=e.readFloat(),p=e.readFloat(),x=e.readFloat(),w=e.readFloat();switch(e.readByte()){case D:r.setStepped(t);break;case N:o(e,r,s++,t,0,l,i,h,n,1),o(e,r,s++,t,1,l,i,c,a,1),o(e,r,s++,t,2,l,i,d,g,1),o(e,r,s++,t,3,l,i,u,p,1),o(e,r,s++,t,4,l,i,m,x,1),o(e,r,s++,t,5,l,i,f,w,1)}l=i,h=n,c=a,d=g,u=p,m=x,f=w}n.push(r)}for(let s=0,r=e.readInt(!0);s<r;s++){let s=e.readInt(!0),r=i.pathConstraints[s];for(let i=0,l=e.readInt(!0);i<l;i++){const i=e.readByte(),l=e.readInt(!0),h=e.readInt(!0);switch(i){case v:n.push(a(e,new t.PathConstraintPositionTimeline(l,h,s),r.positionMode==t.PositionMode.Fixed?q:1));break;case C:n.push(a(e,new t.PathConstraintSpacingTimeline(l,h,s),r.spacingMode==t.SpacingMode.Length||r.spacingMode==t.SpacingMode.Fixed?q:1));break;case F:let i=new t.PathConstraintMixTimeline(l,h,s),c=e.readFloat(),d=e.readFloat(),u=e.readFloat(),m=e.readFloat();for(let t=0,s=0,n=i.getFrameCount()-1;i.setFrame(t,c,d,u,m),t!=n;t++){let n=e.readFloat(),a=e.readFloat(),r=e.readFloat(),l=e.readFloat();switch(e.readByte()){case D:i.setStepped(t);break;case N:o(e,i,s++,t,0,c,n,d,a,1),o(e,i,s++,t,1,c,n,u,r,1),o(e,i,s++,t,2,c,n,m,l,1)}c=n,d=a,u=r,m=l}n.push(i)}}}for(let s=0,i=e.readInt(!0);s<i;s++){const s=e.readInt(!0)-1;for(let i=0,r=e.readInt(!0);i<r;i++){const i=e.readByte(),r=e.readInt(!0);if(i==V){const i=new t.PhysicsConstraintResetTimeline(r,s);for(let t=0;t<r;t++)i.setFrame(t,e.readFloat());n.push(i);continue}const o=e.readInt(!0);switch(i){case Y:n.push(a(e,new t.PhysicsConstraintInertiaTimeline(r,o,s),1));break;case X:n.push(a(e,new t.PhysicsConstraintStrengthTimeline(r,o,s),1));break;case P:n.push(a(e,new t.PhysicsConstraintDampingTimeline(r,o,s),1));break;case R:n.push(a(e,new t.PhysicsConstraintMassTimeline(r,o,s),1));break;case U:n.push(a(e,new t.PhysicsConstraintWindTimeline(r,o,s),1));break;case E:n.push(a(e,new t.PhysicsConstraintGravityTimeline(r,o,s),1));break;case B:n.push(a(e,new t.PhysicsConstraintMixTimeline(r,o,s),1))}}}for(let s=0,a=e.readInt(!0);s<a;s++){let s=i.skins[e.readInt(!0)];for(let i=0,a=e.readInt(!0);i<a;i++){let i=e.readInt(!0);for(let a=0,r=e.readInt(!0);a<r;a++){let a=e.readStringRef();if(!a)throw new Error("attachmentName must not be null.");let r=s.getAttachment(i,a),l=e.readByte(),h=e.readInt(!0),c=h-1;switch(l){case k:{let s=r,a=s.bones,l=s.vertices,d=a?l.length/3*2:l.length,u=e.readInt(!0),m=new t.DeformTimeline(h,u,i,s),f=e.readFloat();for(let s=0,i=0;;s++){let n,r=e.readInt(!0);if(0==r)n=a?t.Utils.newFloatArray(d):l;else{n=t.Utils.newFloatArray(d);let s=e.readInt(!0);if(r+=s,1==q)for(let t=s;t<r;t++)n[t]=e.readFloat();else for(let t=s;t<r;t++)n[t]=e.readFloat()*q;if(!a)for(let t=0,e=n.length;t<e;t++)n[t]+=l[t]}if(m.setFrame(s,f,n),s==c)break;let h=e.readFloat();switch(e.readByte()){case D:m.setStepped(s);break;case N:o(e,m,i++,s,0,f,h,0,1,1)}f=h}n.push(m);break}case T:{let s=new t.SequenceTimeline(h,i,r);for(let i=0;i<h;i++){let n=e.readFloat(),a=e.readInt32();s.setFrame(i,n,t.SequenceModeValues[15&a],a>>4,e.readFloat())}n.push(s);break}}}}}let L=e.readInt(!0);if(L>0){let s=new t.DrawOrderTimeline(L),a=i.slots.length;for(let i=0;i<L;i++){let n=e.readFloat(),r=e.readInt(!0),o=t.Utils.newArray(a,0);for(let t=a-1;t>=0;t--)o[t]=-1;let l=t.Utils.newArray(a-r,0),h=0,c=0;for(let t=0;t<r;t++){let t=e.readInt(!0);for(;h!=t;)l[c++]=h++;o[h+e.readInt(!0)]=h++}for(;h<a;)l[c++]=h++;for(let t=a-1;t>=0;t--)-1==o[t]&&(o[t]=l[--c]);s.setFrame(i,n,o)}n.push(s)}let O=e.readInt(!0);if(O>0){let s=new t.EventTimeline(O);for(let n=0;n<O;n++){let a=e.readFloat(),r=i.events[e.readInt(!0)],o=new t.Event(a,r);o.intValue=e.readInt(!1),o.floatValue=e.readFloat(),o.stringValue=e.readString(),null==o.stringValue&&(o.stringValue=r.stringValue),o.data.audioPath&&(o.volume=e.readFloat(),o.balance=e.readFloat()),s.setFrame(n,o)}n.push(s)}let W=0;for(let t=0,e=n.length;t<e;t++)W=Math.max(W,n[t].getDuration());return new t.Animation(s,n,W)}};class e{constructor(t,e=new Array,s=0,i=new DataView(t instanceof ArrayBuffer?t:t.buffer)){this.strings=e,this.index=s,this.buffer=i}readByte(){return this.buffer.getInt8(this.index++)}readUnsignedByte(){return this.buffer.getUint8(this.index++)}readShort(){let t=this.buffer.getInt16(this.index);return this.index+=2,t}readInt32(){let t=this.buffer.getInt32(this.index);return this.index+=4,t}readInt(t){let e=this.readByte(),s=127&e;return 128&e&&(e=this.readByte(),s|=(127&e)<<7,128&e&&(e=this.readByte(),s|=(127&e)<<14,128&e&&(e=this.readByte(),s|=(127&e)<<21,128&e&&(e=this.readByte(),s|=(127&e)<<28)))),t?s:s>>>1^-(1&s)}readStringRef(){let t=this.readInt(!0);return 0==t?null:this.strings[t-1]}readString(){let t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;let e="";for(let s=0;s<t;){let t=this.readUnsignedByte();switch(t>>4){case 12:case 13:e+=String.fromCharCode((31&t)<<6|63&this.readByte()),s+=2;break;case 14:e+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),s+=3;break;default:e+=String.fromCharCode(t),s++}}return e}readFloat(){let t=this.buffer.getFloat32(this.index);return this.index+=4,t}readBoolean(){return 0!=this.readByte()}}t.BinaryInput=e;class s{constructor(t,e,s,i,n){this.mesh=t,this.skinIndex=e,this.slotIndex=s,this.parent=i,this.inheritTimeline=n}}class i{constructor(t=null,e=null,s=0){this.bones=t,this.vertices=e,this.length=s}}let n;function a(t,e,s){let i=t.readFloat(),n=t.readFloat()*s;for(let a=0,r=0,l=e.getFrameCount()-1;e.setFrame(a,i,n),a!=l;a++){let l=t.readFloat(),h=t.readFloat()*s;switch(t.readByte()){case D:e.setStepped(a);break;case N:o(t,e,r++,a,0,i,l,n,h,s)}i=l,n=h}return e}function r(t,e,s){let i=t.readFloat(),n=t.readFloat()*s,a=t.readFloat()*s;for(let r=0,l=0,h=e.getFrameCount()-1;e.setFrame(r,i,n,a),r!=h;r++){let h=t.readFloat(),c=t.readFloat()*s,d=t.readFloat()*s;switch(t.readByte()){case D:e.setStepped(r);break;case N:o(t,e,l++,r,0,i,h,n,c,s),o(t,e,l++,r,1,i,h,a,d,s)}i=h,n=c,a=d}return e}function o(t,e,s,i,n,a,r,o,l,h){e.setBezier(s,i,n,a,o,t.readFloat(),t.readFloat()*h,t.readFloat(),t.readFloat()*h,r,l)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(n||(n={}));const l=0,h=1,c=2,d=3,u=4,m=5,f=6,g=7,p=8,x=9,w=10,b=0,y=1,M=2,S=3,A=4,I=5,k=0,T=1,v=0,C=1,F=2,Y=0,X=1,P=2,R=4,U=5,E=6,B=7,V=8,D=1,N=2}(spine||(spine={})),function(t){t.SkeletonBounds=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 t.Pool(()=>t.Utils.newFloatArray(16))}update(e,s){if(!e)throw new Error("skeleton cannot be null.");let i=this.boundingBoxes,n=this.polygons,a=this.polygonPool,r=e.slots,o=r.length;i.length=0,a.freeAll(n),n.length=0;for(let e=0;e<o;e++){let s=r[e];if(!s.bone.active)continue;let o=s.getAttachment();if(o instanceof t.BoundingBoxAttachment){let e=o;i.push(e);let r=a.obtain();r.length!=e.worldVerticesLength&&(r=t.Utils.newFloatArray(e.worldVerticesLength)),n.push(r),e.computeWorldVertices(s,0,e.worldVerticesLength,r,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 t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=this.polygons;for(let a=0,r=n.length;a<r;a++){let r=n[a],o=r;for(let n=0,a=r.length;n<a;n+=2){let a=o[n],r=o[n+1];t=Math.min(t,a),e=Math.min(e,r),s=Math.max(s,a),i=Math.max(i,r)}}this.minX=t,this.minY=e,this.maxX=s,this.maxY=i}aabbContainsPoint(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}aabbIntersectsSegment(t,e,s,i){let n=this.minX,a=this.minY,r=this.maxX,o=this.maxY;if(t<=n&&s<=n||e<=a&&i<=a||t>=r&&s>=r||e>=o&&i>=o)return!1;let l=(i-e)/(s-t),h=l*(n-t)+e;if(h>a&&h<o)return!0;if(h=l*(r-t)+e,h>a&&h<o)return!0;let c=(a-e)/l+t;return c>n&&c<r||(c=(o-e)/l+t,c>n&&c<r)}aabbIntersectsSkeleton(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY}containsPoint(t,e){let s=this.polygons;for(let i=0,n=s.length;i<n;i++)if(this.containsPointPolygon(s[i],t,e))return this.boundingBoxes[i];return null}containsPointPolygon(t,e,s){let i=t,n=t.length,a=n-2,r=!1;for(let t=0;t<n;t+=2){let n=i[t+1],o=i[a+1];if(n<s&&o>=s||o<s&&n>=s){let l=i[t];l+(s-n)/(o-n)*(i[a]-l)<e&&(r=!r)}a=t}return r}intersectsSegment(t,e,s,i){let n=this.polygons;for(let a=0,r=n.length;a<r;a++)if(this.intersectsSegmentPolygon(n[a],t,e,s,i))return this.boundingBoxes[a];return null}intersectsSegmentPolygon(t,e,s,i,n){let a=t,r=t.length,o=e-i,l=s-n,h=e*n-s*i,c=a[r-2],d=a[r-1];for(let t=0;t<r;t+=2){let r=a[t],u=a[t+1],m=c*u-d*r,f=c-r,g=d-u,p=o*g-l*f,x=(h*f-o*m)/p;if((x>=c&&x<=r||x>=r&&x<=c)&&(x>=e&&x<=i||x>=i&&x<=e)){let t=(h*g-l*m)/p;if((t>=d&&t<=u||t>=u&&t<=d)&&(t>=s&&t<=n||t>=n&&t<=s))return!0}c=r,d=u}return!1}getPolygon(t){if(!t)throw new Error("boundingBox cannot be null.");let e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}getWidth(){return this.maxX-this.minX}getHeight(){return this.maxY-this.minY}}}(spine||(spine={})),function(t){class e{constructor(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedUVs=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}clipStart(s,i){if(this.clipAttachment)return 0;this.clipAttachment=i;let n=i.worldVerticesLength,a=t.Utils.setArraySize(this.clippingPolygon,n);i.computeWorldVertices(s,0,n,a,0,2);let r=this.clippingPolygon;e.makeClockwise(r);let o=this.clippingPolygons=this.triangulator.decompose(r,this.triangulator.triangulate(r));for(let t=0,s=o.length;t<s;t++){let s=o[t];e.makeClockwise(s),s.push(s[0]),s.push(s[1])}return o.length}clipEndWithSlot(t){this.clipAttachment&&this.clipAttachment.endSlot==t.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 null!=this.clipAttachment}clipTriangles(t,e,s,i,n,a,r,o){let l,h,c,d,u,m;"number"==typeof e?(l=s,h=i,c=n,d=a,u=r,m=o):(l=e,h=s,c=i,d=n,u=a,m=r),c&&d&&u&&"boolean"==typeof m?this.clipTrianglesRender(t,l,h,c,d,u,m):this.clipTrianglesNoRender(t,l,h)}clipTrianglesNoRender(e,s,i){let n=this.clipOutput,a=this.clippedVertices,r=this.clippedTriangles,o=this.clippingPolygons,l=o.length,h=0;a.length=0,r.length=0;for(let c=0;c<i;c+=3){let i=s[c]<<1,d=e[i],u=e[i+1];i=s[c+1]<<1;let m=e[i],f=e[i+1];i=s[c+2]<<1;let g=e[i],p=e[i+1];for(let e=0;e<l;e++){let s=a.length;if(!this.clip(d,u,m,f,g,p,o[e],n)){let e=t.Utils.setArraySize(a,s+6);e[s]=d,e[s+1]=u,e[s+2]=m,e[s+3]=f,e[s+4]=g,e[s+5]=p,s=r.length;let i=t.Utils.setArraySize(r,s+3);i[s]=h,i[s+1]=h+1,i[s+2]=h+2,h+=3;break}{let e=n.length;if(0==e)continue;let i=e>>1,o=this.clipOutput,l=t.Utils.setArraySize(a,s+2*i);for(let t=0;t<e;t+=2,s+=2){let e=o[t],i=o[t+1];l[s]=e,l[s+1]=i}s=r.length;let c=t.Utils.setArraySize(r,s+3*(i-2));i--;for(let t=1;t<i;t++,s+=3)c[s]=h,c[s+1]=h+t,c[s+2]=h+t+1;h+=i+1}}}}clipTrianglesRender(e,s,i,n,a,r,o){let l=this.clipOutput,h=this.clippedVertices,c=this.clippedTriangles,d=this.clippingPolygons,u=d.length,m=o?12:8,f=0;h.length=0,c.length=0;for(let g=0;g<i;g+=3){let i=s[g]<<1,p=e[i],x=e[i+1],w=n[i],b=n[i+1];i=s[g+1]<<1;let y=e[i],M=e[i+1],S=n[i],A=n[i+1];i=s[g+2]<<1;let I=e[i],k=e[i+1],T=n[i],v=n[i+1];for(let e=0;e<u;e++){let s=h.length;if(!this.clip(p,x,y,M,I,k,d[e],l)){let e=t.Utils.setArraySize(h,s+3*m);e[s]=p,e[s+1]=x,e[s+2]=a.r,e[s+3]=a.g,e[s+4]=a.b,e[s+5]=a.a,o?(e[s+6]=w,e[s+7]=b,e[s+8]=r.r,e[s+9]=r.g,e[s+10]=r.b,e[s+11]=r.a,e[s+12]=y,e[s+13]=M,e[s+14]=a.r,e[s+15]=a.g,e[s+16]=a.b,e[s+17]=a.a,e[s+18]=S,e[s+19]=A,e[s+20]=r.r,e[s+21]=r.g,e[s+22]=r.b,e[s+23]=r.a,e[s+24]=I,e[s+25]=k,e[s+26]=a.r,e[s+27]=a.g,e[s+28]=a.b,e[s+29]=a.a,e[s+30]=T,e[s+31]=v,e[s+32]=r.r,e[s+33]=r.g,e[s+34]=r.b,e[s+35]=r.a):(e[s+6]=w,e[s+7]=b,e[s+8]=y,e[s+9]=M,e[s+10]=a.r,e[s+11]=a.g,e[s+12]=a.b,e[s+13]=a.a,e[s+14]=S,e[s+15]=A,e[s+16]=I,e[s+17]=k,e[s+18]=a.r,e[s+19]=a.g,e[s+20]=a.b,e[s+21]=a.a,e[s+22]=T,e[s+23]=v),s=c.length;let i=t.Utils.setArraySize(c,s+3);i[s]=f,i[s+1]=f+1,i[s+2]=f+2,f+=3;break}{let e=l.length;if(0==e)continue;let i=M-k,n=I-y,d=p-I,u=k-x,g=1/(i*d+n*(x-k)),C=e>>1,F=this.clipOutput,Y=t.Utils.setArraySize(h,s+C*m);for(let t=0;t<e;t+=2,s+=m){let e=F[t],l=F[t+1];Y[s]=e,Y[s+1]=l,Y[s+2]=a.r,Y[s+3]=a.g,Y[s+4]=a.b,Y[s+5]=a.a;let h=e-I,c=l-k,m=(i*h+n*c)*g,f=(u*h+d*c)*g,p=1-m-f;Y[s+6]=w*m+S*f+T*p,Y[s+7]=b*m+A*f+v*p,o&&(Y[s+8]=r.r,Y[s+9]=r.g,Y[s+10]=r.b,Y[s+11]=r.a)}s=c.length;let X=t.Utils.setArraySize(c,s+3*(C-2));C--;for(let t=1;t<C;t++,s+=3)X[s]=f,X[s+1]=f+t,X[s+2]=f+t+1;f+=C+1}}}}clipTrianglesUnpacked(e,s,i,n){let a=this.clipOutput,r=this.clippedVertices,o=this.clippedUVs,l=this.clippedTriangles,h=this.clippingPolygons,c=h.length,d=0;r.length=0,o.length=0,l.length=0;for(let u=0;u<i;u+=3){let i=s[u]<<1,m=e[i],f=e[i+1],g=n[i],p=n[i+1];i=s[u+1]<<1;let x=e[i],w=e[i+1],b=n[i],y=n[i+1];i=s[u+2]<<1;let M=e[i],S=e[i+1],A=n[i],I=n[i+1];for(let e=0;e<c;e++){let s=r.length;if(!this.clip(m,f,x,w,M,S,h[e],a)){let e=t.Utils.setArraySize(r,s+6);e[s]=m,e[s+1]=f,e[s+2]=x,e[s+3]=w,e[s+4]=M,e[s+5]=S;let i=t.Utils.setArraySize(o,s+6);i[s]=g,i[s+1]=p,i[s+2]=b,i[s+3]=y,i[s+4]=A,i[s+5]=I,s=l.length;let n=t.Utils.setArraySize(l,s+3);n[s]=d,n[s+1]=d+1,n[s+2]=d+2,d+=3;break}{let e=a.length;if(0==e)continue;let i=w-S,n=M-x,h=m-M,c=S-f,u=1/(i*h+n*(f-S)),k=e>>1,T=this.clipOutput,v=t.Utils.setArraySize(r,s+2*k),C=t.Utils.setArraySize(o,s+2*k);for(let t=0;t<e;t+=2,s+=2){let e=T[t],a=T[t+1];v[s]=e,v[s+1]=a;let r=e-M,o=a-S,l=(i*r+n*o)*u,d=(c*r+h*o)*u,m=1-l-d;C[s]=g*l+b*d+A*m,C[s+1]=p*l+y*d+I*m}s=l.length;let F=t.Utils.setArraySize(l,s+3*(k-2));k--;for(let t=1;t<k;t++,s+=3)F[s]=d,F[s+1]=d+t,F[s+2]=d+t+1;d+=k+1}}}}clip(t,e,s,i,n,a,r,o){let l,h=o,c=!1;r.length%4>=2?(l=o,o=this.scratch):l=this.scratch,l.length=0,l.push(t),l.push(e),l.push(s),l.push(i),l.push(n),l.push(a),l.push(t),l.push(e),o.length=0;let d=r.length-4,u=r;for(let t=0;;t+=2){let e=u[t],s=u[t+1],i=e-u[t+2],n=s-u[t+3],a=o.length,r=l;for(let t=0,a=l.length-2;t<a;){let a=r[t],l=r[t+1];t+=2;let h=r[t],d=r[t+1],u=n*(e-h)>i*(s-d),m=n*(e-a)-i*(s-l);if(m>0){if(u){o.push(h),o.push(d);continue}let t=h-a,e=d-l,s=m/(t*n-e*i);if(!(s>=0&&s<=1)){o.push(h),o.push(d);continue}o.push(a+t*s),o.push(l+e*s)}else if(u){let t=h-a,e=d-l,s=m/(t*n-e*i);if(!(s>=0&&s<=1)){o.push(h),o.push(d);continue}o.push(a+t*s),o.push(l+e*s),o.push(h),o.push(d)}c=!0}if(a==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),t==d)break;let m=o;(o=l).length=0,l=m}if(h!=o){h.length=0;for(let t=0,e=o.length-2;t<e;t++)h[t]=o[t]}else h.length=h.length-2;return c}static makeClockwise(t){let e=t,s=t.length,i=e[s-2]*e[1]-e[0]*e[s-1],n=0,a=0,r=0,o=0;for(let t=0,l=s-3;t<l;t+=2)n=e[t],a=e[t+1],r=e[t+2],o=e[t+3],i+=n*o-r*a;if(!(i<0))for(let t=0,i=s-2,n=s>>1;t<n;t+=2){let s=e[t],n=e[t+1],a=i-t;e[t]=e[a],e[t+1]=e[a+1],e[a]=s,e[a+1]=n}}}t.SkeletonClipping=e}(spine||(spine={})),function(t){t.SkeletonData=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.physicsConstraints=new Array,this.x=0,this.y=0,this.width=0,this.height=0,this.referenceScale=100,this.version=null,this.hash=null,this.fps=0,this.imagesPath=null,this.audioPath=null}findBone(t){if(!t)throw new Error("boneName cannot be null.");let e=this.bones;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findSlot(t){if(!t)throw new Error("slotName cannot be null.");let e=this.slots;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findSkin(t){if(!t)throw new Error("skinName cannot be null.");let e=this.skins;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findEvent(t){if(!t)throw new Error("eventDataName cannot be null.");let e=this.events;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findAnimation(t){if(!t)throw new Error("animationName cannot be null.");let e=this.animations;for(let s=0,i=e.length;s<i;s++){let i=e[s];if(i.name==t)return i}return null}findIkConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.ikConstraints;for(let s=0,i=e.length;s<i;s++){const i=e[s];if(i.name==t)return i}return null}findTransformConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.transformConstraints;for(let s=0,i=e.length;s<i;s++){const i=e[s];if(i.name==t)return i}return null}findPathConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.pathConstraints;for(let s=0,i=e.length;s<i;s++){const i=e[s];if(i.name==t)return i}return null}findPhysicsConstraint(t){if(!t)throw new Error("constraintName cannot be null.");const e=this.physicsConstraints;for(let s=0,i=e.length;s<i;s++){const i=e[s];if(i.name==t)return i}return null}}}(spine||(spine={})),function(t){t.SkeletonJson=class{constructor(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}readSkeletonData(e){var s,i;let n=this.scale,r=new t.SkeletonData,o="string"==typeof e?JSON.parse(e):e,l=o.skeleton;if(l&&(r.hash=l.hash,r.version=l.spine,r.x=l.x,r.y=l.y,r.width=l.width,r.height=l.height,r.referenceScale=a(l,"referenceScale",100)*n,r.fps=l.fps,r.imagesPath=null!==(s=l.images)&&void 0!==s?s:null,r.audioPath=null!==(i=l.audio)&&void 0!==i?i:null),o.bones)for(let e=0;e<o.bones.length;e++){let s=o.bones[e],i=null,l=a(s,"parent",null);l&&(i=r.findBone(l));let h=new t.BoneData(r.bones.length,s.name,i);h.length=a(s,"length",0)*n,h.x=a(s,"x",0)*n,h.y=a(s,"y",0)*n,h.rotation=a(s,"rotation",0),h.scaleX=a(s,"scaleX",1),h.scaleY=a(s,"scaleY",1),h.shearX=a(s,"shearX",0),h.shearY=a(s,"shearY",0),h.inherit=t.Utils.enumValue(t.Inherit,a(s,"inherit","Normal")),h.skinRequired=a(s,"skin",!1);let c=a(s,"color",null);c&&h.color.setFromString(c),r.bones.push(h)}if(o.slots)for(let e=0;e<o.slots.length;e++){let s=o.slots[e],i=s.name,n=r.findBone(s.bone);if(!n)throw new Error(`Couldn't find bone ${s.bone} for slot ${i}`);let l=new t.SlotData(r.slots.length,i,n),h=a(s,"color",null);h&&l.color.setFromString(h);let c=a(s,"dark",null);c&&(l.darkColor=t.Color.fromString(c)),l.attachmentName=a(s,"attachment",null),l.blendMode=t.Utils.enumValue(t.BlendMode,a(s,"blend","normal")),l.visible=a(s,"visible",!0),r.slots.push(l)}if(o.ik)for(let e=0;e<o.ik.length;e++){let s=o.ik[e],i=new t.IkConstraintData(s.name);i.order=a(s,"order",0),i.skinRequired=a(s,"skin",!1);for(let t=0;t<s.bones.length;t++){let e=r.findBone(s.bones[t]);if(!e)throw new Error(`Couldn't find bone ${s.bones[t]} for IK constraint ${s.name}.`);i.bones.push(e)}let l=r.findBone(s.target);if(!l)throw new Error(`Couldn't find target bone ${s.target} for IK constraint ${s.name}.`);i.target=l,i.mix=a(s,"mix",1),i.softness=a(s,"softness",0)*n,i.bendDirection=a(s,"bendPositive",!0)?1:-1,i.compress=a(s,"compress",!1),i.stretch=a(s,"stretch",!1),i.uniform=a(s,"uniform",!1),r.ikConstraints.push(i)}if(o.transform)for(let e=0;e<o.transform.length;e++){let s=o.transform[e],i=new t.TransformConstraintData(s.name);i.order=a(s,"order",0),i.skinRequired=a(s,"skin",!1);for(let t=0;t<s.bones.length;t++){let e=s.bones[t],n=r.findBone(e);if(!n)throw new Error(`Couldn't find bone ${e} for transform constraint ${s.name}.`);i.bones.push(n)}let l=s.target,h=r.findBone(l);if(!h)throw new Error(`Couldn't find target bone ${l} for transform constraint ${s.name}.`);i.target=h,i.local=a(s,"local",!1),i.relative=a(s,"relative",!1),i.offsetRotation=a(s,"rotation",0),i.offsetX=a(s,"x",0)*n,i.offsetY=a(s,"y",0)*n,i.offsetScaleX=a(s,"scaleX",0),i.offsetScaleY=a(s,"scaleY",0),i.offsetShearY=a(s,"shearY",0),i.mixRotate=a(s,"mixRotate",1),i.mixX=a(s,"mixX",1),i.mixY=a(s,"mixY",i.mixX),i.mixScaleX=a(s,"mixScaleX",1),i.mixScaleY=a(s,"mixScaleY",i.mixScaleX),i.mixShearY=a(s,"mixShearY",1),r.transformConstraints.push(i)}if(o.path)for(let e=0;e<o.path.length;e++){let s=o.path[e],i=new t.PathConstraintData(s.name);i.order=a(s,"order",0),i.skinRequired=a(s,"skin",!1);for(let t=0;t<s.bones.length;t++){let e=s.bones[t],n=r.findBone(e);if(!n)throw new Error(`Couldn't find bone ${e} for path constraint ${s.name}.`);i.bones.push(n)}let l=s.target,h=r.findSlot(l);if(!h)throw new Error(`Couldn't find target slot ${l} for path constraint ${s.name}.`);i.target=h,i.positionMode=t.Utils.enumValue(t.PositionMode,a(s,"positionMode","Percent")),i.spacingMode=t.Utils.enumValue(t.SpacingMode,a(s,"spacingMode","Length")),i.rotateMode=t.Utils.enumValue(t.RotateMode,a(s,"rotateMode","Tangent")),i.offsetRotation=a(s,"rotation",0),i.position=a(s,"position",0),i.positionMode==t.PositionMode.Fixed&&(i.position*=n),i.spacing=a(s,"spacing",0),i.spacingMode!=t.SpacingMode.Length&&i.spacingMode!=t.SpacingMode.Fixed||(i.spacing*=n),i.mixRotate=a(s,"mixRotate",1),i.mixX=a(s,"mixX",1),i.mixY=a(s,"mixY",i.mixX),r.pathConstraints.push(i)}if(o.physics)for(let e=0;e<o.physics.length;e++){const s=o.physics[e],i=new t.PhysicsConstraintData(s.name);i.order=a(s,"order",0),i.skinRequired=a(s,"skin",!1);const l=s.bone,h=r.findBone(l);if(null==h)throw new Error("Physics bone not found: "+l);i.bone=h,i.x=a(s,"x",0),i.y=a(s,"y",0),i.rotate=a(s,"rotate",0),i.scaleX=a(s,"scaleX",0),i.shearX=a(s,"shearX",0),i.limit=a(s,"limit",5e3)*n,i.step=1/a(s,"fps",60),i.inertia=a(s,"inertia",1),i.strength=a(s,"strength",100),i.damping=a(s,"damping",1),i.massInverse=1/a(s,"mass",1),i.wind=a(s,"wind",0),i.gravity=a(s,"gravity",0),i.mix=a(s,"mix",1),i.inertiaGlobal=a(s,"inertiaGlobal",!1),i.strengthGlobal=a(s,"strengthGlobal",!1),i.dampingGlobal=a(s,"dampingGlobal",!1),i.massGlobal=a(s,"massGlobal",!1),i.windGlobal=a(s,"windGlobal",!1),i.gravityGlobal=a(s,"gravityGlobal",!1),i.mixGlobal=a(s,"mixGlobal",!1),r.physicsConstraints.push(i)}if(o.skins)for(let e=0;e<o.skins.length;e++){let s=o.skins[e],i=new t.Skin(s.name);if(s.bones)for(let t=0;t<s.bones.length;t++){let e=s.bones[t],n=r.findBone(e);if(!n)throw new Error(`Couldn't find bone ${e} for skin ${s.name}.`);i.bones.push(n)}if(s.ik)for(let t=0;t<s.ik.length;t++){let e=s.ik[t],n=r.findIkConstraint(e);if(!n)throw new Error(`Couldn't find IK constraint ${e} for skin ${s.name}.`);i.constraints.push(n)}if(s.transform)for(let t=0;t<s.transform.length;t++){let e=s.transform[t],n=r.findTransformConstraint(e);if(!n)throw new Error(`Couldn't find transform constraint ${e} for skin ${s.name}.`);i.constraints.push(n)}if(s.path)for(let t=0;t<s.path.length;t++){let e=s.path[t],n=r.findPathConstraint(e);if(!n)throw new Error(`Couldn't find path constraint ${e} for skin ${s.name}.`);i.constraints.push(n)}if(s.physics)for(let t=0;t<s.physics.length;t++){let e=s.physics[t],n=r.findPhysicsConstraint(e);if(!n)throw new Error(`Couldn't find physics constraint ${e} for skin ${s.name}.`);i.constraints.push(n)}for(let t in s.attachments){let e=r.findSlot(t);if(!e)throw new Error(`Couldn't find slot ${t} for skin ${s.name}.`);let n=s.attachments[t];for(let t in n){let s=this.readAttachment(n[t],i,e.index,t,r);s&&i.setAttachment(e.index,t,s)}}r.skins.push(i),"default"==i.name&&(r.defaultSkin=i)}for(let t=0,e=this.linkedMeshes.length;t<e;t++){let e=this.linkedMeshes[t],s=e.skin?r.findSkin(e.skin):r.defaultSkin;if(!s)throw new Error(`Skin not found: ${e.skin}`);let i=s.getAttachment(e.slotIndex,e.parent);if(!i)throw new Error(`Parent mesh not found: ${e.parent}`);e.mesh.timelineAttachment=e.inheritTimeline?i:e.mesh,e.mesh.setParentMesh(i),null!=e.mesh.region&&e.mesh.updateRegion()}if(this.linkedMeshes.length=0,o.events)for(let e in o.events){let s=o.events[e],i=new t.EventData(e);i.intValue=a(s,"int",0),i.floatValue=a(s,"float",0),i.stringValue=a(s,"string",""),i.audioPath=a(s,"audio",null),i.audioPath&&(i.volume=a(s,"volume",1),i.balance=a(s,"balance",0)),r.events.push(i)}if(o.animations)for(let t in o.animations){let e=o.animations[t];this.readAnimation(e,t,r)}return r}readAttachment(s,i,n,r,o){let l=this.scale;switch(r=a(s,"name",r),a(s,"type","region")){case"region":{let t=a(s,"path",r),e=this.readSequence(a(s,"sequence",null)),n=this.attachmentLoader.newRegionAttachment(i,r,t,e);if(!n)return null;n.path=t,n.x=a(s,"x",0)*l,n.y=a(s,"y",0)*l,n.scaleX=a(s,"scaleX",1),n.scaleY=a(s,"scaleY",1),n.rotation=a(s,"rotation",0),n.width=s.width*l,n.height=s.height*l,n.sequence=e;let o=a(s,"color",null);return o&&n.color.setFromString(o),null!=n.region&&n.updateRegion(),n}case"boundingbox":{let t=this.attachmentLoader.newBoundingBoxAttachment(i,r);if(!t)return null;this.readVertices(s,t,s.vertexCount<<1);let e=a(s,"color",null);return e&&t.color.setFromString(e),t}case"mesh":case"linkedmesh":{let t=a(s,"path",r),o=this.readSequence(a(s,"sequence",null)),h=this.attachmentLoader.newMeshAttachment(i,r,t,o);if(!h)return null;h.path=t;let c=a(s,"color",null);c&&h.color.setFromString(c),h.width=a(s,"width",0)*l,h.height=a(s,"height",0)*l,h.sequence=o;let d=a(s,"parent",null);if(d)return this.linkedMeshes.push(new e(h,a(s,"skin",null),n,d,a(s,"timelines",!0))),h;let u=s.uvs;return this.readVertices(s,h,u.length),h.triangles=s.triangles,h.regionUVs=u,null!=h.region&&h.updateRegion(),h.edges=a(s,"edges",null),h.hullLength=2*a(s,"hull",0),h}case"path":{let e=this.attachmentLoader.newPathAttachment(i,r);if(!e)return null;e.closed=a(s,"closed",!1),e.constantSpeed=a(s,"constantSpeed",!0);let n=s.vertexCount;this.readVertices(s,e,n<<1);let o=t.Utils.newArray(n/3,0);for(let t=0;t<s.lengths.length;t++)o[t]=s.lengths[t]*l;e.lengths=o;let h=a(s,"color",null);return h&&e.color.setFromString(h),e}case"point":{let t=this.attachmentLoader.newPointAttachment(i,r);if(!t)return null;t.x=a(s,"x",0)*l,t.y=a(s,"y",0)*l,t.rotation=a(s,"rotation",0);let e=a(s,"color",null);return e&&t.color.setFromString(e),t}case"clipping":{let t=this.attachmentLoader.newClippingAttachment(i,r);if(!t)return null;let e=a(s,"end",null);e&&(t.endSlot=o.findSlot(e));let n=s.vertexCount;this.readVertices(s,t,n<<1);let l=a(s,"color",null);return l&&t.color.setFromString(l),t}}return null}readSequence(e){if(null==e)return null;let s=new t.Sequence(a(e,"count",0));return s.start=a(e,"start",1),s.digits=a(e,"digits",0),s.setupIndex=a(e,"setup",0),s}readVertices(e,s,i){let n=this.scale;s.worldVerticesLength=i;let a=e.vertices;if(i==a.length){let e=t.Utils.toFloatArray(a);if(1!=n)for(let t=0,s=a.length;t<s;t++)e[t]*=n;return void(s.vertices=e)}let r=new Array,o=new Array;for(let t=0,e=a.length;t<e;){let e=a[t++];o.push(e);for(let s=t+4*e;t<s;t+=4)o.push(a[t]),r.push(a[t+1]*n),r.push(a[t+2]*n),r.push(a[t+3])}s.bones=o,s.vertices=t.Utils.toFloatArray(r)}readAnimation(e,r,o){let l=this.scale,h=new Array;if(e.slots)for(let i in e.slots){let r=e.slots[i],l=o.findSlot(i);if(!l)throw new Error("Slot not found: "+i);let c=l.index;for(let e in r){let i=r[e];if(!i)continue;let o=i.length;if("attachment"==e){let e=new t.AttachmentTimeline(o,c);for(let t=0;t<o;t++){let s=i[t];e.setFrame(t,a(s,"time",0),a(s,"name",null))}h.push(e)}else if("rgba"==e){let e=new t.RGBATimeline(o,o<<2,c),s=i[0],r=a(s,"time",0),l=t.Color.fromString(s.color);for(let o=0,h=0;;o++){e.setFrame(o,r,l.r,l.g,l.b,l.a);let c=i[o+1];if(!c){e.shrink(h);break}let d=a(c,"time",0),u=t.Color.fromString(c.color),m=s.curve;m&&(h=n(m,e,h,o,0,r,d,l.r,u.r,1),h=n(m,e,h,o,1,r,d,l.g,u.g,1),h=n(m,e,h,o,2,r,d,l.b,u.b,1),h=n(m,e,h,o,3,r,d,l.a,u.a,1)),r=d,l=u,s=c}h.push(e)}else if("rgb"==e){let e=new t.RGBTimeline(o,3*o,c),s=i[0],r=a(s,"time",0),l=t.Color.fromString(s.color);for(let o=0,h=0;;o++){e.setFrame(o,r,l.r,l.g,l.b);let c=i[o+1];if(!c){e.shrink(h);break}let d=a(c,"time",0),u=t.Color.fromString(c.color),m=s.curve;m&&(h=n(m,e,h,o,0,r,d,l.r,u.r,1),h=n(m,e,h,o,1,r,d,l.g,u.g,1),h=n(m,e,h,o,2,r,d,l.b,u.b,1)),r=d,l=u,s=c}h.push(e)}else if("alpha"==e)h.push(s(i,new t.AlphaTimeline(o,o,c),0,1));else if("rgba2"==e){let e=new t.RGBA2Timeline(o,7*o,c),s=i[0],r=a(s,"time",0),l=t.Color.fromString(s.light),d=t.Color.fromString(s.dark);for(let o=0,h=0;;o++){e.setFrame(o,r,l.r,l.g,l.b,l.a,d.r,d.g,d.b);let c=i[o+1];if(!c){e.shrink(h);break}let u=a(c,"time",0),m=t.Color.fromString(c.light),f=t.Color.fromString(c.dark),g=s.curve;g&&(h=n(g,e,h,o,0,r,u,l.r,m.r,1),h=n(g,e,h,o,1,r,u,l.g,m.g,1),h=n(g,e,h,o,2,r,u,l.b,m.b,1),h=n(g,e,h,o,3,r,u,l.a,m.a,1),h=n(g,e,h,o,4,r,u,d.r,f.r,1),h=n(g,e,h,o,5,r,u,d.g,f.g,1),h=n(g,e,h,o,6,r,u,d.b,f.b,1)),r=u,l=m,d=f,s=c}h.push(e)}else if("rgb2"==e){let e=new t.RGB2Timeline(o,6*o,c),s=i[0],r=a(s,"time",0),l=t.Color.fromString(s.light),d=t.Color.fromString(s.dark);for(let o=0,h=0;;o++){e.setFrame(o,r,l.r,l.g,l.b,d.r,d.g,d.b);let c=i[o+1];if(!c){e.shrink(h);break}let u=a(c,"time",0),m=t.Color.fromString(c.light),f=t.Color.fromString(c.dark),g=s.curve;g&&(h=n(g,e,h,o,0,r,u,l.r,m.r,1),h=n(g,e,h,o,1,r,u,l.g,m.g,1),h=n(g,e,h,o,2,r,u,l.b,m.b,1),h=n(g,e,h,o,3,r,u,d.r,f.r,1),h=n(g,e,h,o,4,r,u,d.g,f.g,1),h=n(g,e,h,o,5,r,u,d.b,f.b,1)),r=u,l=m,d=f,s=c}h.push(e)}}}if(e.bones)for(let n in e.bones){let r=e.bones[n],c=o.findBone(n);if(!c)throw new Error("Bone not found: "+n);let d=c.index;for(let e in r){let n=r[e],o=n.length;if(0!=o)if("rotate"===e)h.push(s(n,new t.RotateTimeline(o,o,d),0,1));else if("translate"===e){let e=new t.TranslateTimeline(o,o<<1,d);h.push(i(n,e,"x","y",0,l))}else if("translatex"===e){let e=new t.TranslateXTimeline(o,o,d);h.push(s(n,e,0,l))}else if("translatey"===e){let e=new t.TranslateYTimeline(o,o,d);h.push(s(n,e,0,l))}else if("scale"===e){let e=new t.ScaleTimeline(o,o<<1,d);h.push(i(n,e,"x","y",1,1))}else if("scalex"===e){let e=new t.ScaleXTimeline(o,o,d);h.push(s(n,e,1,1))}else if("scaley"===e){let e=new t.ScaleYTimeline(o,o,d);h.push(s(n,e,1,1))}else if("shear"===e){let e=new t.ShearTimeline(o,o<<1,d);h.push(i(n,e,"x","y",0,1))}else if("shearx"===e){let e=new t.ShearXTimeline(o,o,d);h.push(s(n,e,0,1))}else if("sheary"===e){let e=new t.ShearYTimeline(o,o,d);h.push(s(n,e,0,1))}else if("inherit"===e){let e=new t.InheritTimeline(o,c.index);for(let s=0;s<n.length;s++){let i=n[s];e.setFrame(s,a(i,"time",0),t.Utils.enumValue(t.Inherit,a(i,"inherit","Normal")))}h.push(e)}}}if(e.ik)for(let s in e.ik){let i=e.ik[s],r=i[0];if(!r)continue;let c=o.findIkConstraint(s);if(!c)throw new Error("IK Constraint not found: "+s);let d=o.ikConstraints.indexOf(c),u=new t.IkConstraintTimeline(i.length,i.length<<1,d),m=a(r,"time",0),f=a(r,"mix",1),g=a(r,"softness",0)*l;for(let t=0,e=0;;t++){u.setFrame(t,m,f,g,a(r,"bendPositive",!0)?1:-1,a(r,"compress",!1),a(r,"stretch",!1));let s=i[t+1];if(!s){u.shrink(e);break}let o=a(s,"time",0),h=a(s,"mix",1),c=a(s,"softness",0)*l,d=r.curve;d&&(e=n(d,u,e,t,0,m,o,f,h,1),e=n(d,u,e,t,1,m,o,g,c,l)),m=o,f=h,g=c,r=s}h.push(u)}if(e.transform)for(let s in e.transform){let i=e.transform[s],r=i[0];if(!r)continue;let l=o.findTransformConstraint(s);if(!l)throw new Error("Transform constraint not found: "+s);let c=o.transformConstraints.indexOf(l),d=new t.TransformConstraintTimeline(i.length,6*i.length,c),u=a(r,"time",0),m=a(r,"mixRotate",1),f=a(r,"mixX",1),g=a(r,"mixY",f),p=a(r,"mixScaleX",1),x=a(r,"mixScaleY",p),w=a(r,"mixShearY",1);for(let t=0,e=0;;t++){d.setFrame(t,u,m,f,g,p,x,w);let s=i[t+1];if(!s){d.shrink(e);break}let o=a(s,"time",0),l=a(s,"mixRotate",1),h=a(s,"mixX",1),c=a(s,"mixY",h),b=a(s,"mixScaleX",1),y=a(s,"mixScaleY",b),M=a(s,"mixShearY",1),S=r.curve;S&&(e=n(S,d,e,t,0,u,o,m,l,1),e=n(S,d,e,t,1,u,o,f,h,1),e=n(S,d,e,t,2,u,o,g,c,1),e=n(S,d,e,t,3,u,o,p,b,1),e=n(S,d,e,t,4,u,o,x,y,1),e=n(S,d,e,t,5,u,o,w,M,1)),u=o,m=l,f=h,g=c,p=b,x=y,p=b,r=s}h.push(d)}if(e.path)for(let i in e.path){let r=e.path[i],c=o.findPathConstraint(i);if(!c)throw new Error("Path constraint not found: "+i);let d=o.pathConstraints.indexOf(c);for(let e in r){let i=r[e],o=i[0];if(!o)continue;let u=i.length;if("position"===e){let e=new t.PathConstraintPositionTimeline(u,u,d);h.push(s(i,e,0,c.positionMode==t.PositionMode.Fixed?l:1))}else if("spacing"===e){let e=new t.PathConstraintSpacingTimeline(u,u,d);h.push(s(i,e,0,c.spacingMode==t.SpacingMode.Length||c.spacingMode==t.SpacingMode.Fixed?l:1))}else if("mix"===e){let e=new t.PathConstraintMixTimeline(u,3*u,d),s=a(o,"time",0),r=a(o,"mixRotate",1),l=a(o,"mixX",1),c=a(o,"mixY",l);for(let t=0,h=0;;t++){e.setFrame(t,s,r,l,c);let d=i[t+1];if(!d){e.shrink(h);break}let u=a(d,"time",0),m=a(d,"mixRotate",1),f=a(d,"mixX",1),g=a(d,"mixY",f),p=o.curve;p&&(h=n(p,e,h,t,0,s,u,r,m,1),h=n(p,e,h,t,1,s,u,l,f,1),h=n(p,e,h,t,2,s,u,c,g,1)),s=u,r=m,l=f,c=g,o=d}h.push(e)}}}if(e.physics)for(let i in e.physics){let n=e.physics[i],r=-1;if(i.length>0){let t=o.findPhysicsConstraint(i);if(!t)throw new Error("Physics constraint not found: "+i);r=o.physicsConstraints.indexOf(t)}for(let e in n){let i=n[e],o=i[0];if(!o)continue;let l,c=i.length;if("reset"==e){const e=new t.PhysicsConstraintResetTimeline(c,r);for(let t=0;null!=o;o=i[t+1],t++)e.setFrame(t,a(o,"time",0));h.push(e);continue}if("inertia"==e)l=new t.PhysicsConstraintInertiaTimeline(c,c,r);else if("strength"==e)l=new t.PhysicsConstraintStrengthTimeline(c,c,r);else if("damping"==e)l=new t.PhysicsConstraintDampingTimeline(c,c,r);else if("mass"==e)l=new t.PhysicsConstraintMassTimeline(c,c,r);else if("wind"==e)l=new t.PhysicsConstraintWindTimeline(c,c,r);else if("gravity"==e)l=new t.PhysicsConstraintGravityTimeline(c,c,r);else{if("mix"!=e)continue;l=new t.PhysicsConstraintMixTimeline(c,c,r)}h.push(s(i,l,0,1))}}if(e.attachments)for(let s in e.attachments){let i=e.attachments[s],r=o.findSkin(s);if(!r)throw new Error("Skin not found: "+s);for(let e in i){let s=i[e],c=o.findSlot(e);if(!c)throw new Error("Slot not found: "+e);let d=c.index;for(let e in s){let i=s[e],o=r.getAttachment(d,e);for(let e in i){let s=i[e],r=s[0];if(r)if("deform"==e){let e=o.bones,i=o.vertices,c=e?i.length/3*2:i.length,u=new t.DeformTimeline(s.length,s.length,d,o),m=a(r,"time",0);for(let o=0,h=0;;o++){let d,f=a(r,"vertices",null);if(f){d=t.Utils.newFloatArray(c);let s=a(r,"offset",0);if(t.Utils.arrayCopy(f,0,d,s,f.length),1!=l)for(let t=s,e=t+f.length;t<e;t++)d[t]*=l;if(!e)for(let t=0;t<c;t++)d[t]+=i[t]}else d=e?t.Utils.newFloatArray(c):i;u.setFrame(o,m,d);let g=s[o+1];if(!g){u.shrink(h);break}let p=a(g,"time",0),x=r.curve;x&&(h=n(x,u,h,o,0,m,p,0,1,1)),m=p,r=g}h.push(u)}else if("sequence"==e){let e=new t.SequenceTimeline(s.length,d,o),i=0;for(let n=0;n<s.length;n++){let o=a(r,"delay",i),l=a(r,"time",0),h=t.SequenceMode[a(r,"mode","hold")],c=a(r,"index",0);e.setFrame(n,l,h,c,o),i=o,r=s[n+1]}h.push(e)}}}}}if(e.drawOrder){let s=new t.DrawOrderTimeline(e.drawOrder.length),i=o.slots.length,n=0;for(let r=0;r<e.drawOrder.length;r++,n++){let l=e.drawOrder[r],h=null,c=a(l,"offsets",null);if(c){h=t.Utils.newArray(i,-1);let e=t.Utils.newArray(i-c.length,0),s=0,n=0;for(let t=0;t<c.length;t++){let i=c[t],a=o.findSlot(i.slot);if(!a)throw new Error("Slot not found: "+a);let r=a.index;for(;s!=r;)e[n++]=s++;h[s+i.offset]=s++}for(;s<i;)e[n++]=s++;for(let t=i-1;t>=0;t--)-1==h[t]&&(h[t]=e[--n])}s.setFrame(n,a(l,"time",0),h)}h.push(s)}if(e.events){let s=new t.EventTimeline(e.events.length),i=0;for(let n=0;n<e.events.length;n++,i++){let r=e.events[n],l=o.findEvent(r.name);if(!l)throw new Error("Event not found: "+r.name);let h=new t.Event(t.Utils.toSinglePrecision(a(r,"time",0)),l);h.intValue=a(r,"int",l.intValue),h.floatValue=a(r,"float",l.floatValue),h.stringValue=a(r,"string",l.stringValue),h.data.audioPath&&(h.volume=a(r,"volume",1),h.balance=a(r,"balance",0)),s.setFrame(i,h)}h.push(s)}let c=0;for(let t=0,e=h.length;t<e;t++)c=Math.max(c,h[t].getDuration());o.animations.push(new t.Animation(r,h,c))}};class e{constructor(t,e,s,i,n){this.mesh=t,this.skin=e,this.slotIndex=s,this.parent=i,this.inheritTimeline=n}}function s(t,e,s,i){let r=t[0],o=a(r,"time",0),l=a(r,"value",s)*i,h=0;for(let c=0;;c++){e.setFrame(c,o,l);let d=t[c+1];if(!d)return e.shrink(h),e;let u=a(d,"time",0),m=a(d,"value",s)*i;r.curve&&(h=n(r.curve,e,h,c,0,o,u,l,m,i)),o=u,l=m,r=d}}function i(t,e,s,i,r,o){let l=t[0],h=a(l,"time",0),c=a(l,s,r)*o,d=a(l,i,r)*o,u=0;for(let m=0;;m++){e.setFrame(m,h,c,d);let f=t[m+1];if(!f)return e.shrink(u),e;let g=a(f,"time",0),p=a(f,s,r)*o,x=a(f,i,r)*o,w=l.curve;w&&(u=n(w,e,u,m,0,h,g,c,p,o),u=n(w,e,u,m,1,h,g,d,x,o)),h=g,c=p,d=x,l=f}}function n(t,e,s,i,n,a,r,o,l,h){if("stepped"==t)return e.setStepped(i),s;let c=n<<2,d=t[c],u=t[c+1]*h,m=t[c+2],f=t[c+3]*h;return e.setBezier(s,i,n,a,o,d,u,m,f,r,l),s+1}function a(t,e,s){return void 0!==t[e]?t[e]:s}}(spine||(spine={})),function(t){class e{constructor(t=0,e,s){this.slotIndex=t,this.name=e,this.attachment=s}}t.SkinEntry=e;t.Skin=class{constructor(e){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,this.color=new t.Color(.99607843,.61960787,.30980393,1),!e)throw new Error("name cannot be null.");this.name=e}setAttachment(t,e,s){if(!s)throw new Error("attachment cannot be null.");let i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=s}addSkin(t){for(let e=0;e<t.bones.length;e++){let s=t.bones[e],i=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){i=!0;break}i||this.bones.push(s)}for(let e=0;e<t.constraints.length;e++){let s=t.constraints[e],i=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){i=!0;break}i||this.constraints.push(s)}let e=t.getAttachments();for(let t=0;t<e.length;t++){var s=e[t];this.setAttachment(s.slotIndex,s.name,s.attachment)}}copySkin(e){for(let t=0;t<e.bones.length;t++){let s=e.bones[t],i=!1;for(let t=0;t<this.bones.length;t++)if(this.bones[t]==s){i=!0;break}i||this.bones.push(s)}for(let t=0;t<e.constraints.length;t++){let s=e.constraints[t],i=!1;for(let t=0;t<this.constraints.length;t++)if(this.constraints[t]==s){i=!0;break}i||this.constraints.push(s)}let s=e.getAttachments();for(let e=0;e<s.length;e++){var i=s[e];i.attachment&&(i.attachment instanceof t.MeshAttachment?(i.attachment=i.attachment.newLinkedMesh(),this.setAttachment(i.slotIndex,i.name,i.attachment)):(i.attachment=i.attachment.copy(),this.setAttachment(i.slotIndex,i.name,i.attachment)))}}getAttachment(t,e){let s=this.attachments[t];return s?s[e]:null}removeAttachment(t,e){let s=this.attachments[t];s&&delete s[e]}getAttachments(){let t=new Array;for(var s=0;s<this.attachments.length;s++){let i=this.attachments[s];if(i)for(let n in i){let a=i[n];a&&t.push(new e(s,n,a))}}return t}getAttachmentsForSlot(t,s){let i=this.attachments[t];if(i)for(let n in i){let a=i[n];a&&s.push(new e(t,n,a))}}clear(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0}attachAll(t,e){let s=0;for(let i=0;i<t.slots.length;i++){let n=t.slots[i],a=n.getAttachment();if(a&&s<e.attachments.length){let t=e.attachments[s];for(let e in t){if(a==t[e]){let t=this.getAttachment(s,e);t&&n.setAttachment(t);break}}}s++}}}}(spine||(spine={})),function(t){t.Slot=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 t.Color,this.darkColor=e.darkColor?new t.Color:null,this.setToSetupPose()}getSkeleton(){return this.bone.skeleton}getAttachment(){return this.attachment}setAttachment(e){this.attachment!=e&&(e instanceof t.VertexAttachment&&this.attachment instanceof t.VertexAttachment&&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}}}(spine||(spine={})),function(t){let e;t.SlotData=class{constructor(s,i,n){if(this.index=0,this.color=new t.Color(1,1,1,1),this.darkColor=null,this.attachmentName=null,this.blendMode=e.Normal,this.visible=!0,s<0)throw new Error("index must be >= 0.");if(!i)throw new Error("name cannot be null.");if(!n)throw new Error("boneData cannot be null.");this.index=s,this.name=i,this.boneData=n}},function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(e=t.BlendMode||(t.BlendMode={}))}(spine||(spine={})),function(t){class e{constructor(t){this._image=t}getImage(){return this._image}}let s,i;t.Texture=e,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(s=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(i=t.TextureWrap||(t.TextureWrap={}));t.TextureRegion=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}};t.FakeTexture=class extends e{setFilters(t,e){}setWraps(t,e){}dispose(){}}}(spine||(spine={})),function(t){t.TextureAtlas=class{constructor(n){this.pages=new Array,this.regions=new Array;let a=new e(n),r=new Array(4),o={size:t=>{t.width=parseInt(r[1]),t.height=parseInt(r[2])},format:()=>{},filter:e=>{e.minFilter=t.Utils.enumValue(t.TextureFilter,r[1]),e.magFilter=t.Utils.enumValue(t.TextureFilter,r[2])},repeat:e=>{-1!=r[1].indexOf("x")&&(e.uWrap=t.TextureWrap.Repeat),-1!=r[1].indexOf("y")&&(e.vWrap=t.TextureWrap.Repeat)},pma:t=>{t.pma="true"==r[1]}};var l={xy:t=>{t.x=parseInt(r[1]),t.y=parseInt(r[2])},size:t=>{t.width=parseInt(r[1]),t.height=parseInt(r[2])},bounds:t=>{t.x=parseInt(r[1]),t.y=parseInt(r[2]),t.width=parseInt(r[3]),t.height=parseInt(r[4])},offset:t=>{t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2])},orig:t=>{t.originalWidth=parseInt(r[1]),t.originalHeight=parseInt(r[2])},offsets:t=>{t.offsetX=parseInt(r[1]),t.offsetY=parseInt(r[2]),t.originalWidth=parseInt(r[3]),t.originalHeight=parseInt(r[4])},rotate:t=>{let e=r[1];"true"==e?t.degrees=90:"false"!=e&&(t.degrees=parseInt(e))},index:t=>{t.index=parseInt(r[1])}};let h=a.readLine();for(;h&&0==h.trim().length;)h=a.readLine();for(;h&&0!=h.trim().length&&0!=a.readEntry(r,h);)h=a.readLine();let c=null,d=null,u=null;for(;null!==h;)if(0==h.trim().length)c=null,h=a.readLine();else if(c){let t=new i(c,h);for(;;){let e=a.readEntry(r,h=a.readLine());if(0==e)break;let s=l[r[0]];if(s)s(t);else{d||(d=[]),u||(u=[]),d.push(r[0]);let t=[];for(let s=0;s<e;s++)t.push(parseInt(r[s+1]));u.push(t)}}0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),d&&d.length>0&&u&&u.length>0&&(t.names=d,t.values=u,d=null,u=null),t.u=t.x/c.width,t.v=t.y/c.height,90==t.degrees?(t.u2=(t.x+t.height)/c.width,t.v2=(t.y+t.width)/c.height):(t.u2=(t.x+t.width)/c.width,t.v2=(t.y+t.height)/c.height),this.regions.push(t)}else{for(c=new s(h.trim());0!=a.readEntry(r,h=a.readLine());){let t=o[r[0]];t&&t(c)}this.pages.push(c)}}findRegion(t){for(let e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null}setTextures(t,e=""){for(let s of this.pages)s.setTexture(t.get(e+s.name))}dispose(){var t;for(let e=0;e<this.pages.length;e++)null===(t=this.pages[e].texture)||void 0===t||t.dispose()}};class e{constructor(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}readLine(){return this.index>=this.lines.length?null:this.lines[this.index++]}readEntry(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;let s=e.indexOf(":");if(-1==s)return 0;t[0]=e.substr(0,s).trim();for(let i=1,n=s+1;;i++){let s=e.indexOf(",",n);if(-1==s)return t[i]=e.substr(n).trim(),i;if(t[i]=e.substr(n,s-n).trim(),n=s+1,4==i)return 4}}}class s{constructor(e){this.minFilter=t.TextureFilter.Nearest,this.magFilter=t.TextureFilter.Nearest,this.uWrap=t.TextureWrap.ClampToEdge,this.vWrap=t.TextureWrap.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}setTexture(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);for(let e of this.regions)e.texture=t}}t.TextureAtlasPage=s;class i extends t.TextureRegion{constructor(t,e){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=t,this.name=e,t.regions.push(this)}}t.TextureAtlasRegion=i}(spine||(spine={})),function(t){t.TransformConstraint=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 t.Vector2,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 t=0;t<e.bones.length;t++){let i=s.findBone(e.bones[t].name);if(!i)throw new Error(`Couldn't find bone ${e.bones[t].name}.`);this.bones.push(i)}let i=s.findBone(e.target.name);if(!i)throw new Error(`Couldn't find target bone ${e.target.name}.`);this.target=i,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY}isActive(){return this.active}setToSetupPose(){const t=this.data;this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY}update(t){0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(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,i=this.mixY,n=this.mixScaleX,a=this.mixScaleY,r=this.mixShearY,o=0!=s||0!=i,l=this.target,h=l.a,c=l.b,d=l.c,u=l.d,m=h*u-c*d>0?t.MathUtils.degRad:-t.MathUtils.degRad,f=this.data.offsetRotation*m,g=this.data.offsetShearY*m,p=this.bones;for(let m=0,x=p.length;m<x;m++){let x=p[m];if(0!=e){let s=x.a,i=x.b,n=x.c,a=x.d,r=Math.atan2(d,h)-Math.atan2(n,s)+f;r>t.MathUtils.PI?r-=t.MathUtils.PI2:r<-t.MathUtils.PI&&(r+=t.MathUtils.PI2),r*=e;let o=Math.cos(r),l=Math.sin(r);x.a=o*s-l*n,x.b=o*i-l*a,x.c=l*s+o*n,x.d=l*i+o*a}if(o){let t=this.temp;l.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=(t.x-x.worldX)*s,x.worldY+=(t.y-x.worldY)*i}if(0!=n){let t=Math.sqrt(x.a*x.a+x.c*x.c);0!=t&&(t=(t+(Math.sqrt(h*h+d*d)-t+this.data.offsetScaleX)*n)/t),x.a*=t,x.c*=t}if(0!=a){let t=Math.sqrt(x.b*x.b+x.d*x.d);0!=t&&(t=(t+(Math.sqrt(c*c+u*u)-t+this.data.offsetScaleY)*a)/t),x.b*=t,x.d*=t}if(r>0){let e=x.b,s=x.d,i=Math.atan2(s,e),n=Math.atan2(u,c)-Math.atan2(d,h)-(i-Math.atan2(x.c,x.a));n>t.MathUtils.PI?n-=t.MathUtils.PI2:n<-t.MathUtils.PI&&(n+=t.MathUtils.PI2),n=i+(n+g)*r;let a=Math.sqrt(e*e+s*s);x.b=Math.cos(n)*a,x.d=Math.sin(n)*a}x.updateAppliedTransform()}}applyRelativeWorld(){let e=this.mixRotate,s=this.mixX,i=this.mixY,n=this.mixScaleX,a=this.mixScaleY,r=this.mixShearY,o=0!=s||0!=i,l=this.target,h=l.a,c=l.b,d=l.c,u=l.d,m=h*u-c*d>0?t.MathUtils.degRad:-t.MathUtils.degRad,f=this.data.offsetRotation*m,g=this.data.offsetShearY*m,p=this.bones;for(let m=0,x=p.length;m<x;m++){let x=p[m];if(0!=e){let s=x.a,i=x.b,n=x.c,a=x.d,r=Math.atan2(d,h)+f;r>t.MathUtils.PI?r-=t.MathUtils.PI2:r<-t.MathUtils.PI&&(r+=t.MathUtils.PI2),r*=e;let o=Math.cos(r),l=Math.sin(r);x.a=o*s-l*n,x.b=o*i-l*a,x.c=l*s+o*n,x.d=l*i+o*a}if(o){let t=this.temp;l.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),x.worldX+=t.x*s,x.worldY+=t.y*i}if(0!=n){let t=(Math.sqrt(h*h+d*d)-1+this.data.offsetScaleX)*n+1;x.a*=t,x.c*=t}if(0!=a){let t=(Math.sqrt(c*c+u*u)-1+this.data.offsetScaleY)*a+1;x.b*=t,x.d*=t}if(r>0){let e=Math.atan2(u,c)-Math.atan2(d,h);e>t.MathUtils.PI?e-=t.MathUtils.PI2:e<-t.MathUtils.PI&&(e+=t.MathUtils.PI2);let s=x.b,i=x.d;e=Math.atan2(i,s)+(e-t.MathUtils.PI/2+g)*r;let n=Math.sqrt(s*s+i*i);x.b=Math.cos(e)*n,x.d=Math.sin(e)*n}x.updateAppliedTransform()}}applyAbsoluteLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,r=this.target,o=this.bones;for(let l=0,h=o.length;l<h;l++){let h=o[l],c=h.arotation;0!=t&&(c+=(r.arotation-c+this.data.offsetRotation)*t);let d=h.ax,u=h.ay;d+=(r.ax-d+this.data.offsetX)*e,u+=(r.ay-u+this.data.offsetY)*s;let m=h.ascaleX,f=h.ascaleY;0!=i&&0!=m&&(m=(m+(r.ascaleX-m+this.data.offsetScaleX)*i)/m),0!=n&&0!=f&&(f=(f+(r.ascaleY-f+this.data.offsetScaleY)*n)/f);let g=h.ashearY;0!=a&&(g+=(r.ashearY-g+this.data.offsetShearY)*a),h.updateWorldTransformWith(d,u,c,m,f,h.ashearX,g)}}applyRelativeLocal(){let t=this.mixRotate,e=this.mixX,s=this.mixY,i=this.mixScaleX,n=this.mixScaleY,a=this.mixShearY,r=this.target,o=this.bones;for(let l=0,h=o.length;l<h;l++){let h=o[l],c=h.arotation+(r.arotation+this.data.offsetRotation)*t,d=h.ax+(r.ax+this.data.offsetX)*e,u=h.ay+(r.ay+this.data.offsetY)*s,m=h.ascaleX*((r.ascaleX-1+this.data.offsetScaleX)*i+1),f=h.ascaleY*((r.ascaleY-1+this.data.offsetScaleY)*n+1),g=h.ashearY+(r.ashearY+this.data.offsetShearY)*a;h.updateWorldTransformWith(d,u,c,m,f,h.ashearX,g)}}}}(spine||(spine={})),function(t){class e extends t.ConstraintData{constructor(t){super(t,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(t){this._target=t}get target(){if(this._target)return this._target;throw new Error("BoneData not set.")}}t.TransformConstraintData=e}(spine||(spine={})),function(t){class e{constructor(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool(()=>new Array),this.polygonIndicesPool=new t.Pool(()=>new Array)}triangulate(t){let s=t,i=t.length>>1,n=this.indicesArray;n.length=0;for(let t=0;t<i;t++)n[t]=t;let a=this.isConcaveArray;a.length=0;for(let t=0,r=i;t<r;++t)a[t]=e.isConcave(t,i,s,n);let r=this.triangles;for(r.length=0;i>3;){let t=i-1,o=0,l=1;for(;;){t:if(!a[o]){let r=n[t]<<1,h=n[o]<<1,c=n[l]<<1,d=s[r],u=s[r+1],m=s[h],f=s[h+1],g=s[c],p=s[c+1];for(let r=(l+1)%i;r!=t;r=(r+1)%i){if(!a[r])continue;let t=n[r]<<1,i=s[t],o=s[t+1];if(e.positiveArea(g,p,d,u,i,o)&&e.positiveArea(d,u,m,f,i,o)&&e.positiveArea(m,f,g,p,i,o))break t}break}if(0==l){do{if(!a[o])break;o--}while(o>0);break}t=o,o=l,l=(l+1)%i}r.push(n[(i+o-1)%i]),r.push(n[o]),r.push(n[(o+1)%i]),n.splice(o,1),a.splice(o,1),i--;let h=(i+o-1)%i,c=o==i?0:o;a[h]=e.isConcave(h,i,s,n),a[c]=e.isConcave(c,i,s,n)}return 3==i&&(r.push(n[2]),r.push(n[0]),r.push(n[1])),r}decompose(t,s){let i=t,n=this.convexPolygons;this.polygonPool.freeAll(n),n.length=0;let a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;let r=this.polygonIndicesPool.obtain();r.length=0;let o=this.polygonPool.obtain();o.length=0;let l=-1,h=0;for(let t=0,c=s.length;t<c;t+=3){let c=s[t]<<1,d=s[t+1]<<1,u=s[t+2]<<1,m=i[c],f=i[c+1],g=i[d],p=i[d+1],x=i[u],w=i[u+1],b=!1;if(l==c){let t=o.length-4,s=e.winding(o[t],o[t+1],o[t+2],o[t+3],x,w),i=e.winding(x,w,o[0],o[1],o[2],o[3]);s==h&&i==h&&(o.push(x),o.push(w),r.push(u),b=!0)}b||(o.length>0?(n.push(o),a.push(r)):(this.polygonPool.free(o),this.polygonIndicesPool.free(r)),o=this.polygonPool.obtain(),o.length=0,o.push(m),o.push(f),o.push(g),o.push(p),o.push(x),o.push(w),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(c),r.push(d),r.push(u),h=e.winding(m,f,g,p,x,w),l=c)}o.length>0&&(n.push(o),a.push(r));for(let t=0,s=n.length;t<s;t++){if(r=a[t],0==r.length)continue;let i=r[0],l=r[r.length-1];o=n[t];let h=o.length-4,c=o[h],d=o[h+1],u=o[h+2],m=o[h+3],f=o[0],g=o[1],p=o[2],x=o[3],w=e.winding(c,d,u,m,f,g);for(let h=0;h<s;h++){if(h==t)continue;let s=a[h];if(3!=s.length)continue;let b=s[0],y=s[1],M=s[2],S=n[h],A=S[S.length-2],I=S[S.length-1];if(b!=i||y!=l)continue;let k=e.winding(c,d,u,m,A,I),T=e.winding(A,I,f,g,p,x);k==w&&T==w&&(S.length=0,s.length=0,o.push(A),o.push(I),r.push(M),c=u,d=m,u=A,m=I,h=0)}}for(let t=n.length-1;t>=0;t--)o=n[t],0==o.length&&(n.splice(t,1),this.polygonPool.free(o),r=a[t],a.splice(t,1),this.polygonIndicesPool.free(r));return n}static isConcave(t,e,s,i){let n=i[(e+t-1)%e]<<1,a=i[t]<<1,r=i[(t+1)%e]<<1;return!this.positiveArea(s[n],s[n+1],s[a],s[a+1],s[r],s[r+1])}static positiveArea(t,e,s,i,n,a){return t*(a-i)+s*(e-a)+n*(i-e)>=0}static winding(t,e,s,i,n,a){let r=s-t,o=i-e;return n*o-a*r+r*e-t*o>=0?1:-1}}t.Triangulator=e}(spine||(spine={})),window.spine=spine;