PageSourceSearch

https://static.prts.wiki/widgets/production/SpineViewer.iuSD1U9d.js

js prts.wiki collected 2026-09-24 20:28:53 UTC 256,051 bytes, 86 lines download raw bytes

1import{r as e,t}from"./rolldown-runtime.hePW80VL.js";import"./modulepreload-polyfill.P2Xu9kJm.js";import{$r as n,Ar as r,C as i,Cr as a,Dr as o,Er as s,Gr as c,Jr as l,Kr as u,Mr as d,T as f,Tr as p,Wr as m,Zn as h,_ as g,ci as _,gi as v,h as y,hi as b,jr as x,m as S,mi as C,n as w,pi as T,pr as E,st as D,t as O,ti as k,v as A,wr as j,yr as M}from"./common.WxbwQFO0.js";import{C as N,b as P,h as F,w as I,y as L}from"./vendor.CmtdU-ui.js";import{$ as R,L as z,M as B,R as V,a as H,c as U,l as W,z as G}from"./naive-ui.xsV_t-A7.js";import{t as K}from"./defineProperty.BbfpZ9Tg.js";var q={class:`wikitable w-full`},J=d({__name:`Detail`,props:{details:{}},setup(e){function t(e){return Math.round(e)}return(n,r)=>(u(),o(`table`,q,[r[0]||(r[0]=j(`thead`,null,[j(`tr`,null,[j(`th`,null,`动画`),j(`th`,null,`持续时间(s)`),j(`th`,null,`帧数(30/s)`)])],-1)),j(`tbody`,null,[(u(!0),o(M,null,l(e.details,e=>(u(),o(`tr`,{key:e.name},[j(`td`,null,v(e.name),1),j(`td`,null,v(e.duration),1),j(`td`,null,v(t(e.duration*30)),1)]))),128))])]))}}),Y=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),X;(function(e){var t=(function(){function e(e,t,n){if(e==null)throw Error(`name cannot be null.`);if(t==null)throw Error(`timelines cannot be null.`);this.name=e,this.timelines=t,this.timelineIds=[];for(var r=0;r<t.length;r++)this.timelineIds[t[r].getPropertyId()]=!0;this.duration=n}return e.prototype.hasTimeline=function(e){return this.timelineIds[e]==1},e.prototype.apply=function(e,t,n,r,i,a,o,s){if(e==null)throw Error(`skeleton cannot be null.`);r&&this.duration!=0&&(n%=this.duration,t>0&&(t%=this.duration));for(var c=this.timelines,l=0,u=c.length;l<u;l++)c[l].apply(e,t,n,i,a,o,s)},e.binarySearch=function(e,t,n){n===void 0&&(n=1);var r=0,i=e.length/n-2;if(i==0)return n;for(var a=i>>>1;;){if(e[(a+1)*n]<=t?r=a+1:i=a,r==i)return(r+1)*n;a=r+i>>>1}},e.linearSearch=function(e,t,n){for(var r=0,i=e.length-n;r<=i;r+=n)if(e[r]>t)return r;return-1},e})();e.Animation=t;var n;(function(e){e[e.setup=0]=`setup`,e[e.first=1]=`first`,e[e.replace=2]=`replace`,e[e.add=3]=`add`})(n=e.MixBlend||(e.MixBlend={}));var r;(function(e){e[e.mixIn=0]=`mixIn`,e[e.mixOut=1]=`mixOut`})(r=e.MixDirection||(e.MixDirection={}));var i;(function(e){e[e.rotate=0]=`rotate`,e[e.translate=1]=`translate`,e[e.scale=2]=`scale`,e[e.shear=3]=`shear`,e[e.attachment=4]=`attachment`,e[e.color=5]=`color`,e[e.deform=6]=`deform`,e[e.event=7]=`event`,e[e.drawOrder=8]=`drawOrder`,e[e.ikConstraint=9]=`ikConstraint`,e[e.transformConstraint=10]=`transformConstraint`,e[e.pathConstraintPosition=11]=`pathConstraintPosition`,e[e.pathConstraintSpacing=12]=`pathConstraintSpacing`,e[e.pathConstraintMix=13]=`pathConstraintMix`,e[e.twoColor=14]=`twoColor`})(i=e.TimelineType||(e.TimelineType={}));var a=(function(){function t(n){if(n<=0)throw Error(`frameCount must be > 0: `+n);this.curves=e.Utils.newFloatArray((n-1)*t.BEZIER_SIZE)}return t.prototype.getFrameCount=function(){return this.curves.length/t.BEZIER_SIZE+1},t.prototype.setLinear=function(e){this.curves[e*t.BEZIER_SIZE]=t.LINEAR},t.prototype.setStepped=function(e){this.curves[e*t.BEZIER_SIZE]=t.STEPPED},t.prototype.getCurveType=function(e){var n=e*t.BEZIER_SIZE;if(n==this.curves.length)return t.LINEAR;var r=this.curves[n];return r==t.LINEAR?t.LINEAR:r==t.STEPPED?t.STEPPED:t.BEZIER},t.prototype.setCurve=function(e,n,r,i,a){var o=(-n*2+i)*.03,s=(-r*2+a)*.03,c=((n-i)*3+1)*.006,l=((r-a)*3+1)*.006,u=o*2+c,d=s*2+l,f=n*.3+o+c*.16666667,p=r*.3+s+l*.16666667,m=e*t.BEZIER_SIZE,h=this.curves;h[m++]=t.BEZIER;for(var g=f,_=p,v=m+t.BEZIER_SIZE-1;m<v;m+=2)h[m]=g,h[m+1]=_,f+=u,p+=d,u+=c,d+=l,g+=f,_+=p},t.prototype.getCurvePercent=function(n,r){r=e.MathUtils.clamp(r,0,1);var i=this.curves,a=n*t.BEZIER_SIZE,o=i[a];if(o==t.LINEAR)return r;
1if(o==t.STEPPED)return 0;a++;for(var s=0,c=a,l=a+t.BEZIER_SIZE-1;a<l;a+=2)if(s=i[a],s>=r){var u=void 0,d=void 0;return a==c?(u=0,d=0):(u=i[a-2],d=i[a-1]),d+(i[a+1]-d)*(r-u)/(s-u)}var f=i[a-1];return f+(1-f)*(r-s)/(1-s)},t.LINEAR=0,t.STEPPED=1,t.BEZIER=2,t.BEZIER_SIZE=19,t})();e.CurveTimeline=a,e.RotateTimeline=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t<<1),n}return a.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(e,t,n){e<<=1,this.frames[e]=t,this.frames[e+a.ROTATION]=n},a.prototype.apply=function(e,r,i,o,s,c,l){var u=this.frames,d=e.bones[this.boneIndex];if(d.active){if(i<u[0]){switch(c){case n.setup:d.rotation=d.data.rotation;return;case n.first:var f=d.data.rotation-d.rotation;d.rotation+=(f-(16384-(16384.499999999996-f/360|0))*360)*s}return}if(i>=u[u.length-a.ENTRIES]){var p=u[u.length+a.PREV_ROTATION];switch(c){case n.setup:d.rotation=d.data.rotation+p*s;break;case n.first:case n.replace:p+=d.data.rotation-d.rotation,p-=(16384-(16384.499999999996-p/360|0))*360;case n.add:d.rotation+=p*s}return}var m=t.binarySearch(u,i,a.ENTRIES),h=u[m+a.PREV_ROTATION],g=u[m],_=this.getCurvePercent((m>>1)-1,1-(i-g)/(u[m+a.PREV_TIME]-g)),v=Math.fround(u[m+a.ROTATION]-h);switch(v=h+(v-(16384-(16384.499999999996-v/360|0))*360)*_,c){case n.setup:d.rotation=d.data.rotation+(v-(16384-(16384.499999999996-v/360|0))*360)*s;break;case n.first:case n.replace:v+=d.data.rotation-d.rotation;case n.add:d.rotation+=(v-(16384-(16384.499999999996-v/360|0))*360)*s}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a})(a);var o=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*a.ENTRIES),n}return a.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},a.prototype.setFrame=function(e,t,n,r){e*=a.ENTRIES,this.frames[e]=t,this.frames[e+a.X]=n,this.frames[e+a.Y]=r},a.prototype.apply=function(e,r,i,o,s,c,l){var u=this.frames,d=e.bones[this.boneIndex];if(d.active){if(i<u[0]){switch(c){case n.setup:d.x=d.data.x,d.y=d.data.y;return;case n.first:d.x+=(d.data.x-d.x)*s,d.y+=(d.data.y-d.y)*s}return}var f=0,p=0;if(i>=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],p=u[u.length+a.PREV_Y];else{var m=t.binarySearch(u,i,a.ENTRIES);f=u[m+a.PREV_X],p=u[m+a.PREV_Y];var h=u[m],g=this.getCurvePercent(m/a.ENTRIES-1,1-(i-h)/(u[m+a.PREV_TIME]-h));f+=(u[m+a.X]-f)*g,p+=(u[m+a.Y]-p)*g}switch(c){case n.setup:d.x=d.data.x+f*s,d.y=d.data.y+p*s;break;case n.first:case n.replace:d.x+=(d.data.x+f-d.x)*s,d.y+=(d.data.y+p-d.y)*s;break;case n.add:d.x+=f*s,d.y+=p*s}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a})(a);e.TranslateTimeline=o,e.ScaleTimeline=(function(a){Y(o,a);function o(e){return a.call(this,e)||this}return o.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},o.prototype.apply=function(i,a,s,c,l,u,d){var f=this.frames,p=i.bones[this.boneIndex];if(p.active){if(s<f[0]){switch(u){case n.setup:p.scaleX=p.data.scaleX,p.scaleY=p.data.scaleY;return;case n.first:p.scaleX+=(p.data.scaleX-p.scaleX)*l,p.scaleY+=(p.data.scaleY-p.scaleY)*l}return}var m=0,h=0;if(s>=f[f.length-o.ENTRIES])m=f[f.length+o.PREV_X]*p.data.scaleX,h=f[f.length+o.PREV_Y]*p.data.scaleY;else{var g=t.binarySearch(f,s,o.ENTRIES);m=f[g+o.PREV_X],h=f[g+o.PREV_Y];var _=f[g],v=this.getCurvePercent(g/o.ENTRIES-1,1-(s-_)/(f[g+o.PREV_TIME]-_));m=(m+(f[g+o.X]-m)*v)*p.data.scaleX,h=(h+(f[g+o.Y]-h)*v)*p.data.scaleY}if(l==1)u==n.add?(p.scaleX+=m-p.data.scaleX,p.scaleY+=h-p.data.scaleY):(p.scaleX=m,p.scaleY=h);else{var y=0,b=0;if(d==r.mixOut)switch(u){case n.setup:y=p.data.scaleX,b=p.data.scaleY,p.scaleX=y+(Math.abs(m)*e.MathUtils.signum(y)-y)*l,p.scaleY=b+(Math.abs(h)*e.MathUtils.signum(b)-b)*l;break;case n.first:case n.replace:y=p.scaleX,b=p.scaleY,p.scaleX=y+(Math.abs(m)*e.MathUtils.signum(y)-y)*l,p.scaleY=b+(Math.abs(h)*e.MathUtils.signum(b)-b)*l;break;case n.add:y=p.scaleX,b=p.scaleY,p.scaleX=y+(Math.abs(m)*e.MathUtils.signum(y)-p.data.scaleX)*l,p.scaleY=b+(Math.abs(h)*e.MathUtils.signum(b)-p.data.scaleY)*l}else switch(u){case n.setup:y=Math.abs(p.data.scaleX)*e.MathUtils.signum(m),b=Math.abs(p.data.scaleY)*e.MathUtils.signum(h),p.scaleX=y+(m-y)*l,p.scaleY=b+(h-b)*l;break;case n.first:case n.replace:y=Math.abs(p.scaleX)*e.MathUtils.signum(m),b=Math.abs(p.scaleY)*e.MathUtils.signum(h),p.scaleX=y+(m-y)*l,p.scaleY=b+(h-b)*l;break;case n.add:y=e.MathUtils.signum(m),b=e.MathUtils.signum(h),p.scaleX=Math.abs(p.scaleX)*y+(m-Math.abs(p.data.scaleX)*y)*l,p.scaleY=Math.abs(p.scaleY)*b+(h-Math.abs(p.data.scaleY)*b)*l}}}},o})(o),e.ShearTimeline=(function(e){Y(r,e);function r(t){return e.call(this,t)||this}return r.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},r.prototype.apply=function(e,i,a,o,s,c,l){var u=this.frames,d=e.bones[this.boneIndex];if(d.active){if(a<u[0]){switch(c){case n.setup:d.shearX=d.data.shearX,d.shearY=d.data.shearY;return;case n.first:d.shearX+=(d.data.shearX-d.shearX)*s,d.shearY+=(d.data.shearY-d.shearY)*s}return}var f=0,p=0;if(a>=u[u.length-r.ENTRIES])f=u[u.length+r.PREV_X],p=u[u.length+r.PREV_Y];else{var m=t.binarySearch(u,a,r.ENTRIES);f=u[m+r.PREV_X],p=u[m+r.PREV_Y];
1var h=u[m],g=this.getCurvePercent(m/r.ENTRIES-1,1-(a-h)/(u[m+r.PREV_TIME]-h));f+=(u[m+r.X]-f)*g,p+=(u[m+r.Y]-p)*g}switch(c){case n.setup:d.shearX=d.data.shearX+f*s,d.shearY=d.data.shearY+p*s;break;case n.first:case n.replace:d.shearX+=(d.data.shearX+f-d.shearX)*s,d.shearY+=(d.data.shearY+p-d.shearY)*s;break;case n.add:d.shearX+=f*s,d.shearY+=p*s}}},r})(o),e.ColorTimeline=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*a.ENTRIES),n}return a.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},a.prototype.setFrame=function(e,t,n,r,i,o){e*=a.ENTRIES,this.frames[e]=t,this.frames[e+a.R]=n,this.frames[e+a.G]=r,this.frames[e+a.B]=i,this.frames[e+a.A]=o},a.prototype.apply=function(e,r,i,o,s,c,l){var u=e.slots[this.slotIndex];if(u.bone.active){var d=this.frames;if(i<d[0]){switch(c){case n.setup:u.color.setFromColor(u.data.color);return;case n.first:var f=u.color,p=u.data.color;f.add((p.r-f.r)*s,(p.g-f.g)*s,(p.b-f.b)*s,(p.a-f.a)*s)}return}var m=0,h=0,g=0,_=0;if(i>=d[d.length-a.ENTRIES]){var v=d.length;m=d[v+a.PREV_R],h=d[v+a.PREV_G],g=d[v+a.PREV_B],_=d[v+a.PREV_A]}else{var y=t.binarySearch(d,i,a.ENTRIES);m=d[y+a.PREV_R],h=d[y+a.PREV_G],g=d[y+a.PREV_B],_=d[y+a.PREV_A];var b=d[y],x=this.getCurvePercent(y/a.ENTRIES-1,1-(i-b)/(d[y+a.PREV_TIME]-b));m+=(d[y+a.R]-m)*x,h+=(d[y+a.G]-h)*x,g+=(d[y+a.B]-g)*x,_+=(d[y+a.A]-_)*x}if(s==1)u.color.set(m,h,g,_);else{var f=u.color;c==n.setup&&f.setFromColor(u.data.color),f.add((m-f.r)*s,(h-f.g)*s,(g-f.b)*s,(_-f.a)*s)}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a})(a),e.TwoColorTimeline=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*a.ENTRIES),n}return a.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(e,t,n,r,i,o,s,c,l){e*=a.ENTRIES,this.frames[e]=t,this.frames[e+a.R]=n,this.frames[e+a.G]=r,this.frames[e+a.B]=i,this.frames[e+a.A]=o,this.frames[e+a.R2]=s,this.frames[e+a.G2]=c,this.frames[e+a.B2]=l},a.prototype.apply=function(e,r,i,o,s,c,l){var u=e.slots[this.slotIndex];if(u.bone.active){var d=this.frames;if(i<d[0]){switch(c){case n.setup:u.color.setFromColor(u.data.color),u.darkColor.setFromColor(u.data.darkColor);return;case n.first:var f=u.color,p=u.darkColor,m=u.data.color,h=u.data.darkColor;f.add((m.r-f.r)*s,(m.g-f.g)*s,(m.b-f.b)*s,(m.a-f.a)*s),p.add((h.r-p.r)*s,(h.g-p.g)*s,(h.b-p.b)*s,0)}return}var g=0,_=0,v=0,y=0,b=0,x=0,S=0;if(i>=d[d.length-a.ENTRIES]){var C=d.length;g=d[C+a.PREV_R],_=d[C+a.PREV_G],v=d[C+a.PREV_B],y=d[C+a.PREV_A],b=d[C+a.PREV_R2],x=d[C+a.PREV_G2],S=d[C+a.PREV_B2]}else{var w=t.binarySearch(d,i,a.ENTRIES);g=d[w+a.PREV_R],_=d[w+a.PREV_G],v=d[w+a.PREV_B],y=d[w+a.PREV_A],b=d[w+a.PREV_R2],x=d[w+a.PREV_G2],S=d[w+a.PREV_B2];var T=d[w],E=this.getCurvePercent(w/a.ENTRIES-1,1-(i-T)/(d[w+a.PREV_TIME]-T));g+=(d[w+a.R]-g)*E,_+=(d[w+a.G]-_)*E,v+=(d[w+a.B]-v)*E,y+=(d[w+a.A]-y)*E,b+=(d[w+a.R2]-b)*E,x+=(d[w+a.G2]-x)*E,S+=(d[w+a.B2]-S)*E}if(s==1)u.color.set(g,_,v,y),u.darkColor.set(b,x,S,1);else{var f=u.color,p=u.darkColor;c==n.setup&&(f.setFromColor(u.data.color),p.setFromColor(u.data.darkColor)),f.add((g-f.r)*s,(_-f.g)*s,(v-f.b)*s,(y-f.a)*s),p.add((b-p.r)*s,(x-p.g)*s,(S-p.b)*s,0)}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a})(a),e.AttachmentTimeline=(function(){function a(t){this.frames=e.Utils.newFloatArray(t),this.attachmentNames=Array(t)}return a.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(e,t,n){this.frames[e]=t,this.attachmentNames[e]=n},a.prototype.apply=function(e,i,a,o,s,c,l){var u=e.slots[this.slotIndex];if(u.bone.active){if(l==r.mixOut){c==n.setup&&this.setAttachment(e,u,u.data.attachmentName);return}var d=this.frames;if(a<d[0]){(c==n.setup||c==n.first)&&this.setAttachment(e,u,u.data.attachmentName);return}var f=0;f=a>=d[d.length-1]?d.length-1:t.binarySearch(d,a,1)-1;var p=this.attachmentNames[f];
1e.slots[this.slotIndex].setAttachment(p==null?null:e.getAttachment(this.slotIndex,p))}},a.prototype.setAttachment=function(e,t,n){t.setAttachment(n==null?null:e.getAttachment(this.slotIndex,n))},a})();var s=null;e.DeformTimeline=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t),n.frameVertices=Array(t),s==null&&(s=e.Utils.newFloatArray(64)),n}return a.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(e,t,n){this.frames[e]=t,this.frameVertices[e]=n},a.prototype.apply=function(r,i,a,o,s,c,l){var u=r.slots[this.slotIndex];if(u.bone.active){var d=u.getAttachment();if(d instanceof e.VertexAttachment&&d.deformAttachment==this.attachment){var f=u.deform;f.length==0&&(c=n.setup);var p=this.frameVertices,m=p[0].length,h=this.frames;if(a<h[0]){var g=d;switch(c){case n.setup:f.length=0;return;case n.first:if(s==1){f.length=0;break}var _=e.Utils.setArraySize(f,m);if(g.bones==null)for(var v=g.vertices,y=0;y<m;y++)_[y]+=(v[y]-_[y])*s;else{s=1-s;for(var y=0;y<m;y++)_[y]*=s}}return}var b=e.Utils.setArraySize(f,m);if(a>=h[h.length-1]){var x=p[h.length-1];if(s==1){if(c==n.add){var g=d;if(g.bones==null)for(var v=g.vertices,S=0;S<m;S++)b[S]+=x[S]-v[S];else for(var C=0;C<m;C++)b[C]+=x[C]}else e.Utils.arrayCopy(x,0,b,0,m)}else switch(c){case n.setup:var w=d;if(w.bones==null)for(var v=w.vertices,T=0;T<m;T++){var E=v[T];b[T]=E+(x[T]-E)*s}else for(var D=0;D<m;D++)b[D]=x[D]*s;break;case n.first:case n.replace:for(var O=0;O<m;O++)b[O]+=(x[O]-b[O])*s;break;case n.add:var g=d;if(g.bones==null)for(var v=g.vertices,k=0;k<m;k++)b[k]+=(x[k]-v[k])*s;else for(var A=0;A<m;A++)b[A]+=x[A]*s}return}var j=t.binarySearch(h,a),M=p[j-1],N=p[j],P=h[j],F=this.getCurvePercent(j-1,1-(a-P)/(h[j-1]-P));if(s==1){if(c==n.add){var g=d;if(g.bones==null)for(var v=g.vertices,I=0;I<m;I++){var L=M[I];b[I]+=L+(N[I]-L)*F-v[I]}else for(var R=0;R<m;R++){var L=M[R];b[R]+=L+(N[R]-L)*F}}else for(var z=0;z<m;z++){var L=M[z];b[z]=L+(N[z]-L)*F}}else switch(c){case n.setup:var B=d;if(B.bones==null)for(var v=B.vertices,V=0;V<m;V++){var L=M[V],E=v[V];b[V]=E+(L+(N[V]-L)*F-E)*s}else for(var H=0;H<m;H++){var L=M[H];b[H]=(L+(N[H]-L)*F)*s}break;case n.first:case n.replace:for(var U=0;U<m;U++){var L=M[U];b[U]+=(L+(N[U]-L)*F-b[U])*s}break;case n.add:var g=d;if(g.bones==null)for(var v=g.vertices,W=0;W<m;W++){var L=M[W];b[W]+=(L+(N[W]-L)*F-v[W])*s}else for(var G=0;G<m;G++){var L=M[G];b[G]+=(L+(N[G]-L)*F)*s}}}}},a})(a),e.EventTimeline=(function(){function n(t){this.frames=e.Utils.newFloatArray(t),this.events=Array(t)}return n.prototype.getPropertyId=function(){return i.event<<24},n.prototype.getFrameCount=function(){return this.frames.length},n.prototype.setFrame=function(e,t){this.frames[e]=t.time,this.events[e]=t},n.prototype.apply=function(e,n,r,i,a,o,s){if(i!=null){var c=this.frames,l=this.frames.length;if(n>r)this.apply(e,n,Number.MAX_VALUE,i,a,o,s),n=-1;else if(n>=c[l-1])return;if(!(r<c[0])){var u=0;if(n<c[0])u=0;else{u=t.binarySearch(c,n);for(var d=c[u];u>0&&c[u-1]==d;)u--}for(;u<l&&r>=c[u];u++)i.push(this.events[u])}}},n})(),e.DrawOrderTimeline=(function(){function a(t){this.frames=e.Utils.newFloatArray(t),this.drawOrders=Array(t)}return a.prototype.getPropertyId=function(){return i.drawOrder<<24},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(e,t,n){this.frames[e]=t,this.drawOrders[e]=n},a.prototype.apply=function(i,a,o,s,c,l,u){var d=i.drawOrder,f=i.slots;if(u==r.mixOut){l==n.setup&&e.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length);return}var p=this.frames;if(o<p[0]){(l==n.setup||l==n.first)&&e.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length);return}var m=0;m=o>=p[p.length-1]?p.length-1:t.binarySearch(p,o)-1;var h=this.drawOrders[m];if(h==null)e.Utils.arrayCopy(f,0,d,0,f.length);else for(var g=0,_=h.length;g<_;g++)d[g]=f[h[g]]},a})(),e.IkConstraintTimeline=(function(a){Y(o,a);function o(t){var n=a.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*o.ENTRIES),n}return o.prototype.getPropertyId=function(){return(i.ikConstraint<<24)+this.ikConstraintIndex},o.prototype.setFrame=function(e,t,n,r,i,a,s){e*=o.ENTRIES,this.frames[e]=t,this.frames[e+o.MIX]=n,this.frames[e+o.SOFTNESS]=r,this.frames[e+o.BEND_DIRECTION]=i,this.frames[e+o.COMPRESS]=+!!a,this.frames[e+o.STRETCH]=+!!s},o.prototype.apply=function(e,i,a,s,c,l,u){var d=this.frames,f=e.ikConstraints[this.ikConstraintIndex];if(f.active){if(a<d[0]){switch(l){case n.setup:f.mix=f.data.mix,f.softness=f.data.softness,f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch;return;case n.first:f.mix+=(f.data.mix-f.mix)*c,f.softness+=(f.data.softness-f.softness)*c,f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch}return}if(a>=d[d.length-o.ENTRIES]){l==n.setup?(f.mix=f.data.mix+(d[d.length+o.PREV_MIX]-f.data.mix)*c,f.softness=f.data.softness+(d[d.length+o.PREV_SOFTNESS]-f.data.softness)*c,u==r.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=d[d.length+o.PREV_BEND_DIRECTION],f.compress=d[d.length+o.PREV_COMPRESS]!=0,f.stretch=d[d.length+o.PREV_STRETCH]!=0)):(f.mix+=(d[d.length+o.PREV_MIX]-f.mix)*c,f.softness+=(d[d.length+o.PREV_SOFTNESS]-f.softness)*c,u==r.mixIn&&(f.bendDirection=d[d.length+o.PREV_BEND_DIRECTION],f.compress=d[d.length+o.PREV_COMPRESS]!=0,f.stretch=d[d.length+o.PREV_STRETCH]!=0));return}var p=t.binarySearch(d,a,o.ENTRIES),m=d[p+o.PREV_MIX],h=d[p+o.PREV_SOFTNESS],g=d[p],_=this.getCurvePercent(p/o.ENTRIES-1,1-(a-g)/(d[p+o.PREV_TIME]-g));l==n.setup?(f.mix=f.data.mix+(m+(d[p+o.MIX]-m)*_-f.data.mix)*c,f.softness=f.data.softness+(h+(d[p+o.SOFTNESS]-h)*_-f.data.softness)*c,u==r.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=d[p+o.PREV_BEND_DIRECTION],f.compress=d[p+o.PREV_COMPRESS]!=0,f.stretch=d[p+o.PREV_STRETCH]!=0)):(f.mix+=(m+(d[p+o.MIX]-m)*_-f.mix)*c,f.softness+=(h+(d[p+o.SOFTNESS]-h)*_-f.softness)*c,u==r.mixIn&&(f.bendDirection=d[p+o.PREV_BEND_DIRECTION],f.compress=d[p+o.PREV_COMPRESS]!=0,f.stretch=d[p+o.PREV_STRETCH]!=0))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o})(a),e.TransformConstraintTimeline=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*a.ENTRIES),n}return a.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(e,t,n,r,i,o){e*=a.ENTRIES,this.frames[e]=t,this.frames[e+a.ROTATE]=n,this.frames[e+a.TRANSLATE]=r,this.frames[e+a.SCALE]=i,this.frames[e+a.SHEAR]=o},a.prototype.apply=function(e,r,i,o,s,c,l){var u=this.frames,d=e.transformConstraints[this.transformConstraintIndex];if(d.active){if(i<u[0]){var f=d.data;switch(c){case n.setup:d.rotateMix=f.rotateMix,d.translateMix=f.translateMix,d.scaleMix=f.scaleMix,d.shearMix=f.shearMix;return;case n.first:d.rotateMix+=(f.rotateMix-d.rotateMix)*s,d.translateMix+=(f.translateMix-d.translateMix)*s,d.scaleMix+=(f.scaleMix-d.scaleMix)*s,d.shearMix+=(f.shearMix-d.shearMix)*s}return}var p=0,m=0,h=0,g=0;if(i>=u[u.length-a.ENTRIES]){var _=u.length;p=u[_+a.PREV_ROTATE],m=u[_+a.PREV_TRANSLATE],h=u[_+a.PREV_SCALE],g=u[_+a.PREV_SHEAR]}else{var v=t.binarySearch(u,i,a.ENTRIES);p=u[v+a.PREV_ROTATE],m=u[v+a.PREV_TRANSLATE],h=u[v+a.PREV_SCALE],g=u[v+a.PREV_SHEAR];var y=u[v],b=this.getCurvePercent(v/a.ENTRIES-1,1-(i-y)/(u[v+a.PREV_TIME]-y));p+=(u[v+a.ROTATE]-p)*b,m+=(u[v+a.TRANSLATE]-m)*b,h+=(u[v+a.SCALE]-h)*b,g+=(u[v+a.SHEAR]-g)*b}if(c==n.setup){var f=d.data;d.rotateMix=f.rotateMix+(p-f.rotateMix)*s,d.translateMix=f.translateMix+(m-f.translateMix)*s,d.scaleMix=f.scaleMix+(h-f.scaleMix)*s,d.shearMix=f.shearMix+(g-f.shearMix)*s}else d.rotateMix+=(p-d.rotateMix)*s,d.translateMix+=(m-d.translateMix)*s,d.scaleMix+=(h-d.scaleMix)*s,d.shearMix+=(g-d.shearMix)*s}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a})(a);var c=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*a.ENTRIES),n}return a.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(e,t,n){e*=a.ENTRIES,this.frames[e]=t,this.frames[e+a.VALUE]=n},a.prototype.apply=function(e,r,i,o,s,c,l){var u=this.frames,d=e.pathConstraints[this.pathConstraintIndex];if(d.active){if(i<u[0]){switch(c){case n.setup:d.position=d.data.position;return;case n.first:d.position+=(d.data.position-d.position)*s}return}var f=0;if(i>=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var p=t.binarySearch(u,i,a.ENTRIES);f=u[p+a.PREV_VALUE];var m=u[p],h=this.getCurvePercent(p/a.ENTRIES-1,1-(i-m)/(u[p+a.PREV_TIME]-m));f+=(u[p+a.VALUE]-f)*h}c==n.setup?d.position=d.data.position+(f-d.data.position)*s:d.position+=(f-d.position)*s}}
1,a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a})(a);e.PathConstraintPositionTimeline=c,e.PathConstraintSpacingTimeline=(function(e){Y(r,e);function r(t){return e.call(this,t)||this}return r.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},r.prototype.apply=function(e,i,a,o,s,c,l){var u=this.frames,d=e.pathConstraints[this.pathConstraintIndex];if(d.active){if(a<u[0]){switch(c){case n.setup:d.spacing=d.data.spacing;return;case n.first:d.spacing+=(d.data.spacing-d.spacing)*s}return}var f=0;if(a>=u[u.length-r.ENTRIES])f=u[u.length+r.PREV_VALUE];else{var p=t.binarySearch(u,a,r.ENTRIES);f=u[p+r.PREV_VALUE];var m=u[p],h=this.getCurvePercent(p/r.ENTRIES-1,1-(a-m)/(u[p+r.PREV_TIME]-m));f+=(u[p+r.VALUE]-f)*h}c==n.setup?d.spacing=d.data.spacing+(f-d.data.spacing)*s:d.spacing+=(f-d.spacing)*s}},r})(c),e.PathConstraintMixTimeline=(function(r){Y(a,r);function a(t){var n=r.call(this,t)||this;return n.frames=e.Utils.newFloatArray(t*a.ENTRIES),n}return a.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(e,t,n,r){e*=a.ENTRIES,this.frames[e]=t,this.frames[e+a.ROTATE]=n,this.frames[e+a.TRANSLATE]=r},a.prototype.apply=function(e,r,i,o,s,c,l){var u=this.frames,d=e.pathConstraints[this.pathConstraintIndex];if(d.active){if(i<u[0]){switch(c){case n.setup:d.rotateMix=d.data.rotateMix,d.translateMix=d.data.translateMix;return;case n.first:d.rotateMix+=(d.data.rotateMix-d.rotateMix)*s,d.translateMix+=(d.data.translateMix-d.translateMix)*s}return}var f=0,p=0;if(i>=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],p=u[u.length+a.PREV_TRANSLATE];else{var m=t.binarySearch(u,i,a.ENTRIES);f=u[m+a.PREV_ROTATE],p=u[m+a.PREV_TRANSLATE];var h=u[m],g=this.getCurvePercent(m/a.ENTRIES-1,1-(i-h)/(u[m+a.PREV_TIME]-h));f+=(u[m+a.ROTATE]-f)*g,p+=(u[m+a.TRANSLATE]-p)*g}c==n.setup?(d.rotateMix=d.data.rotateMix+(f-d.data.rotateMix)*s,d.translateMix=d.data.translateMix+(p-d.data.translateMix)*s):(d.rotateMix+=(f-d.rotateMix)*s,d.translateMix+=(p-d.translateMix)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a})(a)})(X||(X={}));var X;(function(e){e.AnimationState=(function(){function r(r){this.tracks=[],this.timeScale=1,this.unkeyedState=0,this.events=[],this.listeners=[],this.queue=new n(this),this.propertyIDs=new e.IntSet,this.animationsChanged=!1,this.trackEntryPool=new e.Pool(function(){return new t}),this.data=r}return r.prototype.update=function(e){e*=this.timeScale;for(var t=this.tracks,n=0,r=t.length;n<r;n++){var i=t[n];if(i!=null){i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast;var a=e*i.timeScale;if(i.delay>0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}var o=i.next;if(o!=null){var s=i.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime+=i.timeScale==0?0:(s/i.timeScale+e)*o.timeScale,i.trackTime+=a,this.setCurrent(n,o,!0);o.mixingFrom!=null;)o.mixTime+=e,o=o.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&i.mixingFrom==null){t[n]=null,this.queue.end(i),this.disposeNext(i);continue}if(i.mixingFrom!=null&&this.updateMixingFrom(i,e)){var c=i.mixingFrom;for(i.mixingFrom=null,c!=null&&(c.mixingTo=null);c!=null;)this.queue.end(c),c=c.mixingFrom}i.trackTime+=a}}this.queue.drain()},r.prototype.updateMixingFrom=function(e,t){var n=e.mixingFrom;if(n==null)return!0;var r=this.updateMixingFrom(n,t);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,e.mixTime>0&&e.mixTime>=e.mixDuration?((n.totalAlpha==0||e.mixDuration==0)&&(e.mixingFrom=n.mixingFrom,n.mixingFrom!=null&&(n.mixingFrom.mixingTo=e),e.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=t*n.timeScale,e.mixTime+=t,!1)},r.prototype.apply=function(t){if(t==null)throw Error(`skeleton cannot be null.`);this.animationsChanged&&this._animationsChanged();for(var n=this.events,i=this.tracks,a=!1,o=0,s=i.length;o<s;o++){var c=i[o];if(!(c==null||c.delay>0)){a=!0;var l=o==0?e.MixBlend.first:c.mixBlend,u=c.alpha;c.mixingFrom==null?c.trackTime>=c.trackEnd&&c.next==null&&(u=0):u*=this.applyMixingFrom(c,t,l);var d=c.animationLast,f=c.getAnimationTime(),p=c.animation.timelines.length,m=c.animation.timelines;if(o==0&&u==1||l==e.MixBlend.add)for(var h=0;h<p;h++){e.Utils.webkit602BugfixHelper(u,l);var g=m[h];g instanceof e.AttachmentTimeline?this.applyAttachmentTimeline(g,t,f,l,!0):g.apply(t,d,f,n,u,l,e.MixDirection.mixIn)}else{var _=c.timelineMode,v=c.timelinesRotation.length==0;v&&e.Utils.setArraySize(c.timelinesRotation,p<<1,null);for(var y=c.timelinesRotation,h=0;h<p;h++){var b=m[h],x=_[h]==r.SUBSEQUENT?l:e.MixBlend.setup;b instanceof e.RotateTimeline?this.applyRotateTimeline(b,t,f,u,x,y,h<<1,v):b instanceof e.AttachmentTimeline?this.applyAttachmentTimeline(b,t,f,l,!0):(e.Utils.webkit602BugfixHelper(u,l),b.apply(t,d,f,n,u,x,e.MixDirection.mixIn))}}this.queueEvents(c,f),n.length=0,c.nextAnimationLast=f,c.nextTrackLast=c.trackTime}}for(var S=this.unkeyedState+r.SETUP,C=t.slots,w=0,T=t.slots.length;w<T;w++){var E=C[w];if(E.attachmentState==S){var D=E.data.attachmentName;E.setAttachment(D==null?null:t.getAttachment(E.data.index,D))}}return this.unkeyedState+=2,this.queue.drain(),a},r.prototype.applyMixingFrom=function(t,n,i){var a=t.mixingFrom;a.mixingFrom!=null&&this.applyMixingFrom(a,n,i);var o=0;t.mixDuration==0?(o=1,i==e.MixBlend.first&&(i=e.MixBlend.setup)):(o=t.mixTime/t.mixDuration,o>1&&(o=1),i!=e.MixBlend.first&&(i=a.mixBlend));var s=o<a.eventThreshold?this.events:null,c=o<a.attachmentThreshold,l=o<a.drawOrderThreshold,u=a.animationLast,d=a.getAnimationTime(),f=a.animation.timelines.length,p=a.animation.timelines,m=a.alph
1a*t.interruptAlpha,h=m*(1-o);if(i==e.MixBlend.add)for(var g=0;g<f;g++)p[g].apply(n,u,d,s,h,i,e.MixDirection.mixOut);else{var _=a.timelineMode,v=a.timelineHoldMix,y=a.timelinesRotation.length==0;y&&e.Utils.setArraySize(a.timelinesRotation,f<<1,null);var b=a.timelinesRotation;a.totalAlpha=0;for(var g=0;g<f;g++){var x=p[g],S=e.MixDirection.mixOut,C=void 0,w=0;switch(_[g]){case r.SUBSEQUENT:if(!l&&x instanceof e.DrawOrderTimeline)continue;C=i,w=h;break;case r.FIRST:C=e.MixBlend.setup,w=h;break;case r.HOLD_SUBSEQUENT:C=i,w=m;break;case r.HOLD_FIRST:C=e.MixBlend.setup,w=m;break;default:C=e.MixBlend.setup;var T=v[g];w=m*Math.max(0,1-T.mixTime/T.mixDuration)}a.totalAlpha+=w,x instanceof e.RotateTimeline?this.applyRotateTimeline(x,n,d,w,C,b,g<<1,y):x instanceof e.AttachmentTimeline?this.applyAttachmentTimeline(x,n,d,C,c):(e.Utils.webkit602BugfixHelper(w,i),l&&x instanceof e.DrawOrderTimeline&&C==e.MixBlend.setup&&(S=e.MixDirection.mixIn),x.apply(n,u,d,s,w,C,S))}}return t.mixDuration>0&&this.queueEvents(a,d),this.events.length=0,a.nextAnimationLast=d,a.nextTrackLast=a.trackTime,o},r.prototype.applyAttachmentTimeline=function(t,n,i,a,o){var s=n.slots[t.slotIndex];if(s.bone.active){var c=t.frames;if(i<c[0])(a==e.MixBlend.setup||a==e.MixBlend.first)&&this.setAttachment(n,s,s.data.attachmentName,o);else{var l=i>=c[c.length-1]?c.length-1:e.Animation.binarySearch(c,i)-1;this.setAttachment(n,s,t.attachmentNames[l],o)}s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+r.SETUP)}},r.prototype.setAttachment=function(e,t,n,i){t.setAttachment(n==null?null:e.getAttachment(t.data.index,n)),i&&(t.attachmentState=this.unkeyedState+r.CURRENT)},r.prototype.applyRotateTimeline=function(t,n,r,i,a,o,s,c){if(c&&(o[s]=0),i==1){t.apply(n,0,r,null,1,a,e.MixDirection.mixIn);return}var l=t,u=l.frames,d=n.bones[l.boneIndex];if(d.active){var f=0,p=0;if(r<u[0])switch(a){case e.MixBlend.setup:d.rotation=d.data.rotation;default:return;case e.MixBlend.first:f=d.rotation,p=d.data.rotation}else if(f=a==e.MixBlend.setup?d.data.rotation:d.rotation,r>=u[u.length-e.RotateTimeline.ENTRIES])p=d.data.rotation+u[u.length+e.RotateTimeline.PREV_ROTATION];else{var m=e.Animation.binarySearch(u,r,e.RotateTimeline.ENTRIES),h=u[m+e.RotateTimeline.PREV_ROTATION],g=u[m],_=l.getCurvePercent((m>>1)-1,1-(r-g)/(u[m+e.RotateTimeline.PREV_TIME]-g));p=Math.fround(u[m+e.RotateTimeline.ROTATION]-h),p-=(16384-(16384.499999999996-p/360|0))*360,p=h+p*_+d.data.rotation,p-=(16384-(16384.499999999996-p/360|0))*360}var v=0,y=p-f;if(y-=(16384-(16384.499999999996-y/360|0))*360,y==0)v=o[s];else{var b=0,x=0;c?(b=0,x=y):(b=o[s],x=o[s+1]);var S=y>0,C=b>=0;e.MathUtils.signum(x)!=e.MathUtils.signum(y)&&Math.abs(x)<=90&&(Math.abs(b)>180&&(b+=360*e.MathUtils.signum(b)),C=S),v=y+b-b%360,C!=S&&(v+=360*e.MathUtils.signum(b)),o[s]=v}o[s+1]=y,f+=v*i,d.rotation=f-(16384-(16384.499999999996-f/360|0))*360}},r.prototype.queueEvents=function(e,t){for(var n=e.animationStart,r=e.animationEnd,i=r-n,a=e.trackLast%i,o=this.events,s=0,c=o.length;s<c;s++){var l=o[s];if(l.time<a)break;l.time>r||this.queue.event(e,l)}var u=!1;for(u=e.loop?i==0||a>e.trackTime%i:t>=r&&e.animationLast<r,u&&this.queue.complete(e);s<c;s++)o[s].time<n||this.queue.event(e,o[s])},r.prototype.clearTracks=function(){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var t=0,n=this.tracks.length;t<n;t++)this.clearTrack(t);this.tracks.length=0,this.queue.drainDisabled=e,this.queue.drain()},r.prototype.clearTrack=function(e){if(!(e>=this.tracks.length)){var t=this.tracks[e];if(t!=null){this.queue.end(t),this.disposeNext(t);for(var n=t;;){var r=n.mixingFrom;if(r==null)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[t.trackIndex]=null,this.queue.drain()}}},r.prototype.setCurrent=function(e,t,n){var r=this.expandToIndex(e);this.tracks[e]=t,r!=null&&(n&&this.queue.interrupt(r),t.mixingFrom=r,r.mixingTo=t,t.mixTime=0,r.mixingFrom!=null&&r.mixDuration>0&&(t.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(t)},r.prototype.setAnimation=function(e,t,n){var r=this.data.skeletonData.findAnimation(t);
1if(r==null)throw Error(`Animation not found: `+t);return this.setAnimationWith(e,r,n)},r.prototype.setAnimationWith=function(e,t,n){if(t==null)throw Error(`animation cannot be null.`);var r=!0,i=this.expandToIndex(e);i!=null&&(i.nextTrackLast==-1?(this.tracks[e]=i.mixingFrom,this.queue.interrupt(i),this.queue.end(i),this.disposeNext(i),i=i.mixingFrom,r=!1):this.disposeNext(i));var a=this.trackEntry(e,t,n,i);return this.setCurrent(e,a,r),this.queue.drain(),a},r.prototype.addAnimation=function(e,t,n,r){var i=this.data.skeletonData.findAnimation(t);if(i==null)throw Error(`Animation not found: `+t);return this.addAnimationWith(e,i,n,r)},r.prototype.addAnimationWith=function(e,t,n,r){if(t==null)throw Error(`animation cannot be null.`);var i=this.expandToIndex(e);if(i!=null)for(;i.next!=null;)i=i.next;var a=this.trackEntry(e,t,n,i);if(i==null)this.setCurrent(e,a,!0),this.queue.drain();else if(i.next=a,r<=0){var o=i.animationEnd-i.animationStart;o==0?r=i.trackTime:(i.loop?r+=o*(1+(i.trackTime/o|0)):r+=Math.max(o,i.trackTime),r-=this.data.getMix(i.animation,t))}return a.delay=r,a},r.prototype.setEmptyAnimation=function(e,t){var n=this.setAnimationWith(e,r.emptyAnimation,!1);
1return n.mixDuration=t,n.trackEnd=t,n},r.prototype.addEmptyAnimation=function(e,t,n){n<=0&&(n-=t);var i=this.addAnimationWith(e,r.emptyAnimation,!1,n);return i.mixDuration=t,i.trackEnd=t,i},r.prototype.setEmptyAnimations=function(e){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n<r;n++){var i=this.tracks[n];i!=null&&this.setEmptyAnimation(i.trackIndex,e)}this.queue.drainDisabled=t,this.queue.drain()},r.prototype.expandToIndex=function(t){return t<this.tracks.length?this.tracks[t]:(e.Utils.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)},r.prototype.trackEntry=function(t,n,r,i){var a=this.trackEntryPool.obtain();return a.trackIndex=t,a.animation=n,a.loop=r,a.holdPrevious=!1,a.eventThreshold=0,a.attachmentThreshold=0,a.drawOrderThreshold=0,a.animationStart=0,a.animationEnd=n.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.interruptAlpha=1,a.mixTime=0,a.mixDuration=i==null?0:this.data.getMix(i.animation,n),a.mixBlend=e.MixBlend.replace,a},r.prototype.disposeNext=function(e){for(var t=e.next;t!=null;)this.queue.dispose(t),t=t.next;e.next=null},r.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var t=0,n=this.tracks.length;t<n;t++){var r=this.tracks[t];if(r!=null){for(;r.mixingFrom!=null;)r=r.mixingFrom;do(r.mixingFrom==null||r.mixBlend!=e.MixBlend.add)&&this.computeHold(r),r=r.mixingTo;while(r!=null)}}},r.prototype.computeHold=function(t){var n=t.mixingTo,i=t.animation.timelines,a=t.animation.timelines.length,o=e.Utils.setArraySize(t.timelineMode,a);t.timelineHoldMix.length=0;var s=e.Utils.setArraySize(t.timelineHoldMix,a),c=this.propertyIDs;if(n!=null&&n.holdPrevious){for(var l=0;l<a;l++)o[l]=c.add(i[l].getPropertyId())?r.HOLD_FIRST:r.HOLD_SUBSEQUENT;return}outer:for(var l=0;l<a;l++){var u=i[l],d=u.getPropertyId();if(!c.add(d))o[l]=r.SUBSEQUENT;else if(n==null||u instanceof e.AttachmentTimeline||u instanceof e.DrawOrderTimeline||u instanceof e.EventTimeline||!n.animation.hasTimeline(d))o[l]=r.FIRST;else{for(var f=n.mixingTo;f!=null;f=f.mixingTo)if(!f.animation.hasTimeline(d)){if(t.mixDuration>0){o[l]=r.HOLD_MIX,s[l]=f;continue outer}break}o[l]=r.HOLD_FIRST}}},r.prototype.getCurrent=function(e){return e>=this.tracks.length?null:this.tracks[e]},r.prototype.addListener=function(e){if(e==null)throw Error(`listener cannot be null.`);this.listeners.push(e)},r.prototype.removeListener=function(e){var t=this.listeners.indexOf(e);t>=0&&this.listeners.splice(t,1)},r.prototype.clearListeners=function(){this.listeners.length=0},r.prototype.clearListenerNotifications=function(){this.queue.clear()},r.emptyAnimation=new e.Animation(`<empty>`,[],0),r.SUBSEQUENT=0,r.FIRST=1,r.HOLD_SUBSEQUENT=2,r.HOLD_FIRST=3,r.HOLD_MIX=4,r.SETUP=1,r.CURRENT=2,r})();var t=(function(){function t(){this.mixBlend=e.MixBlend.replace,this.timelineMode=[],this.timelineHoldMix=[],this.timelinesRotation=[]}return t.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},t.prototype.getAnimationTime=function(){if(this.loop){var e=this.animationEnd-this.animationStart;return e==0?this.animationStart:this.trackTime%e+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},t.prototype.setAnimationLast=function(e){this.animationLast=e,this.nextAnimationLast=e},t.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},t.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},t})();e.TrackEntry=t;var n=(function(){function e(e){this.objects=[],this.drainDisabled=!1,this.animState=e}return e.prototype.start=function(e){this.objects.push(r.start),this.objects.push(e),this.animState.animationsChanged=!0},e.prototype.interrupt=function(e){this.objects.push(r.interrupt),this.objects.push(e)}
1,e.prototype.end=function(e){this.objects.push(r.end),this.objects.push(e),this.animState.animationsChanged=!0},e.prototype.dispose=function(e){this.objects.push(r.dispose),this.objects.push(e)},e.prototype.complete=function(e){this.objects.push(r.complete),this.objects.push(e)},e.prototype.event=function(e,t){this.objects.push(r.event),this.objects.push(e),this.objects.push(t)},e.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var e=this.objects,t=this.animState.listeners,n=0;n<e.length;n+=2){var i=e[n],a=e[n+1];switch(i){case r.start:a.listener!=null&&a.listener.start&&a.listener.start(a);for(var o=0;o<t.length;o++)t[o].start&&t[o].start(a);break;case r.interrupt:a.listener!=null&&a.listener.interrupt&&a.listener.interrupt(a);for(var o=0;o<t.length;o++)t[o].interrupt&&t[o].interrupt(a);break;case r.end:a.listener!=null&&a.listener.end&&a.listener.end(a);for(var o=0;o<t.length;o++)t[o].end&&t[o].end(a);case r.dispose:a.listener!=null&&a.listener.dispose&&a.listener.dispose(a);for(var o=0;o<t.length;o++)t[o].dispose&&t[o].dispose(a);this.animState.trackEntryPool.free(a);break;case r.complete:a.listener!=null&&a.listener.complete&&a.listener.complete(a);for(var o=0;o<t.length;o++)t[o].complete&&t[o].complete(a);break;case r.event:var s=e[n+++2];a.listener!=null&&a.listener.event&&a.listener.event(a,s);for(var o=0;o<t.length;o++)t[o].event&&t[o].event(a,s)}}this.clear(),this.drainDisabled=!1}},e.prototype.clear=function(){this.objects.length=0},e})();e.EventQueue=n;var r;(function(e){e[e.start=0]=`start`,e[e.interrupt=1]=`interrupt`,e[e.end=2]=`end`,e[e.dispose=3]=`dispose`,e[e.complete=4]=`complete`,e[e.event=5]=`event`})(r=e.EventType||(e.EventType={})),e.AnimationStateAdapter=(function(){function e(){}return e.prototype.start=function(e){},e.prototype.interrupt=function(e){},e.prototype.end=function(e){},e.prototype.dispose=function(e){},e.prototype.complete=function(e){},e.prototype.event=function(e,t){},e})()})(X||(X={}));var X;(function(e){e.AnimationStateData=(function(){function e(e){if(this.animationToMixTime={},this.defaultMix=0,e==null)throw Error(`skeletonData cannot be null.`);this.skeletonData=e}return e.prototype.setMix=function(e,t,n){var r=this.skeletonData.findAnimation(e);if(r==null)throw Error(`Animation not found: `+e);var i=this.skeletonData.findAnimation(t);if(i==null)throw Error(`Animation not found: `+t);this.setMixWith(r,i,n)},e.prototype.setMixWith=function(e,t,n){if(e==null)throw Error(`from cannot be null.`);if(t==null)throw Error(`to cannot be null.`);var r=e.name+`.`+t.name;this.animationToMixTime[r]=n},e.prototype.getMix=function(e,t){var n=e.name+`.`+t.name,r=this.animationToMixTime[n];return r===void 0?this.defaultMix:r},e})()})(X||(X={}));var X;(function(e){e.AssetManager=(function(){function t(e,t){t===void 0&&(t=``),this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.rawDataUris={},this.textureLoader=e,this.pathPrefix=t}return t.prototype.downloadText=function(e,t,n){var r=new XMLHttpRequest;r.overrideMimeType(`text/html`),this.rawDataUris[e]&&(e=this.rawDataUris[e]),r.open(`GET`,e,!0),r.onload=function(){r.status==200?t(r.responseText):n(r.status,r.responseText)},r.onerror=function(){n(r.status,r.responseText)},r.send()},t.prototype.downloadBinary=function(e,t,n){var r=new XMLHttpRequest;this.rawDataUris[e]&&(e=this.rawDataUris[e]),r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=function(){r.status==200?t(new Uint8Array(r.response)):n(r.status,r.responseText)},r.onerror=function(){n(r.status,r.responseText)},r.send()},t.prototype.setRawDataURI=function(e,t){this.rawDataUris[this.pathPrefix+e]=t},t.prototype.loadBinary=function(e,t,n){var r=this;t===void 0&&(t=null),n===void 0&&(n=null),e=this.pathPrefix+e,this.toLoad++,this.downloadBinary(e,function(n){r.assets[e]=n,t&&t(e,n),r.toLoad--,r.loaded++},function(t,i){r.errors[e]=`Couldn't load binary `+e+`: status `+status+`, `+i,n&&n(e,`Couldn't load binary `+e+`: status `+status+`, `+i),r.toLoad--,r.loaded++})},t.prototype.loadText=function(e,t,n){var r=this;t===void 0&&(t=null),n===void 0&&(n=null),e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,function(n){r.assets[e]=n,t&&t(e,n),r.toLoad--,r.loaded++},function(t,i){r.errors[e]=`Couldn't load text `+e+`: status `+status+`, `+i,n&&n(e,`Couldn't load text `+e+`: status `+status+`, `+i),r.toLoad--,r.loaded++})},t.prototype.loadTexture=function(e,t,n){var r=this;t===void 0&&(t=null),n===void 0&&(n=null),e=this.pathPrefix+e;var i=e;this.toLoad++;var a=new Image;a.crossOrigin=`anonymous`,a.onload=function(n){var o=r.textureLoader(a);r.assets[i]=o,r.toLoad--,r.loaded++,t&&t(e,a)},a.onerror=function(t){r.errors[e]=`Couldn't load image `+e,r.toLoad--,r.loaded++,n&&n(e,`Couldn't load image `+e)},this.rawDataUris[e]&&(e=this.rawDataUris[e]),a.src=e},t.prototype.loadTextureAtlas=function(t,n,r){var i=this;n===void 0&&(n=null),r===void 0&&(r=null);var a=t.lastIndexOf(`/`)>=0?t.substring(0,t.lastIndexOf(`/`)):``;t=this.pathPrefix+t,this.toLoad++,this.downloadText(t,function(o){var s={count:0},c=[];
1try{new e.TextureAtlas(o,function(t){c.push(a==``?t:a+`/`+t);var n=document.createElement(`img`);return n.width=16,n.height=16,new e.FakeTexture(n)})}catch(e){var l=e;i.errors[t]=`Couldn't load texture atlas `+t+`: `+l.message,r&&r(t,`Couldn't load texture atlas `+t+`: `+l.message),i.toLoad--,i.loaded++;return}for(var u=function(l){var u=!1;i.loadTexture(l,function(l,d){if(s.count++,s.count==c.length){if(u)i.errors[t]=`Couldn't load texture atlas page `+l+`} of atlas `+t,r&&r(t,`Couldn't load texture atlas page `+l+` of atlas `+t),i.toLoad--,i.loaded++;else try{var f=new e.TextureAtlas(o,function(e){return i.get(a==``?e:a+`/`+e)});i.assets[t]=f,n&&n(t,f),i.toLoad--,i.loaded++}catch(e){var p=e;i.errors[t]=`Couldn't load texture atlas `+t+`: `+p.message,r&&r(t,`Couldn't load texture atlas `+t+`: `+p.message),i.toLoad--,i.loaded++}}},function(e,n){u=!0,s.count++,s.count==c.length&&(i.errors[t]=`Couldn't load texture atlas page `+e+`} of atlas `+t,r&&r(t,`Couldn't load texture atlas page `+e+` of atlas `+t),i.toLoad--,i.loaded++)})},d=0,f=c;d<f.length;d++){var p=f[d];u(p)}},function(e,n){i.errors[t]=`Couldn't load texture atlas `+t+`: status `+status+`, `+n,r&&r(t,`Couldn't load texture atlas `+t+`: status `+status+`, `+n),i.toLoad--,i.loaded++})},t.prototype.get=function(e){return e=this.pathPrefix+e,this.assets[e]},t.prototype.remove=function(e){e=this.pathPrefix+e;var t=this.assets[e];t.dispose&&t.dispose(),this.assets[e]=null},t.prototype.removeAll=function(){for(var e in this.assets){var t=this.assets[e];t.dispose&&t.dispose()}this.assets={}},t.prototype.isLoadingComplete=function(){return this.toLoad==0},t.prototype.getToLoad=function(){return this.toLoad},t.prototype.getLoaded=function(){return this.loaded},t.prototype.dispose=function(){this.removeAll()},t.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return this.errors},t})()})(X||(X={}));var X;(function(e){e.AtlasAttachmentLoader=(function(){function t(e){this.atlas=e}return t.prototype.newRegionAttachment=function(t,n,r){var i=this.atlas.findRegion(r);if(i==null)throw Error(`Region not found in atlas: `+r+` (region attachment: `+n+`)`);i.renderObject=i;var a=new e.RegionAttachment(n);return a.setRegion(i),a},t.prototype.newMeshAttachment=function(t,n,r){var i=this.atlas.findRegion(r);if(i==null)throw Error(`Region not found in atlas: `+r+` (mesh attachment: `+n+`)`);i.renderObject=i;var a=new e.MeshAttachment(n);return a.region=i,a},t.prototype.newBoundingBoxAttachment=function(t,n){return new e.BoundingBoxAttachment(n)},t.prototype.newPathAttachment=function(t,n){return new e.PathAttachment(n)},t.prototype.newPointAttachment=function(t,n){return new e.PointAttachment(n)},t.prototype.newClippingAttachment=function(t,n){return new e.ClippingAttachment(n)},t})()})(X||(X={}));var X;(function(e){(function(e){e[e.Normal=0]=`Normal`,e[e.Additive=1]=`Additive`,e[e.Multiply=2]=`Multiply`,e[e.Screen=3]=`Screen`})(e.BlendMode||(e.BlendMode={}))})(X||(X={}));var X;(function(e){e.Bone=(function(){function t(e,t,n){if(this.children=[],this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,e==null)throw Error(`data cannot be null.`);if(t==null)throw Error(`skeleton cannot be null.`);this.data=e,this.skeleton=t,this.parent=n,this.setToSetupPose()}return t.prototype.isActive=function(){return this.active},t.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},t.prototype.updateWorldTransformWith=function(t,n,r,i,a,o,s){this.ax=t,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var c=this.parent;if(c==null){var l=this.skeleton,u=r+90+s,d=l.scaleX,f=l.scaleY;this.a=e.MathUtils.cosDeg(r+o)*i*d,this.b=e.MathUtils.cosDeg(u)*a*d,this.c=e.MathUtils.sinDeg(r+o)*i*f,this.d=e.MathUtils.sinDeg(u)*a*f,this.worldX=t*d+l.x,this.worldY=n*f+l.y;return}var p=c.a,m=c.b,h=c.c,g=c.d;switch(this.worldX=p*t+m*n+c.worldX,this.worldY=h*t+g*n+c.worldY,this.data.transformMode){case e.TransformMode.Normal:var u=r+90+s,_=e.MathUtils.cosDeg(r+o)*i,v=e.MathUtils.cosDeg(u)*a,y=e.MathUtils.sinDeg(r+o)*i,b=e.MathUtils.sinDeg(u)*a;this.a=p*_+m*y,this.b=p*v+m*b,this.c=h*_+g*y,this.d=h*v+g*b;return;case e.TransformMode.OnlyTranslation:var u=r+90+s;this.a=e.MathUtils.cosDeg(r+o)*i,this.b=e.MathUtils.cosDeg(u)*a,this.c=e.MathUtils.sinDeg(r+o)*i,this.d=e.MathUtils.sinDeg(u)*a;break;case e.TransformMode.NoRotationOrReflection:var x=p*p+h*h,S=0;x>1e-4?(x=Math.abs(p*g-m*h)/x,p/=this.skeleton.scaleX,h/=this.skeleton.scaleY,m=h*x,g=p*x,S=Math.atan2(h,p)*e.MathUtils.radDeg):(p=0,h=0,S=90-Math.atan2(g,m)*e.MathUtils.radDeg);var C=r+o-S,w=r+s-S+90,_=e.MathUtils.cosDeg(C)*i,v=e.MathUtils.cosDeg(w)*a,y=e.MathUtils.sinDeg(C)*i,b=e.MathUtils.sinDeg(w)*a;this.a=p*_-m*y,this.b=p*v-m*b,this.c=h*_+g*y,this.d=h*v+g*b;break;case e.TransformMode.NoScale:case e.TransformMode.NoScaleOrReflection:var T=e.MathUtils.cosDeg(r),E=e.MathUtils.sinDeg(r),D=(p*T+m*E)/this.skeleton.scaleX,O=(h*T+g*E)/this.skeleton.scaleY,x=Math.sqrt(D*D+O*O);x>1e-5&&(x=1/x),D*=x,O*=x,x=Math.sqrt(D*D+O*O),this.data.transformMode==e.TransformMode.NoScale&&p*g-m*h<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(x=-x);var k=Math.PI/2+Math.atan2(O,D),A=Math.cos(k)*x,j=Math.sin(k)*x,_=e.MathUtils.cosDeg(o)*i,v=e.MathUtils.cosDeg(90+s)*a,y=e.MathUtils.sinDeg(o
1)*i,b=e.MathUtils.sinDeg(90+s)*a;this.a=D*_+A*y,this.b=D*v+A*b,this.c=O*_+j*y,this.d=O*v+j*b}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},t.prototype.setToSetupPose=function(){var e=this.data;this.x=e.x,this.y=e.y,this.rotation=e.rotation,this.scaleX=e.scaleX,this.scaleY=e.scaleY,this.shearX=e.shearX,this.shearY=e.shearY},t.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*e.MathUtils.radDeg},t.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*e.MathUtils.radDeg},t.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},t.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},t.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var t=this.parent;if(t==null){this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*e.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,this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*e.MathUtils.radDeg;return}var n=t.a,r=t.b,i=t.c,a=t.d,o=1/(n*a-r*i),s=this.worldX-t.worldX,c=this.worldY-t.worldY;this.ax=s*a*o-c*r*o,this.ay=c*n*o-s*i*o;var l=o*a,u=o*n,d=o*r,f=o*i,p=l*this.a-d*this.c,m=l*this.b-d*this.d,h=u*this.c-f*this.a,g=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(p*p+h*h),this.ascaleX>1e-4){var _=p*g-m*h;this.ascaleY=_/this.ascaleX,this.ashearY=Math.atan2(p*m+h*g,_)*e.MathUtils.radDeg,this.arotation=Math.atan2(h,p)*e.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(m*m+g*g),this.ashearY=0,this.arotation=90-Math.atan2(g,m)*e.MathUtils.radDeg},t.prototype.worldToLocal=function(e){var t=this.a,n=this.b,r=this.c,i=this.d,a=1/(t*i-n*r),o=e.x-this.worldX,s=e.y-this.worldY;return e.x=o*i*a-s*n*a,e.y=s*t*a-o*r*a,e},t.prototype.localToWorld=function(e){var t=e.x,n=e.y;return e.x=t*this.a+n*this.b+this.worldX,e.y=t*this.c+n*this.d+this.worldY,e},t.prototype.worldToLocalRotation=function(t){var n=e.MathUtils.sinDeg(t),r=e.MathUtils.cosDeg(t);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*e.MathUtils.radDeg+this.rotation-this.shearX},t.prototype.localToWorldRotation=function(t){t-=this.rotation-this.shearX;var n=e.MathUtils.sinDeg(t),r=e.MathUtils.cosDeg(t);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*e.MathUtils.radDeg},t.prototype.rotateWorld=function(t){var n=this.a,r=this.b,i=this.c,a=this.d,o=e.MathUtils.cosDeg(t),s=e.MathUtils.sinDeg(t);this.a=o*n-s*i,this.b=o*r-s*a,this.c=s*n+o*i,this.d=s*r+o*a,this.appliedValid=!1},t})()})(X||(X={}));var X;(function(e){e.BoneData=(function(){function n(n,r,i){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=t.Normal,this.skinRequired=!1,this.color=new e.Color,n<0)throw Error(`index must be >= 0.`);if(r==null)throw Error(`name cannot be null.`);this.index=n,this.name=r,this.parent=i}return n})();var t;(function(e){e[e.Normal=0]=`Normal`,e[e.OnlyTranslation=1]=`OnlyTranslation`,e[e.NoRotationOrReflection=2]=`NoRotationOrReflection`,e[e.NoScale=3]=`NoScale`,e[e.NoScaleOrReflection=4]=`NoScaleOrReflection`})(t=e.TransformMode||(e.TransformMode={}))})(X||(X={}));var X;(function(e){e.ConstraintData=(function(){function e(e,t,n){this.name=e,this.order=t,this.skinRequired=n}return e})()})(X||(X={}));var X;(function(e){e.Event=(function(){function e(e,t){if(t==null)throw Error(`data cannot be null.`);this.time=e,this.data=t}return e})()})(X||(X={}));var X;(function(e){e.EventData=(function(){function e(e){this.name=e}return e})()})(X||(X={}));var X;(function(e){e.IkConstraint=(function(){function t(e,t){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,e==null)throw Error(`data cannot be null.`);if(t==null)throw Error(`skeleton cannot be null.`);this.data=e,this.mix=e.mix,this.softness=e.softness,this.bendDirection=e.bendDirection,this.compress=e.compress,this.stretch=e.stretch,this.bones=[];for(var n=0;n<e.bones.length;n++)this.bones.push(t.findBone(e.bones[n].name));this.target=t.findBone(e.target.name)}
1return t.prototype.isActive=function(){return this.active},t.prototype.apply=function(){this.update()},t.prototype.update=function(){var e=this.target,t=this.bones;switch(t.length){case 1:this.apply1(t[0],e.worldX,e.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(t[0],t[1],e.worldX,e.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},t.prototype.apply1=function(t,n,r,i,a,o,s){t.appliedValid||t.updateAppliedTransform();var c=t.parent,l=c.a,u=c.b,d=c.c,f=c.d,p=-t.ashearX-t.arotation,m=0,h=0;switch(t.data.transformMode){case e.TransformMode.OnlyTranslation:m=n-t.worldX,h=r-t.worldY;break;case e.TransformMode.NoRotationOrReflection:var g=Math.abs(l*f-u*d)/(l*l+d*d),_=l/t.skeleton.scaleX,v=d/t.skeleton.scaleY;u=-v*g*t.skeleton.scaleX,f=_*g*t.skeleton.scaleY,p+=Math.atan2(v,_)*e.MathUtils.radDeg;default:var y=n-c.worldX,b=r-c.worldY,x=l*f-u*d;m=(y*f-b*u)/x-t.ax,h=(b*l-y*d)/x-t.ay}p+=Math.atan2(h,m)*e.MathUtils.radDeg,t.ascaleX<0&&(p+=180),p>180?p-=360:p<-180&&(p+=360);var S=t.ascaleX,C=t.ascaleY;if(i||a){switch(t.data.transformMode){case e.TransformMode.NoScale:case e.TransformMode.NoScaleOrReflection:m=n-t.worldX,h=r-t.worldY}var w=t.data.length*S,T=Math.sqrt(m*m+h*h);if(i&&T<w||a&&T>w&&w>1e-4){var g=(T/w-1)*s+1;S*=g,o&&(C*=g)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+p*s,S,C,t.ashearX,t.ashearY)},t.prototype.apply2=function(t,n,r,i,a,o,s,c){if(c==0){n.updateWorldTransform();return}t.appliedValid||t.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=t.ax,u=t.ay,d=t.ascaleX,f=d,p=t.ascaleY,m=n.ascaleX,h=0,g=0,_=0;d<0?(d=-d,h=180,_=-1):(h=0,_=1),p<0&&(p=-p,_=-_),m<0?(m=-m,g=180):g=0;var v=n.ax,y=0,b=0,x=0,S=t.a,C=t.b,w=t.c,T=t.d,E=Math.abs(d-p)<=1e-4;E?(y=n.ay,b=S*v+C*y+t.worldX,x=w*v+T*y+t.worldY):(y=0,b=S*v+t.worldX,x=w*v+t.worldY);var D=t.parent;S=D.a,C=D.b,w=D.c,T=D.d;var O=1/(S*T-C*w),k=b-D.worldX,A=x-D.worldY,j=(k*T-A*C)*O-l,M=(A*S-k*w)*O-u,N=Math.sqrt(j*j+M*M),P=n.data.length*m,F,I;if(N<1e-4){this.apply1(t,r,i,!1,o,!1,c),n.updateWorldTransformWith(v,y,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);return}k=r-D.worldX,A=i-D.worldY;var L=(k*T-A*C)*O-l,R=(A*S-k*w)*O-u,z=L*L+R*R;if(s!=0){s*=d*(m+1)/2;var B=Math.sqrt(z),V=B-N-P*d+s;if(V>0){var H=Math.min(1,V/(s*2))-1;H=(V-s*(1-H*H))/B,L-=H*L,R-=H*R,z=L*L+R*R}}outer:if(E){P*=d;var U=(z-N*N-P*P)/(2*N*P);U<-1?U=-1:U>1&&(U=1,o&&(f*=(Math.sqrt(z)/(N+P)-1)*c+1)),I=Math.acos(U)*a,S=N+P*U,C=P*Math.sin(I),F=Math.atan2(R*S-L*C,L*S+R*C)}else{S=d*P,C=p*P;var W=S*S,G=C*C,K=Math.atan2(R,L);w=G*N*N+W*z-W*G;var q=-2*G*N,J=G-W;if(T=q*q-4*J*w,T>=0){var Y=Math.sqrt(T);q<0&&(Y=-Y),Y=-(q+Y)/2;var X=Y/J,Z=w/Y,Q=Math.abs(X)<Math.abs(Z)?X:Z;if(Q*Q<=z){A=Math.sqrt(z-Q*Q)*a,F=K-Math.atan2(A,Q),I=Math.atan2(A/p,(Q-N)/d);break outer}}var $=e.MathUtils.PI,ee=N-S,te=ee*ee,ne=0,re=0,ie=N+S,ae=ie*ie,oe=0;w=-S*N/(W-G),w>=-1&&w<=1&&(w=Math.acos(w),k=S*Math.cos(w)+N,A=C*Math.sin(w),T=k*k+A*A,T<te&&($=w,te=T,ee=k,ne=A),T>ae&&(re=w,ae=T,ie=k,oe=A)),z<=(te+ae)/2?(F=K-Math.atan2(ne*a,ee),I=$*a):(F=K-Math.atan2(oe*a,ie),I=re*a)}var se=Math.atan2(y,v)*_,ce=t.arotation;F=(F-se)*e.MathUtils.radDeg+h-ce,F>180?F-=360:F<-180&&(F+=360),t.updateWorldTransformWith(l,u,ce+F*c,f,t.ascaleY,0,0),ce=n.arotation,I=((I+se)*e.MathUtils.radDeg-n.ashearX)*_+g-ce,I>180?I-=360:I<-180&&(I+=360),n.updateWorldTransformWith(v,y,ce+I*c,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)},t})()})(X||(X={}));var X;(function(e){e.IkConstraintData=(function(e){Y(t,e);function t(t){var n=e.call(this,t,0,!1)||this;return n.bones=[],n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return t})(e.ConstraintData)})(X||(X={}));var X;(function(e){e.PathConstraint=(function(){function t(e,t){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=[],this.positions=[],this.world=[],this.curves=[],this.lengths=[],this.segments=[],this.active=!1,e==null)throw Error(`data cannot be null.`);if(t==null)throw Error(`skeleton cannot be null.`);this.data=e,this.bones=[];for(var n=0,r=e.bones.length;n<r;n++)this.bones.push(t.findBone(e.bones[n].name));this.target=t.findSlot(e.target.name),this.position=e.position,this.spacing=e.spacing,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix}return t.prototype.isActive=function(){return this.active},t.prototype.apply=function(){this.update()},t.prototype.update=function(){var n=this.target.getAttachment();if(n instanceof e.PathAttachment){var r=this.rotateMix,i=this.translateMix,a=i>0,o=r>0;if(a||o){var s=this.data,c=s.spacingMode==e.SpacingMode.Percent,l=s.rotateMode,u=l==e.RotateMode.Tangent,d=l==e.RotateMode.ChainScale,f=this.bones.length,p=u?f:f+1,m=this.bones,h=e.Utils.setArraySize(this.spaces,p),g=null,_=this.spacing;if(d||!c){d&&(g=e.Utils.setArraySize(this.lengths,f));for(var v=s.spacingMode==e.SpacingMode.Length,y=0,b=p-1;y<b;){var x=m[y],S=x.data.length;if(S<t.epsilon)d&&(g[y]=0),h[++y]=0;else if(c){if(d){var C=S*x.a,w=S*x.c,T=Math.sqrt(C*C+w*w);g[y]=T}h[++y]=_}else{var C=S*x.a,w=S*x.c,E=Math.sqrt(C*C+w*w);d&&(g[y]=E),h[++y]=(v?S+_:_)*E/S}}}else for(var y=1;y<p;y++)h[y]=_;var D=this.computeWorldPositions(n,p,u,s.positionMode==e.PositionMode.Percent,c),O=D[0],k=D[1],A=s.offsetRotation,j=!1;if(A==0)j=l==e.RotateMode.Chain;else{j=!1;var M=this.target.bone;A*=M.a*M.d-M.b*M.c>0?e.MathUtils.degRad:-e.MathUtils.degRad}for(var y=0,M=3;y<f;y++,M+=3){var x=m[y];x.worldX+=(O-x.worldX)*i,x.worldY+=(k-x.worldY)*i;var C=D[M],w=D[M+1],N=C-O,P=w-k;if(d){var F=g[y];if(F!=0){var I=(Math.sqrt(N*N+P*P)/F-1)*r+1;x.a*=I,x.c*=I}}if(O=C,k=w,o){var L=x.a,R=x.b,z=x.c,B=x.d,V=0,H=0,U=0;if(V=u?D[M-1]:h[y+1]==0?D[M+2]:Math.atan2(P,N),V-=Math.atan2(z,L),j){H=Math.cos(V),U=Math.sin(V);var W=x.data.length;O+=(W*(H*L-U*z)-N)*r,k+=(W*(U*L+H*z)-P)*r}else V+=A;V>e.MathUtils.PI?V-=e.MathUtils.PI2:V<-e.MathUtils.PI&&(V+=e.MathUtils.PI2),V*=r,H=Math.cos(V),U=Math.sin(V),x.a=H*L-U*z,x.b=H*R-U*B,x.c=U*L+H*z,x.d=U*R+H*B}x.appliedValid=!1}}}},t.prototype.computeWorldPositions=function(n,r,i,a,o){var s=this.target,c=this.position,l=this.spaces,u=e.Utils.setArraySize(this.positions,r*3+2),d=null,f=n.closed,p=n.worldVerticesLength,m=p/6,h=t.NONE;if(!n.constantSpeed){var g=n.lengths;m-=f?1:2;var _=g[m];
1if(a&&(c*=_),o)for(var v=1;v<r;v++)l[v]*=_;d=e.Utils.setArraySize(this.world,8);for(var v=0,y=0,b=0;v<r;v++,y+=3){var x=l[v];c+=x;var S=c;if(f)S%=_,S<0&&(S+=_),b=0;else if(S<0){h!=t.BEFORE&&(h=t.BEFORE,n.computeWorldVertices(s,2,4,d,0,2)),this.addBeforePosition(S,d,0,u,y);continue}else if(S>_){h!=t.AFTER&&(h=t.AFTER,n.computeWorldVertices(s,p-6,4,d,0,2)),this.addAfterPosition(S-_,d,0,u,y);continue}for(;;b++){var C=g[b];if(!(S>C)){if(b==0)S/=C;else{var w=g[b-1];S=(S-w)/(C-w)}break}}b!=h&&(h=b,f&&b==m?(n.computeWorldVertices(s,p-4,4,d,0,2),n.computeWorldVertices(s,0,4,d,4,2)):n.computeWorldVertices(s,b*6+2,8,d,0,2)),this.addCurvePosition(S,d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],u,y,i||v>0&&x==0)}return u}f?(p+=2,d=e.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p-4,d,0,2),n.computeWorldVertices(s,0,2,d,p-4,2),d[p-2]=d[0],d[p-1]=d[1]):(m--,p-=4,d=e.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p,d,0,2));for(var T=e.Utils.setArraySize(this.curves,m),E=0,D=d[0],O=d[1],k=0,A=0,j=0,M=0,N=0,P=0,F=0,I=0,L=0,R=0,z=0,B=0,V=0,H=0,v=0,U=2;v<m;v++,U+=6)k=d[U],A=d[U+1],j=d[U+2],M=d[U+3],N=d[U+4],P=d[U+5],F=(D-k*2+j)*.1875,I=(O-A*2+M)*.1875,L=((k-j)*3-D+N)*.09375,R=((A-M)*3-O+P)*.09375,z=F*2+L,B=I*2+R,V=(k-D)*.75+F+L*.16666667,H=(A-O)*.75+I+R*.16666667,E+=Math.sqrt(V*V+H*H),V+=z,H+=B,z+=L,B+=R,E+=Math.sqrt(V*V+H*H),V+=z,H+=B,E+=Math.sqrt(V*V+H*H),V+=z+L,H+=B+R,E+=Math.sqrt(V*V+H*H),T[v]=E,D=N,O=P;if(c*=a?E:E/n.lengths[m-1],o)for(var v=1;v<r;v++)l[v]*=E;for(var W=this.segments,G=0,v=0,y=0,b=0,K=0;v<r;v++,y+=3){var x=l[v];c+=x;var S=c;if(f)S%=E,S<0&&(S+=E),b=0;else if(S<0){this.addBeforePosition(S,d,0,u,y);continue}else if(S>E){this.addAfterPosition(S-E,d,p-4,u,y);continue}for(;;b++){var q=T[b];if(!(S>q)){if(b==0)S/=q;else{var w=T[b-1];S=(S-w)/(q-w)}break}}if(b!=h){h=b;var J=b*6;for(D=d[J],O=d[J+1],k=d[J+2],A=d[J+3],j=d[J+4],M=d[J+5],N=d[J+6],P=d[J+7],F=(D-k*2+j)*.03,I=(O-A*2+M)*.03,L=((k-j)*3-D+N)*.006,R=((A-M)*3-O+P)*.006,z=F*2+L,B=I*2+R,V=(k-D)*.3+F+L*.16666667,H=(A-O)*.3+I+R*.16666667,G=Math.sqrt(V*V+H*H),W[0]=G,J=1;J<8;J++)V+=z,H+=B,z+=L,B+=R,G+=Math.sqrt(V*V+H*H),W[J]=G;V+=z,H+=B,G+=Math.sqrt(V*V+H*H),W[8]=G,V+=z+L,H+=B+R,G+=Math.sqrt(V*V+H*H),W[9]=G,K=0}for(S*=G;;K++){var Y=W[K];if(!(S>Y)){if(K==0)S/=Y;else{var w=W[K-1];S=K+(S-w)/(Y-w)}break}}this.addCurvePosition(S*.1,D,O,k,A,j,M,N,P,u,y,i||v>0&&x==0)}return u},t.prototype.addBeforePosition=function(e,t,n,r,i){var a=t[n],o=t[n+1],s=t[n+2]-a,c=t[n+3]-o,l=Math.atan2(c,s);r[i]=a+e*Math.cos(l),r[i+1]=o+e*Math.sin(l),r[i+2]=l},t.prototype.addAfterPosition=function(e,t,n,r,i){var a=t[n+2],o=t[n+3],s=a-t[n],c=o-t[n+1],l=Math.atan2(c,s);r[i]=a+e*Math.cos(l),r[i+1]=o+e*Math.sin(l),r[i+2]=l},t.prototype.addCurvePosition=function(e,t,n,r,i,a,o,s,c,l,u,d){if(e==0||isNaN(e)){l[u]=t,l[u+1]=n,l[u+2]=Math.atan2(i-n,r-t);return}var f=e*e,p=f*e,m=1-e,h=m*m,g=h*m,_=m*e,v=_*3,y=m*v,b=v*e,x=t*g+r*y+a*b+s*p,S=n*g+i*y+o*b+c*p;l[u]=x,l[u+1]=S,d&&(e<.001?l[u+2]=Math.atan2(i-n,r-t):l[u+2]=Math.atan2(S-(n*h+i*_*2+o*f),x-(t*h+r*_*2+a*f)))},t.NONE=-1,t.BEFORE=-2,t.AFTER=-3,t.epsilon=1e-5,t})()})(X||(X={}));var X;(function(e){e.PathConstraintData=(function(e){Y(t,e);function t(t){var n=e.call(this,t,0,!1)||this;return n.bones=[],n}return t})(e.ConstraintData),(function(e){e[e.Fixed=0]=`Fixed`,e[e.Percent=1]=`Percent`})(e.PositionMode||(e.PositionMode={})),(function(e){e[e.Length=0]=`Length`,e[e.Fixed=1]=`Fixed`,e[e.Percent=2]=`Percent`})(e.SpacingMode||(e.SpacingMode={})),(function(e){e[e.Tangent=0]=`Tangent`,e[e.Chain=1]=`Chain`,e[e.ChainScale=2]=`ChainScale`})(e.RotateMode||(e.RotateMode={}))})(X||(X={}));var X;(function(e){var t=(function(){function e(e){this.toLoad=[],this.assets={},this.clientId=e}return e.prototype.loaded=function(){var e=0;for(var t in this.assets)e++;return e},e})();e.SharedAssetManager=(function(){function e(e){e===void 0&&(e=``),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=e}return e.prototype.queueAsset=function(e,n,r){var i=this.clientAssets[e];return i==null&&(i=new t(e),this.clientAssets[e]=i),n!==null&&(i.textureLoader=n),i.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},e.prototype.loadText=function(e,t){var n=this;if(t=this.pathPrefix+t,this.queueAsset(e,null,t)){var r=new XMLHttpRequest;r.overrideMimeType(`text/html`),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[t]=r.responseText:n.errors[t]=`Couldn't load text `+t+`: status `+r.status+`, `+r.responseText)},r.open(`GET`,t,!0),r.send()}},e.prototype.loadJson=function(e,t){var n=this;if(t=this.pathPrefix+t,this.queueAsset(e,null,t)){var r=new XMLHttpRequest;r.overrideMimeType(`text/html`),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[t]=JSON.parse(r.responseText):n.errors[t]=`Couldn't load text `+t+`: status `+r.status+`, `+r.responseText)},r.open(`GET`,t,!0),r.send()}},e.prototype.loadTexture=function(e,t,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(e,t,n)){if(!(typeof window<`u`&&typeof navigator<`u`&&window.document)&&typeof importScripts<`u`)fetch(n,{mode:`cors`}).then(function(e){return e.ok||(r.errors[n]=`Couldn't load image `+n),e.blob()}).then(function(e){return createImageBitmap(e,{premultiplyAlpha:`none`,colorSpaceConversion:`none`})}).then(function(e){r.rawAssets[n]=e});else{var i=new Image;i.crossOrigin=`anonymous`,i.onload=function(e){r.rawAssets[n]=i},i.onerror=function(e){r.errors[n]=`Couldn't load image `+n},i.src=n}}},e.prototype.get=function(e,t){t=this.pathPrefix+t;var n=this.clientAssets[e];return n==null||n.assets[t]},e.prototype.updateClientAssets=function(e){for(var t=!(typeof window<`u`&&typeof navigator<`u`&&window.document)&&typeof importScripts<`u`,n=0;n<e.toLoad.length;n++){var r=e.toLoad[n];if(e.assets[r]==null){var i=this.rawAssets[r];if(i==null)continue;t?i instanceof ImageBitmap?e.assets[r]=e.textureLoader(i):e.assets[r]=i:i instanceof HTMLImageElement?e.assets[r]=e.textureLoader(i):e.assets[r]=i}}},e.prototype.isLoadingComplete=function(e){var t=this.clientAssets[e];return t==null||(this.updateClientAssets(t),t.toLoad.length==t.loaded())},e.prototype.dispose=function(){},e.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},e.prototype.getErrors=function(){return this.errors},e})()})(X||(X={}));var X;(function(e){e.Skeleton=(function(){function t(t){if(this._updateCache=[],this.updateCacheReset=[],this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,t==null)throw Error(`data cannot be null.`);this.data=t,this.bones=[];for(var n=0;n<t.bones.length;n++){var r=t.bones[n],i=void 0;if(r.parent==null)i=new e.Bone(r,this,null);else{var a=this.bones[r.parent.index];i=new e.Bone(r,this,a),a.children.push(i)}this.bones.push(i)}this.slots=[],this.drawOrder=[];for(var n=0;n<t.slots.length;n++){var o=t.slots[n],i=this.bones[o.boneData.index],s=new e.Slot(o,i);this.slots.push(s),this.drawOrder.push(s)}this.ikConstraints=[];for(var n=0;n<t.ikConstraints.length;n++){var c=t.ikConstraints[n];this.ikConstraints.push(new e.IkConstraint(c,this))}this.transformConstraints=[];for(var n=0;n<t.transformConstraints.length;n++){var l=t.transformConstraints[n];this.transformConstraints.push(new e.TransformConstraint(l,this))}this.pathConstraints=[];for(var n=0;n<t.pathConstraints.length;n++){var u=t.pathConstraints[n];this.pathConstraints.push(new e.PathConstraint(u,this))}this.color=new e.Color(1,1,1,1),this.updateCache()}return t.prototype.updateCache=function(){var e=this._updateCache;e.length=0,this.updateCacheReset.length=0;for(var t=this.bones,n=0,r=t.length;n<r;n++){var i=t[n];i.sorted=i.data.skinRequired,i.active=!i.sorted}if(this.skin!=null)for(var a=this.skin.bones,n=0,r=this.skin.bones.length;n<r;n++){var i=this.bones[a[n].index];do i.sorted=!1,i.active=!0,i=i.parent;while(i!=null)}var o=this.ikConstraints,s=this.transformConstraints,c=this.pathConstraints,l=o.length,u=s.length,d=c.length,f=l+u+d;outer:for(var n=0;n<f;n++){for(var p=0;p<l;p++){var m=o[p];if(m.data.order==n){this.sortIkConstraint(m);continue outer}}for(var p=0;p<u;p++){var m=s[p];if(m.data.order==n){this.sortTransformConstraint(m);continue outer}}for(var p=0;p<d;p++){var m=c[p];if(m.data.order==n){this.sortPathConstraint(m);continue outer}}}for(var n=0,r=t.length;n<r;n++)this.sortBone(t[n])},t.prototype.sortIkConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin!=null&&e.Utils.contains(this.skin.constraints,t.data,!0)),t.active){var n=t.target;this.sortBone(n);var r=t.bones,i=r[0];if(this.sortBone(i),r.length>1){var a=r[r.length-1];this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}this._updateCache.push(t),this.sortReset(i.children),r[r.length-1].sorted=!0}
1},t.prototype.sortPathConstraint=function(t){if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin!=null&&e.Utils.contains(this.skin.constraints,t.data,!0)),t.active){var n=t.target,r=n.data.index,i=n.bone;this.skin!=null&&this.sortPathConstraintAttachment(this.skin,r,i),this.data.defaultSkin!=null&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(var a=0,o=this.data.skins.length;a<o;a++)this.sortPathConstraintAttachment(this.data.skins[a],r,i);var s=n.getAttachment();s instanceof e.PathAttachment&&this.sortPathConstraintAttachmentWith(s,i);for(var c=t.bones,l=c.length,a=0;a<l;a++)this.sortBone(c[a]);this._updateCache.push(t);for(var a=0;a<l;a++)this.sortReset(c[a].children);for(var a=0;a<l;a++)c[a].sorted=!0}},t.prototype.sortTransformConstraint=function(t){if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin!=null&&e.Utils.contains(this.skin.constraints,t.data,!0)),t.active){this.sortBone(t.target);var n=t.bones,r=n.length;if(t.data.local)for(var i=0;i<r;i++){var a=n[i];this.sortBone(a.parent),this._updateCache.indexOf(a)>-1||this.updateCacheReset.push(a)}else for(var i=0;i<r;i++)this.sortBone(n[i]);this._updateCache.push(t);for(var o=0;o<r;o++)this.sortReset(n[o].children);for(var o=0;o<r;o++)n[o].sorted=!0}},t.prototype.sortPathConstraintAttachment=function(e,t,n){var r=e.attachments[t];if(r)for(var i in r)this.sortPathConstraintAttachmentWith(r[i],n)},t.prototype.sortPathConstraintAttachmentWith=function(t,n){if(t instanceof e.PathAttachment){var r=t.bones;if(r==null)this.sortBone(n);else for(var i=this.bones,a=0;a<r.length;)for(var o=r[a++],s=a+o;a<s;a++){var c=r[a];this.sortBone(i[c])}}},t.prototype.sortBone=function(e){if(!e.sorted){var t=e.parent;t!=null&&this.sortBone(t),e.sorted=!0,this._updateCache.push(e)}},t.prototype.sortReset=function(e){for(var t=0,n=e.length;t<n;t++){var r=e[t];r.active&&(r.sorted&&this.sortReset(r.children),r.sorted=!1)}},t.prototype.updateWorldTransform=function(){for(var e=this.updateCacheReset,t=0,n=e.length;t<n;t++){var r=e[t];r.ax=r.x,r.ay=r.y,r.arotation=r.rotation,r.ascaleX=r.scaleX,r.ascaleY=r.scaleY,r.ashearX=r.shearX,r.ashearY=r.shearY,r.appliedValid=!0}for(var i=this._updateCache,t=0,n=i.length;t<n;t++)i[t].update()},t.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},t.prototype.setBonesToSetupPose=function(){for(var e=this.bones,t=0,n=e.length;t<n;t++)e[t].setToSetupPose();for(var r=this.ikConstraints,t=0,n=r.length;t<n;t++){var i=r[t];i.mix=i.data.mix,i.softness=i.data.softness,i.bendDirection=i.data.bendDirection,i.compress=i.data.compress,i.stretch=i.data.stretch}for(var a=this.transformConstraints,t=0,n=a.length;t<n;t++){var i=a[t],o=i.data;i.rotateMix=o.rotateMix,i.translateMix=o.translateMix,i.scaleMix=o.scaleMix,i.shearMix=o.shearMix}for(var s=this.pathConstraints,t=0,n=s.length;t<n;t++){var i=s[t],o=i.data;i.position=o.position,i.spacing=o.spacing,i.rotateMix=o.rotateMix,i.translateMix=o.translateMix}},t.prototype.setSlotsToSetupPose=function(){var t=this.slots;e.Utils.arrayCopy(t,0,this.drawOrder,0,t.length);for(var n=0,r=t.length;n<r;n++)t[n].setToSetupPose()},t.prototype.getRootBone=function(){return this.bones.length==0?null:this.bones[0]},t.prototype.findBone=function(e){if(e==null)throw Error(`boneName cannot be null.`);for(var t=this.bones,n=0,r=t.length;n<r;n++){var i=t[n];if(i.data.name==e)return i}return null},t.prototype.findBoneIndex=function(e){if(e==null)throw Error(`boneName cannot be null.`);for(var t=this.bones,n=0,r=t.length;n<r;n++)if(t[n].data.name==e)return n;return-1},t.prototype.findSlot=function(e){if(e==null)throw Error(`slotName cannot be null.`);for(var t=this.slots,n=0,r=t.length;n<r;n++){var i=t[n];if(i.data.name==e)return i}return null},t.prototype.findSlotIndex=function(e){if(e==null)throw Error(`slotName cannot be null.`);for(var t=this.slots,n=0,r=t.length;n<r;n++)if(t[n].data.name==e)return n;return-1},t.prototype.setSkinByName=function(e){var t=this.data.findSkin(e);if(t==null)throw Error(`Skin not found: `+e);this.setSkin(t)},t.prototype.setSkin=function(e){if(e!=this.skin){if(e!=null){if(this.skin!=null)e.attachAll(this,this.skin);else for(var t=this.slots,n=0,r=t.length;n<r;n++){var i=t[n],a=i.data.attachmentName;if(a!=null){var o=e.getAttachment(n,a);o!=null&&i.setAttachment(o)}}}this.skin=e,this.updateCache()}},t.prototype.getAttachmentByName=function(e,t){return this.getAttachment(this.data.findSlotIndex(e),t)},t.prototype.getAttachment=function(e,t){if(t==null)throw Error(`attachmentName cannot be null.`);if(this.skin!=null){var n=this.skin.getAttachment(e,t);if(n!=null)return n}return this.data.defaultSkin==null?null:this.data.defaultSkin.getAttachment(e,t)},t.prototype.setAttachment=function(e,t){if(e==null)throw Error(`slotName cannot be null.`);for(var n=this.slots,r=0,i=n.length;r<i;r++){var a=n[r];if(a.data.name==e){var o=null;if(t!=null&&(o=this.getAttachment(r,t),o==null))throw Error(`Attachment not found: `+t+`, for slot: `+e);a.setAttachment(o);return}}throw Error(`Slot not found: `+e)},t.prototype.findIkConstraint=function(e){if(e==null)throw Error(`constraintName cannot be null.`);for(var t=this.ikConstraints,n=0,r=t.length;n<r;n++){var i=t[n];if(i.data.name==e)return i}return null},t.prototype.findTransformConstraint=function(e){if(e==null)throw Error(`constraintName cannot be null.`);for(var t=this.transformConstraints,n=0,r=t.length;n<r;n++){var i=t[n];if(i.data.name==e)return i}return null},t.prototype.findPathConstraint=function(e){if(e==null)throw Error(`constraintName cannot be null.`);for(var t=this.pathConstraints,n=0,r=t.length;n<r;n++){var i=t[n];if(i.data.name==e)return i}return null},t.prototype.getBounds=function(t,n,r){if(r===void 0&&(r=[,,]),t==null)throw Error(`offset cannot be null.`);if(n==null)throw Error(`size cannot be null.`);for(var i=this.drawOrder,a=1/0,o=1/0,s=-1/0,c=-1/0,l=0,u=i.length;l<u;l++){var d=i[l];if(d.bone.active){var f=0,p=null,m=d.getAttachment();if(m instanceof e.RegionAttachment)f=8,p=e.Utils.setArraySize(r,f,0),m.computeWorldVertices(d.bone,p,0,2);else if(m instanceof e.MeshAttachment){var h=m;f=h.worldVerticesLength,p=e.Utils.setArraySize(r,f,0),h.computeWorldVertices(d,0,f,p,0,2)}if(p!=null)for(var g=0,_=p.length;g<_;g+=2){var v=p[g],y=p[g+1];a=Math.min(a,v),o=Math.min(o,y),s=Math.max(s,v),c=Math.max(c,y)}}}t.set(a,o),n.set(s-a,c-o)},t.prototype.update=function(e){this.time+=e},t})()})(X||(X={}));var X;(function(e){e.SkeletonBinary=(function(){function i(e){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=e}return i.prototype.readSkeletonData=function(n){var r=this.scale,a=new e.SkeletonData;a.name=``;var o=new t(n);if(a.hash=o.readString(),a.version=o.readString(),a.version==`3.8.75`)throw Error(`Unsupported skeleton data, please export with a newer version of Spine.`);a.x=o.readFloat(),a.y=o.readFloat(),a.width=o.readFloat(),a.height=o.readFloat();var s=o.readBoolean();s&&(a.fps=o.readFloat(),a.imagesPath=o.readString(),a.audioPath=o.readString());var c=0;c=o.readInt(!0);for(var l=0;l<c;l++)o.strings.push(o.readString());c=o.readInt(!0);for(var l=0;l<c;l++){var u=o.readString(),d=l==0?null:a.bones[o.readInt(!0)],f=new e.BoneData(l,u,d);f.rotation=o.readFloat(),f.x=o.readFloat()*r,f.y=o.readFloat()*r,f.scaleX=o.readFloat(),f.scaleY=o.readFloat(),f.shearX=o.readFloat(),f.shearY=o.readFloat(),f.length=o.readFloat()*r,f.transformMode=i.TransformModeValues[o.readInt(!0)],f.skinRequired=o.readBoolean(),s&&e.Color.rgba8888ToColor(f.color,o.readInt32()),a.bones.push(f)}c=o.readInt(!0);for(var l=0;l<c;l++){var p=o.readString(),m=a.bones[o.readInt(!0)],f=new e.SlotData(l,p,m);e.Color.rgba8888ToColor(f.color,o.readInt32());var h=o.readInt32();h!=-1&&e.Color.rgb888ToColor(f.darkColor=new e.Color,h),f.attachmentName=o.readStringRef(),f.blendMode=i.BlendModeValues[o.readInt(!0)],a.slots.push(f)}c=o.readInt(!0);for(var l=0,g=void 0;l<c;l++){var f=new e.IkConstraintData(o.readString());f.order=o.readInt(!0),f.skinRequired=o.readBoolean(),g=o.readInt(!0);for(var _=0;_<g;_++)f.bones.push(a.bones[o.readInt(!0)]);f.target=a.bones[o.readInt(!0)],f.mix=o.readFloat(),f.softness=o.readFloat()*r,f.bendDirection=o.readByte(),f.compress=o.readBoolean(),f.stretch=o.readBoolean(),f.uniform=o.readBoolean(),a.ikConstraints.push(f)}c=o.readInt(!0);for(var l=0,g=void 0;l<c;l++){var f=new e.TransformConstraintData(o.readString());f.order=o.readInt(!0),f.skinRequired=o.readBoolean(),g=o.readInt(!0);for(var _=0;_<g;_++)f.bones.push(a.bones[o.readInt(!0)]);f.target=a.bones[o.readInt(!0)],f.local=o.readBoolean(),f.relative=o.readBoolean(),f.offsetRotation=o.readFloat(),f.offsetX=o.readFloat()*r,f.offsetY=o.readFloat()*r,f.offsetScaleX=o.readFloat(),f.offsetScaleY=o.readFloat(),f.offsetShearY=o.readFloat(),f.rotateMix=o.readFloat(),f.translateMix=o.readFloat(),f.scaleMix=o.readFloat(),f.shearMix=o.readFloat(),a.transformConstraints.push(f)}c=o.readInt(!0);for(var l=0,g=void 0;l<c;l++){var f=new e.PathConstraintData(o.readString());f.order=o.readInt(!0),f.skinRequired=o.readBoolean(),g=o.readInt(!0);for(var _=0;_<g;_++)f.bones.push(a.bones[o.readInt(!0)]);f.target=a.slots[o.readInt(!0)],f.positionMode=i.PositionModeValues[o.readInt(!0)],f.spacingMode=i.SpacingModeValues[o.readInt(!0)],f.rotateMode=i.RotateModeValues[o.readInt(!0)],f.offsetRotation=o.readFloat(),f.position=o.readFloat(),f.positionMode==e.PositionMode.Fixed&&(f.position*=r),f.spacing=o.readFloat(),(f.spacingMode==e.SpacingMode.Length||f.spacingMode==e.SpacingMode.Fixed)&&(f.spacing*=r),f.rotateMix=o.readFloat(),f.translateMix=o.readFloat(),a.pathConstraints.push(f)}var v=this.readSkin(o,a,!0,s);v!=null&&(a.defaultSkin=v,a.skins.push(v));var l=a.skins.length;for(e.Utils.setArraySize(a.skins,c=l+o.readInt(!0));l<c;l++)a.skins[l]=this.readSkin(o,a,!1,s);c=this.linkedMeshes.length;for(var l=0;l<c;l++){var y=this.linkedMeshes[l],b=y.skin==null?a.defaultSkin:a.findSkin(y.skin);if(b==null)throw Error(`Skin not found: `+y.skin);var x=b.getAttachment(y.slotIndex,y.parent);if(x==null)throw Error(`Parent mesh not found: `+y.parent);y.mesh.deformAttachment=y.inheritDeform?x:y.mesh,y.mesh.setParentMesh(x),y.mesh.updateUVs()}this.linkedMeshes.length=0,c=o.readInt(!0);for(var l=0;l<c;l++){var f=new e.EventData(o.readStringRef());f.intValue=o.readInt(!1),f.floatValue=o.readFloat(),f.stringValue=o.readString(),f.audioPath=o.readString(),f.audioPath!=null&&(f.volume=o.readFloat(),f.balance=o.readFloat()),a.events.push(f)}c=o.readInt(!0);for(var l=0;l<c;l++)a.animations.push(this.readAnimation(o,o.readString(),a));return a},i.prototype.readSkin=function(t,n,r,i){var a=null,o=0;if(r){if(o=t.readInt(!0),o==0)return null;a=new e.Skin(`default`)}else{a=new e.Skin(t.readStringRef()),a.bones.length=t.readInt(!0);for(var s=0,c=a.bones.length;s<c;s++)a.bones[s]=n.bones[t.readInt(!0)];for(var s=0,c=t.readInt(!0);s<c;s++)a.constraints.push(n.ikConstraints[t.readInt(!0)]);for(var s=0,c=t.readInt(!0);s<c;s++)a.constraints.push(n.transformConstraints[t.readInt(!0)]);for(var s=0,c=t.readInt(!0);s<c;s++)a.constraints.push(n.pathConstraints[t.readInt(!0)]);o=t.readInt(!0)}for(var s=0;s<o;s++)for(var l=t.readInt(!0),u=0,d=t.readInt(!0);u<d;u++){var f=t.readStringRef(),p=this.readAttachment(t,n,a,l,f,i);p!=null&&a.setAttachment(l,f,p)}return a},i.prototype.readAttachment=function(t,r,a,o,s,c){var l=this.scale,u=t.readStringRef();u==null&&(u=s);var d=t.readByte();switch(i.AttachmentTypeValues[d]){case e.AttachmentType.Region:var f=t.readStringRef(),p=t.readFloat(),m=t.readFloat(),h=t.readFloat(),g=t.readFloat(),_=t.readFloat(),v=t.readFloat(),y=t.readFloat(),b=t.readInt32();f==null&&(f=u);var x=this.attachmentLoader.newRegionAttachment(a,u,f);return x==null?null:(x.path=f,x.x=m*l,x.y=h*l,x.scaleX=g,x.scaleY=_,x.rotation=p,x.width=v*l,x.height=y*l,e.Color.rgba8888ToColor(x.color,b),x.updateOffset(),x);case e.AttachmentType.BoundingBox:var S=t.readInt(!0),C=this.readVertices(t,S),b=c?t.readInt32():0,w=this.attachmentLoader.newBoundingBoxAttachment(a,u);return w==null?null:(w.worldVerticesLength=S<<1,w.vertices=C.vertices,w.bones=C.bones,c&&e.Color.rgba8888ToColor(w.color,b),w);case e.AttachmentType.Mesh:var f=t.readStringRef(),b=t.readInt32(),S=t.readInt(!0),T=this.readFloatArray(t,S<<1,1),E=this.readShortArray(t),C=this.readVertices(t,S),D=t.readInt(!0),O=null,v=0,y=0;c&&(O=this.readShortArray(t),v=t.readFloat(),y=t.readFloat()),f==null&&(f=u);var k=this.attachmentLoader.newMeshAttachment(a,u,f);return k==null?null:(k.path=f,e.Color.rgba8888ToColor(k.color,b),k.bones=C.bones,k.vertices=C.vertices,k.worldVerticesLength=S<<1,k.triangles=E,k.regionUVs=T,k.updateUVs(),k.hullLength=D<<1,c&&(k.edges=O,k.width=v*l,k.height=y*l),k);case e.AttachmentType.LinkedMesh:var f=t.readStringRef(),b=t.readInt32(),A=t.readStringRef(),j=t.readStringRef(),M=t.readBoolean(),v=0,y=0;c&&(v=t.readFloat(),y=t.readFloat()),f==null&&(f=u);var k=this.attachmentLoader.newMeshAttachment(a,u,f);return k==null?null:(k.path=f,e.Color.rgba8888ToColor(k.color,b),c&&(k.width=v*l,k.height=y*l),this.linkedMeshes.push(new n(k,A,o,j,M)),k);case e.AttachmentType.Path:for(var N=t.readBoolean(),P=t.readBoolean(),S=t.readInt(!0),C=this.readVertices(t,S),F=e.Utils.newArray(S/3,0),I=0,L=F.length;I<L;I++)F[I]=t.readFloat()*l;var b=c?t.readInt32():0,f=this.attachmentLoader.newPathAttachment(a,u);return f==null?null:(f.closed=N,f.constantSpeed=P,f.worldVerticesLength=S<<1,f.vertices=C.vertices,f.bones=C.bones,f.lengths=F,c&&e.Color.rgba8888ToColor(f.color,b),f);case e.AttachmentType.Point:var p=t.readFloat(),m=t.readFloat(),h=t.readFloat(),b=c?t.readInt32():0,R=this.attachmentLoader.newPointAttachment(a,u);return R==null?null:(R.x=m*l,R.y=h*l,R.rotation=p,c&&e.Color.rgba8888ToColor(R.color,b),R);case e.AttachmentType.Clipping:var z=t.readInt(!0),S=t.readInt(!0),C=this.readVertices(t,S),b=c?t.readInt32():0,B=this.attachmentLoader.newClippingAttachment(a,u);return B==null?null:(B.endSlot=r.slots[z],B.worldVerticesLength=S<<1,B.vertices=C.vertices,B.bones=C.bones,c&&e.Color.rgba8888ToColor(B.color,b),B)}return null},i.prototype.readVertices=function(t,n){var i=n<<1,a=new r,o=this.scale;if(!t.readBoolean())return a.vertices=this.readFloatArray(t,i,o),a;for(var s=[],c=[],l=0;l<n;l++){var u=t.readInt(!0);c.push(u);for(var d=0;d<u;d++)c.push(t.readInt(!0)),s.push(t.readFloat()*o),s.push(t.readFloat()*o),s.push(t.readFloat())}return a.vertices=e.Utils.toFloatArray(s),a.bones=c,a},i.prototype.readFloatArray=function(e,t,n){var r=Array(t);if(n==1)for(var i=0;i<t;i++)r[i]=e.readFloat();else for(var i=0;i<t;i++)r[i]=e.readFloat()*n;return r},i.prototype.readShortArray=function(e){for(var t=e.readInt(!0),n=Array(t),r=0;r<t;r++)n[r]=e.readShort();return n},i.prototype.readAnimation=function(t,n,r){for(var a=[],o=this.scale,s=0,c=new e.Color,l=new e.Color,u=0,d=t.readInt(!0);u<d;u++)for(var f=t.readInt(!0),p=0,m=t.readInt(!0);p<m;p++){var h=t.readByte(),g=t.readInt(!0);switch(h){case i.SLOT_ATTACHMENT:var _=new e.AttachmentTimeline(g);_.slotIndex=f;for(var v=0;v<g;
1v++)_.setFrame(v,t.readFloat(),t.readStringRef());a.push(_),s=Math.max(s,_.frames[g-1]);break;case i.SLOT_COLOR:var _=new e.ColorTimeline(g);_.slotIndex=f;for(var v=0;v<g;v++){var y=t.readFloat();e.Color.rgba8888ToColor(c,t.readInt32()),_.setFrame(v,y,c.r,c.g,c.b,c.a),v<g-1&&this.readCurve(t,v,_)}a.push(_),s=Math.max(s,_.frames[(g-1)*e.ColorTimeline.ENTRIES]);break;case i.SLOT_TWO_COLOR:var _=new e.TwoColorTimeline(g);_.slotIndex=f;for(var v=0;v<g;v++){var y=t.readFloat();e.Color.rgba8888ToColor(c,t.readInt32()),e.Color.rgb888ToColor(l,t.readInt32()),_.setFrame(v,y,c.r,c.g,c.b,c.a,l.r,l.g,l.b),v<g-1&&this.readCurve(t,v,_)}a.push(_),s=Math.max(s,_.frames[(g-1)*e.TwoColorTimeline.ENTRIES])}}for(var u=0,d=t.readInt(!0);u<d;u++)for(var b=t.readInt(!0),p=0,m=t.readInt(!0);p<m;p++){var h=t.readByte(),g=t.readInt(!0);switch(h){case i.BONE_ROTATE:var _=new e.RotateTimeline(g);_.boneIndex=b;for(var v=0;v<g;v++)_.setFrame(v,t.readFloat(),t.readFloat()),v<g-1&&this.readCurve(t,v,_);a.push(_),s=Math.max(s,_.frames[(g-1)*e.RotateTimeline.ENTRIES]);break;case i.BONE_TRANSLATE:case i.BONE_SCALE:case i.BONE_SHEAR:var _=void 0,x=1;h==i.BONE_SCALE?_=new e.ScaleTimeline(g):h==i.BONE_SHEAR?_=new e.ShearTimeline(g):(_=new e.TranslateTimeline(g),x=o),_.boneIndex=b;for(var v=0;v<g;v++)_.setFrame(v,t.readFloat(),t.readFloat()*x,t.readFloat()*x),v<g-1&&this.readCurve(t,v,_);a.push(_),s=Math.max(s,_.frames[(g-1)*e.TranslateTimeline.ENTRIES])}}for(var u=0,d=t.readInt(!0);u<d;u++){var S=t.readInt(!0),g=t.readInt(!0),_=new e.IkConstraintTimeline(g);_.ikConstraintIndex=S;for(var v=0;v<g;v++)_.setFrame(v,t.readFloat(),t.readFloat(),t.readFloat()*o,t.readByte(),t.readBoolean(),t.readBoolean()),v<g-1&&this.readCurve(t,v,_);a.push(_),s=Math.max(s,_.frames[(g-1)*e.IkConstraintTimeline.ENTRIES])}for(var u=0,d=t.readInt(!0);u<d;u++){var S=t.readInt(!0),g=t.readInt(!0),_=new e.TransformConstraintTimeline(g);_.transformConstraintIndex=S;for(var v=0;v<g;v++)_.setFrame(v,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat()),v<g-1&&this.readCurve(t,v,_);a.push(_),s=Math.max(s,_.frames[(g-1)*e.TransformConstraintTimeline.ENTRIES])}for(var u=0,d=t.readInt(!0);u<d;u++)for(var S=t.readInt(!0),C=r.pathConstraints[S],p=0,m=t.readInt(!0);p<m;p++){var h=t.readByte(),g=t.readInt(!0);switch(h){case i.PATH_POSITION:case i.PATH_SPACING:var _=void 0,x=1;h==i.PATH_SPACING?(_=new e.PathConstraintSpacingTimeline(g),(C.spacingMode==e.SpacingMode.Length||C.spacingMode==e.SpacingMode.Fixed)&&(x=o)):(_=new e.PathConstraintPositionTimeline(g),C.positionMode==e.PositionMode.Fixed&&(x=o)),_.pathConstraintIndex=S;for(var v=0;v<g;v++)_.setFrame(v,t.readFloat(),t.readFloat()*x),v<g-1&&this.readCurve(t,v,_);a.push(_),s=Math.max(s,_.frames[(g-1)*e.PathConstraintPositionTimeline.ENTRIES]);break;case i.PATH_MIX:var _=new e.PathConstraintMixTimeline(g);_.pathConstraintIndex=S;for(var v=0;v<g;v++)_.setFrame(v,t.readFloat(),t.readFloat(),t.readFloat()),v<g-1&&this.readCurve(t,v,_);a.push(_),s=Math.max(s,_.frames[(g-1)*e.PathConstraintMixTimeline.ENTRIES])}}for(var u=0,d=t.readInt(!0);u<d;u++)for(var w=r.skins[t.readInt(!0)],p=0,m=t.readInt(!0);p<m;p++)for(var f=t.readInt(!0),T=0,E=t.readInt(!0);T<E;T++){var D=w.getAttachment(f,t.readStringRef()),O=D.bones!=null,k=D.vertices,A=O?k.length/3*2:k.length,g=t.readInt(!0),_=new e.DeformTimeline(g);_.slotIndex=f,_.attachment=D;for(var v=0;v<g;v++){var y=t.readFloat(),j=void 0,M=t.readInt(!0);if(M==0)j=O?e.Utils.newFloatArray(A):k;else{j=e.Utils.newFloatArray(A);var N=t.readInt(!0);if(M+=N,o==1)for(var P=N;P<M;P++)j[P]=t.readFloat();else for(var P=N;P<M;P++)j[P]=t.readFloat()*o;if(!O)for(var P=0,F=j.length;P<F;P++)j[P]+=k[P]}_.setFrame(v,y,j),v<g-1&&this.readCurve(t,v,_)}a.push(_),s=Math.max(s,_.frames[g-1])}var I=t.readInt(!0);if(I>0){for(var _=new e.DrawOrderTimeline(I),L=r.slots.length,u=0;u<I;u++){for(var y=t.readFloat(),R=t.readInt(!0),z=e.Utils.newArray(L,0),p=L-1;p>=0;p--)z[p]=-1;for(var B=e.Utils.newArray(L-R,0),V=0,H=0,p=0;p<R;p++){for(var f=t.readInt(!0);V!=f;)B[H++]=V++;z[V+t.readInt(!0)]=V++}for(;V<L;)B[H++]=V++;for(var p=L-1;p>=0;p--)z[p]==-1&&(z[p]=B[--H]);
1_.setFrame(u,y,z)}a.push(_),s=Math.max(s,_.frames[I-1])}var U=t.readInt(!0);if(U>0){for(var _=new e.EventTimeline(U),u=0;u<U;u++){var y=t.readFloat(),W=r.events[t.readInt(!0)],G=new e.Event(y,W);G.intValue=t.readInt(!1),G.floatValue=t.readFloat(),G.stringValue=t.readBoolean()?t.readString():W.stringValue,G.data.audioPath!=null&&(G.volume=t.readFloat(),G.balance=t.readFloat()),_.setFrame(u,G)}a.push(_),s=Math.max(s,_.frames[U-1])}return new e.Animation(n,a,s)},i.prototype.readCurve=function(e,t,n){switch(e.readByte()){case i.CURVE_STEPPED:n.setStepped(t);break;case i.CURVE_BEZIER:this.setCurve(n,t,e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat())}},i.prototype.setCurve=function(e,t,n,r,i,a){e.setCurve(t,n,r,i,a)},i.AttachmentTypeValues=[0,1,2,3,4,5,6],i.TransformModeValues=[e.TransformMode.Normal,e.TransformMode.OnlyTranslation,e.TransformMode.NoRotationOrReflection,e.TransformMode.NoScale,e.TransformMode.NoScaleOrReflection],i.PositionModeValues=[e.PositionMode.Fixed,e.PositionMode.Percent],i.SpacingModeValues=[e.SpacingMode.Length,e.SpacingMode.Fixed,e.SpacingMode.Percent],i.RotateModeValues=[e.RotateMode.Tangent,e.RotateMode.Chain,e.RotateMode.ChainScale],i.BlendModeValues=[e.BlendMode.Normal,e.BlendMode.Additive,e.BlendMode.Multiply,e.BlendMode.Screen],i.BONE_ROTATE=0,i.BONE_TRANSLATE=1,i.BONE_SCALE=2,i.BONE_SHEAR=3,i.SLOT_ATTACHMENT=0,i.SLOT_COLOR=1,i.SLOT_TWO_COLOR=2,i.PATH_POSITION=0,i.PATH_SPACING=1,i.PATH_MIX=2,i.CURVE_LINEAR=0,i.CURVE_STEPPED=1,i.CURVE_BEZIER=2,i})();var t=(function(){function e(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=0),r===void 0&&(r=new DataView(e.buffer)),this.strings=t,this.index=n,this.buffer=r}return e.prototype.readByte=function(){return this.buffer.getInt8(this.index++)},e.prototype.readUnsignedByte=function(){return this.buffer.getUint8(this.index++)},e.prototype.readShort=function(){var e=this.buffer.getInt16(this.index);return this.index+=2,e},e.prototype.readInt32=function(){var e=this.buffer.getInt32(this.index);return this.index+=4,e},e.prototype.readInt=function(e){var t=this.readByte(),n=t&127;return t&128&&(t=this.readByte(),n|=(t&127)<<7,t&128&&(t=this.readByte(),n|=(t&127)<<14,t&128&&(t=this.readByte(),n|=(t&127)<<21,t&128&&(t=this.readByte(),n|=(t&127)<<28)))),e?n:n>>>1^-(n&1)},e.prototype.readStringRef=function(){var e=this.readInt(!0);return e==0?null:this.strings[e-1]},e.prototype.readString=function(){var e=this.readInt(!0);switch(e){case 0:return null;case 1:return``}e--;for(var t=``,n=0;n<e;){var r=this.readUnsignedByte();switch(r>>4){case 12:case 13:t+=String.fromCharCode((r&31)<<6|this.readByte()&63),n+=2;break;case 14:t+=String.fromCharCode((r&15)<<12|(this.readByte()&63)<<6|this.readByte()&63),n+=3;break;default:t+=String.fromCharCode(r),n++}}return t},e.prototype.readFloat=function(){var e=this.buffer.getFloat32(this.index);return this.index+=4,e},e.prototype.readBoolean=function(){return this.readByte()!=0},e})(),n=(function(){function e(e,t,n,r,i){this.mesh=e,this.skin=t,this.slotIndex=n,this.parent=r,this.inheritDeform=i}return e})(),r=(function(){function e(e,t){e===void 0&&(e=null),t===void 0&&(t=null),this.bones=e,this.vertices=t}return e})()})(X||(X={}));var X;(function(e){e.SkeletonBounds=(function(){function t(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=[],this.polygons=[],this.polygonPool=new e.Pool(function(){return e.Utils.newFloatArray(16)})}return t.prototype.update=function(t,n){if(t==null)throw Error(`skeleton cannot be null.`);var r=this.boundingBoxes,i=this.polygons,a=this.polygonPool,o=t.slots,s=o.length;r.length=0,a.freeAll(i),i.length=0;for(var c=0;c<s;c++){var l=o[c];if(l.bone.active){var u=l.getAttachment();if(u instanceof e.BoundingBoxAttachment){var d=u;r.push(d);var f=a.obtain();f.length!=d.worldVerticesLength&&(f=e.Utils.newFloatArray(d.worldVerticesLength)),i.push(f),d.computeWorldVertices(l,0,d.worldVerticesLength,f,0,2)}}}n?this.aabbCompute():(this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0)},t.prototype.aabbCompute=function(){for(var e=1/0,t=1/0,n=-1/0,r=-1/0,i=this.polygons,a=0,o=i.length;a<o;a++)for(var s=i[a],c=s,l=0,u=s.length;l<u;l+=2){var d=c[l],f=c[l+1];e=Math.min(e,d),t=Math.min(t,f),n=Math.max(n,d),r=Math.max(r,f)}this.minX=e,this.minY=t,this.maxX=n,this.maxY=r},t.prototype.aabbContainsPoint=function(e,t){return e>=this.minX&&e<=this.maxX&&t>=this.minY&&t<=this.maxY},t.prototype.aabbIntersectsSegment=function(e,t,n,r){var i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;if(e<=i&&n<=i||t<=a&&r<=a||e>=o&&n>=o||t>=s&&r>=s)return!1;var c=(r-t)/(n-e),l=c*(i-e)+t;if(l>a&&l<s||(l=c*(o-e)+t,l>a&&l<s))return!0;var u=(a-t)/c+e;return u>i&&u<o||(u=(s-t)/c+e,u>i&&u<o)},t.prototype.aabbIntersectsSkeleton=function(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY},t.prototype.containsPoint=function(e,t){for(var n=this.polygons,r=0,i=n.length;r<i;r++)if(this.containsPointPolygon(n[r],e,t))return this.boundingBoxes[r];return null},t.prototype.containsPointPolygon=function(e,t,n){for(var r=e,i=e.length,a=i-2,o=!1,s=0;s<i;s+=2){var c=r[s+1],l=r[a+1];if(c<n&&l>=n||l<n&&c>=n){var u=r[s];u+(n-c)/(l-c)*(r[a]-u)<t&&(o=!o)}a=s}return o},t.prototype.intersectsSegment=function(e,t,n,r){for(var i=this.polygons,a=0,o=i.length;a<o;a++)if(this.intersectsSegmentPolygon(i[a],e,t,n,r))return this.boundingBoxes[a];return null},t.prototype.intersectsSegmentPolygon=function(e,t,n,r,i){for(var a=e,o=e.length,s=t-r,c=n-i,l=t*i-n*r,u=a[o-2],d=a[o-1],f=0;f<o;f+=2){var p=a[f],m=a[f+1],h=u*m-d*p,g=u-p,_=d-m,v=s*_-c*g,y=(l*g-s*h)/v;if((y>=u&&y<=p||y>=p&&y<=u)&&(y>=t&&y<=r||y>=r&&y<=t)){var b=(l*_-c*h)/v;if((b>=d&&b<=m||b>=m&&b<=d)&&(b>=n&&b<=i||b>=i&&b<=n))return!0}u=p,d=m}return!1},t.prototype.getPolygon=function(e){if(e==null)throw Error(`boundingBox cannot be null.`);var t=this.boundingBoxes.indexOf(e);return t==-1?null:this.polygons[t]},t.prototype.getWidth=function(){return this.maxX-this.minX},t.prototype.getHeight=function(){return this.maxY-this.minY},t})()})(X||(X={}));var X;(function(e){e.SkeletonClipping=(function(){function t(){this.triangulator=new e.Triangulator,this.clippingPolygon=[],this.clipOutput=[],this.clippedVertices=[],this.clippedTriangles=[],this.scratch=[]}return t.prototype.clipStart=function(n,r){if(this.clipAttachment!=null)return 0;this.clipAttachment=r;var i=r.worldVerticesLength,a=e.Utils.setArraySize(this.clippingPolygon,i);r.computeWorldVertices(n,0,i,a,0,2);var o=this.clippingPolygon;t.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),c=0,l=s.length;c<l;c++){var u=s[c];t.makeClockwise(u),u.push(u[0]),u.push(u[1])}return s.length},t.prototype.clipEndWithSlot=function(e){this.clipAttachment!=null&&this.clipAttachment.endSlot==e.data&&this.clipEnd()},t.prototype.clipEnd=function(){this.clipAttachment!=null&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},t.prototype.isClipping=function(){return this.clipAttachment!=null},t.prototype.clipTriangles=function(t,n,r,i,a,o,s,c){var l=this.clipOutput,u=this.clippedVertices,d=this.clippedTriangles,f=this.clippingPolygons,p=this.clippingPolygons.length,m=c?12:8,h=0;u.length=0,d.length=0;outer:for(var g=0;g<i;g+=3){var _=r[g]<<1,v=t[_],y=t[_+1],b=a[_],x=a[_+1];_=r[g+1]<<1;var S=t[_],C=t[_+1],w=a[_],T=a[_+1];_=r[g+2]<<1;for(var E=t[_],D=t[_+1],O=a[_],k=a[_+1],A=0;A<p;A++){var j=u.length;if(this.clip(v,y,S,C,E,D,f[A],l)){var M=l.length;if(M==0)continue;for(var N=C-D,P=E-S,F=v-E,I=D-y,L=1/(N*F+P*(y-D)),R=M>>1,z=this.clipOutput,B=e.Utils.setArraySize(u,j+R*m),V=0;V<M;V+=2){var H=z[V],U=z[V+1];B[j]=H,B[j+1]=U,B[j+2]=o.r,B[j+3]=o.g,B[j+4]=o.b,B[j+5]=o.a;var W=H-E,G=U-D,K=(N*W+P*G)*L,q=(I*W+F*G)*L,J=1-K-q;B[j+6]=b*K+w*q+O*J,B[j+7]=x*K+T*q+k*J,c&&(B[j+8]=s.r,B[j+9]=s.g,B[j+10]=s.b,B[j+11]=s.a),j+=m}j=d.length;var Y=e.Utils.setArraySize(d,j+3*(R-2));R--;for(var V=1;V<R;V++)Y[j]=h,Y[j+1]=h+V,Y[j+2]=h+V+1,j+=3;h+=R+1}else{var B=e.Utils.setArraySize(u,j+3*m);B[j]=v,B[j+1]=y,B[j+2]=o.r,B[j+3]=o.g,B[j+4]=o.b,B[j+5]=o.a,c?(B[j+6]=b,B[j+7]=x,B[j+8]=s.r,B[j+9]=s.g,B[j+10]=s.b,B[j+11]=s.a,B[j+12]=S,B[j+13]=C,B[j+14]=o.r,B[j+15]=o.g,B[j+16]=o.b,B[j+17]=o.a,B[j+18]=w,B[j+19]=T,B[j+20]=s.r,B[j+21]=s.g,B[j+22]=s.b,B[j+23]=s.a,B[j+24]=E,B[j+25
1]=D,B[j+26]=o.r,B[j+27]=o.g,B[j+28]=o.b,B[j+29]=o.a,B[j+30]=O,B[j+31]=k,B[j+32]=s.r,B[j+33]=s.g,B[j+34]=s.b,B[j+35]=s.a):(B[j+6]=b,B[j+7]=x,B[j+8]=S,B[j+9]=C,B[j+10]=o.r,B[j+11]=o.g,B[j+12]=o.b,B[j+13]=o.a,B[j+14]=w,B[j+15]=T,B[j+16]=E,B[j+17]=D,B[j+18]=o.r,B[j+19]=o.g,B[j+20]=o.b,B[j+21]=o.a,B[j+22]=O,B[j+23]=k),j=d.length;var Y=e.Utils.setArraySize(d,j+3);Y[j]=h,Y[j+1]=h+1,Y[j+2]=h+2,h+=3;continue outer}}}},t.prototype.clip=function(e,t,n,r,i,a,o,s){var c=s,l=!1,u=null;o.length%4>=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(e),u.push(t),u.push(n),u.push(r),u.push(i),u.push(a),u.push(e),u.push(t),s.length=0;for(var d=o,f=o.length-4,p=0;;p+=2){for(var m=d[p],h=d[p+1],g=d[p+2],_=d[p+3],v=m-g,y=h-_,b=u,x=u.length-2,S=s.length,C=0;C<x;C+=2){var w=b[C],T=b[C+1],E=b[C+2],D=b[C+3],O=v*(D-_)-y*(E-g)>0;if(v*(T-_)-y*(w-g)>0){if(O){s.push(E),s.push(D);continue}var k=D-T,A=E-w,j=k*(g-m)-A*(_-h);if(Math.abs(j)>1e-6){var M=(A*(h-T)-k*(m-w))/j;s.push(m+(g-m)*M),s.push(h+(_-h)*M)}else s.push(m),s.push(h)}else if(O){var k=D-T,A=E-w,j=k*(g-m)-A*(_-h);if(Math.abs(j)>1e-6){var M=(A*(h-T)-k*(m-w))/j;s.push(m+(g-m)*M),s.push(h+(_-h)*M)}else s.push(m),s.push(h);s.push(E),s.push(D)}l=!0}if(S==s.length)return c.length=0,!0;if(s.push(s[0]),s.push(s[1]),p==f)break;var N=s;s=u,s.length=0,u=N}if(c!=s){c.length=0;for(var p=0,P=s.length-2;p<P;p++)c[p]=s[p]}else c.length-=2;return l},t.makeClockwise=function(e){for(var t=e,n=e.length,r=t[n-2]*t[1]-t[0]*t[n-1],i=0,a=0,o=0,s=0,c=0,l=n-3;c<l;c+=2)i=t[c],a=t[c+1],o=t[c+2],s=t[c+3],r+=i*s-o*a;if(!(r<0))for(var c=0,u=n-2,l=n>>1;c<l;c+=2){var d=t[c],f=t[c+1],p=u-c;t[c]=t[p],t[c+1]=t[p+1],t[p]=d,t[p+1]=f}},t})()})(X||(X={}));var X;(function(e){e.SkeletonData=(function(){function e(){this.bones=[],this.slots=[],this.skins=[],this.events=[],this.animations=[],this.ikConstraints=[],this.transformConstraints=[],this.pathConstraints=[],this.fps=0}return e.prototype.findBone=function(e){if(e==null)throw Error(`boneName cannot be null.`);for(var t=this.bones,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findBoneIndex=function(e){if(e==null)throw Error(`boneName cannot be null.`);for(var t=this.bones,n=0,r=t.length;n<r;n++)if(t[n].name==e)return n;return-1},e.prototype.findSlot=function(e){if(e==null)throw Error(`slotName cannot be null.`);for(var t=this.slots,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findSlotIndex=function(e){if(e==null)throw Error(`slotName cannot be null.`);for(var t=this.slots,n=0,r=t.length;n<r;n++)if(t[n].name==e)return n;return-1},e.prototype.findSkin=function(e){if(e==null)throw Error(`skinName cannot be null.`);for(var t=this.skins,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findEvent=function(e){if(e==null)throw Error(`eventDataName cannot be null.`);for(var t=this.events,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findAnimation=function(e){if(e==null)throw Error(`animationName cannot be null.`);for(var t=this.animations,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findIkConstraint=function(e){if(e==null)throw Error(`constraintName cannot be null.`);for(var t=this.ikConstraints,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findTransformConstraint=function(e){if(e==null)throw Error(`constraintName cannot be null.`);for(var t=this.transformConstraints,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findPathConstraint=function(e){if(e==null)throw Error(`constraintName cannot be null.`);for(var t=this.pathConstraints,n=0,r=t.length;n<r;n++){var i=t[n];if(i.name==e)return i}return null},e.prototype.findPathConstraintIndex=function(e){if(e==null)throw Error(`pathConstraintName cannot be null.`);for(var t=this.pathConstraints,n=0,r=t.length;n<r;n++)if(t[n].name==e)return n;return-1},e})()})(X||(X={}));var X;(function(e){e.SkeletonJson=(function(){function n(e){this.scale=1,this.linkedMeshes=[],this.attachmentLoader=e}return n.prototype.readSkeletonData=function(t){var r=this.scale,i=new e.SkeletonData,a=typeof t==`string`?JSON.parse(t):t,o=a.skeleton;if(o!=null){if(i.hash=o.hash,i.version=o.spine,i.version==`3.8.75`)throw Error(`Unsupported skeleton data, please export with a newer version of Spine.`);i.x=o.x,i.y=o.y,i.width=o.width,i.height=o.height,i.fps=o.fps,i.imagesPath=o.images}if(a.bones)for(var s=0;s<a.bones.length;s++){var c=a.bones[s],l=null,u=this.getValue(c,`parent`,null);if(u!=null&&(l=i.findBone(u),l==null))throw Error(`Parent bone not found: `+u);var d=new e.BoneData(i.bones.length,c.name,l);d.length=this.getValue(c,`length`,0)*r,d.x=this.getValue(c,`x`,0)*r,d.y=this.getValue(c,`y`,0)*r,d.rotation=this.getValue(c,`rotation`,0),d.scaleX=this.getValue(c,`scaleX`,1),d.scaleY=this.getValue(c,`scaleY`,1),d.shearX=this.getValue(c,`shearX`,0),d.shearY=this.getValue(c,`shearY`,0),d.transformMode=n.transformModeFromString(this.getValue(c,`transform`,`normal`)),d.skinRequired=this.getValue(c,`skin`,!1),i.bones.push(d)}if(a.slots)for(var s=0;s<a.slots.length;s++){var f=a.slots[s],p=f.name,m=f.bone,h=i.findBone(m);if(h==null)throw Error(`Slot bone not found: `+m);var d=new e.SlotData(i.slots.length,p,h),g=this.getValue(f,`color`,
1null);g!=null&&d.color.setFromString(g);var _=this.getValue(f,`dark`,null);_!=null&&(d.darkColor=new e.Color(1,1,1,1),d.darkColor.setFromString(_)),d.attachmentName=this.getValue(f,`attachment`,null),d.blendMode=n.blendModeFromString(this.getValue(f,`blend`,`normal`)),i.slots.push(d)}if(a.ik)for(var s=0;s<a.ik.length;s++){var v=a.ik[s],d=new e.IkConstraintData(v.name);d.order=this.getValue(v,`order`,0),d.skinRequired=this.getValue(v,`skin`,!1);for(var y=0;y<v.bones.length;y++){var m=v.bones[y],b=i.findBone(m);if(b==null)throw Error(`IK bone not found: `+m);d.bones.push(b)}var x=v.target;if(d.target=i.findBone(x),d.target==null)throw Error(`IK target bone not found: `+x);d.mix=this.getValue(v,`mix`,1),d.softness=this.getValue(v,`softness`,0)*r,d.bendDirection=this.getValue(v,`bendPositive`,!0)?1:-1,d.compress=this.getValue(v,`compress`,!1),d.stretch=this.getValue(v,`stretch`,!1),d.uniform=this.getValue(v,`uniform`,!1),i.ikConstraints.push(d)}if(a.transform)for(var s=0;s<a.transform.length;s++){var v=a.transform[s],d=new e.TransformConstraintData(v.name);d.order=this.getValue(v,`order`,0),d.skinRequired=this.getValue(v,`skin`,!1);for(var y=0;y<v.bones.length;y++){var m=v.bones[y],b=i.findBone(m);if(b==null)throw Error(`Transform constraint bone not found: `+m);d.bones.push(b)}var x=v.target;if(d.target=i.findBone(x),d.target==null)throw Error(`Transform constraint target bone not found: `+x);d.local=this.getValue(v,`local`,!1),d.relative=this.getValue(v,`relative`,!1),d.offsetRotation=this.getValue(v,`rotation`,0),d.offsetX=this.getValue(v,`x`,0)*r,d.offsetY=this.getValue(v,`y`,0)*r,d.offsetScaleX=this.getValue(v,`scaleX`,0),d.offsetScaleY=this.getValue(v,`scaleY`,0),d.offsetShearY=this.getValue(v,`shearY`,0),d.rotateMix=this.getValue(v,`rotateMix`,1),d.translateMix=this.getValue(v,`translateMix`,1),d.scaleMix=this.getValue(v,`scaleMix`,1),d.shearMix=this.getValue(v,`shearMix`,1),i.transformConstraints.push(d)}if(a.path)for(var s=0;s<a.path.length;s++){var v=a.path[s],d=new e.PathConstraintData(v.name);d.order=this.getValue(v,`order`,0),d.skinRequired=this.getValue(v,`skin`,!1);for(var y=0;y<v.bones.length;y++){var m=v.bones[y],b=i.findBone(m);if(b==null)throw Error(`Transform constraint bone not found: `+m);d.bones.push(b)}var x=v.target;if(d.target=i.findSlot(x),d.target==null)throw Error(`Path target slot not found: `+x);d.positionMode=n.positionModeFromString(this.getValue(v,`positionMode`,`percent`)),d.spacingMode=n.spacingModeFromString(this.getValue(v,`spacingMode`,`length`)),d.rotateMode=n.rotateModeFromString(this.getValue(v,`rotateMode`,`tangent`)),d.offsetRotation=this.getValue(v,`rotation`,0),d.position=this.getValue(v,`position`,0),d.positionMode==e.PositionMode.Fixed&&(d.position*=r),d.spacing=this.getValue(v,`spacing`,0),(d.spacingMode==e.SpacingMode.Length||d.spacingMode==e.SpacingMode.Fixed)&&(d.spacing*=r),d.rotateMix=this.getValue(v,`rotateMix`,1),d.translateMix=this.getValue(v,`translateMix`,1),i.pathConstraints.push(d)}if(a.skins)for(var s=0;s<a.skins.length;s++){var S=a.skins[s],C=new e.Skin(S.name);if(S.bones)for(var w=0;w<S.bones.length;w++){var b=i.findBone(S.bones[w]);if(b==null)throw Error(`Skin bone not found: `+S.bones[s]);C.bones.push(b)}if(S.ik)for(var w=0;w<S.ik.length;w++){var T=i.findIkConstraint(S.ik[w]);if(T==null)throw Error(`Skin IK constraint not found: `+S.ik[s]);C.constraints.push(T)}if(S.transform)for(var w=0;w<S.transform.length;w++){var T=i.findTransformConstraint(S.transform[w]);if(T==null)throw Error(`Skin transform constraint not found: `+S.transform[s]);C.constraints.push(T)}if(S.path)for(var w=0;w<S.path.length;w++){var T=i.findPathConstraint(S.path[w]);if(T==null)throw Error(`Skin path constraint not found: `+S.path[s]);C.constraints.push(T)}for(var p in S.attachments){var E=i.findSlot(p);if(E==null)throw Error(`Slot not found: `+p);var f=S.attachments[p];for(var D in f){var O=this.readAttachment(f[D],C,E.index,D,i);O!=null&&C.setAttachment(E.index,D,O)}}i.skins.push(C),C.name=="default"&&(i.defaultSkin=C)}for(var s=0,k=this.linkedMeshes.length;s<k;s++){var A=this.linkedMeshes[s],C=A.skin==null?i.defaultSkin:i.findSkin(A.skin);if(C==null)throw Error(`Skin not found: `+A.skin);var j=C.getAttachment(A.slotIndex,A.parent);if(j==null)throw Error(`Parent mesh not found: `+A.parent);A.mesh.deformAttachment=A.inheritDeform?j:A.mesh,A.mesh.setParentMesh(j),A.mesh.updateUVs()}if(this.linkedMeshes.length=0,a.events)for(var M in a.events){var N=a.events[M],d=new e.EventData(M);d.intValue=this.getValue(N,`int`,0),d.floatValue=this.getValue(N,`float`,0),d.stringValue=this.getValue(N,`string`,``),d.audioPath=this.getValue(N,`audio`,null),d.audioPath!=null&&(d.volume=this.getValue(N,`volume`,1),d.balance=this.getValue(N,`balance`,0)),i.events.push(d)}if(a.animations)for(var P in a.animations){var F=a.animations[P];this.readAnimation(F,P,i)}return i},n.prototype.readAttachment=function(n,r,i,a,o){var s=this.scale;switch(a=this.getValue(n,`name`,a),this.getValue(n,`type`,`region`)){case`region`:var c=this.getValue(n,`path`,a),l=this.attachmentLoader.newRegionAttachment(r,a,c);if(l==null)return null;l.path=c,l.x=this.getValue(n,`x`,0)*s,l.y=this.getValue(n,`y`,0)*s,l.scaleX=this.getValue(n,`scaleX`,1),l.scaleY=this.getValue(n,`scaleY`,1),l.rotation=this.getValue(n,`rotation`,0),l.width=n.width*s,l.height=n.height*s;
1var u=this.getValue(n,`color`,null);return u!=null&&l.color.setFromString(u),l.updateOffset(),l;case`boundingbox`:var d=this.attachmentLoader.newBoundingBoxAttachment(r,a);if(d==null)return null;this.readVertices(n,d,n.vertexCount<<1);var u=this.getValue(n,`color`,null);return u!=null&&d.color.setFromString(u),d;case`mesh`:case`linkedmesh`:var c=this.getValue(n,`path`,a),f=this.attachmentLoader.newMeshAttachment(r,a,c);if(f==null)return null;f.path=c;var u=this.getValue(n,`color`,null);u!=null&&f.color.setFromString(u),f.width=this.getValue(n,`width`,0)*s,f.height=this.getValue(n,`height`,0)*s;var p=this.getValue(n,`parent`,null);if(p!=null)return this.linkedMeshes.push(new t(f,this.getValue(n,`skin`,null),i,p,this.getValue(n,`deform`,!0))),f;var m=n.uvs;return this.readVertices(n,f,m.length),f.triangles=n.triangles,f.regionUVs=m,f.updateUVs(),f.edges=this.getValue(n,`edges`,null),f.hullLength=this.getValue(n,`hull`,0)*2,f;case`path`:var c=this.attachmentLoader.newPathAttachment(r,a);if(c==null)return null;c.closed=this.getValue(n,`closed`,!1),c.constantSpeed=this.getValue(n,`constantSpeed`,!0);var h=n.vertexCount;this.readVertices(n,c,h<<1);for(var g=e.Utils.newArray(h/3,0),_=0;_<n.lengths.length;_++)g[_]=n.lengths[_]*s;c.lengths=g;var u=this.getValue(n,`color`,null);return u!=null&&c.color.setFromString(u),c;case`point`:var v=this.attachmentLoader.newPointAttachment(r,a);if(v==null)return null;v.x=this.getValue(n,`x`,0)*s,v.y=this.getValue(n,`y`,0)*s,v.rotation=this.getValue(n,`rotation`,0);var u=this.getValue(n,`color`,null);return u!=null&&v.color.setFromString(u),v;case`clipping`:var y=this.attachmentLoader.newClippingAttachment(r,a);if(y==null)return null;var b=this.getValue(n,`end`,null);if(b!=null){var x=o.findSlot(b);if(x==null)throw Error(`Clipping end slot not found: `+b);y.endSlot=x}var h=n.vertexCount;this.readVertices(n,y,h<<1);var u=this.getValue(n,`color`,null);return u!=null&&y.color.setFromString(u),y}return null},n.prototype.readVertices=function(t,n,r){var i=this.scale;n.worldVerticesLength=r;var a=t.vertices;if(r==a.length){var o=e.Utils.toFloatArray(a);if(i!=1)for(var s=0,c=a.length;s<c;s++)o[s]*=i;n.vertices=o;return}for(var l=[],u=[],s=0,c=a.length;s<c;){var d=a[s++];u.push(d);for(var f=s+d*4;s<f;s+=4)u.push(a[s]),l.push(a[s+1]*i),l.push(a[s+2]*i),l.push(a[s+3])}n.bones=u,n.vertices=e.Utils.toFloatArray(l)},n.prototype.readAnimation=function(t,n,r){var i=this.scale,a=[],o=0;if(t.slots)for(var s in t.slots){var c=t.slots[s],l=r.findSlotIndex(s);if(l==-1)throw Error(`Slot not found: `+s);for(var u in c){var d=c[u];if(u==`attachment`){var f=new e.AttachmentTimeline(d.length);f.slotIndex=l;for(var p=0,m=0;m<d.length;m++){var h=d[m];f.setFrame(p++,this.getValue(h,`time`,0),h.name)}a.push(f),o=Math.max(o,f.frames[f.getFrameCount()-1])}else if(u==`color`){var f=new e.ColorTimeline(d.length);f.slotIndex=l;for(var p=0,m=0;m<d.length;m++){var h=d[m],g=new e.Color;g.setFromString(h.color),f.setFrame(p,this.getValue(h,`time`,0),g.r,g.g,g.b,g.a),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.ColorTimeline.ENTRIES])}else if(u==`twoColor`){var f=new e.TwoColorTimeline(d.length);f.slotIndex=l;for(var p=0,m=0;m<d.length;m++){var h=d[m],_=new e.Color,v=new e.Color;_.setFromString(h.light),v.setFromString(h.dark),f.setFrame(p,this.getValue(h,`time`,0),_.r,_.g,_.b,_.a,v.r,v.g,v.b),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.TwoColorTimeline.ENTRIES])}else throw Error(`Invalid timeline type for a slot: `+u+` (`+s+`)`)}}if(t.bones)for(var y in t.bones){var b=t.bones[y],x=r.findBoneIndex(y);if(x==-1)throw Error(`Bone not found: `+y);for(var u in b){var d=b[u];if(u===`rotate`){var f=new e.RotateTimeline(d.length);f.boneIndex=x;for(var p=0,m=0;m<d.length;m++){var h=d[m];f.setFrame(p,this.getValue(h,`time`,0),this.getValue(h,`angle`,0)),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.RotateTimeline.ENTRIES])}else if(u===`translate`||u===`scale`||u===`shear`){var f=null,S=1,C=0;u===`scale`?(f=new e.ScaleTimeline(d.length),C=1):u===`shear`?f=new e.ShearTimeline(d.length):(f=new e.TranslateTimeline(d.length),S=i),f.boneIndex=x;for(var p=0,m=0;m<d.length;m++){var h=d[m],w=this.getValue(h,`x`,C),T=this.getValue(h,`y`,C);
1f.setFrame(p,this.getValue(h,`time`,0),w*S,T*S),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.TranslateTimeline.ENTRIES])}else throw Error(`Invalid timeline type for a bone: `+u+` (`+y+`)`)}}if(t.ik)for(var E in t.ik){var D=t.ik[E],O=r.findIkConstraint(E),f=new e.IkConstraintTimeline(D.length);f.ikConstraintIndex=r.ikConstraints.indexOf(O);for(var p=0,m=0;m<D.length;m++){var h=D[m];f.setFrame(p,this.getValue(h,`time`,0),this.getValue(h,`mix`,1),this.getValue(h,`softness`,0)*i,this.getValue(h,`bendPositive`,!0)?1:-1,this.getValue(h,`compress`,!1),this.getValue(h,`stretch`,!1)),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.IkConstraintTimeline.ENTRIES])}if(t.transform)for(var E in t.transform){var D=t.transform[E],O=r.findTransformConstraint(E),f=new e.TransformConstraintTimeline(D.length);f.transformConstraintIndex=r.transformConstraints.indexOf(O);for(var p=0,m=0;m<D.length;m++){var h=D[m];f.setFrame(p,this.getValue(h,`time`,0),this.getValue(h,`rotateMix`,1),this.getValue(h,`translateMix`,1),this.getValue(h,`scaleMix`,1),this.getValue(h,`shearMix`,1)),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.TransformConstraintTimeline.ENTRIES])}if(t.path)for(var E in t.path){var D=t.path[E],k=r.findPathConstraintIndex(E);if(k==-1)throw Error(`Path constraint not found: `+E);var A=r.pathConstraints[k];for(var u in D){var d=D[u];if(u===`position`||u===`spacing`){var f=null,S=1;u===`spacing`?(f=new e.PathConstraintSpacingTimeline(d.length),(A.spacingMode==e.SpacingMode.Length||A.spacingMode==e.SpacingMode.Fixed)&&(S=i)):(f=new e.PathConstraintPositionTimeline(d.length),A.positionMode==e.PositionMode.Fixed&&(S=i)),f.pathConstraintIndex=k;for(var p=0,m=0;m<d.length;m++){var h=d[m];f.setFrame(p,this.getValue(h,`time`,0),this.getValue(h,u,0)*S),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.PathConstraintPositionTimeline.ENTRIES])}else if(u===`mix`){var f=new e.PathConstraintMixTimeline(d.length);f.pathConstraintIndex=k;for(var p=0,m=0;m<d.length;m++){var h=d[m];f.setFrame(p,this.getValue(h,`time`,0),this.getValue(h,`rotateMix`,1),this.getValue(h,`translateMix`,1)),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[(f.getFrameCount()-1)*e.PathConstraintMixTimeline.ENTRIES])}}}if(t.deform)for(var j in t.deform){var M=t.deform[j],N=r.findSkin(j);if(N==null)throw Error(`Skin not found: `+j);for(var s in M){var c=M[s],l=r.findSlotIndex(s);if(l==-1)throw Error(`Slot not found: `+c.name);for(var u in c){var d=c[u],P=N.getAttachment(l,u);if(P==null)throw Error(`Deform attachment not found: `+d.name);var F=P.bones!=null,I=P.vertices,L=F?I.length/3*2:I.length,f=new e.DeformTimeline(d.length);f.slotIndex=l,f.attachment=P;for(var p=0,R=0;R<d.length;R++){var h=d[R],z=void 0,B=this.getValue(h,`vertices`,null);if(B==null)z=F?e.Utils.newFloatArray(L):I;else{z=e.Utils.newFloatArray(L);var V=this.getValue(h,`offset`,0);if(e.Utils.arrayCopy(B,0,z,V,B.length),i!=1)for(var m=V,H=m+B.length;m<H;m++)z[m]*=i;if(!F)for(var m=0;m<L;m++)z[m]+=I[m]}f.setFrame(p,this.getValue(h,`time`,0),z),this.readCurve(h,f,p),p++}a.push(f),o=Math.max(o,f.frames[f.getFrameCount()-1])}}}var U=t.drawOrder;if(U==null&&(U=t.draworder),U!=null){for(var f=new e.DrawOrderTimeline(U.length),W=r.slots.length,p=0,R=0;R<U.length;R++){var G=U[R],K=null,q=this.getValue(G,`offsets`,null);if(q!=null){K=e.Utils.newArray(W,-1);for(var J=e.Utils.newArray(W-q.length,0),Y=0,X=0,m=0;m<q.length;m++){var Z=q[m],l=r.findSlotIndex(Z.slot);if(l==-1)throw Error(`Slot not found: `+Z.slot);for(;Y!=l;)J[X++]=Y++;K[Y+Z.offset]=Y++}for(;Y<W;)J[X++]=Y++;for(var m=W-1;m>=0;m--)K[m]==-1&&(K[m]=J[--X])}f.setFrame(p++,this.getValue(G,`time`,0),K)}a.push(f),o=Math.max(o,f.frames[f.getFrameCount()-1])}if(t.events){for(var f=new e.EventTimeline(t.events.length),p=0,m=0;m<t.events.length;m++){var Q=t.events[m],$=r.findEvent(Q.name);if($==null)throw Error(`Event not found: `+Q.name);var ee=new e.Event(e.Utils.toSinglePrecision(this.getValue(Q,`time`,0)),$);ee.intValue=this.getValue(Q,`int`,$.intValue),ee.floatValue=this.getValue(Q,`float`,$.floatValue),ee.stringValue=this.getValue(Q,`string`,$.stringValue),ee.data.audioPath!=null&&(ee.volume=this.getValue(Q,`volume`,1),ee.balance=this.getValue(Q,`balance`,0)),f.setFrame
1(p++,ee)}a.push(f),o=Math.max(o,f.frames[f.getFrameCount()-1])}if(isNaN(o))throw Error(`Error while parsing animation, duration is NaN`);r.animations.push(new e.Animation(n,a,o))},n.prototype.readCurve=function(e,t,n){if(e.hasOwnProperty(`curve`)){if(e.curve==`stepped`)t.setStepped(n);else{var r=e.curve;t.setCurve(n,r,this.getValue(e,`c2`,0),this.getValue(e,`c3`,1),this.getValue(e,`c4`,1))}}},n.prototype.getValue=function(e,t,n){return e[t]===void 0?n:e[t]},n.blendModeFromString=function(t){if(t=t.toLowerCase(),t==`normal`)return e.BlendMode.Normal;if(t==`additive`)return e.BlendMode.Additive;if(t==`multiply`)return e.BlendMode.Multiply;if(t==`screen`)return e.BlendMode.Screen;throw Error(`Unknown blend mode: `+t)},n.positionModeFromString=function(t){if(t=t.toLowerCase(),t==`fixed`)return e.PositionMode.Fixed;if(t==`percent`)return e.PositionMode.Percent;throw Error(`Unknown position mode: `+t)},n.spacingModeFromString=function(t){if(t=t.toLowerCase(),t==`length`)return e.SpacingMode.Length;if(t==`fixed`)return e.SpacingMode.Fixed;if(t==`percent`)return e.SpacingMode.Percent;throw Error(`Unknown position mode: `+t)},n.rotateModeFromString=function(t){if(t=t.toLowerCase(),t==`tangent`)return e.RotateMode.Tangent;if(t==`chain`)return e.RotateMode.Chain;if(t==`chainscale`)return e.RotateMode.ChainScale;throw Error(`Unknown rotate mode: `+t)},n.transformModeFromString=function(t){if(t=t.toLowerCase(),t==`normal`)return e.TransformMode.Normal;if(t==`onlytranslation`)return e.TransformMode.OnlyTranslation;if(t==`norotationorreflection`)return e.TransformMode.NoRotationOrReflection;if(t==`noscale`)return e.TransformMode.NoScale;if(t==`noscaleorreflection`)return e.TransformMode.NoScaleOrReflection;throw Error(`Unknown transform mode: `+t)},n})();var t=(function(){function e(e,t,n,r,i){this.mesh=e,this.skin=t,this.slotIndex=n,this.parent=r,this.inheritDeform=i}return e})()})(X||(X={}));var X;(function(e){var t=(function(){function e(e,t,n){this.slotIndex=e,this.name=t,this.attachment=n}return e})();e.SkinEntry=t,e.Skin=(function(){function n(e){if(this.attachments=[],this.bones=[],this.constraints=[],e==null)throw Error(`name cannot be null.`);this.name=e}return n.prototype.setAttachment=function(e,t,n){if(n==null)throw Error(`attachment cannot be null.`);var r=this.attachments;e>=r.length&&(r.length=e+1),r[e]||(r[e]={}),r[e][t]=n},n.prototype.addSkin=function(e){for(var t=0;t<e.bones.length;t++){for(var n=e.bones[t],r=!1,i=0;i<this.bones.length;i++)if(this.bones[i]==n){r=!0;break}r||this.bones.push(n)}for(var t=0;t<e.constraints.length;t++){for(var a=e.constraints[t],r=!1,i=0;i<this.constraints.length;i++)if(this.constraints[i]==a){r=!0;break}r||this.constraints.push(a)}for(var o=e.getAttachments(),t=0;t<o.length;t++){var s=o[t];this.setAttachment(s.slotIndex,s.name,s.attachment)}},n.prototype.copySkin=function(t){for(var n=0;n<t.bones.length;n++){for(var r=t.bones[n],i=!1,a=0;a<this.bones.length;a++)if(this.bones[a]==r){i=!0;break}i||this.bones.push(r)}for(var n=0;n<t.constraints.length;n++){for(var o=t.constraints[n],i=!1,a=0;a<this.constraints.length;a++)if(this.constraints[a]==o){i=!0;break}i||this.constraints.push(o)}for(var s=t.getAttachments(),n=0;n<s.length;n++){var c=s[n];c.attachment!=null&&(c.attachment instanceof e.MeshAttachment?(c.attachment=c.attachment.newLinkedMesh(),this.setAttachment(c.slotIndex,c.name,c.attachment)):(c.attachment=c.attachment.copy(),this.setAttachment(c.slotIndex,c.name,c.attachment)))}},n.prototype.getAttachment=function(e,t){var n=this.attachments[e];return n?n[t]:null},n.prototype.removeAttachment=function(e,t){var n=this.attachments[e];n&&(n[t]=null)},n.prototype.getAttachments=function(){for(var e=[],n=0;n<this.attachments.length;n++){var r=this.attachments[n];if(r)for(var i in r){var a=r[i];a&&e.push(new t(n,i,a))}}return e},n.prototype.getAttachmentsForSlot=function(e,n){var r=this.attachments[e];if(r)for(var i in r){var a=r[i];a&&n.push(new t(e,i,a))}},n.prototype.clear=function(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0},n.prototype.attachAll=function(e,t){for(var n=0,r=0;r<e.slots.length;r++){var i=e.slots[r],a=i.getAttachment();if(a&&n<t.attachments.length){var o=t.attachments[n];for(var s in o)if(a==o[s]){var c=this.getAttachment(n,s);c!=null&&i.setAttachment(c);break}}n++}},n})()})(X||(X={}));var X;(function(e){e.Slot=(function(){function t(t,n){if(this.deform=[],t==null)throw Error(`data cannot be null.`);if(n==null)throw Error(`bone cannot be null.`);this.data=t,this.bone=n,this.color=new e.Color,this.darkColor=t.darkColor==null?null:new e.Color,this.setToSetupPose()}return t.prototype.getSkeleton=function(){return this.bone.skeleton},t.prototype.getAttachment=function(){return this.attachment},t.prototype.setAttachment=function(e){this.attachment!=e&&(this.attachment=e,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)},t.prototype.setAttachmentTime=function(e){this.attachmentTime=this.bone.skeleton.time-e},t.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},t.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),this.darkColor!=null&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName==null?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},t})()})(X||(X={}));var X;(function(e){e.SlotData=(function(){function t(t,n,r){if(this.color=new e.Color(1,1,1,1),t<0)throw Error(`index must be >= 0.`);if(n==null)throw Error(`name cannot be null.`);if(r==null)throw Error(`boneData cannot be null.`);this.index=t,this.name=n,this.boneData=r}return t})()})(X||(X={}));var X;(function(e){var t=(function(){function e(e){this._image=e}return e.prototype.getImage=function(){return this._image},e.filterFromString=function(e){switch(e.toLowerCase()){case`nearest`:return n.Nearest;case`linear`:return n.Linear;case`mipmap`:return n.MipMap;case`mipmapnearestnearest`:return n.MipMapNearestNearest;case`mipmaplinearnearest`:return n.MipMapLinearNearest;case`mipmapnearestlinear`:return n.MipMapNearestLinear;case`mipmaplinearlinear`:return n.MipMapLinearLinear;default:throw Error(`Unknown texture filter `+e)}},e.wrapFromString=function(e){switch(e.toLowerCase()){case`mirroredtepeat`:return r.MirroredRepeat;case`clamptoedge`:return r.ClampToEdge;case`repeat`:return r.Repeat;default:throw Error(`Unknown texture wrap `+e)}},e})();e.Texture=t;var n;(function(e){e[e.Nearest=9728]=`Nearest`,e[e.Linear=9729]=`Linear`,e[e.MipMap=9987]=`MipMap`,e[e.MipMapNearestNearest=9984]=`MipMapNearestNearest`,e[e.MipMapLinearNearest=9985]=`MipMapLinearNearest`,e[e.MipMapNearestLinear=9986]=`MipMapNearestLinear`,e[e.MipMapLinearLinear=9987]=`MipMapLinearLinear`})(n=e.TextureFilter||(e.TextureFilter={}));var r;(function(e){e[e.MirroredRepeat=33648]=`MirroredRepeat`,e[e.ClampToEdge=33071]=`ClampToEdge`,e[e.Repeat=10497]=`Repeat`})(r=e.TextureWrap||(e.TextureWrap={})),e.TextureRegion=(function(){function e(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}return e})(),e.FakeTexture=(function(e){Y(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setFilters=function(e,t){},t.prototype.setWraps=function(e,t){},t.prototype.dispose=function(){},t})(t)})(X||(X={}));var X;(function(e){e.TextureAtlas=(function(){function i(e,t){this.pages=[],this.regions=[],this.load(e,t)}return i.prototype.load=function(i,a){if(a==null)throw Error(`textureLoader cannot be null.`);for(var o=new t(i),s=[,,,,],c=null;;){var l=o.readLine();if(l==null)break;
1if(l.trim().length==0)c=null;else if(c){var u=new r;u.name=l,u.page=c;var d=o.readValue();u.degrees=d.toLocaleLowerCase()==`true`?90:d.toLocaleLowerCase()==`false`?0:parseFloat(d),u.rotate=u.degrees==90,o.readTuple(s);var f=parseInt(s[0]),p=parseInt(s[1]);o.readTuple(s);var m=parseInt(s[0]),h=parseInt(s[1]);u.u=f/c.width,u.v=p/c.height,u.rotate?(u.u2=(f+h)/c.width,u.v2=(p+m)/c.height):(u.u2=(f+m)/c.width,u.v2=(p+h)/c.height),u.x=f,u.y=p,u.width=Math.abs(m),u.height=Math.abs(h),o.readTuple(s)==4&&o.readTuple(s)==4&&o.readTuple(s),u.originalWidth=parseInt(s[0]),u.originalHeight=parseInt(s[1]),o.readTuple(s),u.offsetX=parseInt(s[0]),u.offsetY=parseInt(s[1]),u.index=parseInt(o.readValue()),u.texture=c.texture,this.regions.push(u)}else{c=new n,c.name=l.trim(),o.readTuple(s)==2&&(c.width=parseInt(s[0]),c.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),c.minFilter=e.Texture.filterFromString(s[0]),c.magFilter=e.Texture.filterFromString(s[1]);var g=o.readValue();c.uWrap=e.TextureWrap.ClampToEdge,c.vWrap=e.TextureWrap.ClampToEdge,g==`x`?c.uWrap=e.TextureWrap.Repeat:g==`y`?c.vWrap=e.TextureWrap.Repeat:g==`xy`&&(c.uWrap=c.vWrap=e.TextureWrap.Repeat),c.texture=a(l),c.texture.setFilters(c.minFilter,c.magFilter),c.texture.setWraps(c.uWrap,c.vWrap),this.pages.push(c)}}},i.prototype.findRegion=function(e){for(var t=0;t<this.regions.length;t++)if(this.regions[t].name==e)return this.regions[t];return null},i.prototype.dispose=function(){for(var e=0;e<this.pages.length;e++)this.pages[e].texture.dispose()},i})();var t=(function(){function e(e){this.index=0,this.lines=e.split(/\r\n|\r|\n/)}return e.prototype.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},e.prototype.readValue=function(){var e=this.readLine(),t=e.indexOf(`:`);if(t==-1)throw Error(`Invalid line: `+e);return e.substring(t+1).trim()},e.prototype.readTuple=function(e){var t=this.readLine(),n=t.indexOf(`:`);if(n==-1)throw Error(`Invalid line: `+t);for(var r=0,i=n+1;r<3;r++){var a=t.indexOf(`,`,i);if(a==-1)break;e[r]=t.substr(i,a-i).trim(),i=a+1}return e[r]=t.substring(i).trim(),r+1},e})(),n=(function(){function e(){}return e})();e.TextureAtlasPage=n;var r=(function(e){Y(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(e.TextureRegion);e.TextureAtlasRegion=r})(X||(X={}));var X;(function(e){e.TransformConstraint=(function(){function t(t,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new e.Vector2,this.active=!1,t==null)throw Error(`data cannot be null.`);if(n==null)throw Error(`skeleton cannot be null.`);this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=[];for(var r=0;r<t.bones.length;r++)this.bones.push(n.findBone(t.bones[r].name));this.target=n.findBone(t.target.name)}
1return t.prototype.isActive=function(){return this.active},t.prototype.apply=function(){this.update()},t.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},t.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,n=this.translateMix,r=this.scaleMix,i=this.shearMix,a=this.target,o=a.a,s=a.b,c=a.c,l=a.d,u=o*l-s*c>0?e.MathUtils.degRad:-e.MathUtils.degRad,d=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,m=0,h=p.length;m<h;m++){var g=p[m],_=!1;if(t!=0){var v=g.a,y=g.b,b=g.c,x=g.d,S=Math.atan2(c,o)-Math.atan2(b,v)+d;S>e.MathUtils.PI?S-=e.MathUtils.PI2:S<-e.MathUtils.PI&&(S+=e.MathUtils.PI2),S*=t;var C=Math.cos(S),w=Math.sin(S);g.a=C*v-w*b,g.b=C*y-w*x,g.c=w*v+C*b,g.d=w*y+C*x,_=!0}if(n!=0){var T=this.temp;a.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=(T.x-g.worldX)*n,g.worldY+=(T.y-g.worldY)*n,_=!0}if(r>0){var E=Math.sqrt(g.a*g.a+g.c*g.c),D=Math.sqrt(o*o+c*c);E>1e-5&&(E=(E+(D-E+this.data.offsetScaleX)*r)/E),g.a*=E,g.c*=E,E=Math.sqrt(g.b*g.b+g.d*g.d),D=Math.sqrt(s*s+l*l),E>1e-5&&(E=(E+(D-E+this.data.offsetScaleY)*r)/E),g.b*=E,g.d*=E,_=!0}if(i>0){var y=g.b,x=g.d,O=Math.atan2(x,y),S=Math.atan2(l,s)-Math.atan2(c,o)-(O-Math.atan2(g.c,g.a));S>e.MathUtils.PI?S-=e.MathUtils.PI2:S<-e.MathUtils.PI&&(S+=e.MathUtils.PI2),S=O+(S+f)*i;var E=Math.sqrt(y*y+x*x);g.b=Math.cos(S)*E,g.d=Math.sin(S)*E,_=!0}_&&(g.appliedValid=!1)}},t.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,n=this.translateMix,r=this.scaleMix,i=this.shearMix,a=this.target,o=a.a,s=a.b,c=a.c,l=a.d,u=o*l-s*c>0?e.MathUtils.degRad:-e.MathUtils.degRad,d=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,m=0,h=p.length;m<h;m++){var g=p[m],_=!1;if(t!=0){var v=g.a,y=g.b,b=g.c,x=g.d,S=Math.atan2(c,o)+d;S>e.MathUtils.PI?S-=e.MathUtils.PI2:S<-e.MathUtils.PI&&(S+=e.MathUtils.PI2),S*=t;var C=Math.cos(S),w=Math.sin(S);g.a=C*v-w*b,g.b=C*y-w*x,g.c=w*v+C*b,g.d=w*y+C*x,_=!0}if(n!=0){var T=this.temp;a.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),g.worldX+=T.x*n,g.worldY+=T.y*n,_=!0}if(r>0){var E=(Math.sqrt(o*o+c*c)-1+this.data.offsetScaleX)*r+1;g.a*=E,g.c*=E,E=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,g.b*=E,g.d*=E,_=!0}if(i>0){var S=Math.atan2(l,s)-Math.atan2(c,o);S>e.MathUtils.PI?S-=e.MathUtils.PI2:S<-e.MathUtils.PI&&(S+=e.MathUtils.PI2);var y=g.b,x=g.d;S=Math.atan2(x,y)+(S-e.MathUtils.PI/2+f)*i;var E=Math.sqrt(y*y+x*x);g.b=Math.cos(S)*E,g.d=Math.sin(S)*E,_=!0}_&&(g.appliedValid=!1)}},t.prototype.applyAbsoluteLocal=function(){var e=this.rotateMix,t=this.translateMix,n=this.scaleMix,r=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,o=0,s=a.length;o<s;o++){var c=a[o];c.appliedValid||c.updateAppliedTransform();var l=c.arotation;if(e!=0){var u=i.arotation-l+this.data.offsetRotation;u-=(16384-(16384.499999999996-u/360|0))*360,l+=u*e}var d=c.ax,f=c.ay;t!=0&&(d+=(i.ax-d+this.data.offsetX)*t,f+=(i.ay-f+this.data.offsetY)*t);var p=c.ascaleX,m=c.ascaleY;n!=0&&(p>1e-5&&(p=(p+(i.ascaleX-p+this.data.offsetScaleX)*n)/p),m>1e-5&&(m=(m+(i.ascaleY-m+this.data.offsetScaleY)*n)/m));var h=c.ashearY;if(r!=0){var u=i.ashearY-h+this.data.offsetShearY;u-=(16384-(16384.499999999996-u/360|0))*360,c.shearY+=u*r}c.updateWorldTransformWith(d,f,l,p,m,c.ashearX,h)}},t.prototype.applyRelativeLocal=function(){var e=this.rotateMix,t=this.translateMix,n=this.scaleMix,r=this.shearMix,i=this.target;i.appliedValid||i.updateAppliedTransform();for(var a=this.bones,o=0,s=a.length;o<s;o++){var c=a[o];c.appliedValid||c.updateAppliedTransform();var l=c.arotation;e!=0&&(l+=(i.arotation+this.data.offsetRotation)*e);var u=c.ax,d=c.ay;t!=0&&(u+=(i.ax+this.data.offsetX)*t,d+=(i.ay+this.data.offsetY)*t);var f=c.ascaleX,p=c.ascaleY;n!=0&&(f>1e-5&&(f*=(i.ascaleX-1+this.data.offsetScaleX)*n+1),p>1e-5&&(p*=(i.ascaleY-1+this.data.offsetScaleY)*n+1));var m=c.ashearY;r!=0&&(m+=(i.ashearY+this.data.offsetShearY)*r),c.updateWorldTransformWith(u,d,l,f,p,c.ashearX,m)}},t})()})(X||(X={}));var X;(function(e){e.TransformConstraintData=(function(e){Y(t,e);function t(t){var n=e.call(this,t,0,!1)||this;return n.bones=[],n.rotateMix=0,n.translateMix=0,n.scaleMix=0,n.shearMix=0,n.offsetRotation=0,n.offsetX=0,n.offsetY=0,n.offsetScaleX=0,n.offsetScaleY=0,n.offsetShearY=0,n.relative=!1,n.local=!1,n}return t})(e.ConstraintData)})(X||(X={}));var X;(function(e){e.Triangulator=(function(){function t(){this.convexPolygons=[],this.convexPolygonsIndices=[],this.indicesArray=[],this.isConcaveArray=[],this.triangles=[],this.polygonPool=new e.Pool(function(){return[]}),this.polygonIndicesPool=new e.Pool(function(){return[]})}return t.prototype.triangulate=function(e){var n=e,r=e.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a<r;a++)i[a]=a;var o=this.isConcaveArray;o.length=0;for(var a=0,s=r;a<s;++a)o[a]=t.isConcave(a,r,n,i);var c=this.triangles;for(c.length=0;r>3;){for(var l=r-1,a=0,u=1;;){outer:if(!o[a]){for(var d=i[l]<<1,f=i[a]<<1,p=i[u]<<1,m=n[d],h=n[d+1],g=n[f],_=n[f+1],v=n[p],y=n[p+1],b=(u+1)%r;b!=l;b=(b+1)%r)if(o[b]){var x=i[b]<<1,S=n[x],C=n[x+1];if(t.positiveArea(v,y,m,h,S,C)&&t.positiveArea(m,h,g,_,S,C)&&t.positiveArea(g,_,v,y,S,C))break outer}break}if(u==0){do{if(!o[a])break;a--}while(a>0);break}l=a,a=u,u=(u+1)%r}c.push(i[(r+a-1)%r]),c.push(i[a]),c.push(i[(a+1)%r]),i.splice(a,1),o.splice(a,1),r--;var w=(r+a-1)%r,T=a==r?0:a;o[w]=t.isConcave(w,r,n,i),o[T]=t.isConcave(T,r,n,i)}return r==3&&(c.push(i[2]),c.push(i[0]),c.push(i[1])),c},t.prototype.decompose=function(e,n){var r=e,i=this.convexPolygons;this.polygonPool.freeAll(i),i.length=0;var a=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(a),a.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var c=-1,l=0,u=0,d=n.length;u<d;u+=3){var f=n[u]<<1,p=n[u+1]<<1,m=n[u+2]<<1,h=r[f],g=r[f+1],_=r[p],v=r[p+1],y=r[m],b=r[m+1],x=!1;if(c==f){var S=s.length-4,C=t.winding(s[S],s[S+1],s[S+2],s[S+3],y,b),w=t.winding(y,b,s[0],s[1],s[2],s[3]);C==l&&w==l&&(s.push(y),s.push(b),o.push(m),x=!0)}x||(s.length>0?(i.push(s),a.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),s=this.polygonPool.obtain(),s.length=0,s.push(h),s.push(g),s.push(_),s.push(v),s.push(y),s.push(b),o=this.polygonIndicesPool.obtain(),o.length=0,o.push(f),o.push(p),o.push(m),l=t.winding(h,g,_,v,y,b),c=f)}s.length>0&&(i.push(s),a.push(o));for(var u=0,d=i.length;u<d;u++)if(o=a[u],o.length!=0){var T=o[0],E=o[o.length-1];s=i[u];for(var S=s.length-4,D=s[S],O=s[S+1],k=s[S+2],A=s[S+3],j=s[0],M=s[1],N=s[2],P=s[3],F=t.winding(D,O,k,A,j,M),I=0;I<d;I++)if(I!=u){var L=a[I];if(L.length==3){var R=L[0],z=L[1],B=L[2],V=i[I],y=V[V.length-2],b=V[V.length-1];if(R==T&&z==E){var C=t.winding(D,O,k,A,y,b),w=t.winding(y,b,j,M,N,P);C==F&&w==F&&(V.length=0,L.length=0,s.push(y),s.push(b),o.push(B),D=k,O=A,k=y,A=b,I=0)}}}}for(var u=i.length-1;u>=0;u--)s=i[u],s.length==0&&(i.splice(u,1),this.polygonPool.free(s),o=a[u],a.splice(u,1),this.polygonIndicesPool.free(o));return i},t.isConcave=function(e,t,n,r){var i=r[(t+e-1)%t]<<1,a=r[e]<<1,o=r[(e+1)%t]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[o],n[o+1])},t.positiveArea=function(e,t,n,r,i,a){return e*(a-r)+n*(t-a)+i*(r-t)>=0},t.winding=function(e,t,n,r,i,a){var o=n-e,s=r-t;return i*s-a*o+o*t-e*s>=0?1:-1},t})()})(X||(X={}));var X;(function(e){e.IntSet=(function(){function e(){this.array=[]}return e.prototype.add=function(e){var t=this.contains(e);return this.array[e|0]=e|0,!t},e.prototype.contains=function(e){return this.array[e|0]!=null},e.prototype.remove=function(e){this.array[e|0]=void 0},e.prototype.clear=function(){this.array.length=0},e})(),e.Color=(function(){function e(e,t,n,r){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),this.r=e,this.g=t,this.b=n,this.a=r}return e.prototype.set=function(e,t,n,r){return this.r=e,this.g=t,this.b=n,this.a=r,this.clamp(),this},e.prototype.setFromColor=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},e.prototype.setFromString=function(e){return e=e.charAt(0)==`#`?e.substr(1):e,this.r=parseInt(e.substr(0,2),16)/255,this.g=parseInt(e.substr(2,2),16)/255,this.b=parseInt(e.substr(4,2),16)/255,this.a=(e.length==8?parseInt(e.substr(6,2),16):255)/255,this},e.prototype.add=function(e,t,n,r){return this.r+=e,this.g+=t,this.b+=n,this.a+=r,this.clamp(),this},e.prototype.clamp=function(){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},e.rgba8888ToColor=function(e,t){e.r=((t&4278190080)>>>24)/255,e.g=((t&16711680)>>>16)/255,e.b=((t&65280)>>>8)/255,e.a=(t&255)/255},e.rgb888ToColor=function(e,t){e.r=((t&16711680)>>>16)/255,e.g=((t&65280)>>>8)/255,e.b=(t&255)/255},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),e})(),e.MathUtils=(function(){function e(){}return e.clamp=function(e,t,n){return e<t?t:e>n?n:e},e.cosDeg=function(t){return Math.cos(t*e.degRad)},e.sinDeg=function(t){return Math.sin(t*e.degRad)},e.signum=function(e){return e>0?1:e<0?-1:0},e.toInt=function(e){return e>0?Math.floor(e):Math.ceil(e)},e.cbrt=function(e){var t=Math.abs(e)**(1/3);return e<0?-t:t},e.randomTriangular=function(t,n){return e.randomTriangularWith(t,n,(t+n)*.5)},e.randomTriangularWith=function(e,t,n){var r=Math.random(),i=t-e;return r<=(n-e)/i?e+Math.sqrt(r*i*(n-e)):t-Math.sqrt((1-r)*i*(t-n))},e.PI=3.1415927,e.PI2=e.PI*2,e.radiansToDegrees=180/e.PI,e.radDeg=e.radiansToDegrees,e.degreesToRadians=e.PI/180,e.degRad=e.degreesToRadians,e})();var t=(function(){function e(){}return e.prototype.apply=function(e,t,n){return e+(t-e)*this.applyInternal(n)},e})();e.Interpolation=t;var n=(function(e){Y(t,e);function t(t){var n=e.call(this)||this;return n.power=2,n.power=t,n}return t.prototype.applyInternal=function(e){return e<=.5?(e*2)**this.power/2:((e-1)*2)**this.power/(this.power%2==0?-2:2)+1},t})(t);e.Pow=n,e.PowOut=(function(e){Y(t,e);function t(t){return e.call(this,t)||this}return t.prototype.applyInternal=function(e){return(e-1)**this.power*(this.power%2==0?-1:1)+1},t})(n),e.Utils=(function(){function e(){}return e.arrayCopy=function(e,t,n,r,i){for(var a=t,o=r;a<t+i;a++,o++)n[o]=e[a]},e.setArraySize=function(e,t,n){n===void 0&&(n=0);var r=e.length;if(r==t)return e;if(e.length=t,r<t)for(var i=r;i<t;i++)e[i]=n;return e},e.ensureArrayCapacity=function(t,n,r){return r===void 0&&(r=0),t.length>=n?t:e.setArraySize(t,n,r)},e.newArray=function(e,t){for(var n=Array(e),r=0;r<e;r++)n[r]=t;return n},e.newFloatArray=function(t){if(e.SUPPORTS_TYPED_ARRAYS)return new Float32Array(t);for(var n=Array(t),r=0;r<n.length;r++)n[r]=0;return n}
1,e.newShortArray=function(t){if(e.SUPPORTS_TYPED_ARRAYS)return new Int16Array(t);for(var n=Array(t),r=0;r<n.length;r++)n[r]=0;return n},e.toFloatArray=function(t){return e.SUPPORTS_TYPED_ARRAYS?new Float32Array(t):t},e.toSinglePrecision=function(t){return e.SUPPORTS_TYPED_ARRAYS?Math.fround(t):t},e.webkit602BugfixHelper=function(e,t){},e.contains=function(e,t,n){n===void 0&&(n=!0);for(var r=0;r<e.length;r++)if(e[r]==t)return!0;return!1},e.SUPPORTS_TYPED_ARRAYS=typeof Float32Array<`u`,e})(),e.DebugUtils=(function(){function e(){}return e.logBones=function(e){for(var t=0;t<e.bones.length;t++){var n=e.bones[t];console.log(n.data.name+`, `+n.a+`, `+n.b+`, `+n.c+`, `+n.d+`, `+n.worldX+`, `+n.worldY)}},e})(),e.Pool=(function(){function e(e){this.items=[],this.instantiator=e}return e.prototype.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},e.prototype.free=function(e){e.reset&&e.reset(),this.items.push(e)},e.prototype.freeAll=function(e){for(var t=0;t<e.length;t++)this.free(e[t])},e.prototype.clear=function(){this.items.length=0},e})(),e.Vector2=(function(){function e(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.x=e,this.y=t}return e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.length=function(){var e=this.x,t=this.y;return Math.sqrt(e*e+t*t)},e.prototype.normalize=function(){var e=this.length();return e!=0&&(this.x/=e,this.y/=e),this},e})(),e.TimeKeeper=(function(){function e(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return e.prototype.update=function(){var e=Date.now()/1e3;this.delta=e-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=e,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},e})(),e.WindowedMean=(function(){function e(e){e===void 0&&(e=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=Array(e)}return e.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},e.prototype.addValue=function(e){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=e,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0},e.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var e=0,t=0;t<this.values.length;t++)e+=this.values[t];this.mean=e/this.values.length,this.dirty=!1}return this.mean}return 0},e})()})(X||(X={})),(function(){Math.fround||(Math.fround=(function(e){return function(t){return e[0]=t,e[0]}})(new Float32Array(1)))})();var X;(function(e){var t=(function(){function e(e){if(e==null)throw Error(`name cannot be null.`);this.name=e}return e})();e.Attachment=t,e.VertexAttachment=(function(t){Y(n,t);function n(e){var r=t.call(this,e)||this;return r.id=(n.nextID++&65535)<<11,r.worldVerticesLength=0,r.deformAttachment=r,r}return n.prototype.computeWorldVertices=function(e,t,n,r,i,a){n=i+(n>>1)*a;var o=e.bone.skeleton,s=e.deform,c=this.vertices,l=this.bones;if(l==null){s.length>0&&(c=s);for(var u=e.bone,d=u.worldX,f=u.worldY,p=u.a,m=u.b,h=u.c,g=u.d,_=t,v=i;v<n;_+=2,v+=a){var y=c[_],b=c[_+1];r[v]=y*p+b*m+d,r[v+1]=y*h+b*g+f}return}for(var x=0,S=0,C=0;C<t;C+=2){var w=l[x];x+=w+1,S+=w}var T=o.bones;if(s.length==0)for(var v=i,m=S*3;v<n;v+=a){var E=0,D=0,w=l[x++];for(w+=x;x<w;x++,m+=3){var u=T[l[x]],y=c[m],b=c[m+1],O=c[m+2];E+=(y*u.a+b*u.b+u.worldX)*O,D+=(y*u.c+b*u.d+u.worldY)*O}r[v]=E,r[v+1]=D}else for(var k=s,v=i,m=S*3,A=S<<1;v<n;v+=a){var E=0,D=0,w=l[x++];for(w+=x;x<w;x++,m+=3,A+=2){var u=T[l[x]],y=c[m]+k[A],b=c[m+1]+k[A+1],O=c[m+2];E+=(y*u.a+b*u.b+u.worldX)*O,D+=(y*u.c+b*u.d+u.worldY)*O}r[v]=E,r[v+1]=D}},n.prototype.copyTo=function(t){this.bones==null?t.bones=null:(t.bones=Array(this.bones.length),e.Utils.arrayCopy(this.bones,0,t.bones,0,this.bones.length)),this.vertices==null?t.vertices=null:(t.vertices=e.Utils.newFloatArray(this.vertices.length),e.Utils.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.deformAttachment=this.deformAttachment},n.nextID=0,n})(t)})(X||(X={}));var X;(function(e){(function(e){e[e.Region=0]=`Region`,e[e.BoundingBox=1]=`BoundingBox`,e[e.Mesh=2]=`Mesh`,e[e.LinkedMesh=3]=`LinkedMesh`,e[e.Path=4]=`Path`,e[e.Point=5]=`Point`,e[e.Clipping=6]=`Clipping`})(e.AttachmentType||(e.AttachmentType={}))})(X||(X={}));var X;(function(e){e.BoundingBoxAttachment=(function(t){Y(n,t);function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(1,1,1,1),r}return n.prototype.copy=function(){var e=new n(this.name);return this.copyTo(e),e.color.setFromColor(this.color),e},n})(e.VertexAttachment)})(X||(X={}));var X;(function(e){e.ClippingAttachment=(function(t){Y(n,t);function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(.2275,.2275,.8078,1),r}return n.prototype.copy=function(){var e=new n(this.name);return this.copyTo(e),e.endSlot=this.endSlot,e.color.setFromColor(this.color),e},n})(e.VertexAttachment)})(X||(X={}));var X;(function(e){e.MeshAttachment=(function(t){Y(n,t);function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(1,1,1,1),r.tempColor=new e.Color(0,0,0,0),r}return n.prototype.updateUVs=function(){var t=this.regionUVs;(this.uvs==null||this.uvs.length!=t.length)&&(this.uvs=e.Utils.newFloatArray(t.length));var n=this.uvs,r=this.uvs.length,i=this.region.u,a=this.region.v,o=0,s=0;if(this.region instanceof e.TextureAtlasRegion){var c=this.region,l=this.region.page,u=l.width,d=l.height;switch(c.degrees){case 90:i-=(c.originalHeight-c.offsetY-c.height)/u,a-=(c.originalWidth-c.offsetX-c.width)/d,o=c.originalHeight/u,s=c.originalWidth/d;for(var f=0;f<r;f+=2)n[f]=i+t[f+1]*o,n[f+1]=a+(1-t[f])*s;return;case 180:i-=(c.originalWidth-c.offsetX-c.width)/u,a-=c.offsetY/d,o=c.originalWidth/u,s=c.originalHeight/d;for(var f=0;f<r;f+=2)n[f]=i+(1-t[f])*o,n[f+1]=a+(1-t[f+1])*s;return;case 270:i-=c.offsetY/u,a-=c.offsetX/d,o=c.originalHeight/u,s=c.originalWidth/d;for(var f=0;f<r;f+=2)n[f]=i+(1-t[f+1])*o,n[f+1]=a+t[f]*s;return}i-=c.offsetX/u,a-=(c.originalHeight-c.offsetY-c.height)/d,o=c.originalWidth/u,s=c.originalHeight/d}else this.region==null?(i=a=0,o=s=1):(o=this.region.u2-i,s=this.region.v2-a);for(var f=0;f<r;f+=2)n[f]=i+t[f]*o,n[f+1]=a+t[f+1]*s},n.prototype.getParentMesh=function(){return this.parentMesh},n.prototype.setParentMesh=function(e){this.parentMesh=e,e!=null&&(this.bones=e.bones,this.vertices=e.vertices,this.worldVerticesLength=e.worldVerticesLength,this.regionUVs=e.regionUVs,this.triangles=e.triangles,this.hullLength=e.hullLength,this.worldVerticesLength=e.worldVerticesLength)},n.prototype.copy=function(){if(this.parentMesh!=null)return this.newLinkedMesh();var t=new n(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),this.copyTo(t),t.regionUVs=Array(this.regionUVs.length),e.Utils.arrayCopy(this.regionUVs,0,t.regionUVs,0,this.regionUVs.length),t.uvs=Array(this.uvs.length),e.Utils.arrayCopy(this.uvs,0,t.uvs,0,this.uvs.length),t.triangles=Array(this.triangles.length),e.Utils.arrayCopy(this.triangles,0,t.triangles,0,this.triangles.length),t.hullLength=this.hullLength,this.edges!=null&&(t.edges=Array(this.edges.length),e.Utils.arrayCopy(this.edges,0,t.edges,0,this.edges.length)),t.width=this.width,t.height=this.height,t},n.prototype.newLinkedMesh=function(){var e=new n(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),e.deformAttachment=this.deformAttachment,e.
1setParentMesh(this.parentMesh==null?this:this.parentMesh),e.updateUVs(),e},n})(e.VertexAttachment)})(X||(X={}));var X;(function(e){e.PathAttachment=(function(t){Y(n,t);function n(n){var r=t.call(this,n)||this;return r.closed=!1,r.constantSpeed=!1,r.color=new e.Color(1,1,1,1),r}return n.prototype.copy=function(){var t=new n(this.name);return this.copyTo(t),t.lengths=Array(this.lengths.length),e.Utils.arrayCopy(this.lengths,0,t.lengths,0,this.lengths.length),t.closed=closed,t.constantSpeed=this.constantSpeed,t.color.setFromColor(this.color),t},n})(e.VertexAttachment)})(X||(X={}));var X;(function(e){e.PointAttachment=(function(t){Y(n,t);function n(n){var r=t.call(this,n)||this;return r.color=new e.Color(.38,.94,0,1),r}return n.prototype.computeWorldPosition=function(e,t){return t.x=this.x*e.a+this.y*e.b+e.worldX,t.y=this.x*e.c+this.y*e.d+e.worldY,t},n.prototype.computeWorldRotation=function(t){var n=e.MathUtils.cosDeg(this.rotation),r=e.MathUtils.sinDeg(this.rotation),i=n*t.a+r*t.b,a=n*t.c+r*t.d;return Math.atan2(a,i)*e.MathUtils.radDeg},n.prototype.copy=function(){var e=new n(this.name);return e.x=this.x,e.y=this.y,e.rotation=this.rotation,e.color.setFromColor(this.color),e},n})(e.VertexAttachment)})(X||(X={}));var X;(function(e){e.RegionAttachment=(function(t){Y(n,t);function n(n){var r=t.call(this,n)||this;return r.x=0,r.y=0,r.scaleX=1,r.scaleY=1,r.rotation=0,r.width=0,r.height=0,r.color=new e.Color(1,1,1,1),r.offset=e.Utils.newFloatArray(8),r.uvs=e.Utils.newFloatArray(8),r.tempColor=new e.Color(1,1,1,1),r}return n.prototype.updateOffset=function(){var e=this.width/this.region.originalWidth*this.scaleX,t=this.height/this.region.originalHeight*this.scaleY,r=-this.width/2*this.scaleX+this.region.offsetX*e,i=-this.height/2*this.scaleY+this.region.offsetY*t,a=r+this.region.width*e,o=i+this.region.height*t,s=this.rotation*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=r*c+this.x,d=r*l,f=i*c+this.y,p=i*l,m=a*c+this.x,h=a*l,g=o*c+this.y,_=o*l,v=this.offset;v[n.OX1]=u-p,v[n.OY1]=f+d,v[n.OX2]=u-_,v[n.OY2]=g+d,v[n.OX3]=m-_,v[n.OY3]=g+h,v[n.OX4]=m-p,v[n.OY4]=f+h},n.prototype.setRegion=function(e){this.region=e;var t=this.uvs;e.rotate?(t[2]=e.u,t[3]=e.v2,t[4]=e.u,t[5]=e.v,t[6]=e.u2,t[7]=e.v,t[0]=e.u2,t[1]=e.v2):(t[0]=e.u,t[1]=e.v2,t[2]=e.u,t[3]=e.v,t[4]=e.u2,t[5]=e.v,t[6]=e.u2,t[7]=e.v2)},n.prototype.computeWorldVertices=function(e,t,r,i){var a=this.offset,o=e.worldX,s=e.worldY,c=e.a,l=e.b,u=e.c,d=e.d,f=0,p=0;f=a[n.OX1],p=a[n.OY1],t[r]=f*c+p*l+o,t[r+1]=f*u+p*d+s,r+=i,f=a[n.OX2],p=a[n.OY2],t[r]=f*c+p*l+o,t[r+1]=f*u+p*d+s,r+=i,f=a[n.OX3],p=a[n.OY3],t[r]=f*c+p*l+o,t[r+1]=f*u+p*d+s,r+=i,f=a[n.OX4],p=a[n.OY4],t[r]=f*c+p*l+o,t[r+1]=f*u+p*d+s},n.prototype.copy=function(){var t=new n(this.name);return t.region=this.region,t.rendererObject=this.rendererObject,t.path=this.path,t.x=this.x,t.y=this.y,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.rotation=this.rotation,t.width=this.width,t.height=this.height,e.Utils.arrayCopy(this.uvs,0,t.uvs,0,8),e.Utils.arrayCopy(this.offset,0,t.offset,0,8),t.color.setFromColor(this.color),t},n.OX1=0,n.OY1=1,n.OX2=2,n.OY2=3,n.OX3=4,n.OY3=5,n.OX4=6,n.OY4=7,n.X1=0,n.Y1=1,n.C1R=2,n.C1G=3,n.C1B=4,n.C1A=5,n.U1=6,n.V1=7,n.X2=8,n.Y2=9,n.C2R=10,n.C2G=11,n.C2B=12,n.C2A=13,n.U2=14,n.V2=15,n.X3=16,n.Y3=17,n.C3R=18,n.C3G=19,n.C3B=20,n.C3A=21,n.U3=22,n.V3=23,n.X4=24,n.Y4=25,n.C4R=26,n.C4G=27,n.C4B=28,n.C4A=29,n.U4=30,n.V4=31,n})(e.Attachment)})(X||(X={}));var X;(function(e){e.JitterEffect=(function(){function t(e,t){this.jitterX=0,this.jitterY=0,this.jitterX=e,this.jitterY=t}return t.prototype.begin=function(e){},t.prototype.transform=function(t,n,r,i){t.x+=e.MathUtils.randomTriangular(-this.jitterX,this.jitterY),t.y+=e.MathUtils.randomTriangular(-this.jitterX,this.jitterY)},t.prototype.end=function(){},t})()})(X||(X={}));var X;(function(e){e.SwirlEffect=(function(){function t(e){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=e}return t.prototype.begin=function(e){this.worldX=e.x+this.centerX,this.worldY=e.y+this.centerY},t.prototype.transform=function(n,r,i,a){var o=this.angle*e.MathUtils.degreesToRadians,s=n.x-this.worldX,c=n.y-this.worldY,l=Math.sqrt(s*s+c*c);if(l<this.radius){var u=t.interpolation.apply(0,o,(this.radius-l)/this.radius),d=Math.cos(u),f=Math.sin(u);n.x=d*s-f*c+this.worldX,n.y=f*s+d*c+this.worldY}},t.prototype.end=function(){},t.interpolation=new e.PowOut(2),t})()})(X||(X={}));var X;(function(e){(function(t){t.AssetManager=(function(t){Y(n,t);function n(n,r){return r===void 0&&(r=``),t.call(this,function(t){return new e.webgl.GLTexture(n,t)},r)||this}return n})(e.AssetManager)})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(e){e.OrthoCamera=(function(){function t(t,n){this.position=new e.Vector3(0,0,0),this.direction=new e.Vector3(0,0,-1),this.up=new e.Vector3(0,1,0),this.near=0,this.far=100,this.zoom=1,this.viewportWidth=0,this.viewportHe
1ight=0,this.projectionView=new e.Matrix4,this.inverseProjectionView=new e.Matrix4,this.projection=new e.Matrix4,this.view=new e.Matrix4,this.tmp=new e.Vector3,this.viewportWidth=t,this.viewportHeight=n,this.update()}return t.prototype.update=function(){var e=this.projection,t=this.view,n=this.projectionView,r=this.inverseProjectionView,i=this.zoom,a=this.viewportWidth,o=this.viewportHeight;e.ortho(i*(-a/2),a/2*i,i*(-o/2),o/2*i,this.near,this.far),t.lookAt(this.position,this.direction,this.up),n.set(e.values),n.multiply(t),r.set(n.values).invert()},t.prototype.screenToWorld=function(e,t,n){var r=e.x,i=n-e.y-1,a=this.tmp;return a.x=2*r/t-1,a.y=2*i/n-1,a.z=2*e.z-1,a.project(this.inverseProjectionView),e.set(a.x,a.y,a.z),e},t.prototype.setViewport=function(e,t){this.viewportWidth=e,this.viewportHeight=t},t})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.GLTexture=(function(n){Y(r,n);function r(e,r,i){i===void 0&&(i=!1);var a=n.call(this,r)||this;return a.texture=null,a.boundUnit=0,a.useMipMaps=!1,a.context=e instanceof t.ManagedWebGLRenderingContext?e:new t.ManagedWebGLRenderingContext(e),a.useMipMaps=i,a.restore(),a.context.addRestorable(a),a}return r.prototype.setFilters=function(e,t){var n=this.context.gl;this.bind(),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,r.validateMagFilter(t))},r.validateMagFilter=function(t){switch(t){case e.TextureFilter.MipMap:case e.TextureFilter.MipMapLinearLinear:case e.TextureFilter.MipMapLinearNearest:case e.TextureFilter.MipMapNearestLinear:case e.TextureFilter.MipMapNearestNearest:return e.TextureFilter.Linear;default:return t}},r.prototype.setWraps=function(e,t){var n=this.context.gl;this.bind(),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t)},r.prototype.update=function(e){var t=this.context.gl;this.texture||(this.texture=this.context.gl.createTexture()),this.bind(),r.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL&&t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this._image),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e&&t.generateMipmap(t.TEXTURE_2D)},r.prototype.restore=function(){this.texture=null,this.update(this.useMipMaps)},r.prototype.bind=function(e){e===void 0&&(e=0);var t=this.context.gl;this.boundUnit=e,t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},r.prototype.unbind=function(){var e=this.context.gl;e.activeTexture(e.TEXTURE0+this.boundUnit),e.bindTexture(e.TEXTURE_2D,null)},r.prototype.dispose=function(){this.context.removeRestorable(this),this.context.gl.deleteTexture(this.texture)},r.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL=!1,r})(e.Texture)})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.Input=(function(){function t(t){this.lastX=0,this.lastY=0,this.buttonDown=!1,this.currTouch=null,this.touchesPool=new e.Pool(function(){return new e.webgl.Touch(0,0,0)}),this.listeners=[],this.element=t,this.setupCallbacks(t)}return t.prototype.setupCallbacks=function(e){var t=this,n=function(n){if(n instanceof MouseEvent){for(var a=e.getBoundingClientRect(),o=n.clientX-a.left,s=n.clientY-a.top,c=t.listeners,l=0;l<c.length;l++)c[l].down&&c[l].down(o,s);t.lastX=o,t.lastY=s,t.buttonDown=!0,document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}},r=function(n){if(n instanceof MouseEvent){for(var r=e.getBoundingClientRect(),i=n.clientX-r.left,a=n.clientY-r.top,o=t.listeners,s=0;s<o.length;s++)t.buttonDown?o[s].dragged&&o[s].dragged(i,a):o[s].moved&&o[s].moved(i,a);t.lastX=i,t.lastY=a}},i=function(n){if(n instanceof MouseEvent){for(var a=e.getBoundingClientRect(),o=n.clientX-a.left,s=n.clientY-a.top,c=t.listeners,l=0;l<c.length;l++)c[l].up&&c[l].up(o,s);t.lastX=o,t.lastY=s,t.buttonDown=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)}};e.addEventListener(`mousedown`,n,!0),e.addEventListener(`mousemove`,r,!0),e.addEventListener(`mouseup`,i,!0),e.addEventListener(`touchstart`,function(n){if(t.currTouch==null){for(var r=n.changedTouches,i=0;i<r.length;i++){var a=r[i],o=e.getBoundingClientRect(),s=a.clientX-o.left,c=a.clientY-o.top;t.currTouch=t.touchesPool.obtain(),t.currTouch.identifier=a.identifier,t.currTouch.x=s,t.currTouch.y=c;break}for(var l=t.listeners,u=0;u<l.length;u++)l[u].down&&l[u].down(t.currTouch.x,t.currTouch.y);t.lastX=t.currTouch.x,t.lastY=t.currTouch.y,t.buttonDown=!0,n.preventDefault()}},!1),e.addEventListener(`touchend`,function(n){for(var r=n.changedTouches,i=0;i<r.length;i++){var a=r[i];if(t.currTouch.identifier===a.identifier){var o=e.getBoundingClientRect(),s=t.currTouch.x=a.clientX-o.left,c=t.currTouch.y=a.clientY-o.top;t.touchesPool.free(t.currTouch);for(var l=t.listeners,u=0;u<l.length;u++)l[u].up&&l[u].up(s,c);t.lastX=s,t.lastY=c,t.buttonDown=!1,t.currTouch=null;break}}n.preventDefault()},!1),e.addEventListener(`touchcancel`,function(n){for(var r=n.changedTouches,i=0;i<r.length;i++){var a=r[i];if(t.currTouch.identifier===a.identifier){var o=e.getBoundingClientRect(),s=t.currTouch.x=a.clientX-o.left,c=t.currTouch.y=a.clientY-o.top;t.touchesPool.free(t.currTouch);for(var l=t.listeners,u=0;u<l.length;u++)l[u].up&&l[u].up(s,c);t.lastX=s,t.lastY=c,t.buttonDown=!1,t.currTouch=null;break}}n.preventDefault()},!1),e.addEventListener(`touchmove`,function(n){if(t.currTouch!=null){for(var r=n.changedTouches,i=0;i<r.length;i++){var a=r[i];if(t.currTouch.identifier===a.identifier){for(var o=e.getBoundingClientRect(),s=a.clientX-o.left,c=a.clientY-o.top,l=t.listeners,u=0;u<l.length;u++)l[u].dragged&&l[u].dragged(s,c);t.lastX=t.currTouch.x=s,t.lastY=t.currTouch.y=c;break}}n.preventDefault()}},!1)},t.prototype.addListener=function(e){this.listeners.push(e)},t.prototype.removeListener=function(e){var t=this.listeners.indexOf(e);t>-1&&this.listeners.splice(t,1)},t})(),t.Touch=(function(){function e(e,t,n){this.identifier=e,this.x=t,this.y=n}return e})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.LoadingScreen=(function(){function n(t){if(this.logo=null,this.spinner=null,this.angle=0,this.fadeOut=0,this.timeKeeper=new e.TimeKeeper,this.backgroundColor=new e.Color(.135,.135,.135,1),this.tempColor=new e.Color,this.firstDraw=0,this.renderer=t,this.timeKeeper.maxDelta=9,n.logoImg===null){var r=navigator.userAgent.indexOf(`Safari`)>-1;n.logoImg=new Image,n.logoImg.src=n.SPINE_LOGO_DATA,r||(n.logoImg.crossOrigin=`anonymous`),n.logoImg.onload=function(e){n.loaded++},n.spinnerImg=new Image,n.spinnerImg.src=n.SPINNER_DATA,r||(n.spinnerImg.crossOrigin=`anonymous`),n.spinnerImg.onload=function(e){n.loaded++}}}return n.prototype.draw=function(e){if(e===void 0&&(e=!1),!(e&&this.fadeOut>
1n.FADE_SECONDS)){this.timeKeeper.update();var r=Math.abs(Math.sin(this.timeKeeper.totalTime+.75));this.angle-=this.timeKeeper.delta/1.4*360*(1+1.5*r**5);var i=this.renderer,a=i.canvas,o=i.context.gl;i.resize(t.ResizeMode.Stretch);var s=i.camera.position.x,c=i.camera.position.y;if(i.camera.position.set(a.width/2,a.height/2,0),i.camera.viewportWidth=a.width,i.camera.viewportHeight=a.height,!e)o.clearColor(this.backgroundColor.r,this.backgroundColor.g,this.backgroundColor.b,this.backgroundColor.a),o.clear(o.COLOR_BUFFER_BIT),this.tempColor.a=1;else{if(this.fadeOut+=this.timeKeeper.delta*(this.timeKeeper.totalTime<1?2:1),this.fadeOut>n.FADE_SECONDS){i.camera.position.set(s,c,0);return}r=1-this.fadeOut/n.FADE_SECONDS,this.tempColor.setFromColor(this.backgroundColor),this.tempColor.a=1-(r-1)*(r-1),i.begin(),i.quad(!0,0,0,a.width,0,a.width,a.height,0,a.height,this.tempColor,this.tempColor,this.tempColor,this.tempColor),i.end()}if(this.tempColor.set(1,1,1,this.tempColor.a),n.loaded==2){this.logo===null&&(this.logo=new t.GLTexture(i.context,n.logoImg),this.spinner=new t.GLTexture(i.context,n.spinnerImg)),this.logo.update(!1),this.spinner.update(!1);var l=this.logo.getImage().width,u=this.logo.getImage().height,d=this.spinner.getImage().width,f=this.spinner.getImage().height;i.batcher.setBlendMode(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),i.begin(),i.drawTexture(this.logo,(a.width-l)/2,(a.height-u)/2,l,u,this.tempColor),i.drawTextureRotated(this.spinner,(a.width-d)/2,(a.height-f)/2,d,f,d/2,f/2,this.angle,this.tempColor),i.end(),i.camera.position.set(s,c,0)}}},n.FADE_SECONDS=1,n.loaded=0,n.spinnerImg=null,n.logoImg=null,n.SPINNER_DATA=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAAACXBIWXMAAAsTAAALEwEAmpwYAAALB2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWR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nZ1Ho7wPrYNadHdINGCLdVMdrU6nMdimqHYgiaF2kn4IXJ8FMJY6iPRxsPqTksbc55ZJP2vHgOnuYwD2tU4k/eycaT891g0F5YDZ7qfQ3SidTAZgG4By4FwHgBtYBpYbZ/l/2EJnC9N0gaQAAAAASUVORK5CYII=`,n})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(e){e.M00=0,e.M01=4,e.M02=8,e.M03=12,e.M10=1,e.M11=5,e.M12=9,e.M13=13,e.M20=2,e.M21=6,e.M22=10,e.M23=14,e.M30=3,e.M31=7,e.M32=11,e.M33=15,e.Matrix4=(function(){function t(){this.temp=new Float32Array(16),this.values=new Float32Array(16);var t=this.values;t[e.M00]=1,t[e.M11]=1,t[e.M22]=1,t[e.M33]=1}return t.prototype.set=function(e){return this.values.set(e),this},t.prototype.transpose=function(){var t=this.temp,n=this.values;return t[e.M00]=n[e.M00],t[e.M01]=n[e.M10],t[e.M02]=n[e.M20],t[e.M03]=n[e.M30],t[e.M10]=n[e.M01],t[e.M11]=n[e.M11],t[e.M12]=n[e.M21],t[e.M13]=n[e.M31],t[e.M20]=n[e.M02],t[e.M21]=n[e.M12],t[e.M22]=n[e.M22],t[e.M23]=n[e.M32],t[e.M30]=n[e.M03],t[e.M31]=n[e.M13],t[e.M32]=n[e.M23],t[e.M33]=n[e.M33],this.set(t)},t.prototype.identity=function(){var t=this.values;return t[e.M00]=1,t[e.M01]=0,t[e.M02]=0,t[e.M03]=0,t[e.M10]=0,t[e.M11]=1,t[e.M12]=0,t[e.M13]=0,t[e.M20]=0,t[e.M21]=0,t[e.M22]=1,t[e.M23]=0,t[e.M30]=0,t[e.M31]=0,t[e.M32]=0,t[e.M33]=1,this},t.prototype.invert=function(){var t=this.values,n=this.temp,r=t[e.M30]*t[e.M21]*t[e.M12]*t[e.M03]-t[e.M20]*t[e.M31]*t[e.M12]*t[e.M03]-t[e.M30]*t[e.M11]*t[e.M22]*t[e.M03]+t[e.M10]*t[e.M31]*t[e.M22]*t[e.M03]+t[e.M20]*t[e.M11]*t[e.M32]*t[e.M03]-t[e.M10]*t[e.M21]*t[e.M32]*t[e.M03]-t[e.M30]*t[e.M21]*t[e.M02]*t[e.M13]+t[e.M20]*t[e.M31]*t[e.M02]*t[e.M13]+t[e.M30]*t[e.M01]*t[e.M22]*t[e.M13]-t[e.M00]*t[e.M31]*t[e.M22]*t[e.M13]-t[e.M20]*t[e.M01]*t[e.M32]*t[e.M13]+t[e.M00]*t[e.M21]*t[e.M32]*t[e.M13]+t[e.M30]*t[e.M11]*t[e.M02]*t[e.M23]-t[e.M10]*t[e.M31]*t[e.M02]*t[e.M23]-t[e.M30]*t[e.M01]*t[e.M12]*t[e.M23]+t[e.M00]*t[e.M31]*t[e.M12]*t[e.M23]+t[e.M10]*t[e.M01]*t[e.M32]*t[e.M23]-t[e.M00]*t[e.M11]*t[e.M32]*t[e.M23]-t[e.M20]*t[e.M11]*t[e.M02]*t[e.M33]+t[e.M10]*t[e.M21]*t[e.M02]*t[e.M33]+t[e.M20]*t[e.M01]*t[e.M12]*t[e.M33]-t[e.M00]*t[e.M21]*t[e.M12]*t[e.M33]-t[e.M10]*t[e.M01]*t[e.M22]*t[e.M33]+t[e.M00]*t[e.M11]*t[e.M22]*t[e.M33];if(r==0)throw Error(`non-invertible matrix`);var i=1/r;return n[e.M00]=t[e.M12]*t[e.M23]*t[e.M31]-t[e.M13]*t[e.M22]*t[e.M31]+t[e.M13]*t[e.M21]*t[e.M32]-t[e.M11]*t[e.M23]*t[e.M32]-t[e.M12]*t[e.M21]*t[e.M33]+t[e.M11]*t[e.M22]*t[e.M33],n[e.M01]=t[e.M03]*t[e.M22]*t[e.M31]-t[e.M02]*t[e.M23]*t[e.M31]-t[e.M03]*t[e.M21]*t[e.M32]+t[e.M01]*t[e.M23]*t[e.M32]+t[e.M02]*t[e.M21]*t[e.M33]-t[e.M01]*t[e.M22]*t[e.M33],n[e.M02]=t[e.M02]*t[e.M13]*t[e.M31]-t[e.M03]*t[e.M12]*t[e.M31]+t[e.M03]*t[e.M11]*t[e.M32]-t[e.M01]*t[e.M13]*t[e.M32]-t[e.M02]*t[e.M11]*t[e.M33]+t[e.M01]*t[e.M12]*t[e.M33],n[e.M03]=t[e.M03]*t[e.M12]*t[e.M21]-t[e.M02]*t[e.M13]*t[e.M21]-t[e.M03]*t[e.M11]*t[e.M22]+t[e.M01]*t[e.M13]*t[e.M22]+t[e.M02]*t[e.M11]*t[e.M23]-t[e.M01]*t[e.M12]*t[e.M23],n[e.M10]=t[e.M13]*t[e.M22]*t[e.M30]-t[e.M12]*t[e.M23]*t[e.M30]-t[e.M13]*t[e.M20]*t[e.M32]+t[e.M10]*t[e.M23]*t[e.M32]+t[e.M12]*t[e.M20]*t[e.M33]-t[e.M10]*t[e.M22]*t[e.M33],n[e.M11]=t[e.M02]*t[e.M23]*t[e.M30]-t[e.M03]*t[e.M22]*t[e.M30]+t[e.M03]*t[e.M20]*t[e.M32]-t[e.M00]*t[e.M23]*t[e.M32]-t[e.M02]*t[e.M20]*t[e.M33]+t[e.M00]*t[e.M22]*t[e.M33],n[e.M12]=t[e.M03]*t[e.M12]*t[e.M30]-t[e.M02]*t[e.M13]*t[e.M30]-t[e.M03]*t[e.M10]*t[e.M32]+t[e.M00]*t[e.M13]*t[e.M32]+t[e.M02]*t[e.M10]*t[e.M33]-t[e.M00]*t[e.M12]*t[e.M33],n[e.M13]=t[e.M02]*t[e.M13]*t[e.M20]-t[e.M03]*t[e.M12]*t[e.M20]+t[e.M03]*t[e.M10]*t[e.M22]-t[e.M00]*t[e.M13]*t[e.M22]-t[e.M02]*t[e.M10]*t[e.M23]+t[e.M00]*t[e.M12]*t[e.M23],n[e.M20]=t[e.M11]*t[e.M23]*t[e.M30]-t[e.M13]*t[e.M21]*t[e.M30]+t[e.M13]*t[e.M20]*t[e.M31]-t[e.M10]*t[e.M23]*t[e.M31]-t[e.M11]*t[e.M20]*t[e.M33]+t[e.M10]*t[e.M21]*t[e.M33],n[e.M21]=t[e.M03]*t[e.M21]*t[e.M30]-t[e.M01]*t[e.M23]*t[e.M30]-t[e.M03]*t[e.M20]*t[e.M31]+t[e.M00]*t[e.M23]*t[e.M31]+t[e.M01]*t[e.M20]*t[e.M33]-t[e.M00]*t[e.M21]*t[e.M33],n[e.M22]=t[e.M01]*t[e.M13]*t[e.M30]-t[e.M03]*t[e.M11]*t[e.M30]+t[e.M03]*t[e.M10]*t[e.M31]-t[e.M00]*t[e.M13]*t[e.M31]-t[e.M01]*t[e.M10]*t[e.M33]+t[e.M00]*t[e.M11]*t[e.M33],n[e.M23]=t[e.M03]*t[e.M11]*t[e.M20]-t[e.M01]*t[e.M13]*t[e.M20]-t[e.M03]*t[e.M10]*t[e.M21]+t[e.M00]*t[e.M13]*t[e.M21]+t[e.M01]*t[e.M10]*t[e.M23]-t[e.M00]*t[e.M11]*t[e.M23],n[e.M30]=t[e.M12]*t[e.M21]*t[e.M30]-t[e.M11]*t[e.M22]*t[e.M30]-t[e.M12]*t[e.M20]*t[e.M31]+t[e.M10]*t[e.M22]*t[e.M31]+t[e.M11]*t[e.M20]*t[e.M32]-t[e.M10]*t[e.M21]*t[e.M32],n[e.M31]=t[e.M01]*t[e.M22]*t[e.M30]-t[e.M02]*t[e.M21]*t[e.M30]+t[e.M02]*t[e.M20]*t[e.M31]-t[e.M00]*t[e.M22]*t[e.M31]-t[e.M01]*t[e.M20]*t[e.M32]+t[e.M00]*t[e.M21]*t[e.M32],n[e.M32]=t[e.M02]*t[e.M11]*t[e.M30]-t[e.M01]*t[e.M12]*t[e.M30]-t[e.M02]*t[e.M10]*t[e.M31]+t[e.M00]*t[e.M12]*t[e.M31]+t[e.M01]*t[e.M10]*t[e.M32]-t[e.M00]*t[e.M11]*t[e.M32],n[e.M33]=t[e.M01]*t[e.M12]*t[e.M20]-t[e.M02]*t[e.M11]*t[e.M20]+t[e.M02]*t[e.M10]*t[e.M21]-t[e.M00]*t[e.M12]*t[e.M21]-t[e.M01]*t[e.M10]*t[e.M22]+t[e.M00]*t[e.M11]*t[e.M22],t[e.M00]=n[e.M00]*i,t[e.M01]=n[e.M01]*i,t[e.M02]=n[e.M02]*i,t[e.M03]=n[e.M03]*i,t[e.M10]=n[e.M10]*i,t[e.M11]=n[e.M11]*i,t[e.M12]=n[e.M12]*i,t[e.M13]=n[e.M13]*i,t[e.M20]=n[e.M20]*i,t[e.M21]=n[e.M21]*i,t[e.M22]=n[e.M22]*i,t[e.M23]=n[e.M23]*i,t[e.M30]=n[e.M30]*i,t[e.M31]=n[e.M31]*i,t[e.M32]=n[e.M32]*i,t[e.M33]=n[e.M33]*i,this},t.prototype.determinant=function(){var t=this.values;return t[e.M30]*t[e.M21]*t[e.M12]*t[e.M03]-t[e.M20]*t[e.M31]*t[e.M12]*t[e.M03]-t[e.M30]*t[e.M11]*t[e.M22]*t[e.M03]+t[e.M10]*t[e.M31]*t[e.M22]*t[e.M03]+t[e.M20]*t[e.M11]*t[e.M32]*t[e.M03]-t[e.M10]*t[e.M21]*t[e.M32]*t[e.M03]-t[e.M30]*t[e.M21]*t[e.M02]*t[e.M13]+t[e.M20]*t[e.M31]*t[e.M02]*t[e.M13]+t[e.M30]*t[e.M01]*t[e.M22]*t[e.M13]-t[e.M00]*t[e.M31]*t[e.M22]*t[e.M13]-t[e.M20]*t[e.M01]*t[e.M32]*t[e.M13]+t[e.M00]*t[e.M21]*t[e.M32]*t[e.M13]+t[e.M30]*t[e.M11]*t[e.M02]*t[e.M23]-t[e.M10]*t[e.M31]*t[e.M02]*t[e.M23]-t[e.M30]*t[e.M01]*t[e.M12]*t[e.M23]+t[e.M00]*t[e.M31]*t[e.M12]*t[e.M23]+t[e.M10]*t[e.M01]*t[e.M32]*t[e.M23]-t[e.M00]*t[e.M11]*t[e.M32]*t[e.M23]-t[e.M20]*t[e.M11]*t[e.M02]*t[e.M33]+t[e.M10]*t[e.M21]*t[e.M02]*t[e.M33]+t[e.M20]*t[e.M01]*t[e.M12]*t[e.M33]-t[e.M00]*t[e.M21]*t[e.M12]*t[e.M33]-t[e.M10]*t[e.M01]*t[e.M22]*t[e.M33]+t[e.M00]*t[e.M11]*t[e.M22]*t[e.M33]},t.prototype.translate=function(t,n,r){var i=this.values;return i[e.M03]+=t,i[e.M13]+=n,i[e.M23]+=r,this},t.prototype.copy=function(){return new t().set(this.values)},t.prototype.projection=function(t,n,r,i){this.identity();var a=1/Math.tan(Math.PI/180*r/2),o=(n+t)/(t-n),s=2*n*t/(t-n),c=this.values;return c[e.M00]=a/i,c[e.M10]=0,c[e.M20]=0,c[e.M30]=0,c[e.M01]=0,c[e.M11]=a,c[e.M21]=0,c[e.M31]=0,c[e.M02]=0,c[e.M12]=0,c[e.M22]=o,c[e.M32]=-1,c[e.M03]=0,c[e.M13]=0,c[e.M23]=s,c[e.M33]=0,this},t.prototype.ortho2d=function(e,t,n,r){return this.ortho(e,e+n,t,t+r,0,1)},t.prototype.ortho=function(t,n,r,i,a,o){this.identity();var s=2/(n-t),c=2/(i-r),l=-2/(o-a),u=-(n+t)/(n-t),d=-(i+r)/(i-r),f=-(o+a)/(o-a),p=this.values;return p[e.M00]=s,p[e.M10]=0,p[e.M20]=0,p[e.M30]=0,p[e.M01]=0,p[e.M11]=c,p[e.M21]=0,p[e.M31]=0,p[e.M02]=0,p[e.M12]=0,p[e.M22]=l,p[e.M32]=0,p[e.M03]=u,p[e.M13]=d,p[e.M23]=f,p[e.M33]=1,this},t.prototype.multiply=function(t){var n=this.temp,r=this.values,i=t.values;return n[e.M00]=r[e.M00]*i[e.M00]+r[e.M01]*i[e.M10]+r[e.M02]*i[e.M20]+r[e.M03]*i[e.M30],n[e.M01]=r[e.M00]*i[e.M01]+r[e.M01]*i[e.M11]+r[e.M02]*i[e.M21]+r[e.M03]*i[e.M31],n[e.M02]=r[e.M00]*i[e.M02]+r[e.M01]*i[e.M12]+r[e.M02]*i[e.M22]+r[e.M03]*i[e.M32],n[e.M03]=r[e.M00]*i[e.M03]+r[e.M01]*i[e.M13]+r[e.M02]*i[e.M23]+r[e.M03]*i[e.M33],n[e.M10]=r[e.M10]*i[e.M00]+r[e.M11]*i[e.M10]+r[e.M12]*i[e.M20]+r[e.M13]*i[e.M30],n[e.M11]=r[e.M10]*i[e.M01]+r[e.M11]*i[e.M11]+r[e.M12]*i[e.M21]+r[e.M13]*i[e.M31],n[e.M12]=r[e.M10]*i[e.M02]+r[e.M11]*i[e.M12]+r[e.M12]*i[e.M22]+r[e.M13]*i[e.M32],n[e.M13]=r[e.M10]*i[e.M03]+r[e.M11]*i[e.M13]+r[e.M12]*i[e.M23]+r[e.M13]*i[e.M33],n[e.M20]=r[e.M20]*i[e.M00]+r[e.M21]*i[e.M10]+r[e.M22]*i[e.M20]+r[e.M23]*i[e.M30],n[e.M21]=r[e.M20]*i[e.M01]+r[e.M21]*i[e.M11]+r[e.M22]*i[e.M21]+r[e.M23]*i[e.M31],n[e.M22]=r[e.M20]*i[e.M02]+r[e.M21]*i[e.M12]+r[e.M22]*i[e.M22]+r[e.M23]*i[e.M32],n[e.M23]=r[e.M20]*i[e.M03]+r[e.M21]*i[e.M13]+r[e.M22]*i[e.M23]+r[e.M23]*i[e.M33],n[e.M30]=r[e.M30]*i[e.M00]+r[e.M31]*i[e.M10]+r[e.M32]*i[e.M20]+r[e.M33]*i[e.M30],n[e.M31]=r[e.M30]*i[e.M01]+r[e.M31]*i[e.M11]+r[e.M32]*i[e.M21]+r[e.M33]*i[e.M31],n[e.M32]=r[e.M30]*i[e.M02]+r[e.M31]*i[e.M12]+r[e.M32]*i[e.M22]+r[e.M33]*i[e.M32],n[e.M33]=r[e.M30]*i[e.M03]+r[e.M31]*i[e.M13]+r[e.M32]*i[e.M23]+r[e.M33]*i[e.M33],this.set(this.temp)},t.prototype.multiplyLeft=function(t){var n=this.temp,r=this.values,i=t.values;return n[e.M00]=i[e.M00]*r[e.M00]+i[e.M01]*r[e.M10]+i[e.M02]*r[e.M20]+i[e.M03]*r[e.M30],n[e.M01]=i[e.M00]*r[e.M01]+i[e.M01]*r[e.M11]+i[e.M02]*r[e.M21]+i[e.M03]*r[e.M31],n[e.M02]=i[e.M00]*r[e.M02]+i[e.M01]*r[e.M12]+i[e.M02]*r[e.M22]+i[e.M03]*r[e.M32],n[e.M03]=i[e.M00]*r[e.M03]+i[e.M01]*r[e.M13]+i[e.M02]*r[e.M23]+i[e.M03]*r[e.M33],n[e.M10]=i[e.M10]*r[e.M00]+i[e.M11]*r[e.M10]+i[e.M12]*r[e.M20]+i[e.M13]*r[e.M30],n[e.M11]=i[e.M10]*r[e.M01]+i[e.M11]*r[e.M11]+i[e.M12]*r[e.M21]+i[e.M13]*r[e.M31],n[e.M12]=i[e.M10]*r[e.M02]+i[e.M11]*r[e.M12]+i[e.M12]*r[e.M22]+i[e.M13]*r[e.M32],n[e.M13]=i[e.M10]*r[e.M03]+i[e.M11]*r[e.M13]+i[e.M12]*r[e.M23]+i[e.M13]*r[e.M33],n[e.M20]=i[e.M20]*r[e.M00]+i[e.M21]*r[e.M10]+i[e.M22]*r[e.M20]+i[e.M23]*r[e.M30],n[e.M21]=i[e.M20]*r[e.M01]+i[e.M21]*r[e.M11]+i[e.M22]*r[e.M21]+i[e.M23]*r[e.M31],n[e.M22]=i[e.M20]*r[e.M02]+i[e.M21]*r[e.M12]+i[e.M22]*r[e.M22]+i[e.M23]*r[e.M32],n[e.M23]=i[e.M20]*r[e.M03]+i[e.M21]*r[e.M13]+i[e.M22]*r[e.M23]+i[e.M23]*r[e.M33],n[e.M30]=i[e.M30]*r[e.M00]+i[e.M31]*r[e.M10]+i[e.M32]*r[e.M20]+i[e.M33]*r[e.M30],n[e.M31]=i[e.M30]*r[e.M01]+i[e.M31]*r[e.M11]+i[e.M32]*r[e.M21]+i[e.M33]*r[e.M31],n[e.M32]=i[e.M30]*r[e.M02]+i[e.M31]*r[e.M12]+i[e.M32]*r[e.M22]+i[e.M33]*r[e.M32],n[e.M33]=i[e.M30]*r[e.M03]+i[e.M31]*r[e.M13]+i[e.M32]*r[e.M23]+i[e.M33]*r[e.M33],this.set(this.temp)},t.prototype.lookAt=function(n,r,i){t.initTemps();var a=t.xAxis,o=t.yAxis,s=t.zAxis;s.setFrom(r).normalize(),a.setFrom(r).normalize(),a.cross(i).normalize(),o.setFrom(a).cross(s).normalize(),this.identity();var c=this.values;return c[e.M00]=a.x,c[e.M01]=a.y,c[e.M02]=a.z,c[e.M10]=o.x,c[e.M11]=o.y,c[e.M12]=o.z,c[e.M20]=-s.x,c[e.M21]=-s.y,c[e.M22]=-s.z,t.tmpMatrix.identity(),t.tmpMatrix.values[e.M03]=-n.x,t.tmpMatrix.values[e.M13]=-n.y,t.tmpMatrix.values[e.M23]=-n.z,this.multiply(t.tmpMatrix),this},t.initTemps=function(){t.xAxis===null&&(t.xAxis=new e.Vector3),t.yAxis===null&&(t.yAxis=new e.Vector3),t.zAxis===null&&(t.zAxis=new e.Vector3)},t.xAxis=null,t.yAxis=null,t.zAxis=null,t.tmpMatrix=new t,t})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(e){e.Mesh=(function(){function t(t,n,r,i){this.attributes=n,this.verticesLength=0,this.dirtyVertices=!1,this.indicesLength=0,this.dirtyIndices=!1,this.elementsPerVertex=0,this.context=t instanceof e.ManagedWebG
1LRenderingContext?t:new e.ManagedWebGLRenderingContext(t),this.elementsPerVertex=0;for(var a=0;a<n.length;a++)this.elementsPerVertex+=n[a].numElements;this.vertices=new Float32Array(r*this.elementsPerVertex),this.indices=new Uint16Array(i),this.context.addRestorable(this)}return t.prototype.getAttributes=function(){return this.attributes},t.prototype.maxVertices=function(){return this.vertices.length/this.elementsPerVertex},t.prototype.numVertices=function(){return this.verticesLength/this.elementsPerVertex},t.prototype.setVerticesLength=function(e){this.dirtyVertices=!0,this.verticesLength=e},t.prototype.getVertices=function(){return this.vertices},t.prototype.maxIndices=function(){return this.indices.length},t.prototype.numIndices=function(){return this.indicesLength},t.prototype.setIndicesLength=function(e){this.dirtyIndices=!0,this.indicesLength=e},t.prototype.getIndices=function(){return this.indices},t.prototype.getVertexSizeInFloats=function(){for(var e=0,t=0;t<this.attributes.length;t++){var n=this.attributes[t];e+=n.numElements}return e},t.prototype.setVertices=function(e){if(this.dirtyVertices=!0,e.length>this.vertices.length)throw Error(`Mesh can't store more than `+this.maxVertices()+` vertices`);this.vertices.set(e,0),this.verticesLength=e.length},t.prototype.setIndices=function(e){if(this.dirtyIndices=!0,e.length>this.indices.length)throw Error(`Mesh can't store more than `+this.maxIndices()+` indices`);this.indices.set(e,0),this.indicesLength=e.length},t.prototype.draw=function(e,t){this.drawWithOffset(e,t,0,this.indicesLength>0?this.indicesLength:this.verticesLength/this.elementsPerVertex)},t.prototype.drawWithOffset=function(e,t,n,r){var i=this.context.gl;(this.dirtyVertices||this.dirtyIndices)&&this.update(),this.bind(e),this.indicesLength>0?i.drawElements(t,r,i.UNSIGNED_SHORT,n*2):i.drawArrays(t,n,r),this.unbind(e)},t.prototype.bind=function(e){var t=this.context.gl;t.bindBuffer(t.ARRAY_BUFFER,this.verticesBuffer);for(var n=0,r=0;r<this.attributes.length;r++){var i=this.attributes[r],a=e.getAttributeLocation(i.name);t.enableVertexAttribArray(a),t.vertexAttribPointer(a,i.numElements,t.FLOAT,!1,this.elementsPerVertex*4,n*4),n+=i.numElements}this.indicesLength>0&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},t.prototype.unbind=function(e){for(var t=this.context.gl,n=0;n<this.attributes.length;n++){var r=this.attributes[n],i=e.getAttributeLocation(r.name);t.disableVertexAttribArray(i)}t.bindBuffer(t.ARRAY_BUFFER,null),this.indicesLength>0&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)},t.prototype.update=function(){var e=this.context.gl;this.dirtyVertices&&(this.verticesBuffer||(this.verticesBuffer=e.createBuffer()),e.bindBuffer(e.ARRAY_BUFFER,this.verticesBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices.subarray(0,this.verticesLength),e.DYNAMIC_DRAW),this.dirtyVertices=!1),this.dirtyIndices&&(this.indicesBuffer||(this.indicesBuffer=e.createBuffer()),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices.subarray(0,this.indicesLength),e.DYNAMIC_DRAW),this.dirtyIndices=!1)},t.prototype.restore=function(){this.verticesBuffer=null,this.indicesBuffer=null,this.update()},t.prototype.dispose=function(){this.context.removeRestorable(this);var e=this.context.gl;e.deleteBuffer(this.verticesBuffer),e.deleteBuffer(this.indicesBuffer)},t})();var t=(function(){function e(e,t,n){this.name=e,this.type=t,this.numElements=n}return e})();e.VertexAttribute=t,e.Position2Attribute=(function(t){Y(r,t);function r(){return t.call(this,e.Shader.POSITION,n.Float,2)||this}return r})(t),e.Position3Attribute=(function(t){Y(r,t);function r(){return t.call(this,e.Shader.POSITION,n.Float,3)||this}return r})(t),e.TexCoordAttribute=(function(t){Y(r,t);function r(r){return r===void 0&&(r=0),t.call(this,e.Shader.TEXCOORDS+(r==0?``:r),n.Float,2)||this}return r})(t),e.ColorAttribute=(function(t){Y(r,t);function r(){return t.call(this,e.Shader.COLOR,n.Float,4)||this}return r})(t),e.Color2Attribute=(function(t){Y(r,t);function r(){return t.call(this,e.Shader.COLOR2,n.Float,4)||this}return r})(t);var n;(function(e){e[e.Float=0]=`Float`})(n=e.VertexAttributeType||(e.VertexAttributeType={}))})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(e){e.PolygonBatcher=(function(){function t(t,n,r){if(n===void 0&&(n=!0),r===void 0&&(r=10920),this.isDrawing=!1,this.shader=null,this.lastTexture=null,this.verticesLength=0,this.indicesLength=0,r>10920)throw Error(`Can't have more than 10920 triangles per batch: `+r);
1this.context=t instanceof e.ManagedWebGLRenderingContext?t:new e.ManagedWebGLRenderingContext(t);var i=n?[new e.Position2Attribute,new e.ColorAttribute,new e.TexCoordAttribute,new e.Color2Attribute]:[new e.Position2Attribute,new e.ColorAttribute,new e.TexCoordAttribute];this.mesh=new e.Mesh(t,i,r,r*3),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return t.prototype.begin=function(e){var t=this.context.gl;if(this.isDrawing)throw Error(`PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()`);this.drawCalls=0,this.shader=e,this.lastTexture=null,this.isDrawing=!0,t.enable(t.BLEND),t.blendFunc(this.srcBlend,this.dstBlend)},t.prototype.setBlendMode=function(e,t){var n=this.context.gl;this.srcBlend=e,this.dstBlend=t,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))},t.prototype.draw=function(e,t,n){e==this.lastTexture?(this.verticesLength+t.length>this.mesh.getVertices().length||this.indicesLength+n.length>this.mesh.getIndices().length)&&this.flush():(this.flush(),this.lastTexture=e);var r=this.mesh.numVertices();this.mesh.getVertices().set(t,this.verticesLength),this.verticesLength+=t.length,this.mesh.setVerticesLength(this.verticesLength);for(var i=this.mesh.getIndices(),a=this.indicesLength,o=0;o<n.length;a++,o++)i[a]=n[o]+r;this.indicesLength+=n.length,this.mesh.setIndicesLength(this.indicesLength)},t.prototype.flush=function(){var e=this.context.gl;this.verticesLength!=0&&(this.lastTexture.bind(),this.mesh.draw(this.shader,e.TRIANGLES),this.verticesLength=0,this.indicesLength=0,this.mesh.setVerticesLength(0),this.mesh.setIndicesLength(0),this.drawCalls++)},t.prototype.end=function(){var e=this.context.gl;if(!this.isDrawing)throw Error(`PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()`);(this.verticesLength>0||this.indicesLength>0)&&this.flush(),this.shader=null,this.lastTexture=null,this.isDrawing=!1,e.disable(e.BLEND)},t.prototype.getDrawCalls=function(){return this.drawCalls},t.prototype.dispose=function(){this.mesh.dispose()},t})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.SceneRenderer=(function(){function r(n,r,i){i===void 0&&(i=!0),this.twoColorTint=!1,this.activeRenderer=null,this.QUAD=[0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0],this.QUAD_TRIANGLES=[0,1,2,2,3,0],this.WHITE=new e.Color(1,1,1,1),this.canvas=n,this.context=r instanceof t.ManagedWebGLRenderingContext?r:new t.ManagedWebGLRenderingContext(r),this.twoColorTint=i,this.camera=new t.OrthoCamera(n.width,n.height),this.batcherShader=i?t.Shader.newTwoColoredTextured(this.context):t.Shader.newColoredTextured(this.context),this.batcher=new t.PolygonBatcher(this.context,i),this.shapesShader=t.Shader.newColored(this.context),this.shapes=new t.ShapeRenderer(this.context),this.skeletonRenderer=new t.SkeletonRenderer(this.context,i),this.skeletonDebugRenderer=new t.SkeletonDebugRenderer(this.context)}return r.prototype.begin=function(){this.camera.update(),this.enableRenderer(this.batcher)},r.prototype.drawSkeleton=function(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=-1),r===void 0&&(r=-1),this.enableRenderer(this.batcher),this.skeletonRenderer.premultipliedAlpha=t,this.skeletonRenderer.draw(this.batcher,e,n,r)},r.prototype.drawSkeletonDebug=function(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=null),this.enableRenderer(this.shapes),this.skeletonDebugRenderer.premultipliedAlpha=t,this.skeletonDebugRenderer.draw(this.shapes,e,n)},r.prototype.drawTexture=function(e,t,n,r,i,a){a===void 0&&(a=null),this.enableRenderer(this.batcher),a===null&&(a=this.WHITE);var o=this.QUAD,s=0;o[s++]=t,o[s++]=n,o[s++]=a.r,o[s++]=a.g,o[s++]=a.b,o[s++]=a.a,o[s++]=0,o[s++]=1,this.twoColorTint&&(o[s++]=0,o[s++]=0,o[s++]=0,o[s++]=0),o[s++]=t+r,o[s++]=n,o[s++]=a.r,o[s++]=a.g,o[s++]=a.b,o[s++]=a.a,o[s++]=1,o[s++]=1,this.twoColorTint&&(o[s++]=0,o[s++]=0,o[s++]=0,o[s++]=0),o[s++]=t+r,o[s++]=n+i,o[s++]=a.r,o[s++]=a.g,o[s++]=a.b,o[s++]=a.a,o[s++]=1,o[s++]=0,this.twoColorTint&&(o[s++]=0,o[s++]=0,o[s++]=0,o[s++]=0),o[s++]=t,o[s++]=n+i,o[s++]=a.r,o[s++]=a.g,o[s++]=a.b,o[s++]=a.a,o[s++]=0,o[s++]=0,this.twoColorTint&&(o[s++]=0,o[s++]=0,o[s++]=0,o[s++]=0),this.batcher.draw(e,o,this.QUAD_TRIANGLES)},r.prototype.drawTextureUV=function(e,t,n,r,i,a,o,s,c,l){l===void 0&&(l=null),this.enableRenderer(this.batcher),l===null&&(l=this.WHITE);var u=this.QUAD,d=0;u[d++]=t,u[d++]=n,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=a,u[d++]=o,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),u[d++]=t+r,u[d++]=n,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=s,u[d++]=o,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),u[d++]=t+r,u[d++]=n+i,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=s,u[d++]=c,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),u[d++]=t,u[d++]=n+i,u[d++]=l.r,u[d++]=l.g,u[d++]=l.b,u[d++]=l.a,u[d++]=a,u[d++]=c,this.twoColorTint&&(u[d++]=0,u[d++]=0,u[d++]=0,u[d++]=0),this.batcher.draw(e,u,this.QUAD_TRIANGLES)},r.prototype.drawTextureRotated=function(t,n,r,i,a,o,s,c,l,u){l===void 0&&(l=null),u===void 0&&(u=!1),this.enableRenderer(this.batcher),l===null&&(l=this.WHITE);var d=this.QUAD,f=n+o,p=r+s,m=-o,h=-s,g=i-o,_=a-s,v=m,y=h,b=m,x=_,S=g,C=_,w=g,T=h,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=0;if(c!=0){var P=e.MathUtils.cosDeg(c),F=e.MathUtils.sinDeg(c);E=P*v-F*y,D=F*v+P*y,M=P*b-F*x,N=F*b+P*x,A=P*S-F*C,j=F*S+P*C,O=A+(E-M),k=j+(D-N)}else E=v,D=y,M=b,N=x,A=S,j=C,O=w,k=T;E+=f,D+=p,O+=f,k+=p,A+=f,j+=p,M+=f,N+=p;var I=0;d[I++]=E,d[I++]=D,d[I++]=l.r,d[I++]=l.g,d[I++]=l.b,d[I++]=l.a,d[I++]=0,d[I++]=1,this.twoColorTint&&(d[I++]=0,d[I++]=0,d[I++]=0,d[I++]=0),d[I++]=O,d[I++]=k,d[I++]=l.r,d[I++]=l.g,d[I++]=l.b,d[I++]=l.a,d[I++]=1,d[I++]=1,this.twoColorTint&&(d[I++]=0,d[I++]=0,d[I++]=0,d[I++]=0),d[I++]=A,d[I++]=j,d[I++]=l.r,d[I++]=l.g,d[I++]=l.b,d[I++]=l.a,d[I++]=1,d[I++]=0,this.twoColorTint&&(d[I++]=0,d[I++]=0,d[I++]=0,d[I++]=0),d[I++]=M,d[I++]=N,d[I++]=l.r,d[I++]=l.g,d[I++]=l.b,d[I++]=l.a,d[I++]=0,d[I++]=0,this.twoColorTint&&(d[I++]=0,d[I++]=0,d[I++]=0,d[I++]=0),this.batcher.draw(t,d,this.QUAD_TRIANGLES)},r.prototype.drawRegion=function(e,t,n,r,i,a,o){a===void 0&&(a=null),o===void 0&&(o=!1),this.enableRenderer(this.batcher),a===null&&(a=this.WHITE);var s=this.QUAD,c=0;s[c++]=t,s[c++]=n,s[c++]=a.r,s[c++]=a.g,s[c++]=a.b,s[c++]=a.a,s[c++]=e.u,s[c++]=e.v2,this.twoColorTint&&(s[c++]=0,s[c++]=0,s[c++]=0,s[c++]=0),s[c++]=t+r,s[c++]=n,s[c++]=a.r,s[c++]=a.g,s[c++]=a.b,s[c++]=a.a,s[c++]=e.u2,s[c++]=e.v2,this.twoColorTint&&(s[c++]=0,s[c++]=0,s[c++]=0,s[c++]=0),s[c++]=t+r,s[c++]=n+i,s[c++]=a.r,s[c++]=a.g,s[c++]=a.b,s[c++]=a.a,s[c++]=e.u2,s[c++]=e.v,this.twoColorTint&&(s[c++]=0,s[c++]=0,s[c++]=0,s[c++]=0),s[c++]=t,s[c++]=n+i,s[c++]=a.r,s[c++]=a.g,s[c++]=a.b,s[c++]=a.a,s[c++]=e.u,s[c++]=e.v,this.twoColorTint&&(s[c++]=0,s[c++]=0,s[c++]=0,s[c++]=0),this.batcher.draw(e.texture,s,this.QUAD_TRIANGLES)},r.prototype.line=function(e,t,n,r,i,a){i===void 0&&(i=null),a===void 0&&(a=null),this.enableRenderer(this.shapes),this.shapes.line(e,t,n,r,i)},r.prototype.triangle=function(e,t,n,r,i,a,o,s,c,l){s===void 0&&(s=null),c===void 0&&(c=null),l===void 0&&(l=null),this.enableRenderer(this.shapes),this.shapes.triangle(e,t,n,r,i,a,o,s,c,l)},r.prototype.quad=function(e,t,n,r,i,a,o,s,c,l,u,d,f){l===void 0&&(l=null),u===void 0&&(u=null),d===void 0&&(d=null),f===void 0&&(f=null),this.enableRenderer(this.shapes),this.shapes.quad(e,t,n,r,i,a,o,s,c,l,u,d,f)},r.prototype.rect=function(e,t,n,r,i,a){a===void 0&&(a=null),this.enableRenderer(this.shapes),this.shapes.rect(e,t,n,r,i,a)},r.prototype.rectLine=function(e,t,n,r,i,a,o){o===void 0&&(o=null),this.enableRenderer(this.shapes),this.shapes.rectLine(e,t,n,r,i,a,o)},r.prototype.polygon=function(e,t,n,r){r===void 0&&(r=null),this.enableRenderer(this.shapes),this.shapes.polygon(e,t,n,r)},r.prototype.circle=function(e,t,n,r,i,a){i===void 0&&(i=null),a===void 0&&(a=0),this.enableRenderer(this.shapes),this.shapes.circle(e,t,n,r,i,a)},r.prototype.curve=function(e,t,n,r,i,a,o,s,c,l){l===void 0&&(l=null),this.enableRenderer(this.shapes),this.shapes.curve(e,t,n,r,i,a,o,s,c,l)},r.prototype.end=function(){this.activeRenderer===this.batcher?this.batcher.end():this.activeRenderer===this.shapes&&this.shapes.end(),this.activeRenderer=null},r.prototype.resize=function(e){var t=this.canvas,r=t.clientWidth,i=t.clientHeight;if((t.width!=r||t.height!=i)&&(t.width=r,t.height=i),this.context.gl.viewport(0,0,t.width,t.height),e!==n.Stretch){if(e===n.Expand)this.camera.setViewport(r,i);else if(e===n.Fit){var a=t.width,o=t.height,s=this.camera.viewportWidth,c=this.camera.viewportHe
1ight,l=c/s<o/a?s/a:c/o;this.camera.viewportWidth=a*l,this.camera.viewportHeight=o*l}}this.camera.update()},r.prototype.enableRenderer=function(e){this.activeRenderer!==e&&(this.end(),e instanceof t.PolygonBatcher?(this.batcherShader.bind(),this.batcherShader.setUniform4x4f(t.Shader.MVP_MATRIX,this.camera.projectionView.values),this.batcherShader.setUniformi(`u_texture`,0),this.batcher.begin(this.batcherShader),this.activeRenderer=this.batcher):e instanceof t.ShapeRenderer?(this.shapesShader.bind(),this.shapesShader.setUniform4x4f(t.Shader.MVP_MATRIX,this.camera.projectionView.values),this.shapes.begin(this.shapesShader),this.activeRenderer=this.shapes):this.activeRenderer=this.skeletonDebugRenderer)},r.prototype.dispose=function(){this.batcher.dispose(),this.batcherShader.dispose(),this.shapes.dispose(),this.shapesShader.dispose(),this.skeletonDebugRenderer.dispose()},r})();var n;(function(e){e[e.Stretch=0]=`Stretch`,e[e.Expand=1]=`Expand`,e[e.Fit=2]=`Fit`})(n=t.ResizeMode||(t.ResizeMode={}))})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(e){e.Shader=(function(){function t(t,n,r){this.vertexShader=n,this.fragmentShader=r,this.vs=null,this.fs=null,this.program=null,this.tmp2x2=new Float32Array(4),this.tmp3x3=new Float32Array(9),this.tmp4x4=new Float32Array(16),this.vsSource=n,this.fsSource=r,this.context=t instanceof e.ManagedWebGLRenderingContext?t:new e.ManagedWebGLRenderingContext(t),this.context.addRestorable(this),this.compile()}return t.prototype.getProgram=function(){return this.program},t.prototype.getVertexShader=function(){return this.vertexShader},t.prototype.getFragmentShader=function(){return this.fragmentShader},t.prototype.getVertexShaderSource=function(){return this.vsSource},t.prototype.getFragmentSource=function(){return this.fsSource},t.prototype.compile=function(){var e=this.context.gl;try{this.vs=this.compileShader(e.VERTEX_SHADER,this.vertexShader),this.fs=this.compileShader(e.FRAGMENT_SHADER,this.fragmentShader),this.program=this.compileProgram(this.vs,this.fs)}catch(e){throw this.dispose(),e}},t.prototype.compileShader=function(e,t){var n=this.context.gl,r=n.createShader(e);if(n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){var i=`Couldn't compile shader: `+n.getShaderInfoLog(r);if(n.deleteShader(r),!n.isContextLost())throw Error(i)}return r},t.prototype.compileProgram=function(e,t){var n=this.context.gl,r=n.createProgram();if(n.attachShader(r,e),n.attachShader(r,t),n.linkProgram(r),!n.getProgramParameter(r,n.LINK_STATUS)){var i=`Couldn't compile shader program: `+n.getProgramInfoLog(r);if(n.deleteProgram(r),!n.isContextLost())throw Error(i)}return r},t.prototype.restore=function(){this.compile()},t.prototype.bind=function(){this.context.gl.useProgram(this.program)},t.prototype.unbind=function(){this.context.gl.useProgram(null)},t.prototype.setUniformi=function(e,t){this.context.gl.uniform1i(this.getUniformLocation(e),t)},t.prototype.setUniformf=function(e,t){this.context.gl.uniform1f(this.getUniformLocation(e),t)},t.prototype.setUniform2f=function(e,t,n){this.context.gl.uniform2f(this.getUniformLocation(e),t,n)},t.prototype.setUniform3f=function(e,t,n,r){this.context.gl.uniform3f(this.getUniformLocation(e),t,n,r)},t.prototype.setUniform4f=function(e,t,n,r,i){this.context.gl.uniform4f(this.getUniformLocation(e),t,n,r,i)},t.prototype.setUniform2x2f=function(e,t){var n=this.context.gl;this.tmp2x2.set(t),n.uniformMatrix2fv(this.getUniformLocation(e),!1,this.tmp2x2)},t.prototype.setUniform3x3f=function(e,t){var n=this.context.gl;this.tmp3x3.set(t),n.uniformMatrix3fv(this.getUniformLocation(e),!1,this.tmp3x3)},t.prototype.setUniform4x4f=function(e,t){var n=this.context.gl;this.tmp4x4.set(t),n.uniformMatrix4fv(this.getUniformLocation(e),!1,this.tmp4x4)},t.prototype.getUniformLocation=function(e){var t=this.context.gl,n=t.getUniformLocation(this.program,e);if(!n&&!t.isContextLost())throw Error(`Couldn't find location for uniform `+e);return n},t.prototype.getAttributeLocation=function(e){var t=this.context.gl,n=t.getAttribLocation(this.program,e);if(n==-1&&!t.isContextLost())throw Error(`Couldn't find location for attribute `+e);return n},t.prototype.dispose=function(){this.context.removeRestorable(this);var e=this.context.gl;this.vs&&(e.deleteShader(this.vs),this.vs=null),this.fs&&(e.deleteShader(this.fs),this.fs=null),this.program&&(e.deleteProgram(this.program),this.program=null)},t.newColoredTextured=function(e){return new t(e,`
2				attribute vec4 `+t.POSITION+`;
3				attribute vec4 `+t.COLOR+`;
4				attribute vec2 `+t.TEXCOORDS+`;
5				uniform mat4 `+t.MVP_MATRIX+`;
6				varying vec4 v_color;
7				varying vec2 v_texCoords;
8
9				void main () {
10					v_color = `+t.COLOR+`;
11					v_texCoords = `+t.TEXCOORDS+`;
12					gl_Position = `+t.MVP_MATRIX+` * `+t.POSITION+`;
13				}
14			`,`
15				#ifdef GL_ES
16					#define LOWP lowp
17					precision mediump float;
18				#else
19					#define LOWP
20				#endif
21				varying LOWP vec4 v_color;
22				varying vec2 v_texCoords;
23				uniform sampler2D u_texture;
24
25				void main () {
26					gl_FragColor = v_color * texture2D(u_texture, v_texCoords);
27				}
28			`)},t.newTwoColoredTextured=function(e){return new t(e,`
29				attribute vec4 `+t.POSITION+`;
30				attribute vec4 `+t.COLOR+`;
31				attribute vec4 `+t.COLOR2+`;
32				attribute vec2 `+t.TEXCOORDS+`;
33				uniform mat4 `+t.MVP_MATRIX+`;
34				varying vec4 v_light;
35				varying vec4 v_dark;
36				varying vec2 v_texCoords;
37
38				void main () {
39					v_light = `+t.COLOR+`;
40					v_dark = `+t.COLOR2+`;
41					v_texCoords = `+t.TEXCOORDS+`;
42					gl_Position = `+t.MVP_MATRIX+` * `+t.POSITION+`;
43				}
44			`,`
45				#ifdef GL_ES
46					#define LOWP lowp
47					precision mediump float;
48				#else
49					#define LOWP
50				#endif
51				varying LOWP vec4 v_light;
52				varying LOWP vec4 v_dark;
53				varying vec2 v_texCoords;
54				uniform sampler2D u_texture;
55
56				void main () {
57					vec4 texColor = texture2D(u_texture, v_texCoords);
58					gl_FragColor.a = texColor.a * v_light.a;
59					gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;
60				}
61			`)},t.newColored=function(e){return new t(e,`
62				attribute vec4 `+t.POSITION+`;
63				attribute vec4 `+t.COLOR+`;
64				uniform mat4 `+t.MVP_MATRIX+`;
65				varying vec4 v_color;
66
67				void main () {
68					v_color = `+t.COLOR+`;
69					gl_Position = `+t.MVP_MATRIX+` * `+t.POSITION+`;
70				}
71			`,`
72				#ifdef GL_ES
73					#define LOWP lowp
74					precision mediump float;
75				#else
76					#define LOWP
77				#endif
78				varying LOWP vec4 v_color;
79
80				void main () {
81					gl_FragColor = v_color;
82				}
83			`)},t.MVP_MATRIX=`u_projTrans`,t.POSITION=`a_position`,t.COLOR=`a_color`,t.COLOR2=`a_color2`,t.TEXCOORDS=`a_texCoords`,t.SAMPLER=`u_texture`,t})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.ShapeRenderer=(function(){function r(r,i){if(i===void 0&&(i=10920),this.isDrawing=!1,this.shapeType=n.Filled,this.color=new e.Color(1,1,1,1),this.vertexIndex=0,this.tmp=new e.Vector2,i>10920)throw Error(`Can't have more than 10920 triangles per batch: `+i);
83this.context=r instanceof t.ManagedWebGLRenderingContext?r:new t.ManagedWebGLRenderingContext(r),this.mesh=new t.Mesh(r,[new t.Position2Attribute,new t.ColorAttribute],i,0),this.srcBlend=this.context.gl.SRC_ALPHA,this.dstBlend=this.context.gl.ONE_MINUS_SRC_ALPHA}return r.prototype.begin=function(e){if(this.isDrawing)throw Error(`ShapeRenderer.begin() has already been called`);this.shader=e,this.vertexIndex=0,this.isDrawing=!0;var t=this.context.gl;t.enable(t.BLEND),t.blendFunc(this.srcBlend,this.dstBlend)},r.prototype.setBlendMode=function(e,t){var n=this.context.gl;this.srcBlend=e,this.dstBlend=t,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))},r.prototype.setColor=function(e){this.color.setFromColor(e)},r.prototype.setColorWith=function(e,t,n,r){this.color.set(e,t,n,r)},r.prototype.point=function(e,t,r){r===void 0&&(r=null),this.check(n.Point,1),r===null&&(r=this.color),this.vertex(e,t,r)},r.prototype.line=function(e,t,r,i,a){a===void 0&&(a=null),this.check(n.Line,2),this.mesh.getVertices(),this.vertexIndex,a===null&&(a=this.color),this.vertex(e,t,a),this.vertex(r,i,a)},r.prototype.triangle=function(e,t,r,i,a,o,s,c,l,u){c===void 0&&(c=null),l===void 0&&(l=null),u===void 0&&(u=null),this.check(e?n.Filled:n.Line,3),this.mesh.getVertices(),this.vertexIndex,c===null&&(c=this.color),l===null&&(l=this.color),u===null&&(u=this.color),e?(this.vertex(t,r,c),this.vertex(i,a,l),this.vertex(o,s,u)):(this.vertex(t,r,c),this.vertex(i,a,l),this.vertex(i,a,c),this.vertex(o,s,l),this.vertex(o,s,c),this.vertex(t,r,l))},r.prototype.quad=function(e,t,r,i,a,o,s,c,l,u,d,f,p){u===void 0&&(u=null),d===void 0&&(d=null),f===void 0&&(f=null),p===void 0&&(p=null),this.check(e?n.Filled:n.Line,3),this.mesh.getVertices(),this.vertexIndex,u===null&&(u=this.color),d===null&&(d=this.color),f===null&&(f=this.color),p===null&&(p=this.color),e?(this.vertex(t,r,u),this.vertex(i,a,d),this.vertex(o,s,f),this.vertex(o,s,f),this.vertex(c,l,p),this.vertex(t,r,u)):(this.vertex(t,r,u),this.vertex(i,a,d),this.vertex(i,a,d),this.vertex(o,s,f),this.vertex(o,s,f),this.vertex(c,l,p),this.vertex(c,l,p),this.vertex(t,r,u))},r.prototype.rect=function(e,t,n,r,i,a){a===void 0&&(a=null),this.quad(e,t,n,t+r,n,t+r,n+i,t,n+i,a,a,a,a)},r.prototype.rectLine=function(e,t,r,i,a,o,s){s===void 0&&(s=null),this.check(e?n.Filled:n.Line,8),s===null&&(s=this.color);var c=this.tmp.set(a-r,t-i);c.normalize(),o*=.5;var l=c.x*o,u=c.y*o;e?(this.vertex(t+l,r+u,s),this.vertex(t-l,r-u,s),this.vertex(i+l,a+u,s),this.vertex(i-l,a-u,s),this.vertex(i+l,a+u,s),this.vertex(t-l,r-u,s)):(this.vertex(t+l,r+u,s),this.vertex(t-l,r-u,s),this.vertex(i+l,a+u,s),this.vertex(i-l,a-u,s),this.vertex(i+l,a+u,s),this.vertex(t+l,r+u,s),this.vertex(i-l,a-u,s),this.vertex(t-l,r-u,s))},r.prototype.x=function(e,t,n){this.line(e-n,t-n,e+n,t+n),this.line(e-n,t+n,e+n,t-n)},r.prototype.polygon=function(e,t,r,i){if(i===void 0&&(i=null),r<3)throw Error(`Polygon must contain at least 3 vertices`);this.check(n.Line,r*2),i===null&&(i=this.color),this.mesh.getVertices(),this.vertexIndex,t<<=1,r<<=1;for(var a=e[t],o=e[t+1],s=t+r,c=t,l=t+r-2;c<l;c+=2){var u=e[c],d=e[c+1],f=0,p=0;c+2>=s?(f=a,p=o):(f=e[c+2],p=e[c+3]),this.vertex(u,d,i),this.vertex(f,p,i)}},r.prototype.circle=function(t,r,i,a,o,s){if(o===void 0&&(o=null),s===void 0&&(s=0),s===0&&(s=Math.max(1,6*e.MathUtils.cbrt(a)|0)),s<=0)throw Error(`segments must be > 0.`);o===null&&(o=this.color);var c=2*e.MathUtils.PI/s,l=Math.cos(c),u=Math.sin(c),d=a,f=0;if(t){this.check(n.Filled,s*3+3),s--;for(var p=0;p<s;p++){this.vertex(r,i,o),this.vertex(r+d,i+f,o);var m=d;d=l*d-u*f,f=u*m+l*f,this.vertex(r+d,i+f,o)}this.vertex(r,i,o),this.vertex(r+d,i+f,o)}else{this.check(n.Line,s*2+2);for(var p=0;p<s;p++){this.vertex(r+d,i+f,o);var h=d;d=l*d-u*f,f=u*h+l*f,this.vertex(r+d,i+f,o)}this.vertex(r+d,i+f,o)}d=a,f=0,this.vertex(r+d,i+f,o)},r.prototype.curve=function(e,t,r,i,a,o,s,c,l,u){u===void 0&&(u=null),this.check(n.Line,l*2+2),u===null&&(u=this.color);for(var d=1/l,f=d*d,p=d*d*d,m=3*d,h=3*f,g=6*f,_=6*p,v=e-r*2+a,y=t-i*2+o,b=(r-a)*3-e+s,x=(i-o)*3-t+c,S=e,C=t,w=(r-e)*m+v*h+b*p,T=(i-t)*m+y*h+x*p,E=v*g+b*_,D=y*g+x*_,O=b*_,k=x*_;l-->0;)this.vertex(S,C,u),S+=w,C+=T,w+=E,T+=D,E+=O,D+=k,this.vertex(S,C,u);this.vertex(S,C,u),this.vertex(s,c,u)},r.prototype.vertex=function(e,t,n){var r=this.vertexIndex,i=this.mesh.getVertices();i[r++]=e,i[r++]=t,i[r++]=n.r,i[r++]=n.g,i[r++]=n.b,i[r++]=n.a,this.vertexIndex=r},r.prototype.end=function(){if(!this.isDrawing)throw Error(`ShapeRenderer.begin() has not been called`);this.flush(),this.context.gl.disable(this.context.gl.BLEND),this.isDrawing=!1},r.prototype.flush=function(){this.vertexIndex!=0&&(this.mesh.setVerticesLength(this.vertexIndex),this.mesh.draw(this.shader,this.shapeType),this.vertexIndex=0)},r.prototype.check=function(e,t){if(!this.isDrawing)throw Error(`ShapeRenderer.begin() has not been called`);
83if(this.shapeType==e){if(this.mesh.maxVertices()-this.mesh.numVertices()<t)this.flush();else return}else this.flush(),this.shapeType=e},r.prototype.dispose=function(){this.mesh.dispose()},r})();var n;(function(e){e[e.Point=0]=`Point`,e[e.Line=1]=`Line`,e[e.Filled=4]=`Filled`})(n=t.ShapeType||(t.ShapeType={}))})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.SkeletonDebugRenderer=(function(){function n(n){this.boneLineColor=new e.Color(1,0,0,1),this.boneOriginColor=new e.Color(0,1,0,1),this.attachmentLineColor=new e.Color(0,0,1,.5),this.triangleLineColor=new e.Color(1,.64,0,.5),this.pathColor=new e.Color().setFromString(`FF7F00`),this.clipColor=new e.Color(.8,0,0,2),this.aabbColor=new e.Color(0,1,0,.5),this.drawBones=!0,this.drawRegionAttachments=!0,this.drawBoundingBoxes=!0,this.drawMeshHull=!0,this.drawMeshTriangles=!0,this.drawPaths=!0,this.drawSkeletonXY=!1,this.drawClipping=!0,this.premultipliedAlpha=!1,this.scale=1,this.boneWidth=2,this.bounds=new e.SkeletonBounds,this.temp=[],this.vertices=e.Utils.newFloatArray(2048),this.context=n instanceof t.ManagedWebGLRenderingContext?n:new t.ManagedWebGLRenderingContext(n)}return n.prototype.draw=function(t,r,i){i===void 0&&(i=null);var a=r.x,o=r.y,s=this.context.gl,c=this.premultipliedAlpha?s.ONE:s.SRC_ALPHA;t.setBlendMode(c,s.ONE_MINUS_SRC_ALPHA);var l=r.bones;if(this.drawBones){t.setColor(this.boneLineColor);for(var u=0,d=l.length;u<d;u++){var f=l[u];if(!(i&&i.indexOf(f.data.name)>-1)&&f.parent!=null){var p=a+f.data.length*f.a+f.worldX,m=o+f.data.length*f.c+f.worldY;t.rectLine(!0,a+f.worldX,o+f.worldY,p,m,this.boneWidth*this.scale)}}this.drawSkeletonXY&&t.x(a,o,4*this.scale)}if(this.drawRegionAttachments){t.setColor(this.attachmentLineColor);for(var h=r.slots,u=0,d=h.length;u<d;u++){var g=h[u],_=g.getAttachment();if(_ instanceof e.RegionAttachment){var v=_,y=this.vertices;v.computeWorldVertices(g.bone,y,0,2),t.line(y[0],y[1],y[2],y[3]),t.line(y[2],y[3],y[4],y[5]),t.line(y[4],y[5],y[6],y[7]),t.line(y[6],y[7],y[0],y[1])}}}if(this.drawMeshHull||this.drawMeshTriangles)for(var h=r.slots,u=0,d=h.length;u<d;u++){var g=h[u];if(g.bone.active){var _=g.getAttachment();if(_ instanceof e.MeshAttachment){var b=_,y=this.vertices;b.computeWorldVertices(g,0,b.worldVerticesLength,y,0,2);var x=b.triangles,S=b.hullLength;if(this.drawMeshTriangles){t.setColor(this.triangleLineColor);for(var C=0,w=x.length;C<w;C+=3){var T=x[C]*2,E=x[C+1]*2,D=x[C+2]*2;t.triangle(!1,y[T],y[T+1],y[E],y[E+1],y[D],y[D+1])}}if(this.drawMeshHull&&S>0){t.setColor(this.attachmentLineColor),S=(S>>1)*2;for(var O=y[S-2],k=y[S-1],C=0,w=S;C<w;C+=2){var p=y[C],m=y[C+1];t.line(p,m,O,k),O=p,k=m}}}}}if(this.drawBoundingBoxes){var A=this.bounds;A.update(r,!0),t.setColor(this.aabbColor),t.rect(!1,A.minX,A.minY,A.getWidth(),A.getHeight());for(var j=A.polygons,M=A.boundingBoxes,u=0,d=j.length;u<d;u++){var N=j[u];t.setColor(M[u].color),t.polygon(N,0,N.length)}}if(this.drawPaths)for(var h=r.slots,u=0,d=h.length;u<d;u++){var g=h[u];if(g.bone.active){var _=g.getAttachment();if(_ instanceof e.PathAttachment){var P=_,w=P.worldVerticesLength,F=this.temp=e.Utils.setArraySize(this.temp,w,0);P.computeWorldVertices(g,0,w,F,0,2);var I=this.pathColor,L=F[2],R=F[3],z=0,B=0;if(P.closed){t.setColor(I);var V=F[0],H=F[1],U=F[w-2],W=F[w-1];z=F[w-4],B=F[w-3],t.curve(L,R,V,H,U,W,z,B,32),t.setColor(n.LIGHT_GRAY),t.line(L,R,V,H),t.line(z,B,U,W)}w-=4;for(var C=4;C<w;C+=6){var V=F[C],H=F[C+1],U=F[C+2],W=F[C+3];z=F[C+4],B=F[C+5],t.setColor(I),t.curve(L,R,V,H,U,W,z,B,32),t.setColor(n.LIGHT_GRAY),t.line(L,R,V,H),t.line(z,B,U,W),L=z,R=B}}}}if(this.drawBones){t.setColor(this.boneOriginColor);for(var u=0,d=l.length;u<d;u++){var f=l[u];i&&i.indexOf(f.data.name)>-1||t.circle(!0,a+f.worldX,o+f.worldY,3*this.scale,n.GREEN,8)}}if(this.drawClipping){var h=r.slots;t.setColor(this.clipColor);for(var u=0,d=h.length;u<d;u++){var g=h[u];if(g.bone.active){var _=g.getAttachment();if(_ instanceof e.ClippingAttachment){var G=_,w=G.worldVerticesLength,F=this.temp=e.Utils.setArraySize(this.temp,w,0);G.computeWorldVertices(g,0,w,F,0,2);for(var K=0,q=F.length;K<q;K+=2){var p=F[K],m=F[K+1],z=F[(K+2)%F.length],B=F[(K+3)%F.length];t.line(p,m,z,B)}}}}}},n.prototype.dispose=function(){},n.LIGHT_GRAY=new e.Color(192/255,192/255,192/255,1),n.GREEN=new e.Color(0,1,0,1),n})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){var n=(function(){function e(e,t,n){this.vertices=e,this.numVertices=t,this.numFloats=n}return e})();t.SkeletonRenderer=(function(){function r(t,r){r===void 0&&(r=!0),this.premultipliedAlpha=!1,this.vertexEffect=null,this.tempColor=new e.Color,this.tempColor2=new e.Color,this.vertexSize=8,this.twoColorTint=!1,this.renderable=new n(null,0,0),this.clipper=new e.SkeletonClipping,this.temp=new e.Vector2,this.temp2=new e.Vector2,this.temp3=new e.Color,this.temp4=new e.Color,this.twoColorTint=r,r&&(this.vertexSize+=4),this.vertices=e.Utils.newFloatArray(this.vertexSize*1024)}return r.prototype.draw=function(n,i,a,o){a===void 0&&(a=-1),o===void 0&&(o=-1);var s=this.clipper,c=this.premultipliedAlpha,l=this.twoColorTint,u=null,d=this.temp,f=this.temp2,p=this.temp3,m=this.temp4,h=this.renderable,g=null,_=null,v=i.drawOrder,y=null,b=i.color,x=l?12:8,S=!1;a==-1&&(S=!0);for(var C=0,w=v.length;C<w;C++){var T=s.isClipping()?2:x,E=v[C];if(!E.bone.active){s.clipEndWithSlot(E);continue}if(a>=0&&a==E.data.index&&(S=!0),!S){s.clipEndWithSlot(E);continue}o>=0&&o==E.data.index&&(S=!1);var D=E.getAttachment(),O=null;if(D instanceof e.RegionAttachment){var k=D;h.vertices=this.vertices,h.numVertices=4,h.numFloats=T<<2,k.computeWorldVertices(E.bone,h.vertices,0,T),_=r.QUAD_TRIANGLES,g=k.uvs,O=k.region.renderObject.texture,y=k.color}else if(D instanceof e.MeshAttachment){var A=D;h.vertices=this.vertices,h.numVertices=A.worldVerticesLength>>1,h.numFloats=h.numVertices*T,h.numFloats>h.vertices.length&&(h.vertices=this.vertices=e.Utils.newFloatArray(h.numFloats)),A.computeWorldVertices(E,0,A.worldVerticesLength,h.vertices,0,T),_=A.triangles,O=A.region.renderObject.texture,g=A.uvs,y=A.color}else if(D instanceof e.ClippingAttachment){var j=D;s.clipStart(E,j);continue}else{s.clipEndWithSlot(E);continue}if(O!=null){var M=E.color,N=this.tempColor;N.r=b.r*M.r*y.r,N.g=b.g*M.g*y.g,N.b=b.b*M.b*y.b,N.a=b.a*M.a*y.a,c&&(N.r*=N.a,N.g*=N.a,N.b*=N.a);var P=this.tempColor2;E.darkColor==null?P.set(0,0,0,1):(c?(P.r=E.darkColor.r*N.a,P.g=E.darkColor.g*N.a,P.b=E.darkColor.b*N.a):P.setFromColor(E.darkColor),P.a=+!!c);var F=E.data.blendMode;if(F!=u&&(u=F,n.setBlendMode(t.WebGLBlendModeConverter.getSourceGLBlendMode(u,c),t.WebGLBlendModeConverter.getDestGLBlendMode(u))),s.isCl
83ipping()){s.clipTriangles(h.vertices,h.numFloats,_,_.length,g,N,P,l);var I=new Float32Array(s.clippedVertices),L=s.clippedTriangles;if(this.vertexEffect!=null){var R=this.vertexEffect,z=I;if(l)for(var B=0,V=I.length;B<V;B+=x)d.x=z[B],d.y=z[B+1],p.set(z[B+2],z[B+3],z[B+4],z[B+5]),f.x=z[B+6],f.y=z[B+7],m.set(z[B+8],z[B+9],z[B+10],z[B+11]),R.transform(d,f,p,m),z[B]=d.x,z[B+1]=d.y,z[B+2]=p.r,z[B+3]=p.g,z[B+4]=p.b,z[B+5]=p.a,z[B+6]=f.x,z[B+7]=f.y,z[B+8]=m.r,z[B+9]=m.g,z[B+10]=m.b,z[B+11]=m.a;else for(var B=0,H=I.length;B<H;B+=x)d.x=z[B],d.y=z[B+1],p.set(z[B+2],z[B+3],z[B+4],z[B+5]),f.x=z[B+6],f.y=z[B+7],m.set(0,0,0,0),R.transform(d,f,p,m),z[B]=d.x,z[B+1]=d.y,z[B+2]=p.r,z[B+3]=p.g,z[B+4]=p.b,z[B+5]=p.a,z[B+6]=f.x,z[B+7]=f.y}n.draw(O,I,L)}else{var z=h.vertices;if(this.vertexEffect!=null){var R=this.vertexEffect;if(l)for(var B=0,U=0,W=h.numFloats;B<W;B+=x,U+=2)d.x=z[B],d.y=z[B+1],f.x=g[U],f.y=g[U+1],p.setFromColor(N),m.setFromColor(P),R.transform(d,f,p,m),z[B]=d.x,z[B+1]=d.y,z[B+2]=p.r,z[B+3]=p.g,z[B+4]=p.b,z[B+5]=p.a,z[B+6]=f.x,z[B+7]=f.y,z[B+8]=m.r,z[B+9]=m.g,z[B+10]=m.b,z[B+11]=m.a;else for(var B=0,U=0,G=h.numFloats;B<G;B+=x,U+=2)d.x=z[B],d.y=z[B+1],f.x=g[U],f.y=g[U+1],p.setFromColor(N),m.set(0,0,0,0),R.transform(d,f,p,m),z[B]=d.x,z[B+1]=d.y,z[B+2]=p.r,z[B+3]=p.g,z[B+4]=p.b,z[B+5]=p.a,z[B+6]=f.x,z[B+7]=f.y}else if(l)for(var B=2,U=0,K=h.numFloats;B<K;B+=x,U+=2)z[B]=N.r,z[B+1]=N.g,z[B+2]=N.b,z[B+3]=N.a,z[B+4]=g[U],z[B+5]=g[U+1],z[B+6]=P.r,z[B+7]=P.g,z[B+8]=P.b,z[B+9]=P.a;else for(var B=2,U=0,q=h.numFloats;B<q;B+=x,U+=2)z[B]=N.r,z[B+1]=N.g,z[B+2]=N.b,z[B+3]=N.a,z[B+4]=g[U],z[B+5]=g[U+1];var J=h.vertices.subarray(0,h.numFloats);n.draw(O,J,_)}}s.clipEndWithSlot(E)}s.clipEnd()},r.QUAD_TRIANGLES=[0,1,2,2,3,0],r})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(e){e.Vector3=(function(){function t(e,t,n){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),this.x=0,this.y=0,this.z=0,this.x=e,this.y=t,this.z=n}return t.prototype.setFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},t.prototype.set=function(e,t,n){return this.x=e,this.y=t,this.z=n,this},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},t.prototype.scale=function(e){return this.x*=e,this.y*=e,this.z*=e,this},t.prototype.normalize=function(){var e=this.length();return e==0?this:(e=1/e,this.x*=e,this.y*=e,this.z*=e,this)},t.prototype.cross=function(e){return this.set(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)},t.prototype.multiply=function(t){var n=t.values;return this.set(this.x*n[e.M00]+this.y*n[e.M01]+this.z*n[e.M02]+n[e.M03],this.x*n[e.M10]+this.y*n[e.M11]+this.z*n[e.M12]+n[e.M13],this.x*n[e.M20]+this.y*n[e.M21]+this.z*n[e.M22]+n[e.M23])},t.prototype.project=function(t){var n=t.values,r=1/(this.x*n[e.M30]+this.y*n[e.M31]+this.z*n[e.M32]+n[e.M33]);return this.set((this.x*n[e.M00]+this.y*n[e.M01]+this.z*n[e.M02]+n[e.M03])*r,(this.x*n[e.M10]+this.y*n[e.M11]+this.z*n[e.M12]+n[e.M13])*r,(this.x*n[e.M20]+this.y*n[e.M21]+this.z*n[e.M22]+n[e.M23])*r)},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.prototype.distance=function(e){var t=e.x-this.x,n=e.y-this.y,r=e.z-this.z;return Math.sqrt(t*t+n*n+r*r)},t})()})(e.webgl||(e.webgl={}))})(X||(X={}));var X;(function(e){(function(t){t.ManagedWebGLRenderingContext=(function(){function e(e,t){t===void 0&&(t={alpha:`true`}),this.restorables=[],e instanceof WebGLRenderingContext||e instanceof WebGL2RenderingContext?(this.gl=e,this.canvas=this.gl.canvas):this.setupCanvas(e,t)}return e.prototype.setupCanvas=function(e,t){var n=this;this.gl=e.getContext(`webgl2`,t)||e.getContext(`webgl`,t),this.canvas=e,e.addEventListener(`webglcontextlost`,function(e){e&&e.preventDefault()}),e.addEventListener(`webglcontextrestored`,function(e){for(var t=0,r=n.restorables.length;t<r;t++)n.restorables[t].restore()})},e.prototype.addRestorable=function(e){this.restorables.push(e)},e.prototype.removeRestorable=function(e){var t=this.restorables.indexOf(e);t>-1&&this.restorables.splice(t,1)},e})(),t.WebGLBlendModeConverter=(function(){function t(){}return t.getDestGLBlendMode=function(n){switch(n){case e.BlendMode.Normal:return t.ONE_MINUS_SRC_ALPHA;case e.BlendMode.Additive:return t.ONE;case e.BlendMode.Multiply:return t.ONE_MINUS_SRC_ALPHA;case e.BlendMode.Screen:return t.ONE_MINUS_SRC_ALPHA;default:throw Error(`Unknown blend mode: `+n)}},t.getSourceGLBlendMode=function(n,r){switch(r===void 0&&(r=!1),n){case e.BlendMode.Normal:return r?t.ONE:t.SRC_ALPHA;case e.BlendMode.Additive:return r?t.ONE:t.SRC_ALPHA;case e.BlendMode.Multiply:return t.DST_COLOR;case e.BlendMode.Screen:return t.ONE;default:throw Error(`Unknown blend mode: `+n)}},t.ZERO=0,t.ONE=1,t.SRC_COLOR=768,t.ONE_MINUS_SRC_COLOR=769,t.SRC_ALPHA=770,t.ONE_MINUS_SRC_ALPHA=771,t.DST_ALPHA=772,t.ONE_MINUS_DST_ALPHA=773,t.DST_COLOR=774,t})()})(e.webgl||(e.webgl={}))})(X||(X={}));var Z=X,Q=class{constructor(e){K(this,`skeletons`,{}),K(this,`canvas`,void 0),K(this,`shader`,void 0),K(this,`debugShader`,void 0),K(this,`batcher`,void 0),K(this,`mvp`,void 0),K(this,`skeletonRenderer`,void 0),K(this,`debugRenderer`,void 0),K(this,`context`,void 0),K(this,`shapes`,void 0),K(this,`assetManager`,void 0),K(this,`lastFrameTime`,void 0),K(this,`bg`,[0,0,0,0]),K(this,`activeSkeleton`,void 0),K(this,`debug`,!1),K(this,`position`,void 0),this.canvas=e,this.context=new Z.webgl.ManagedWebG
83LRenderingContext(e,{alpha:!0}),this.shader=Z.webgl.Shader.newTwoColoredTextured(this.context),this.batcher=new Z.webgl.PolygonBatcher(this.context),this.mvp=new Z.webgl.Matrix4,this.mvp.ortho2d(0,0,e.width,e.height),this.position={x:0,y:0,scale:1},this.skeletonRenderer=new Z.webgl.SkeletonRenderer(this.context),this.debugRenderer=new Z.webgl.SkeletonDebugRenderer(this.context),this.debugRenderer.drawRegionAttachments=!0,this.debugRenderer.drawBoundingBoxes=!0,this.debugRenderer.drawMeshHull=!0,this.debugRenderer.drawMeshTriangles=!0,this.debugRenderer.drawPaths=!0,this.debugShader=Z.webgl.Shader.newColored(this.context),this.shapes=new Z.webgl.ShapeRenderer(this.context),this.assetManager=new Z.webgl.AssetManager(this.context),this.lastFrameTime=0}fetchAssets(e,t){let n=new Promise((t,n)=>{this.assetManager.loadBinary(e,e=>t(e),e=>n(e))}),r=new Promise((e,n)=>{this.assetManager.loadTextureAtlas(t,t=>e(t),e=>n(e))});return Promise.all([n,r])}loadSkel(e,t,n,r,i=!0,a){let o=this.assetManager.get(n),s=new Z.AtlasAttachmentLoader(o),c=this.assetManager.get(t),l;if(c[0]===123){let e=new Z.SkeletonJson(s),t=new TextDecoder(`utf-8`);l=e.readSkeletonData(t.decode(c))}else l=new Z.SkeletonBinary(s).readSkeletonData(c);let u=new Z.Skeleton(l);a&&u.setSkinByName(a);let d=$(u),f=new Z.AnimationStateData(u.data),p=new Z.AnimationState(f);return this.mvp.ortho2d(r.x,r.y,this.canvas.width*r.scale,this.canvas.height*r.scale),this.skeletons[e]={skeleton:u,bounds:d,state:p,premultipliedAlpha:i},this.position=r,this.skeletons[e]}async load(e,t,n,r,i,a=!0){return this.skeletons[e]?this.skeletons[e]:(await this.fetchAssets(t,n),this.loadSkel(e,t,n,r,a,i))}play(e){if(this.lastFrameTime&&e===this.activeSkeleton){console.log(`is playing!`);return}console.log(`play`,e),this.lastFrameTime=Date.now(),this.activeSkeleton=e,this.render()}render(){if(!this.activeSkeleton){this.lastFrameTime=0,console.info(`nothing to play`);return}let e=Date.now()/1e3,t=e-this.lastFrameTime;this.lastFrameTime=e,this.context.gl.clearColor(...this.bg),this.context.gl.clear(this.context.gl.COLOR_BUFFER_BIT);let n=this.skeletons[this.activeSkeleton].state,r=this.skeletons[this.activeSkeleton].skeleton,i=this.skeletons[this.activeSkeleton].premultipliedAlpha;n.update(t),n.apply(r),r.updateWorldTransform(),this.shader.bind(),this.shader.setUniformi(Z.webgl.Shader.SAMPLER,0),this.shader.setUniform4x4f(Z.webgl.Shader.MVP_MATRIX,this.mvp.values),this.batcher.begin(this.shader),this.skeletonRenderer.premultipliedAlpha=i,this.skeletonRenderer.draw(this.batcher,r),this.batcher.end(),this.shader.unbind(),this.debug&&(this.debugShader.bind(),this.debugShader.setUniform4x4f(Z.webgl.Shader.MVP_MATRIX,this.mvp.values),this.debugRenderer.premultipliedAlpha=i,this.shapes.begin(this.debugShader),this.debugRenderer.draw(this.shapes,r),this.shapes.end(),this.debugShader.unbind()),requestAnimationFrame(this.render.bind(this))}getCurrent(){if(this.activeSkeleton)return console.log(`getCurrent`,this.activeSkeleton),this.skeletons[this.activeSkeleton]}setAnimation(e,t){if(!this.activeSkeleton)return;let n=this.skeletons[this.activeSkeleton];if(!n)return;let{state:r}=n;if(n.repeatListener&&(r.removeListener(n.repeatListener),n.repeatListener=void 0),!t){r.setAnimation(0,e,!1);return}r.setAnimation(0,e,!1);let i={start:()=>{},interrupt:()=>{},end:()=>{},dispose:()=>{},complete:()=>{r.addAnimation(0,e,!1,0)},event:()=>{}};r.addListener(i),n.repeatListener=i}move(e,t){console.log(e,t),this.activeSkeleton&&(this.position.x=e,this.position.y=t,this.mvp.ortho2d(e,t,this.canvas.width/this.position.scale,this.canvas.height/this.position.scale))}scale(e){this.position={scale:e,x:this.position.x,y:this.position.y},this.mvp.ortho2d(this.position.x,this.position.y,this.canvas.width/e,this.canvas.height/e)}transform(e,t,n){this.position={scale:n,x:e,y:t},this.mvp.ortho2d(this.position.x,this.position.y,this.canvas.width/n,this.canvas.height/n)}record(e,t){if(!this.activeSkeleton)throw Error(`activeSkeleton is empty`);let n=this.canvas.captureStream(60),r=[],i=new MediaRecorder(n,{mimeType:`video/webm`});i.ondataavailable=e=>{r.push(e.data)};let a=!1,o=this.skeletons[this.activeSkeleton];o.repeatListener&&(o.state.removeListener(o.repeatListener),o.repeatListener=void 0);let s=o.state;return s.addListener({start:e=>{console.log(`start`),a=!0,i.start()},end:()=>{},interrupt:()=>{},dispose:()=>{},complete:e=>{a&&(console.log(`end`),i.stop())},event:()=>{}}),s.setAnimation(0,e,!1),new Promise(e=>{i.onstop=()=>{let n=new Blob(r,{type:`video/webm`});y(n,t||`output`),s.clearListeners(),e()}})}};function $(e){e.setToSetupPose(),e.updateWorldTransform();let t=new Z.Vector2,n=new Z.Vector2;return e.getBounds(t,n,[]),{offset:t,size:n}}var ee=e(t(((e,t)=>{(function(e,n,r,i){var a=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],o=n.createElement(`div`),s=`function`,c=Math.round,l=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(y(e,n),t)}function f(e,t,n){return Array.isArray(e)?(p(e,n[t],n),!0):!1}function p(e,t,n){var r;if(e){if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}}function m(t,n,r){var i=`DEPRECATED METHOD: `+n+`
84`+r+` AT 
85`;return function(){var n=Error(`get-stack-trace`),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,a=e.console&&(e.console.warn||e.console.log);return a&&a.call(e.console,i,r),t.apply(this,arguments)}}var h=typeof Object.assign==`function`?Object.assign:function(e){if(e===i||e===null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&r!==null)for(var a in r)r.hasOwnProperty(a)&&(t[a]=r[a])}return t},g=m(function(e,t,n){for(var r=Object.keys(t),a=0;a<r.length;)(!n||n&&e[r[a]]===i)&&(e[r[a]]=t[r[a]]),a++;return e},`extend`,"Use `assign`."),_=m(function(e,t){return g(e,t,!0)},`merge`,"Use `assign`.");function v(e,t,n){var r=t.prototype,i=e.prototype=Object.create(r);i.constructor=e,i._super=r,n&&h(i,n)}function y(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return typeof e==s?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function S(e,t,n){p(E(t),function(t){e.addEventListener(t,n,!1)})}
vendor: 18,337 bytes, line 85
85function C(e,t,n){p(E(t),function(t){e.removeEventListener(t,n,!1)})}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function T(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function D(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function O(e){return Array.prototype.slice.call(e,0)}function k(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];D(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function A(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if(n=a[s],r=n?n+o:t,r in e)return r;s++}return i}var j=1;function M(){return j++}function N(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}var P=/mobile|tablet|ip(ad|hone|od)|android/i,F=`ontouchstart`in e,I=A(e,`PointerEvent`)!==i,L=F&&P.test(navigator.userAgent),R=`touch`,z=`pen`,B=`mouse`,V=`kinect`,H=25,U=1,W=2,G=4,K=8,q=1,J=2,Y=4,X=8,Z=16,Q=J|Y,$=X|Z,ee=Q|$,te=[`x`,`y`],ne=[`clientX`,`clientY`];function re(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}re.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(N(this.element),this.evWin,this.domHandler)}};function ie(e){return new(e.options.inputClass||(I?Te:L?Ne:F?Le:be))(e,ae)}function ae(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&U&&r-i===0,o=t&(G|K)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,oe(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function oe(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=le(t)),i>1&&!n.firstMultiple?n.firstMultiple=le(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=ue(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=me(s,c),t.distance=pe(s,c),se(n,t),t.offsetDirection=fe(t.deltaX,t.deltaY);var d=de(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=l(d.x)>l(d.y)?d.x:d.y,t.scale=o?ge(o.pointers,r):1,t.rotation=o?he(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,ce(n,t);var f=e.element;w(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}function se(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===U||a.eventType===G)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function ce(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,a,o,s,c;if(t.eventType!=K&&(r>H||n.velocity===i)){var u=t.deltaX-n.deltaX,d=t.deltaY-n.deltaY,f=de(r,u,d);o=f.x,s=f.y,a=l(f.x)>l(f.y)?f.x:f.y,c=fe(u,d),e.lastInterval=t}else a=n.velocity,o=n.velocityX,s=n.velocityY,c=n.direction;t.velocity=a,t.velocityX=o,t.velocityY=s,t.direction=c}function le(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:ue(t),deltaX:e.deltaX,deltaY:e.deltaY}}function ue(e){var t=e.length;if(t===1)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:c(n/t),y:c(r/t)}}function de(e,t,n){return{x:t/e||0,y:n/e||0}}function fe(e,t){return e===t?q:l(e)>=l(t)?e<0?J:Y:t<0?X:Z}function pe(e,t,n){n||(n=te);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function me(e,t,n){n||(n=te);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function he(e,t){return me(t[1],t[0],ne)+me(e[1],e[0],ne)}function ge(e,t){return pe(t[0],t[1],ne)/pe(e[0],e[1],ne)}var _e={mousedown:U,mousemove:W,mouseup:G},ve=`mousedown`,ye=`mousemove mouseup`;function be(){this.evEl=ve,this.evWin=ye,this.pressed=!1,re.apply(this,arguments)}v(be,re,{handler:function(e){var t=_e[e.type];t&U&&e.button===0&&(this.pressed=!0),t&W&&e.which!==1&&(t=G),this.pressed&&(t&G&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:B,srcEvent:e}))}});var xe={pointerdown:U,pointermove:W,pointerup:G,pointercancel:K,pointerout:K},Se={2:R,3:z,4:B,5:V},Ce=`pointerdown`,we=`pointermove pointerup pointercancel`;e.MSPointerEvent&&!e.PointerEvent&&(Ce=`MSPointerDown`,we=`MSPointerMove MSPointerUp MSPointerCancel`);function Te(){this.evEl=Ce,this.evWin=we,re.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(Te,re,{handler:function(e){var t=this.store,n=!1,r=xe[e.type.toLowerCase().replace(`ms`,``)],i=Se[e.pointerType]||e.pointerType,a=i==R,o=D(t,e.pointerId,`pointerId`);r&U&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&(G|K)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))}});var Ee={touchstart:U,touchmove:W,touchend:G,touchcancel:K},De=`touchstart`,Oe=`touchstart touchmove touchend touchcancel`;function ke(){this.evTarget=De,this.evWin=Oe,this.started=!1,re.apply(this,arguments)}v(ke,re,{handler:function(e){var t=Ee[e.type];if(t===U&&(this.started=!0),this.started){var n=Ae.call(this,e,t);t&(G|K)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:R,srcEvent:e})}}});function Ae(e,t){var n=O(e.touches),r=O(e.changedTouches);return t&(G|K)&&(n=k(n.concat(r),`identifier`,!0)),[n,r]}var je={touchstart:U,touchmove:W,touchend:G,touchcancel:K},Me=`touchstart touchmove touchend touchcancel`;function Ne(){this.evTarget=Me,this.targetIds={},re.apply(this,arguments)}v(Ne,re,{handler:function(e){var t=je[e.type],n=Pe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:R,srcEvent:e})}});function Pe(e,t){var n=O(e.touches),r=this.targetIds;if(t&(U|W)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=O(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return w(e.target,c)}),t===U)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&(G|K)&&delete r[o[i].identifier],i++;if(s.length)return[k(a.concat(s),`identifier`,!0),s]}var Fe=2500,Ie=25;function Le(){re.apply(this,arguments);var e=y(this.handler,this);this.touch=new Ne(this.manager,e),this.mouse=new be(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}v(Le,re,{handler:function(e,t,n){var r=n.pointerType==R,i=n.pointerType==B;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)Re.call(this,t,n);else if(i&&Be.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Re(e,t){e&U?(this.primaryTouch=t.changedPointers[0].identifier,ze.call(this,t)):e&(G|K)&&ze.call(this,t)}function ze(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Fe)}}function Be(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Ie&&o<=Ie)return!0}return!1}var Ve=A(o.style,`touchAction`),He=Ve!==i,Ue=`compute`,We=`auto`,Ge=`manipulation`,Ke=`none`,qe=`pan-x`,Je=`pan-y`,Ye=Qe();function Xe(e,t){this.manager=e,this.set(t)}Xe.prototype={set:function(e){e==Ue&&(e=this.compute()),He&&this.manager.element.style&&Ye[e]&&(this.manager.element.style[Ve]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Ze(e.join(` `))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=T(r,Ke)&&!Ye[Ke],a=T(r,Je)&&!Ye[Je],o=T(r,qe)&&!Ye[qe];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&Q||o&&n&$))return this.preventSrc(t)},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};function Ze(e){if(T(e,Ke))return Ke;var t=T(e,qe),n=T(e,Je);return t&&n?Ke:t||n?t?qe:Je:T(e,Ge)?Ge:We}function Qe(){if(!He)return!1;var t={},n=e.CSS&&e.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(r){t[r]=!n||e.CSS.supports(`touch-action`,r)}),t}var $e=1,et=2,tt=4,nt=8,rt=nt,it=16,at=32;function ot(e){this.options=h({},this.defaults,e||{}),this.id=M(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=$e,this.simultaneous={},this.requireFail=[]}ot.prototype={defaults:{},set:function(e){return h(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=lt(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,`dropRecognizeWith`,this)?this:(e=lt(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(f(e,`requireFailure`,this))return this;var t=this.requireFail;return e=lt(e,this),D(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,`dropRequireFailure`,this))return this;e=lt(e,this);var t=D(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<nt&&r(t.options.event+st(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=nt&&r(t.options.event+st(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=at},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(at|$e)))return!1;e++}return!0},recognize:function(e){var t=h({},e);if(!b(this.options.enable,[this,t])){this.reset(),this.state=at;return}this.state&(rt|it|at)&&(this.state=$e),this.state=this.process(t),this.state&(et|tt|nt|it)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}};function st(e){return e&it?`cancel`:e&nt?`end`:e&tt?`move`:e&et?`start`:``}function ct(e){return e==Z?`down`:e==X?`up`:e==J?`left`:e==Y?`right`:``}function lt(e,t){var n=t.manager;return n?n.get(e):e}function ut(){ot.apply(this,arguments)}v(ut,ot,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(et|tt),i=this.attrTest(e);return r&&(n&K||!i)?t|it:r||i?n&G?t|nt:t&et?t|tt:et:at}});function dt(){ut.apply(this,arguments),this.pX=null,this.pY=null}v(dt,ut,{defaults:{event:`pan`,threshold:10,pointers:1,direction:ee},getTouchAction:function(){var e=this.options.direction,t=[];return e&Q&&t.push(Je),e&$&&t.push(qe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&Q?(i=a===0?q:a<0?J:Y,n=a!=this.pX,r=Math.abs(e.deltaX)):(i=o===0?q:o<0?X:Z,n=o!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return ut.prototype.attrTest.call(this,e)&&(this.state&et||!(this.state&et)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ct(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}});function ft(){ut.apply(this,arguments)}v(ft,ut,{defaults:{event:`pinch`,threshold:0,pointers:2},getTouchAction:function(){return[Ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&et)},emit:function(e){if(e.scale!==1){var t=e.scale<1?`in`:`out`;e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}});function pt(){ot.apply(this,arguments),this._timer=null,this._input=null}v(pt,ot,{defaults:{event:`press`,pointers:1,time:251,threshold:9},getTouchAction:function(){return[We]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(G|K)&&!i)this.reset();else if(e.eventType&U)this.reset(),this._timer=d(function(){this.state=rt,this.tryEmit()},t.time,this);else if(e.eventType&G)return rt;return at},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===rt&&(e&&e.eventType&G?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function mt(){ut.apply(this,arguments)}v(mt,ut,{defaults:{event:`rotate`,threshold:0,pointers:2},getTouchAction:function(){return[Ke]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&et)}});function ht(){ut.apply(this,arguments)}v(ht,ut,{defaults:{event:`swipe`,threshold:10,velocity:.3,direction:Q|$,pointers:1},getTouchAction:function(){return dt.prototype.getTouchAction.call(this)},attrTest:function(e){var t=this.options.direction,n;return t&(Q|$)?n=e.overallVelocity:t&Q?n=e.overallVelocityX:t&$&&(n=e.overallVelocityY),this._super.attrTest.call(this,e)&&t&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&l(n)>this.options.velocity&&e.eventType&G},emit:function(e){var t=ct(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}});function gt(){ot.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(gt,ot,{defaults:{event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ge]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&U&&this.count===0)return this.failTimeout();if(r&&i&&n){if(e.eventType!=G)return this.failTimeout();var a=!this.pTime||e.timeStamp-this.pTime<t.interval,o=!this.pCenter||pe(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!o||!a?this.count=1:this.count+=1,this._input=e,this.count%t.taps===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=rt,this.tryEmit()},t.interval,this),et):rt}return at},failTimeout:function(){return this._timer=d(function(){this.state=at},this.options.interval,this),at},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function _t(e,t){return t=t||{},t.recognizers=x(t.recognizers,_t.defaults.preset),new bt(e,t)}_t.VERSION=`2.0.7`,_t.defaults={domEvents:!1,touchAction:Ue,enable:!0,inputTarget:null,inputClass:null,preset:[[mt,{enable:!1}],[ft,{enable:!1},[`rotate`]],[ht,{direction:Q}],[dt,{direction:Q},[`swipe`]],[gt],[gt,{event:`doubletap`,taps:2},[`tap`]],[pt]],cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}};var vt=1,yt=2;function bt(e,t){this.options=h({},_t.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ie(this),this.touchAction=new Xe(this,this.options.touchAction),xt(this,!0),p(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}bt.prototype={set:function(e){return h(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?yt:vt},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&rt)&&(i=t.curRecognizer=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==yt&&(!i||n==i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(et|tt|nt)&&(i=t.curRecognizer=n),a++}},get:function(e){if(e instanceof ot)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,`remove`,this))return this;if(e=this.get(e),e){var t=this.recognizers,n=D(t,e);n!==-1&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return p(E(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(E(e),function(e){t?n[e]&&n[e].splice(D(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&St(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&xt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function xt(e,t){var n=e.element;if(n.style){var r;p(e.options.cssProps,function(i,a){r=A(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function St(e,t){var r=n.createEvent(`Event`);r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}h(_t,{INPUT_START:U,INPUT_MOVE:W,INPUT_END:G,INPUT_CANCEL:K,STATE_POSSIBLE:$e,STATE_BEGAN:et,STATE_CHANGED:tt,STATE_ENDED:nt,STATE_RECOGNIZED:rt,STATE_CANCELLED:it,STATE_FAILED:at,DIRECTION_NONE:q,DIRECTION_LEFT:J,DIRECTION_RIGHT:Y,DIRECTION_UP:X,DIRECTION_DOWN:Z,DIRECTION_HORIZONTAL:Q,DIRECTION_VERTICAL:$,DIRECTION_ALL:ee,Manager:bt,In
85put:re,TouchAction:Xe,TouchInput:Ne,MouseInput:be,PointerEventInput:Te,TouchMouseInput:Le,SingleTouchInput:ke,Recognizer:ot,AttrRecognizer:ut,Tap:gt,Pan:dt,Swipe:ht,Pinch:ft,Rotate:mt,Press:pt,on:S,off:C,each:p,merge:_,extend:g,assign:h,inherit:v,bindFn:y,prefixed:A});var Ct=e===void 0?typeof self<`u`?self:{}:e;Ct.Hammer=_t,typeof define==`function`&&define.amd?define(function(){return _t}):t!==void 0&&t.exports?t.exports=_t:e[r]=_t})(window,document,`Hammer`)}))(),1);function te(e,t){let n=_(!1),r=_(),i=()=>t.spine.position,a=n=>{var r;if(n.preventDefault(),!e.value)return;let a=g()?n.deltaY/-480:n.deltaY*-.001;if(!t.spine)return;let{scale:o}=i();o+a<=0||(r=t.spine)==null||r.scale(o+a)},o;return m(()=>{e.value&&(o=new ee.default(e.value),o.get(`pinch`).set({enable:!0}),o.on(`panstart`,()=>{if(!t.spine)return;let{x:e,y:n}=i();r.value={x:e,y:n}}),o.on(`panmove`,e=>{if(!t.spine)return;let{scale:a}=i(),{x:o,y:s}=r.value,c=(n.value?1:10/3)/a;t.spine.move(o-e.deltaX*c,s+e.deltaY*c)}),o.on(`panend`,()=>{r.value=void 0}),e.value.addEventListener(`wheel`,a))}),c(()=>{var t;o==null||o.destroy(),(t=e.value)==null||t.removeEventListener(`wheel`,a)}),{big:n}}var ne={class:`h-[400px] w-[330px] flex flex-col justify-around pr-4 space-y-2`},re={class:`flex`},ie={class:`flex justify-around`},ae={key:0},oe={key:1},se={style:{backgroundImage:`linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #ccc 75%),linear-gradient(135deg, transparent 75%, #ccc 75%)`,backgroundSize:`24px 24px`,backgroundPosition:`0 0, 12px 0, 12px -12px, 0px 12px`}},ce={key:0,class:`absolute bottom-0 left-0 right-0 top-0 h-full flex items-center justify-center`,style:{backgroundColor:`rgba(0,0,0,0.4)`}},le={class:`rounded bg-white p-4`},ue=d({__name:`Spine`,props:{prefix:{},name:{},skin:{}},setup(e){let t=e,n=_(),i={},c=_(!0),l=_(1),d=Object.keys(t.skin),f=d.map(e=>({label:e,value:e})),h=_(d[0]),g=a(()=>Object.keys(t.skin[h.value]).map(e=>({label:e,value:e}))),y=_(Object.keys(t.skin[d[0]])[0]),S=_([]),E=a(()=>S.value.map(e=>({label:e,value:e}))),M=_([]),V=_(``),K=_(!1);async function q(){c.value=!0;let e=t.prefix+t.skin[h.value][y.value].file,{skeleton:n,state:r}=await i.spine.load(`${h.value}-${y.value}`,`${e}.skel`,`${e}.atlas`,{x:-500,y:-200,scale:1},t.skin[h.value][y.value].skin),a=S.value=n.data.animations.map(e=>e.name);M.value=n.data.animations.map(e=>({name:e.name,duration:e.duration})),c.value=!1,i.spine.play(`${h.value}-${y.value}`),i.spine.setAnimation(a[0],K.value),V.value=a[0],r.timeScale=l.value}m(()=>{console.warn(`canvas`,n.value),n.value&&(i.spine=new Q(n.value),q())});let{big:Y}=te(n,i);function X(e){h.value=e,y.value=Object.keys(t.skin[e])[0],q()}function Z(e){y.value=e,q()}function $(e){var t;let n=(t=i.spine)==null?void 0:t.getCurrent();n&&(console.log(`ani change`,n),i.spine.setAnimation(e,K.value),n.state.timeScale=l.value)}function ee(e){var t;(t=i.spine)!=null&&t.getCurrent()&&i.spine.setAnimation(V.value,e)}function ue(e){if(!i.spine)return;let t=Number.parseInt(e.slice(1),16);i.spine.bg=[(t>>>24)/255,((t&16711680)>>>16)/255,((t&65280)>>>8)/255,(t&255)/255]}function de(e){var t;let n=(t=i.spine)==null||(t=t.getCurrent())==null?void 0:t.state;n&&(n.timeScale=e)}function fe(){var e;(e=i.spine)==null||e.transform(-500,-200,1)}let pe=window.MediaRecorder&&MediaRecorder.isTypeSupported(`video/webm`)&&!A(),me=_(!1);async function he(){i.spine&&!me.value&&(me.value=!0,await i.spine.record(V.value,`${t.name}-${h.value}-${y.value}-${V.value}-x${l.value}`),me.value=!1)}return(t,i)=>(u(),p(w,{style:b({width:T(A)()?``:`fit-content`}),class:`relative bg-white`},{default:k(()=>[j(`div`,{class:C([{"pr-5":!T(A)()},`m-5 flex flex-wrap justify-around`])},[j(`div`,ne,[x(O,{label:`时装组`},{default:k(()=>[x(T(z),{value:h.value,"onUpdate:value":[i[0]||(i[0]=e=>h.value=e),X],options:T(f)},null,8,[`value`,`options`])]),_:1}),x(O,{label:`模型组`},{default:k(()=>[x(T(z),{value:y.value,"onUpdate:value":[i[1]||(i[1]=e=>y.value=e),Z],options:g.value},null,8,[`value`,`options`])]),_:1}),x(O,{label:`动画`},{default:k(()=>[x(T(z),{value:V.value,"onUpdate:value":[i[2]||(i[2]=e=>V.value=e),$],options:E.value},null,8,[`value`,`options`])]),_:1}),j(`div`,re,[x(O,{label:`循环播放`,class:`mr-2`},{default:k(()=>[j(`div`,null,[x(T(H),{value:K.value,"onUpdate:value":[i[3]||(i[3]=e=>K.value=e),ee],size:`small`},null,8,[`value`])])]),_:1}),x(O,{label:`背景颜色`,class:`flex-grow`},{default:k(()=>[x(T(G),{size:`small`,"default-value":`#00000000`,swatches:[`#00000000`,`#FFFFFFFF`,`#DBDBDBFF`,`#2F2F2FFF`,`#000000FF`,`#FF0000FF`,`#00FF00FF`,`#0000FFFF`],"show-preview":!0,"onUpdate:value":ue})]),_:1})]),x(O,{"label-placement":`left`,label:`播放速度`},{default:k(()=>[x(T(U),{value:l.value,"onUpdate:value":[i[4]||(i[4]=e=>l.value=e),de],min:.1,max:2,step:.1,marks:{.1:`x0.1`,.5:`x0.5`,1:`x1.0`,1.5:`x1.5`,2:`x2.0`},"format-tooltip":e=>`x${e.toFixed(1)}`},null,8,[`value`,`format-tooltip`])]),_:1}),j(`div`,ie,[T(pe)?(u(),p(T(R),{key:0},{trigger:k(()=>[x(T(D),{circle:``,size:`large`,onClick:he},{icon:k(()=>[x(T(B),{size:28},{default:k(()=>[x(T(N))]),_:1})]),_:1})]),default:k(()=>
85[i[6]||(i[6]=r(` 实验性WEBM导出 `,-1))]),_:1})):s(``,!0),T(pe)?(u(),p(T(R),{key:1},{trigger:k(()=>[x(T(D),{circle:``,size:`large`,onClick:fe},{icon:k(()=>[x(T(B),{size:28},{default:k(()=>[x(T(I))]),_:1})]),_:1})]),default:k(()=>[i[7]||(i[7]=r(` 重置模型中心 `,-1))]),_:1})):s(``,!0),T(pe)?(u(),p(T(R),{key:2},{trigger:k(()=>[x(T(D),{circle:``,size:`large`,onClick:i[5]||(i[5]=()=>{Y.value=!T(Y)})},{icon:k(()=>[x(T(B),{size:28},{default:k(()=>[T(Y)?(u(),p(T(P),{key:0})):(u(),p(T(L),{key:1}))]),_:1})]),_:1})]),default:k(()=>[T(Y)?(u(),o(`span`,ae,`小屏查看`)):(u(),o(`span`,oe,`大屏查看`))]),_:1})):s(``,!0),x(T(R),{trigger:`hover`},{trigger:k(()=>[x(T(D),{circle:``,size:`large`},{icon:k(()=>[x(T(B),{size:28},{default:k(()=>[x(T(F))]),_:1})]),_:1})]),default:k(()=>[i[8]||(i[8]=j(`b`,null,`模型动画数据`,-1)),x(J,{details:M.value},null,8,[`details`])]),_:1})])]),j(`div`,{class:`relative overflow-hidden`,style:b({width:T(Y)?`1000px`:`300px`,height:T(Y)?`1000px`:`300px`})},[c.value?(u(),p(T(W),{key:0,class:`absolute right-0 top-0 h-full w-full`})):s(``,!0),j(`div`,se,[j(`div`,{style:b({width:1e3,height:1e3,transformOrigin:`top left`,transform:T(Y)?``:`scale(0.3,0.3)`,display:c.value?`none`:`block`})},[j(`canvas`,{ref_key:`canvas`,ref:n,width:`1000`,height:`1000`},null,512)],4)])],4)],2),me.value?(u(),o(`div`,ce,[j(`div`,le,` 正在导出 `+v(e.name)+`-`+v(h.value)+`-`+v(y.value)+`-`+v(V.value)+`-x`+v(l.value)+`.webm `,1)])):s(``,!0)]),_:1},8,[`style`]))}}),de=S(d({__name:`Wrapper`,props:{conf:{},id:{}},setup(e){let t=e,a=_(!1),{theme:o,themeOverrides:s,isDark:c}=f({common:{primaryColor:`#6a6aff`}}),l=_();l.value=t.conf,n(t,()=>{l.value=t.conf});async function d(){if(t.id){let e=await fetch(`${i}/assets/char_spine/${t.id}/meta.json`);l.value=await e.json()}a.value=!0}return(e,t)=>(u(),p(T(V),{"preflight-style-disabled":``,breakpoints:{s:640,m:768,lg:1024,xl:1280,xxl:1536},theme:T(o),"theme-overrides":T(s),locale:T(h)},{default:k(()=>[j(`div`,{class:C([`spine-viewer-widget`,T(c)&&`prts-widget-dark`])},[a.value?(u(),p(ue,{key:0,prefix:l.value.prefix,name:l.value.name,skin:l.value.skin},null,8,[`prefix`,`name`,`skin`])):(u(),p(T(D),{key:1,type:`info`,onClick:d},{default:k(()=>[...t[0]||(t[0]=[r(` 点此载入模型 `,-1)])]),_:1}))],2)]),_:1},8,[`theme`,`theme-overrides`,`locale`]))}}),[[`__scopeId`,`data-v-0b01a843`]]);window.SpineApi=Q,window.dispatchEvent(new Event(`spine_api_ready`));function fe(){let e=document.querySelector(`#spine-root`),t=null;e!=null&&e.dataset.id||(t=JSON.parse(document.querySelector(`#SPINEDATA`).innerHTML),t.prefix=t.prefix.replace(`https://static.prts.wiki/spine/`,`https://static.prts.wiki/spine38/`)),e?E(de,{conf:t,id:e==null?void 0:e.dataset.id}).mount(e):console.error(`SPINEDATA or ele not found`,e)}fe();
86//# sourceMappingURL=https://static.prts.wiki/widgets/production/SpineViewer.iuSD1U9d.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.