From 04fc964048e6601452e373b13e64bf0f097f0cac Mon Sep 17 00:00:00 2001 From: Ed Preston Date: Fri, 15 Sep 2023 11:38:32 +1000 Subject: [PATCH] Update Prebuilt Modules --- build/playcanvas-spine.3.6.js | 45 ++++++++++++++++++------------- build/playcanvas-spine.3.6.min.js | 2 +- build/playcanvas-spine.3.8.js | 45 ++++++++++++++++++------------- build/playcanvas-spine.3.8.min.js | 2 +- build/playcanvas-spine.4.0.js | 44 +++++++++++++++++------------- build/playcanvas-spine.4.0.min.js | 2 +- build/playcanvas-spine.4.1.js | 45 ++++++++++++++++++------------- build/playcanvas-spine.4.1.min.js | 2 +- 8 files changed, 107 insertions(+), 80 deletions(-) diff --git a/build/playcanvas-spine.3.6.js b/build/playcanvas-spine.3.6.js index bcaf26b..7a1ce94 100644 --- a/build/playcanvas-spine.3.6.js +++ b/build/playcanvas-spine.3.6.js @@ -8797,6 +8797,7 @@ var spine = (function (pc) { this.skeletonVersion = semver.valid(semver.coerce(_skeletonData.version)); this._spine_3_6_0 = semver.satisfies(this.skeletonVersion, '<=3.6.0'); this._spine_3_7_99 = semver.satisfies(this.skeletonVersion, '<=3.7.99'); + this._spine_4_0_X = semver.satisfies(this.skeletonVersion, '~4.0.0'); this._spine_4_1_X = semver.satisfies(this.skeletonVersion, '~4.1.23'); this.skeleton = new spine$1.Skeleton(_skeletonData); this.skeleton.updateWorldTransform(); @@ -8935,26 +8936,32 @@ var spine = (function (pc) { } else if (attachment instanceof spine$1.MeshAttachment) { slot._active.type = ATTACHMENT_TYPE.MESH; } - if (attachment.region && attachment.region.texture) { - var texture = attachment.region.texture.pcTexture; - if (texture) { - if (texture instanceof pc__namespace.StandardMaterial) { - this._materials[texture.name] = texture; - slot.material = texture.name; - } else { - var key = null; - if (texture.name) { - key = texture.name; - } else if (texture.getSource() instanceof Image) { - key = texture.getSource().getAttribute('src'); - } - if (key) { - if (this._materials[key] === undefined) { - var material = this.createMaterial(texture); - this._materials[key] = material; - } - slot.material = key; + var texture = null; + if (attachment.region) { + if (attachment.region.texture) { + texture = attachment.region.texture.pcTexture; + } + if (attachment.region.page && attachment.region.page.texture) { + texture = attachment.region.page.texture.pcTexture; + } + } + if (texture) { + if (texture instanceof pc__namespace.StandardMaterial) { + this._materials[texture.name] = texture; + slot.material = texture.name; + } else { + var key = null; + if (texture.name) { + key = texture.name; + } else if (texture.getSource() instanceof Image) { + key = texture.getSource().getAttribute('src'); + } + if (key) { + if (this._materials[key] === undefined) { + var material = this.createMaterial(texture); + this._materials[key] = material; } + slot.material = key; } } } diff --git a/build/playcanvas-spine.3.6.min.js b/build/playcanvas-spine.3.6.min.js index 12b01fa..accdf90 100644 --- a/build/playcanvas-spine.3.6.min.js +++ b/build/playcanvas-spine.3.6.min.js @@ -1 +1 @@ -var spine=function(t){"use strict";function e(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n,r,i,a=e(t),o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});function s(){s=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",h=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new N(r||[]);return i(o,"_invoke",{value:b(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",d="suspendedYield",m="executing",v="completed",g={};function y(){}function E(){}function w(){}var x={};u(x,o,(function(){return this}));var A=Object.getPrototypeOf,T=A&&A(A(_([])));T&&T!==n&&r.call(T,o)&&(x=T);var M=w.prototype=y.prototype=Object.create(x);function R(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function n(i,a,o,s){var h=f(t[i],t,a);if("throw"!==h.type){var l=h.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,s)}))}s(h.arg)}var a;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return a=a?a.then(i,i):i()}})}function b(e,n,r){var i=p;return function(a,o){if(i===m)throw new Error("Generator is already running");if(i===v){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var h=S(s,r);if(h){if(h===g)continue;return h}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var l=f(e,n,r);if("normal"===l.type){if(i=r.done?v:d,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=v,r.method="throw",r.arg=l.arg)}}}function S(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=f(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function _(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var h=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(h&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function M(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,i=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.duration=n}return t.prototype.apply=function(t,e,n,r,i,a,o,s){if(null==t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(a+1)*n]<=e?r=a+1:i=a,r==i)return(r+1)*n;a=r+i>>>1}},t.linearSearch=function(t,e,n){for(var r=0,i=t.length-n;r<=i;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=i,function(t){t[t.setup=0]="setup",t[t.current=1]="current",t[t.currentLayered=2]="currentLayered"}(e=t.MixPose||(t.MixPose={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(r=t.TimelineType||(t.TimelineType={}));var a=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,i,a){var o=.03*(2*-n+i),s=.03*(2*-r+a),h=.006*(3*(n-i)+1),l=.006*(3*(r-a)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,p=.3*r+s+.16666667*l,d=t*e.BEZIER_SIZE,m=this.curves;m[d++]=e.BEZIER;for(var v=f,g=p,y=d+e.BEZIER_SIZE-1;d=r){var u=void 0,c=void 0;return a==h?(u=0,c=0):(u=i[a-2],c=i[a-1]),c+(i[a+1]-c)*(r-u)/(s-u)}var f=i[a-1];return f+(1-f)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var s=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])if(h==e.setup)c.rotation=c.data.rotation+u[u.length+a.PREV_ROTATION]*s;else{var p=c.data.rotation+u[u.length+a.PREV_ROTATION]-c.rotation;p-=360*(16384-(16384.499999999996-p/360|0)),c.rotation+=p*s}else{var d=i.binarySearch(u,r,a.ENTRIES),m=u[d+a.PREV_ROTATION],v=u[d],g=this.getCurvePercent((d>>1)-1,1-(r-v)/(u[d+a.PREV_TIME]-v)),y=u[d+a.ROTATION]-m;y=m+(y-=360*(16384-(16384.499999999996-y/360|0)))*g,h==e.setup?(y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation=c.data.rotation+y*s):(y=c.data.rotation+y-c.rotation,y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation+=y*s)}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=s;var h=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=n,this.frames[t+a.Y]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],p=u[u.length+a.PREV_Y];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_X],p=u[d+a.PREV_Y];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.X]-f)*v,p+=(u[d+a.Y]-p)*v}h==e.setup?(c.x=c.data.x+f*s,c.y=c.data.y+p*s):(c.x+=(c.data.x+f-c.x)*s,c.y+=(c.data.y+p-c.y)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function s(t){return a.call(this,t)||this}return o(s,a),s.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},s.prototype.apply=function(r,a,o,h,l,u,c){var f=this.frames,p=r.bones[this.boneIndex];if(o=f[f.length-s.ENTRIES])d=f[f.length+s.PREV_X]*p.data.scaleX,m=f[f.length+s.PREV_Y]*p.data.scaleY;else{var v=i.binarySearch(f,o,s.ENTRIES);d=f[v+s.PREV_X],m=f[v+s.PREV_Y];var g=f[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(o-g)/(f[v+s.PREV_TIME]-g));d=(d+(f[v+s.X]-d)*y)*p.data.scaleX,m=(m+(f[v+s.Y]-m)*y)*p.data.scaleY}if(1==l)p.scaleX=d,p.scaleY=m;else{var E=0,w=0;u==e.setup?(E=p.data.scaleX,w=p.data.scaleY):(E=p.scaleX,w=p.scaleY),c==n.out?(d=Math.abs(d)*t.MathUtils.signum(E),m=Math.abs(m)*t.MathUtils.signum(w)):(E=Math.abs(E)*t.MathUtils.signum(d),w=Math.abs(w)*t.MathUtils.signum(m)),p.scaleX=E+(d-E)*l,p.scaleY=w+(m-w)*l}}},s}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],p=u[u.length+n.PREV_Y];else{var d=i.binarySearch(u,a,n.ENTRIES);f=u[d+n.PREV_X],p=u[d+n.PREV_Y];var m=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(a-m)/(u[d+n.PREV_TIME]-m));f+=(u[d+n.X]-f)*v,p+=(u[d+n.Y]-p)*v}h==e.setup?(c.shearX=c.data.shearX+f*s,c.shearY=c.data.shearY+p*s):(c.shearX+=(c.data.shearX+f-c.shearX)*s,c.shearY+=(c.data.shearY+p-c.shearY)*s)}},n}(h);t.ShearTimeline=u;var c=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var y=c.length;d=c[y+a.PREV_R],m=c[y+a.PREV_G],v=c[y+a.PREV_B],g=c[y+a.PREV_A]}else{var E=i.binarySearch(c,r,a.ENTRIES);d=c[E+a.PREV_R],m=c[E+a.PREV_G],v=c[E+a.PREV_B],g=c[E+a.PREV_A];var w=c[E],x=this.getCurvePercent(E/a.ENTRIES-1,1-(r-w)/(c[E+a.PREV_TIME]-w));d+=(c[E+a.R]-d)*x,m+=(c[E+a.G]-m)*x,v+=(c[E+a.B]-v)*x,g+=(c[E+a.A]-g)*x}if(1==s)u.color.set(d,m,v,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((d-f.r)*s,(m-f.g)*s,(v-f.b)*s,(g-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);t.ColorTimeline=c;var f=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o,s,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o,this.frames[t+a.R2]=s,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var T=c.length;v=c[T+a.PREV_R],g=c[T+a.PREV_G],y=c[T+a.PREV_B],E=c[T+a.PREV_A],w=c[T+a.PREV_R2],x=c[T+a.PREV_G2],A=c[T+a.PREV_B2]}else{var M=i.binarySearch(c,r,a.ENTRIES);v=c[M+a.PREV_R],g=c[M+a.PREV_G],y=c[M+a.PREV_B],E=c[M+a.PREV_A],w=c[M+a.PREV_R2],x=c[M+a.PREV_G2],A=c[M+a.PREV_B2];var R=c[M],I=this.getCurvePercent(M/a.ENTRIES-1,1-(r-R)/(c[M+a.PREV_TIME]-R));v+=(c[M+a.R]-v)*I,g+=(c[M+a.G]-g)*I,y+=(c[M+a.B]-y)*I,E+=(c[M+a.A]-E)*I,w+=(c[M+a.R2]-w)*I,x+=(c[M+a.G2]-x)*I,A+=(c[M+a.B2]-A)*I}if(1==s)u.color.set(v,g,y,E),u.darkColor.set(w,x,A,1);else{f=u.color,p=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),p.setFromColor(u.data.darkColor)),f.add((v-f.r)*s,(g-f.g)*s,(y-f.b)*s,(E-f.a)*s),p.add((w-p.r)*s,(x-p.g)*s,(A-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);t.TwoColorTimeline=f;var p=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return a.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},a.prototype.apply=function(t,r,a,o,s,h,l){var u=t.slots[this.slotIndex];if(l!=n.out||h!=e.setup){var c=this.frames;if(a=c[c.length-1]?c.length-1:i.binarySearch(c,a,1)-1;var d=this.attachmentNames[p];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var m=u.data.attachmentName;u.setAttachment(null==m?null:t.getAttachment(this.slotIndex,m))}},a}();t.AttachmentTimeline=p;var d=null,m=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==d&&(d=t.Utils.newFloatArray(64)),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},a.prototype.apply=function(n,r,a,o,s,h,l){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(s=1);var p=this.frameVertices,d=p[0].length,m=this.frames;if(a=m[m.length-1]){var x=p[m.length-1];if(1==s)t.Utils.arrayCopy(x,0,w,0,d);else if(h==e.setup){if(null==(v=c).bones)for(var A=v.vertices,T=0;Tn)this.apply(t,e,Number.MAX_VALUE,r,a,o,s),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=v;var g=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return a.prototype.getPropertyId=function(){return r.drawOrder<<24},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},a.prototype.apply=function(r,a,o,s,h,l,u){var c=r.drawOrder,f=r.slots;if(u!=n.out||l!=e.setup){var p=this.frames;if(o=p[p.length-1]?p.length-1:i.binarySearch(p,o)-1;var m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var v=0,g=m.length;v=c[c.length-s.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+s.PREV_MIX]-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[c.length+s.PREV_BEND_DIRECTION]):(f.mix+=(c[c.length+s.PREV_MIX]-f.mix)*h,u==n.in&&(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION]));else{var p=i.binarySearch(c,a,s.ENTRIES),d=c[p+s.PREV_MIX],m=c[p],v=this.getCurvePercent(p/s.ENTRIES-1,1-(a-m)/(c[p+s.PREV_TIME]-m));l==e.setup?(f.mix=f.data.mix+(d+(c[p+s.MIX]-d)*v-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[p+s.PREV_BEND_DIRECTION]):(f.mix+=(d+(c[p+s.MIX]-d)*v-f.mix)*h,u==n.in&&(f.bendDirection=c[p+s.PREV_BEND_DIRECTION]))}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_MIX=-2,s.PREV_BEND_DIRECTION=-1,s.MIX=1,s.BEND_DIRECTION=2,s}(a);t.IkConstraintTimeline=y;var E=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r,this.frames[t+a.SCALE]=i,this.frames[t+a.SHEAR]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(r=u[u.length-a.ENTRIES]){var g=u.length;p=u[g+a.PREV_ROTATE],d=u[g+a.PREV_TRANSLATE],m=u[g+a.PREV_SCALE],v=u[g+a.PREV_SHEAR]}else{var y=i.binarySearch(u,r,a.ENTRIES);p=u[y+a.PREV_ROTATE],d=u[y+a.PREV_TRANSLATE],m=u[y+a.PREV_SCALE],v=u[y+a.PREV_SHEAR];var E=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(r-E)/(u[y+a.PREV_TIME]-E));p+=(u[y+a.ROTATE]-p)*w,d+=(u[y+a.TRANSLATE]-d)*w,m+=(u[y+a.SCALE]-m)*w,v+=(u[y+a.SHEAR]-v)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(p-f.rotateMix)*s,c.translateMix=f.translateMix+(d-f.translateMix)*s,c.scaleMix=f.scaleMix+(m-f.scaleMix)*s,c.shearMix=f.shearMix+(v-f.shearMix)*s}else c.rotateMix+=(p-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(v-c.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);t.TransformConstraintTimeline=E;var w=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var p=i.binarySearch(u,r,a.ENTRIES);f=u[p+a.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/a.ENTRIES-1,1-(r-d)/(u[p+a.PREV_TIME]-d));f+=(u[p+a.VALUE]-f)*m}h==e.setup?c.position=c.data.position+(f-c.data.position)*s:c.position+=(f-c.position)*s}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var x=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var p=i.binarySearch(u,a,n.ENTRIES);f=u[p+n.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/n.ENTRIES-1,1-(a-d)/(u[p+n.PREV_TIME]-d));f+=(u[p+n.VALUE]-f)*m}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*s:c.spacing+=(f-c.spacing)*s}},n}(w);t.PathConstraintSpacingTimeline=x;var A=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],p=u[u.length+a.PREV_TRANSLATE];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_ROTATE],p=u[d+a.PREV_TRANSLATE];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.ROTATE]-f)*v,p+=(u[d+a.TRANSLATE]-p)*v}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(p-c.data.translateMix)*s):(c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(p-c.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);t.PathConstraintMixTimeline=A}(i||(i={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new i(this),this.propertyIDs=new t.IntSet,this.mixingTo=new Array,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool((function(){return new n})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}var o=i.next;if(null!=o){var s=i.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime=s+t*o.timeScale,i.trackTime+=a,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=a,o=o.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&null==i.mixingFrom){e[n]=null,this.queue.end(i),this.disposeNext(i);continue}if(null!=i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null;null!=h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&(t.mixTime>=t.mixDuration||0==t.timeScale)?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e*t.timeScale,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,i=this.tracks,a=!1,o=0,s=i.length;o0)){a=!0;var l=0==o?t.MixPose.current:t.MixPose.currentLayered,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),p=h.animation.timelines.length,d=h.animation.timelines;if(1==u)for(var m=0;m=e.FIRST?t.MixPose.setup:l;E instanceof t.RotateTimeline?this.applyRotateTimeline(E,n,f,u,w,y,m<<1,g):(t.Utils.webkit602BugfixHelper(u,w),E.apply(n,c,f,r,u,w,t.MixDirection.in))}}this.queueEvents(h,f),r.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}return this.queue.drain(),a},e.prototype.applyMixingFrom=function(n,r,i){var a=n.mixingFrom;null!=a.mixingFrom&&this.applyMixingFrom(a,r,i);var o=0;0==n.mixDuration?(o=1,i=t.MixPose.setup):(o=n.mixTime/n.mixDuration)>1&&(o=1);var s=o0&&this.queueEvents(a,c),this.events.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,r,i,a,o,s,h){if(h&&(o[s]=0),1!=i){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(r=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),d=u[p+t.RotateTimeline.PREV_ROTATION],m=u[p],v=l.getCurvePercent((p>>1)-1,1-(r-m)/(u[p+t.RotateTimeline.PREV_TIME]-m));f=u[p+t.RotateTimeline.ROTATION]-d,f=d+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var g=a==t.MixPose.setup?c.data.rotation:c.rotation,y=0,E=f-g;if(0==E)y=o[s];else{E-=360*(16384-(16384.499999999996-E/360|0));var w=0,x=0;h?(w=0,x=E):(w=o[s],x=o[s+1]);var A=E>0,T=w>=0;t.MathUtils.signum(x)!=t.MathUtils.signum(E)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=A),y=E+w-w%360,T!=A&&(y+=360*t.MathUtils.signum(w)),o[s]=y}o[s+1]=E,g+=y*i,c.rotation=g-360*(16384-(16384.499999999996-g/360|0))}}else e.apply(n,0,r,null,1,a,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,i=r-n,a=t.trackLast%i,o=this.events,s=0,h=o.length;sr||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=r&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,i=this.expandToIndex(t);null!=i&&(-1==i.nextTrackLast?(this.tracks[t]=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(t,e,n,i);return this.setCurrent(t,a,r),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,r){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(null!=i)for(;null!=i.next;)i=i.next;var a=this.trackEntry(t,e,n,i);if(null==i)this.setCurrent(t,a,!0),this.queue.drain();else if(i.next=a,r<=0){var o=i.animationEnd-i.animationStart;0!=o?(i.loop?r+=o*(1+(i.trackTime/o|0)):r+=o,r-=this.data.getMix(i.animation,e)):r=0}return a.delay=r,a},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var i=this.addAnimationWith(t,e.emptyAnimation,!1,r);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.DIP=2,e.DIP_MIX=3,e}();t.AnimationState=e;var n=function(){function n(){this.timelineData=new Array,this.timelineDipMix=new Array,this.timelinesRotation=new Array}return n.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.animation=null,this.listener=null,this.timelineData.length=0,this.timelineDipMix.length=0,this.timelinesRotation.length=0},n.prototype.setTimelineData=function(n,r,i){null!=n&&r.push(n);var a=null!=this.mixingFrom?this.mixingFrom.setTimelineData(this,r,i):this;null!=n&&r.pop();var o=r,s=r.length-1,h=this.animation.timelines,l=this.animation.timelines.length,u=t.Utils.setArraySize(this.timelineData,l);this.timelineDipMix.length=0;var c=t.Utils.setArraySize(this.timelineDipMix,l);t:for(var f=0;f=0;d--){var m=o[d];if(!m.hasTimeline(p)&&m.mixDuration>0){u[f]=e.DIP_MIX,c[f]=m;continue t}}u[f]=e.DIP}else u[f]=e.FIRST;else u[f]=e.SUBSEQUENT}return a},n.prototype.hasTimeline=function(t){for(var e=this.animation.timelines,n=0,r=e.length;n=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n}();t.TrackEntry=n;var r,i=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n=0?n.substring(0,n.lastIndexOf("/")):"";n=this.pathPrefix+n,this.toLoad++,e.downloadText(n,(function(e){var s={count:0},h=new Array;try{new t.TextureAtlas(e,(function(e){h.push(o+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)}))}catch(t){var l=t;return a.errors[n]="Couldn't load texture atlas "+n+": "+l.message,i&&i(n,"Couldn't load texture atlas "+n+": "+l.message),a.toLoad--,void a.loaded++}for(var u=function(l){var u=!1;a.loadTexture(l,(function(l,c){if(s.count++,s.count==h.length)if(u)a.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+l+" of atlas "+n),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(e,(function(t){return a.get(o+"/"+t)}));a.assets[n]=f,r&&r(n,f),a.toLoad--,a.loaded++}catch(t){var p=t;a.errors[n]="Couldn't load texture atlas "+n+": "+p.message,i&&i(n,"Couldn't load texture atlas "+n+": "+p.message),a.toLoad--,a.loaded++}}),(function(t,e){u=!0,s.count++,s.count==h.length&&(a.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+t+" of atlas "+n),a.toLoad--,a.loaded++)}))},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(i||(i={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");i.renderObject=i;var a=new t.RegionAttachment(n);return a.setRegion(i),a},e.prototype.newMeshAttachment=function(e,n,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");i.renderObject=i;var a=new t.MeshAttachment(n);return a.region=i,a},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(i||(i={})),function(t){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(i||(i={})),function(t){var e=function(){function e(t,e,n){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,r,i,a,o,s){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var h=this.parent;if(null==h){var l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a,d=this.skeleton;return d.flipX&&(e=-e,u=-u,c=-c),d.flipY&&(n=-n,f=-f,p=-p),this.a=u,this.b=c,this.c=f,this.d=p,this.worldX=e+d.x,void(this.worldY=n+d.y)}var m=h.a,v=h.b,g=h.c,y=h.d;switch(this.worldX=m*e+v*n+h.worldX,this.worldY=g*e+y*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a;return this.a=m*u+v*f,this.b=m*c+v*p,this.c=g*u+y*f,void(this.d=g*c+y*p);case t.TransformMode.OnlyTranslation:l=r+90+s;this.a=t.MathUtils.cosDeg(r+o)*i,this.b=t.MathUtils.cosDeg(l)*a,this.c=t.MathUtils.sinDeg(r+o)*i,this.d=t.MathUtils.sinDeg(l)*a;break;case t.TransformMode.NoRotationOrReflection:var E=0;(A=m*m+g*g)>1e-4?(v=g*(A=Math.abs(m*y-v*g)/A),y=m*A,E=Math.atan2(g,m)*t.MathUtils.radDeg):(m=0,g=0,E=90-Math.atan2(y,v)*t.MathUtils.radDeg);var w=r+o-E,x=r+s-E+90;u=t.MathUtils.cosDeg(w)*i,c=t.MathUtils.cosDeg(x)*a,f=t.MathUtils.sinDeg(w)*i,p=t.MathUtils.sinDeg(x)*a;this.a=m*u-v*f,this.b=m*c-v*p,this.c=g*u+y*f,this.d=g*c+y*p;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,T=t.MathUtils.cosDeg(r),M=t.MathUtils.sinDeg(r),R=m*T+v*M,I=g*T+y*M;(A=Math.sqrt(R*R+I*I))>1e-5&&(A=1/A),R*=A,I*=A,A=Math.sqrt(R*R+I*I);var b=Math.PI/2+Math.atan2(I,R),S=Math.cos(b)*A,P=Math.sin(b)*A;u=t.MathUtils.cosDeg(o)*i,c=t.MathUtils.cosDeg(90+s)*a,f=t.MathUtils.sinDeg(o)*i,p=t.MathUtils.sinDeg(90+s)*a;return(this.data.transformMode!=t.TransformMode.NoScaleOrReflection?m*y-v*g<0:this.skeleton.flipX!=this.skeleton.flipY)&&(S=-S,P=-P),this.a=R*u+S*f,this.b=R*c+S*p,this.c=I*u+P*f,void(this.d=I*c+P*p)}this.skeleton.flipX&&(this.a=-this.a,this.b=-this.b),this.skeleton.flipY&&(this.c=-this.c,this.d=-this.d)},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var n=e.a,r=e.b,i=e.c,a=e.d,o=1/(n*a-r*i),s=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=s*a*o-h*r*o,this.ay=h*n*o-s*i*o;var l=o*a,u=o*n,c=o*r,f=o*i,p=l*this.a-c*this.c,d=l*this.b-c*this.d,m=u*this.c-f*this.a,v=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(p*p+m*m),this.ascaleX>1e-4){var g=p*v-d*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(p*d+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,p)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,i=this.d,a=1/(e*i-n*r),o=t.x-this.worldX,s=t.y-this.worldY;return t.x=o*i*a-s*n*a,t.y=s*e*a-o*r*a,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*t.MathUtils.radDeg},e.prototype.localToWorldRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,i=this.c,a=this.d,o=t.MathUtils.cosDeg(e),s=t.MathUtils.sinDeg(e);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},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(t,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=t,this.name=n,this.parent=r};t.BoneData=n,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(i||(i={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(i||(i={})),function(t){var e=function(t){this.name=t};t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.mix=1,this.bendDirection=0,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=new Array;for(var n=0;n180?c-=360:c<-180&&(c+=360),e.updateWorldTransformWith(e.ax,e.ay,e.arotation+c*i,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,i,a,o){if(0!=o){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var s=e.ax,h=e.ay,l=e.ascaleX,u=e.ascaleY,c=n.ascaleX,f=0,p=0,d=0;l<0?(l=-l,f=180,d=-1):(f=0,d=1),u<0&&(u=-u,d=-d),c<0?(c=-c,p=180):p=0;var m=n.ax,v=0,g=0,y=0,E=e.a,w=e.b,x=e.c,A=e.d,T=Math.abs(l-u)<=1e-4;T?(g=E*m+w*(v=n.ay)+e.worldX,y=x*m+A*v+e.worldY):(v=0,g=E*m+e.worldX,y=x*m+e.worldY);var M=e.parent;E=M.a,w=M.b,x=M.c;var R=1/(E*(A=M.d)-w*x),I=r-M.worldX,b=i-M.worldY,S=(I*A-b*w)*R-s,P=(b*E-I*x)*R-h,C=((I=g-M.worldX)*A-(b=y-M.worldY)*w)*R-s,N=(b*E-I*x)*R-h,_=Math.sqrt(C*C+N*N),k=n.data.length*c,L=0,O=0;t:if(T){var V=(S*S+P*P-_*_-(k*=l)*k)/(2*_*k);V<-1?V=-1:V>1&&(V=1),O=Math.acos(V)*a,E=_+k*V,w=k*Math.sin(O),L=Math.atan2(P*E-S*w,S*E+P*w)}else{var D=(E=l*k)*E,F=(w=u*k)*w,X=S*S+P*P,U=Math.atan2(P,S),Y=-2*F*_,B=F-D;if((A=Y*Y-4*B*(x=F*_*_+D*X-D*F))>=0){var j=Math.sqrt(A);Y<0&&(j=-j);var W=(j=-(Y+j)/2)/B,G=x/j,q=Math.abs(W)=-1&&x<=1&&(x=Math.acos(x),(A=(I=E*Math.cos(x)+_)*I+(b=w*Math.sin(x))*b)K&&(J=x,K=A,Q=I,tt=b)),X<=(Z+K)/2?(L=U-Math.atan2($*a,H),O=z*a):(L=U-Math.atan2(tt*a,Q),O=J*a)}var et=Math.atan2(v,m)*d,nt=e.arotation;(L=(L-et)*t.MathUtils.radDeg+f-nt)>180?L-=360:L<-180&&(L+=360),e.updateWorldTransformWith(s,h,nt+L*o,e.ascaleX,e.ascaleY,0,0),nt=n.arotation,(O=((O+et)*t.MathUtils.radDeg-n.ashearX)*d+p-nt)>180?O-=360:O<-180&&(O+=360),n.updateWorldTransformWith(m,v,nt+O*o,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t};t.IkConstraintData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n0;if(i>0||a){var o=this.data,s=o.spacingMode,h=s==t.SpacingMode.Length,l=o.rotateMode,u=l==t.RotateMode.Tangent,c=l==t.RotateMode.ChainScale,f=this.bones.length,p=u?f:f+1,d=this.bones,m=t.Utils.setArraySize(this.spaces,p),v=null,g=this.spacing;if(c||h){c&&(v=t.Utils.setArraySize(this.lengths,f));for(var y=0,E=p-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=r,U=Math.cos(X),Y=Math.sin(X),C.a=U*O-Y*D,C.b=U*V-Y*F,C.c=Y*O+U*D,C.d=Y*V+U*F}C.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,i,a,o){var s=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*r+2),c=null,f=n.closed,p=n.worldVerticesLength,d=p/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[d-=f?1:2];if(a&&(h*=g),o)for(var y=0;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(s,p-6,4,c,0,2)),this.addAfterPosition(x-g,c,0,u,E);continue}}for(;;w++){var A=v[w];if(!(x>A)){if(0==w)x/=A;else x=(x-(Z=v[w-1]))/(A-Z);break}}w!=m&&(m=w,f&&w==d?(n.computeWorldVertices(s,p-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*w+2,8,c,0,2)),this.addCurvePosition(x,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,E,i||y>0&&0==G)}return u}f?(p+=2,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p-4,c,0,2),n.computeWorldVertices(s,0,2,c,p-4,2),c[p-2]=c[0],c[p-1]=c[1]):(d--,p-=4,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p,c,0,2));for(var T=t.Utils.setArraySize(this.curves,d),M=0,R=c[0],I=c[1],b=0,S=0,P=0,C=0,N=0,_=0,k=0,L=0,O=0,V=0,D=0,F=0,X=0,U=0,Y=(y=0,2);yM){this.addAfterPosition(x-M,c,p-4,u,E);continue}}for(;;w++){var q=T[w];if(!(x>q)){if(0==w)x/=q;else x=(x-(Z=T[w-1]))/(q-Z);break}}if(w!=m){m=w;var z=6*w;for(R=c[z],I=c[z+1],b=c[z+2],S=c[z+3],P=c[z+4],C=c[z+5],D=2*(k=.03*(R-2*b+P))+(O=.006*(3*(b-P)-R+(N=c[z+6]))),F=2*(L=.03*(I-2*S+C))+(V=.006*(3*(S-C)-I+(_=c[z+7]))),X=.3*(b-R)+k+.16666667*O,U=.3*(S-I)+L+.16666667*V,j=Math.sqrt(X*X+U*U),B[0]=j,z=1;z<8;z++)X+=D,U+=F,D+=O,F+=V,j+=Math.sqrt(X*X+U*U),B[z]=j;X+=D,U+=F,j+=Math.sqrt(X*X+U*U),B[8]=j,X+=D+O,U+=F+V,j+=Math.sqrt(X*X+U*U),B[9]=j,W=0}for(x*=j;;W++){var H=B[W];if(!(x>H)){var Z;if(0==W)x/=H;else x=W+(x-(Z=B[W-1]))/(H-Z);break}}this.addCurvePosition(.1*x,R,I,b,S,P,C,N,_,u,E,i||y>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,n,r,i){var a=e[n],o=e[n+1],s=e[n+2]-a,h=e[n+3]-o,l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,i){var a=e[n+2],o=e[n+3],s=a-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,i,a,o,s,h,l,u,c){(0==t||isNaN(t))&&(t=1e-4);var f=t*t,p=f*t,d=1-t,m=d*d,v=m*d,g=d*t,y=3*g,E=d*y,w=y*t,x=e*v+r*E+a*w+s*p,A=n*v+i*E+o*w+h*p;l[u]=x,l[u+1]=A,c&&(l[u+2]=Math.atan2(A-(n*m+i*g*2+o*f),x-(e*m+r*g*2+a*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e,n,r,i=function(t){this.order=0,this.bones=new Array,this.name=t};t.PathConstraintData=i,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(i||(i={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),n=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,n,r){var i=this.clientAssets[t];return null==i&&(i=new e(t),this.clientAssets[t]=i),null!==n&&(i.textureLoader=n),i.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var i=new Image;i.src=n,i.crossOrigin="anonymous",i.onload=function(t){r.rawAssets[n]=i},i.onerror=function(t){r.errors[n]="Couldn't load image "+n}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null==n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(i||(i={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.flipX=!1,this.flipY=!1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var n=0;n1){var i=n[n.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var n=e.target,r=n.data.index,i=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,i),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(var a=0,o=this.data.skins.length;a-1||this.updateCacheReset.push(i)}else for(r=0;r=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;if(t<=i&&n<=i||e<=a&&r<=a||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(i-t)+e;if(l>a&&la&&li&&ui&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,i=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[a]-u)=u&&E<=p||E>=p&&E<=u)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(l*g-h*m)/y;if((w>=c&&w<=d||w>=d&&w<=c)&&(w>=n&&w<=i||w>=i&&w<=n))return!0}u=p,c=d}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(i||(i={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(n,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var i=r.worldVerticesLength,a=t.Utils.setArraySize(this.clippingPolygon,i);r.computeWorldVertices(n,0,i,a,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=s.length;h>1,X=this.clipOutput,U=t.Utils.setArraySize(u,N+F*d),Y=0;Y<_;Y+=2){var B=X[Y],j=X[Y+1];U[N]=B,U[N+1]=j,U[N+2]=o.r,U[N+3]=o.g,U[N+4]=o.b,U[N+5]=o.a;var W=B-I,G=j-b,q=(k*W+L*G)*D,z=(V*W+O*G)*D,H=1-q-z;U[N+6]=w*q+M*z+S*H,U[N+7]=x*q+R*z+P*H,h&&(U[N+8]=s.r,U[N+9]=s.g,U[N+10]=s.b,U[N+11]=s.a),N+=d}N=c.length;var Z=t.Utils.setArraySize(c,N+3*(F-2));F--;for(Y=1;Y=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(i),u.push(a),u.push(t),u.push(e),s.length=0;for(var c=o,f=o.length-4,p=0;;p+=2){for(var d=c[p],m=c[p+1],v=c[p+2],g=c[p+3],y=d-v,E=m-g,w=u,x=u.length-2,A=s.length,T=0;T0;if(y*(R-g)-E*(M-v)>0){if(S){s.push(I),s.push(b);continue}var P=((N=I-M)*(m-R)-(C=b-R)*(d-M))/(C*(v-d)-N*(g-m));s.push(d+(v-d)*P),s.push(m+(g-m)*P)}else if(S){var C,N;P=((N=I-M)*(m-R)-(C=b-R)*(d-M))/(C*(v-d)-N*(g-m));s.push(d+(v-d)*P),s.push(m+(g-m)*P),s.push(I),s.push(b)}l=!0}if(A==s.length)return h.length=0,!0;if(s.push(s[0]),s.push(s[1]),p==f)break;var _=s;(s=u).length=0,u=_}if(h!=s){h.length=0;p=0;for(var k=s.length-2;p>1;s=0;f--)-1==W[f]&&(W[f]=q[--H])}w.setFrame(c++,j.time,W)}a.push(w),o=Math.max(o,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(i||(i={})),function(t){var e,n,r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var i=function(){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};t.TextureRegion=i;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(t.Texture);t.FakeTexture=a}(i||(i={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,a){if(null==a)throw new Error("textureLoader cannot be null.");for(var o=new n(e),s=new Array(4),h=null;;){var l=o.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new i;u.name=l,u.page=h,u.rotate="true"==o.readValue(),o.readTuple(s);var c=parseInt(s[0]),f=parseInt(s[1]);o.readTuple(s);var p=parseInt(s[0]),d=parseInt(s[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height):(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height),u.x=c,u.y=f,u.width=Math.abs(p),u.height=Math.abs(d),4==o.readTuple(s)&&4==o.readTuple(s)&&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=h.texture,this.regions.push(u)}else{(h=new r).name=l,2==o.readTuple(s)&&(h.width=parseInt(s[0]),h.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),h.minFilter=t.Texture.filterFromString(s[0]),h.magFilter=t.Texture.filterFromString(s[1]);var m=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==m?h.uWrap=t.TextureWrap.Repeat:"y"==m?h.vWrap=t.TextureWrap.Repeat:"xy"==m&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=a(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var r=0,i=n+1;r<3;r++){var a=e.indexOf(",",i);if(-1==a)break;t[r]=e.substr(i,a-i).trim(),i=a+1}return t[r]=e.substring(i).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=i}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var A=Math.cos(b),T=Math.sin(b);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var R=Math.sqrt(v.a*v.a+v.c*v.c),I=Math.sqrt(o*o+h*h);R>1e-5&&(R=(R+(I-R+this.data.offsetScaleX)*r)/R),v.a*=R,v.c*=R,R=Math.sqrt(v.b*v.b+v.d*v.d),I=Math.sqrt(s*s+l*l),R>1e-5&&(R=(R+(I-R+this.data.offsetScaleY)*r)/R),v.b*=R,v.d*=R,g=!0}if(i>0){E=v.b,x=v.d;var b,S=Math.atan2(x,E);(b=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b=S+(b+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(b)*R,v.d=Math.sin(b)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,i=this.shearMix,a=this.target,o=a.a,s=a.b,h=a.c,l=a.d,u=o*l-s*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I*=e;var A=Math.cos(I),T=Math.sin(I);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var R=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*r+1;v.a*=R,v.c*=R,R=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,v.b*=R,v.d*=R,g=!0}if(i>0){var I;(I=Math.atan2(l,s)-Math.atan2(h,o))>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2);E=v.b,x=v.d;I=Math.atan2(x,E)+(I-t.MathUtils.PI/2+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(I)*R,v.d=Math.sin(I)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=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;o0&&(p>1e-5&&(p=(p+(i.ascaleX-p+this.data.offsetScaleX)*n)/p),d>1e-5&&(d=(d+(i.ascaleY-d+this.data.offsetScaleY)*n)/d));var m=h.ashearY;if(r>0){u=i.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*r}h.updateWorldTransformWith(c,f,l,p,d,h.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=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;o0&&(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 d=h.ashearY;r>0&&(d+=(i.ashearY+this.data.offsetShearY)*r),h.updateWorldTransformWith(u,c,l,f,p,h.ashearX,d)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name cannot be null.");this.name=t};t.TransformConstraintData=e}(i||(i={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var n=t,r=t.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a3;){for(var l=r-1,u=(a=0,1);;){t:if(!o[a]){for(var c=i[l]<<1,f=i[a]<<1,p=i[u]<<1,d=n[c],m=n[c+1],v=n[f],g=n[f+1],y=n[p],E=n[p+1],w=(u+1)%r;w!=l;w=(w+1)%r)if(o[w]){var x=i[w]<<1,A=n[x],T=n[x+1];if(e.positiveArea(y,E,d,m,A,T)&&e.positiveArea(d,m,v,g,A,T)&&e.positiveArea(v,g,y,E,A,T))break t}break}if(0==u){do{if(!o[a])break;a--}while(a>0);break}l=a,a=u,u=(u+1)%r}h.push(i[(r+a-1)%r]),h.push(i[a]),h.push(i[(a+1)%r]),i.splice(a,1),o.splice(a,1);var M=(--r+a-1)%r,R=a==r?0:a;o[M]=e.isConcave(M,r,n,i),o[R]=e.isConcave(R,r,n,i)}return 3==r&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},e.prototype.decompose=function(t,n){var r=t,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 h=-1,l=0,u=0,c=n.length;u0?(i.push(s),a.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(v),s.push(g),s.push(y),s.push(E),s.push(w),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(p),o.push(d),l=e.winding(m,v,g,y,E,w),h=f)}s.length>0&&(i.push(s),a.push(o));for(u=0,c=i.length;u=0;u--)0==(s=i[u]).length&&(i.splice(u,1),this.polygonPool.free(s),o=a[u],a.splice(u,1),this.polygonIndicesPool.free(o));return i},e.isConcave=function(t,e,n,r){var i=r[(e+t-1)%e]<<1,a=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,r,i,a){return t*(a-r)+n*(e-a)+i*(r-e)>=0},e.winding=function(t,e,n,r,i,a){var o=n-t,s=r-e;return i*s-a*o+o*e-t*s>=0?1:-1},e}();t.Triangulator=e}(i||(i={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.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},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var r=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),i=e-t;return r<=(n-t)/i?t+Math.sqrt(r*i*(n-t)):e-Math.sqrt((1-r)*i*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=r;var i=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=i;var a=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return o(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(i);t.Pow=a;var s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=s;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,r,i){for(var a=e,o=r;a=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=f;var p=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*a;var o=t.bone.skeleton,s=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=s);for(var w,x=(w=t.bone).worldX,A=w.worldY,T=w.a,M=w.b,R=w.c,I=w.d,b=e,S=i;S)?=?)"),p("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),p("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),p("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),p("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),p("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),p("COERCERTL",h[l.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",p("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),p("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("LONECARET","(?:\\^)"),p("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",p("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),p("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),p("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),p("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),p("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(k,k.exports);var L=k.exports;S(L);var O=Object.freeze({loose:!0}),V=Object.freeze({}),D=function(t){return t?"object"!==h(t)?O:t:V};S(D);var F=/^[0-9]+$/,X=function(t,e){var n=F.test(t),r=F.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tB)throw new TypeError("version is longer than ".concat(B," characters"));Y("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?W[G.LOOSE]:W[G.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>j||this.major<0)throw new TypeError("Invalid major version");if(this.minor>j||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>j||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var a=[e,r];!1===n&&(a=[e]),0===z(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),Z=H;S(Z);var $=Z,J=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof $)return t;try{return new $(t,e)}catch(t){if(!n)return null;throw t}};S(J);var Q,K,tt=J,et=S((function(t,e){var n=tt(t,e);return n?n.version:null})),nt=Z,rt=J,it=L.safeRe,at=L.t,ot=S((function(t,e){if(t instanceof nt)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=it[at.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),it[at.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;it[at.COERCERTL].lastIndex=-1}else n=t.match(it[at.COERCE]);return null===n?null:rt("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}));var st=ht;function ht(t){var e=this;if(e instanceof ht||(e=new ht),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},ht.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},ht.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},ht.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},ht.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new ht;if(ethis.length&&(e=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(e=this.length);for(var r=this.length,i=this.tail;null!==i&&r>e;r--)i=i.prev;for(;null!==i&&r>t;r--,i=i.prev)n.push(i.value);return n},ht.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&nthis[dt])return Pt(this,this[At].get(t)),!1;var a=this[At].get(t).value;return this[Et]&&(this[wt]||this[Et](t,a.value)),a.now=r,a.maxAge=n,a.value=e,this[mt]+=i-a.length,a.length=i,this.get(t),St(this),!0}var o=new Ct(t,e,i,r,n);return o.length>this[dt]?(this[Et]&&this[Et](t,e),!1):(this[mt]+=o.length,this[xt].unshift(o),this[At].set(t,this[xt].head),St(this),!0)}},{key:"has",value:function(t){if(!this[At].has(t))return!1;var e=this[At].get(t).value;return!bt(this,e)}},{key:"get",value:function(t){return It(this,t,!0)}},{key:"peek",value:function(t){return It(this,t,!1)}},{key:"pop",value:function(){var t=this[xt].tail;return t?(Pt(this,t),t.value):null}},{key:"del",value:function(t){Pt(this,this[At].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var a=i-e;a>0&&this.set(r.k,r.v,a)}}}},{key:"prune",value:function(){var t=this;this[At].forEach((function(e,n){return It(t,n,!1)}))}}]),t}(),It=function(t,e,n){var r=t[At].get(e);if(r){var i=r.value;if(bt(t,i)){if(Pt(t,r),!t[gt])return}else n&&(t[Tt]&&(r.value.now=Date.now()),t[xt].unshiftNode(r));return i.value}},bt=function(t,e){if(!e||!e.maxAge&&!t[yt])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[yt]&&n>t[yt]},St=function(t){if(t[mt]>t[dt])for(var e=t[xt].tail;t[mt]>t[dt]&&null!==e;){var n=e.prev;Pt(t,e),e=n}},Pt=function(t,e){if(e){var n=e.value;t[Et]&&t[Et](n.key,n.value),t[mt]-=n.length,t[At].delete(n.key),t[xt].removeNode(e)}},Ct=c((function t(e,n,r,i,a){l(this,t),this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=a||0})),Nt=function(t,e,n,r){var i=n.value;bt(t,i)&&(Pt(t,n),t[gt]||(i=void 0)),i&&e.call(r,i.value,i.key,t)},_t=Rt;S(_t);var kt=Z,Lt=function(t,e,n){return new kt(t,n).compare(new kt(e,n))};S(Lt);var Ot=Lt,Vt=function(t,e,n){return 0===Ot(t,e,n)};S(Vt);var Dt=Lt,Ft=function(t,e,n){return 0!==Dt(t,e,n)};S(Ft);var Xt=Lt,Ut=function(t,e,n){return Xt(t,e,n)>0};S(Ut);var Yt=Lt,Bt=function(t,e,n){return Yt(t,e,n)>=0};S(Bt);var jt=Lt,Wt=function(t,e,n){return jt(t,e,n)<0};S(Wt);var Gt=Lt,qt=function(t,e,n){return Gt(t,e,n)<=0};S(qt);var zt,Ht,Zt,$t,Jt=Vt,Qt=Ft,Kt=Ut,te=Bt,ee=Wt,ne=qt,re=function(t,e,n,r){switch(e){case"===":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t===n;case"!==":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Jt(t,n,r);case"!=":return Qt(t,n,r);case">":return Kt(t,n,r);case">=":return te(t,n,r);case"<":return ee(t,n,r);case"<=":return ne(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function ie(){if($t)return Zt;$t=1;var t=function(){function t(e,i){var a=this;if(l(this,t),i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return a.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,h=T(this.set);try{for(h.s();!(s=h.n()).done;){var u=s.value;if(1===u.length&&v(u[0])){this.set=[u];break}}}catch(t){h.e(t)}finally{h.f()}}}this.format()}return c(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,a=((this.options.includePrerelease&&p)|(this.options.loose&&d))+":"+t,l=e.get(a);if(l)return l;var c=this.options.loose,v=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(v,N(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],h),i("comparator trim",t),t=t.replace(o[s.TILDETRIM],u),i("tilde trim",t),t=t.replace(o[s.CARETTRIM],f),i("caret trim",t);var g=t.split(" ").map((function(t){return y(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));c&&(g=g.filter((function(t){return i("loose invalid filter",t,n.options),!!t.match(o[s.COMPARATORLOOSE])}))),i("range list",g);var E,x=new Map,A=g.map((function(t){return new r(t,n.options)})),M=T(A);try{for(M.s();!(E=M.n()).done;){var R=E.value;if(m(R))return[R];x.set(R.value,R)}}catch(t){M.e(t)}finally{M.f()}x.size>1&&x.has("")&&x.delete("");var I=w(x.values());return e.set(a,I),I}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new a(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(a(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(a(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();zt=e;var n=D,r=L.safeRe,i=L.t,a=re,o=_,s=Z,h=ie();return zt}(),i=_,a=Z,o=L.safeRe,s=L.t,h=L.comparatorTrimReplace,u=L.tildeTrimReplace,f=L.caretTrimReplace,p=P.FLAG_INCLUDE_PRERELEASE,d=P.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),i=r.pop();n&&r.length;)n=r.every((function(t){return i.intersects(t,e)})),i=r.pop();return n},y=function(t,e){return i("comp",t,e),t=M(t,e),i("caret",t),t=x(t,e),i("tildes",t),t=I(t,e),i("xrange",t),t=S(t,e),i("stars",t),t},E=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){var n=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(n,(function(e,n,r,a,o){var s;return i("tilde",t,e,n,r,a,o),E(n)?s="":E(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):E(a)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(i("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(a,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(a," <").concat(n,".").concat(+r+1,".0-0"),i("tilde return",s),s}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){i("caret",t,e);var n=e.loose?o[s.CARETLOOSE]:o[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,a,o,s){var h;return i("caret",t,e,n,a,o,s),E(n)?h="":E(a)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):E(o)?h="0"===n?">=".concat(n,".").concat(a,".0").concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(i("replaceCaret pr",s),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(i("no pr"),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o," <").concat(+n+1,".0.0-0")),i("caret return",h),h}))},I=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return b(t,e)})).join(" ")},b=function(t,e){t=t.trim();var n=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(n,(function(n,r,a,o,s,h){i("xRange",t,n,r,a,o,s,h);var l=E(a),u=l||E(o),c=u||E(s),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(a=+a+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?a=+a+1:o=+o+1),"<"===r&&(h="-0"),n="".concat(r+a,".").concat(o,".").concat(s).concat(h)):u?n=">=".concat(a,".0.0").concat(h," <").concat(+a+1,".0.0-0"):c&&(n=">=".concat(a,".").concat(o,".0").concat(h," <").concat(a,".").concat(+o+1,".0-0")),i("xRange return",n),n}))},S=function(t,e){return i("replaceStars",t,e),t.trim().replace(o[s.STAR],"")},C=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?s.GTE0PRE:s.GTE0],"")},N=function(t){return function(e,n,r,i,a,o,s,h,l,u,c,f,p){return n=E(r)?"":E(i)?">=".concat(r,".0.0").concat(t?"-0":""):E(a)?">=".concat(r,".").concat(i,".0").concat(t?"-0":""):o?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=E(l)?"":E(u)?"<".concat(+l+1,".0.0-0"):E(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},k=function(t,e,n){for(var a=0;a0){var s=t[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0};return Zt}S(re);var ae,oe,se=ie(),he=function(t,e,n){try{e=new se(e,n)}catch(t){return!1}return e.test(t)},le={valid:et,coerce:ot,satisfies:S(he),SEMVER_SPEC_VERSION:C.SEMVER_SPEC_VERSION},ue=0,ce=1,fe=2,pe=[0,1,2,2,3,0],de=function(){function t(e,n,r,o){var s;if(l(this,t),f(this,"autoUpdate",!0),f(this,"skeleton",void 0),f(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===i.TextureAtlas.length){var h,u=T((s=new i.TextureAtlas(n)).pages);try{for(u.s();!(h=u.n()).done;){var c=h.value;c.setTexture(new b(o[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else s=new i.TextureAtlas(n,(function(t){return new b(o[t])}));var p=new i.SkeletonJson(new i.AtlasAttachmentLoader(s));p.scale*=.01;var d=p.readSkeletonData(r);this.skeletonVersion=le.valid(le.coerce(d.version)),this._spine_3_6_0=le.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=le.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_1_X=le.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new i.Skeleton(d),this.skeleton.updateWorldTransform(),this.stateData=new i.AnimationStateData(this.skeleton.data),this.states=[new i.AnimationState(this.stateData)],this.clipper=new i.SkeletonClipping,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}return c(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=o,n=0),t=c.material;var f=c.positions,p=c.vertexColor.r,d=c.vertexColor.g,m=c.vertexColor.b,v=c.vertexColor.a,g=c.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var h=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(h&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:_(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function M(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,i=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.duration=n}return t.prototype.apply=function(t,e,n,r,i,a,o,s){if(null==t)throw new Error("skeleton cannot be null.");r&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(a+1)*n]<=e?r=a+1:i=a,r==i)return(r+1)*n;a=r+i>>>1}},t.linearSearch=function(t,e,n){for(var r=0,i=t.length-n;r<=i;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=i,function(t){t[t.setup=0]="setup",t[t.current=1]="current",t[t.currentLayered=2]="currentLayered"}(e=t.MixPose||(t.MixPose={})),function(t){t[t.in=0]="in",t[t.out=1]="out"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(r=t.TimelineType||(t.TimelineType={}));var a=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,i,a){var o=.03*(2*-n+i),s=.03*(2*-r+a),h=.006*(3*(n-i)+1),l=.006*(3*(r-a)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,p=.3*r+s+.16666667*l,d=t*e.BEZIER_SIZE,m=this.curves;m[d++]=e.BEZIER;for(var v=f,g=p,y=d+e.BEZIER_SIZE-1;d=r){var u=void 0,c=void 0;return a==h?(u=0,c=0):(u=i[a-2],c=i[a-1]),c+(i[a+1]-c)*(r-u)/(s-u)}var f=i[a-1];return f+(1-f)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var s=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])if(h==e.setup)c.rotation=c.data.rotation+u[u.length+a.PREV_ROTATION]*s;else{var p=c.data.rotation+u[u.length+a.PREV_ROTATION]-c.rotation;p-=360*(16384-(16384.499999999996-p/360|0)),c.rotation+=p*s}else{var d=i.binarySearch(u,r,a.ENTRIES),m=u[d+a.PREV_ROTATION],v=u[d],g=this.getCurvePercent((d>>1)-1,1-(r-v)/(u[d+a.PREV_TIME]-v)),y=u[d+a.ROTATION]-m;y=m+(y-=360*(16384-(16384.499999999996-y/360|0)))*g,h==e.setup?(y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation=c.data.rotation+y*s):(y=c.data.rotation+y-c.rotation,y-=360*(16384-(16384.499999999996-y/360|0)),c.rotation+=y*s)}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=s;var h=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=n,this.frames[t+a.Y]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],p=u[u.length+a.PREV_Y];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_X],p=u[d+a.PREV_Y];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.X]-f)*v,p+=(u[d+a.Y]-p)*v}h==e.setup?(c.x=c.data.x+f*s,c.y=c.data.y+p*s):(c.x+=(c.data.x+f-c.x)*s,c.y+=(c.data.y+p-c.y)*s)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function s(t){return a.call(this,t)||this}return o(s,a),s.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},s.prototype.apply=function(r,a,o,h,l,u,c){var f=this.frames,p=r.bones[this.boneIndex];if(o=f[f.length-s.ENTRIES])d=f[f.length+s.PREV_X]*p.data.scaleX,m=f[f.length+s.PREV_Y]*p.data.scaleY;else{var v=i.binarySearch(f,o,s.ENTRIES);d=f[v+s.PREV_X],m=f[v+s.PREV_Y];var g=f[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(o-g)/(f[v+s.PREV_TIME]-g));d=(d+(f[v+s.X]-d)*y)*p.data.scaleX,m=(m+(f[v+s.Y]-m)*y)*p.data.scaleY}if(1==l)p.scaleX=d,p.scaleY=m;else{var E=0,w=0;u==e.setup?(E=p.data.scaleX,w=p.data.scaleY):(E=p.scaleX,w=p.scaleY),c==n.out?(d=Math.abs(d)*t.MathUtils.signum(E),m=Math.abs(m)*t.MathUtils.signum(w)):(E=Math.abs(E)*t.MathUtils.signum(d),w=Math.abs(w)*t.MathUtils.signum(m)),p.scaleX=E+(d-E)*l,p.scaleY=w+(m-w)*l}}},s}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],p=u[u.length+n.PREV_Y];else{var d=i.binarySearch(u,a,n.ENTRIES);f=u[d+n.PREV_X],p=u[d+n.PREV_Y];var m=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(a-m)/(u[d+n.PREV_TIME]-m));f+=(u[d+n.X]-f)*v,p+=(u[d+n.Y]-p)*v}h==e.setup?(c.shearX=c.data.shearX+f*s,c.shearY=c.data.shearY+p*s):(c.shearX+=(c.data.shearX+f-c.shearX)*s,c.shearY+=(c.data.shearY+p-c.shearY)*s)}},n}(h);t.ShearTimeline=u;var c=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var y=c.length;d=c[y+a.PREV_R],m=c[y+a.PREV_G],v=c[y+a.PREV_B],g=c[y+a.PREV_A]}else{var E=i.binarySearch(c,r,a.ENTRIES);d=c[E+a.PREV_R],m=c[E+a.PREV_G],v=c[E+a.PREV_B],g=c[E+a.PREV_A];var w=c[E],x=this.getCurvePercent(E/a.ENTRIES-1,1-(r-w)/(c[E+a.PREV_TIME]-w));d+=(c[E+a.R]-d)*x,m+=(c[E+a.G]-m)*x,v+=(c[E+a.B]-v)*x,g+=(c[E+a.A]-g)*x}if(1==s)u.color.set(d,m,v,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((d-f.r)*s,(m-f.g)*s,(v-f.b)*s,(g-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);t.ColorTimeline=c;var f=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,r,i,o,s,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=r,this.frames[t+a.B]=i,this.frames[t+a.A]=o,this.frames[t+a.R2]=s,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex],c=this.frames;if(r=c[c.length-a.ENTRIES]){var T=c.length;v=c[T+a.PREV_R],g=c[T+a.PREV_G],y=c[T+a.PREV_B],E=c[T+a.PREV_A],w=c[T+a.PREV_R2],x=c[T+a.PREV_G2],A=c[T+a.PREV_B2]}else{var M=i.binarySearch(c,r,a.ENTRIES);v=c[M+a.PREV_R],g=c[M+a.PREV_G],y=c[M+a.PREV_B],E=c[M+a.PREV_A],w=c[M+a.PREV_R2],x=c[M+a.PREV_G2],A=c[M+a.PREV_B2];var R=c[M],I=this.getCurvePercent(M/a.ENTRIES-1,1-(r-R)/(c[M+a.PREV_TIME]-R));v+=(c[M+a.R]-v)*I,g+=(c[M+a.G]-g)*I,y+=(c[M+a.B]-y)*I,E+=(c[M+a.A]-E)*I,w+=(c[M+a.R2]-w)*I,x+=(c[M+a.G2]-x)*I,A+=(c[M+a.B2]-A)*I}if(1==s)u.color.set(v,g,y,E),u.darkColor.set(w,x,A,1);else{f=u.color,p=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),p.setFromColor(u.data.darkColor)),f.add((v-f.r)*s,(g-f.g)*s,(y-f.b)*s,(E-f.a)*s),p.add((w-p.r)*s,(x-p.g)*s,(A-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);t.TwoColorTimeline=f;var p=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return a.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},a.prototype.apply=function(t,r,a,o,s,h,l){var u=t.slots[this.slotIndex];if(l!=n.out||h!=e.setup){var c=this.frames;if(a=c[c.length-1]?c.length-1:i.binarySearch(c,a,1)-1;var d=this.attachmentNames[p];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else{var m=u.data.attachmentName;u.setAttachment(null==m?null:t.getAttachment(this.slotIndex,m))}},a}();t.AttachmentTimeline=p;var d=null,m=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==d&&(d=t.Utils.newFloatArray(64)),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},a.prototype.apply=function(n,r,a,o,s,h,l){var u=n.slots[this.slotIndex],c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.applyDeform(this.attachment)){var f=u.attachmentVertices;0==f.length&&(s=1);var p=this.frameVertices,d=p[0].length,m=this.frames;if(a=m[m.length-1]){var x=p[m.length-1];if(1==s)t.Utils.arrayCopy(x,0,w,0,d);else if(h==e.setup){if(null==(v=c).bones)for(var A=v.vertices,T=0;Tn)this.apply(t,e,Number.MAX_VALUE,r,a,o,s),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=v;var g=function(){function a(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return a.prototype.getPropertyId=function(){return r.drawOrder<<24},a.prototype.getFrameCount=function(){return this.frames.length},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},a.prototype.apply=function(r,a,o,s,h,l,u){var c=r.drawOrder,f=r.slots;if(u!=n.out||l!=e.setup){var p=this.frames;if(o=p[p.length-1]?p.length-1:i.binarySearch(p,o)-1;var m=this.drawOrders[d];if(null==m)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var v=0,g=m.length;v=c[c.length-s.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+s.PREV_MIX]-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[c.length+s.PREV_BEND_DIRECTION]):(f.mix+=(c[c.length+s.PREV_MIX]-f.mix)*h,u==n.in&&(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION]));else{var p=i.binarySearch(c,a,s.ENTRIES),d=c[p+s.PREV_MIX],m=c[p],v=this.getCurvePercent(p/s.ENTRIES-1,1-(a-m)/(c[p+s.PREV_TIME]-m));l==e.setup?(f.mix=f.data.mix+(d+(c[p+s.MIX]-d)*v-f.data.mix)*h,f.bendDirection=u==n.out?f.data.bendDirection:c[p+s.PREV_BEND_DIRECTION]):(f.mix+=(d+(c[p+s.MIX]-d)*v-f.mix)*h,u==n.in&&(f.bendDirection=c[p+s.PREV_BEND_DIRECTION]))}},s.ENTRIES=3,s.PREV_TIME=-3,s.PREV_MIX=-2,s.PREV_BEND_DIRECTION=-1,s.MIX=1,s.BEND_DIRECTION=2,s}(a);t.IkConstraintTimeline=y;var E=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,n,r,i,o){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r,this.frames[t+a.SCALE]=i,this.frames[t+a.SHEAR]=o},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(r=u[u.length-a.ENTRIES]){var g=u.length;p=u[g+a.PREV_ROTATE],d=u[g+a.PREV_TRANSLATE],m=u[g+a.PREV_SCALE],v=u[g+a.PREV_SHEAR]}else{var y=i.binarySearch(u,r,a.ENTRIES);p=u[y+a.PREV_ROTATE],d=u[y+a.PREV_TRANSLATE],m=u[y+a.PREV_SCALE],v=u[y+a.PREV_SHEAR];var E=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(r-E)/(u[y+a.PREV_TIME]-E));p+=(u[y+a.ROTATE]-p)*w,d+=(u[y+a.TRANSLATE]-d)*w,m+=(u[y+a.SCALE]-m)*w,v+=(u[y+a.SHEAR]-v)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(p-f.rotateMix)*s,c.translateMix=f.translateMix+(d-f.translateMix)*s,c.scaleMix=f.scaleMix+(m-f.scaleMix)*s,c.shearMix=f.shearMix+(v-f.shearMix)*s}else c.rotateMix+=(p-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(v-c.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);t.TransformConstraintTimeline=E;var w=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=n},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var p=i.binarySearch(u,r,a.ENTRIES);f=u[p+a.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/a.ENTRIES-1,1-(r-d)/(u[p+a.PREV_TIME]-d));f+=(u[p+a.VALUE]-f)*m}h==e.setup?c.position=c.data.position+(f-c.data.position)*s:c.position+=(f-c.position)*s}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var x=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,a,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(a=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var p=i.binarySearch(u,a,n.ENTRIES);f=u[p+n.PREV_VALUE];var d=u[p],m=this.getCurvePercent(p/n.ENTRIES-1,1-(a-d)/(u[p+n.PREV_TIME]-d));f+=(u[p+n.VALUE]-f)*m}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*s:c.spacing+=(f-c.spacing)*s}},n}(w);t.PathConstraintSpacingTimeline=x;var A=function(n){function a(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*a.ENTRIES),r}return o(a,n),a.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n,r){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=r},a.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(r=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],p=u[u.length+a.PREV_TRANSLATE];else{var d=i.binarySearch(u,r,a.ENTRIES);f=u[d+a.PREV_ROTATE],p=u[d+a.PREV_TRANSLATE];var m=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(r-m)/(u[d+a.PREV_TIME]-m));f+=(u[d+a.ROTATE]-f)*v,p+=(u[d+a.TRANSLATE]-p)*v}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(p-c.data.translateMix)*s):(c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(p-c.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);t.PathConstraintMixTimeline=A}(i||(i={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.events=new Array,this.listeners=new Array,this.queue=new i(this),this.propertyIDs=new t.IntSet,this.mixingTo=new Array,this.animationsChanged=!1,this.timeScale=1,this.trackEntryPool=new t.Pool((function(){return new n})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n0){if(i.delay-=a,i.delay>0)continue;a=-i.delay,i.delay=0}var o=i.next;if(null!=o){var s=i.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime=s+t*o.timeScale,i.trackTime+=a,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=a,o=o.mixingFrom;continue}}else if(i.trackLast>=i.trackEnd&&null==i.mixingFrom){e[n]=null,this.queue.end(i),this.disposeNext(i);continue}if(null!=i.mixingFrom&&this.updateMixingFrom(i,t)){var h=i.mixingFrom;for(i.mixingFrom=null;null!=h;)this.queue.end(h),h=h.mixingFrom}i.trackTime+=a}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&(t.mixTime>=t.mixDuration||0==t.timeScale)?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e*t.timeScale,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,i=this.tracks,a=!1,o=0,s=i.length;o0)){a=!0;var l=0==o?t.MixPose.current:t.MixPose.currentLayered,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),p=h.animation.timelines.length,d=h.animation.timelines;if(1==u)for(var m=0;m=e.FIRST?t.MixPose.setup:l;E instanceof t.RotateTimeline?this.applyRotateTimeline(E,n,f,u,w,y,m<<1,g):(t.Utils.webkit602BugfixHelper(u,w),E.apply(n,c,f,r,u,w,t.MixDirection.in))}}this.queueEvents(h,f),r.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}return this.queue.drain(),a},e.prototype.applyMixingFrom=function(n,r,i){var a=n.mixingFrom;null!=a.mixingFrom&&this.applyMixingFrom(a,r,i);var o=0;0==n.mixDuration?(o=1,i=t.MixPose.setup):(o=n.mixTime/n.mixDuration)>1&&(o=1);var s=o0&&this.queueEvents(a,c),this.events.length=0,a.nextAnimationLast=c,a.nextTrackLast=a.trackTime,o},e.prototype.applyRotateTimeline=function(e,n,r,i,a,o,s,h){if(h&&(o[s]=0),1!=i){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(r=u[u.length-t.RotateTimeline.ENTRIES])f=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),d=u[p+t.RotateTimeline.PREV_ROTATION],m=u[p],v=l.getCurvePercent((p>>1)-1,1-(r-m)/(u[p+t.RotateTimeline.PREV_TIME]-m));f=u[p+t.RotateTimeline.ROTATION]-d,f=d+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+c.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0))}var g=a==t.MixPose.setup?c.data.rotation:c.rotation,y=0,E=f-g;if(0==E)y=o[s];else{E-=360*(16384-(16384.499999999996-E/360|0));var w=0,x=0;h?(w=0,x=E):(w=o[s],x=o[s+1]);var A=E>0,T=w>=0;t.MathUtils.signum(x)!=t.MathUtils.signum(E)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=A),y=E+w-w%360,T!=A&&(y+=360*t.MathUtils.signum(w)),o[s]=y}o[s+1]=E,g+=y*i,c.rotation=g-360*(16384-(16384.499999999996-g/360|0))}}else e.apply(n,0,r,null,1,a,t.MixDirection.in)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,i=r-n,a=t.trackLast%i,o=this.events,s=0,h=o.length;sr||this.queue.event(t,l)}for((t.loop?0==i||a>t.trackTime%i:e>=r&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,i=this.expandToIndex(t);null!=i&&(-1==i.nextTrackLast?(this.tracks[t]=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(t,e,n,i);return this.setCurrent(t,a,r),this.queue.drain(),a},e.prototype.addAnimation=function(t,e,n,r){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,i,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var i=this.expandToIndex(t);if(null!=i)for(;null!=i.next;)i=i.next;var a=this.trackEntry(t,e,n,i);if(null==i)this.setCurrent(t,a,!0),this.queue.drain();else if(i.next=a,r<=0){var o=i.animationEnd-i.animationStart;0!=o?(i.loop?r+=o*(1+(i.trackTime/o|0)):r+=o,r-=this.data.getMix(i.animation,e)):r=0}return a.delay=r,a},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var i=this.addAnimationWith(t,e.emptyAnimation,!1,r);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.DIP=2,e.DIP_MIX=3,e}();t.AnimationState=e;var n=function(){function n(){this.timelineData=new Array,this.timelineDipMix=new Array,this.timelinesRotation=new Array}return n.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.animation=null,this.listener=null,this.timelineData.length=0,this.timelineDipMix.length=0,this.timelinesRotation.length=0},n.prototype.setTimelineData=function(n,r,i){null!=n&&r.push(n);var a=null!=this.mixingFrom?this.mixingFrom.setTimelineData(this,r,i):this;null!=n&&r.pop();var o=r,s=r.length-1,h=this.animation.timelines,l=this.animation.timelines.length,u=t.Utils.setArraySize(this.timelineData,l);this.timelineDipMix.length=0;var c=t.Utils.setArraySize(this.timelineDipMix,l);t:for(var f=0;f=0;d--){var m=o[d];if(!m.hasTimeline(p)&&m.mixDuration>0){u[f]=e.DIP_MIX,c[f]=m;continue t}}u[f]=e.DIP}else u[f]=e.FIRST;else u[f]=e.SUBSEQUENT}return a},n.prototype.hasTimeline=function(t){for(var e=this.animation.timelines,n=0,r=e.length;n=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n}();t.TrackEntry=n;var r,i=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n=0?n.substring(0,n.lastIndexOf("/")):"";n=this.pathPrefix+n,this.toLoad++,e.downloadText(n,(function(e){var s={count:0},h=new Array;try{new t.TextureAtlas(e,(function(e){h.push(o+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)}))}catch(t){var l=t;return a.errors[n]="Couldn't load texture atlas "+n+": "+l.message,i&&i(n,"Couldn't load texture atlas "+n+": "+l.message),a.toLoad--,void a.loaded++}for(var u=function(l){var u=!1;a.loadTexture(l,(function(l,c){if(s.count++,s.count==h.length)if(u)a.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+l+" of atlas "+n),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(e,(function(t){return a.get(o+"/"+t)}));a.assets[n]=f,r&&r(n,f),a.toLoad--,a.loaded++}catch(t){var p=t;a.errors[n]="Couldn't load texture atlas "+n+": "+p.message,i&&i(n,"Couldn't load texture atlas "+n+": "+p.message),a.toLoad--,a.loaded++}}),(function(t,e){u=!0,s.count++,s.count==h.length&&(a.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,i&&i(n,"Couldn't load texture atlas page "+t+" of atlas "+n),a.toLoad--,a.loaded++)}))},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(i||(i={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");i.renderObject=i;var a=new t.RegionAttachment(n);return a.setRegion(i),a},e.prototype.newMeshAttachment=function(e,n,r){var i=this.atlas.findRegion(r);if(null==i)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");i.renderObject=i;var a=new t.MeshAttachment(n);return a.region=i,a},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(i||(i={})),function(t){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(i||(i={})),function(t){var e=function(){function e(t,e,n){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.worldX=0,this.c=0,this.d=0,this.worldY=0,this.sorted=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,r,i,a,o,s){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=i,this.ascaleY=a,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var h=this.parent;if(null==h){var l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a,d=this.skeleton;return d.flipX&&(e=-e,u=-u,c=-c),d.flipY&&(n=-n,f=-f,p=-p),this.a=u,this.b=c,this.c=f,this.d=p,this.worldX=e+d.x,void(this.worldY=n+d.y)}var m=h.a,v=h.b,g=h.c,y=h.d;switch(this.worldX=m*e+v*n+h.worldX,this.worldY=g*e+y*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:l=r+90+s,u=t.MathUtils.cosDeg(r+o)*i,c=t.MathUtils.cosDeg(l)*a,f=t.MathUtils.sinDeg(r+o)*i,p=t.MathUtils.sinDeg(l)*a;return this.a=m*u+v*f,this.b=m*c+v*p,this.c=g*u+y*f,void(this.d=g*c+y*p);case t.TransformMode.OnlyTranslation:l=r+90+s;this.a=t.MathUtils.cosDeg(r+o)*i,this.b=t.MathUtils.cosDeg(l)*a,this.c=t.MathUtils.sinDeg(r+o)*i,this.d=t.MathUtils.sinDeg(l)*a;break;case t.TransformMode.NoRotationOrReflection:var E=0;(A=m*m+g*g)>1e-4?(v=g*(A=Math.abs(m*y-v*g)/A),y=m*A,E=Math.atan2(g,m)*t.MathUtils.radDeg):(m=0,g=0,E=90-Math.atan2(y,v)*t.MathUtils.radDeg);var w=r+o-E,x=r+s-E+90;u=t.MathUtils.cosDeg(w)*i,c=t.MathUtils.cosDeg(x)*a,f=t.MathUtils.sinDeg(w)*i,p=t.MathUtils.sinDeg(x)*a;this.a=m*u-v*f,this.b=m*c-v*p,this.c=g*u+y*f,this.d=g*c+y*p;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,T=t.MathUtils.cosDeg(r),M=t.MathUtils.sinDeg(r),R=m*T+v*M,I=g*T+y*M;(A=Math.sqrt(R*R+I*I))>1e-5&&(A=1/A),R*=A,I*=A,A=Math.sqrt(R*R+I*I);var b=Math.PI/2+Math.atan2(I,R),S=Math.cos(b)*A,P=Math.sin(b)*A;u=t.MathUtils.cosDeg(o)*i,c=t.MathUtils.cosDeg(90+s)*a,f=t.MathUtils.sinDeg(o)*i,p=t.MathUtils.sinDeg(90+s)*a;return(this.data.transformMode!=t.TransformMode.NoScaleOrReflection?m*y-v*g<0:this.skeleton.flipX!=this.skeleton.flipY)&&(S=-S,P=-P),this.a=R*u+S*f,this.b=R*c+S*p,this.c=I*u+P*f,void(this.d=I*c+P*p)}this.skeleton.flipX&&(this.a=-this.a,this.b=-this.b),this.skeleton.flipY&&(this.c=-this.c,this.d=-this.d)},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var n=e.a,r=e.b,i=e.c,a=e.d,o=1/(n*a-r*i),s=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=s*a*o-h*r*o,this.ay=h*n*o-s*i*o;var l=o*a,u=o*n,c=o*r,f=o*i,p=l*this.a-c*this.c,d=l*this.b-c*this.d,m=u*this.c-f*this.a,v=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(p*p+m*m),this.ascaleX>1e-4){var g=p*v-d*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(p*d+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,p)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,d)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,i=this.d,a=1/(e*i-n*r),o=t.x-this.worldX,s=t.y-this.worldY;return t.x=o*i*a-s*n*a,t.y=s*e*a-o*r*a,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*t.MathUtils.radDeg},e.prototype.localToWorldRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,i=this.c,a=this.d,o=t.MathUtils.cosDeg(e),s=t.MathUtils.sinDeg(e);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},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(t,n,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,t<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");this.index=t,this.name=n,this.parent=r};t.BoneData=n,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(i||(i={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(i||(i={})),function(t){var e=function(t){this.name=t};t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.mix=1,this.bendDirection=0,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.bendDirection=t.bendDirection,this.bones=new Array;for(var n=0;n180?c-=360:c<-180&&(c+=360),e.updateWorldTransformWith(e.ax,e.ay,e.arotation+c*i,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,i,a,o){if(0!=o){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var s=e.ax,h=e.ay,l=e.ascaleX,u=e.ascaleY,c=n.ascaleX,f=0,p=0,d=0;l<0?(l=-l,f=180,d=-1):(f=0,d=1),u<0&&(u=-u,d=-d),c<0?(c=-c,p=180):p=0;var m=n.ax,v=0,g=0,y=0,E=e.a,w=e.b,x=e.c,A=e.d,T=Math.abs(l-u)<=1e-4;T?(g=E*m+w*(v=n.ay)+e.worldX,y=x*m+A*v+e.worldY):(v=0,g=E*m+e.worldX,y=x*m+e.worldY);var M=e.parent;E=M.a,w=M.b,x=M.c;var R=1/(E*(A=M.d)-w*x),I=r-M.worldX,b=i-M.worldY,S=(I*A-b*w)*R-s,P=(b*E-I*x)*R-h,C=((I=g-M.worldX)*A-(b=y-M.worldY)*w)*R-s,N=(b*E-I*x)*R-h,_=Math.sqrt(C*C+N*N),k=n.data.length*c,L=0,O=0;t:if(T){var V=(S*S+P*P-_*_-(k*=l)*k)/(2*_*k);V<-1?V=-1:V>1&&(V=1),O=Math.acos(V)*a,E=_+k*V,w=k*Math.sin(O),L=Math.atan2(P*E-S*w,S*E+P*w)}else{var D=(E=l*k)*E,F=(w=u*k)*w,X=S*S+P*P,U=Math.atan2(P,S),Y=-2*F*_,B=F-D;if((A=Y*Y-4*B*(x=F*_*_+D*X-D*F))>=0){var j=Math.sqrt(A);Y<0&&(j=-j);var W=(j=-(Y+j)/2)/B,G=x/j,q=Math.abs(W)=-1&&x<=1&&(x=Math.acos(x),(A=(I=E*Math.cos(x)+_)*I+(b=w*Math.sin(x))*b)K&&(J=x,K=A,Q=I,tt=b)),X<=(Z+K)/2?(L=U-Math.atan2($*a,H),O=z*a):(L=U-Math.atan2(tt*a,Q),O=J*a)}var et=Math.atan2(v,m)*d,nt=e.arotation;(L=(L-et)*t.MathUtils.radDeg+f-nt)>180?L-=360:L<-180&&(L+=360),e.updateWorldTransformWith(s,h,nt+L*o,e.ascaleX,e.ascaleY,0,0),nt=n.arotation,(O=((O+et)*t.MathUtils.radDeg-n.ashearX)*d+p-nt)>180?O-=360:O<-180&&(O+=360),n.updateWorldTransformWith(m,v,nt+O*o,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(t){this.order=0,this.bones=new Array,this.bendDirection=1,this.mix=1,this.name=t};t.IkConstraintData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n0;if(i>0||a){var o=this.data,s=o.spacingMode,h=s==t.SpacingMode.Length,l=o.rotateMode,u=l==t.RotateMode.Tangent,c=l==t.RotateMode.ChainScale,f=this.bones.length,p=u?f:f+1,d=this.bones,m=t.Utils.setArraySize(this.spaces,p),v=null,g=this.spacing;if(c||h){c&&(v=t.Utils.setArraySize(this.lengths,f));for(var y=0,E=p-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=r,U=Math.cos(X),Y=Math.sin(X),C.a=U*O-Y*D,C.b=U*V-Y*F,C.c=Y*O+U*D,C.d=Y*V+U*F}C.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,i,a,o){var s=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*r+2),c=null,f=n.closed,p=n.worldVerticesLength,d=p/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[d-=f?1:2];if(a&&(h*=g),o)for(var y=0;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(s,p-6,4,c,0,2)),this.addAfterPosition(x-g,c,0,u,E);continue}}for(;;w++){var A=v[w];if(!(x>A)){if(0==w)x/=A;else x=(x-(Z=v[w-1]))/(A-Z);break}}w!=m&&(m=w,f&&w==d?(n.computeWorldVertices(s,p-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*w+2,8,c,0,2)),this.addCurvePosition(x,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,E,i||y>0&&0==G)}return u}f?(p+=2,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p-4,c,0,2),n.computeWorldVertices(s,0,2,c,p-4,2),c[p-2]=c[0],c[p-1]=c[1]):(d--,p-=4,c=t.Utils.setArraySize(this.world,p),n.computeWorldVertices(s,2,p,c,0,2));for(var T=t.Utils.setArraySize(this.curves,d),M=0,R=c[0],I=c[1],b=0,S=0,P=0,C=0,N=0,_=0,k=0,L=0,O=0,V=0,D=0,F=0,X=0,U=0,Y=(y=0,2);yM){this.addAfterPosition(x-M,c,p-4,u,E);continue}}for(;;w++){var q=T[w];if(!(x>q)){if(0==w)x/=q;else x=(x-(Z=T[w-1]))/(q-Z);break}}if(w!=m){m=w;var z=6*w;for(R=c[z],I=c[z+1],b=c[z+2],S=c[z+3],P=c[z+4],C=c[z+5],D=2*(k=.03*(R-2*b+P))+(O=.006*(3*(b-P)-R+(N=c[z+6]))),F=2*(L=.03*(I-2*S+C))+(V=.006*(3*(S-C)-I+(_=c[z+7]))),X=.3*(b-R)+k+.16666667*O,U=.3*(S-I)+L+.16666667*V,j=Math.sqrt(X*X+U*U),B[0]=j,z=1;z<8;z++)X+=D,U+=F,D+=O,F+=V,j+=Math.sqrt(X*X+U*U),B[z]=j;X+=D,U+=F,j+=Math.sqrt(X*X+U*U),B[8]=j,X+=D+O,U+=F+V,j+=Math.sqrt(X*X+U*U),B[9]=j,W=0}for(x*=j;;W++){var H=B[W];if(!(x>H)){var Z;if(0==W)x/=H;else x=W+(x-(Z=B[W-1]))/(H-Z);break}}this.addCurvePosition(.1*x,R,I,b,S,P,C,N,_,u,E,i||y>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,n,r,i){var a=e[n],o=e[n+1],s=e[n+2]-a,h=e[n+3]-o,l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,i){var a=e[n+2],o=e[n+3],s=a-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[i]=a+t*Math.cos(l),r[i+1]=o+t*Math.sin(l),r[i+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,i,a,o,s,h,l,u,c){(0==t||isNaN(t))&&(t=1e-4);var f=t*t,p=f*t,d=1-t,m=d*d,v=m*d,g=d*t,y=3*g,E=d*y,w=y*t,x=e*v+r*E+a*w+s*p,A=n*v+i*E+o*w+h*p;l[u]=x,l[u+1]=A,c&&(l[u+2]=Math.atan2(A-(n*m+i*g*2+o*f),x-(e*m+r*g*2+a*f)))},e.prototype.getOrder=function(){return this.data.order},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e,n,r,i=function(t){this.order=0,this.bones=new Array,this.name=t};t.PathConstraintData=i,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(i||(i={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),n=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,n,r){var i=this.clientAssets[t];return null==i&&(i=new e(t),this.clientAssets[t]=i),null!==n&&(i.textureLoader=n),i.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var i=new Image;i.src=n,i.crossOrigin="anonymous",i.onload=function(t){r.rawAssets[n]=i},i.onerror=function(t){r.errors[n]="Couldn't load image "+n}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null==n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(i||(i={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.flipX=!1,this.flipY=!1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var n=0;n1){var i=n[n.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(t),this.sortReset(r.children),n[n.length-1].sorted=!0},e.prototype.sortPathConstraint=function(e){var n=e.target,r=n.data.index,i=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,i),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,i);for(var a=0,o=this.data.skins.length;a-1||this.updateCacheReset.push(i)}else for(r=0;r=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var i=this.minX,a=this.minY,o=this.maxX,s=this.maxY;if(t<=i&&n<=i||e<=a&&r<=a||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(i-t)+e;if(l>a&&la&&li&&ui&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,i=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[a]-u)=u&&E<=p||E>=p&&E<=u)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(l*g-h*m)/y;if((w>=c&&w<=d||w>=d&&w<=c)&&(w>=n&&w<=i||w>=i&&w<=n))return!0}u=p,c=d}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(i||(i={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(n,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var i=r.worldVerticesLength,a=t.Utils.setArraySize(this.clippingPolygon,i);r.computeWorldVertices(n,0,i,a,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=s.length;h>1,X=this.clipOutput,U=t.Utils.setArraySize(u,N+F*d),Y=0;Y<_;Y+=2){var B=X[Y],j=X[Y+1];U[N]=B,U[N+1]=j,U[N+2]=o.r,U[N+3]=o.g,U[N+4]=o.b,U[N+5]=o.a;var W=B-I,G=j-b,q=(k*W+L*G)*D,z=(V*W+O*G)*D,H=1-q-z;U[N+6]=w*q+M*z+S*H,U[N+7]=x*q+R*z+P*H,h&&(U[N+8]=s.r,U[N+9]=s.g,U[N+10]=s.b,U[N+11]=s.a),N+=d}N=c.length;var Z=t.Utils.setArraySize(c,N+3*(F-2));F--;for(Y=1;Y=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(i),u.push(a),u.push(t),u.push(e),s.length=0;for(var c=o,f=o.length-4,p=0;;p+=2){for(var d=c[p],m=c[p+1],v=c[p+2],g=c[p+3],y=d-v,E=m-g,w=u,x=u.length-2,A=s.length,T=0;T0;if(y*(R-g)-E*(M-v)>0){if(S){s.push(I),s.push(b);continue}var P=((N=I-M)*(m-R)-(C=b-R)*(d-M))/(C*(v-d)-N*(g-m));s.push(d+(v-d)*P),s.push(m+(g-m)*P)}else if(S){var C,N;P=((N=I-M)*(m-R)-(C=b-R)*(d-M))/(C*(v-d)-N*(g-m));s.push(d+(v-d)*P),s.push(m+(g-m)*P),s.push(I),s.push(b)}l=!0}if(A==s.length)return h.length=0,!0;if(s.push(s[0]),s.push(s[1]),p==f)break;var _=s;(s=u).length=0,u=_}if(h!=s){h.length=0;p=0;for(var k=s.length-2;p>1;s=0;f--)-1==W[f]&&(W[f]=q[--H])}w.setFrame(c++,j.time,W)}a.push(w),o=Math.max(o,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},t.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},t.prototype.attachAll=function(t,e){for(var n=0,r=0;r= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(i||(i={})),function(t){var e,n,r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var i=function(){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};t.TextureRegion=i;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(t.Texture);t.FakeTexture=a}(i||(i={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,a){if(null==a)throw new Error("textureLoader cannot be null.");for(var o=new n(e),s=new Array(4),h=null;;){var l=o.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new i;u.name=l,u.page=h,u.rotate="true"==o.readValue(),o.readTuple(s);var c=parseInt(s[0]),f=parseInt(s[1]);o.readTuple(s);var p=parseInt(s[0]),d=parseInt(s[1]);u.u=c/h.width,u.v=f/h.height,u.rotate?(u.u2=(c+d)/h.width,u.v2=(f+p)/h.height):(u.u2=(c+p)/h.width,u.v2=(f+d)/h.height),u.x=c,u.y=f,u.width=Math.abs(p),u.height=Math.abs(d),4==o.readTuple(s)&&4==o.readTuple(s)&&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=h.texture,this.regions.push(u)}else{(h=new r).name=l,2==o.readTuple(s)&&(h.width=parseInt(s[0]),h.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),h.minFilter=t.Texture.filterFromString(s[0]),h.magFilter=t.Texture.filterFromString(s[1]);var m=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==m?h.uWrap=t.TextureWrap.Repeat:"y"==m?h.vWrap=t.TextureWrap.Repeat:"xy"==m&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=a(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var r=0,i=n+1;r<3;r++){var a=e.indexOf(",",i);if(-1==a)break;t[r]=e.substr(i,a-i).trim(),i=a+1}return t[r]=e.substring(i).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=i}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var A=Math.cos(b),T=Math.sin(b);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var R=Math.sqrt(v.a*v.a+v.c*v.c),I=Math.sqrt(o*o+h*h);R>1e-5&&(R=(R+(I-R+this.data.offsetScaleX)*r)/R),v.a*=R,v.c*=R,R=Math.sqrt(v.b*v.b+v.d*v.d),I=Math.sqrt(s*s+l*l),R>1e-5&&(R=(R+(I-R+this.data.offsetScaleY)*r)/R),v.b*=R,v.d*=R,g=!0}if(i>0){E=v.b,x=v.d;var b,S=Math.atan2(x,E);(b=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b=S+(b+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(b)*R,v.d=Math.sin(b)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,i=this.shearMix,a=this.target,o=a.a,s=a.b,h=a.c,l=a.d,u=o*l-s*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,p=this.bones,d=0,m=p.length;dt.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I*=e;var A=Math.cos(I),T=Math.sin(I);v.a=A*y-T*w,v.b=A*E-T*x,v.c=T*y+A*w,v.d=T*E+A*x,g=!0}if(0!=n){var M=this.temp;a.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var R=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*r+1;v.a*=R,v.c*=R,R=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,v.b*=R,v.d*=R,g=!0}if(i>0){var I;(I=Math.atan2(l,s)-Math.atan2(h,o))>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2);E=v.b,x=v.d;I=Math.atan2(x,E)+(I-t.MathUtils.PI/2+f)*i;R=Math.sqrt(E*E+x*x);v.b=Math.cos(I)*R,v.d=Math.sin(I)*R,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=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;o0&&(p>1e-5&&(p=(p+(i.ascaleX-p+this.data.offsetScaleX)*n)/p),d>1e-5&&(d=(d+(i.ascaleY-d+this.data.offsetScaleY)*n)/d));var m=h.ashearY;if(r>0){u=i.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*r}h.updateWorldTransformWith(c,f,l,p,d,h.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=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;o0&&(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 d=h.ashearY;r>0&&(d+=(i.ashearY+this.data.offsetShearY)*r),h.updateWorldTransformWith(u,c,l,f,p,h.ashearX,d)}},e.prototype.getOrder=function(){return this.data.order},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(t){if(this.order=0,this.bones=new Array,this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.offsetRotation=0,this.offsetX=0,this.offsetY=0,this.offsetScaleX=0,this.offsetScaleY=0,this.offsetShearY=0,this.relative=!1,this.local=!1,null==t)throw new Error("name cannot be null.");this.name=t};t.TransformConstraintData=e}(i||(i={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var n=t,r=t.length>>1,i=this.indicesArray;i.length=0;for(var a=0;a3;){for(var l=r-1,u=(a=0,1);;){t:if(!o[a]){for(var c=i[l]<<1,f=i[a]<<1,p=i[u]<<1,d=n[c],m=n[c+1],v=n[f],g=n[f+1],y=n[p],E=n[p+1],w=(u+1)%r;w!=l;w=(w+1)%r)if(o[w]){var x=i[w]<<1,A=n[x],T=n[x+1];if(e.positiveArea(y,E,d,m,A,T)&&e.positiveArea(d,m,v,g,A,T)&&e.positiveArea(v,g,y,E,A,T))break t}break}if(0==u){do{if(!o[a])break;a--}while(a>0);break}l=a,a=u,u=(u+1)%r}h.push(i[(r+a-1)%r]),h.push(i[a]),h.push(i[(a+1)%r]),i.splice(a,1),o.splice(a,1);var M=(--r+a-1)%r,R=a==r?0:a;o[M]=e.isConcave(M,r,n,i),o[R]=e.isConcave(R,r,n,i)}return 3==r&&(h.push(i[2]),h.push(i[0]),h.push(i[1])),h},e.prototype.decompose=function(t,n){var r=t,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 h=-1,l=0,u=0,c=n.length;u0?(i.push(s),a.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(v),s.push(g),s.push(y),s.push(E),s.push(w),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(p),o.push(d),l=e.winding(m,v,g,y,E,w),h=f)}s.length>0&&(i.push(s),a.push(o));for(u=0,c=i.length;u=0;u--)0==(s=i[u]).length&&(i.splice(u,1),this.polygonPool.free(s),o=a[u],a.splice(u,1),this.polygonIndicesPool.free(o));return i},e.isConcave=function(t,e,n,r){var i=r[(e+t-1)%e]<<1,a=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[i],n[i+1],n[a],n[a+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,r,i,a){return t*(a-r)+n*(e-a)+i*(r-e)>=0},e.winding=function(t,e,n,r,i,a){var o=n-t,s=r-e;return i*s-a*o+o*e-t*s>=0?1:-1},e}();t.Triangulator=e}(i||(i={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.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},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var r=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),i=e-t;return r<=(n-t)/i?t+Math.sqrt(r*i*(n-t)):e-Math.sqrt((1-r)*i*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=r;var i=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=i;var a=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return o(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(i);t.Pow=a;var s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=s;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,r,i){for(var a=e,o=r;a=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=f;var p=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*a;var o=t.bone.skeleton,s=t.attachmentVertices,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=s);for(var w,x=(w=t.bone).worldX,A=w.worldY,T=w.a,M=w.b,R=w.c,I=w.d,b=e,S=i;S)?=?)"),p("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),p("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),p("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),p("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),p("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),p("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),p("COERCERTL",h[l.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",p("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),p("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("LONECARET","(?:\\^)"),p("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",p("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),p("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),p("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),p("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),p("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),p("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(k,k.exports);var L=k.exports;S(L);var O=Object.freeze({loose:!0}),V=Object.freeze({}),D=function(t){return t?"object"!==h(t)?O:t:V};S(D);var F=/^[0-9]+$/,X=function(t,e){var n=F.test(t),r=F.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tB)throw new TypeError("version is longer than ".concat(B," characters"));Y("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?W[G.LOOSE]:W[G.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>j||this.major<0)throw new TypeError("Invalid major version");if(this.minor>j||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>j||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var a=[e,r];!1===n&&(a=[e]),0===z(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=a):this.prerelease=a}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),Z=H;S(Z);var $=Z,J=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof $)return t;try{return new $(t,e)}catch(t){if(!n)return null;throw t}};S(J);var Q,K,tt=J,et=S((function(t,e){var n=tt(t,e);return n?n.version:null})),nt=Z,rt=J,it=L.safeRe,at=L.t,ot=S((function(t,e){if(t instanceof nt)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=it[at.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),it[at.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;it[at.COERCERTL].lastIndex=-1}else n=t.match(it[at.COERCE]);return null===n?null:rt("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}));var st=ht;function ht(t){var e=this;if(e instanceof ht||(e=new ht),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},ht.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},ht.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},ht.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},ht.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new ht;if(ethis.length&&(e=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(e=this.length);for(var r=this.length,i=this.tail;null!==i&&r>e;r--)i=i.prev;for(;null!==i&&r>t;r--,i=i.prev)n.push(i.value);return n},ht.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&nthis[dt])return Pt(this,this[At].get(t)),!1;var a=this[At].get(t).value;return this[Et]&&(this[wt]||this[Et](t,a.value)),a.now=r,a.maxAge=n,a.value=e,this[mt]+=i-a.length,a.length=i,this.get(t),St(this),!0}var o=new Ct(t,e,i,r,n);return o.length>this[dt]?(this[Et]&&this[Et](t,e),!1):(this[mt]+=o.length,this[xt].unshift(o),this[At].set(t,this[xt].head),St(this),!0)}},{key:"has",value:function(t){if(!this[At].has(t))return!1;var e=this[At].get(t).value;return!bt(this,e)}},{key:"get",value:function(t){return It(this,t,!0)}},{key:"peek",value:function(t){return It(this,t,!1)}},{key:"pop",value:function(){var t=this[xt].tail;return t?(Pt(this,t),t.value):null}},{key:"del",value:function(t){Pt(this,this[At].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var a=i-e;a>0&&this.set(r.k,r.v,a)}}}},{key:"prune",value:function(){var t=this;this[At].forEach((function(e,n){return It(t,n,!1)}))}}]),t}(),It=function(t,e,n){var r=t[At].get(e);if(r){var i=r.value;if(bt(t,i)){if(Pt(t,r),!t[gt])return}else n&&(t[Tt]&&(r.value.now=Date.now()),t[xt].unshiftNode(r));return i.value}},bt=function(t,e){if(!e||!e.maxAge&&!t[yt])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[yt]&&n>t[yt]},St=function(t){if(t[mt]>t[dt])for(var e=t[xt].tail;t[mt]>t[dt]&&null!==e;){var n=e.prev;Pt(t,e),e=n}},Pt=function(t,e){if(e){var n=e.value;t[Et]&&t[Et](n.key,n.value),t[mt]-=n.length,t[At].delete(n.key),t[xt].removeNode(e)}},Ct=c((function t(e,n,r,i,a){l(this,t),this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=a||0})),Nt=function(t,e,n,r){var i=n.value;bt(t,i)&&(Pt(t,n),t[gt]||(i=void 0)),i&&e.call(r,i.value,i.key,t)},_t=Rt;S(_t);var kt=Z,Lt=function(t,e,n){return new kt(t,n).compare(new kt(e,n))};S(Lt);var Ot=Lt,Vt=function(t,e,n){return 0===Ot(t,e,n)};S(Vt);var Dt=Lt,Ft=function(t,e,n){return 0!==Dt(t,e,n)};S(Ft);var Xt=Lt,Ut=function(t,e,n){return Xt(t,e,n)>0};S(Ut);var Yt=Lt,Bt=function(t,e,n){return Yt(t,e,n)>=0};S(Bt);var jt=Lt,Wt=function(t,e,n){return jt(t,e,n)<0};S(Wt);var Gt=Lt,qt=function(t,e,n){return Gt(t,e,n)<=0};S(qt);var zt,Ht,Zt,$t,Jt=Vt,Qt=Ft,Kt=Ut,te=Bt,ee=Wt,ne=qt,re=function(t,e,n,r){switch(e){case"===":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t===n;case"!==":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Jt(t,n,r);case"!=":return Qt(t,n,r);case">":return Kt(t,n,r);case">=":return te(t,n,r);case"<":return ee(t,n,r);case"<=":return ne(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function ie(){if($t)return Zt;$t=1;var t=function(){function t(e,i){var a=this;if(l(this,t),i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return a.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,h=T(this.set);try{for(h.s();!(s=h.n()).done;){var u=s.value;if(1===u.length&&v(u[0])){this.set=[u];break}}}catch(t){h.e(t)}finally{h.f()}}}this.format()}return c(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,a=((this.options.includePrerelease&&p)|(this.options.loose&&d))+":"+t,l=e.get(a);if(l)return l;var c=this.options.loose,v=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(v,N(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],h),i("comparator trim",t),t=t.replace(o[s.TILDETRIM],u),i("tilde trim",t),t=t.replace(o[s.CARETTRIM],f),i("caret trim",t);var g=t.split(" ").map((function(t){return y(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));c&&(g=g.filter((function(t){return i("loose invalid filter",t,n.options),!!t.match(o[s.COMPARATORLOOSE])}))),i("range list",g);var E,x=new Map,A=g.map((function(t){return new r(t,n.options)})),M=T(A);try{for(M.s();!(E=M.n()).done;){var R=E.value;if(m(R))return[R];x.set(R.value,R)}}catch(t){M.e(t)}finally{M.f()}x.size>1&&x.has("")&&x.delete("");var I=w(x.values());return e.set(a,I),I}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new a(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(a(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(a(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();zt=e;var n=D,r=L.safeRe,i=L.t,a=re,o=_,s=Z,h=ie();return zt}(),i=_,a=Z,o=L.safeRe,s=L.t,h=L.comparatorTrimReplace,u=L.tildeTrimReplace,f=L.caretTrimReplace,p=P.FLAG_INCLUDE_PRERELEASE,d=P.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),i=r.pop();n&&r.length;)n=r.every((function(t){return i.intersects(t,e)})),i=r.pop();return n},y=function(t,e){return i("comp",t,e),t=M(t,e),i("caret",t),t=x(t,e),i("tildes",t),t=I(t,e),i("xrange",t),t=S(t,e),i("stars",t),t},E=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){var n=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(n,(function(e,n,r,a,o){var s;return i("tilde",t,e,n,r,a,o),E(n)?s="":E(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):E(a)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(i("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(a,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(a," <").concat(n,".").concat(+r+1,".0-0"),i("tilde return",s),s}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){i("caret",t,e);var n=e.loose?o[s.CARETLOOSE]:o[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,a,o,s){var h;return i("caret",t,e,n,a,o,s),E(n)?h="":E(a)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):E(o)?h="0"===n?">=".concat(n,".").concat(a,".0").concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(i("replaceCaret pr",s),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(i("no pr"),h="0"===n?"0"===a?">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(a,".").concat(+o+1,"-0"):">=".concat(n,".").concat(a,".").concat(o).concat(r," <").concat(n,".").concat(+a+1,".0-0"):">=".concat(n,".").concat(a,".").concat(o," <").concat(+n+1,".0.0-0")),i("caret return",h),h}))},I=function(t,e){return i("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return b(t,e)})).join(" ")},b=function(t,e){t=t.trim();var n=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(n,(function(n,r,a,o,s,h){i("xRange",t,n,r,a,o,s,h);var l=E(a),u=l||E(o),c=u||E(s),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(a=+a+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?a=+a+1:o=+o+1),"<"===r&&(h="-0"),n="".concat(r+a,".").concat(o,".").concat(s).concat(h)):u?n=">=".concat(a,".0.0").concat(h," <").concat(+a+1,".0.0-0"):c&&(n=">=".concat(a,".").concat(o,".0").concat(h," <").concat(a,".").concat(+o+1,".0-0")),i("xRange return",n),n}))},S=function(t,e){return i("replaceStars",t,e),t.trim().replace(o[s.STAR],"")},C=function(t,e){return i("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?s.GTE0PRE:s.GTE0],"")},N=function(t){return function(e,n,r,i,a,o,s,h,l,u,c,f,p){return n=E(r)?"":E(i)?">=".concat(r,".0.0").concat(t?"-0":""):E(a)?">=".concat(r,".").concat(i,".0").concat(t?"-0":""):o?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=E(l)?"":E(u)?"<".concat(+l+1,".0.0-0"):E(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},k=function(t,e,n){for(var a=0;a0){var s=t[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0};return Zt}S(re);var ae,oe,se=ie(),he=function(t,e,n){try{e=new se(e,n)}catch(t){return!1}return e.test(t)},le={valid:et,coerce:ot,satisfies:S(he),SEMVER_SPEC_VERSION:C.SEMVER_SPEC_VERSION},ue=0,ce=1,fe=2,pe=[0,1,2,2,3,0],de=function(){function t(e,n,r,o){var s;if(l(this,t),f(this,"autoUpdate",!0),f(this,"skeleton",void 0),f(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===i.TextureAtlas.length){var h,u=T((s=new i.TextureAtlas(n)).pages);try{for(u.s();!(h=u.n()).done;){var c=h.value;c.setTexture(new b(o[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else s=new i.TextureAtlas(n,(function(t){return new b(o[t])}));var p=new i.SkeletonJson(new i.AtlasAttachmentLoader(s));p.scale*=.01;var d=p.readSkeletonData(r);this.skeletonVersion=le.valid(le.coerce(d.version)),this._spine_3_6_0=le.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=le.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=le.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=le.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new i.Skeleton(d),this.skeleton.updateWorldTransform(),this.stateData=new i.AnimationStateData(this.skeleton.data),this.states=[new i.AnimationState(this.stateData)],this.clipper=new i.SkeletonClipping,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}return c(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=o,n=0),t=c.material;var f=c.positions,p=c.vertexColor.r,d=c.vertexColor.g,m=c.vertexColor.b,v=c.vertexColor.a,g=c.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var h=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(h&&l){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;P(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function M(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,a=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var r=0;r0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=a,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(r=t.TimelineType||(t.TimelineType={}));var i=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,a,i){var o=.03*(2*-n+a),s=.03*(2*-r+i),h=.006*(3*(n-a)+1),l=.006*(3*(r-i)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,d=.3*r+s+.16666667*l,p=t*e.BEZIER_SIZE,m=this.curves;m[p++]=e.BEZIER;for(var v=f,g=d,y=p+e.BEZIER_SIZE-1;p=r){var u=void 0,c=void 0;return i==h?(u=0,c=0):(u=a[i-2],c=a[i-1]),c+(a[i+1]-c)*(r-u)/(s-u)}var f=a[i-1];return f+(1-f)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=i;var s=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+i.ROTATION]=n},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES]){var d=u[u.length+i.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+d*s;break;case e.first:case e.replace:d+=c.data.rotation-c.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:c.rotation+=d*s}}else{var p=a.binarySearch(u,r,i.ENTRIES),m=u[p+i.PREV_ROTATION],v=u[p],g=this.getCurvePercent((p>>1)-1,1-(r-v)/(u[p+i.PREV_TIME]-v)),y=u[p+i.ROTATION]-m;switch(y=m+(y-360*(16384-(16384.499999999996-y/360|0)))*g,h){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*s;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*s}}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_ROTATION=-1,i.ROTATION=1,i}(i);t.RotateTimeline=s;var h=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.X]=n,this.frames[t+i.Y]=r},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_X],d=u[u.length+i.PREV_Y];else{var p=a.binarySearch(u,r,i.ENTRIES);f=u[p+i.PREV_X],d=u[p+i.PREV_Y];var m=u[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(u[p+i.PREV_TIME]-m));f+=(u[p+i.X]-f)*v,d+=(u[p+i.Y]-d)*v}switch(h){case e.setup:c.x=c.data.x+f*s,c.y=c.data.y+d*s;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*s,c.y+=(c.data.y+d-c.y)*s;break;case e.add:c.x+=f*s,c.y+=d*s}}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_X=-2,i.PREV_Y=-1,i.X=1,i.Y=2,i}(i);t.TranslateTimeline=h;var l=function(i){function s(t){return i.call(this,t)||this}return o(s,i),s.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},s.prototype.apply=function(r,i,o,h,l,u,c){var f=this.frames,d=r.bones[this.boneIndex];if(d.active)if(o=f[f.length-s.ENTRIES])p=f[f.length+s.PREV_X]*d.data.scaleX,m=f[f.length+s.PREV_Y]*d.data.scaleY;else{var v=a.binarySearch(f,o,s.ENTRIES);p=f[v+s.PREV_X],m=f[v+s.PREV_Y];var g=f[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(o-g)/(f[v+s.PREV_TIME]-g));p=(p+(f[v+s.X]-p)*y)*d.data.scaleX,m=(m+(f[v+s.Y]-m)*y)*d.data.scaleY}if(1==l)u==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=m-d.data.scaleY):(d.scaleX=p,d.scaleY=m);else{var E=0,w=0;if(c==n.mixOut)switch(u){case e.setup:E=d.data.scaleX,w=d.data.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*l,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*l;break;case e.first:case e.replace:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*l,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*l;break;case e.add:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-d.data.scaleX)*l,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-d.data.scaleY)*l}else switch(u){case e.setup:E=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.data.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*l,d.scaleY=w+(m-w)*l;break;case e.first:case e.replace:E=Math.abs(d.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*l,d.scaleY=w+(m-w)*l;break;case e.add:E=t.MathUtils.signum(p),w=t.MathUtils.signum(m),d.scaleX=Math.abs(d.scaleX)*E+(p-Math.abs(d.data.scaleX)*E)*l,d.scaleY=Math.abs(d.scaleY)*w+(m-Math.abs(d.data.scaleY)*w)*l}}}},s}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,i,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(i=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],d=u[u.length+n.PREV_Y];else{var p=a.binarySearch(u,i,n.ENTRIES);f=u[p+n.PREV_X],d=u[p+n.PREV_Y];var m=u[p],v=this.getCurvePercent(p/n.ENTRIES-1,1-(i-m)/(u[p+n.PREV_TIME]-m));f+=(u[p+n.X]-f)*v,d+=(u[p+n.Y]-d)*v}switch(h){case e.setup:c.shearX=c.data.shearX+f*s,c.shearY=c.data.shearY+d*s;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*s,c.shearY+=(c.data.shearY+d-c.shearY)*s;break;case e.add:c.shearX+=f*s,c.shearY+=d*s}}},n}(h);t.ShearTimeline=u;var c=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o},i.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(r=c[c.length-i.ENTRIES]){var y=c.length;p=c[y+i.PREV_R],m=c[y+i.PREV_G],v=c[y+i.PREV_B],g=c[y+i.PREV_A]}else{var E=a.binarySearch(c,r,i.ENTRIES);p=c[E+i.PREV_R],m=c[E+i.PREV_G],v=c[E+i.PREV_B],g=c[E+i.PREV_A];var w=c[E],x=this.getCurvePercent(E/i.ENTRIES-1,1-(r-w)/(c[E+i.PREV_TIME]-w));p+=(c[E+i.R]-p)*x,m+=(c[E+i.G]-m)*x,v+=(c[E+i.B]-v)*x,g+=(c[E+i.A]-g)*x}if(1==s)u.color.set(p,m,v,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((p-f.r)*s,(m-f.g)*s,(v-f.b)*s,(g-f.a)*s)}}}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_R=-4,i.PREV_G=-3,i.PREV_B=-2,i.PREV_A=-1,i.R=1,i.G=2,i.B=3,i.A=4,i}(i);t.ColorTimeline=c;var f=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o,s,h,l){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o,this.frames[t+i.R2]=s,this.frames[t+i.G2]=h,this.frames[t+i.B2]=l},i.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(r=c[c.length-i.ENTRIES]){var A=c.length;v=c[A+i.PREV_R],g=c[A+i.PREV_G],y=c[A+i.PREV_B],E=c[A+i.PREV_A],w=c[A+i.PREV_R2],x=c[A+i.PREV_G2],T=c[A+i.PREV_B2]}else{var M=a.binarySearch(c,r,i.ENTRIES);v=c[M+i.PREV_R],g=c[M+i.PREV_G],y=c[M+i.PREV_B],E=c[M+i.PREV_A],w=c[M+i.PREV_R2],x=c[M+i.PREV_G2],T=c[M+i.PREV_B2];var I=c[M],b=this.getCurvePercent(M/i.ENTRIES-1,1-(r-I)/(c[M+i.PREV_TIME]-I));v+=(c[M+i.R]-v)*b,g+=(c[M+i.G]-g)*b,y+=(c[M+i.B]-y)*b,E+=(c[M+i.A]-E)*b,w+=(c[M+i.R2]-w)*b,x+=(c[M+i.G2]-x)*b,T+=(c[M+i.B2]-T)*b}if(1==s)u.color.set(v,g,y,E),u.darkColor.set(w,x,T,1);else{f=u.color,d=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),d.setFromColor(u.data.darkColor)),f.add((v-f.r)*s,(g-f.g)*s,(y-f.b)*s,(E-f.a)*s),d.add((w-d.r)*s,(x-d.g)*s,(T-d.b)*s,0)}}}},i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,i}(i);t.TwoColorTimeline=f;var d=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return i.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},i.prototype.apply=function(t,r,i,o,s,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=n.mixOut){var c=this.frames;if(i=c[c.length-1]?c.length-1:a.binarySearch(c,i,1)-1;var d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},i.prototype.setAttachment=function(t,e,n){e.setAttachment(null==n?null:t.getAttachment(this.slotIndex,n))},i}();t.AttachmentTimeline=d;var p=null,m=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},i.prototype.apply=function(n,r,i,o,s,h,l){var u=n.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var f=u.deform;0==f.length&&(h=e.setup);var d=this.frameVertices,p=d[0].length,m=this.frames;if(i=m[m.length-1]){var x=d[m.length-1];if(1==s)if(h==e.add)if(null==(v=c).bones){y=v.vertices;for(var T=0;Tn)this.apply(t,e,Number.MAX_VALUE,r,i,o,s),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=v;var g=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return i.prototype.getPropertyId=function(){return r.drawOrder<<24},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},i.prototype.apply=function(r,i,o,s,h,l,u){var c=r.drawOrder,f=r.slots;if(u!=n.mixOut){var d=this.frames;if(o=d[d.length-1]?d.length-1:a.binarySearch(d,o)-1;var m=this.drawOrders[p];if(null==m)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var v=0,g=m.length;v=c[c.length-s.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+s.PREV_MIX]-f.data.mix)*h,f.softness=f.data.softness+(c[c.length+s.PREV_SOFTNESS]-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+s.PREV_COMPRESS],f.stretch=0!=c[c.length+s.PREV_STRETCH])):(f.mix+=(c[c.length+s.PREV_MIX]-f.mix)*h,f.softness+=(c[c.length+s.PREV_SOFTNESS]-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+s.PREV_COMPRESS],f.stretch=0!=c[c.length+s.PREV_STRETCH]));else{var d=a.binarySearch(c,i,s.ENTRIES),p=c[d+s.PREV_MIX],m=c[d+s.PREV_SOFTNESS],v=c[d],g=this.getCurvePercent(d/s.ENTRIES-1,1-(i-v)/(c[d+s.PREV_TIME]-v));l==e.setup?(f.mix=f.data.mix+(p+(c[d+s.MIX]-p)*g-f.data.mix)*h,f.softness=f.data.softness+(m+(c[d+s.SOFTNESS]-m)*g-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[d+s.PREV_BEND_DIRECTION],f.compress=0!=c[d+s.PREV_COMPRESS],f.stretch=0!=c[d+s.PREV_STRETCH])):(f.mix+=(p+(c[d+s.MIX]-p)*g-f.mix)*h,f.softness+=(m+(c[d+s.SOFTNESS]-m)*g-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[d+s.PREV_BEND_DIRECTION],f.compress=0!=c[d+s.PREV_COMPRESS],f.stretch=0!=c[d+s.PREV_STRETCH]))}},s.ENTRIES=6,s.PREV_TIME=-6,s.PREV_MIX=-5,s.PREV_SOFTNESS=-4,s.PREV_BEND_DIRECTION=-3,s.PREV_COMPRESS=-2,s.PREV_STRETCH=-1,s.MIX=1,s.SOFTNESS=2,s.BEND_DIRECTION=3,s.COMPRESS=4,s.STRETCH=5,s}(i);t.IkConstraintTimeline=y;var E=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r,this.frames[t+i.SCALE]=a,this.frames[t+i.SHEAR]=o},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES]){var g=u.length;d=u[g+i.PREV_ROTATE],p=u[g+i.PREV_TRANSLATE],m=u[g+i.PREV_SCALE],v=u[g+i.PREV_SHEAR]}else{var y=a.binarySearch(u,r,i.ENTRIES);d=u[y+i.PREV_ROTATE],p=u[y+i.PREV_TRANSLATE],m=u[y+i.PREV_SCALE],v=u[y+i.PREV_SHEAR];var E=u[y],w=this.getCurvePercent(y/i.ENTRIES-1,1-(r-E)/(u[y+i.PREV_TIME]-E));d+=(u[y+i.ROTATE]-d)*w,p+=(u[y+i.TRANSLATE]-p)*w,m+=(u[y+i.SCALE]-m)*w,v+=(u[y+i.SHEAR]-v)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(d-f.rotateMix)*s,c.translateMix=f.translateMix+(p-f.translateMix)*s,c.scaleMix=f.scaleMix+(m-f.scaleMix)*s,c.shearMix=f.shearMix+(v-f.shearMix)*s}else c.rotateMix+=(d-c.rotateMix)*s,c.translateMix+=(p-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(v-c.shearMix)*s}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_ROTATE=-4,i.PREV_TRANSLATE=-3,i.PREV_SCALE=-2,i.PREV_SHEAR=-1,i.ROTATE=1,i.TRANSLATE=2,i.SCALE=3,i.SHEAR=4,i}(i);t.TransformConstraintTimeline=E;var w=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.VALUE]=n},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_VALUE];else{var d=a.binarySearch(u,r,i.ENTRIES);f=u[d+i.PREV_VALUE];var p=u[d],m=this.getCurvePercent(d/i.ENTRIES-1,1-(r-p)/(u[d+i.PREV_TIME]-p));f+=(u[d+i.VALUE]-f)*m}h==e.setup?c.position=c.data.position+(f-c.data.position)*s:c.position+=(f-c.position)*s}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_VALUE=-1,i.VALUE=1,i}(i);t.PathConstraintPositionTimeline=w;var x=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,i,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(i=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var d=a.binarySearch(u,i,n.ENTRIES);f=u[d+n.PREV_VALUE];var p=u[d],m=this.getCurvePercent(d/n.ENTRIES-1,1-(i-p)/(u[d+n.PREV_TIME]-p));f+=(u[d+n.VALUE]-f)*m}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*s:c.spacing+=(f-c.spacing)*s}},n}(w);t.PathConstraintSpacingTimeline=x;var T=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_ROTATE],d=u[u.length+i.PREV_TRANSLATE];else{var p=a.binarySearch(u,r,i.ENTRIES);f=u[p+i.PREV_ROTATE],d=u[p+i.PREV_TRANSLATE];var m=u[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(u[p+i.PREV_TIME]-m));f+=(u[p+i.ROTATE]-f)*v,d+=(u[p+i.TRANSLATE]-d)*v}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(d-c.data.translateMix)*s):(c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s)}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_ROTATE=-2,i.PREV_TRANSLATE=-1,i.ROTATE=1,i.TRANSLATE=2,i}(i);t.PathConstraintMixTimeline=T}(a||(a={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new n})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var o=a.next;if(null!=o){var s=a.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime+=0==a.timeScale?0:(s/a.timeScale+t)*o.timeScale,a.trackTime+=i,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&null==a.mixingFrom){e[n]=null,this.queue.end(a),this.disposeNext(a);continue}if(null!=a.mixingFrom&&this.updateMixingFrom(a,t)){var h=a.mixingFrom;for(a.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}a.trackTime+=i}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,a=this.tracks,i=!1,o=0,s=a.length;o0)){i=!0;var l=0==o?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,p=h.animation.timelines;if(0==o&&1==u||l==t.MixBlend.add)for(var m=0;m1&&(o=1),a!=t.MixBlend.first&&(a=i.mixBlend));var s=o0&&this.queueEvents(i,c),this.events.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime,o},e.prototype.applyAttachmentTimeline=function(n,r,a,i,o){var s=r.slots[n.slotIndex];if(s.bone.active){var h,l=n.frames;if(a=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,a)-1,this.setAttachment(r,s,n.attachmentNames[h],o);s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,n,r,a){n.setAttachment(null==r?null:t.getAttachment(n.data.index,r)),a&&(n.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,n,r,a,i,o,s,h){if(h&&(o[s]=0),1!=a){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(c.active){var f=0,d=0;if(r=u[u.length-t.RotateTimeline.ENTRIES])d=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),m=u[p+t.RotateTimeline.PREV_ROTATION],v=u[p],g=l.getCurvePercent((p>>1)-1,1-(r-v)/(u[p+t.RotateTimeline.PREV_TIME]-v));d=u[p+t.RotateTimeline.ROTATION]-m,d=m+(d-=360*(16384-(16384.499999999996-d/360|0)))*g+c.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var y=0,E=d-f;if(0==(E-=360*(16384-(16384.499999999996-E/360|0))))y=o[s];else{var w=0,x=0;h?(w=0,x=E):(w=o[s],x=o[s+1]);var T=E>0,A=w>=0;t.MathUtils.signum(x)!=t.MathUtils.signum(E)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),A=T),y=E+w-w%360,A!=T&&(y+=360*t.MathUtils.signum(w)),o[s]=y}o[s+1]=E,f+=y*a,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(n,0,r,null,1,i,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,o=this.events,s=0,h=o.length;sr||this.queue.event(t,l)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,r=!1):this.disposeNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i},e.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,i,!0),this.queue.drain();else if(a.next=i,r<=0){var o=a.animationEnd-a.animationStart;0!=o?(a.loop?r+=o*(1+(a.trackTime/o|0)):r+=Math.max(o,a.trackTime),r-=this.data.getMix(a.animation,e)):r=a.trackTime}return i.delay=r,i},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var a=this.addAnimationWith(t,e.emptyAnimation,!1,r);return a.mixDuration=n,a.trackEnd=n,a},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n0){o[l]=e.HOLD_MIX,s[l]=f;continue t}break}o[l]=e.HOLD_FIRST}else o[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var n=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.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},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=n;var r,a=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(o){var s={count:0},h=new Array;try{new t.TextureAtlas(o,(function(e){h.push(""==i?e:i+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)}))}catch(t){var l=t;return a.errors[e]="Couldn't load texture atlas "+e+": "+l.message,r&&r(e,"Couldn't load texture atlas "+e+": "+l.message),a.toLoad--,void a.loaded++}for(var u=function(l){var u=!1;a.loadTexture(l,(function(l,c){if(s.count++,s.count==h.length)if(u)a.errors[e]="Couldn't load texture atlas page "+l+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+l+" of atlas "+e),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(o,(function(t){return a.get(""==i?t:i+"/"+t)}));a.assets[e]=f,n&&n(e,f),a.toLoad--,a.loaded++}catch(t){var d=t;a.errors[e]="Couldn't load texture atlas "+e+": "+d.message,r&&r(e,"Couldn't load texture atlas "+e+": "+d.message),a.toLoad--,a.loaded++}}),(function(t,n){u=!0,s.count++,s.count==h.length&&(a.errors[e]="Couldn't load texture atlas page "+t+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+t+" of atlas "+e),a.toLoad--,a.loaded++)}))},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(a||(a={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");a.renderObject=a;var i=new t.RegionAttachment(n);return i.setRegion(a),i},e.prototype.newMeshAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");a.renderObject=a;var i=new t.MeshAttachment(n);return i.region=a,i},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(a||(a={})),function(t){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(a||(a={})),function(t){var e=function(){function e(t,e,n){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.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,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,r,a,i,o,s){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=a,this.ascaleY=i,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=r+90+s,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(r+o)*a*c,this.b=t.MathUtils.cosDeg(u)*i*c,this.c=t.MathUtils.sinDeg(r+o)*a*f,this.d=t.MathUtils.sinDeg(u)*i*f,this.worldX=e*c+l.x,void(this.worldY=n*f+l.y)}var d=h.a,p=h.b,m=h.c,v=h.d;switch(this.worldX=d*e+p*n+h.worldX,this.worldY=m*e+v*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=r+90+s;var g=t.MathUtils.cosDeg(r+o)*a,y=t.MathUtils.cosDeg(u)*i,E=t.MathUtils.sinDeg(r+o)*a,w=t.MathUtils.sinDeg(u)*i;return this.a=d*g+p*E,this.b=d*y+p*w,this.c=m*g+v*E,void(this.d=m*y+v*w);case t.TransformMode.OnlyTranslation:u=r+90+s;this.a=t.MathUtils.cosDeg(r+o)*a,this.b=t.MathUtils.cosDeg(u)*i,this.c=t.MathUtils.sinDeg(r+o)*a,this.d=t.MathUtils.sinDeg(u)*i;break;case t.TransformMode.NoRotationOrReflection:var x=0;(M=d*d+m*m)>1e-4?(M=Math.abs(d*v-p*m)/M,d/=this.skeleton.scaleX,p=(m/=this.skeleton.scaleY)*M,v=d*M,x=Math.atan2(m,d)*t.MathUtils.radDeg):(d=0,m=0,x=90-Math.atan2(v,p)*t.MathUtils.radDeg);var T=r+o-x,A=r+s-x+90;g=t.MathUtils.cosDeg(T)*a,y=t.MathUtils.cosDeg(A)*i,E=t.MathUtils.sinDeg(T)*a,w=t.MathUtils.sinDeg(A)*i;this.a=d*g-p*E,this.b=d*y-p*w,this.c=m*g+v*E,this.d=m*y+v*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var M,I=t.MathUtils.cosDeg(r),b=t.MathUtils.sinDeg(r),R=(d*I+p*b)/this.skeleton.scaleX,S=(m*I+v*b)/this.skeleton.scaleY;(M=Math.sqrt(R*R+S*S))>1e-5&&(M=1/M),R*=M,S*=M,M=Math.sqrt(R*R+S*S),this.data.transformMode==t.TransformMode.NoScale&&d*v-p*m<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(M=-M);var C=Math.PI/2+Math.atan2(S,R),P=Math.cos(C)*M,k=Math.sin(C)*M;g=t.MathUtils.cosDeg(o)*a,y=t.MathUtils.cosDeg(90+s)*i,E=t.MathUtils.sinDeg(o)*a,w=t.MathUtils.sinDeg(90+s)*i;this.a=R*g+P*E,this.b=R*y+P*w,this.c=S*g+k*E,this.d=S*y+k*w}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var n=e.a,r=e.b,a=e.c,i=e.d,o=1/(n*i-r*a),s=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=s*i*o-h*r*o,this.ay=h*n*o-s*a*o;var l=o*i,u=o*n,c=o*r,f=o*a,d=l*this.a-c*this.c,p=l*this.b-c*this.d,m=u*this.c-f*this.a,v=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+m*m),this.ascaleX>1e-4){var g=d*v-p*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*p+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,a=this.d,i=1/(e*a-n*r),o=t.x-this.worldX,s=t.y-this.worldY;return t.x=o*a*i-s*n*i,t.y=s*e*i-o*r*i,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,a=this.c,i=this.d,o=t.MathUtils.cosDeg(e),s=t.MathUtils.sinDeg(e);this.a=o*n-s*a,this.b=o*r-s*i,this.c=s*n+o*a,this.d=s*r+o*i,this.appliedValid=!1},e}();t.Bone=e}(a||(a={})),function(t){var e,n=function(n,r,a){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,n<0)throw new Error("index must be >= 0.");if(null==r)throw new Error("name cannot be null.");this.index=n,this.name=r,this.parent=a};t.BoneData=n,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(a||(a={})),function(t){var e=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n};t.ConstraintData=e}(a||(a={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(a||(a={})),function(t){var e=function(t){this.name=t};t.EventData=e}(a||(a={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n180?d-=360:d<-180&&(d+=360);var T=e.ascaleX,A=e.ascaleY;if(a||i){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=n-e.worldX,m=r-e.worldY}var M=e.data.length*T,I=Math.sqrt(p*p+m*m);if(a&&IM&&M>1e-4)T*=v=(I/M-1)*s+1,o&&(A*=v)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*s,T,A,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,a,i,o,s,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,f=c,d=e.ascaleY,p=n.ascaleX,m=0,v=0,g=0;c<0?(c=-c,m=180,g=-1):(m=0,g=1),d<0&&(d=-d,g=-g),p<0?(p=-p,v=180):v=0;var y=n.ax,E=0,w=0,x=0,T=e.a,A=e.b,M=e.c,I=e.d,b=Math.abs(c-d)<=1e-4;b?(w=T*y+A*(E=n.ay)+e.worldX,x=M*y+I*E+e.worldY):(E=0,w=T*y+e.worldX,x=M*y+e.worldY);var R=e.parent;T=R.a,A=R.b,M=R.c;var S,C,P=1/(T*(I=R.d)-A*M),k=w-R.worldX,N=x-R.worldY,_=(k*I-N*A)*P-l,V=(N*T-k*M)*P-u,L=Math.sqrt(_*_+V*V),O=n.data.length*p;if(L<1e-4)return this.apply1(e,r,a,!1,o,!1,h),void n.updateWorldTransformWith(y,E,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var F=((k=r-R.worldX)*I-(N=a-R.worldY)*A)*P-l,D=(N*T-k*M)*P-u,U=F*F+D*D;if(0!=s){s*=c*(p+1)/2;var B=Math.sqrt(U),X=B-L-O*c+s;if(X>0){var Y=Math.min(1,X/(2*s))-1;U=(F-=(Y=(X-s*(1-Y*Y))/B)*F)*F+(D-=Y*D)*D}}t:if(b){var W=(U-L*L-(O*=c)*O)/(2*L*O);W<-1?W=-1:W>1&&(W=1,o&&(f*=(Math.sqrt(U)/(L+O)-1)*h+1)),C=Math.acos(W)*i,T=L+O*W,A=O*Math.sin(C),S=Math.atan2(D*T-F*A,F*T+D*A)}else{var j=(T=c*O)*T,G=(A=d*O)*A,q=Math.atan2(D,F),H=-2*G*L,z=G-j;if((I=H*H-4*z*(M=G*L*L+j*U-j*G))>=0){var Z=Math.sqrt(I);H<0&&(Z=-Z);var $=(Z=-(H+Z)/2)/z,Q=M/Z,J=Math.abs($)=-1&&M<=1&&(M=Math.acos(M),(I=(k=T*Math.cos(M)+L)*k+(N=A*Math.sin(M))*N)it&&(rt=M,it=I,at=k,ot=N)),U<=(et+it)/2?(S=q-Math.atan2(nt*i,tt),C=K*i):(S=q-Math.atan2(ot*i,at),C=rt*i)}var st=Math.atan2(E,y)*g,ht=e.arotation;(S=(S-st)*t.MathUtils.radDeg+m-ht)>180?S-=360:S<-180&&(S+=360),e.updateWorldTransformWith(l,u,ht+S*h,f,e.ascaleY,0,0),ht=n.arotation,(C=((C+st)*t.MathUtils.radDeg-n.ashearX)*g+v-ht)>180?C-=360:C<-180&&(C+=360),n.updateWorldTransformWith(y,E,ht+C*h,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(a||(a={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return o(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(a||(a={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n0;if(a>0||i){var o=this.data,s=o.spacingMode==t.SpacingMode.Percent,h=o.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),m=null,v=this.spacing;if(u||!s){u&&(m=t.Utils.setArraySize(this.lengths,c));for(var g=o.spacingMode==t.SpacingMode.Length,y=0,E=f-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?B-=t.MathUtils.PI2:B<-t.MathUtils.PI&&(B+=t.MathUtils.PI2),B*=r,X=Math.cos(B),Y=Math.sin(B),k.a=X*O-Y*D,k.b=X*F-Y*U,k.c=Y*O+X*D,k.d=Y*F+X*U}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,a,i,o){var s=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*r+2),c=null,f=n.closed,d=n.worldVerticesLength,p=d/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[p-=f?1:2];if(i&&(h*=g),o)for(var y=1;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(s,d-6,4,c,0,2)),this.addAfterPosition(x-g,c,0,u,E);continue}}for(;;w++){var T=v[w];if(!(x>T)){if(0==w)x/=T;else x=(x-(Z=v[w-1]))/(T-Z);break}}w!=m&&(m=w,f&&w==p?(n.computeWorldVertices(s,d-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*w+2,8,c,0,2)),this.addCurvePosition(x,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,E,a||y>0&&0==G)}return u}f?(d+=2,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(s,2,d-4,c,0,2),n.computeWorldVertices(s,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(s,2,d,c,0,2));for(var A=t.Utils.setArraySize(this.curves,p),M=0,I=c[0],b=c[1],R=0,S=0,C=0,P=0,k=0,N=0,_=0,V=0,L=0,O=0,F=0,D=0,U=0,B=0,X=(y=0,2);yM){this.addAfterPosition(x-M,c,d-4,u,E);continue}}for(;;w++){var q=A[w];if(!(x>q)){if(0==w)x/=q;else x=(x-(Z=A[w-1]))/(q-Z);break}}if(w!=m){m=w;var H=6*w;for(I=c[H],b=c[H+1],R=c[H+2],S=c[H+3],C=c[H+4],P=c[H+5],F=2*(_=.03*(I-2*R+C))+(L=.006*(3*(R-C)-I+(k=c[H+6]))),D=2*(V=.03*(b-2*S+P))+(O=.006*(3*(S-P)-b+(N=c[H+7]))),U=.3*(R-I)+_+.16666667*L,B=.3*(S-b)+V+.16666667*O,W=Math.sqrt(U*U+B*B),Y[0]=W,H=1;H<8;H++)U+=F,B+=D,F+=L,D+=O,W+=Math.sqrt(U*U+B*B),Y[H]=W;U+=F,B+=D,W+=Math.sqrt(U*U+B*B),Y[8]=W,U+=F+L,B+=D+O,W+=Math.sqrt(U*U+B*B),Y[9]=W,j=0}for(x*=W;;j++){var z=Y[j];if(!(x>z)){var Z;if(0==j)x/=z;else x=j+(x-(Z=Y[j-1]))/(z-Z);break}}this.addCurvePosition(.1*x,I,b,R,S,C,P,k,N,u,E,a||y>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],o=e[n+1],s=e[n+2]-i,h=e[n+3]-o,l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],o=e[n+3],s=i-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,a,i,o,s,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(a-n,r-e));var f=t*t,d=f*t,p=1-t,m=p*p,v=m*p,g=p*t,y=3*g,E=p*y,w=y*t,x=e*v+r*E+i*w+s*d,T=n*v+a*E+o*w+h*d;l[u]=x,l[u+1]=T,c&&(l[u+2]=t<.001?Math.atan2(a-n,r-e):Math.atan2(T-(n*m+a*g*2+o*f),x-(e*m+r*g*2+i*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(a||(a={})),function(t){var e,n,r,a=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n}return o(e,t),e}(t.ConstraintData);t.PathConstraintData=a,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(a||(a={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),n=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,n,r){var a=this.clientAssets[t];return null==a&&(a=new e(t),this.clientAssets[t]=a),null!==n&&(a.textureLoader=n),a.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(n,{mode:"cors"}).then((function(t){return t.ok||(r.errors[n]="Couldn't load image "+n),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){r.rawAssets[n]=t}))}else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(t){r.rawAssets[n]=a},a.onerror=function(t){r.errors[n]="Couldn't load image "+n},a.src=n}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null==n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,n=0;n0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(a||(a={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var n=0;n1){var i=r[r.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(e),this.sortReset(a.children),r[r.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var n=e.target,r=n.data.index,a=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(var i=0,o=this.data.skins.length;i-1||this.updateCacheReset.push(i)}else for(a=0;a0){w=new t.DrawOrderTimeline(O);var F=a.slots.length;for(u=0;u=0;d--)U[d]=-1;var B=t.Utils.newArray(F-D,0),X=0,Y=0;for(d=0;d=0;d--)-1==U[d]&&(U[d]=B[--Y]);w.setFrame(u,y,U)}i.push(w),s=Math.max(s,w.frames[O-1])}var W=n.readInt(!0);if(W>0){for(w=new t.EventTimeline(W),u=0;u>>1^-(1&n)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),n++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),r=function(t,e,n,r,a){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r,this.inheritDeform=a},a=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(a||(a={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,n){if(null==e)throw new Error("skeleton cannot be null.");var r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,o=e.slots,s=o.length;r.length=0,i.freeAll(a),a.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,o=this.maxX,s=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(a-t)+e;if(l>i&&li&&la&&ua&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[i]-u)=u&&E<=d||E>=d&&E<=u)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(l*g-h*m)/y;if((w>=c&&w<=p||w>=p&&w<=c)&&(w>=n&&w<=a||w>=a&&w<=n))return!0}u=d,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(a||(a={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(n,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,i=t.Utils.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(n,0,a,i,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=s.length;h>1,U=this.clipOutput,B=t.Utils.setArraySize(u,k+D*p),X=0;X=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(a),u.push(i),u.push(t),u.push(e),s.length=0;for(var c=o,f=o.length-4,d=0;;d+=2){for(var p=c[d],m=c[d+1],v=c[d+2],g=c[d+3],y=p-v,E=m-g,w=u,x=u.length-2,T=s.length,A=0;A0;if(y*(I-g)-E*(M-v)>0){if(S){s.push(b),s.push(R);continue}var C=(k=R-I)*(v-p)-(N=b-M)*(g-m);if(Math.abs(C)>1e-6){var P=(N*(m-I)-k*(p-M))/C;s.push(p+(v-p)*P),s.push(m+(g-m)*P)}else s.push(p),s.push(m)}else if(S){var k,N;C=(k=R-I)*(v-p)-(N=b-M)*(g-m);if(Math.abs(C)>1e-6){P=(N*(m-I)-k*(p-M))/C;s.push(p+(v-p)*P),s.push(m+(g-m)*P)}else s.push(p),s.push(m);s.push(b),s.push(R)}l=!0}if(T==s.length)return h.length=0,!0;if(s.push(s[0]),s.push(s[1]),d==f)break;var _=s;(s=u).length=0,u=_}if(h!=s){h.length=0;d=0;for(var V=s.length-2;d>1;s=0;f--)-1==G[f]&&(G[f]=H[--Z])}w.setFrame(c++,this.getValue(j,"time",0),G)}i.push(w),o=Math.max(o,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},n.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(a||(a={})),function(t){var e,n,r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var a=function(){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};t.TextureRegion=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(r);t.FakeTexture=i}(a||(a={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,i){if(null==i)throw new Error("textureLoader cannot be null.");for(var o=new n(e),s=new Array(4),h=null;;){var l=o.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new a;u.name=l,u.page=h;var c=o.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,o.readTuple(s);var f=parseInt(s[0]),d=parseInt(s[1]);o.readTuple(s);var p=parseInt(s[0]),m=parseInt(s[1]);u.u=f/h.width,u.v=d/h.height,u.rotate?(u.u2=(f+m)/h.width,u.v2=(d+p)/h.height):(u.u2=(f+p)/h.width,u.v2=(d+m)/h.height),u.x=f,u.y=d,u.width=Math.abs(p),u.height=Math.abs(m),4==o.readTuple(s)&&4==o.readTuple(s)&&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=h.texture,this.regions.push(u)}else{(h=new r).name=l,2==o.readTuple(s)&&(h.width=parseInt(s[0]),h.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),h.minFilter=t.Texture.filterFromString(s[0]),h.magFilter=t.Texture.filterFromString(s[1]);var v=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==v?h.uWrap=t.TextureWrap.Repeat:"y"==v?h.vWrap=t.TextureWrap.Repeat:"xy"==v&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=i(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(-1==i)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=a}(a||(a={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var T=Math.cos(R),A=Math.sin(R);v.a=T*y-A*w,v.b=T*E-A*x,v.c=A*y+T*w,v.d=A*E+T*x,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var I=Math.sqrt(v.a*v.a+v.c*v.c),b=Math.sqrt(o*o+h*h);I>1e-5&&(I=(I+(b-I+this.data.offsetScaleX)*r)/I),v.a*=I,v.c*=I,I=Math.sqrt(v.b*v.b+v.d*v.d),b=Math.sqrt(s*s+l*l),I>1e-5&&(I=(I+(b-I+this.data.offsetScaleY)*r)/I),v.b*=I,v.d*=I,g=!0}if(a>0){E=v.b,x=v.d;var R,S=Math.atan2(x,E);(R=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R=S+(R+f)*a;I=Math.sqrt(E*E+x*x);v.b=Math.cos(R)*I,v.d=Math.sin(R)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,o=i.a,s=i.b,h=i.c,l=i.d,u=o*l-s*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var T=Math.cos(b),A=Math.sin(b);v.a=T*y-A*w,v.b=T*E-A*x,v.c=A*y+T*w,v.d=A*E+T*x,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var I=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*r+1;v.a*=I,v.c*=I,I=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,v.b*=I,v.d*=I,g=!0}if(a>0){var b;(b=Math.atan2(l,s)-Math.atan2(h,o))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2);E=v.b,x=v.d;b=Math.atan2(x,E)+(b-t.MathUtils.PI/2+f)*a;I=Math.sqrt(E*E+x*x);v.b=Math.cos(b)*I,v.d=Math.sin(b)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p));var m=h.ashearY;if(0!=r){u=a.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*r}h.updateWorldTransformWith(c,f,l,d,p,h.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o1e-5&&(f*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));var p=h.ashearY;0!=r&&(p+=(a.ashearY+this.data.offsetShearY)*r),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,p)}},e}();t.TransformConstraint=e}(a||(a={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,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 o(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(a||(a={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var n=t,r=t.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i3;){for(var l=r-1,u=(i=0,1);;){t:if(!o[i]){for(var c=a[l]<<1,f=a[i]<<1,d=a[u]<<1,p=n[c],m=n[c+1],v=n[f],g=n[f+1],y=n[d],E=n[d+1],w=(u+1)%r;w!=l;w=(w+1)%r)if(o[w]){var x=a[w]<<1,T=n[x],A=n[x+1];if(e.positiveArea(y,E,p,m,T,A)&&e.positiveArea(p,m,v,g,T,A)&&e.positiveArea(v,g,y,E,T,A))break t}break}if(0==u){do{if(!o[i])break;i--}while(i>0);break}l=i,i=u,u=(u+1)%r}h.push(a[(r+i-1)%r]),h.push(a[i]),h.push(a[(i+1)%r]),a.splice(i,1),o.splice(i,1);var M=(--r+i-1)%r,I=i==r?0:i;o[M]=e.isConcave(M,r,n,a),o[I]=e.isConcave(I,r,n,a)}return 3==r&&(h.push(a[2]),h.push(a[0]),h.push(a[1])),h},e.prototype.decompose=function(t,n){var r=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(a.push(s),i.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(v),s.push(g),s.push(y),s.push(E),s.push(w),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(d),o.push(p),l=e.winding(m,v,g,y,E,w),h=f)}s.length>0&&(a.push(s),i.push(o));for(u=0,c=a.length;u=0;u--)0==(s=a[u]).length&&(a.splice(u,1),this.polygonPool.free(s),o=i[u],i.splice(u,1),this.polygonIndicesPool.free(o));return a},e.isConcave=function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0},e.winding=function(t,e,n,r,a,i){var o=n-t,s=r-e;return a*s-i*o+o*e-t*s>=0?1:-1},e}();t.Triangulator=e}(a||(a={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.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},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var r=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=r;var a=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=a;var i=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return o(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(a);t.Pow=i;var s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(i);t.PowOut=s;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,o=r;i=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=f;var d=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var o=t.bone.skeleton,s=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=s);for(var w,x=(w=t.bone).worldX,T=w.worldY,A=w.a,M=w.b,I=w.c,b=w.d,R=e,S=a;S)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(_,_.exports);var V=_.exports;S(V);var L=Object.freeze({loose:!0}),O=Object.freeze({}),F=function(t){return t?"object"!==h(t)?L:t:O};S(F);var D=/^[0-9]+$/,U=function(t,e){var n=D.test(t),r=D.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tY)throw new TypeError("version is longer than ".concat(Y," characters"));X("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?j[G.LOOSE]:j[G.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>W||this.major<0)throw new TypeError("Invalid major version");if(this.minor>W||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>W||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var i=[e,r];!1===n&&(i=[e]),0===H(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),Z=z;S(Z);var $=Z,Q=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof $)return t;try{return new $(t,e)}catch(t){if(!n)return null;throw t}};S(Q);var J,K,tt=Q,et=S((function(t,e){var n=tt(t,e);return n?n.version:null})),nt=Z,rt=Q,at=V.safeRe,it=V.t,ot=S((function(t,e){if(t instanceof nt)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=at[it.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),at[it.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;at[it.COERCERTL].lastIndex=-1}else n=t.match(at[it.COERCE]);return null===n?null:rt("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}));var st=ht;function ht(t){var e=this;if(e instanceof ht||(e=new ht),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var a=0;null!==r;a++)n=t(n,r.value,a),r=r.next;return n},ht.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==r;a--)n=t(n,r.value,a),r=r.prev;return n},ht.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},ht.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},ht.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new ht;if(ethis.length&&(e=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(e=this.length);for(var r=this.length,a=this.tail;null!==a&&r>e;r--)a=a.prev;for(;null!==a&&r>t;r--,a=a.prev)n.push(a.value);return n},ht.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&nthis[pt])return Ct(this,this[Tt].get(t)),!1;var i=this[Tt].get(t).value;return this[Et]&&(this[wt]||this[Et](t,i.value)),i.now=r,i.maxAge=n,i.value=e,this[mt]+=a-i.length,i.length=a,this.get(t),St(this),!0}var o=new Pt(t,e,a,r,n);return o.length>this[pt]?(this[Et]&&this[Et](t,e),!1):(this[mt]+=o.length,this[xt].unshift(o),this[Tt].set(t,this[xt].head),St(this),!0)}},{key:"has",value:function(t){if(!this[Tt].has(t))return!1;var e=this[Tt].get(t).value;return!Rt(this,e)}},{key:"get",value:function(t){return bt(this,t,!0)}},{key:"peek",value:function(t){return bt(this,t,!1)}},{key:"pop",value:function(){var t=this[xt].tail;return t?(Ct(this,t),t.value):null}},{key:"del",value:function(t){Ct(this,this[Tt].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],a=r.e||0;if(0===a)this.set(r.k,r.v);else{var i=a-e;i>0&&this.set(r.k,r.v,i)}}}},{key:"prune",value:function(){var t=this;this[Tt].forEach((function(e,n){return bt(t,n,!1)}))}}]),t}(),bt=function(t,e,n){var r=t[Tt].get(e);if(r){var a=r.value;if(Rt(t,a)){if(Ct(t,r),!t[gt])return}else n&&(t[At]&&(r.value.now=Date.now()),t[xt].unshiftNode(r));return a.value}},Rt=function(t,e){if(!e||!e.maxAge&&!t[yt])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[yt]&&n>t[yt]},St=function(t){if(t[mt]>t[pt])for(var e=t[xt].tail;t[mt]>t[pt]&&null!==e;){var n=e.prev;Ct(t,e),e=n}},Ct=function(t,e){if(e){var n=e.value;t[Et]&&t[Et](n.key,n.value),t[mt]-=n.length,t[Tt].delete(n.key),t[xt].removeNode(e)}},Pt=c((function t(e,n,r,a,i){l(this,t),this.key=e,this.value=n,this.length=r,this.now=a,this.maxAge=i||0})),kt=function(t,e,n,r){var a=n.value;Rt(t,a)&&(Ct(t,n),t[gt]||(a=void 0)),a&&e.call(r,a.value,a.key,t)},Nt=It;S(Nt);var _t=Z,Vt=function(t,e,n){return new _t(t,n).compare(new _t(e,n))};S(Vt);var Lt=Vt,Ot=function(t,e,n){return 0===Lt(t,e,n)};S(Ot);var Ft=Vt,Dt=function(t,e,n){return 0!==Ft(t,e,n)};S(Dt);var Ut=Vt,Bt=function(t,e,n){return Ut(t,e,n)>0};S(Bt);var Xt=Vt,Yt=function(t,e,n){return Xt(t,e,n)>=0};S(Yt);var Wt=Vt,jt=function(t,e,n){return Wt(t,e,n)<0};S(jt);var Gt=Vt,qt=function(t,e,n){return Gt(t,e,n)<=0};S(qt);var Ht,zt,Zt,$t,Qt=Ot,Jt=Dt,Kt=Bt,te=Yt,ee=jt,ne=qt,re=function(t,e,n,r){switch(e){case"===":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t===n;case"!==":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Qt(t,n,r);case"!=":return Jt(t,n,r);case">":return Kt(t,n,r);case">=":return te(t,n,r);case"<":return ee(t,n,r);case"<=":return ne(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function ae(){if($t)return Zt;$t=1;var t=function(){function t(e,a){var i=this;if(l(this,t),a=n(a),e instanceof t)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new t(e.raw,a);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,h=A(this.set);try{for(h.s();!(s=h.n()).done;){var u=s.value;if(1===u.length&&v(u[0])){this.set=[u];break}}}catch(t){h.e(t)}finally{h.f()}}}this.format()}return c(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+t,l=e.get(i);if(l)return l;var c=this.options.loose,v=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(v,k(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],h),a("comparator trim",t),t=t.replace(o[s.TILDETRIM],u),a("tilde trim",t),t=t.replace(o[s.CARETTRIM],f),a("caret trim",t);var g=t.split(" ").map((function(t){return y(t,n.options)})).join(" ").split(/\s+/).map((function(t){return P(t,n.options)}));c&&(g=g.filter((function(t){return a("loose invalid filter",t,n.options),!!t.match(o[s.COMPARATORLOOSE])}))),a("range list",g);var E,x=new Map,T=g.map((function(t){return new r(t,n.options)})),M=A(T);try{for(M.s();!(E=M.n()).done;){var I=E.value;if(m(I))return[I];x.set(I.value,I)}}catch(t){M.e(t)}finally{M.f()}x.size>1&&x.has("")&&x.delete("");var b=w(x.values());return e.set(i,b),b}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new i(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(i(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(i(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();Ht=e;var n=F,r=V.safeRe,a=V.t,i=re,o=N,s=Z,h=ae();return Ht}(),a=N,i=Z,o=V.safeRe,s=V.t,h=V.comparatorTrimReplace,u=V.tildeTrimReplace,f=V.caretTrimReplace,d=C.FLAG_INCLUDE_PRERELEASE,p=C.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),a=r.pop();n&&r.length;)n=r.every((function(t){return a.intersects(t,e)})),a=r.pop();return n},y=function(t,e){return a("comp",t,e),t=M(t,e),a("caret",t),t=x(t,e),a("tildes",t),t=b(t,e),a("xrange",t),t=S(t,e),a("stars",t),t},E=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){var n=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(n,(function(e,n,r,i,o){var s;return a("tilde",t,e,n,r,i,o),E(n)?s="":E(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):E(i)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(a("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(i,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",s),s}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){a("caret",t,e);var n=e.loose?o[s.CARETLOOSE]:o[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,o,s){var h;return a("caret",t,e,n,i,o,s),E(n)?h="":E(i)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):E(o)?h="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(a("replaceCaret pr",s),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(a("no pr"),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),a("caret return",h),h}))},b=function(t,e){return a("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var n=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(n,(function(n,r,i,o,s,h){a("xRange",t,n,r,i,o,s,h);var l=E(i),u=l||E(o),c=u||E(s),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(h="-0"),n="".concat(r+i,".").concat(o,".").concat(s).concat(h)):u?n=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):c&&(n=">=".concat(i,".").concat(o,".0").concat(h," <").concat(i,".").concat(+o+1,".0-0")),a("xRange return",n),n}))},S=function(t,e){return a("replaceStars",t,e),t.trim().replace(o[s.STAR],"")},P=function(t,e){return a("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?s.GTE0PRE:s.GTE0],"")},k=function(t){return function(e,n,r,a,i,o,s,h,l,u,c,f,d){return n=E(r)?"":E(a)?">=".concat(r,".0.0").concat(t?"-0":""):E(i)?">=".concat(r,".").concat(a,".0").concat(t?"-0":""):o?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=E(l)?"":E(u)?"<".concat(+l+1,".0.0-0"):E(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},_=function(t,e,n){for(var i=0;i0){var s=t[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0};return Zt}S(re);var ie,oe,se=ae(),he=function(t,e,n){try{e=new se(e,n)}catch(t){return!1}return e.test(t)},le={valid:et,coerce:ot,satisfies:S(he),SEMVER_SPEC_VERSION:P.SEMVER_SPEC_VERSION},ue=0,ce=1,fe=2,de=[0,1,2,2,3,0],pe=function(){function t(e,n,r,o){var s;if(l(this,t),f(this,"autoUpdate",!0),f(this,"skeleton",void 0),f(this,"states",void 0),this._app=e,this._position=new i.Vec3,1===a.TextureAtlas.length){var h,u=A((s=new a.TextureAtlas(n)).pages);try{for(u.s();!(h=u.n()).done;){var c=h.value;c.setTexture(new R(o[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else s=new a.TextureAtlas(n,(function(t){return new R(o[t])}));var d=new a.SkeletonJson(new a.AtlasAttachmentLoader(s));d.scale*=.01;var p=d.readSkeletonData(r);this.skeletonVersion=le.valid(le.coerce(p.version)),this._spine_3_6_0=le.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=le.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_1_X=le.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new a.Skeleton(p),this.skeleton.updateWorldTransform(),this.stateData=new a.AnimationStateData(this.skeleton.data),this.states=[new a.AnimationState(this.stateData)],this.clipper=new a.SkeletonClipping,this._node=new i.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new i.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new i.Vec2,this._aabbTempSize=new i.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[i.LAYERID_UI],this.init(),this._hidden=!1}return c(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new i.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new i.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=o,n=0),t=c.material;var f=c.positions,d=c.vertexColor.r,p=c.vertexColor.g,m=c.vertexColor.b,v=c.vertexColor.a,g=c.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new i.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=i.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var a=new i.MeshInstance(r,this._materials[n],this._node);a.drawOrder=this.priority+this._meshInstances.length,a.visible=!this._hidden,this._meshInstances.push(a)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var h=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(h&&l){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;P(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function M(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}!function(t){var e,n,r,a=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var r=0;r0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l>>1;;){if(t[(i+1)*n]<=e?r=i+1:a=i,r==a)return(r+1)*n;i=r+a>>>1}},t.linearSearch=function(t,e,n){for(var r=0,a=t.length-n;r<=a;r+=n)if(t[r]>e)return r;return-1},t}();t.Animation=a,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(r=t.TimelineType||(t.TimelineType={}));var i=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var r=this.curves[n];return r==e.LINEAR?e.LINEAR:r==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,r,a,i){var o=.03*(2*-n+a),s=.03*(2*-r+i),h=.006*(3*(n-a)+1),l=.006*(3*(r-i)+1),u=2*o+h,c=2*s+l,f=.3*n+o+.16666667*h,d=.3*r+s+.16666667*l,p=t*e.BEZIER_SIZE,m=this.curves;m[p++]=e.BEZIER;for(var v=f,g=d,y=p+e.BEZIER_SIZE-1;p=r){var u=void 0,c=void 0;return i==h?(u=0,c=0):(u=a[i-2],c=a[i-1]),c+(a[i+1]-c)*(r-u)/(s-u)}var f=a[i-1];return f+(1-f)*(r-s)/(1-s)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=i;var s=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e<<1),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.rotate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+i.ROTATION]=n},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES]){var d=u[u.length+i.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+d*s;break;case e.first:case e.replace:d+=c.data.rotation-c.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:c.rotation+=d*s}}else{var p=a.binarySearch(u,r,i.ENTRIES),m=u[p+i.PREV_ROTATION],v=u[p],g=this.getCurvePercent((p>>1)-1,1-(r-v)/(u[p+i.PREV_TIME]-v)),y=u[p+i.ROTATION]-m;switch(y=m+(y-360*(16384-(16384.499999999996-y/360|0)))*g,h){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*s;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*s}}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_ROTATION=-1,i.ROTATION=1,i}(i);t.RotateTimeline=s;var h=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.translate<<24)+this.boneIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.X]=n,this.frames[t+i.Y]=r},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_X],d=u[u.length+i.PREV_Y];else{var p=a.binarySearch(u,r,i.ENTRIES);f=u[p+i.PREV_X],d=u[p+i.PREV_Y];var m=u[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(u[p+i.PREV_TIME]-m));f+=(u[p+i.X]-f)*v,d+=(u[p+i.Y]-d)*v}switch(h){case e.setup:c.x=c.data.x+f*s,c.y=c.data.y+d*s;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*s,c.y+=(c.data.y+d-c.y)*s;break;case e.add:c.x+=f*s,c.y+=d*s}}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_X=-2,i.PREV_Y=-1,i.X=1,i.Y=2,i}(i);t.TranslateTimeline=h;var l=function(i){function s(t){return i.call(this,t)||this}return o(s,i),s.prototype.getPropertyId=function(){return(r.scale<<24)+this.boneIndex},s.prototype.apply=function(r,i,o,h,l,u,c){var f=this.frames,d=r.bones[this.boneIndex];if(d.active)if(o=f[f.length-s.ENTRIES])p=f[f.length+s.PREV_X]*d.data.scaleX,m=f[f.length+s.PREV_Y]*d.data.scaleY;else{var v=a.binarySearch(f,o,s.ENTRIES);p=f[v+s.PREV_X],m=f[v+s.PREV_Y];var g=f[v],y=this.getCurvePercent(v/s.ENTRIES-1,1-(o-g)/(f[v+s.PREV_TIME]-g));p=(p+(f[v+s.X]-p)*y)*d.data.scaleX,m=(m+(f[v+s.Y]-m)*y)*d.data.scaleY}if(1==l)u==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=m-d.data.scaleY):(d.scaleX=p,d.scaleY=m);else{var E=0,w=0;if(c==n.mixOut)switch(u){case e.setup:E=d.data.scaleX,w=d.data.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*l,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*l;break;case e.first:case e.replace:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-E)*l,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-w)*l;break;case e.add:E=d.scaleX,w=d.scaleY,d.scaleX=E+(Math.abs(p)*t.MathUtils.signum(E)-d.data.scaleX)*l,d.scaleY=w+(Math.abs(m)*t.MathUtils.signum(w)-d.data.scaleY)*l}else switch(u){case e.setup:E=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.data.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*l,d.scaleY=w+(m-w)*l;break;case e.first:case e.replace:E=Math.abs(d.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.scaleY)*t.MathUtils.signum(m),d.scaleX=E+(p-E)*l,d.scaleY=w+(m-w)*l;break;case e.add:E=t.MathUtils.signum(p),w=t.MathUtils.signum(m),d.scaleX=Math.abs(d.scaleX)*E+(p-Math.abs(d.data.scaleX)*E)*l,d.scaleY=Math.abs(d.scaleY)*w+(m-Math.abs(d.data.scaleY)*w)*l}}}},s}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.shear<<24)+this.boneIndex},n.prototype.apply=function(t,r,i,o,s,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(i=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],d=u[u.length+n.PREV_Y];else{var p=a.binarySearch(u,i,n.ENTRIES);f=u[p+n.PREV_X],d=u[p+n.PREV_Y];var m=u[p],v=this.getCurvePercent(p/n.ENTRIES-1,1-(i-m)/(u[p+n.PREV_TIME]-m));f+=(u[p+n.X]-f)*v,d+=(u[p+n.Y]-d)*v}switch(h){case e.setup:c.shearX=c.data.shearX+f*s,c.shearY=c.data.shearY+d*s;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*s,c.shearY+=(c.data.shearY+d-c.shearY)*s;break;case e.add:c.shearX+=f*s,c.shearY+=d*s}}},n}(h);t.ShearTimeline=u;var c=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.color<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o},i.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(r=c[c.length-i.ENTRIES]){var y=c.length;p=c[y+i.PREV_R],m=c[y+i.PREV_G],v=c[y+i.PREV_B],g=c[y+i.PREV_A]}else{var E=a.binarySearch(c,r,i.ENTRIES);p=c[E+i.PREV_R],m=c[E+i.PREV_G],v=c[E+i.PREV_B],g=c[E+i.PREV_A];var w=c[E],x=this.getCurvePercent(E/i.ENTRIES-1,1-(r-w)/(c[E+i.PREV_TIME]-w));p+=(c[E+i.R]-p)*x,m+=(c[E+i.G]-m)*x,v+=(c[E+i.B]-v)*x,g+=(c[E+i.A]-g)*x}if(1==s)u.color.set(p,m,v,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((p-f.r)*s,(m-f.g)*s,(v-f.b)*s,(g-f.a)*s)}}}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_R=-4,i.PREV_G=-3,i.PREV_B=-2,i.PREV_A=-1,i.R=1,i.G=2,i.B=3,i.A=4,i}(i);t.ColorTimeline=c;var f=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.twoColor<<24)+this.slotIndex},i.prototype.setFrame=function(t,e,n,r,a,o,s,h,l){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.R]=n,this.frames[t+i.G]=r,this.frames[t+i.B]=a,this.frames[t+i.A]=o,this.frames[t+i.R2]=s,this.frames[t+i.G2]=h,this.frames[t+i.B2]=l},i.prototype.apply=function(t,n,r,o,s,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(r=c[c.length-i.ENTRIES]){var A=c.length;v=c[A+i.PREV_R],g=c[A+i.PREV_G],y=c[A+i.PREV_B],E=c[A+i.PREV_A],w=c[A+i.PREV_R2],x=c[A+i.PREV_G2],T=c[A+i.PREV_B2]}else{var M=a.binarySearch(c,r,i.ENTRIES);v=c[M+i.PREV_R],g=c[M+i.PREV_G],y=c[M+i.PREV_B],E=c[M+i.PREV_A],w=c[M+i.PREV_R2],x=c[M+i.PREV_G2],T=c[M+i.PREV_B2];var I=c[M],b=this.getCurvePercent(M/i.ENTRIES-1,1-(r-I)/(c[M+i.PREV_TIME]-I));v+=(c[M+i.R]-v)*b,g+=(c[M+i.G]-g)*b,y+=(c[M+i.B]-y)*b,E+=(c[M+i.A]-E)*b,w+=(c[M+i.R2]-w)*b,x+=(c[M+i.G2]-x)*b,T+=(c[M+i.B2]-T)*b}if(1==s)u.color.set(v,g,y,E),u.darkColor.set(w,x,T,1);else{f=u.color,d=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),d.setFromColor(u.data.darkColor)),f.add((v-f.r)*s,(g-f.g)*s,(y-f.b)*s,(E-f.a)*s),d.add((w-d.r)*s,(x-d.g)*s,(T-d.b)*s,0)}}}},i.ENTRIES=8,i.PREV_TIME=-8,i.PREV_R=-7,i.PREV_G=-6,i.PREV_B=-5,i.PREV_A=-4,i.PREV_R2=-3,i.PREV_G2=-2,i.PREV_B2=-1,i.R=1,i.G=2,i.B=3,i.A=4,i.R2=5,i.G2=6,i.B2=7,i}(i);t.TwoColorTimeline=f;var d=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return i.prototype.getPropertyId=function(){return(r.attachment<<24)+this.slotIndex},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},i.prototype.apply=function(t,r,i,o,s,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=n.mixOut){var c=this.frames;if(i=c[c.length-1]?c.length-1:a.binarySearch(c,i,1)-1;var d=this.attachmentNames[f];t.slots[this.slotIndex].setAttachment(null==d?null:t.getAttachment(this.slotIndex,d))}}else h==e.setup&&this.setAttachment(t,u,u.data.attachmentName)},i.prototype.setAttachment=function(t,e,n){e.setAttachment(null==n?null:t.getAttachment(this.slotIndex,n))},i}();t.AttachmentTimeline=d;var p=null,m=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e),r.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.deform<<27)+ +this.attachment.id+this.slotIndex},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},i.prototype.apply=function(n,r,i,o,s,h,l){var u=n.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var f=u.deform;0==f.length&&(h=e.setup);var d=this.frameVertices,p=d[0].length,m=this.frames;if(i=m[m.length-1]){var x=d[m.length-1];if(1==s)if(h==e.add)if(null==(v=c).bones){y=v.vertices;for(var T=0;Tn)this.apply(t,e,Number.MAX_VALUE,r,i,o,s),e=-1;else if(e>=h[l-1])return;if(!(n0&&h[u-1]==c;)u--;for(;u=h[u];u++)r.push(this.events[u])}}},e}();t.EventTimeline=v;var g=function(){function i(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return i.prototype.getPropertyId=function(){return r.drawOrder<<24},i.prototype.getFrameCount=function(){return this.frames.length},i.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},i.prototype.apply=function(r,i,o,s,h,l,u){var c=r.drawOrder,f=r.slots;if(u!=n.mixOut){var d=this.frames;if(o=d[d.length-1]?d.length-1:a.binarySearch(d,o)-1;var m=this.drawOrders[p];if(null==m)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var v=0,g=m.length;v=c[c.length-s.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+s.PREV_MIX]-f.data.mix)*h,f.softness=f.data.softness+(c[c.length+s.PREV_SOFTNESS]-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+s.PREV_COMPRESS],f.stretch=0!=c[c.length+s.PREV_STRETCH])):(f.mix+=(c[c.length+s.PREV_MIX]-f.mix)*h,f.softness+=(c[c.length+s.PREV_SOFTNESS]-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[c.length+s.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+s.PREV_COMPRESS],f.stretch=0!=c[c.length+s.PREV_STRETCH]));else{var d=a.binarySearch(c,i,s.ENTRIES),p=c[d+s.PREV_MIX],m=c[d+s.PREV_SOFTNESS],v=c[d],g=this.getCurvePercent(d/s.ENTRIES-1,1-(i-v)/(c[d+s.PREV_TIME]-v));l==e.setup?(f.mix=f.data.mix+(p+(c[d+s.MIX]-p)*g-f.data.mix)*h,f.softness=f.data.softness+(m+(c[d+s.SOFTNESS]-m)*g-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[d+s.PREV_BEND_DIRECTION],f.compress=0!=c[d+s.PREV_COMPRESS],f.stretch=0!=c[d+s.PREV_STRETCH])):(f.mix+=(p+(c[d+s.MIX]-p)*g-f.mix)*h,f.softness+=(m+(c[d+s.SOFTNESS]-m)*g-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[d+s.PREV_BEND_DIRECTION],f.compress=0!=c[d+s.PREV_COMPRESS],f.stretch=0!=c[d+s.PREV_STRETCH]))}},s.ENTRIES=6,s.PREV_TIME=-6,s.PREV_MIX=-5,s.PREV_SOFTNESS=-4,s.PREV_BEND_DIRECTION=-3,s.PREV_COMPRESS=-2,s.PREV_STRETCH=-1,s.MIX=1,s.SOFTNESS=2,s.BEND_DIRECTION=3,s.COMPRESS=4,s.STRETCH=5,s}(i);t.IkConstraintTimeline=y;var E=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.transformConstraint<<24)+this.transformConstraintIndex},i.prototype.setFrame=function(t,e,n,r,a,o){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r,this.frames[t+i.SCALE]=a,this.frames[t+i.SHEAR]=o},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES]){var g=u.length;d=u[g+i.PREV_ROTATE],p=u[g+i.PREV_TRANSLATE],m=u[g+i.PREV_SCALE],v=u[g+i.PREV_SHEAR]}else{var y=a.binarySearch(u,r,i.ENTRIES);d=u[y+i.PREV_ROTATE],p=u[y+i.PREV_TRANSLATE],m=u[y+i.PREV_SCALE],v=u[y+i.PREV_SHEAR];var E=u[y],w=this.getCurvePercent(y/i.ENTRIES-1,1-(r-E)/(u[y+i.PREV_TIME]-E));d+=(u[y+i.ROTATE]-d)*w,p+=(u[y+i.TRANSLATE]-p)*w,m+=(u[y+i.SCALE]-m)*w,v+=(u[y+i.SHEAR]-v)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(d-f.rotateMix)*s,c.translateMix=f.translateMix+(p-f.translateMix)*s,c.scaleMix=f.scaleMix+(m-f.scaleMix)*s,c.shearMix=f.shearMix+(v-f.shearMix)*s}else c.rotateMix+=(d-c.rotateMix)*s,c.translateMix+=(p-c.translateMix)*s,c.scaleMix+=(m-c.scaleMix)*s,c.shearMix+=(v-c.shearMix)*s}},i.ENTRIES=5,i.PREV_TIME=-5,i.PREV_ROTATE=-4,i.PREV_TRANSLATE=-3,i.PREV_SCALE=-2,i.PREV_SHEAR=-1,i.ROTATE=1,i.TRANSLATE=2,i.SCALE=3,i.SHEAR=4,i}(i);t.TransformConstraintTimeline=E;var w=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintPosition<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.VALUE]=n},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_VALUE];else{var d=a.binarySearch(u,r,i.ENTRIES);f=u[d+i.PREV_VALUE];var p=u[d],m=this.getCurvePercent(d/i.ENTRIES-1,1-(r-p)/(u[d+i.PREV_TIME]-p));f+=(u[d+i.VALUE]-f)*m}h==e.setup?c.position=c.data.position+(f-c.data.position)*s:c.position+=(f-c.position)*s}},i.ENTRIES=2,i.PREV_TIME=-2,i.PREV_VALUE=-1,i.VALUE=1,i}(i);t.PathConstraintPositionTimeline=w;var x=function(t){function n(e){return t.call(this,e)||this}return o(n,t),n.prototype.getPropertyId=function(){return(r.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,r,i,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(i=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var d=a.binarySearch(u,i,n.ENTRIES);f=u[d+n.PREV_VALUE];var p=u[d],m=this.getCurvePercent(d/n.ENTRIES-1,1-(i-p)/(u[d+n.PREV_TIME]-p));f+=(u[d+n.VALUE]-f)*m}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*s:c.spacing+=(f-c.spacing)*s}},n}(w);t.PathConstraintSpacingTimeline=x;var T=function(n){function i(e){var r=n.call(this,e)||this;return r.frames=t.Utils.newFloatArray(e*i.ENTRIES),r}return o(i,n),i.prototype.getPropertyId=function(){return(r.pathConstraintMix<<24)+this.pathConstraintIndex},i.prototype.setFrame=function(t,e,n,r){t*=i.ENTRIES,this.frames[t]=e,this.frames[t+i.ROTATE]=n,this.frames[t+i.TRANSLATE]=r},i.prototype.apply=function(t,n,r,o,s,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r=u[u.length-i.ENTRIES])f=u[u.length+i.PREV_ROTATE],d=u[u.length+i.PREV_TRANSLATE];else{var p=a.binarySearch(u,r,i.ENTRIES);f=u[p+i.PREV_ROTATE],d=u[p+i.PREV_TRANSLATE];var m=u[p],v=this.getCurvePercent(p/i.ENTRIES-1,1-(r-m)/(u[p+i.PREV_TIME]-m));f+=(u[p+i.ROTATE]-f)*v,d+=(u[p+i.TRANSLATE]-d)*v}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*s,c.translateMix=c.data.translateMix+(d-c.data.translateMix)*s):(c.rotateMix+=(f-c.rotateMix)*s,c.translateMix+=(d-c.translateMix)*s)}},i.ENTRIES=3,i.PREV_TIME=-3,i.PREV_ROTATE=-2,i.PREV_TRANSLATE=-1,i.ROTATE=1,i.TRANSLATE=2,i}(i);t.PathConstraintMixTimeline=T}(a||(a={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new a(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool((function(){return new n})),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var o=a.next;if(null!=o){var s=a.trackLast-o.delay;if(s>=0){for(o.delay=0,o.trackTime+=0==a.timeScale?0:(s/a.timeScale+t)*o.timeScale,a.trackTime+=i,this.setCurrent(n,o,!0);null!=o.mixingFrom;)o.mixTime+=t,o=o.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&null==a.mixingFrom){e[n]=null,this.queue.end(a),this.disposeNext(a);continue}if(null!=a.mixingFrom&&this.updateMixingFrom(a,t)){var h=a.mixingFrom;for(a.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}a.trackTime+=i}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var r=this.events,a=this.tracks,i=!1,o=0,s=a.length;o0)){i=!0;var l=0==o?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,p=h.animation.timelines;if(0==o&&1==u||l==t.MixBlend.add)for(var m=0;m1&&(o=1),a!=t.MixBlend.first&&(a=i.mixBlend));var s=o0&&this.queueEvents(i,c),this.events.length=0,i.nextAnimationLast=c,i.nextTrackLast=i.trackTime,o},e.prototype.applyAttachmentTimeline=function(n,r,a,i,o){var s=r.slots[n.slotIndex];if(s.bone.active){var h,l=n.frames;if(a=l[l.length-1]?l.length-1:t.Animation.binarySearch(l,a)-1,this.setAttachment(r,s,n.attachmentNames[h],o);s.attachmentState<=this.unkeyedState&&(s.attachmentState=this.unkeyedState+e.SETUP)}},e.prototype.setAttachment=function(t,n,r,a){n.setAttachment(null==r?null:t.getAttachment(n.data.index,r)),a&&(n.attachmentState=this.unkeyedState+e.CURRENT)},e.prototype.applyRotateTimeline=function(e,n,r,a,i,o,s,h){if(h&&(o[s]=0),1!=a){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(c.active){var f=0,d=0;if(r=u[u.length-t.RotateTimeline.ENTRIES])d=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,r,t.RotateTimeline.ENTRIES),m=u[p+t.RotateTimeline.PREV_ROTATION],v=u[p],g=l.getCurvePercent((p>>1)-1,1-(r-v)/(u[p+t.RotateTimeline.PREV_TIME]-v));d=u[p+t.RotateTimeline.ROTATION]-m,d=m+(d-=360*(16384-(16384.499999999996-d/360|0)))*g+c.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var y=0,E=d-f;if(0==(E-=360*(16384-(16384.499999999996-E/360|0))))y=o[s];else{var w=0,x=0;h?(w=0,x=E):(w=o[s],x=o[s+1]);var T=E>0,A=w>=0;t.MathUtils.signum(x)!=t.MathUtils.signum(E)&&Math.abs(x)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),A=T),y=E+w-w%360,A!=T&&(y+=360*t.MathUtils.signum(w)),o[s]=y}o[s+1]=E,f+=y*a,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(n,0,r,null,1,i,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,o=this.events,s=0,h=o.length;sr||this.queue.event(t,l)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var r=n.mixingFrom;if(null==r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,null!=r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,null!=r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);null!=a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.disposeNext(a),a=a.mixingFrom,r=!1):this.disposeNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i},e.prototype.addAnimation=function(t,e,n,r){var a=this.data.skeletonData.findAnimation(e);if(null==a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)},e.prototype.addAnimationWith=function(t,e,n,r){if(null==e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(null!=a)for(;null!=a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);if(null==a)this.setCurrent(t,i,!0),this.queue.drain();else if(a.next=i,r<=0){var o=a.animationEnd-a.animationStart;0!=o?(a.loop?r+=o*(1+(a.trackTime/o|0)):r+=Math.max(o,a.trackTime),r-=this.data.getMix(a.animation,e)):r=a.trackTime}return i.delay=r,i},e.prototype.setEmptyAnimation=function(t,n){var r=this.setAnimationWith(t,e.emptyAnimation,!1);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.addEmptyAnimation=function(t,n,r){r<=0&&(r-=n);var a=this.addAnimationWith(t,e.emptyAnimation,!1,r);return a.mixDuration=n,a.trackEnd=n,a},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n0){o[l]=e.HOLD_MIX,s[l]=f;continue t}break}o[l]=e.HOLD_FIRST}else o[l]=e.SUBSEQUENT}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD_SUBSEQUENT=2,e.HOLD_FIRST=3,e.HOLD_MIX=4,e.SETUP=1,e.CURRENT=2,e}();t.AnimationState=e;var n=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.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},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=n;var r,a=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(r.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(r.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(r.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(r.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(r.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(r.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n=0?e.substring(0,e.lastIndexOf("/")):"";e=this.pathPrefix+e,this.toLoad++,this.downloadText(e,(function(o){var s={count:0},h=new Array;try{new t.TextureAtlas(o,(function(e){h.push(""==i?e:i+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)}))}catch(t){var l=t;return a.errors[e]="Couldn't load texture atlas "+e+": "+l.message,r&&r(e,"Couldn't load texture atlas "+e+": "+l.message),a.toLoad--,void a.loaded++}for(var u=function(l){var u=!1;a.loadTexture(l,(function(l,c){if(s.count++,s.count==h.length)if(u)a.errors[e]="Couldn't load texture atlas page "+l+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+l+" of atlas "+e),a.toLoad--,a.loaded++;else try{var f=new t.TextureAtlas(o,(function(t){return a.get(""==i?t:i+"/"+t)}));a.assets[e]=f,n&&n(e,f),a.toLoad--,a.loaded++}catch(t){var d=t;a.errors[e]="Couldn't load texture atlas "+e+": "+d.message,r&&r(e,"Couldn't load texture atlas "+e+": "+d.message),a.toLoad--,a.loaded++}}),(function(t,n){u=!0,s.count++,s.count==h.length&&(a.errors[e]="Couldn't load texture atlas page "+t+"} of atlas "+e,r&&r(e,"Couldn't load texture atlas page "+t+" of atlas "+e),a.toLoad--,a.loaded++)}))},c=0,f=h;c0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(a||(a={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (region attachment: "+n+")");a.renderObject=a;var i=new t.RegionAttachment(n);return i.setRegion(a),i},e.prototype.newMeshAttachment=function(e,n,r){var a=this.atlas.findRegion(r);if(null==a)throw new Error("Region not found in atlas: "+r+" (mesh attachment: "+n+")");a.renderObject=a;var i=new t.MeshAttachment(n);return i.region=a,i},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(a||(a={})),function(t){var e;(e=t.BlendMode||(t.BlendMode={}))[e.Normal=0]="Normal",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.Screen=3]="Screen"}(a||(a={})),function(t){var e=function(){function e(t,e,n){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.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,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,r,a,i,o,s){this.ax=e,this.ay=n,this.arotation=r,this.ascaleX=a,this.ascaleY=i,this.ashearX=o,this.ashearY=s,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=r+90+s,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(r+o)*a*c,this.b=t.MathUtils.cosDeg(u)*i*c,this.c=t.MathUtils.sinDeg(r+o)*a*f,this.d=t.MathUtils.sinDeg(u)*i*f,this.worldX=e*c+l.x,void(this.worldY=n*f+l.y)}var d=h.a,p=h.b,m=h.c,v=h.d;switch(this.worldX=d*e+p*n+h.worldX,this.worldY=m*e+v*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=r+90+s;var g=t.MathUtils.cosDeg(r+o)*a,y=t.MathUtils.cosDeg(u)*i,E=t.MathUtils.sinDeg(r+o)*a,w=t.MathUtils.sinDeg(u)*i;return this.a=d*g+p*E,this.b=d*y+p*w,this.c=m*g+v*E,void(this.d=m*y+v*w);case t.TransformMode.OnlyTranslation:u=r+90+s;this.a=t.MathUtils.cosDeg(r+o)*a,this.b=t.MathUtils.cosDeg(u)*i,this.c=t.MathUtils.sinDeg(r+o)*a,this.d=t.MathUtils.sinDeg(u)*i;break;case t.TransformMode.NoRotationOrReflection:var x=0;(M=d*d+m*m)>1e-4?(M=Math.abs(d*v-p*m)/M,d/=this.skeleton.scaleX,p=(m/=this.skeleton.scaleY)*M,v=d*M,x=Math.atan2(m,d)*t.MathUtils.radDeg):(d=0,m=0,x=90-Math.atan2(v,p)*t.MathUtils.radDeg);var T=r+o-x,A=r+s-x+90;g=t.MathUtils.cosDeg(T)*a,y=t.MathUtils.cosDeg(A)*i,E=t.MathUtils.sinDeg(T)*a,w=t.MathUtils.sinDeg(A)*i;this.a=d*g-p*E,this.b=d*y-p*w,this.c=m*g+v*E,this.d=m*y+v*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var M,I=t.MathUtils.cosDeg(r),b=t.MathUtils.sinDeg(r),R=(d*I+p*b)/this.skeleton.scaleX,S=(m*I+v*b)/this.skeleton.scaleY;(M=Math.sqrt(R*R+S*S))>1e-5&&(M=1/M),R*=M,S*=M,M=Math.sqrt(R*R+S*S),this.data.transformMode==t.TransformMode.NoScale&&d*v-p*m<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(M=-M);var C=Math.PI/2+Math.atan2(S,R),P=Math.cos(C)*M,k=Math.sin(C)*M;g=t.MathUtils.cosDeg(o)*a,y=t.MathUtils.cosDeg(90+s)*i,E=t.MathUtils.sinDeg(o)*a,w=t.MathUtils.sinDeg(90+s)*i;this.a=R*g+P*E,this.b=R*y+P*w,this.c=S*g+k*E,this.d=S*y+k*w}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var n=e.a,r=e.b,a=e.c,i=e.d,o=1/(n*i-r*a),s=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=s*i*o-h*r*o,this.ay=h*n*o-s*a*o;var l=o*i,u=o*n,c=o*r,f=o*a,d=l*this.a-c*this.c,p=l*this.b-c*this.d,m=u*this.c-f*this.a,v=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+m*m),this.ascaleX>1e-4){var g=d*v-p*m;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*p+m*v,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(m,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+v*v),this.ashearY=0,this.arotation=90-Math.atan2(v,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,r=this.c,a=this.d,i=1/(e*a-n*r),o=t.x-this.worldX,s=t.y-this.worldY;return t.x=o*a*i-s*n*i,t.y=s*e*i-o*r*i,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*r,this.d*r-this.b*n)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var n=t.MathUtils.sinDeg(e),r=t.MathUtils.cosDeg(e);return Math.atan2(r*this.c+n*this.d,r*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,r=this.b,a=this.c,i=this.d,o=t.MathUtils.cosDeg(e),s=t.MathUtils.sinDeg(e);this.a=o*n-s*a,this.b=o*r-s*i,this.c=s*n+o*a,this.d=s*r+o*i,this.appliedValid=!1},e}();t.Bone=e}(a||(a={})),function(t){var e,n=function(n,r,a){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,n<0)throw new Error("index must be >= 0.");if(null==r)throw new Error("name cannot be null.");this.index=n,this.name=r,this.parent=a};t.BoneData=n,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(a||(a={})),function(t){var e=function(t,e,n){this.name=t,this.order=e,this.skinRequired=n};t.ConstraintData=e}(a||(a={})),function(t){var e=function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e};t.Event=e}(a||(a={})),function(t){var e=function(t){this.name=t};t.EventData=e}(a||(a={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n180?d-=360:d<-180&&(d+=360);var T=e.ascaleX,A=e.ascaleY;if(a||i){switch(e.data.transformMode){case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:p=n-e.worldX,m=r-e.worldY}var M=e.data.length*T,I=Math.sqrt(p*p+m*m);if(a&&IM&&M>1e-4)T*=v=(I/M-1)*s+1,o&&(A*=v)}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+d*s,T,A,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,r,a,i,o,s,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,f=c,d=e.ascaleY,p=n.ascaleX,m=0,v=0,g=0;c<0?(c=-c,m=180,g=-1):(m=0,g=1),d<0&&(d=-d,g=-g),p<0?(p=-p,v=180):v=0;var y=n.ax,E=0,w=0,x=0,T=e.a,A=e.b,M=e.c,I=e.d,b=Math.abs(c-d)<=1e-4;b?(w=T*y+A*(E=n.ay)+e.worldX,x=M*y+I*E+e.worldY):(E=0,w=T*y+e.worldX,x=M*y+e.worldY);var R=e.parent;T=R.a,A=R.b,M=R.c;var S,C,P=1/(T*(I=R.d)-A*M),k=w-R.worldX,N=x-R.worldY,_=(k*I-N*A)*P-l,V=(N*T-k*M)*P-u,L=Math.sqrt(_*_+V*V),O=n.data.length*p;if(L<1e-4)return this.apply1(e,r,a,!1,o,!1,h),void n.updateWorldTransformWith(y,E,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var F=((k=r-R.worldX)*I-(N=a-R.worldY)*A)*P-l,D=(N*T-k*M)*P-u,U=F*F+D*D;if(0!=s){s*=c*(p+1)/2;var B=Math.sqrt(U),X=B-L-O*c+s;if(X>0){var Y=Math.min(1,X/(2*s))-1;U=(F-=(Y=(X-s*(1-Y*Y))/B)*F)*F+(D-=Y*D)*D}}t:if(b){var W=(U-L*L-(O*=c)*O)/(2*L*O);W<-1?W=-1:W>1&&(W=1,o&&(f*=(Math.sqrt(U)/(L+O)-1)*h+1)),C=Math.acos(W)*i,T=L+O*W,A=O*Math.sin(C),S=Math.atan2(D*T-F*A,F*T+D*A)}else{var j=(T=c*O)*T,G=(A=d*O)*A,q=Math.atan2(D,F),H=-2*G*L,z=G-j;if((I=H*H-4*z*(M=G*L*L+j*U-j*G))>=0){var Z=Math.sqrt(I);H<0&&(Z=-Z);var $=(Z=-(H+Z)/2)/z,Q=M/Z,J=Math.abs($)=-1&&M<=1&&(M=Math.acos(M),(I=(k=T*Math.cos(M)+L)*k+(N=A*Math.sin(M))*N)it&&(rt=M,it=I,at=k,ot=N)),U<=(et+it)/2?(S=q-Math.atan2(nt*i,tt),C=K*i):(S=q-Math.atan2(ot*i,at),C=rt*i)}var st=Math.atan2(E,y)*g,ht=e.arotation;(S=(S-st)*t.MathUtils.radDeg+m-ht)>180?S-=360:S<-180&&(S+=360),e.updateWorldTransformWith(l,u,ht+S*h,f,e.ascaleY,0,0),ht=n.arotation,(C=((C+st)*t.MathUtils.radDeg-n.ashearX)*g+v-ht)>180?C-=360:C<-180&&(C+=360),n.updateWorldTransformWith(y,E,ht+C*h,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(a||(a={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return o(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(a||(a={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,r=t.bones.length;n0;if(a>0||i){var o=this.data,s=o.spacingMode==t.SpacingMode.Percent,h=o.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),m=null,v=this.spacing;if(u||!s){u&&(m=t.Utils.setArraySize(this.lengths,c));for(var g=o.spacingMode==t.SpacingMode.Length,y=0,E=f-1;y0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;yt.MathUtils.PI?B-=t.MathUtils.PI2:B<-t.MathUtils.PI&&(B+=t.MathUtils.PI2),B*=r,X=Math.cos(B),Y=Math.sin(B),k.a=X*O-Y*D,k.b=X*F-Y*U,k.c=Y*O+X*D,k.d=Y*F+X*U}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,r,a,i,o){var s=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*r+2),c=null,f=n.closed,d=n.worldVerticesLength,p=d/6,m=e.NONE;if(!n.constantSpeed){var v=n.lengths,g=v[p-=f?1:2];if(i&&(h*=g),o)for(var y=1;yg){m!=e.AFTER&&(m=e.AFTER,n.computeWorldVertices(s,d-6,4,c,0,2)),this.addAfterPosition(x-g,c,0,u,E);continue}}for(;;w++){var T=v[w];if(!(x>T)){if(0==w)x/=T;else x=(x-(Z=v[w-1]))/(T-Z);break}}w!=m&&(m=w,f&&w==p?(n.computeWorldVertices(s,d-4,4,c,0,2),n.computeWorldVertices(s,0,4,c,4,2)):n.computeWorldVertices(s,6*w+2,8,c,0,2)),this.addCurvePosition(x,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,E,a||y>0&&0==G)}return u}f?(d+=2,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(s,2,d-4,c,0,2),n.computeWorldVertices(s,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(s,2,d,c,0,2));for(var A=t.Utils.setArraySize(this.curves,p),M=0,I=c[0],b=c[1],R=0,S=0,C=0,P=0,k=0,N=0,_=0,V=0,L=0,O=0,F=0,D=0,U=0,B=0,X=(y=0,2);yM){this.addAfterPosition(x-M,c,d-4,u,E);continue}}for(;;w++){var q=A[w];if(!(x>q)){if(0==w)x/=q;else x=(x-(Z=A[w-1]))/(q-Z);break}}if(w!=m){m=w;var H=6*w;for(I=c[H],b=c[H+1],R=c[H+2],S=c[H+3],C=c[H+4],P=c[H+5],F=2*(_=.03*(I-2*R+C))+(L=.006*(3*(R-C)-I+(k=c[H+6]))),D=2*(V=.03*(b-2*S+P))+(O=.006*(3*(S-P)-b+(N=c[H+7]))),U=.3*(R-I)+_+.16666667*L,B=.3*(S-b)+V+.16666667*O,W=Math.sqrt(U*U+B*B),Y[0]=W,H=1;H<8;H++)U+=F,B+=D,F+=L,D+=O,W+=Math.sqrt(U*U+B*B),Y[H]=W;U+=F,B+=D,W+=Math.sqrt(U*U+B*B),Y[8]=W,U+=F+L,B+=D+O,W+=Math.sqrt(U*U+B*B),Y[9]=W,j=0}for(x*=W;;j++){var z=Y[j];if(!(x>z)){var Z;if(0==j)x/=z;else x=j+(x-(Z=Y[j-1]))/(z-Z);break}}this.addCurvePosition(.1*x,I,b,R,S,C,P,k,N,u,E,a||y>0&&0==G)}return u},e.prototype.addBeforePosition=function(t,e,n,r,a){var i=e[n],o=e[n+1],s=e[n+2]-i,h=e[n+3]-o,l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},e.prototype.addAfterPosition=function(t,e,n,r,a){var i=e[n+2],o=e[n+3],s=i-e[n],h=o-e[n+1],l=Math.atan2(h,s);r[a]=i+t*Math.cos(l),r[a+1]=o+t*Math.sin(l),r[a+2]=l},e.prototype.addCurvePosition=function(t,e,n,r,a,i,o,s,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(a-n,r-e));var f=t*t,d=f*t,p=1-t,m=p*p,v=m*p,g=p*t,y=3*g,E=p*y,w=y*t,x=e*v+r*E+i*w+s*d,T=n*v+a*E+o*w+h*d;l[u]=x,l[u+1]=T,c&&(l[u+2]=t<.001?Math.atan2(a-n,r-e):Math.atan2(T-(n*m+a*g*2+o*f),x-(e*m+r*g*2+i*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(a||(a={})),function(t){var e,n,r,a=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n}return o(e,t),e}(t.ConstraintData);t.PathConstraintData=a,(e=t.PositionMode||(t.PositionMode={}))[e.Fixed=0]="Fixed",e[e.Percent=1]="Percent",(n=t.SpacingMode||(t.SpacingMode={}))[n.Length=0]="Length",n[n.Fixed=1]="Fixed",n[n.Percent=2]="Percent",(r=t.RotateMode||(t.RotateMode={}))[r.Tangent=0]="Tangent",r[r.Chain=1]="Chain",r[r.ChainScale=2]="ChainScale"}(a||(a={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),n=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,n,r){var a=this.clientAssets[t];return null==a&&(a=new e(t),this.clientAssets[t]=a),null!==n&&(a.textureLoader=n),a.toLoad.push(r),this.queuedAssets[r]!==r&&(this.queuedAssets[r]=r,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=r.responseText:n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var r=new XMLHttpRequest;r.overrideMimeType("text/html"),r.onreadystatechange=function(){r.readyState==XMLHttpRequest.DONE&&(r.status>=200&&r.status<300?n.rawAssets[e]=JSON.parse(r.responseText):n.errors[e]="Couldn't load text "+e+": status "+r.status+", "+r.responseText)},r.open("GET",e,!0),r.send()}},t.prototype.loadTexture=function(t,e,n){var r=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n))if(!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts){fetch(n,{mode:"cors"}).then((function(t){return t.ok||(r.errors[n]="Couldn't load image "+n),t.blob()})).then((function(t){return createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"})})).then((function(t){r.rawAssets[n]=t}))}else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(t){r.rawAssets[n]=a},a.onerror=function(t){r.errors[n]="Couldn't load image "+n},a.src=n}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null==n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document)&&"undefined"!=typeof importScripts,n=0;n0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(a||(a={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var n=0;n1){var i=r[r.length-1];this._updateCache.indexOf(i)>-1||this.updateCacheReset.push(i)}this._updateCache.push(e),this.sortReset(a.children),r[r.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var n=e.target,r=n.data.index,a=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,r,a),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,r,a);for(var i=0,o=this.data.skins.length;i-1||this.updateCacheReset.push(i)}else for(a=0;a0){w=new t.DrawOrderTimeline(O);var F=a.slots.length;for(u=0;u=0;d--)U[d]=-1;var B=t.Utils.newArray(F-D,0),X=0,Y=0;for(d=0;d=0;d--)-1==U[d]&&(U[d]=B[--Y]);w.setFrame(u,y,U)}i.push(w),s=Math.max(s,w.frames[O-1])}var W=n.readInt(!0);if(W>0){for(w=new t.EventTimeline(W),u=0;u>>1^-(1&n)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),n++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),r=function(t,e,n,r,a){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=r,this.inheritDeform=a},a=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(a||(a={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool((function(){return t.Utils.newFloatArray(16)}))}return e.prototype.update=function(e,n){if(null==e)throw new Error("skeleton cannot be null.");var r=this.boundingBoxes,a=this.polygons,i=this.polygonPool,o=e.slots,s=o.length;r.length=0,i.freeAll(a),a.length=0;for(var h=0;h=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,r){var a=this.minX,i=this.minY,o=this.maxX,s=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=o&&n>=o||e>=s&&r>=s)return!1;var h=(r-e)/(n-t),l=h*(a-t)+e;if(l>i&&li&&la&&ua&&ut.minX&&this.minYt.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||l=n){var u=r[s];u+(n-h)/(l-h)*(r[i]-u)=u&&E<=d||E>=d&&E<=u)&&(E>=e&&E<=r||E>=r&&E<=e)){var w=(l*g-h*m)/y;if((w>=c&&w<=p||w>=p&&w<=c)&&(w>=n&&w<=a||w>=a&&w<=n))return!0}u=d,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(a||(a={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(n,r){if(null!=this.clipAttachment)return 0;this.clipAttachment=r;var a=r.worldVerticesLength,i=t.Utils.setArraySize(this.clippingPolygon,a);r.computeWorldVertices(n,0,a,i,0,2);var o=this.clippingPolygon;e.makeClockwise(o);for(var s=this.clippingPolygons=this.triangulator.decompose(o,this.triangulator.triangulate(o)),h=0,l=s.length;h>1,U=this.clipOutput,B=t.Utils.setArraySize(u,k+D*p),X=0;X=2?(u=s,s=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(r),u.push(a),u.push(i),u.push(t),u.push(e),s.length=0;for(var c=o,f=o.length-4,d=0;;d+=2){for(var p=c[d],m=c[d+1],v=c[d+2],g=c[d+3],y=p-v,E=m-g,w=u,x=u.length-2,T=s.length,A=0;A0;if(y*(I-g)-E*(M-v)>0){if(S){s.push(b),s.push(R);continue}var C=(k=R-I)*(v-p)-(N=b-M)*(g-m);if(Math.abs(C)>1e-6){var P=(N*(m-I)-k*(p-M))/C;s.push(p+(v-p)*P),s.push(m+(g-m)*P)}else s.push(p),s.push(m)}else if(S){var k,N;C=(k=R-I)*(v-p)-(N=b-M)*(g-m);if(Math.abs(C)>1e-6){P=(N*(m-I)-k*(p-M))/C;s.push(p+(v-p)*P),s.push(m+(g-m)*P)}else s.push(p),s.push(m);s.push(b),s.push(R)}l=!0}if(T==s.length)return h.length=0,!0;if(s.push(s[0]),s.push(s[1]),d==f)break;var _=s;(s=u).length=0,u=_}if(h!=s){h.length=0;d=0;for(var V=s.length-2;d>1;s=0;f--)-1==G[f]&&(G[f]=H[--Z])}w.setFrame(c++,this.getValue(j,"time",0),G)}i.push(w),o=Math.max(o,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n},n.prototype.addSkin=function(t){for(var e=0;e= 0.");if(null==n)throw new Error("name cannot be null.");if(null==r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r};t.SlotData=e}(a||(a={})),function(t){var e,n,r=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=r,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var a=function(){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};t.TextureRegion=a;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(r);t.FakeTexture=i}(a||(a={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,i){if(null==i)throw new Error("textureLoader cannot be null.");for(var o=new n(e),s=new Array(4),h=null;;){var l=o.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new a;u.name=l,u.page=h;var c=o.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,o.readTuple(s);var f=parseInt(s[0]),d=parseInt(s[1]);o.readTuple(s);var p=parseInt(s[0]),m=parseInt(s[1]);u.u=f/h.width,u.v=d/h.height,u.rotate?(u.u2=(f+m)/h.width,u.v2=(d+p)/h.height):(u.u2=(f+p)/h.width,u.v2=(d+m)/h.height),u.x=f,u.y=d,u.width=Math.abs(p),u.height=Math.abs(m),4==o.readTuple(s)&&4==o.readTuple(s)&&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=h.texture,this.regions.push(u)}else{(h=new r).name=l,2==o.readTuple(s)&&(h.width=parseInt(s[0]),h.height=parseInt(s[1]),o.readTuple(s)),o.readTuple(s),h.minFilter=t.Texture.filterFromString(s[0]),h.magFilter=t.Texture.filterFromString(s[1]);var v=o.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==v?h.uWrap=t.TextureWrap.Repeat:"y"==v?h.vWrap=t.TextureWrap.Repeat:"xy"==v&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=i(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var r=0,a=n+1;r<3;r++){var i=e.indexOf(",",a);if(-1==i)break;t[r]=e.substr(a,i-a).trim(),a=i+1}return t[r]=e.substring(a).trim(),r+1},t}(),r=function(){};t.TextureAtlasPage=r;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=a}(a||(a={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var r=0;r0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var T=Math.cos(R),A=Math.sin(R);v.a=T*y-A*w,v.b=T*E-A*x,v.c=A*y+T*w,v.d=A*E+T*x,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=(M.x-v.worldX)*n,v.worldY+=(M.y-v.worldY)*n,g=!0}if(r>0){var I=Math.sqrt(v.a*v.a+v.c*v.c),b=Math.sqrt(o*o+h*h);I>1e-5&&(I=(I+(b-I+this.data.offsetScaleX)*r)/I),v.a*=I,v.c*=I,I=Math.sqrt(v.b*v.b+v.d*v.d),b=Math.sqrt(s*s+l*l),I>1e-5&&(I=(I+(b-I+this.data.offsetScaleY)*r)/I),v.b*=I,v.d*=I,g=!0}if(a>0){E=v.b,x=v.d;var R,S=Math.atan2(x,E);(R=Math.atan2(l,s)-Math.atan2(h,o)-(S-Math.atan2(v.c,v.a)))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R=S+(R+f)*a;I=Math.sqrt(E*E+x*x);v.b=Math.cos(R)*I,v.d=Math.sin(R)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,r=this.scaleMix,a=this.shearMix,i=this.target,o=i.a,s=i.b,h=i.c,l=i.d,u=o*l-s*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,m=d.length;pt.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2),b*=e;var T=Math.cos(b),A=Math.sin(b);v.a=T*y-A*w,v.b=T*E-A*x,v.c=A*y+T*w,v.d=A*E+T*x,g=!0}if(0!=n){var M=this.temp;i.localToWorld(M.set(this.data.offsetX,this.data.offsetY)),v.worldX+=M.x*n,v.worldY+=M.y*n,g=!0}if(r>0){var I=(Math.sqrt(o*o+h*h)-1+this.data.offsetScaleX)*r+1;v.a*=I,v.c*=I,I=(Math.sqrt(s*s+l*l)-1+this.data.offsetScaleY)*r+1,v.b*=I,v.d*=I,g=!0}if(a>0){var b;(b=Math.atan2(l,s)-Math.atan2(h,o))>t.MathUtils.PI?b-=t.MathUtils.PI2:b<-t.MathUtils.PI&&(b+=t.MathUtils.PI2);E=v.b,x=v.d;b=Math.atan2(x,E)+(b-t.MathUtils.PI/2+f)*a;I=Math.sqrt(E*E+x*x);v.b=Math.cos(b)*I,v.d=Math.sin(b)*I,g=!0}g&&(v.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o1e-5&&(d=(d+(a.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(a.ascaleY-p+this.data.offsetScaleY)*n)/p));var m=h.ashearY;if(0!=r){u=a.ashearY-m+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*r}h.updateWorldTransformWith(c,f,l,d,p,h.ashearX,m)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,r=this.shearMix,a=this.target;a.appliedValid||a.updateAppliedTransform();for(var i=this.bones,o=0,s=i.length;o1e-5&&(f*=(a.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(a.ascaleY-1+this.data.offsetScaleY)*n+1));var p=h.ashearY;0!=r&&(p+=(a.ashearY+this.data.offsetShearY)*r),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,p)}},e}();t.TransformConstraint=e}(a||(a={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,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 o(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(a||(a={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool((function(){return new Array})),this.polygonIndicesPool=new t.Pool((function(){return new Array}))}return e.prototype.triangulate=function(t){var n=t,r=t.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i3;){for(var l=r-1,u=(i=0,1);;){t:if(!o[i]){for(var c=a[l]<<1,f=a[i]<<1,d=a[u]<<1,p=n[c],m=n[c+1],v=n[f],g=n[f+1],y=n[d],E=n[d+1],w=(u+1)%r;w!=l;w=(w+1)%r)if(o[w]){var x=a[w]<<1,T=n[x],A=n[x+1];if(e.positiveArea(y,E,p,m,T,A)&&e.positiveArea(p,m,v,g,T,A)&&e.positiveArea(v,g,y,E,T,A))break t}break}if(0==u){do{if(!o[i])break;i--}while(i>0);break}l=i,i=u,u=(u+1)%r}h.push(a[(r+i-1)%r]),h.push(a[i]),h.push(a[(i+1)%r]),a.splice(i,1),o.splice(i,1);var M=(--r+i-1)%r,I=i==r?0:i;o[M]=e.isConcave(M,r,n,a),o[I]=e.isConcave(I,r,n,a)}return 3==r&&(h.push(a[2]),h.push(a[0]),h.push(a[1])),h},e.prototype.decompose=function(t,n){var r=t,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var o=this.polygonIndicesPool.obtain();o.length=0;var s=this.polygonPool.obtain();s.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(a.push(s),i.push(o)):(this.polygonPool.free(s),this.polygonIndicesPool.free(o)),(s=this.polygonPool.obtain()).length=0,s.push(m),s.push(v),s.push(g),s.push(y),s.push(E),s.push(w),(o=this.polygonIndicesPool.obtain()).length=0,o.push(f),o.push(d),o.push(p),l=e.winding(m,v,g,y,E,w),h=f)}s.length>0&&(a.push(s),i.push(o));for(u=0,c=a.length;u=0;u--)0==(s=a[u]).length&&(a.splice(u,1),this.polygonPool.free(s),o=i[u],i.splice(u,1),this.polygonIndicesPool.free(o));return a},e.isConcave=function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,o=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[o],n[o+1])},e.positiveArea=function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0},e.winding=function(t,e,n,r,a,i){var o=n-t,s=r-e;return a*s-i*o+o*e-t*s>=0?1:-1},e}();t.Triangulator=e}(a||(a={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return null!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.r=t,this.g=e,this.b=n,this.a=r}return t.prototype.set=function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp(),this},t.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},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var r=function(){function t(){}return t.clamp=function(t,e,n){return tn?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=r;var a=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=a;var i=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return o(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(a);t.Pow=i;var s=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(i);t.PowOut=s;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,r,a){for(var i=e,o=r;i=n?e:t.setArraySize(e,n,r)},t.newArray=function(t,e){for(var n=new Array(t),r=0;r0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;ethis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=f;var d=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var o=t.bone.skeleton,s=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f0&&(h=s);for(var w,x=(w=t.bone).worldX,T=w.worldY,A=w.a,M=w.b,I=w.c,b=w.d,R=e,S=a;S)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(_,_.exports);var V=_.exports;S(V);var L=Object.freeze({loose:!0}),O=Object.freeze({}),F=function(t){return t?"object"!==h(t)?L:t:O};S(F);var D=/^[0-9]+$/,U=function(t,e){var n=D.test(t),r=D.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tY)throw new TypeError("version is longer than ".concat(Y," characters"));X("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?j[G.LOOSE]:j[G.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>W||this.major<0)throw new TypeError("Invalid major version");if(this.minor>W||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>W||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var i=[e,r];!1===n&&(i=[e]),0===H(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),Z=z;S(Z);var $=Z,Q=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof $)return t;try{return new $(t,e)}catch(t){if(!n)return null;throw t}};S(Q);var J,K,tt=Q,et=S((function(t,e){var n=tt(t,e);return n?n.version:null})),nt=Z,rt=Q,at=V.safeRe,it=V.t,ot=S((function(t,e){if(t instanceof nt)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=at[it.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),at[it.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;at[it.COERCERTL].lastIndex=-1}else n=t.match(at[it.COERCE]);return null===n?null:rt("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}));var st=ht;function ht(t){var e=this;if(e instanceof ht||(e=new ht),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var a=0;null!==r;a++)n=t(n,r.value,a),r=r.next;return n},ht.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==r;a--)n=t(n,r.value,a),r=r.prev;return n},ht.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},ht.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},ht.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new ht;if(ethis.length&&(e=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(e=this.length);for(var r=this.length,a=this.tail;null!==a&&r>e;r--)a=a.prev;for(;null!==a&&r>t;r--,a=a.prev)n.push(a.value);return n},ht.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&nthis[pt])return Ct(this,this[Tt].get(t)),!1;var i=this[Tt].get(t).value;return this[Et]&&(this[wt]||this[Et](t,i.value)),i.now=r,i.maxAge=n,i.value=e,this[mt]+=a-i.length,i.length=a,this.get(t),St(this),!0}var o=new Pt(t,e,a,r,n);return o.length>this[pt]?(this[Et]&&this[Et](t,e),!1):(this[mt]+=o.length,this[xt].unshift(o),this[Tt].set(t,this[xt].head),St(this),!0)}},{key:"has",value:function(t){if(!this[Tt].has(t))return!1;var e=this[Tt].get(t).value;return!Rt(this,e)}},{key:"get",value:function(t){return bt(this,t,!0)}},{key:"peek",value:function(t){return bt(this,t,!1)}},{key:"pop",value:function(){var t=this[xt].tail;return t?(Ct(this,t),t.value):null}},{key:"del",value:function(t){Ct(this,this[Tt].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],a=r.e||0;if(0===a)this.set(r.k,r.v);else{var i=a-e;i>0&&this.set(r.k,r.v,i)}}}},{key:"prune",value:function(){var t=this;this[Tt].forEach((function(e,n){return bt(t,n,!1)}))}}]),t}(),bt=function(t,e,n){var r=t[Tt].get(e);if(r){var a=r.value;if(Rt(t,a)){if(Ct(t,r),!t[gt])return}else n&&(t[At]&&(r.value.now=Date.now()),t[xt].unshiftNode(r));return a.value}},Rt=function(t,e){if(!e||!e.maxAge&&!t[yt])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[yt]&&n>t[yt]},St=function(t){if(t[mt]>t[pt])for(var e=t[xt].tail;t[mt]>t[pt]&&null!==e;){var n=e.prev;Ct(t,e),e=n}},Ct=function(t,e){if(e){var n=e.value;t[Et]&&t[Et](n.key,n.value),t[mt]-=n.length,t[Tt].delete(n.key),t[xt].removeNode(e)}},Pt=c((function t(e,n,r,a,i){l(this,t),this.key=e,this.value=n,this.length=r,this.now=a,this.maxAge=i||0})),kt=function(t,e,n,r){var a=n.value;Rt(t,a)&&(Ct(t,n),t[gt]||(a=void 0)),a&&e.call(r,a.value,a.key,t)},Nt=It;S(Nt);var _t=Z,Vt=function(t,e,n){return new _t(t,n).compare(new _t(e,n))};S(Vt);var Lt=Vt,Ot=function(t,e,n){return 0===Lt(t,e,n)};S(Ot);var Ft=Vt,Dt=function(t,e,n){return 0!==Ft(t,e,n)};S(Dt);var Ut=Vt,Bt=function(t,e,n){return Ut(t,e,n)>0};S(Bt);var Xt=Vt,Yt=function(t,e,n){return Xt(t,e,n)>=0};S(Yt);var Wt=Vt,jt=function(t,e,n){return Wt(t,e,n)<0};S(jt);var Gt=Vt,qt=function(t,e,n){return Gt(t,e,n)<=0};S(qt);var Ht,zt,Zt,$t,Qt=Ot,Jt=Dt,Kt=Bt,te=Yt,ee=jt,ne=qt,re=function(t,e,n,r){switch(e){case"===":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t===n;case"!==":return"object"===h(t)&&(t=t.version),"object"===h(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Qt(t,n,r);case"!=":return Jt(t,n,r);case">":return Kt(t,n,r);case">=":return te(t,n,r);case"<":return ee(t,n,r);case"<=":return ne(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function ae(){if($t)return Zt;$t=1;var t=function(){function t(e,a){var i=this;if(l(this,t),a=n(a),e instanceof t)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new t(e.raw,a);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return i.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var s,h=A(this.set);try{for(h.s();!(s=h.n()).done;){var u=s.value;if(1===u.length&&v(u[0])){this.set=[u];break}}}catch(t){h.e(t)}finally{h.f()}}}this.format()}return c(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+t,l=e.get(i);if(l)return l;var c=this.options.loose,v=c?o[s.HYPHENRANGELOOSE]:o[s.HYPHENRANGE];t=t.replace(v,k(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(o[s.COMPARATORTRIM],h),a("comparator trim",t),t=t.replace(o[s.TILDETRIM],u),a("tilde trim",t),t=t.replace(o[s.CARETTRIM],f),a("caret trim",t);var g=t.split(" ").map((function(t){return y(t,n.options)})).join(" ").split(/\s+/).map((function(t){return P(t,n.options)}));c&&(g=g.filter((function(t){return a("loose invalid filter",t,n.options),!!t.match(o[s.COMPARATORLOOSE])}))),a("range list",g);var E,x=new Map,T=g.map((function(t){return new r(t,n.options)})),M=A(T);try{for(M.s();!(E=M.n()).done;){var I=E.value;if(m(I))return[I];x.set(I.value,I)}}catch(t){M.e(t)}finally{M.f()}x.size>1&&x.has("")&&x.delete("");var b=w(x.values());return e.set(i,b),b}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new i(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(i(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(i(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();Ht=e;var n=F,r=V.safeRe,a=V.t,i=re,o=N,s=Z,h=ae();return Ht}(),a=N,i=Z,o=V.safeRe,s=V.t,h=V.comparatorTrimReplace,u=V.tildeTrimReplace,f=V.caretTrimReplace,d=C.FLAG_INCLUDE_PRERELEASE,p=C.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},v=function(t){return""===t.value},g=function(t,e){for(var n=!0,r=t.slice(),a=r.pop();n&&r.length;)n=r.every((function(t){return a.intersects(t,e)})),a=r.pop();return n},y=function(t,e){return a("comp",t,e),t=M(t,e),a("caret",t),t=x(t,e),a("tildes",t),t=b(t,e),a("xrange",t),t=S(t,e),a("stars",t),t},E=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){var n=e.loose?o[s.TILDELOOSE]:o[s.TILDE];return t.replace(n,(function(e,n,r,i,o){var s;return a("tilde",t,e,n,r,i,o),E(n)?s="":E(r)?s=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):E(i)?s=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):o?(a("replaceTilde pr",o),s=">=".concat(n,".").concat(r,".").concat(i,"-").concat(o," <").concat(n,".").concat(+r+1,".0-0")):s=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",s),s}))},M=function(t,e){return t.trim().split(/\s+/).map((function(t){return I(t,e)})).join(" ")},I=function(t,e){a("caret",t,e);var n=e.loose?o[s.CARETLOOSE]:o[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,o,s){var h;return a("caret",t,e,n,i,o,s),E(n)?h="":E(i)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):E(o)?h="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):s?(a("replaceCaret pr",s),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(s," <").concat(+n+1,".0.0-0")):(a("no pr"),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),a("caret return",h),h}))},b=function(t,e){return a("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return R(t,e)})).join(" ")},R=function(t,e){t=t.trim();var n=e.loose?o[s.XRANGELOOSE]:o[s.XRANGE];return t.replace(n,(function(n,r,i,o,s,h){a("xRange",t,n,r,i,o,s,h);var l=E(i),u=l||E(o),c=u||E(s),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(h="-0"),n="".concat(r+i,".").concat(o,".").concat(s).concat(h)):u?n=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):c&&(n=">=".concat(i,".").concat(o,".0").concat(h," <").concat(i,".").concat(+o+1,".0-0")),a("xRange return",n),n}))},S=function(t,e){return a("replaceStars",t,e),t.trim().replace(o[s.STAR],"")},P=function(t,e){return a("replaceGTE0",t,e),t.trim().replace(o[e.includePrerelease?s.GTE0PRE:s.GTE0],"")},k=function(t){return function(e,n,r,a,i,o,s,h,l,u,c,f,d){return n=E(r)?"":E(a)?">=".concat(r,".0.0").concat(t?"-0":""):E(i)?">=".concat(r,".").concat(a,".0").concat(t?"-0":""):o?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=E(l)?"":E(u)?"<".concat(+l+1,".0.0-0"):E(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},_=function(t,e,n){for(var i=0;i0){var s=t[o].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0};return Zt}S(re);var ie,oe,se=ae(),he=function(t,e,n){try{e=new se(e,n)}catch(t){return!1}return e.test(t)},le={valid:et,coerce:ot,satisfies:S(he),SEMVER_SPEC_VERSION:P.SEMVER_SPEC_VERSION},ue=0,ce=1,fe=2,de=[0,1,2,2,3,0],pe=function(){function t(e,n,r,o){var s;if(l(this,t),f(this,"autoUpdate",!0),f(this,"skeleton",void 0),f(this,"states",void 0),this._app=e,this._position=new i.Vec3,1===a.TextureAtlas.length){var h,u=A((s=new a.TextureAtlas(n)).pages);try{for(u.s();!(h=u.n()).done;){var c=h.value;c.setTexture(new R(o[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else s=new a.TextureAtlas(n,(function(t){return new R(o[t])}));var d=new a.SkeletonJson(new a.AtlasAttachmentLoader(s));d.scale*=.01;var p=d.readSkeletonData(r);this.skeletonVersion=le.valid(le.coerce(p.version)),this._spine_3_6_0=le.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=le.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=le.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=le.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new a.Skeleton(p),this.skeleton.updateWorldTransform(),this.stateData=new a.AnimationStateData(this.skeleton.data),this.states=[new a.AnimationState(this.stateData)],this.clipper=new a.SkeletonClipping,this._node=new i.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new i.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new i.Vec2,this._aabbTempSize=new i.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[i.LAYERID_UI],this.init(),this._hidden=!1}return c(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new i.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new i.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=o,n=0),t=c.material;var f=c.positions,d=c.vertexColor.r,p=c.vertexColor.g,m=c.vertexColor.b,v=c.vertexColor.a,g=c.uvs,y=void 0,E=f.length/2;for(y=0;y0){var r=new i.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=i.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var a=new i.MeshInstance(r,this._materials[n],this._node);a.drawOrder=this.priority+this._meshInstances.length,a.visible=!this._hidden,this._meshInstances.push(a)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var h=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(h&&l){if(this.prev=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),M(a),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var n=a.completion;if("throw"===n.type){var r=n.arg;M(a)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,n){return this.delegate={iterator:Y(e),resultName:a,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var a=0;at.length)&&(e=t.length);for(var a=0,n=new Array(e);a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function b(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var n=a.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var x=function(){function t(){i(this,t),this.array=new Array}return o(t,[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),t}(),w=function(){function t(){i(this,t),this.entries={},this.size=0}return o(t,[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,a=0,n=t.length;a0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;i(this,t),this.r=e,this.g=a,this.b=n,this.a=r}return o(t,[{key:"set",value:function(t,e,a,n){return this.r=t,this.g=e,this.b=a,this.a=n,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value:function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,a,n){return this.r+=t,this.g+=e,this.b+=a,this.a+=n,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value:function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}]),t}();A.WHITE=new A(1,1,1,1),A.RED=new A(1,0,0,1),A.GREEN=new A(0,1,0,1),A.BLUE=new A(0,0,1,1),A.MAGENTA=new A(1,0,1,1);var I=function(){function t(){i(this,t)}return o(t,null,[{key:"clamp",value:function(t,e,a){return ta?a:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,a){return t.randomTriangularWith(e,a,.5*(e+a))}},{key:"randomTriangularWith",value:function(t,e,a){var n=Math.random(),r=e-t;return n<=(a-t)/r?t+Math.sqrt(n*r*(a-t)):e-Math.sqrt((1-n)*r*(e-a))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}]),t}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var E=function(){function t(){i(this,t)}return o(t,[{key:"apply",value:function(t,e,a){return t+(e-t)*this.applyInternal(a)}}]),t}(),S=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this)).power=2,n.power=t,n}return o(a,[{key:"applyInternal",value:function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}]),a}(E),T=function(t){l(a,t);var e=d(a);function a(t){return i(this,a),e.call(this,t)}return o(a,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}]),a}(S),R=function(){function t(){i(this,t)}return o(t,null,[{key:"arrayCopy",value:function(t,e,a,n,r){for(var i=e,s=n;i2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;if(n==e)return t;if(t.length=e,n2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=a?e:t.setArraySize(e,a,n)}},{key:"newArray",value:function(t,e){for(var a=new Array(t),n=0;n0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.x=e,this.y=a}return o(t,[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),t}(),Y=function(){function t(){i(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return o(t,[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}]),t}(),X=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;i(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}return o(t,[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var u=0,c=0,f=0;f0&&(h=o);for(var N=t.bone,P=N.worldX,_=N.worldY,O=N.a,B=N.b,D=N.c,V=N.d,U=e,W=r;W0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;le)return n-1;return a-1}},{key:"search",value:function(t,e,a){for(var n=t.length,r=a;re)return r-a;return n-a}}]),t}(),it=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,r)).curves=null,s.curves=R.newFloatArray(t+18*n),s.curves[t-1]=1,s}return o(a,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var a=R.newFloatArray(e);R.arrayCopy(this.curves,0,a,0,e),this.curves=a}}},{key:"setBezier",value:function(t,e,a,n,r,i,s,o,h,l,u){var c=this.curves,f=this.getFrameCount()+18*t;0==a&&(c[e]=2+f);for(var d=.03*(n-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-n+l),p=.006*(3*(s-h)-r+u),g=2*d+m,y=2*v+p,k=.3*(i-n)+d+.16666667*m,b=.3*(s-r)+v+.16666667*p,x=n+k,w=r+b,A=f+18;ft){var i=this.frames[e],s=this.frames[e+a];return s+(t-i)/(r[n]-i)*(r[n+1]-s)}var o=n+18;for(n+=2;n=t){var h=r[n-2],l=r[n-1];return l+(t-h)/(r[n]-h)*(r[n+1]-l)}e+=this.getFrameEntries();var u=r[o-2],c=r[o-1];return c+(t-u)/(this.frames[e]-u)*(this.frames[e+a]-c)}}]),a}(rt),st=function(t){l(a,t);var e=d(a);function a(t,n,r){return i(this,a),e.call(this,t,n,[r])}return o(a,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,a){t<<=1,this.frames[t]=e,this.frames[t+1]=a}},{key:"getCurveValue",value:function(t){for(var e=this.frames,a=e.length-2,n=2;n<=a;n+=2)if(e[n]>t){a=n-2;break}var r=this.curves[a>>1];switch(r){case 0:var i=e[a],s=e[a+1];return s+(t-i)/(e[a+2]-i)*(e[a+2+1]-s);case 1:return e[a+1]}return this.getBezierValue(t,a,1,r-2)}}]),a}(it),ot=function(t){l(a,t);var e=d(a);function a(t,n,r,s){return i(this,a),e.call(this,t,n,[r,s])}return o(a,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,a,n){t*=3,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n}}]),a}(it),ht=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,n,B+"|"+r)).boneIndex=0,s.boneIndex=r,s}return o(a,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.bones[this.boneIndex];if(o.active)if(a>2];switch(m){case 0:var p=h[v];c=h[v+1],f=h[v+2],d=h[v+3];var g=(a-p)/(h[v+4]-p);c+=(h[v+4+1]-c)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:c=h[v+1],f=h[v+2],d=h[v+3];break;default:c=this.getBezierValue(a,v,1,m-2),f=this.getBezierValue(a,v,2,m+18-2),d=this.getBezierValue(a,v,3,m+36-2)}if(1==r)l.r=c,l.g=f,l.b=d;else{if(i==P.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(c-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}]),a}(it),bt=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,n,z+"|"+r)).slotIndex=0,s.slotIndex=r,s}return o(a,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(a>3];switch(x){case 0:var w=h[b];d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];var A=(a-w)/(h[b+8]-w);d+=(h[b+8+1]-d)*A,v+=(h[b+8+2]-v)*A,m+=(h[b+8+3]-m)*A,p+=(h[b+8+4]-p)*A,g+=(h[b+8+5]-g)*A,y+=(h[b+8+6]-y)*A,k+=(h[b+8+7]-k)*A;break;case 1:d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];break;default:d=this.getBezierValue(a,b,1,x-2),v=this.getBezierValue(a,b,2,x+18-2),m=this.getBezierValue(a,b,3,x+36-2),p=this.getBezierValue(a,b,4,x+54-2),g=this.getBezierValue(a,b,5,x+72-2),y=this.getBezierValue(a,b,6,x+90-2),k=this.getBezierValue(a,b,7,x+108-2)}if(1==r)l.set(d,v,m,p),u.r=g,u.g=y,u.b=k;else{if(i==P.setup){l.setFromColor(o.data.color);var I=o.data.darkColor;u.r=I.r,u.g=I.g,u.b=I.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),u.r+=(g-u.r)*r,u.g+=(y-u.g)*r,u.b+=(k-u.b)*r}}}}}]),a}(it),wt=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,n,[G+"|"+r,H+"|"+r])).slotIndex=0,s.slotIndex=r,s}return o(a,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,a,n,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,u=o.darkColor;if(at){var i=this.frames[e];return a[n+1]*(t-i)/(a[n]-i)}var s=n+18;for(n+=2;n=t){var o=a[n-2],h=a[n-1];return h+(t-o)/(a[n]-o)*(a[n+1]-h)}var l=a[s-2],u=a[s-1];return u+(1-u)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof N&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(i=P.setup);var u=this.vertices,c=u[0].length,f=this.frames;if(a=f[f.length-1]){var p=u[f.length-1];if(1==r)if(i==P.add){var g=h;if(g.bones)for(var y=0;ya)this.apply(t,e,Number.MAX_VALUE,n,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(a0&&o[l-1]==u;)l--;for(;l=o[l];l++)n.push(this.events[l])}}}}]),a}(rt);Et.propertyIds=[""+Q];var St=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,a.propertyIds)).drawOrders=null,n.drawOrders=new Array(t),n}return o(a,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,a){this.frames[t]=e,this.drawOrders[t]=a}},{key:"apply",value:function(t,e,a,n,r,i,s){if(s!=_.mixOut)if(a>2];switch(d){case 0:var v=h[f];l=h[f+1],u=h[f+2],c=h[f+3];var m=(a-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,u+=(h[f+4+2]-u)*m,c+=(h[f+4+3]-c)*m;break;case 1:l=h[f+1],u=h[f+2],c=h[f+3];break;default:l=this.getBezierValue(a,f,1,d-2),u=this.getBezierValue(a,f,2,d+18-2),c=this.getBezierValue(a,f,3,d+36-2)}if(i==P.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(u-p.mixX)*r,o.mixY=p.mixY+(c-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(u-o.mixX)*r,o.mixY+=(c-o.mixY)*r}}}}]),a}(it),Xt=function(){function t(e){i(this,t),this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Nt(this),this.propertyIDs=new w,this.animationsChanged=!1,this.trackEntryPool=new M((function(){return new Lt})),this.data=e}return o(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,a=0,n=e.length;a0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(a,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[a]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var a=t.mixingFrom;if(!a)return!0;var n=this.updateMixingFrom(a,e);return a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=a.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=a.mixingFrom,a.mixingFrom&&(a.mixingFrom.mixingTo=t),t.interruptAlpha=a.interruptAlpha,this.queue.end(a)),n):(a.trackTime+=e*a.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,a=this.tracks,n=!1,r=0,i=a.length;r0)){n=!0;var o=0==r?P.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),c=u,f=e;s.reverse&&(c=s.animation.duration-c,f=null);var d=s.animation.timelines,v=d.length;if(0==r&&1==h||o==P.add)for(var m=0;m1&&(r=1),a!=P.first&&(a=n.mixBlend));var i=r0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,a,n,r){var i=e.slots[t.slotIndex];i.bone.active&&(a0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),c=f+d-d%360,p!=m&&(c+=360*I.signum(d)),i[s]=c}i[s+1]=f,h.rotation=l+c*n}}else t.apply(e,0,a,null,1,r,_.mixIn)}},{key:"queueEvents",value:function(t,e){for(var a=t.animationStart,n=t.animationEnd,r=n-a,i=t.trackLast%r,s=this.events,o=0,h=s.length;on||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var a=e;;){var n=a.mixingFrom;if(!n)break;this.queue.end(n),a.mixingFrom=null,a.mixingTo=null,a=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,a){var n=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,n&&(a&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,a)}},{key:"setAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));var i=this.trackEntry(t,e,a,r);return this.setCurrent(t,i,n),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,a,n)}},{key:"addAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,a,r);return r?(r.next=i,i.previous=r,n<=0&&(n+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=n,i}},{key:"setEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.setAnimationWith(e,t.emptyAnimation(),!1);return n.mixDuration=a,n.trackEnd=a,n}},{key:"addEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,n);return n<=0&&(r.delay+=r.mixDuration-a),r.mixDuration=a,r.trackEnd=a,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var a=0,n=this.tracks.length;a0){r[h]=Wt,i[h]=c;continue t}break}r[h]=Ut}else r[h]=Bt}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return Gt||(Gt=new O("",[],0)),Gt}}]),t}(),Lt=function(){function t(){i(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=P.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return o(t,[{key:"reset",value:function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}},{key:"getAnimationTime",value:function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&(s.names=u,s.values=c,u=null,c=null),s.u=s.x/r.width,s.v=s.y/r.height,90==s.degrees?(s.u2=(s.x+s.height)/r.width,s.v2=(s.y+s.width)/r.height):(s.u2=(s.x+s.width)/r.width,s.v2=(s.y+s.height)/r.height),this.regions.push(s)}else{for((r=new ee).name=l.trim();0!=a.readEntry(n,l=a.readLine());){var p=o[n[0]];p&&p()}this.pages.push(r)}}return o(t,[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",n=k(this.pages);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.setTexture(t.get(a+r.name))}}catch(t){n.e(t)}finally{n.f()}}},{key:"dispose",value:function(){for(var t=0;t=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var a=e.indexOf(":");if(-1==a)return 0;t[0]=e.substr(0,a).trim();for(var n=1,r=a+1;;n++){var i=e.indexOf(",",r);if(-1==i)return t[n]=e.substr(r).trim(),n;if(t[n]=e.substr(r,i-r).trim(),r=i+1,4==n)return 4}}}]),t}(),ee=function(){function t(){i(this,t),this.name=null,this.minFilter=Pt.Nearest,this.magFilter=Pt.Nearest,this.uWrap=_t.ClampToEdge,this.vWrap=_t.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}return o(t,[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}}]),t}(),ae=function(t){l(a,t);var e=d(a);function a(){var t;return i(this,a),(t=e.apply(this,arguments)).page=null,t.name=null,t.x=0,t.y=0,t.offsetX=0,t.offsetY=0,t.originalWidth=0,t.originalHeight=0,t.index=0,t.degrees=0,t.names=null,t.values=null,t}return o(a)}(Qt),ne=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t)).region=null,n.path=null,n.regionUVs=null,n.uvs=null,n.triangles=null,n.color=new A(1,1,1,1),n.width=0,n.height=0,n.hullLength=0,n.edges=null,n.parentMesh=null,n.tempColor=new A(0,0,0,0),n}return o(a,[{key:"updateUVs",value:function(){var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,a=this.uvs.length,n=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof ae){var o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:n-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/u,i=o.originalHeight/l,s=o.originalWidth/u;for(var c=0;c= 0.");if(!a)throw new Error("name cannot be null.");this.index=e,this.name=a,this.parent=n}));!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(oe||(oe={}));var ue,ce,fe,de=function(){function t(e,a,n){if(i(this,t),this.data=null,this.skeleton=null,this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=a,this.parent=n,this.setToSetupPose()}return o(t,[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,a,n,r,i,s){this.ax=t,this.ay=e,this.arotation=a,this.ascaleX=n,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=a+90+s,u=h.scaleX,c=h.scaleY;return this.a=I.cosDeg(a+i)*n*u,this.b=I.cosDeg(l)*r*u,this.c=I.sinDeg(a+i)*n*c,this.d=I.sinDeg(l)*r*c,this.worldX=t*u+h.x,void(this.worldY=e*c+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case oe.Normal:var p=a+90+s,g=I.cosDeg(a+i)*n,y=I.cosDeg(p)*r,k=I.sinDeg(a+i)*n,b=I.sinDeg(p)*r;return this.a=f*g+d*k,this.b=f*y+d*b,this.c=v*g+m*k,void(this.d=v*y+m*b);case oe.OnlyTranslation:var x=a+90+s;this.a=I.cosDeg(a+i)*n,this.b=I.cosDeg(x)*r,this.c=I.sinDeg(a+i)*n,this.d=I.sinDeg(x)*r;break;case oe.NoRotationOrReflection:var w=f*f+v*v,A=0;w>1e-4?(w=Math.abs(f*m-d*v)/w,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*w,m=f*w,A=Math.atan2(v,f)*I.radDeg):(f=0,v=0,A=90-Math.atan2(m,d)*I.radDeg);var E=a+i-A,S=a+s-A+90,T=I.cosDeg(E)*n,R=I.cosDeg(S)*r,C=I.sinDeg(E)*n,M=I.sinDeg(S)*r;this.a=f*T-d*C,this.b=f*R-d*M,this.c=v*T+m*C,this.d=v*R+m*M;break;case oe.NoScale:case oe.NoScaleOrReflection:var F=I.cosDeg(a),Y=I.sinDeg(a),X=(f*F+d*Y)/this.skeleton.scaleX,L=(v*F+m*Y)/this.skeleton.scaleY,N=Math.sqrt(X*X+L*L);N>1e-5&&(N=1/N),X*=N,L*=N,N=Math.sqrt(X*X+L*L),this.data.transformMode==oe.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(N=-N);var P=Math.PI/2+Math.atan2(L,X),_=Math.cos(P)*N,O=Math.sin(P)*N,B=I.cosDeg(i)*n,D=I.cosDeg(90+s)*r,V=I.sinDeg(i)*n,U=I.sinDeg(90+s)*r;this.a=X*B+_*V,this.b=X*D+_*U,this.c=L*B+O*V,this.d=L*D+O*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*I.radDeg);var e=t.a,a=t.b,n=t.c,r=t.d,i=1/(e*r-a*n),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*r*i-o*a*i,this.ay=o*e*i-s*n*i;var h=i*r,l=i*e,u=i*a,c=i*n,f=h*this.a-u*this.c,d=h*this.b-u*this.d,v=l*this.c-c*this.a,m=l*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),a=t.x-this.worldX,n=t.y-this.worldY;return t.x=a*this.d*e-n*this.b*e,t.y=n*this.a*e-a*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,a=t.y;return t.x=e*this.a+a*this.b+this.worldX,t.y=e*this.c+a*this.d+this.worldY,t}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(this.a*e-this.c*a,this.d*a-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(a*this.c+e*this.d,a*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,a=this.b,n=this.c,r=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*n,this.b=i*a-s*r,this.c=s*e+i*n,this.d=s*a+i*r}}]),t}(),ve=o((function t(e,a,n){i(this,t),this.name=e,this.order=a,this.skinRequired=n})),me=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i(this,t),this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=a,this.downloader=n||new pe}return o(t,[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,a){this.toLoad--,this.loaded++,this.assets[e]=a,t&&t(e,a)}},{key:"error",value:function(t,e,a){this.toLoad--,this.loaded++,this.errors[e]=a,t&&t(e,a)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,a){requestAnimationFrame((function n(){t.isLoadingComplete()?t.hasErrors()?a(t.errors):e(t):requestAnimationFrame(n)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadBinary(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadText(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load text ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadJson(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((function(a){return a.ok?a.blob():(e.error(n,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(n){n&&e.success(a,t,e.textureLoader(n))}));else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(a,t,e.textureLoader(r))},r.onerror=function(){e.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}}},{key:"loadTextureAtlas",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new Kt(i),l=h.pages.length,u=!1,c=k(h.pages);try{var f=function(){var i=o.value;e.loadTexture(null==r?s+i.name:r[i.name],(function(n,r){u||(i.setTexture(r),0==--l&&e.success(a,t,h))}),(function(a,r){u||e.error(n,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(a)),u=!0}))};for(c.s();!(o=c.n()).done;)f()}catch(t){c.e(t)}finally{c.f()}}catch(a){e.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(a.message))}}),(function(a,r){e.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var a=this.errors[t];throw Error("Asset not found: "+t+(a?"\n"+a:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),t}(),pe=function(){function t(){i(this,t),this.callbacks={},this.rawDataUris={}}return o(t,[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),a=e.length,n=new Uint8Array(a),r=0;r180?f-=360:f<-180&&(f+=360);var x=t.ascaleX,w=t.ascaleY;if(n||r){switch(t.data.transformMode){case oe.NoScale:case oe.NoScaleOrReflection:d=e-t.worldX,v=a-t.worldY}var A=t.data.length*x,E=Math.sqrt(d*d+v*v);if(n&&EA&&A>1e-4){var S=(E/A-1)*s+1;x*=S,i&&(w*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,x,w,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,a,n,r,i,s,o,h){var l=t.ax,u=t.ay,c=t.ascaleX,f=t.ascaleY,d=c,v=f,m=e.ascaleX,p=0,g=0,y=0;c<0?(c=-c,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var k=e.ax,b=0,x=0,w=0,A=t.a,E=t.b,S=t.c,T=t.d,R=Math.abs(c-f)<=1e-4;!R||i?(b=0,x=A*k+t.worldX,w=S*k+t.worldY):(x=A*k+E*(b=e.ay)+t.worldX,w=S*k+T*b+t.worldY);var C=t.parent;A=C.a,E=C.b,S=C.c;var M,F,Y=1/(A*(T=C.d)-E*S),X=x-C.worldX,L=w-C.worldY,N=(X*T-L*E)*Y-l,P=(L*A-X*S)*Y-u,_=Math.sqrt(N*N+P*P),O=e.data.length*m;if(_<1e-4)return this.apply1(t,a,n,!1,i,!1,h),void e.updateWorldTransformWith(k,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var B=((X=a-C.worldX)*T-(L=n-C.worldY)*E)*Y-l,D=(L*A-X*S)*Y-u,V=B*B+D*D;if(0!=o){o*=c*(m+1)*.5;var U=Math.sqrt(V),W=U-_-O*c+o;if(W>0){var j=Math.min(1,W/(2*o))-1;V=(B-=(j=(W-o*(1-j*j))/U)*B)*B+(D-=j*D)*D}}t:if(R){var q=(V-_*_-(O*=c)*O)/(2*_*O);q<-1?(q=-1,F=Math.PI*r):q>1?(q=1,F=0,i&&(d*=A=(Math.sqrt(V)/(_+O)-1)*h+1,s&&(v*=A))):F=Math.acos(q)*r,A=_+O*q,E=O*Math.sin(F),M=Math.atan2(D*A-B*E,B*A+D*E)}else{var G=(A=c*O)*A,z=(E=f*O)*E,H=Math.atan2(D,B),$=-2*z*_,J=z-G;if((T=$*$-4*J*(S=z*_*_+G*V-G*z))>=0){var Q=Math.sqrt(T);$<0&&(Q=-Q);var Z=(Q=.5*-($+Q))/J,K=S/Q,tt=Math.abs(Z)=-1&&S<=1&&(S=Math.acos(S),(T=(X=A*Math.cos(S)+_)*X+(L=E*Math.sin(S))*L)ot&&(it=S,ot=T,st=X,ht=L)),V<=.5*(nt+ot)?(M=H-Math.atan2(rt*r,at),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(b,k)*y,ut=t.arotation;(M=(M-lt)*I.radDeg+p-ut)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,u,ut+M*h,d,v,0,0),ut=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ut)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(k,b,ut+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]),t}(),be=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,0,!1)).bones=new Array,n.target=null,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return o(a)}(ve),xe=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,0,!1)).bones=new Array,n.target=null,n.positionMode=null,n.spacingMode=null,n.rotateMode=null,n.offsetRotation=0,n.position=0,n.spacing=0,n.mixRotate=0,n.mixX=0,n.mixY=0,n}return o(a)}(ve);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(ue||(ue={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(ce||(ce={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(fe||(fe={}));var we=function(){function t(e,a){if(i(this,t),this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var n=0,r=e.bones.length;n0){b=u/b*d;for(var M=1;M0?I.degRad:-I.degRad}for(var q=0,G=3;q0){var tt=z.a,et=z.b,at=z.c,nt=z.d,rt=0,it=0,st=0;if(rt=s?B[G-1]:0==c[q+1]?B[G+2]:Math.atan2(Q,J),rt-=Math.atan2(at,tt),W){it=Math.cos(rt),st=Math.sin(rt);var ot=z.data.length;D+=(ot*(it*tt-st*at)-J)*a,V+=(ot*(st*tt+it*at)-Q)*a}else rt+=U;rt>I.PI?rt-=I.PI2:rt<-I.PI&&(rt+=I.PI2),rt*=a,it=Math.cos(rt),st=Math.sin(rt),z.a=it*tt-st*at,z.b=it*et-st*nt,z.c=st*tt+it*at,z.d=st*et+it*nt}z.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,a,n){var r=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*a+2),h=null,l=e.closed,u=e.worldVerticesLength,c=u/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[c-=l?1:2];switch(this.data.positionMode==ue.Percent&&(i*=m),this.data.spacingMode){case ce.Percent:d=m;break;case ce.Proportional:d=m/a;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,u-6,4,h,0,2)),this.addAfterPosition(b-m,h,0,o,g);continue}}for(;;y++){var x=v[y];if(!(b>x)){if(0==y)b/=x;else{var w=v[y-1];b=(b-w)/(x-w)}break}}y!=f&&(f=y,l&&y==c?(e.computeWorldVertices(r,u-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(b,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,n||p>0&&0==k)}return o}l?(u+=2,h=R.setArraySize(this.world,u),e.computeWorldVertices(r,2,u-4,h,0,2),e.computeWorldVertices(r,0,2,h,u-4,2),h[u-2]=h[0],h[u-1]=h[1]):(c--,u-=4,h=R.setArraySize(this.world,u),e.computeWorldVertices(r,2,u,h,0,2));for(var A,I=R.setArraySize(this.curves,c),E=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,X=0,L=0,N=0,P=0,_=0,O=0,B=0,D=0,V=0,U=0,W=0,j=2;WE){this.addAfterPosition(Z-E,h,u-4,o,H);continue}}for(;;$++){var K=I[$];if(!(Z>K)){if(0==$)Z/=K;else{var tt=I[$-1];Z=(Z-tt)/(K-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],B=2*(N=.03*(S-2*C+F))+(_=.006*(3*(C-F)-S+(X=h[et+6]))),D=2*(P=.03*(T-2*M+Y))+(O=.006*(3*(M-Y)-T+(L=h[et+7]))),V=.3*(C-S)+N+.16666667*_,U=.3*(M-T)+P+.16666667*O,G=Math.sqrt(V*V+U*U),q[0]=G,et=1;et<8;et++)V+=B,U+=D,B+=_,D+=O,G+=Math.sqrt(V*V+U*U),q[et]=G;V+=B,U+=D,G+=Math.sqrt(V*V+U*U),q[8]=G,V+=B+_,U+=D+O,G+=Math.sqrt(V*V+U*U),q[9]=G,J=0}for(Z*=G;;J++){var at=q[J];if(!(Z>at)){if(0==J)Z/=at;else{var nt=q[J-1];Z=J+(Z-nt)/(at-nt)}break}}this.addCurvePosition(.1*Z,S,T,C,M,F,Y,X,L,o,H,n||z>0&&0==Q)}return o}},{key:"addBeforePosition",value:function(t,e,a,n,r){var i=e[a],s=e[a+1],o=e[a+2]-i,h=e[a+3]-s,l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addAfterPosition",value:function(t,e,a,n,r){var i=e[a+2],s=e[a+3],o=i-e[a],h=s-e[a+1],l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addCurvePosition",value:function(t,e,a,n,r,i,s,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=a,void(l[u+2]=Math.atan2(r-a,n-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,k=v*y,b=y*t,x=e*p+n*k+i*b+o*d,w=a*p+r*k+s*b+h*d;l[u]=x,l[u+1]=w,c&&(l[u+2]=t<.001?Math.atan2(r-a,n-e):Math.atan2(w-(a*m+r*g*2+s*f),x-(e*m+n*g*2+i*f)))}}]),t}();we.NONE=-1,we.BEFORE=-2,we.AFTER=-3,we.epsilon=1e-5;var Ae,Ie=function(){function t(e,a){if(i(this,t),this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentTime=0,this.attachmentState=0,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!a)throw new Error("bone cannot be null.");this.data=e,this.bone=a,this.color=new A,this.darkColor=e.darkColor?new A:null,this.setToSetupPose()}return o(t,[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof N&&this.attachment instanceof N&&t.deformAttachment==this.attachment.deformAttachment||(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}},{key:"setAttachmentTime",value:function(t){this.attachmentTime=this.bone.skeleton.time-t}},{key:"getAttachmentTime",value:function(){return this.bone.skeleton.time-this.attachmentTime}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),t}(),Ee=function(){function t(e,a){if(i(this,t),this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new F,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var n=0;n0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(T.x-y.worldX)*e,y.worldY+=(T.y-y.worldY)*a}if(0!=n){var R=Math.sqrt(y.a*y.a+y.c*y.c);0!=R&&(R=(R+(Math.sqrt(h*h+u*u)-R+this.data.offsetScaleX)*n)/R),y.a*=R,y.c*=R}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+c*c)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),X=Math.atan2(c,l)-Math.atan2(u,h)-(Y-Math.atan2(y.c,y.a));X>I.PI?X-=I.PI2:X<-I.PI&&(X+=I.PI2),X=Y+(X+v)*i;var L=Math.sqrt(M*M+F*F);y.b=Math.cos(X)*L,y.d=Math.sin(X)*L}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=a,o=this.target,h=o.a,l=o.b,u=o.c,c=o.d,f=h*c-l*u>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=T.x*e,y.worldY+=T.y*a}if(0!=n){var R=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=R,y.c*=R}if(0!=r){var C=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(c,l)-Math.atan2(u,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var X=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*X,y.d=Math.sin(M)*X}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var n=this.drawOrder,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=n.length;h0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i(this,t),this.slotIndex=e,this.name=a,this.attachment=n})),Ce=function(){function t(e){if(i(this,t),this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}return o(t,[{key:"setAttachment",value:function(t,e,a){if(!a)throw new Error("attachment cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=a}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!a)throw new Error("name cannot be null.");if(!n)throw new Error("boneData cannot be null.");this.index=e,this.name=a,this.boneData=n}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Ae||(Ae={}));var Fe,Ye=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,0,!1)).bones=new Array,n.target=null,n.mixRotate=0,n.mixX=0,n.mixY=0,n.mixScaleX=0,n.mixScaleY=0,n.mixShearY=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 o(a)}(ve),Xe=function(){function t(e){i(this,t),this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=e}return o(t,[{key:"readSkeletonData",value:function(t){var e=this.scale,a=new Te;a.name="";var n=new Le(t),r=n.readInt32(),i=n.readInt32();a.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),a.version=n.readString(),a.x=n.readFloat(),a.y=n.readFloat(),a.width=n.readFloat(),a.height=n.readFloat();var s=n.readBoolean();s&&(a.fps=n.readFloat(),a.imagesPath=n.readString(),a.audioPath=n.readString());var o=0;o=n.readInt(!0);for(var h=0;h0){for(var pn=new St(mn),gn=a.slots.length,yn=0;yn=0;wn--)xn[wn]=-1;for(var An=R.newArray(gn-bn,0),In=0,En=0,Sn=0;Sn=0;Rn--)-1==xn[Rn]&&(xn[Rn]=An[--En]);pn.setFrame(yn,kn,xn)}n.push(pn)}var Cn=t.readInt(!0);if(Cn>0){for(var Mn=new Et(Cn),Fn=0;Fn1&&void 0!==arguments[1]?arguments[1]:new Array,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);i(this,t),this.strings=a,this.index=n,this.buffer=r}return o(t,[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),a=127&e;return 0!=(128&e)&&(a|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<28)))),t?a:a>>>1^-(1&a)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",a=0;a>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),a+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),a+=3;break;default:e+=String.fromCharCode(n),a++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),t}(),Ne=o((function t(e,a,n,r,s){i(this,t),this.mesh=e,this.skin=a,this.slotIndex=n,this.parent=r,this.inheritDeform=s})),Pe=o((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i(this,t),this.bones=e,this.vertices=a}));function _e(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,n,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(i);break;case oa:Be(t,e,s++,i,0,n,h,r,l,a)}n=h,r=l}return e}function Oe(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=t.readFloat()*a,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,n,r,i),s!=h;s++){var l=t.readFloat(),u=t.readFloat()*a,c=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(s);break;case oa:Be(t,e,o++,s,0,n,l,r,u,a),Be(t,e,o++,s,1,n,l,i,c,a)}n=l,r=u,i=c}return e}function Be(t,e,a,n,r,i,s,o,h,l){e.setBezier(a,n,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Fe||(Fe={}));var De,Ve=0,Ue=1,We=2,je=3,qe=4,Ge=5,ze=6,He=7,$e=8,Je=9,Qe=0,Ze=1,Ke=2,ta=3,ea=4,aa=5,na=0,ra=1,ia=2,sa=1,oa=2,ha=function(){function t(){i(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new M((function(){return R.newFloatArray(16)}))}return o(t,[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var a=this.boundingBoxes,n=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;a.length=0,r.freeAll(n),n.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,a,n){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&a<=r||e<=i&&n<=i||t>=s&&a>=s||e>=o&&n>=o)return!1;var h=(n-e)/(a-t),l=h*(r-t)+e;if(l>i&&li&&lr&&ur&&ut.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var a=this.polygons,n=0,r=a.length;n=a||l=a){var u=n[o];u+(a-h)/(l-h)*(n[i]-u)=u&&k<=d||k>=d&&k<=u)&&(k>=e&&k<=n||k>=n&&k<=e)){var b=(l*g-h*m)/y;if((b>=c&&b<=v||b>=v&&b<=c)&&(b>=a&&b<=r||b>=r&&b<=a))return!0}u=d,c=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),t}(),la=function(){function t(){i(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new M((function(){return new Array})),this.polygonIndicesPool=new M((function(){return new Array}))}return o(t,[{key:"triangulate",value:function(e){var a=e,n=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var u=n-1,c=0,f=1;;){t:if(!s[c]){for(var d=r[u]<<1,v=r[c]<<1,m=r[f]<<1,p=a[d],g=a[d+1],y=a[v],k=a[v+1],b=a[m],x=a[m+1],w=(f+1)%n;w!=u;w=(w+1)%n)if(s[w]){var A=r[w]<<1,I=a[A],E=a[A+1];if(t.positiveArea(b,x,p,g,I,E)&&t.positiveArea(p,g,y,k,I,E)&&t.positiveArea(y,k,b,x,I,E))break t}break}if(0==f){do{if(!s[c])break;c--}while(c>0);break}u=c,c=f,f=(f+1)%n}l.push(r[(n+c-1)%n]),l.push(r[c]),l.push(r[(c+1)%n]),r.splice(c,1),s.splice(c,1);var S=(--n+c-1)%n,T=c==n?0:c;s[S]=t.isConcave(S,n,a,r),s[T]=t.isConcave(T,n,a,r)}return 3==n&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,a){var n=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=a.length;u0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(k),o.push(b),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,k,b),h=f)}o.length>0&&(r.push(o),i.push(s));for(var E=0,S=r.length;E=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,a,n){var r=n[(e+t-1)%e]<<1,i=n[t]<<1,s=n[(t+1)%e]<<1;return!this.positiveArea(a[r],a[r+1],a[i],a[i+1],a[s],a[s+1])}},{key:"positiveArea",value:function(t,e,a,n,r,i){return t*(i-n)+a*(e-i)+r*(n-e)>=0}},{key:"winding",value:function(t,e,a,n,r,i){var s=a-t,o=n-e;return r*o-i*s+s*e-t*o>=0?1:-1}}]),t}(),ua=function(){function t(){i(this,t),this.triangulator=new la,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return o(t,[{key:"clipStart",value:function(e,a){if(this.clipAttachment)return 0;this.clipAttachment=a;var n=a.worldVerticesLength,r=R.setArraySize(this.clippingPolygon,n);a.computeWorldVertices(e,0,n,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),W=0;W=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(a),u.push(n),u.push(r),u.push(i),u.push(t),u.push(e),o.length=0;for(var c=s,f=s.length-4,d=0;;d+=2){for(var v=c[d],m=c[d+1],p=c[d+2],g=c[d+3],y=v-p,k=m-g,b=u,x=u.length-2,w=o.length,A=0;A0;if(y*(E-g)-k*(I-p)>0){if(R){o.push(S),o.push(T);continue}var C=T-E,M=S-I,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-E)-C*(v-I))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(R){var X=T-E,L=S-I,N=X*(p-v)-L*(g-m);if(Math.abs(N)>1e-6){var P=(L*(m-E)-X*(v-I))/N;o.push(v+(p-v)*P),o.push(m+(g-m)*P)}else o.push(v),o.push(m);o.push(S),o.push(T)}l=!0}if(w==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;for(var O=0,B=o.length-2;O>1;l=0;za--)-1==Ba[za]&&(Ba[za]=Va[--Wa])}La.setFrame(Pa,pa(Oa,"time",0),Ba)}r.push(La)}if(t.events){for(var Ha=new Et(t.events.length),$a=0,Ja=0;Ja)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(a,"})")+"(?:\\.(\\d{1,".concat(a,"}))?")+"(?:\\.(\\d{1,".concat(a,"}))?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ra,Ra.exports);var Ca=Ra.exports;Aa(Ca);var Ma=Object.freeze({loose:!0}),Fa=Object.freeze({}),Ya=function(t){return t?"object"!==r(t)?Ma:t:Fa};Aa(Ya);var Xa=/^[0-9]+$/,La=function(t,e){var a=Xa.test(t),n=Xa.test(e);return a&&n&&(t=+t,e=+e),t===e?0:a&&!n?-1:n&&!a?1:t_a)throw new TypeError("version is longer than ".concat(_a," characters"));Pa("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;var n=e.trim().match(a.loose?Ba[Da.LOOSE]:Ba[Da.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Oa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===a)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(e){var i=[e,n];!1===a&&(i=[e]),0===Ua(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),ja=Wa;Aa(ja);var qa=ja,Ga=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof qa)return t;try{return new qa(t,e)}catch(t){if(!a)return null;throw t}};Aa(Ga);var za,Ha,$a=Ga,Ja=Aa((function(t,e){var a=$a(t,e);return a?a.version:null})),Qa=ja,Za=Ga,Ka=Ca.safeRe,tn=Ca.t,en=Aa((function(t,e){if(t instanceof Qa)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var a=null;if((e=e||{}).rtl){for(var n;(n=Ka[tn.COERCERTL].exec(t))&&(!a||a.index+a[0].length!==t.length);)a&&n.index+n[0].length===a.index+a[0].length||(a=n),Ka[tn.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Ka[tn.COERCERTL].lastIndex=-1}else a=t.match(Ka[tn.COERCE]);return null===a?null:Za("".concat(a[2],".").concat(a[3]||"0",".").concat(a[4]||"0"),e)}));var an=nn;function nn(t){var e=this;if(e instanceof nn||(e=new nn),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var a=0,n=arguments.length;a1)a=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,a=this.head.value}for(var r=0;null!==n;r++)a=t(a,n.value,r),n=n.next;return a},nn.prototype.reduceReverse=function(t,e){var a,n=this.tail;if(arguments.length>1)a=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,a=this.tail.value}for(var r=this.length-1;null!==n;r--)a=t(a,n.value,r),n=n.prev;return a},nn.prototype.toArray=function(){for(var t=new Array(this.length),e=0,a=this.head;null!==a;e++)t[e]=a.value,a=a.next;return t},nn.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,a=this.tail;null!==a;e++)t[e]=a.value,a=a.prev;return t},nn.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var a=new nn;if(ethis.length&&(e=this.length);for(var n=0,r=this.head;null!==r&&nthis.length&&(e=this.length);for(var n=this.length,r=this.tail;null!==r&&n>e;n--)r=r.prev;for(;null!==r&&n>t;n--,r=r.prev)a.push(r.value);return a},nn.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var a=0,n=this.head;null!==n&&athis[un])return En(this,this[yn].get(t)),!1;var i=this[yn].get(t).value;return this[mn]&&(this[pn]||this[mn](t,i.value)),i.now=n,i.maxAge=a,i.value=e,this[cn]+=r-i.length,i.length=r,this.get(t),In(this),!0}var s=new Sn(t,e,r,n,a);return s.length>this[un]?(this[mn]&&this[mn](t,e),!1):(this[cn]+=s.length,this[gn].unshift(s),this[yn].set(t,this[gn].head),In(this),!0)}},{key:"has",value:function(t){if(!this[yn].has(t))return!1;var e=this[yn].get(t).value;return!An(this,e)}},{key:"get",value:function(t){return wn(this,t,!0)}},{key:"peek",value:function(t){return wn(this,t,!1)}},{key:"pop",value:function(){var t=this[gn].tail;return t?(En(this,t),t.value):null}},{key:"del",value:function(t){En(this,this[yn].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),a=t.length-1;a>=0;a--){var n=t[a],r=n.e||0;if(0===r)this.set(n.k,n.v);else{var i=r-e;i>0&&this.set(n.k,n.v,i)}}}},{key:"prune",value:function(){var t=this;this[yn].forEach((function(e,a){return wn(t,a,!1)}))}}]),t}(),wn=function(t,e,a){var n=t[yn].get(e);if(n){var r=n.value;if(An(t,r)){if(En(t,n),!t[dn])return}else a&&(t[kn]&&(n.value.now=Date.now()),t[gn].unshiftNode(n));return r.value}},An=function(t,e){if(!e||!e.maxAge&&!t[vn])return!1;var a=Date.now()-e.now;return e.maxAge?a>e.maxAge:t[vn]&&a>t[vn]},In=function(t){if(t[cn]>t[un])for(var e=t[gn].tail;t[cn]>t[un]&&null!==e;){var a=e.prev;En(t,e),e=a}},En=function(t,e){if(e){var a=e.value;t[mn]&&t[mn](a.key,a.value),t[cn]-=a.length,t[yn].delete(a.key),t[gn].removeNode(e)}},Sn=o((function t(e,a,n,r,s){i(this,t),this.key=e,this.value=a,this.length=n,this.now=r,this.maxAge=s||0})),Tn=function(t,e,a,n){var r=a.value;An(t,r)&&(En(t,a),t[dn]||(r=void 0)),r&&e.call(n,r.value,r.key,t)},Rn=xn;Aa(Rn);var Cn=ja,Mn=function(t,e,a){return new Cn(t,a).compare(new Cn(e,a))};Aa(Mn);var Fn=Mn,Yn=function(t,e,a){return 0===Fn(t,e,a)};Aa(Yn);var Xn=Mn,Ln=function(t,e,a){return 0!==Xn(t,e,a)};Aa(Ln);var Nn=Mn,Pn=function(t,e,a){return Nn(t,e,a)>0};Aa(Pn);var _n=Mn,On=function(t,e,a){return _n(t,e,a)>=0};Aa(On);var Bn=Mn,Dn=function(t,e,a){return Bn(t,e,a)<0};Aa(Dn);var Vn=Mn,Un=function(t,e,a){return Vn(t,e,a)<=0};Aa(Un);var Wn,jn,qn,Gn,zn=Yn,Hn=Ln,$n=Pn,Jn=On,Qn=Dn,Zn=Un,Kn=function(t,e,a,n){switch(e){case"===":return"object"===r(t)&&(t=t.version),"object"===r(a)&&(a=a.version),t===a;case"!==":return"object"===r(t)&&(t=t.version),"object"===r(a)&&(a=a.version),t!==a;case"":case"=":case"==":return zn(t,a,n);case"!=":return Hn(t,a,n);case">":return $n(t,a,n);case">=":return Jn(t,a,n);case"<":return Qn(t,a,n);case"<=":return Zn(t,a,n);default:throw new TypeError("Invalid operator: ".concat(e))}};function tr(){if(Gn)return qn;Gn=1;var t=function(){function t(e,r){var s=this;if(i(this,t),r=a(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=k(this.set);try{for(l.s();!(h=l.n()).done;){var u=h.value;if(1===u.length&&g(u[0])){this.set=[u];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return o(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var a=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+t,s=e.get(i);if(s)return s;var o=this.options.loose,g=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(g,M(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],u),r("comparator trim",t),t=t.replace(h[l.TILDETRIM],c),r("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),r("caret trim",t);var y=t.split(" ").map((function(t){return b(t,a.options)})).join(" ").split(/\s+/).map((function(t){return C(t,a.options)}));o&&(y=y.filter((function(t){return r("loose invalid filter",t,a.options),!!t.match(h[l.COMPARATORLOOSE])}))),r("range list",y);var x,w=new Map,A=y.map((function(t){return new n(t,a.options)})),I=k(A);try{for(I.s();!(x=I.n()).done;){var E=x.value;if(m(E))return[E];w.set(E.value,E)}}catch(t){I.e(t)}finally{I.f()}w.size>1&&w.has("")&&w.delete("");var S=p(w.values());return e.set(i,S),S}},{key:"intersects",value:function(e,a){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return y(t,a)&&e.set.some((function(e){return y(e,a)&&t.every((function(t){return e.every((function(e){return t.intersects(e,a)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new s(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(s(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(s(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();Wn=e;var a=Ya,n=Ca.safeRe,r=Ca.t,s=Kn,h=Ta,l=ja,u=tr();return Wn}(),r=Ta,s=ja,h=Ca.safeRe,l=Ca.t,u=Ca.comparatorTrimReplace,c=Ca.tildeTrimReplace,f=Ca.caretTrimReplace,d=Ia.FLAG_INCLUDE_PRERELEASE,v=Ia.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},g=function(t){return""===t.value},y=function(t,e){for(var a=!0,n=t.slice(),r=n.pop();a&&n.length;)a=n.every((function(t){return r.intersects(t,e)})),r=n.pop();return a},b=function(t,e){return r("comp",t,e),t=I(t,e),r("caret",t),t=w(t,e),r("tildes",t),t=S(t,e),r("xrange",t),t=R(t,e),r("stars",t),t},x=function(t){return!t||"x"===t.toLowerCase()||"*"===t},w=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){var a=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(a,(function(e,a,n,i,s){var o;return r("tilde",t,e,a,n,i,s),x(a)?o="":x(n)?o=">=".concat(a,".0.0 <").concat(+a+1,".0.0-0"):x(i)?o=">=".concat(a,".").concat(n,".0 <").concat(a,".").concat(+n+1,".0-0"):s?(r("replaceTilde pr",s),o=">=".concat(a,".").concat(n,".").concat(i,"-").concat(s," <").concat(a,".").concat(+n+1,".0-0")):o=">=".concat(a,".").concat(n,".").concat(i," <").concat(a,".").concat(+n+1,".0-0"),r("tilde return",o),o}))},I=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){r("caret",t,e);var a=e.loose?h[l.CARETLOOSE]:h[l.CARET],n=e.includePrerelease?"-0":"";return t.replace(a,(function(e,a,i,s,o){var h;return r("caret",t,e,a,i,s,o),x(a)?h="":x(i)?h=">=".concat(a,".0.0").concat(n," <").concat(+a+1,".0.0-0"):x(s)?h="0"===a?">=".concat(a,".").concat(i,".0").concat(n," <").concat(a,".").concat(+i+1,".0-0"):">=".concat(a,".").concat(i,".0").concat(n," <").concat(+a+1,".0.0-0"):o?(r("replaceCaret pr",o),h="0"===a?"0"===i?">=".concat(a,".").concat(i,".").concat(s,"-").concat(o," <").concat(a,".").concat(i,".").concat(+s+1,"-0"):">=".concat(a,".").concat(i,".").concat(s,"-").concat(o," <").concat(a,".").concat(+i+1,".0-0"):">=".concat(a,".").concat(i,".").concat(s,"-").concat(o," <").concat(+a+1,".0.0-0")):(r("no pr"),h="0"===a?"0"===i?">=".concat(a,".").concat(i,".").concat(s).concat(n," <").concat(a,".").concat(i,".").concat(+s+1,"-0"):">=".concat(a,".").concat(i,".").concat(s).concat(n," <").concat(a,".").concat(+i+1,".0-0"):">=".concat(a,".").concat(i,".").concat(s," <").concat(+a+1,".0.0-0")),r("caret return",h),h}))},S=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){t=t.trim();var a=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(a,(function(a,n,i,s,o,h){r("xRange",t,a,n,i,s,o,h);var l=x(i),u=l||x(s),c=u||x(o),f=c;return"="===n&&f&&(n=""),h=e.includePrerelease?"-0":"",l?a=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(s=0),o=0,">"===n?(n=">=",u?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===n&&(n="<",u?i=+i+1:s=+s+1),"<"===n&&(h="-0"),a="".concat(n+i,".").concat(s,".").concat(o).concat(h)):u?a=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):c&&(a=">=".concat(i,".").concat(s,".0").concat(h," <").concat(i,".").concat(+s+1,".0-0")),r("xRange return",a),a}))},R=function(t,e){return r("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return r("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,a,n,r,i,s,o,h,l,u,c,f,d){return a=x(n)?"":x(r)?">=".concat(n,".0.0").concat(t?"-0":""):x(i)?">=".concat(n,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(a):">=".concat(a).concat(t?"-0":""),h=x(l)?"":x(u)?"<".concat(+l+1,".0.0-0"):x(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(a," ").concat(h).trim()}},F=function(t,e,a){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return qn}Aa(Kn);var er,ar,nr=tr(),rr=function(t,e,a){try{e=new nr(e,a)}catch(t){return!1}return e.test(t)},ir={valid:Ja,coerce:en,satisfies:Aa(rr),SEMVER_SPEC_VERSION:Ea.SEMVER_SPEC_VERSION},sr=0,or=1,hr=2,lr=[0,1,2,2,3,0],ur=function(){function t(e,n,r,s){var o;if(i(this,t),h(this,"autoUpdate",!0),h(this,"skeleton",void 0),h(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===Kt.length){var l,u=k((o=new Kt(n)).pages);try{for(u.s();!(l=u.n()).done;){var c=l.value;c.setTexture(new wa(s[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else o=new Kt(n,(function(t){return new wa(s[t])}));var f=new ca(new he(o));f.scale*=.01;var d=f.readSkeletonData(r);this.skeletonVersion=ir.valid(ir.coerce(d.version)),this._spine_3_6_0=ir.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=ir.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=ir.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=ir.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Se(d),this.skeleton.updateWorldTransform(),this.stateData=new zt(this.skeleton.data),this.states=[new Xt(this.stateData)],this.clipper=new ua,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}return o(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=s,n=0),t=c.material;var f=c.positions,d=c.vertexColor.r,v=c.vertexColor.g,m=c.vertexColor.b,p=c.vertexColor.a,g=c.uvs,y=void 0,k=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var a=this.states.length;for(e=0;e=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var h=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(h&&l){if(this.prev=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),M(a),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var n=a.completion;if("throw"===n.type){var r=n.arg;M(a)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,n){return this.delegate={iterator:Y(e),resultName:a,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var a=0;at.length)&&(e=t.length);for(var a=0,n=new Array(e);a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw i}}}}function b(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var n=a.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var x=function(){function t(){i(this,t),this.array=new Array}return o(t,[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),t}(),w=function(){function t(){i(this,t),this.entries={},this.size=0}return o(t,[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,a=0,n=t.length;a0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;i(this,t),this.r=e,this.g=a,this.b=n,this.a=r}return o(t,[{key:"set",value:function(t,e,a,n){return this.r=t,this.g=e,this.b=a,this.a=n,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value:function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,a,n){return this.r+=t,this.g+=e,this.b+=a,this.a+=n,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value:function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}]),t}();A.WHITE=new A(1,1,1,1),A.RED=new A(1,0,0,1),A.GREEN=new A(0,1,0,1),A.BLUE=new A(0,0,1,1),A.MAGENTA=new A(1,0,1,1);var I=function(){function t(){i(this,t)}return o(t,null,[{key:"clamp",value:function(t,e,a){return ta?a:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,a){return t.randomTriangularWith(e,a,.5*(e+a))}},{key:"randomTriangularWith",value:function(t,e,a){var n=Math.random(),r=e-t;return n<=(a-t)/r?t+Math.sqrt(n*r*(a-t)):e-Math.sqrt((1-n)*r*(e-a))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}]),t}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var E=function(){function t(){i(this,t)}return o(t,[{key:"apply",value:function(t,e,a){return t+(e-t)*this.applyInternal(a)}}]),t}(),S=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this)).power=2,n.power=t,n}return o(a,[{key:"applyInternal",value:function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}]),a}(E),T=function(t){l(a,t);var e=d(a);function a(t){return i(this,a),e.call(this,t)}return o(a,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}]),a}(S),R=function(){function t(){i(this,t)}return o(t,null,[{key:"arrayCopy",value:function(t,e,a,n,r){for(var i=e,s=n;i2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;if(n==e)return t;if(t.length=e,n2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=a?e:t.setArraySize(e,a,n)}},{key:"newArray",value:function(t,e){for(var a=new Array(t),n=0;n0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.x=e,this.y=a}return o(t,[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),t}(),Y=function(){function t(){i(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return o(t,[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}]),t}(),X=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;i(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}return o(t,[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var u=0,c=0,f=0;f0&&(h=o);for(var N=t.bone,P=N.worldX,_=N.worldY,O=N.a,B=N.b,D=N.c,V=N.d,U=e,W=r;W0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;le)return n-1;return a-1}},{key:"search",value:function(t,e,a){for(var n=t.length,r=a;re)return r-a;return n-a}}]),t}(),it=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,r)).curves=null,s.curves=R.newFloatArray(t+18*n),s.curves[t-1]=1,s}return o(a,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var a=R.newFloatArray(e);R.arrayCopy(this.curves,0,a,0,e),this.curves=a}}},{key:"setBezier",value:function(t,e,a,n,r,i,s,o,h,l,u){var c=this.curves,f=this.getFrameCount()+18*t;0==a&&(c[e]=2+f);for(var d=.03*(n-2*i+o),v=.03*(r-2*s+h),m=.006*(3*(i-o)-n+l),p=.006*(3*(s-h)-r+u),g=2*d+m,y=2*v+p,k=.3*(i-n)+d+.16666667*m,b=.3*(s-r)+v+.16666667*p,x=n+k,w=r+b,A=f+18;ft){var i=this.frames[e],s=this.frames[e+a];return s+(t-i)/(r[n]-i)*(r[n+1]-s)}var o=n+18;for(n+=2;n=t){var h=r[n-2],l=r[n-1];return l+(t-h)/(r[n]-h)*(r[n+1]-l)}e+=this.getFrameEntries();var u=r[o-2],c=r[o-1];return c+(t-u)/(this.frames[e]-u)*(this.frames[e+a]-c)}}]),a}(rt),st=function(t){l(a,t);var e=d(a);function a(t,n,r){return i(this,a),e.call(this,t,n,[r])}return o(a,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,a){t<<=1,this.frames[t]=e,this.frames[t+1]=a}},{key:"getCurveValue",value:function(t){for(var e=this.frames,a=e.length-2,n=2;n<=a;n+=2)if(e[n]>t){a=n-2;break}var r=this.curves[a>>1];switch(r){case 0:var i=e[a],s=e[a+1];return s+(t-i)/(e[a+2]-i)*(e[a+2+1]-s);case 1:return e[a+1]}return this.getBezierValue(t,a,1,r-2)}}]),a}(it),ot=function(t){l(a,t);var e=d(a);function a(t,n,r,s){return i(this,a),e.call(this,t,n,[r,s])}return o(a,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,a,n){t*=3,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n}}]),a}(it),ht=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,n,B+"|"+r)).boneIndex=0,s.boneIndex=r,s}return o(a,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.bones[this.boneIndex];if(o.active)if(a>2];switch(m){case 0:var p=h[v];c=h[v+1],f=h[v+2],d=h[v+3];var g=(a-p)/(h[v+4]-p);c+=(h[v+4+1]-c)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:c=h[v+1],f=h[v+2],d=h[v+3];break;default:c=this.getBezierValue(a,v,1,m-2),f=this.getBezierValue(a,v,2,m+18-2),d=this.getBezierValue(a,v,3,m+36-2)}if(1==r)l.r=c,l.g=f,l.b=d;else{if(i==P.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(c-l.r)*r,l.g+=(f-l.g)*r,l.b+=(d-l.b)*r}}}}}]),a}(it),bt=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,n,z+"|"+r)).slotIndex=0,s.slotIndex=r,s}return o(a,[{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(a>3];switch(x){case 0:var w=h[b];d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];var A=(a-w)/(h[b+8]-w);d+=(h[b+8+1]-d)*A,v+=(h[b+8+2]-v)*A,m+=(h[b+8+3]-m)*A,p+=(h[b+8+4]-p)*A,g+=(h[b+8+5]-g)*A,y+=(h[b+8+6]-y)*A,k+=(h[b+8+7]-k)*A;break;case 1:d=h[b+1],v=h[b+2],m=h[b+3],p=h[b+4],g=h[b+5],y=h[b+6],k=h[b+7];break;default:d=this.getBezierValue(a,b,1,x-2),v=this.getBezierValue(a,b,2,x+18-2),m=this.getBezierValue(a,b,3,x+36-2),p=this.getBezierValue(a,b,4,x+54-2),g=this.getBezierValue(a,b,5,x+72-2),y=this.getBezierValue(a,b,6,x+90-2),k=this.getBezierValue(a,b,7,x+108-2)}if(1==r)l.set(d,v,m,p),u.r=g,u.g=y,u.b=k;else{if(i==P.setup){l.setFromColor(o.data.color);var I=o.data.darkColor;u.r=I.r,u.g=I.g,u.b=I.b}l.add((d-l.r)*r,(v-l.g)*r,(m-l.b)*r,(p-l.a)*r),u.r+=(g-u.r)*r,u.g+=(y-u.g)*r,u.b+=(k-u.b)*r}}}}}]),a}(it),wt=function(t){l(a,t);var e=d(a);function a(t,n,r){var s;return i(this,a),(s=e.call(this,t,n,[G+"|"+r,H+"|"+r])).slotIndex=0,s.slotIndex=r,s}return o(a,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,a,n,r,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=a,this.frames[t+2]=n,this.frames[t+3]=r,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,u=o.darkColor;if(at){var i=this.frames[e];return a[n+1]*(t-i)/(a[n]-i)}var s=n+18;for(n+=2;n=t){var o=a[n-2],h=a[n-1];return h+(t-o)/(a[n]-o)*(a[n+1]-h)}var l=a[s-2],u=a[s-1];return u+(1-u)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,a,n,r,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof N&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(i=P.setup);var u=this.vertices,c=u[0].length,f=this.frames;if(a=f[f.length-1]){var p=u[f.length-1];if(1==r)if(i==P.add){var g=h;if(g.bones)for(var y=0;ya)this.apply(t,e,Number.MAX_VALUE,n,r,i,s),e=-1;else if(e>=o[h-1])return;if(!(a0&&o[l-1]==u;)l--;for(;l=o[l];l++)n.push(this.events[l])}}}}]),a}(rt);Et.propertyIds=[""+Q];var St=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,a.propertyIds)).drawOrders=null,n.drawOrders=new Array(t),n}return o(a,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,a){this.frames[t]=e,this.drawOrders[t]=a}},{key:"apply",value:function(t,e,a,n,r,i,s){if(s!=_.mixOut)if(a>2];switch(d){case 0:var v=h[f];l=h[f+1],u=h[f+2],c=h[f+3];var m=(a-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,u+=(h[f+4+2]-u)*m,c+=(h[f+4+3]-c)*m;break;case 1:l=h[f+1],u=h[f+2],c=h[f+3];break;default:l=this.getBezierValue(a,f,1,d-2),u=this.getBezierValue(a,f,2,d+18-2),c=this.getBezierValue(a,f,3,d+36-2)}if(i==P.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*r,o.mixX=p.mixX+(u-p.mixX)*r,o.mixY=p.mixY+(c-p.mixY)*r}else o.mixRotate+=(l-o.mixRotate)*r,o.mixX+=(u-o.mixX)*r,o.mixY+=(c-o.mixY)*r}}}}]),a}(it),Xt=function(){function t(e){i(this,t),this.data=null,this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Nt(this),this.propertyIDs=new w,this.animationsChanged=!1,this.trackEntryPool=new M((function(){return new Lt})),this.data=e}return o(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,a=0,n=e.length;a0){if(r.delay-=i,r.delay>0)continue;i=-r.delay,r.delay=0}var s=r.next;if(s){var o=r.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*s.timeScale,r.trackTime+=i,this.setCurrent(a,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&!r.mixingFrom){e[a]=null,this.queue.end(r),this.clearNext(r);continue}if(r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var a=t.mixingFrom;if(!a)return!0;var n=this.updateMixingFrom(a,e);return a.animationLast=a.nextAnimationLast,a.trackLast=a.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=a.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=a.mixingFrom,a.mixingFrom&&(a.mixingFrom.mixingTo=t),t.interruptAlpha=a.interruptAlpha,this.queue.end(a)),n):(a.trackTime+=e*a.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,a=this.tracks,n=!1,r=0,i=a.length;r0)){n=!0;var o=0==r?P.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),c=u,f=e;s.reverse&&(c=s.animation.duration-c,f=null);var d=s.animation.timelines,v=d.length;if(0==r&&1==h||o==P.add)for(var m=0;m1&&(r=1),a!=P.first&&(a=n.mixBlend));var i=r0&&this.queueEvents(n,f),this.events.length=0,n.nextAnimationLast=f,n.nextTrackLast=n.trackTime,r}},{key:"applyAttachmentTimeline",value:function(t,e,a,n,r){var i=e.slots[t.slotIndex];i.bone.active&&(a0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),c=f+d-d%360,p!=m&&(c+=360*I.signum(d)),i[s]=c}i[s+1]=f,h.rotation=l+c*n}}else t.apply(e,0,a,null,1,r,_.mixIn)}},{key:"queueEvents",value:function(t,e){for(var a=t.animationStart,n=t.animationEnd,r=n-a,i=t.trackLast%r,s=this.events,o=0,h=s.length;on||this.queue.event(t,l)}for((t.loop?0==r||i>t.trackTime%r:e>=n&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var a=e;;){var n=a.mixingFrom;if(!n)break;this.queue.end(n),a.mixingFrom=null,a.mixingTo=null,a=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,a){var n=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,n&&(a&&this.queue.interrupt(n),e.mixingFrom=n,n.mixingTo=e,e.mixTime=0,n.mixingFrom&&n.mixDuration>0&&(e.interruptAlpha*=Math.min(1,n.mixTime/n.mixDuration)),n.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.data.skeletonData.findAnimation(e);if(!n)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,n,a)}},{key:"setAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var n=!0,r=this.expandToIndex(t);r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.clearNext(r),r=r.mixingFrom,n=!1):this.clearNext(r));var i=this.trackEntry(t,e,a,r);return this.setCurrent(t,i,n),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,a,n)}},{key:"addAnimationWith",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(r)for(;r.next;)r=r.next;var i=this.trackEntry(t,e,a,r);return r?(r.next=i,i.previous=r,n<=0&&(n+=r.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=n,i}},{key:"setEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.setAnimationWith(e,t.emptyAnimation(),!1);return n.mixDuration=a,n.trackEnd=a,n}},{key:"addEmptyAnimation",value:function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.addAnimationWith(e,t.emptyAnimation(),!1,n);return n<=0&&(r.delay+=r.mixDuration-a),r.mixDuration=a,r.trackEnd=a,r}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var a=0,n=this.tracks.length;a0){r[h]=Wt,i[h]=c;continue t}break}r[h]=Ut}else r[h]=Bt}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return Gt||(Gt=new O("",[],0)),Gt}}]),t}(),Lt=function(){function t(){i(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=P.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return o(t,[{key:"reset",value:function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}},{key:"getAnimationTime",value:function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&(s.names=u,s.values=c,u=null,c=null),s.u=s.x/r.width,s.v=s.y/r.height,90==s.degrees?(s.u2=(s.x+s.height)/r.width,s.v2=(s.y+s.width)/r.height):(s.u2=(s.x+s.width)/r.width,s.v2=(s.y+s.height)/r.height),this.regions.push(s)}else{for((r=new ee).name=l.trim();0!=a.readEntry(n,l=a.readLine());){var p=o[n[0]];p&&p()}this.pages.push(r)}}return o(t,[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",n=k(this.pages);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.setTexture(t.get(a+r.name))}}catch(t){n.e(t)}finally{n.f()}}},{key:"dispose",value:function(){for(var t=0;t=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var a=e.indexOf(":");if(-1==a)return 0;t[0]=e.substr(0,a).trim();for(var n=1,r=a+1;;n++){var i=e.indexOf(",",r);if(-1==i)return t[n]=e.substr(r).trim(),n;if(t[n]=e.substr(r,i-r).trim(),r=i+1,4==n)return 4}}}]),t}(),ee=function(){function t(){i(this,t),this.name=null,this.minFilter=Pt.Nearest,this.magFilter=Pt.Nearest,this.uWrap=_t.ClampToEdge,this.vWrap=_t.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1}return o(t,[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap)}}]),t}(),ae=function(t){l(a,t);var e=d(a);function a(){var t;return i(this,a),(t=e.apply(this,arguments)).page=null,t.name=null,t.x=0,t.y=0,t.offsetX=0,t.offsetY=0,t.originalWidth=0,t.originalHeight=0,t.index=0,t.degrees=0,t.names=null,t.values=null,t}return o(a)}(Qt),ne=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t)).region=null,n.path=null,n.regionUVs=null,n.uvs=null,n.triangles=null,n.color=new A(1,1,1,1),n.width=0,n.height=0,n.hullLength=0,n.edges=null,n.parentMesh=null,n.tempColor=new A(0,0,0,0),n}return o(a,[{key:"updateUVs",value:function(){var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,a=this.uvs.length,n=this.region.u,r=this.region.v,i=0,s=0;if(this.region instanceof ae){var o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:n-=(o.originalHeight-o.offsetY-o.height)/l,r-=(o.originalWidth-o.offsetX-o.width)/u,i=o.originalHeight/l,s=o.originalWidth/u;for(var c=0;c= 0.");if(!a)throw new Error("name cannot be null.");this.index=e,this.name=a,this.parent=n}));!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(oe||(oe={}));var ue,ce,fe,de=function(){function t(e,a,n){if(i(this,t),this.data=null,this.skeleton=null,this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=a,this.parent=n,this.setToSetupPose()}return o(t,[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,a,n,r,i,s){this.ax=t,this.ay=e,this.arotation=a,this.ascaleX=n,this.ascaleY=r,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=a+90+s,u=h.scaleX,c=h.scaleY;return this.a=I.cosDeg(a+i)*n*u,this.b=I.cosDeg(l)*r*u,this.c=I.sinDeg(a+i)*n*c,this.d=I.sinDeg(l)*r*c,this.worldX=t*u+h.x,void(this.worldY=e*c+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case oe.Normal:var p=a+90+s,g=I.cosDeg(a+i)*n,y=I.cosDeg(p)*r,k=I.sinDeg(a+i)*n,b=I.sinDeg(p)*r;return this.a=f*g+d*k,this.b=f*y+d*b,this.c=v*g+m*k,void(this.d=v*y+m*b);case oe.OnlyTranslation:var x=a+90+s;this.a=I.cosDeg(a+i)*n,this.b=I.cosDeg(x)*r,this.c=I.sinDeg(a+i)*n,this.d=I.sinDeg(x)*r;break;case oe.NoRotationOrReflection:var w=f*f+v*v,A=0;w>1e-4?(w=Math.abs(f*m-d*v)/w,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*w,m=f*w,A=Math.atan2(v,f)*I.radDeg):(f=0,v=0,A=90-Math.atan2(m,d)*I.radDeg);var E=a+i-A,S=a+s-A+90,T=I.cosDeg(E)*n,R=I.cosDeg(S)*r,C=I.sinDeg(E)*n,M=I.sinDeg(S)*r;this.a=f*T-d*C,this.b=f*R-d*M,this.c=v*T+m*C,this.d=v*R+m*M;break;case oe.NoScale:case oe.NoScaleOrReflection:var F=I.cosDeg(a),Y=I.sinDeg(a),X=(f*F+d*Y)/this.skeleton.scaleX,L=(v*F+m*Y)/this.skeleton.scaleY,N=Math.sqrt(X*X+L*L);N>1e-5&&(N=1/N),X*=N,L*=N,N=Math.sqrt(X*X+L*L),this.data.transformMode==oe.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(N=-N);var P=Math.PI/2+Math.atan2(L,X),_=Math.cos(P)*N,O=Math.sin(P)*N,B=I.cosDeg(i)*n,D=I.cosDeg(90+s)*r,V=I.sinDeg(i)*n,U=I.sinDeg(90+s)*r;this.a=X*B+_*V,this.b=X*D+_*U,this.c=L*B+O*V,this.d=L*D+O*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*I.radDeg);var e=t.a,a=t.b,n=t.c,r=t.d,i=1/(e*r-a*n),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*r*i-o*a*i,this.ay=o*e*i-s*n*i;var h=i*r,l=i*e,u=i*a,c=i*n,f=h*this.a-u*this.c,d=h*this.b-u*this.d,v=l*this.c-c*this.a,m=l*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),a=t.x-this.worldX,n=t.y-this.worldY;return t.x=a*this.d*e-n*this.b*e,t.y=n*this.a*e-a*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,a=t.y;return t.x=e*this.a+a*this.b+this.worldX,t.y=e*this.c+a*this.d+this.worldY,t}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(this.a*e-this.c*a,this.d*a-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),a=I.cosDeg(t);return Math.atan2(a*this.c+e*this.d,a*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,a=this.b,n=this.c,r=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*n,this.b=i*a-s*r,this.c=s*e+i*n,this.d=s*a+i*r}}]),t}(),ve=o((function t(e,a,n){i(this,t),this.name=e,this.order=a,this.skinRequired=n})),me=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i(this,t),this.pathPrefix=null,this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=a,this.downloader=n||new pe}return o(t,[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,a){this.toLoad--,this.loaded++,this.assets[e]=a,t&&t(e,a)}},{key:"error",value:function(t,e,a){this.toLoad--,this.loaded++,this.errors[e]=a,t&&t(e,a)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,a){requestAnimationFrame((function n(){t.isLoadingComplete()?t.hasErrors()?a(t.errors):e(t):requestAnimationFrame(n)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadBinary(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load binary ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadText",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadText(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load text ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadJson",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t=this.start(t),this.downloader.downloadJson(t,(function(n){e.success(a,t,n)}),(function(a,r){e.error(n,t,"Couldn't load JSON ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"loadTexture",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((function(a){return a.ok?a.blob():(e.error(n,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(n){n&&e.success(a,t,e.textureLoader(n))}));else{var r=new Image;r.crossOrigin="anonymous",r.onload=function(){e.success(a,t,e.textureLoader(r))},r.onerror=function(){e.error(n,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),r.src=t}}},{key:"loadTextureAtlas",value:function(t){var e=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new Kt(i),l=h.pages.length,u=!1,c=k(h.pages);try{var f=function(){var i=o.value;e.loadTexture(null==r?s+i.name:r[i.name],(function(n,r){u||(i.setTexture(r),0==--l&&e.success(a,t,h))}),(function(a,r){u||e.error(n,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(a)),u=!0}))};for(c.s();!(o=c.n()).done;)f()}catch(t){c.e(t)}finally{c.f()}}catch(a){e.error(n,t,"Couldn't parse texture atlas ".concat(t,": ").concat(a.message))}}),(function(a,r){e.error(n,t,"Couldn't load texture atlas ".concat(t,": status ").concat(a,", ").concat(r))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var a=this.errors[t];throw Error("Asset not found: "+t+(a?"\n"+a:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),t}(),pe=function(){function t(){i(this,t),this.callbacks={},this.rawDataUris={}}return o(t,[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),a=e.length,n=new Uint8Array(a),r=0;r180?f-=360:f<-180&&(f+=360);var x=t.ascaleX,w=t.ascaleY;if(n||r){switch(t.data.transformMode){case oe.NoScale:case oe.NoScaleOrReflection:d=e-t.worldX,v=a-t.worldY}var A=t.data.length*x,E=Math.sqrt(d*d+v*v);if(n&&EA&&A>1e-4){var S=(E/A-1)*s+1;x*=S,i&&(w*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,x,w,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,a,n,r,i,s,o,h){var l=t.ax,u=t.ay,c=t.ascaleX,f=t.ascaleY,d=c,v=f,m=e.ascaleX,p=0,g=0,y=0;c<0?(c=-c,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var k=e.ax,b=0,x=0,w=0,A=t.a,E=t.b,S=t.c,T=t.d,R=Math.abs(c-f)<=1e-4;!R||i?(b=0,x=A*k+t.worldX,w=S*k+t.worldY):(x=A*k+E*(b=e.ay)+t.worldX,w=S*k+T*b+t.worldY);var C=t.parent;A=C.a,E=C.b,S=C.c;var M,F,Y=1/(A*(T=C.d)-E*S),X=x-C.worldX,L=w-C.worldY,N=(X*T-L*E)*Y-l,P=(L*A-X*S)*Y-u,_=Math.sqrt(N*N+P*P),O=e.data.length*m;if(_<1e-4)return this.apply1(t,a,n,!1,i,!1,h),void e.updateWorldTransformWith(k,b,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var B=((X=a-C.worldX)*T-(L=n-C.worldY)*E)*Y-l,D=(L*A-X*S)*Y-u,V=B*B+D*D;if(0!=o){o*=c*(m+1)*.5;var U=Math.sqrt(V),W=U-_-O*c+o;if(W>0){var j=Math.min(1,W/(2*o))-1;V=(B-=(j=(W-o*(1-j*j))/U)*B)*B+(D-=j*D)*D}}t:if(R){var q=(V-_*_-(O*=c)*O)/(2*_*O);q<-1?(q=-1,F=Math.PI*r):q>1?(q=1,F=0,i&&(d*=A=(Math.sqrt(V)/(_+O)-1)*h+1,s&&(v*=A))):F=Math.acos(q)*r,A=_+O*q,E=O*Math.sin(F),M=Math.atan2(D*A-B*E,B*A+D*E)}else{var G=(A=c*O)*A,z=(E=f*O)*E,H=Math.atan2(D,B),$=-2*z*_,J=z-G;if((T=$*$-4*J*(S=z*_*_+G*V-G*z))>=0){var Q=Math.sqrt(T);$<0&&(Q=-Q);var Z=(Q=.5*-($+Q))/J,K=S/Q,tt=Math.abs(Z)=-1&&S<=1&&(S=Math.acos(S),(T=(X=A*Math.cos(S)+_)*X+(L=E*Math.sin(S))*L)ot&&(it=S,ot=T,st=X,ht=L)),V<=.5*(nt+ot)?(M=H-Math.atan2(rt*r,at),F=et*r):(M=H-Math.atan2(ht*r,st),F=it*r)}var lt=Math.atan2(b,k)*y,ut=t.arotation;(M=(M-lt)*I.radDeg+p-ut)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,u,ut+M*h,d,v,0,0),ut=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ut)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(k,b,ut+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]),t}(),be=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,0,!1)).bones=new Array,n.target=null,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return o(a)}(ve),xe=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,0,!1)).bones=new Array,n.target=null,n.positionMode=null,n.spacingMode=null,n.rotateMode=null,n.offsetRotation=0,n.position=0,n.spacing=0,n.mixRotate=0,n.mixX=0,n.mixY=0,n}return o(a)}(ve);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(ue||(ue={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(ce||(ce={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(fe||(fe={}));var we=function(){function t(e,a){if(i(this,t),this.data=null,this.bones=null,this.target=null,this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var n=0,r=e.bones.length;n0){b=u/b*d;for(var M=1;M0?I.degRad:-I.degRad}for(var q=0,G=3;q0){var tt=z.a,et=z.b,at=z.c,nt=z.d,rt=0,it=0,st=0;if(rt=s?B[G-1]:0==c[q+1]?B[G+2]:Math.atan2(Q,J),rt-=Math.atan2(at,tt),W){it=Math.cos(rt),st=Math.sin(rt);var ot=z.data.length;D+=(ot*(it*tt-st*at)-J)*a,V+=(ot*(st*tt+it*at)-Q)*a}else rt+=U;rt>I.PI?rt-=I.PI2:rt<-I.PI&&(rt+=I.PI2),rt*=a,it=Math.cos(rt),st=Math.sin(rt),z.a=it*tt-st*at,z.b=it*et-st*nt,z.c=st*tt+it*at,z.d=st*et+it*nt}z.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,a,n){var r=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*a+2),h=null,l=e.closed,u=e.worldVerticesLength,c=u/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[c-=l?1:2];switch(this.data.positionMode==ue.Percent&&(i*=m),this.data.spacingMode){case ce.Percent:d=m;break;case ce.Proportional:d=m/a;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(r,u-6,4,h,0,2)),this.addAfterPosition(b-m,h,0,o,g);continue}}for(;;y++){var x=v[y];if(!(b>x)){if(0==y)b/=x;else{var w=v[y-1];b=(b-w)/(x-w)}break}}y!=f&&(f=y,l&&y==c?(e.computeWorldVertices(r,u-4,4,h,0,2),e.computeWorldVertices(r,0,4,h,4,2)):e.computeWorldVertices(r,6*y+2,8,h,0,2)),this.addCurvePosition(b,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,n||p>0&&0==k)}return o}l?(u+=2,h=R.setArraySize(this.world,u),e.computeWorldVertices(r,2,u-4,h,0,2),e.computeWorldVertices(r,0,2,h,u-4,2),h[u-2]=h[0],h[u-1]=h[1]):(c--,u-=4,h=R.setArraySize(this.world,u),e.computeWorldVertices(r,2,u,h,0,2));for(var A,I=R.setArraySize(this.curves,c),E=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,X=0,L=0,N=0,P=0,_=0,O=0,B=0,D=0,V=0,U=0,W=0,j=2;WE){this.addAfterPosition(Z-E,h,u-4,o,H);continue}}for(;;$++){var K=I[$];if(!(Z>K)){if(0==$)Z/=K;else{var tt=I[$-1];Z=(Z-tt)/(K-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],B=2*(N=.03*(S-2*C+F))+(_=.006*(3*(C-F)-S+(X=h[et+6]))),D=2*(P=.03*(T-2*M+Y))+(O=.006*(3*(M-Y)-T+(L=h[et+7]))),V=.3*(C-S)+N+.16666667*_,U=.3*(M-T)+P+.16666667*O,G=Math.sqrt(V*V+U*U),q[0]=G,et=1;et<8;et++)V+=B,U+=D,B+=_,D+=O,G+=Math.sqrt(V*V+U*U),q[et]=G;V+=B,U+=D,G+=Math.sqrt(V*V+U*U),q[8]=G,V+=B+_,U+=D+O,G+=Math.sqrt(V*V+U*U),q[9]=G,J=0}for(Z*=G;;J++){var at=q[J];if(!(Z>at)){if(0==J)Z/=at;else{var nt=q[J-1];Z=J+(Z-nt)/(at-nt)}break}}this.addCurvePosition(.1*Z,S,T,C,M,F,Y,X,L,o,H,n||z>0&&0==Q)}return o}},{key:"addBeforePosition",value:function(t,e,a,n,r){var i=e[a],s=e[a+1],o=e[a+2]-i,h=e[a+3]-s,l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addAfterPosition",value:function(t,e,a,n,r){var i=e[a+2],s=e[a+3],o=i-e[a],h=s-e[a+1],l=Math.atan2(h,o);n[r]=i+t*Math.cos(l),n[r+1]=s+t*Math.sin(l),n[r+2]=l}},{key:"addCurvePosition",value:function(t,e,a,n,r,i,s,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=a,void(l[u+2]=Math.atan2(r-a,n-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,k=v*y,b=y*t,x=e*p+n*k+i*b+o*d,w=a*p+r*k+s*b+h*d;l[u]=x,l[u+1]=w,c&&(l[u+2]=t<.001?Math.atan2(r-a,n-e):Math.atan2(w-(a*m+r*g*2+s*f),x-(e*m+n*g*2+i*f)))}}]),t}();we.NONE=-1,we.BEFORE=-2,we.AFTER=-3,we.epsilon=1e-5;var Ae,Ie=function(){function t(e,a){if(i(this,t),this.data=null,this.bone=null,this.color=null,this.darkColor=null,this.attachment=null,this.attachmentTime=0,this.attachmentState=0,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!a)throw new Error("bone cannot be null.");this.data=e,this.bone=a,this.color=new A,this.darkColor=e.darkColor?new A:null,this.setToSetupPose()}return o(t,[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof N&&this.attachment instanceof N&&t.deformAttachment==this.attachment.deformAttachment||(this.deform.length=0),this.attachment=t,this.attachmentTime=this.bone.skeleton.time)}},{key:"setAttachmentTime",value:function(t){this.attachmentTime=this.bone.skeleton.time-t}},{key:"getAttachmentTime",value:function(){return this.bone.skeleton.time-this.attachmentTime}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),t}(),Ee=function(){function t(e,a){if(i(this,t),this.data=null,this.bones=null,this.target=null,this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new F,this.active=!1,!e)throw new Error("data cannot be null.");if(!a)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var n=0;n0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(T.x-y.worldX)*e,y.worldY+=(T.y-y.worldY)*a}if(0!=n){var R=Math.sqrt(y.a*y.a+y.c*y.c);0!=R&&(R=(R+(Math.sqrt(h*h+u*u)-R+this.data.offsetScaleX)*n)/R),y.a*=R,y.c*=R}if(0!=r){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+c*c)-C+this.data.offsetScaleY)*r)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),X=Math.atan2(c,l)-Math.atan2(u,h)-(Y-Math.atan2(y.c,y.a));X>I.PI?X-=I.PI2:X<-I.PI&&(X+=I.PI2),X=Y+(X+v)*i;var L=Math.sqrt(M*M+F*F);y.b=Math.cos(X)*L,y.d=Math.sin(X)*L}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=a,o=this.target,h=o.a,l=o.b,u=o.c,c=o.d,f=h*c-l*u>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?A-=I.PI2:A<-I.PI&&(A+=I.PI2),A*=t;var E=Math.cos(A),S=Math.sin(A);y.a=E*k-S*x,y.b=E*b-S*w,y.c=S*k+E*x,y.d=S*b+E*w}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=T.x*e,y.worldY+=T.y*a}if(0!=n){var R=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*n+1;y.a*=R,y.c*=R}if(0!=r){var C=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleY)*r+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(c,l)-Math.atan2(u,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var X=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*X,y.d=Math.sin(M)*X}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,a=this.mixY,n=this.mixScaleX,r=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var n=this.drawOrder,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=n.length;h0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i(this,t),this.slotIndex=e,this.name=a,this.attachment=n})),Ce=function(){function t(e){if(i(this,t),this.name=null,this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}return o(t,[{key:"setAttachment",value:function(t,e,a){if(!a)throw new Error("attachment cannot be null.");var n=this.attachments;t>=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=a}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!a)throw new Error("name cannot be null.");if(!n)throw new Error("boneData cannot be null.");this.index=e,this.name=a,this.boneData=n}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Ae||(Ae={}));var Fe,Ye=function(t){l(a,t);var e=d(a);function a(t){var n;return i(this,a),(n=e.call(this,t,0,!1)).bones=new Array,n.target=null,n.mixRotate=0,n.mixX=0,n.mixY=0,n.mixScaleX=0,n.mixScaleY=0,n.mixShearY=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 o(a)}(ve),Xe=function(){function t(e){i(this,t),this.scale=1,this.attachmentLoader=null,this.linkedMeshes=new Array,this.attachmentLoader=e}return o(t,[{key:"readSkeletonData",value:function(t){var e=this.scale,a=new Te;a.name="";var n=new Le(t),r=n.readInt32(),i=n.readInt32();a.hash=0==i&&0==r?null:i.toString(16)+r.toString(16),a.version=n.readString(),a.x=n.readFloat(),a.y=n.readFloat(),a.width=n.readFloat(),a.height=n.readFloat();var s=n.readBoolean();s&&(a.fps=n.readFloat(),a.imagesPath=n.readString(),a.audioPath=n.readString());var o=0;o=n.readInt(!0);for(var h=0;h0){for(var pn=new St(mn),gn=a.slots.length,yn=0;yn=0;wn--)xn[wn]=-1;for(var An=R.newArray(gn-bn,0),In=0,En=0,Sn=0;Sn=0;Rn--)-1==xn[Rn]&&(xn[Rn]=An[--En]);pn.setFrame(yn,kn,xn)}n.push(pn)}var Cn=t.readInt(!0);if(Cn>0){for(var Mn=new Et(Cn),Fn=0;Fn1&&void 0!==arguments[1]?arguments[1]:new Array,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);i(this,t),this.strings=a,this.index=n,this.buffer=r}return o(t,[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),a=127&e;return 0!=(128&e)&&(a|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(a|=(127&(e=this.readByte()))<<28)))),t?a:a>>>1^-(1&a)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",a=0;a>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),a+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),a+=3;break;default:e+=String.fromCharCode(n),a++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),t}(),Ne=o((function t(e,a,n,r,s){i(this,t),this.mesh=e,this.skin=a,this.slotIndex=n,this.parent=r,this.inheritDeform=s})),Pe=o((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i(this,t),this.bones=e,this.vertices=a}));function _e(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,n,r),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(i);break;case oa:Be(t,e,s++,i,0,n,h,r,l,a)}n=h,r=l}return e}function Oe(t,e,a){for(var n=t.readFloat(),r=t.readFloat()*a,i=t.readFloat()*a,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,n,r,i),s!=h;s++){var l=t.readFloat(),u=t.readFloat()*a,c=t.readFloat()*a;switch(t.readByte()){case sa:e.setStepped(s);break;case oa:Be(t,e,o++,s,0,n,l,r,u,a),Be(t,e,o++,s,1,n,l,i,c,a)}n=l,r=u,i=c}return e}function Be(t,e,a,n,r,i,s,o,h,l){e.setBezier(a,n,r,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Fe||(Fe={}));var De,Ve=0,Ue=1,We=2,je=3,qe=4,Ge=5,ze=6,He=7,$e=8,Je=9,Qe=0,Ze=1,Ke=2,ta=3,ea=4,aa=5,na=0,ra=1,ia=2,sa=1,oa=2,ha=function(){function t(){i(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new M((function(){return R.newFloatArray(16)}))}return o(t,[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var a=this.boundingBoxes,n=this.polygons,r=this.polygonPool,i=t.slots,s=i.length;a.length=0,r.freeAll(n),n.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,a,n){var r=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=r&&a<=r||e<=i&&n<=i||t>=s&&a>=s||e>=o&&n>=o)return!1;var h=(n-e)/(a-t),l=h*(r-t)+e;if(l>i&&li&&lr&&ur&&ut.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var a=this.polygons,n=0,r=a.length;n=a||l=a){var u=n[o];u+(a-h)/(l-h)*(n[i]-u)=u&&k<=d||k>=d&&k<=u)&&(k>=e&&k<=n||k>=n&&k<=e)){var b=(l*g-h*m)/y;if((b>=c&&b<=v||b>=v&&b<=c)&&(b>=a&&b<=r||b>=r&&b<=a))return!0}u=d,c=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),t}(),la=function(){function t(){i(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new M((function(){return new Array})),this.polygonIndicesPool=new M((function(){return new Array}))}return o(t,[{key:"triangulate",value:function(e){var a=e,n=e.length>>1,r=this.indicesArray;r.length=0;for(var i=0;i3;){for(var u=n-1,c=0,f=1;;){t:if(!s[c]){for(var d=r[u]<<1,v=r[c]<<1,m=r[f]<<1,p=a[d],g=a[d+1],y=a[v],k=a[v+1],b=a[m],x=a[m+1],w=(f+1)%n;w!=u;w=(w+1)%n)if(s[w]){var A=r[w]<<1,I=a[A],E=a[A+1];if(t.positiveArea(b,x,p,g,I,E)&&t.positiveArea(p,g,y,k,I,E)&&t.positiveArea(y,k,b,x,I,E))break t}break}if(0==f){do{if(!s[c])break;c--}while(c>0);break}u=c,c=f,f=(f+1)%n}l.push(r[(n+c-1)%n]),l.push(r[c]),l.push(r[(c+1)%n]),r.splice(c,1),s.splice(c,1);var S=(--n+c-1)%n,T=c==n?0:c;s[S]=t.isConcave(S,n,a,r),s[T]=t.isConcave(T,n,a,r)}return 3==n&&(l.push(r[2]),l.push(r[0]),l.push(r[1])),l}},{key:"decompose",value:function(e,a){var n=e,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=a.length;u0?(r.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(k),o.push(b),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,k,b),h=f)}o.length>0&&(r.push(o),i.push(s));for(var E=0,S=r.length;E=0;$--)0==(o=r[$]).length&&(r.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return r}}],[{key:"isConcave",value:function(t,e,a,n){var r=n[(e+t-1)%e]<<1,i=n[t]<<1,s=n[(t+1)%e]<<1;return!this.positiveArea(a[r],a[r+1],a[i],a[i+1],a[s],a[s+1])}},{key:"positiveArea",value:function(t,e,a,n,r,i){return t*(i-n)+a*(e-i)+r*(n-e)>=0}},{key:"winding",value:function(t,e,a,n,r,i){var s=a-t,o=n-e;return r*o-i*s+s*e-t*o>=0?1:-1}}]),t}(),ua=function(){function t(){i(this,t),this.triangulator=new la,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return o(t,[{key:"clipStart",value:function(e,a){if(this.clipAttachment)return 0;this.clipAttachment=a;var n=a.worldVerticesLength,r=R.setArraySize(this.clippingPolygon,n);a.computeWorldVertices(e,0,n,r,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),W=0;W=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(a),u.push(n),u.push(r),u.push(i),u.push(t),u.push(e),o.length=0;for(var c=s,f=s.length-4,d=0;;d+=2){for(var v=c[d],m=c[d+1],p=c[d+2],g=c[d+3],y=v-p,k=m-g,b=u,x=u.length-2,w=o.length,A=0;A0;if(y*(E-g)-k*(I-p)>0){if(R){o.push(S),o.push(T);continue}var C=T-E,M=S-I,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-E)-C*(v-I))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(R){var X=T-E,L=S-I,N=X*(p-v)-L*(g-m);if(Math.abs(N)>1e-6){var P=(L*(m-E)-X*(v-I))/N;o.push(v+(p-v)*P),o.push(m+(g-m)*P)}else o.push(v),o.push(m);o.push(S),o.push(T)}l=!0}if(w==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var _=o;(o=u).length=0,u=_}if(h!=o){h.length=0;for(var O=0,B=o.length-2;O>1;l=0;za--)-1==Ba[za]&&(Ba[za]=Va[--Wa])}La.setFrame(Pa,pa(Oa,"time",0),Ba)}r.push(La)}if(t.events){for(var Ha=new Et(t.events.length),$a=0,Ja=0;Ja)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(a,"})")+"(?:\\.(\\d{1,".concat(a,"}))?")+"(?:\\.(\\d{1,".concat(a,"}))?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ra,Ra.exports);var Ca=Ra.exports;Aa(Ca);var Ma=Object.freeze({loose:!0}),Fa=Object.freeze({}),Ya=function(t){return t?"object"!==r(t)?Ma:t:Fa};Aa(Ya);var Xa=/^[0-9]+$/,La=function(t,e){var a=Xa.test(t),n=Xa.test(e);return a&&n&&(t=+t,e=+e),t===e?0:a&&!n?-1:n&&!a?1:t_a)throw new TypeError("version is longer than ".concat(_a," characters"));Pa("SemVer",e,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;var n=e.trim().match(a.loose?Ba[Da.LOOSE]:Ba[Da.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Oa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(e===this.prerelease.join(".")&&!1===a)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(e){var i=[e,n];!1===a&&(i=[e]),0===Ua(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),ja=Wa;Aa(ja);var qa=ja,Ga=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof qa)return t;try{return new qa(t,e)}catch(t){if(!a)return null;throw t}};Aa(Ga);var za,Ha,$a=Ga,Ja=Aa((function(t,e){var a=$a(t,e);return a?a.version:null})),Qa=ja,Za=Ga,Ka=Ca.safeRe,tn=Ca.t,en=Aa((function(t,e){if(t instanceof Qa)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var a=null;if((e=e||{}).rtl){for(var n;(n=Ka[tn.COERCERTL].exec(t))&&(!a||a.index+a[0].length!==t.length);)a&&n.index+n[0].length===a.index+a[0].length||(a=n),Ka[tn.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Ka[tn.COERCERTL].lastIndex=-1}else a=t.match(Ka[tn.COERCE]);return null===a?null:Za("".concat(a[2],".").concat(a[3]||"0",".").concat(a[4]||"0"),e)}));var an=nn;function nn(t){var e=this;if(e instanceof nn||(e=new nn),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var a=0,n=arguments.length;a1)a=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,a=this.head.value}for(var r=0;null!==n;r++)a=t(a,n.value,r),n=n.next;return a},nn.prototype.reduceReverse=function(t,e){var a,n=this.tail;if(arguments.length>1)a=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,a=this.tail.value}for(var r=this.length-1;null!==n;r--)a=t(a,n.value,r),n=n.prev;return a},nn.prototype.toArray=function(){for(var t=new Array(this.length),e=0,a=this.head;null!==a;e++)t[e]=a.value,a=a.next;return t},nn.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,a=this.tail;null!==a;e++)t[e]=a.value,a=a.prev;return t},nn.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var a=new nn;if(ethis.length&&(e=this.length);for(var n=0,r=this.head;null!==r&&nthis.length&&(e=this.length);for(var n=this.length,r=this.tail;null!==r&&n>e;n--)r=r.prev;for(;null!==r&&n>t;n--,r=r.prev)a.push(r.value);return a},nn.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var a=0,n=this.head;null!==n&&athis[un])return En(this,this[yn].get(t)),!1;var i=this[yn].get(t).value;return this[mn]&&(this[pn]||this[mn](t,i.value)),i.now=n,i.maxAge=a,i.value=e,this[cn]+=r-i.length,i.length=r,this.get(t),In(this),!0}var s=new Sn(t,e,r,n,a);return s.length>this[un]?(this[mn]&&this[mn](t,e),!1):(this[cn]+=s.length,this[gn].unshift(s),this[yn].set(t,this[gn].head),In(this),!0)}},{key:"has",value:function(t){if(!this[yn].has(t))return!1;var e=this[yn].get(t).value;return!An(this,e)}},{key:"get",value:function(t){return wn(this,t,!0)}},{key:"peek",value:function(t){return wn(this,t,!1)}},{key:"pop",value:function(){var t=this[gn].tail;return t?(En(this,t),t.value):null}},{key:"del",value:function(t){En(this,this[yn].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),a=t.length-1;a>=0;a--){var n=t[a],r=n.e||0;if(0===r)this.set(n.k,n.v);else{var i=r-e;i>0&&this.set(n.k,n.v,i)}}}},{key:"prune",value:function(){var t=this;this[yn].forEach((function(e,a){return wn(t,a,!1)}))}}]),t}(),wn=function(t,e,a){var n=t[yn].get(e);if(n){var r=n.value;if(An(t,r)){if(En(t,n),!t[dn])return}else a&&(t[kn]&&(n.value.now=Date.now()),t[gn].unshiftNode(n));return r.value}},An=function(t,e){if(!e||!e.maxAge&&!t[vn])return!1;var a=Date.now()-e.now;return e.maxAge?a>e.maxAge:t[vn]&&a>t[vn]},In=function(t){if(t[cn]>t[un])for(var e=t[gn].tail;t[cn]>t[un]&&null!==e;){var a=e.prev;En(t,e),e=a}},En=function(t,e){if(e){var a=e.value;t[mn]&&t[mn](a.key,a.value),t[cn]-=a.length,t[yn].delete(a.key),t[gn].removeNode(e)}},Sn=o((function t(e,a,n,r,s){i(this,t),this.key=e,this.value=a,this.length=n,this.now=r,this.maxAge=s||0})),Tn=function(t,e,a,n){var r=a.value;An(t,r)&&(En(t,a),t[dn]||(r=void 0)),r&&e.call(n,r.value,r.key,t)},Rn=xn;Aa(Rn);var Cn=ja,Mn=function(t,e,a){return new Cn(t,a).compare(new Cn(e,a))};Aa(Mn);var Fn=Mn,Yn=function(t,e,a){return 0===Fn(t,e,a)};Aa(Yn);var Xn=Mn,Ln=function(t,e,a){return 0!==Xn(t,e,a)};Aa(Ln);var Nn=Mn,Pn=function(t,e,a){return Nn(t,e,a)>0};Aa(Pn);var _n=Mn,On=function(t,e,a){return _n(t,e,a)>=0};Aa(On);var Bn=Mn,Dn=function(t,e,a){return Bn(t,e,a)<0};Aa(Dn);var Vn=Mn,Un=function(t,e,a){return Vn(t,e,a)<=0};Aa(Un);var Wn,jn,qn,Gn,zn=Yn,Hn=Ln,$n=Pn,Jn=On,Qn=Dn,Zn=Un,Kn=function(t,e,a,n){switch(e){case"===":return"object"===r(t)&&(t=t.version),"object"===r(a)&&(a=a.version),t===a;case"!==":return"object"===r(t)&&(t=t.version),"object"===r(a)&&(a=a.version),t!==a;case"":case"=":case"==":return zn(t,a,n);case"!=":return Hn(t,a,n);case">":return $n(t,a,n);case">=":return Jn(t,a,n);case"<":return Qn(t,a,n);case"<=":return Zn(t,a,n);default:throw new TypeError("Invalid operator: ".concat(e))}};function tr(){if(Gn)return qn;Gn=1;var t=function(){function t(e,r){var s=this;if(i(this,t),r=a(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=k(this.set);try{for(l.s();!(h=l.n()).done;){var u=h.value;if(1===u.length&&g(u[0])){this.set=[u];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return o(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var a=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+t,s=e.get(i);if(s)return s;var o=this.options.loose,g=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(g,M(this.options.includePrerelease)),r("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],u),r("comparator trim",t),t=t.replace(h[l.TILDETRIM],c),r("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),r("caret trim",t);var y=t.split(" ").map((function(t){return b(t,a.options)})).join(" ").split(/\s+/).map((function(t){return C(t,a.options)}));o&&(y=y.filter((function(t){return r("loose invalid filter",t,a.options),!!t.match(h[l.COMPARATORLOOSE])}))),r("range list",y);var x,w=new Map,A=y.map((function(t){return new n(t,a.options)})),I=k(A);try{for(I.s();!(x=I.n()).done;){var E=x.value;if(m(E))return[E];w.set(E.value,E)}}catch(t){I.e(t)}finally{I.f()}w.size>1&&w.has("")&&w.delete("");var S=p(w.values());return e.set(i,S),S}},{key:"intersects",value:function(e,a){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return y(t,a)&&e.set.some((function(e){return y(e,a)&&t.every((function(t){return e.every((function(e){return t.intersects(e,a)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new s(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(s(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(s(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();Wn=e;var a=Ya,n=Ca.safeRe,r=Ca.t,s=Kn,h=Ta,l=ja,u=tr();return Wn}(),r=Ta,s=ja,h=Ca.safeRe,l=Ca.t,u=Ca.comparatorTrimReplace,c=Ca.tildeTrimReplace,f=Ca.caretTrimReplace,d=Ia.FLAG_INCLUDE_PRERELEASE,v=Ia.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},g=function(t){return""===t.value},y=function(t,e){for(var a=!0,n=t.slice(),r=n.pop();a&&n.length;)a=n.every((function(t){return r.intersects(t,e)})),r=n.pop();return a},b=function(t,e){return r("comp",t,e),t=I(t,e),r("caret",t),t=w(t,e),r("tildes",t),t=S(t,e),r("xrange",t),t=R(t,e),r("stars",t),t},x=function(t){return!t||"x"===t.toLowerCase()||"*"===t},w=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){var a=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(a,(function(e,a,n,i,s){var o;return r("tilde",t,e,a,n,i,s),x(a)?o="":x(n)?o=">=".concat(a,".0.0 <").concat(+a+1,".0.0-0"):x(i)?o=">=".concat(a,".").concat(n,".0 <").concat(a,".").concat(+n+1,".0-0"):s?(r("replaceTilde pr",s),o=">=".concat(a,".").concat(n,".").concat(i,"-").concat(s," <").concat(a,".").concat(+n+1,".0-0")):o=">=".concat(a,".").concat(n,".").concat(i," <").concat(a,".").concat(+n+1,".0-0"),r("tilde return",o),o}))},I=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){r("caret",t,e);var a=e.loose?h[l.CARETLOOSE]:h[l.CARET],n=e.includePrerelease?"-0":"";return t.replace(a,(function(e,a,i,s,o){var h;return r("caret",t,e,a,i,s,o),x(a)?h="":x(i)?h=">=".concat(a,".0.0").concat(n," <").concat(+a+1,".0.0-0"):x(s)?h="0"===a?">=".concat(a,".").concat(i,".0").concat(n," <").concat(a,".").concat(+i+1,".0-0"):">=".concat(a,".").concat(i,".0").concat(n," <").concat(+a+1,".0.0-0"):o?(r("replaceCaret pr",o),h="0"===a?"0"===i?">=".concat(a,".").concat(i,".").concat(s,"-").concat(o," <").concat(a,".").concat(i,".").concat(+s+1,"-0"):">=".concat(a,".").concat(i,".").concat(s,"-").concat(o," <").concat(a,".").concat(+i+1,".0-0"):">=".concat(a,".").concat(i,".").concat(s,"-").concat(o," <").concat(+a+1,".0.0-0")):(r("no pr"),h="0"===a?"0"===i?">=".concat(a,".").concat(i,".").concat(s).concat(n," <").concat(a,".").concat(i,".").concat(+s+1,"-0"):">=".concat(a,".").concat(i,".").concat(s).concat(n," <").concat(a,".").concat(+i+1,".0-0"):">=".concat(a,".").concat(i,".").concat(s," <").concat(+a+1,".0.0-0")),r("caret return",h),h}))},S=function(t,e){return r("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){t=t.trim();var a=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(a,(function(a,n,i,s,o,h){r("xRange",t,a,n,i,s,o,h);var l=x(i),u=l||x(s),c=u||x(o),f=c;return"="===n&&f&&(n=""),h=e.includePrerelease?"-0":"",l?a=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(s=0),o=0,">"===n?(n=">=",u?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===n&&(n="<",u?i=+i+1:s=+s+1),"<"===n&&(h="-0"),a="".concat(n+i,".").concat(s,".").concat(o).concat(h)):u?a=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):c&&(a=">=".concat(i,".").concat(s,".0").concat(h," <").concat(i,".").concat(+s+1,".0-0")),r("xRange return",a),a}))},R=function(t,e){return r("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return r("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,a,n,r,i,s,o,h,l,u,c,f,d){return a=x(n)?"":x(r)?">=".concat(n,".0.0").concat(t?"-0":""):x(i)?">=".concat(n,".").concat(r,".0").concat(t?"-0":""):s?">=".concat(a):">=".concat(a).concat(t?"-0":""),h=x(l)?"":x(u)?"<".concat(+l+1,".0.0-0"):x(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(a," ").concat(h).trim()}},F=function(t,e,a){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return qn}Aa(Kn);var er,ar,nr=tr(),rr=function(t,e,a){try{e=new nr(e,a)}catch(t){return!1}return e.test(t)},ir={valid:Ja,coerce:en,satisfies:Aa(rr),SEMVER_SPEC_VERSION:Ea.SEMVER_SPEC_VERSION},sr=0,or=1,hr=2,lr=[0,1,2,2,3,0],ur=function(){function t(e,n,r,s){var o;if(i(this,t),h(this,"autoUpdate",!0),h(this,"skeleton",void 0),h(this,"states",void 0),this._app=e,this._position=new a.Vec3,1===Kt.length){var l,u=k((o=new Kt(n)).pages);try{for(u.s();!(l=u.n()).done;){var c=l.value;c.setTexture(new wa(s[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else o=new Kt(n,(function(t){return new wa(s[t])}));var f=new ca(new he(o));f.scale*=.01;var d=f.readSkeletonData(r);this.skeletonVersion=ir.valid(ir.coerce(d.version)),this._spine_3_6_0=ir.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=ir.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=ir.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=ir.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Se(d),this.skeleton.updateWorldTransform(),this.stateData=new zt(this.skeleton.data),this.states=[new Xt(this.stateData)],this.clipper=new ua,this._node=new a.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new a.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new a.Vec2,this._aabbTempSize=new a.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[a.LAYERID_UI],this.init(),this._hidden=!1}return o(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new a.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new a.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,n,t),t=c.material,e=s,n=0),t=c.material;var f=c.positions,d=c.vertexColor.r,v=c.vertexColor.g,m=c.vertexColor.b,p=c.vertexColor.a,g=c.uvs,y=void 0,k=f.length/2;for(y=0;y0){var r=new a.Mesh(this._app.graphicsDevice);r.vertexBuffer=this._vertexBuffer,r.indexBuffer[0]=this._indexBuffer,r.primitive[0].type=a.PRIMITIVE_TRIANGLES,r.primitive[0].base=t,r.primitive[0].count=e,r.primitive[0].indexed=!0,r.aabb=this._aabb,this._meshes.push(r);var i=new a.MeshInstance(r,this._materials[n],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var a=this.states.length;for(e=0;e=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var h=a.call(s,"catchLoc"),l=a.call(s,"finallyLoc");if(h&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;M(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:Y(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function k(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var b=function(){function t(){i(this,t),this.array=new Array}return o(t,[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),t}(),x=function(){function t(){i(this,t),this.entries={},this.size=0}return o(t,[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,n=0,r=t.length;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;i(this,t),this.r=e,this.g=n,this.b=r,this.a=a}return o(t,[{key:"set",value:function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value:function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value:function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}]),t}();E.WHITE=new E(1,1,1,1),E.RED=new E(1,0,0,1),E.GREEN=new E(0,1,0,1),E.BLUE=new E(0,0,1,1),E.MAGENTA=new E(1,0,1,1);var I=function(){function t(){i(this,t)}return o(t,null,[{key:"clamp",value:function(t,e,n){return tn?n:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))}},{key:"randomTriangularWith",value:function(t,e,n){var r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(e-n))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}]),t}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var A=function(){function t(){i(this,t)}return o(t,[{key:"apply",value:function(t,e,n){return t+(e-t)*this.applyInternal(n)}}]),t}(),S=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this)).power=2,r.power=t,r}return o(n,[{key:"applyInternal",value:function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}]),n}(A),T=function(t){l(n,t);var e=d(n);function n(t){return i(this,n),e.call(this,t)}return o(n,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}]),n}(S),R=function(){function t(){i(this,t)}return o(t,null,[{key:"arrayCopy",value:function(t,e,n,r,a){for(var i=e,s=r;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length;if(r==e)return t;if(t.length=e,r2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=n?e:t.setArraySize(e,n,r)}},{key:"newArray",value:function(t,e){for(var n=new Array(t),r=0;r0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.x=e,this.y=n}return o(t,[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),t}(),Y=function(){function t(){i(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return o(t,[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}]),t}(),L=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;i(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}return o(t,[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var u=0,c=0,f=0;f0&&(h=o);for(var N=t.bone,P=N.worldX,_=N.worldY,O=N.a,B=N.b,D=N.c,V=N.d,U=e,q=a;q=this.regions.length&&(n=this.regions.length-1);var r=this.regions[n];e.region!=r&&(e.region=r,e.updateRegion())}},{key:"getPath",value:function(t,e){for(var n=t,r=(this.start+e).toString(),a=this.digits-r.length;a>0;a--)n+="0";return n+=r}}],[{key:"nextID",value:function(){return t._nextID++}}]),t}();_._nextID=0,function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(P||(P={}));var O,B,D=[P.hold,P.once,P.loop,P.pingpong,P.onceReverse,P.loopReverse,P.pingpongReverse],V=function(){function t(e,n,r){if(i(this,t),this.timelines=[],this.timelineIds=new x,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(n),this.duration=r}return o(t,[{key:"setTimelines",value:function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;le)return r-1;return n-1}},{key:"search",value:function(t,e,n){for(var r=t.length,a=n;ae)return a-n;return r-n}}]),t}(),lt=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,a)).curves=R.newFloatArray(t+18*r),s.curves[t-1]=1,s}return o(n,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=R.newFloatArray(e);R.arrayCopy(this.curves,0,n,0,e),this.curves=n}}},{key:"setBezier",value:function(t,e,n,r,a,i,s,o,h,l,u){var c=this.curves,f=this.getFrameCount()+18*t;0==n&&(c[e]=2+f);for(var d=.03*(r-2*i+o),v=.03*(a-2*s+h),m=.006*(3*(i-o)-r+l),p=.006*(3*(s-h)-a+u),g=2*d+m,y=2*v+p,w=.3*(i-r)+d+.16666667*m,k=.3*(s-a)+v+.16666667*p,b=r+w,x=a+k,E=f+18;ft){var i=this.frames[e],s=this.frames[e+n];return s+(t-i)/(a[r]-i)*(a[r+1]-s)}var o=r+18;for(r+=2;r=t){var h=a[r-2],l=a[r-1];return l+(t-h)/(a[r]-h)*(a[r+1]-l)}e+=this.getFrameEntries();var u=a[o-2],c=a[o-1];return c+(t-u)/(this.frames[e]-u)*(this.frames[e+n]-c)}}]),n}(ht),ut=function(t){l(n,t);var e=d(n);function n(t,r,a){return i(this,n),e.call(this,t,r,[a])}return o(n,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n}},{key:"getCurveValue",value:function(t){for(var e=this.frames,n=e.length-2,r=2;r<=n;r+=2)if(e[r]>t){n=r-2;break}var a=this.curves[n>>1];switch(a){case 0:var i=e[n],s=e[n+1];return s+(t-i)/(e[n+2]-i)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,a-2)}}]),n}(lt),ct=function(t){l(n,t);var e=d(n);function n(t,r,a,s){return i(this,n),e.call(this,t,r,[a,s])}return o(n,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,n,r){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r}}]),n}(lt),ft=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,r,U+"|"+a)).boneIndex=0,s.boneIndex=a,s}return o(n,[{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.bones[this.boneIndex];if(o.active)if(n>2];switch(m){case 0:var p=h[v];c=h[v+1],f=h[v+2],d=h[v+3];var g=(n-p)/(h[v+4]-p);c+=(h[v+4+1]-c)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:c=h[v+1],f=h[v+2],d=h[v+3];break;default:c=this.getBezierValue(n,v,1,m-2),f=this.getBezierValue(n,v,2,m+18-2),d=this.getBezierValue(n,v,3,m+36-2)}if(1==a)l.r=c,l.g=f,l.b=d;else{if(i==O.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(c-l.r)*a,l.g+=(f-l.g)*a,l.b+=(d-l.b)*a}}}}}]),n}(lt),It=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,r,J+"|"+a)).slotIndex=0,s.slotIndex=a,s}return o(n,[{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(n>3];switch(b){case 0:var x=h[k];d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];var E=(n-x)/(h[k+8]-x);d+=(h[k+8+1]-d)*E,v+=(h[k+8+2]-v)*E,m+=(h[k+8+3]-m)*E,p+=(h[k+8+4]-p)*E,g+=(h[k+8+5]-g)*E,y+=(h[k+8+6]-y)*E,w+=(h[k+8+7]-w)*E;break;case 1:d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];break;default:d=this.getBezierValue(n,k,1,b-2),v=this.getBezierValue(n,k,2,b+18-2),m=this.getBezierValue(n,k,3,b+36-2),p=this.getBezierValue(n,k,4,b+54-2),g=this.getBezierValue(n,k,5,b+72-2),y=this.getBezierValue(n,k,6,b+90-2),w=this.getBezierValue(n,k,7,b+108-2)}if(1==a)l.set(d,v,m,p),u.r=g,u.g=y,u.b=w;else{if(i==O.setup){l.setFromColor(o.data.color);var I=o.data.darkColor;u.r=I.r,u.g=I.g,u.b=I.b}l.add((d-l.r)*a,(v-l.g)*a,(m-l.b)*a,(p-l.a)*a),u.r+=(g-u.r)*a,u.g+=(y-u.g)*a,u.b+=(w-u.b)*a}}}}}]),n}(lt),St=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,r,[$+"|"+a,K+"|"+a])).slotIndex=0,s.slotIndex=a,s}return o(n,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,n,r,a,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=a,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,u=o.darkColor;if(nt){var i=this.frames[e];return n[r+1]*(t-i)/(n[r]-i)}var s=r+18;for(r+=2;r=t){var o=n[r-2],h=n[r-1];return h+(t-o)/(n[r]-o)*(n[r+1]-h)}var l=n[s-2],u=n[s-1];return u+(1-u)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h&&h instanceof N&&h.timelineAttachment==this.attachment){var l=o.deform;0==l.length&&(i=O.setup);var u=this.vertices,c=u[0].length,f=this.frames;if(n=f[f.length-1]){var p=u[f.length-1];if(1==a)if(i==O.add){var g=h;if(g.bones)for(var y=0;yn)this.apply(t,e,Number.MAX_VALUE,r,a,i,s),e=-1;else if(e>=o[h-1])return;if(!(n0&&o[l-1]==u;)l--;for(;l=o[l];l++)r.push(this.events[l])}}}}]),n}(ht);Ct.propertyIds=[""+tt];var Mt=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,n.propertyIds)).drawOrders=new Array(t),r}return o(n,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}},{key:"apply",value:function(t,e,n,r,a,i,s){if(s!=B.mixOut)if(n>2];switch(d){case 0:var v=h[f];l=h[f+1],u=h[f+2],c=h[f+3];var m=(n-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,u+=(h[f+4+2]-u)*m,c+=(h[f+4+3]-c)*m;break;case 1:l=h[f+1],u=h[f+2],c=h[f+3];break;default:l=this.getBezierValue(n,f,1,d-2),u=this.getBezierValue(n,f,2,d+18-2),c=this.getBezierValue(n,f,3,d+36-2)}if(i==O.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*a,o.mixX=p.mixX+(u-p.mixX)*a,o.mixY=p.mixY+(c-p.mixY)*a}else o.mixRotate+=(l-o.mixRotate)*a,o.mixX+=(u-o.mixX)*a,o.mixY+=(c-o.mixY)*a}}}}]),n}(lt),Pt=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,[ot+"|"+r+"|"+a.sequence.id])).slotIndex=r,s.attachment=a,s}return o(n,[{key:"getFrameEntries",value:function(){return n.ENTRIES}},{key:"getSlotIndex",value:function(){return this.slotIndex}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setFrame",value:function(t,e,r,a,i){var s=this.frames;s[t*=n.ENTRIES]=e,s[t+n.MODE]=r|a<<4,s[t+n.DELAY]=i}},{key:"apply",value:function(t,e,r,a,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.attachment,u=this.attachment;if(l==u||l instanceof N&&l.timelineAttachment==u){var c=this.frames;if(r>4,g=this.attachment.sequence.regions.length,y=D[15&v];if(y!=P.hold)switch(p+=(r-d)/m+1e-5|0,y){case P.once:p=Math.min(g-1,p);break;case P.loop:p%=g;break;case P.pingpong:var w=(g<<1)-2;(p=0==w?0:p%w)>=g&&(p=w-p);break;case P.onceReverse:p=Math.max(g-1-p,0);break;case P.loopReverse:p=g-1-p%g;break;case P.pingpongReverse:var k=(g<<1)-2;(p=0==k?0:(p+g-1)%k)>=g&&(p=k-p)}h.sequenceIndex=p}}}}}}]),n}(ht);Pt.ENTRIES=3,Pt.MODE=1,Pt.DELAY=2;var _t=function(){function t(e){i(this,t),this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Dt(this),this.propertyIDs=new x,this.animationsChanged=!1,this.trackEntryPool=new M((function(){return new Bt})),this.data=e}return o(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var s=a.next;if(s){var o=a.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==a.timeScale?0:(o/a.timeScale+t)*s.timeScale,a.trackTime+=i,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&!a.mixingFrom){e[n]=null,this.queue.end(a),this.clearNext(a);continue}if(a.mixingFrom&&this.updateMixingFrom(a,t)){var h=a.mixingFrom;for(a.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}a.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var n=t.mixingFrom;if(!n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,r=!1,a=0,i=n.length;a0)){r=!0;var o=0==a?O.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),c=u,f=e;s.reverse&&(c=s.animation.duration-c,f=null);var d=s.animation.timelines,v=d.length;if(0==a&&1==h||o==O.add)for(var m=0;m1&&(a=1),n!=O.first&&(n=r.mixBlend));var i=a0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,a}},{key:"applyAttachmentTimeline",value:function(t,e,n,r,a){var i=e.slots[t.slotIndex];i.bone.active&&(n0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),c=f+d-d%360,p!=m&&(c+=360*I.signum(d)),i[s]=c}i[s+1]=f,h.rotation=l+c*r}}else t.apply(e,0,n,null,1,a,B.mixIn)}},{key:"queueEvents",value:function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,s=this.events,o=0,h=s.length;or||this.queue.event(t,l)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var r=n.mixingFrom;if(!r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)}},{key:"setAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.clearNext(a),a=a.mixingFrom,r=!1):this.clearNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)}},{key:"addAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(a)for(;a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);return a?(a.next=i,i.previous=a,r<=0&&(r+=a.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=r,i}},{key:"setEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.setAnimationWith(e,t.emptyAnimation(),!1);return r.mixDuration=n,r.trackEnd=n,r}},{key:"addEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=this.addAnimationWith(e,t.emptyAnimation(),!1,r);return r<=0&&(a.delay+=a.mixDuration-n),a.mixDuration=n,a.trackEnd=n,a}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n0){a[h]=Ht,i[h]=c;continue t}break}a[h]=zt}else a[h]=Wt}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return t._emptyAnimation}}]),t}();_t._emptyAnimation=new V("",[],0);var Ot,Bt=function(){function t(){i(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=O.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return o(t,[{key:"reset",value:function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}},{key:"getAnimationTime",value:function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&u&&u.length>0&&(c.names=l,c.values=u,l=null,u=null),c.u=c.x/h.width,c.v=c.y/h.height,90==c.degrees?(c.u2=(c.x+c.height)/h.width,c.v2=(c.y+c.width)/h.height):(c.u2=(c.x+c.width)/h.width,c.v2=(c.y+c.height)/h.height),this.regions.push(c)}else{for(h=new ie(o.trim());0!=n.readEntry(r,o=n.readLine());){var p=a[r[0]];p&&p(h)}this.pages.push(h)}}return o(t,[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",r=w(this.pages);try{for(r.s();!(e=r.n()).done;){var a=e.value;a.setTexture(t.get(n+a.name))}}catch(t){r.e(t)}finally{r.f()}}},{key:"dispose",value:function(){for(var t,e=0;e=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var r=1,a=n+1;;r++){var i=e.indexOf(",",a);if(-1==i)return t[r]=e.substr(a).trim(),r;if(t[r]=e.substr(a,i-a).trim(),a=i+1,4==r)return 4}}}]),t}(),ie=function(){function t(e){i(this,t),this.minFilter=Vt.Nearest,this.magFilter=Vt.Nearest,this.uWrap=Ut.ClampToEdge,this.vWrap=Ut.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}return o(t,[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);var e,n=w(this.regions);try{for(n.s();!(e=n.n()).done;){e.value.texture=t}}catch(t){n.e(t)}finally{n.f()}}}]),t}(),se=function(t){l(n,t);var e=d(n);function n(t,r){var a;return i(this,n),(a=e.call(this)).x=0,a.y=0,a.offsetX=0,a.offsetY=0,a.originalWidth=0,a.originalHeight=0,a.index=0,a.degrees=0,a.names=null,a.values=null,a.page=t,a.name=r,t.regions.push(f(a)),a}return o(n)}(ee),oe=function(t){l(n,t);var e=d(n);function n(t,r){var a;return i(this,n),(a=e.call(this,t)).region=null,a.regionUVs=[],a.uvs=[],a.triangles=[],a.color=new E(1,1,1,1),a.width=0,a.height=0,a.hullLength=0,a.edges=[],a.parentMesh=null,a.sequence=null,a.tempColor=new E(0,0,0,0),a.path=r,a}return o(n,[{key:"updateRegion",value:function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,r=this.region.u,a=this.region.v,i=0,s=0;if(this.region instanceof se){var o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:r-=(o.originalHeight-o.offsetY-o.height)/l,a-=(o.originalWidth-o.offsetX-o.width)/u,i=o.originalHeight/l,s=o.originalWidth/u;for(var c=0;c= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=r}));!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(ce||(ce={}));var ve,me,pe,ge=function(){function t(e,n,r){if(i(this,t),this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=r,this.setToSetupPose()}return o(t,[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,n,r,a,i,s){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=r,this.ascaleY=a,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=n+90+s,u=h.scaleX,c=h.scaleY;return this.a=I.cosDeg(n+i)*r*u,this.b=I.cosDeg(l)*a*u,this.c=I.sinDeg(n+i)*r*c,this.d=I.sinDeg(l)*a*c,this.worldX=t*u+h.x,void(this.worldY=e*c+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case ce.Normal:var p=n+90+s,g=I.cosDeg(n+i)*r,y=I.cosDeg(p)*a,w=I.sinDeg(n+i)*r,k=I.sinDeg(p)*a;return this.a=f*g+d*w,this.b=f*y+d*k,this.c=v*g+m*w,void(this.d=v*y+m*k);case ce.OnlyTranslation:var b=n+90+s;this.a=I.cosDeg(n+i)*r,this.b=I.cosDeg(b)*a,this.c=I.sinDeg(n+i)*r,this.d=I.sinDeg(b)*a;break;case ce.NoRotationOrReflection:var x=f*f+v*v,E=0;x>1e-4?(x=Math.abs(f*m-d*v)/x,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*x,m=f*x,E=Math.atan2(v,f)*I.radDeg):(f=0,v=0,E=90-Math.atan2(m,d)*I.radDeg);var A=n+i-E,S=n+s-E+90,T=I.cosDeg(A)*r,R=I.cosDeg(S)*a,C=I.sinDeg(A)*r,M=I.sinDeg(S)*a;this.a=f*T-d*C,this.b=f*R-d*M,this.c=v*T+m*C,this.d=v*R+m*M;break;case ce.NoScale:case ce.NoScaleOrReflection:var F=I.cosDeg(n),Y=I.sinDeg(n),L=(f*F+d*Y)/this.skeleton.scaleX,X=(v*F+m*Y)/this.skeleton.scaleY,N=Math.sqrt(L*L+X*X);N>1e-5&&(N=1/N),L*=N,X*=N,N=Math.sqrt(L*L+X*X),this.data.transformMode==ce.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(N=-N);var P=Math.PI/2+Math.atan2(X,L),_=Math.cos(P)*N,O=Math.sin(P)*N,B=I.cosDeg(i)*r,D=I.cosDeg(90+s)*a,V=I.sinDeg(i)*r,U=I.sinDeg(90+s)*a;this.a=L*B+_*V,this.b=L*D+_*U,this.c=X*B+O*V,this.d=X*D+O*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*I.radDeg);var e=t.a,n=t.b,r=t.c,a=t.d,i=1/(e*a-n*r),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*a*i-o*n*i,this.ay=o*e*i-s*r*i;var h=i*a,l=i*e,u=i*n,c=i*r,f=h*this.a-u*this.c,d=h*this.b-u*this.d,v=l*this.c-c*this.a,m=l*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,r=t.y-this.worldY;return t.x=n*this.d*e-r*this.b*e,t.y=r*this.a*e-n*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,n=this.b,r=this.c,a=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*r,this.b=i*n-s*a,this.c=s*e+i*r,this.d=s*n+i*a}}]),t}(),ye=o((function t(e,n,r){i(this,t),this.name=e,this.order=n,this.skinRequired=r})),we=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ke;i(this,t),this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=n,this.downloader=r}return o(t,[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)}},{key:"error",value:function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,n){requestAnimationFrame((function r(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(r)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadBinary(t,(function(r){e.success(n,t,r)}),(function(n,a){e.error(r,t,"Couldn't load binary ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"loadText",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadText(t,(function(r){e.success(n,t,r)}),(function(n,a){e.error(r,t,"Couldn't load text ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"loadJson",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadJson(t,(function(r){e.success(n,t,r)}),(function(n,a){e.error(r,t,"Couldn't load JSON ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"loadTexture",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((function(n){return n.ok?n.blob():(e.error(r,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(r){r&&e.success(n,t,e.textureLoader(r))}));else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(){e.success(n,t,e.textureLoader(a))},a.onerror=function(){e.error(r,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),a.src=t}}},{key:"loadTextureAtlas",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=arguments.length>3?arguments[3]:void 0,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new re(i),l=h.pages.length,u=!1,c=w(h.pages);try{var f=function(){var i=o.value;e.loadTexture(a?a[i.name]:s+i.name,(function(r,a){u||(i.setTexture(a),0==--l&&e.success(n,t,h))}),(function(n,a){u||e.error(r,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(n)),u=!0}))};for(c.s();!(o=c.n()).done;)f()}catch(t){c.e(t)}finally{c.f()}}catch(n){e.error(r,t,"Couldn't parse texture atlas ".concat(t,": ").concat(n.message))}}),(function(n,a){e.error(r,t,"Couldn't load texture atlas ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),t}(),ke=function(){function t(){i(this,t),this.callbacks={},this.rawDataUris={}}return o(t,[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),n=e.length,r=new Uint8Array(n),a=0;a180?f-=360:f<-180&&(f+=360);var b=t.ascaleX,x=t.ascaleY;if(r||a){switch(t.data.transformMode){case ce.NoScale:case ce.NoScaleOrReflection:d=e-t.worldX,v=n-t.worldY}var E=t.data.length*b,A=Math.sqrt(d*d+v*v);if(r&&AE&&E>1e-4){var S=(A/E-1)*s+1;b*=S,i&&(x*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,b,x,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,n,r,a,i,s,o,h){var l=t.ax,u=t.ay,c=t.ascaleX,f=t.ascaleY,d=c,v=f,m=e.ascaleX,p=0,g=0,y=0;c<0?(c=-c,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var w=e.ax,k=0,b=0,x=0,E=t.a,A=t.b,S=t.c,T=t.d,R=Math.abs(c-f)<=1e-4;!R||i?(k=0,b=E*w+t.worldX,x=S*w+t.worldY):(b=E*w+A*(k=e.ay)+t.worldX,x=S*w+T*k+t.worldY);var C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");E=C.a,A=C.b,S=C.c;var M,F,Y=E*(T=C.d)-A*S,L=b-C.worldX,X=x-C.worldY,N=(L*T-X*A)*(Y=Math.abs(Y)<=1e-4?0:1/Y)-l,P=(X*E-L*S)*Y-u,_=Math.sqrt(N*N+P*P),O=e.data.length*m;if(_<1e-4)return this.apply1(t,n,r,!1,i,!1,h),void e.updateWorldTransformWith(w,k,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var B=((L=n-C.worldX)*T-(X=r-C.worldY)*A)*Y-l,D=(X*E-L*S)*Y-u,V=B*B+D*D;if(0!=o){o*=c*(m+1)*.5;var U=Math.sqrt(V),q=U-_-O*c+o;if(q>0){var W=Math.min(1,q/(2*o))-1;V=(B-=(W=(q-o*(1-W*W))/U)*B)*B+(D-=W*D)*D}}t:if(R){var j=(V-_*_-(O*=c)*O)/(2*_*O);j<-1?(j=-1,F=Math.PI*a):j>1?(j=1,F=0,i&&(d*=E=(Math.sqrt(V)/(_+O)-1)*h+1,s&&(v*=E))):F=Math.acos(j)*a,E=_+O*j,A=O*Math.sin(F),M=Math.atan2(D*E-B*A,B*E+D*A)}else{var G=(E=c*O)*E,z=(A=f*O)*A,H=Math.atan2(D,B),$=-2*z*_,J=z-G;if((T=$*$-4*J*(S=z*_*_+G*V-G*z))>=0){var K=Math.sqrt(T);$<0&&(K=-K);var Q=(K=.5*-($+K))/J,Z=S/K,tt=Math.abs(Q)=-1&&S<=1&&(S=Math.acos(S),(T=(L=E*Math.cos(S)+_)*L+(X=A*Math.sin(S))*X)ot&&(it=S,ot=T,st=L,ht=X)),V<=.5*(rt+ot)?(M=H-Math.atan2(at*a,nt),F=et*a):(M=H-Math.atan2(ht*a,st),F=it*a)}var lt=Math.atan2(k,w)*y,ut=t.arotation;(M=(M-lt)*I.radDeg+p-ut)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,u,ut+M*h,d,v,0,0),ut=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ut)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,k,ut+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]),t}(),Ie=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,0,!1)).bones=new Array,r._target=null,r.bendDirection=1,r.compress=!1,r.stretch=!1,r.uniform=!1,r.mix=1,r.softness=0,r}return o(n,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}]),n}(ye),Ae=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,0,!1)).bones=new Array,r._target=null,r.positionMode=ve.Fixed,r.spacingMode=me.Fixed,r.rotateMode=pe.Chain,r.offsetRotation=0,r.position=0,r.spacing=0,r.mixRotate=0,r.mixX=0,r.mixY=0,r}return o(n,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t}}]),n}(ye);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(ve||(ve={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(me||(me={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(pe||(pe={}));var Se=function(){function t(e,n){if(i(this,t),this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var r=0,a=e.bones.length;r0){k=u/k*d;for(var M=1;M0?I.degRad:-I.degRad}for(var j=0,G=3;j0){var tt=z.a,et=z.b,nt=z.c,rt=z.d,at=0,it=0,st=0;if(at=s?B[G-1]:0==c[j+1]?B[G+2]:Math.atan2(K,J),at-=Math.atan2(nt,tt),q){it=Math.cos(at),st=Math.sin(at);var ot=z.data.length;D+=(ot*(it*tt-st*nt)-J)*n,V+=(ot*(st*tt+it*nt)-K)*n}else at+=U;at>I.PI?at-=I.PI2:at<-I.PI&&(at+=I.PI2),at*=n,it=Math.cos(at),st=Math.sin(at),z.a=it*tt-st*nt,z.b=it*et-st*rt,z.c=st*tt+it*nt,z.d=st*et+it*rt}z.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,n,r){var a=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*n+2),h=this.world,l=e.closed,u=e.worldVerticesLength,c=u/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[c-=l?1:2];switch(this.data.positionMode==ve.Percent&&(i*=m),this.data.spacingMode){case me.Percent:d=m;break;case me.Proportional:d=m/n;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(a,u-6,4,h,0,2)),this.addAfterPosition(k-m,h,0,o,g);continue}}for(;;y++){var b=v[y];if(!(k>b)){if(0==y)k/=b;else{var x=v[y-1];k=(k-x)/(b-x)}break}}y!=f&&(f=y,l&&y==c?(e.computeWorldVertices(a,u-4,4,h,0,2),e.computeWorldVertices(a,0,4,h,4,2)):e.computeWorldVertices(a,6*y+2,8,h,0,2)),this.addCurvePosition(k,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,r||p>0&&0==w)}return o}l?(u+=2,h=R.setArraySize(this.world,u),e.computeWorldVertices(a,2,u-4,h,0,2),e.computeWorldVertices(a,0,2,h,u-4,2),h[u-2]=h[0],h[u-1]=h[1]):(c--,u-=4,h=R.setArraySize(this.world,u),e.computeWorldVertices(a,2,u,h,0,2));for(var E,I=R.setArraySize(this.curves,c),A=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,L=0,X=0,N=0,P=0,_=0,O=0,B=0,D=0,V=0,U=0,q=0,W=2;qA){this.addAfterPosition(Q-A,h,u-4,o,H);continue}}for(;;$++){var Z=I[$];if(!(Q>Z)){if(0==$)Q/=Z;else{var tt=I[$-1];Q=(Q-tt)/(Z-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],B=2*(N=.03*(S-2*C+F))+(_=.006*(3*(C-F)-S+(L=h[et+6]))),D=2*(P=.03*(T-2*M+Y))+(O=.006*(3*(M-Y)-T+(X=h[et+7]))),V=.3*(C-S)+N+.16666667*_,U=.3*(M-T)+P+.16666667*O,G=Math.sqrt(V*V+U*U),j[0]=G,et=1;et<8;et++)V+=B,U+=D,B+=_,D+=O,G+=Math.sqrt(V*V+U*U),j[et]=G;V+=B,U+=D,G+=Math.sqrt(V*V+U*U),j[8]=G,V+=B+_,U+=D+O,G+=Math.sqrt(V*V+U*U),j[9]=G,J=0}for(Q*=G;;J++){var nt=j[J];if(!(Q>nt)){if(0==J)Q/=nt;else{var rt=j[J-1];Q=J+(Q-rt)/(nt-rt)}break}}this.addCurvePosition(.1*Q,S,T,C,M,F,Y,L,X,o,H,r||z>0&&0==K)}return o}},{key:"addBeforePosition",value:function(t,e,n,r,a){var i=e[n],s=e[n+1],o=e[n+2]-i,h=e[n+3]-s,l=Math.atan2(h,o);r[a]=i+t*Math.cos(l),r[a+1]=s+t*Math.sin(l),r[a+2]=l}},{key:"addAfterPosition",value:function(t,e,n,r,a){var i=e[n+2],s=e[n+3],o=i-e[n],h=s-e[n+1],l=Math.atan2(h,o);r[a]=i+t*Math.cos(l),r[a+1]=s+t*Math.sin(l),r[a+2]=l}},{key:"addCurvePosition",value:function(t,e,n,r,a,i,s,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(a-n,r-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,w=v*y,k=y*t,b=e*p+r*w+i*k+o*d,x=n*p+a*w+s*k+h*d;l[u]=b,l[u+1]=x,c&&(l[u+2]=t<.001?Math.atan2(a-n,r-e):Math.atan2(x-(n*m+a*g*2+s*f),b-(e*m+r*g*2+i*f)))}}]),t}();Se.NONE=-1,Se.BEFORE=-2,Se.AFTER=-3,Se.epsilon=1e-5;var Te=function(){function t(e,n){if(i(this,t),this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new E,this.darkColor=e.darkColor?new E:null,this.setToSetupPose()}return o(t,[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof N&&this.attachment instanceof N&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),t}(),Re=function(){function t(e,n){if(i(this,t),this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new F,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var r=0;r0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(T.x-y.worldX)*e,y.worldY+=(T.y-y.worldY)*n}if(0!=r){var R=Math.sqrt(y.a*y.a+y.c*y.c);0!=R&&(R=(R+(Math.sqrt(h*h+u*u)-R+this.data.offsetScaleX)*r)/R),y.a*=R,y.c*=R}if(0!=a){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+c*c)-C+this.data.offsetScaleY)*a)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),L=Math.atan2(c,l)-Math.atan2(u,h)-(Y-Math.atan2(y.c,y.a));L>I.PI?L-=I.PI2:L<-I.PI&&(L+=I.PI2),L=Y+(L+v)*i;var X=Math.sqrt(M*M+F*F);y.b=Math.cos(L)*X,y.d=Math.sin(L)*X}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,a=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,u=o.c,c=o.d,f=h*c-l*u>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=T.x*e,y.worldY+=T.y*n}if(0!=r){var R=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*r+1;y.a*=R,y.c*=R}if(0!=a){var C=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleY)*a+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(c,l)-Math.atan2(u,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var L=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*L,y.d=Math.sin(M)*L}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,a=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var r=this.drawOrder,a=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=r.length;h0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;i(this,t),this.slotIndex=e,this.name=n,this.attachment=r})),Le=function(){function t(e){if(i(this,t),this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}return o(t,[{key:"setAttachment",value:function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!n)throw new Error("name cannot be null.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Me||(Me={}));var Ne,Pe=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,0,!1)).bones=new Array,r._target=null,r.mixRotate=0,r.mixX=0,r.mixY=0,r.mixScaleX=0,r.mixScaleY=0,r.mixShearY=0,r.offsetRotation=0,r.offsetX=0,r.offsetY=0,r.offsetScaleX=0,r.offsetScaleY=0,r.offsetShearY=0,r.relative=!1,r.local=!1,r}return o(n,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}]),n}(ye),_e=function(){function t(e){i(this,t),this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}return o(t,[{key:"readSkeletonData",value:function(t){var e=this.scale,n=new Fe;n.name="";var r=new Oe(t),a=r.readInt32(),i=r.readInt32();n.hash=0==i&&0==a?null:i.toString(16)+a.toString(16),n.version=r.readString(),n.x=r.readFloat(),n.y=r.readFloat(),n.width=r.readFloat(),n.height=r.readFloat();var s=r.readBoolean();s&&(n.fps=r.readFloat(),n.imagesPath=r.readString(),n.audioPath=r.readString());var o=0;o=r.readInt(!0);for(var h=0;h>4,t.readFloat())}r.push(br)}}var Ar=t.readInt(!0);if(Ar>0){for(var Sr=new Mt(Ar),Tr=n.slots.length,Rr=0;Rr=0;Yr--)Fr[Yr]=-1;for(var Lr=R.newArray(Tr-Mr,0),Xr=0,Nr=0,Pr=0;Pr=0;Or--)-1==Fr[Or]&&(Fr[Or]=Lr[--Nr]);Sr.setFrame(Rr,Cr,Fr)}r.push(Sr)}var Br=t.readInt(!0);if(Br>0){for(var Dr=new Ct(Br),Vr=0;Vr1&&void 0!==arguments[1]?arguments[1]:new Array,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);i(this,t),this.strings=n,this.index=r,this.buffer=a}return o(t,[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),n++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),t}(),Be=o((function t(e,n,r,a,s){i(this,t),this.mesh=e,this.skin=n,this.slotIndex=r,this.parent=a,this.inheritTimeline=s})),De=o((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i(this,t),this.bones=e,this.vertices=n}));function Ve(t,e,n){for(var r=t.readFloat(),a=t.readFloat()*n,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,r,a),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(i);break;case vn:qe(t,e,s++,i,0,r,h,a,l,n)}r=h,a=l}return e}function Ue(t,e,n){for(var r=t.readFloat(),a=t.readFloat()*n,i=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,r,a,i),s!=h;s++){var l=t.readFloat(),u=t.readFloat()*n,c=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(s);break;case vn:qe(t,e,o++,s,0,r,l,a,u,n),qe(t,e,o++,s,1,r,l,i,c,n)}r=l,a=u,i=c}return e}function qe(t,e,n,r,a,i,s,o,h,l){e.setBezier(n,r,a,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Ne||(Ne={}));var We,je=0,Ge=1,ze=2,He=3,$e=4,Je=5,Ke=6,Qe=7,Ze=8,tn=9,en=0,nn=1,rn=2,an=3,sn=4,on=5,hn=0,ln=1,un=0,cn=1,fn=2,dn=1,vn=2,mn=function(){function t(){i(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new M((function(){return R.newFloatArray(16)}))}return o(t,[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,a=this.polygonPool,i=t.slots,s=i.length;n.length=0,a.freeAll(r),r.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,n,r){var a=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=s&&n>=s||e>=o&&r>=o)return!1;var h=(r-e)/(n-t),l=h*(a-t)+e;if(l>i&&li&&la&&ua&&ut.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||l=n){var u=r[o];u+(n-h)/(l-h)*(r[i]-u)=u&&w<=d||w>=d&&w<=u)&&(w>=e&&w<=r||w>=r&&w<=e)){var k=(l*g-h*m)/y;if((k>=c&&k<=v||k>=v&&k<=c)&&(k>=n&&k<=a||k>=a&&k<=n))return!0}u=d,c=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),t}(),pn=function(){function t(){i(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new M((function(){return new Array})),this.polygonIndicesPool=new M((function(){return new Array}))}return o(t,[{key:"triangulate",value:function(e){var n=e,r=e.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i3;){for(var u=r-1,c=0,f=1;;){t:if(!s[c]){for(var d=a[u]<<1,v=a[c]<<1,m=a[f]<<1,p=n[d],g=n[d+1],y=n[v],w=n[v+1],k=n[m],b=n[m+1],x=(f+1)%r;x!=u;x=(x+1)%r)if(s[x]){var E=a[x]<<1,I=n[E],A=n[E+1];if(t.positiveArea(k,b,p,g,I,A)&&t.positiveArea(p,g,y,w,I,A)&&t.positiveArea(y,w,k,b,I,A))break t}break}if(0==f){do{if(!s[c])break;c--}while(c>0);break}u=c,c=f,f=(f+1)%r}l.push(a[(r+c-1)%r]),l.push(a[c]),l.push(a[(c+1)%r]),a.splice(c,1),s.splice(c,1);var S=(--r+c-1)%r,T=c==r?0:c;s[S]=t.isConcave(S,r,n,a),s[T]=t.isConcave(T,r,n,a)}return 3==r&&(l.push(a[2]),l.push(a[0]),l.push(a[1])),l}},{key:"decompose",value:function(e,n){var r=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(a.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(w),o.push(k),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,w,k),h=f)}o.length>0&&(a.push(o),i.push(s));for(var A=0,S=a.length;A=0;$--)0==(o=a[$]).length&&(a.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return a}}],[{key:"isConcave",value:function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,s=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[s],n[s+1])}},{key:"positiveArea",value:function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0}},{key:"winding",value:function(t,e,n,r,a,i){var s=n-t,o=r-e;return a*o-i*s+s*e-t*o>=0?1:-1}}]),t}(),gn=function(){function t(){i(this,t),this.triangulator=new pn,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}return o(t,[{key:"clipStart",value:function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,a=R.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(e,0,r,a,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),q=0;q=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(r),h.push(a),h.push(i),h.push(t),h.push(e),o.length=0;for(var c=s,f=s.length-4,d=0;;d+=2){for(var v=c[d],m=c[d+1],p=c[d+2],g=c[d+3],y=v-p,w=m-g,k=h,b=h.length-2,x=o.length,E=0;E0;if(y*(A-g)-w*(I-p)>0){if(R){o.push(S),o.push(T);continue}var C=T-A,M=S-I,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-A)-C*(v-I))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(R){var L=T-A,X=S-I,N=L*(p-v)-X*(g-m);if(Math.abs(N)>1e-6){var P=(X*(m-A)-L*(v-I))/N;o.push(v+(p-v)*P),o.push(m+(g-m)*P)}else o.push(v),o.push(m);o.push(S),o.push(T)}u=!0}if(x==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var _=o;(o=h).length=0,h=_}if(l!=o){l.length=0;for(var O=0,B=o.length-2;O>1;l=0;lr--)-1==tr[lr]&&(tr[lr]=nr[--ar])}$n.setFrame(Kn,En(Zn,"time",0),tr)}a.push($n)}if(t.events){for(var ur=new Ct(t.events.length),cr=0,fr=0;fr)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ln,Ln.exports);var Xn=Ln.exports;Rn(Xn);var Nn=Object.freeze({loose:!0}),Pn=Object.freeze({}),_n=function(t){return t?"object"!==a(t)?Nn:t:Pn};Rn(_n);var On=/^[0-9]+$/,Bn=function(t,e){var n=On.test(t),r=On.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tUn)throw new TypeError("version is longer than ".concat(Un," characters"));Vn("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?Wn[jn.LOOSE]:Wn[jn.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>qn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qn||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var i=[e,r];!1===n&&(i=[e]),0===zn(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),$n=Hn;Rn($n);var Jn=$n,Kn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof Jn)return t;try{return new Jn(t,e)}catch(t){if(!n)return null;throw t}};Rn(Kn);var Qn,Zn,tr=Kn,er=Rn((function(t,e){var n=tr(t,e);return n?n.version:null})),nr=$n,rr=Kn,ar=Xn.safeRe,ir=Xn.t,sr=Rn((function(t,e){if(t instanceof nr)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=ar[ir.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),ar[ir.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;ar[ir.COERCERTL].lastIndex=-1}else n=t.match(ar[ir.COERCE]);return null===n?null:rr("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}));var or=hr;function hr(t){var e=this;if(e instanceof hr||(e=new hr),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var a=0;null!==r;a++)n=t(n,r.value,a),r=r.next;return n},hr.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==r;a--)n=t(n,r.value,a),r=r.prev;return n},hr.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},hr.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},hr.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new hr;if(ethis.length&&(e=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(e=this.length);for(var r=this.length,a=this.tail;null!==a&&r>e;r--)a=a.prev;for(;null!==a&&r>t;r--,a=a.prev)n.push(a.value);return n},hr.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&nthis[vr])return Cr(this,this[xr].get(t)),!1;var i=this[xr].get(t).value;return this[wr]&&(this[kr]||this[wr](t,i.value)),i.now=r,i.maxAge=n,i.value=e,this[mr]+=a-i.length,i.length=a,this.get(t),Rr(this),!0}var s=new Mr(t,e,a,r,n);return s.length>this[vr]?(this[wr]&&this[wr](t,e),!1):(this[mr]+=s.length,this[br].unshift(s),this[xr].set(t,this[br].head),Rr(this),!0)}},{key:"has",value:function(t){if(!this[xr].has(t))return!1;var e=this[xr].get(t).value;return!Tr(this,e)}},{key:"get",value:function(t){return Sr(this,t,!0)}},{key:"peek",value:function(t){return Sr(this,t,!1)}},{key:"pop",value:function(){var t=this[br].tail;return t?(Cr(this,t),t.value):null}},{key:"del",value:function(t){Cr(this,this[xr].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],a=r.e||0;if(0===a)this.set(r.k,r.v);else{var i=a-e;i>0&&this.set(r.k,r.v,i)}}}},{key:"prune",value:function(){var t=this;this[xr].forEach((function(e,n){return Sr(t,n,!1)}))}}]),t}(),Sr=function(t,e,n){var r=t[xr].get(e);if(r){var a=r.value;if(Tr(t,a)){if(Cr(t,r),!t[gr])return}else n&&(t[Er]&&(r.value.now=Date.now()),t[br].unshiftNode(r));return a.value}},Tr=function(t,e){if(!e||!e.maxAge&&!t[yr])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[yr]&&n>t[yr]},Rr=function(t){if(t[mr]>t[vr])for(var e=t[br].tail;t[mr]>t[vr]&&null!==e;){var n=e.prev;Cr(t,e),e=n}},Cr=function(t,e){if(e){var n=e.value;t[wr]&&t[wr](n.key,n.value),t[mr]-=n.length,t[xr].delete(n.key),t[br].removeNode(e)}},Mr=o((function t(e,n,r,a,s){i(this,t),this.key=e,this.value=n,this.length=r,this.now=a,this.maxAge=s||0})),Fr=function(t,e,n,r){var a=n.value;Tr(t,a)&&(Cr(t,n),t[gr]||(a=void 0)),a&&e.call(r,a.value,a.key,t)},Yr=Ar;Rn(Yr);var Lr=$n,Xr=function(t,e,n){return new Lr(t,n).compare(new Lr(e,n))};Rn(Xr);var Nr=Xr,Pr=function(t,e,n){return 0===Nr(t,e,n)};Rn(Pr);var _r=Xr,Or=function(t,e,n){return 0!==_r(t,e,n)};Rn(Or);var Br=Xr,Dr=function(t,e,n){return Br(t,e,n)>0};Rn(Dr);var Vr=Xr,Ur=function(t,e,n){return Vr(t,e,n)>=0};Rn(Ur);var qr=Xr,Wr=function(t,e,n){return qr(t,e,n)<0};Rn(Wr);var jr=Xr,Gr=function(t,e,n){return jr(t,e,n)<=0};Rn(Gr);var zr,Hr,$r,Jr,Kr=Pr,Qr=Or,Zr=Dr,ta=Ur,ea=Wr,na=Gr,ra=function(t,e,n,r){switch(e){case"===":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t===n;case"!==":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Kr(t,n,r);case"!=":return Qr(t,n,r);case">":return Zr(t,n,r);case">=":return ta(t,n,r);case"<":return ea(t,n,r);case"<=":return na(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function aa(){if(Jr)return $r;Jr=1;var t=function(){function t(e,a){var s=this;if(i(this,t),a=n(a),e instanceof t)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new t(e.raw,a);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=w(this.set);try{for(l.s();!(h=l.n()).done;){var u=h.value;if(1===u.length&&g(u[0])){this.set=[u];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return o(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+t,s=e.get(i);if(s)return s;var o=this.options.loose,g=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(g,M(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],u),a("comparator trim",t),t=t.replace(h[l.TILDETRIM],c),a("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),a("caret trim",t);var y=t.split(" ").map((function(t){return k(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));o&&(y=y.filter((function(t){return a("loose invalid filter",t,n.options),!!t.match(h[l.COMPARATORLOOSE])}))),a("range list",y);var b,x=new Map,E=y.map((function(t){return new r(t,n.options)})),I=w(E);try{for(I.s();!(b=I.n()).done;){var A=b.value;if(m(A))return[A];x.set(A.value,A)}}catch(t){I.e(t)}finally{I.f()}x.size>1&&x.has("")&&x.delete("");var S=p(x.values());return e.set(i,S),S}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return y(t,n)&&e.set.some((function(e){return y(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new s(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(s(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(s(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();zr=e;var n=_n,r=Xn.safeRe,a=Xn.t,s=ra,h=Yn,l=$n,u=aa();return zr}(),a=Yn,s=$n,h=Xn.safeRe,l=Xn.t,u=Xn.comparatorTrimReplace,c=Xn.tildeTrimReplace,f=Xn.caretTrimReplace,d=Cn.FLAG_INCLUDE_PRERELEASE,v=Cn.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},g=function(t){return""===t.value},y=function(t,e){for(var n=!0,r=t.slice(),a=r.pop();n&&r.length;)n=r.every((function(t){return a.intersects(t,e)})),a=r.pop();return n},k=function(t,e){return a("comp",t,e),t=I(t,e),a("caret",t),t=x(t,e),a("tildes",t),t=S(t,e),a("xrange",t),t=R(t,e),a("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){var n=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(n,(function(e,n,r,i,s){var o;return a("tilde",t,e,n,r,i,s),b(n)?o="":b(r)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(i)?o=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):s?(a("replaceTilde pr",s),o=">=".concat(n,".").concat(r,".").concat(i,"-").concat(s," <").concat(n,".").concat(+r+1,".0-0")):o=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",o),o}))},I=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){a("caret",t,e);var n=e.loose?h[l.CARETLOOSE]:h[l.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,s,o){var h;return a("caret",t,e,n,i,s,o),b(n)?h="":b(i)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):b(s)?h="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):o?(a("replaceCaret pr",o),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(a("no pr"),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s," <").concat(+n+1,".0.0-0")),a("caret return",h),h}))},S=function(t,e){return a("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){t=t.trim();var n=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(n,(function(n,r,i,s,o,h){a("xRange",t,n,r,i,s,o,h);var l=b(i),u=l||b(s),c=u||b(o),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(s=0),o=0,">"===r?(r=">=",u?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),"<"===r&&(h="-0"),n="".concat(r+i,".").concat(s,".").concat(o).concat(h)):u?n=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):c&&(n=">=".concat(i,".").concat(s,".0").concat(h," <").concat(i,".").concat(+s+1,".0-0")),a("xRange return",n),n}))},R=function(t,e){return a("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return a("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,n,r,a,i,s,o,h,l,u,c,f,d){return n=b(r)?"":b(a)?">=".concat(r,".0.0").concat(t?"-0":""):b(i)?">=".concat(r,".").concat(a,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=b(l)?"":b(u)?"<".concat(+l+1,".0.0-0"):b(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},F=function(t,e,n){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return $r}Rn(ra);var ia,sa,oa=aa(),ha=function(t,e,n){try{e=new oa(e,n)}catch(t){return!1}return e.test(t)},la={valid:er,coerce:sr,satisfies:Rn(ha),SEMVER_SPEC_VERSION:Mn.SEMVER_SPEC_VERSION},ua=0,ca=1,fa=2,da=[0,1,2,2,3,0],va=function(){function t(e,r,a,s){var o;if(i(this,t),h(this,"autoUpdate",!0),h(this,"skeleton",void 0),h(this,"states",void 0),this._app=e,this._position=new n.Vec3,1===re.length){var l,u=w((o=new re(r)).pages);try{for(u.s();!(l=u.n()).done;){var c=l.value;c.setTexture(new Tn(s[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else o=new re(r,(function(t){return new Tn(s[t])}));var f=new yn(new fe(o));f.scale*=.01;var d=f.readSkeletonData(a);this.skeletonVersion=la.valid(la.coerce(d.version)),this._spine_3_6_0=la.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=la.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_1_X=la.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Ce(d),this.skeleton.updateWorldTransform(),this.stateData=new Kt(this.skeleton.data),this.states=[new _t(this.stateData)],this.clipper=new gn,this._node=new n.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new n.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new n.Vec2,this._aabbTempSize=new n.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[n.LAYERID_UI],this.init(),this._hidden=!1}return o(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new n.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new n.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,r,t),t=c.material,e=s,r=0),t=c.material;var f=c.positions,d=c.vertexColor.r,v=c.vertexColor.g,m=c.vertexColor.b,p=c.vertexColor.a,g=c.uvs,y=void 0,w=f.length/2;for(y=0;y0){var a=new n.Mesh(this._app.graphicsDevice);a.vertexBuffer=this._vertexBuffer,a.indexBuffer[0]=this._indexBuffer,a.primitive[0].type=n.PRIMITIVE_TRIANGLES,a.primitive[0].base=t,a.primitive[0].count=e,a.primitive[0].indexed=!0,a.aabb=this._aabb,this._meshes.push(a);var i=new n.MeshInstance(a,this._materials[r],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e=0;--i){var s=this.tryEntries[i],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var h=a.call(s,"catchLoc"),l=a.call(s,"finallyLoc");if(h&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;M(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:Y(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){o=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}function k(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var b=function(){function t(){i(this,t),this.array=new Array}return o(t,[{key:"add",value:function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e}},{key:"contains",value:function(t){return null!=this.array[0|t]}},{key:"remove",value:function(t){this.array[0|t]=void 0}},{key:"clear",value:function(){this.array.length=0}}]),t}(),x=function(){function t(){i(this,t),this.entries={},this.size=0}return o(t,[{key:"add",value:function(t){var e=this.entries[t];return this.entries[t]=!0,!e&&(this.size++,!0)}},{key:"addAll",value:function(t){for(var e=this.size,n=0,r=t.length;n0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;i(this,t),this.r=e,this.g=n,this.b=r,this.a=a}return o(t,[{key:"set",value:function(t,e,n,r){return this.r=t,this.g=e,this.b=n,this.a=r,this.clamp()}},{key:"setFromColor",value:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this}},{key:"setFromString",value:function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this}},{key:"add",value:function(t,e,n,r){return this.r+=t,this.g+=e,this.b+=n,this.a+=r,this.clamp()}},{key:"clamp",value: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}}],[{key:"rgba8888ToColor",value:function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255}},{key:"rgb888ToColor",value:function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255}},{key:"fromString",value:function(e){return(new t).setFromString(e)}}]),t}();E.WHITE=new E(1,1,1,1),E.RED=new E(1,0,0,1),E.GREEN=new E(0,1,0,1),E.BLUE=new E(0,0,1,1),E.MAGENTA=new E(1,0,1,1);var I=function(){function t(){i(this,t)}return o(t,null,[{key:"clamp",value:function(t,e,n){return tn?n:t}},{key:"cosDeg",value:function(e){return Math.cos(e*t.degRad)}},{key:"sinDeg",value:function(e){return Math.sin(e*t.degRad)}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}},{key:"toInt",value:function(t){return t>0?Math.floor(t):Math.ceil(t)}},{key:"cbrt",value:function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e}},{key:"randomTriangular",value:function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))}},{key:"randomTriangularWith",value:function(t,e,n){var r=Math.random(),a=e-t;return r<=(n-t)/a?t+Math.sqrt(r*a*(n-t)):e-Math.sqrt((1-r)*a*(e-n))}},{key:"isPowerOfTwo",value:function(t){return t&&0==(t&t-1)}}]),t}();I.PI=3.1415927,I.PI2=2*I.PI,I.radiansToDegrees=180/I.PI,I.radDeg=I.radiansToDegrees,I.degreesToRadians=I.PI/180,I.degRad=I.degreesToRadians;var A=function(){function t(){i(this,t)}return o(t,[{key:"apply",value:function(t,e,n){return t+(e-t)*this.applyInternal(n)}}]),t}(),S=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this)).power=2,r.power=t,r}return o(n,[{key:"applyInternal",value:function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1}}]),n}(A),T=function(t){l(n,t);var e=d(n);function n(t){return i(this,n),e.call(this,t)}return o(n,[{key:"applyInternal",value:function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1}}]),n}(S),R=function(){function t(){i(this,t)}return o(t,null,[{key:"arrayCopy",value:function(t,e,n,r,a){for(var i=e,s=r;i2&&void 0!==arguments[2]?arguments[2]:0,r=t.length;if(r==e)return t;if(t.length=e,r2&&void 0!==arguments[2]?arguments[2]:0;return e.length>=n?e:t.setArraySize(e,n,r)}},{key:"newArray",value:function(t,e){for(var n=new Array(t),r=0;r0?this.items.pop():this.instantiator()}},{key:"free",value:function(t){t.reset&&t.reset(),this.items.push(t)}},{key:"freeAll",value:function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.x=e,this.y=n}return o(t,[{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"length",value:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}},{key:"normalize",value:function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this}}]),t}(),Y=function(){function t(){i(this,t),this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return o(t,[{key:"update",value:function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)}}]),t}(),L=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;i(this,t),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(e)}return o(t,[{key:"hasEnoughData",value:function(){return this.addedValues>=this.values.length}},{key:"addValue",value:function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0}},{key:"getMean",value:function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*i;var s=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(l){for(var u=0,c=0,f=0;f0&&(h=o);for(var N=t.bone,P=N.worldX,_=N.worldY,O=N.a,B=N.b,D=N.c,V=N.d,U=e,q=a;q=this.regions.length&&(n=this.regions.length-1);var r=this.regions[n];e.region!=r&&(e.region=r,e.updateRegion())}},{key:"getPath",value:function(t,e){for(var n=t,r=(this.start+e).toString(),a=this.digits-r.length;a>0;a--)n+="0";return n+=r}}],[{key:"nextID",value:function(){return t._nextID++}}]),t}();_._nextID=0,function(t){t[t.hold=0]="hold",t[t.once=1]="once",t[t.loop=2]="loop",t[t.pingpong=3]="pingpong",t[t.onceReverse=4]="onceReverse",t[t.loopReverse=5]="loopReverse",t[t.pingpongReverse=6]="pingpongReverse"}(P||(P={}));var O,B,D=[P.hold,P.once,P.loop,P.pingpong,P.onceReverse,P.loopReverse,P.pingpongReverse],V=function(){function t(e,n,r){if(i(this,t),this.timelines=[],this.timelineIds=new x,!e)throw new Error("name cannot be null.");this.name=e,this.setTimelines(n),this.duration=r}return o(t,[{key:"setTimelines",value:function(t){if(!t)throw new Error("timelines cannot be null.");this.timelines=t,this.timelineIds.clear();for(var e=0;e0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;le)return r-1;return n-1}},{key:"search",value:function(t,e,n){for(var r=t.length,a=n;ae)return a-n;return r-n}}]),t}(),lt=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,a)).curves=R.newFloatArray(t+18*r),s.curves[t-1]=1,s}return o(n,[{key:"setLinear",value:function(t){this.curves[t]=0}},{key:"setStepped",value:function(t){this.curves[t]=1}},{key:"shrink",value:function(t){var e=this.getFrameCount()+18*t;if(this.curves.length>e){var n=R.newFloatArray(e);R.arrayCopy(this.curves,0,n,0,e),this.curves=n}}},{key:"setBezier",value:function(t,e,n,r,a,i,s,o,h,l,u){var c=this.curves,f=this.getFrameCount()+18*t;0==n&&(c[e]=2+f);for(var d=.03*(r-2*i+o),v=.03*(a-2*s+h),m=.006*(3*(i-o)-r+l),p=.006*(3*(s-h)-a+u),g=2*d+m,y=2*v+p,w=.3*(i-r)+d+.16666667*m,k=.3*(s-a)+v+.16666667*p,b=r+w,x=a+k,E=f+18;ft){var i=this.frames[e],s=this.frames[e+n];return s+(t-i)/(a[r]-i)*(a[r+1]-s)}var o=r+18;for(r+=2;r=t){var h=a[r-2],l=a[r-1];return l+(t-h)/(a[r]-h)*(a[r+1]-l)}e+=this.getFrameEntries();var u=a[o-2],c=a[o-1];return c+(t-u)/(this.frames[e]-u)*(this.frames[e+n]-c)}}]),n}(ht),ut=function(t){l(n,t);var e=d(n);function n(t,r,a){return i(this,n),e.call(this,t,r,[a])}return o(n,[{key:"getFrameEntries",value:function(){return 2}},{key:"setFrame",value:function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+1]=n}},{key:"getCurveValue",value:function(t){for(var e=this.frames,n=e.length-2,r=2;r<=n;r+=2)if(e[r]>t){n=r-2;break}var a=this.curves[n>>1];switch(a){case 0:var i=e[n],s=e[n+1];return s+(t-i)/(e[n+2]-i)*(e[n+2+1]-s);case 1:return e[n+1]}return this.getBezierValue(t,n,1,a-2)}}]),n}(lt),ct=function(t){l(n,t);var e=d(n);function n(t,r,a,s){return i(this,n),e.call(this,t,r,[a,s])}return o(n,[{key:"getFrameEntries",value:function(){return 3}},{key:"setFrame",value:function(t,e,n,r){t*=3,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r}}]),n}(lt),ft=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,r,U+"|"+a)).boneIndex=0,s.boneIndex=a,s}return o(n,[{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.bones[this.boneIndex];if(o.active)if(n>2];switch(m){case 0:var p=h[v];c=h[v+1],f=h[v+2],d=h[v+3];var g=(n-p)/(h[v+4]-p);c+=(h[v+4+1]-c)*g,f+=(h[v+4+2]-f)*g,d+=(h[v+4+3]-d)*g;break;case 1:c=h[v+1],f=h[v+2],d=h[v+3];break;default:c=this.getBezierValue(n,v,1,m-2),f=this.getBezierValue(n,v,2,m+18-2),d=this.getBezierValue(n,v,3,m+36-2)}if(1==a)l.r=c,l.g=f,l.b=d;else{if(i==O.setup){var y=o.data.color;l.r=y.r,l.g=y.g,l.b=y.b}l.r+=(c-l.r)*a,l.g+=(f-l.g)*a,l.b+=(d-l.b)*a}}}}}]),n}(lt),It=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,r,J+"|"+a)).slotIndex=0,s.slotIndex=a,s}return o(n,[{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.color;if(n>3];switch(b){case 0:var x=h[k];d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];var E=(n-x)/(h[k+8]-x);d+=(h[k+8+1]-d)*E,v+=(h[k+8+2]-v)*E,m+=(h[k+8+3]-m)*E,p+=(h[k+8+4]-p)*E,g+=(h[k+8+5]-g)*E,y+=(h[k+8+6]-y)*E,w+=(h[k+8+7]-w)*E;break;case 1:d=h[k+1],v=h[k+2],m=h[k+3],p=h[k+4],g=h[k+5],y=h[k+6],w=h[k+7];break;default:d=this.getBezierValue(n,k,1,b-2),v=this.getBezierValue(n,k,2,b+18-2),m=this.getBezierValue(n,k,3,b+36-2),p=this.getBezierValue(n,k,4,b+54-2),g=this.getBezierValue(n,k,5,b+72-2),y=this.getBezierValue(n,k,6,b+90-2),w=this.getBezierValue(n,k,7,b+108-2)}if(1==a)l.set(d,v,m,p),u.r=g,u.g=y,u.b=w;else{if(i==O.setup){l.setFromColor(o.data.color);var I=o.data.darkColor;u.r=I.r,u.g=I.g,u.b=I.b}l.add((d-l.r)*a,(v-l.g)*a,(m-l.b)*a,(p-l.a)*a),u.r+=(g-u.r)*a,u.g+=(y-u.g)*a,u.b+=(w-u.b)*a}}}}}]),n}(lt),St=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,r,[$+"|"+a,K+"|"+a])).slotIndex=0,s.slotIndex=a,s}return o(n,[{key:"getFrameEntries",value:function(){return 7}},{key:"setFrame",value:function(t,e,n,r,a,i,s,o){t*=7,this.frames[t]=e,this.frames[t+1]=n,this.frames[t+2]=r,this.frames[t+3]=a,this.frames[t+4]=i,this.frames[t+5]=s,this.frames[t+6]=o}},{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames,l=o.color,u=o.darkColor;if(nt){var i=this.frames[e];return n[r+1]*(t-i)/(n[r]-i)}var s=r+18;for(r+=2;r=t){var o=n[r-2],h=n[r-1];return h+(t-o)/(n[r]-o)*(n[r+1]-h)}var l=n[s-2],u=n[s-1];return u+(1-u)*(t-l)/(this.frames[e+this.getFrameEntries()]-l)}},{key:"apply",value:function(t,e,n,r,a,i,s){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h&&h instanceof N&&h.timelineAttachment==this.attachment){var l=o.deform;0==l.length&&(i=O.setup);var u=this.vertices,c=u[0].length,f=this.frames;if(n=f[f.length-1]){var p=u[f.length-1];if(1==a)if(i==O.add){var g=h;if(g.bones)for(var y=0;yn)this.apply(t,e,Number.MAX_VALUE,r,a,i,s),e=-1;else if(e>=o[h-1])return;if(!(n0&&o[l-1]==u;)l--;for(;l=o[l];l++)r.push(this.events[l])}}}}]),n}(ht);Ct.propertyIds=[""+tt];var Mt=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,n.propertyIds)).drawOrders=new Array(t),r}return o(n,[{key:"getFrameCount",value:function(){return this.frames.length}},{key:"setFrame",value:function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n}},{key:"apply",value:function(t,e,n,r,a,i,s){if(s!=B.mixOut)if(n>2];switch(d){case 0:var v=h[f];l=h[f+1],u=h[f+2],c=h[f+3];var m=(n-v)/(h[f+4]-v);l+=(h[f+4+1]-l)*m,u+=(h[f+4+2]-u)*m,c+=(h[f+4+3]-c)*m;break;case 1:l=h[f+1],u=h[f+2],c=h[f+3];break;default:l=this.getBezierValue(n,f,1,d-2),u=this.getBezierValue(n,f,2,d+18-2),c=this.getBezierValue(n,f,3,d+36-2)}if(i==O.setup){var p=o.data;o.mixRotate=p.mixRotate+(l-p.mixRotate)*a,o.mixX=p.mixX+(u-p.mixX)*a,o.mixY=p.mixY+(c-p.mixY)*a}else o.mixRotate+=(l-o.mixRotate)*a,o.mixX+=(u-o.mixX)*a,o.mixY+=(c-o.mixY)*a}}}}]),n}(lt),Pt=function(t){l(n,t);var e=d(n);function n(t,r,a){var s;return i(this,n),(s=e.call(this,t,[ot+"|"+r+"|"+a.sequence.id])).slotIndex=r,s.attachment=a,s}return o(n,[{key:"getFrameEntries",value:function(){return n.ENTRIES}},{key:"getSlotIndex",value:function(){return this.slotIndex}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setFrame",value:function(t,e,r,a,i){var s=this.frames;s[t*=n.ENTRIES]=e,s[t+n.MODE]=r|a<<4,s[t+n.DELAY]=i}},{key:"apply",value:function(t,e,r,a,i,s,o){var h=t.slots[this.slotIndex];if(h.bone.active){var l=h.attachment,u=this.attachment;if(l==u||l instanceof N&&l.timelineAttachment==u){var c=this.frames;if(r>4,g=this.attachment.sequence.regions.length,y=D[15&v];if(y!=P.hold)switch(p+=(r-d)/m+1e-5|0,y){case P.once:p=Math.min(g-1,p);break;case P.loop:p%=g;break;case P.pingpong:var w=(g<<1)-2;(p=0==w?0:p%w)>=g&&(p=w-p);break;case P.onceReverse:p=Math.max(g-1-p,0);break;case P.loopReverse:p=g-1-p%g;break;case P.pingpongReverse:var k=(g<<1)-2;(p=0==k?0:(p+g-1)%k)>=g&&(p=k-p)}h.sequenceIndex=p}}}}}}]),n}(ht);Pt.ENTRIES=3,Pt.MODE=1,Pt.DELAY=2;var _t=function(){function t(e){i(this,t),this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new Dt(this),this.propertyIDs=new x,this.animationsChanged=!1,this.trackEntryPool=new M((function(){return new Bt})),this.data=e}return o(t,[{key:"update",value:function(t){t*=this.timeScale;for(var e=this.tracks,n=0,r=e.length;n0){if(a.delay-=i,a.delay>0)continue;i=-a.delay,a.delay=0}var s=a.next;if(s){var o=a.trackLast-s.delay;if(o>=0){for(s.delay=0,s.trackTime+=0==a.timeScale?0:(o/a.timeScale+t)*s.timeScale,a.trackTime+=i,this.setCurrent(n,s,!0);s.mixingFrom;)s.mixTime+=t,s=s.mixingFrom;continue}}else if(a.trackLast>=a.trackEnd&&!a.mixingFrom){e[n]=null,this.queue.end(a),this.clearNext(a);continue}if(a.mixingFrom&&this.updateMixingFrom(a,t)){var h=a.mixingFrom;for(a.mixingFrom=null,h&&(h.mixingTo=null);h;)this.queue.end(h),h=h.mixingFrom}a.trackTime+=i}}this.queue.drain()}},{key:"updateMixingFrom",value:function(t,e){var n=t.mixingFrom;if(!n)return!0;var r=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),r):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)}},{key:"apply",value:function(t){if(!t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,r=!1,a=0,i=n.length;a0)){r=!0;var o=0==a?O.first:s.mixBlend,h=s.alpha;s.mixingFrom?h*=this.applyMixingFrom(s,t,o):s.trackTime>=s.trackEnd&&!s.next&&(h=0);var l=s.animationLast,u=s.getAnimationTime(),c=u,f=e;s.reverse&&(c=s.animation.duration-c,f=null);var d=s.animation.timelines,v=d.length;if(0==a&&1==h||o==O.add)for(var m=0;m1&&(a=1),n!=O.first&&(n=r.mixBlend));var i=a0&&this.queueEvents(r,f),this.events.length=0,r.nextAnimationLast=f,r.nextTrackLast=r.trackTime,a}},{key:"applyAttachmentTimeline",value:function(t,e,n,r,a){var i=e.slots[t.slotIndex];i.bone.active&&(n0,p=d>=0;I.signum(v)!=I.signum(f)&&Math.abs(v)<=90&&(Math.abs(d)>180&&(d+=360*I.signum(d)),p=m),c=f+d-d%360,p!=m&&(c+=360*I.signum(d)),i[s]=c}i[s+1]=f,h.rotation=l+c*r}}else t.apply(e,0,n,null,1,a,B.mixIn)}},{key:"queueEvents",value:function(t,e){for(var n=t.animationStart,r=t.animationEnd,a=r-n,i=t.trackLast%a,s=this.events,o=0,h=s.length;or||this.queue.event(t,l)}for((t.loop?0==a||i>t.trackTime%a:e>=r&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(e){this.queue.end(e),this.clearNext(e);for(var n=e;;){var r=n.mixingFrom;if(!r)break;this.queue.end(r),n.mixingFrom=null,n.mixingTo=null,n=r}this.tracks[e.trackIndex]=null,this.queue.drain()}}}},{key:"setCurrent",value:function(t,e,n){var r=this.expandToIndex(t);this.tracks[t]=e,e.previous=null,r&&(n&&this.queue.interrupt(r),e.mixingFrom=r,r.mixingTo=e,e.mixTime=0,r.mixingFrom&&r.mixDuration>0&&(e.interruptAlpha*=Math.min(1,r.mixTime/r.mixDuration)),r.timelinesRotation.length=0),this.queue.start(e)}},{key:"setAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.data.skeletonData.findAnimation(e);if(!r)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,r,n)}},{key:"setAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e)throw new Error("animation cannot be null.");var r=!0,a=this.expandToIndex(t);a&&(-1==a.nextTrackLast?(this.tracks[t]=a.mixingFrom,this.queue.interrupt(a),this.queue.end(a),this.clearNext(a),a=a.mixingFrom,r=!1):this.clearNext(a));var i=this.trackEntry(t,e,n,a);return this.setCurrent(t,i,r),this.queue.drain(),i}},{key:"addAnimation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=this.data.skeletonData.findAnimation(e);if(!a)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,a,n,r)}},{key:"addAnimationWith",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!e)throw new Error("animation cannot be null.");var a=this.expandToIndex(t);if(a)for(;a.next;)a=a.next;var i=this.trackEntry(t,e,n,a);return a?(a.next=i,i.previous=a,r<=0&&(r+=a.getTrackComplete()-i.mixDuration)):(this.setCurrent(t,i,!0),this.queue.drain()),i.delay=r,i}},{key:"setEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.setAnimationWith(e,t.emptyAnimation(),!1);return r.mixDuration=n,r.trackEnd=n,r}},{key:"addEmptyAnimation",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=this.addAnimationWith(e,t.emptyAnimation(),!1,r);return r<=0&&(a.delay+=a.mixDuration-n),a.mixDuration=n,a.trackEnd=n,a}},{key:"setEmptyAnimations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,r=this.tracks.length;n0){a[h]=Ht,i[h]=c;continue t}break}a[h]=zt}else a[h]=Wt}}},{key:"getCurrent",value:function(t){return t>=this.tracks.length?null:this.tracks[t]}},{key:"addListener",value:function(t){if(!t)throw new Error("listener cannot be null.");this.listeners.push(t)}},{key:"removeListener",value:function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}},{key:"clearListeners",value:function(){this.listeners.length=0}},{key:"clearListenerNotifications",value:function(){this.queue.clear()}}],[{key:"emptyAnimation",value:function(){return t._emptyAnimation}}]),t}();_t._emptyAnimation=new V("",[],0);var Ot,Bt=function(){function t(){i(this,t),this.animation=null,this.previous=null,this.next=null,this.mixingFrom=null,this.mixingTo=null,this.listener=null,this.trackIndex=0,this.loop=!1,this.holdPrevious=!1,this.reverse=!1,this.shortestRotation=!1,this.eventThreshold=0,this.attachmentThreshold=0,this.drawOrderThreshold=0,this.animationStart=0,this.animationEnd=0,this.animationLast=0,this.nextAnimationLast=0,this.delay=0,this.trackTime=0,this.trackLast=0,this.nextTrackLast=0,this.trackEnd=0,this.timeScale=0,this.alpha=0,this.mixTime=0,this.mixDuration=0,this.interruptAlpha=0,this.totalAlpha=0,this.mixBlend=O.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return o(t,[{key:"reset",value:function(){this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0}},{key:"getAnimationTime",value:function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)}},{key:"setAnimationLast",value:function(t){this.animationLast=t,this.nextAnimationLast=t}},{key:"isComplete",value:function(){return this.trackTime>=this.animationEnd-this.animationStart}},{key:"resetRotationDirections",value:function(){this.timelinesRotation.length=0}},{key:"getTrackComplete",value:function(){var t=this.animationEnd-this.animationStart;if(0!=t){if(this.loop)return t*(1+(this.trackTime/t|0));if(this.trackTime0&&u&&u.length>0&&(c.names=l,c.values=u,l=null,u=null),c.u=c.x/h.width,c.v=c.y/h.height,90==c.degrees?(c.u2=(c.x+c.height)/h.width,c.v2=(c.y+c.width)/h.height):(c.u2=(c.x+c.width)/h.width,c.v2=(c.y+c.height)/h.height),this.regions.push(c)}else{for(h=new ie(o.trim());0!=n.readEntry(r,o=n.readLine());){var p=a[r[0]];p&&p(h)}this.pages.push(h)}}return o(t,[{key:"findRegion",value:function(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",r=w(this.pages);try{for(r.s();!(e=r.n()).done;){var a=e.value;a.setTexture(t.get(n+a.name))}}catch(t){r.e(t)}finally{r.f()}}},{key:"dispose",value:function(){for(var t,e=0;e=this.lines.length?null:this.lines[this.index++]}},{key:"readEntry",value:function(t,e){if(!e)return 0;if(0==(e=e.trim()).length)return 0;var n=e.indexOf(":");if(-1==n)return 0;t[0]=e.substr(0,n).trim();for(var r=1,a=n+1;;r++){var i=e.indexOf(",",a);if(-1==i)return t[r]=e.substr(a).trim(),r;if(t[r]=e.substr(a,i-a).trim(),a=i+1,4==r)return 4}}}]),t}(),ie=function(){function t(e){i(this,t),this.minFilter=Vt.Nearest,this.magFilter=Vt.Nearest,this.uWrap=Ut.ClampToEdge,this.vWrap=Ut.ClampToEdge,this.texture=null,this.width=0,this.height=0,this.pma=!1,this.regions=new Array,this.name=e}return o(t,[{key:"setTexture",value:function(t){this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap);var e,n=w(this.regions);try{for(n.s();!(e=n.n()).done;){e.value.texture=t}}catch(t){n.e(t)}finally{n.f()}}}]),t}(),se=function(t){l(n,t);var e=d(n);function n(t,r){var a;return i(this,n),(a=e.call(this)).x=0,a.y=0,a.offsetX=0,a.offsetY=0,a.originalWidth=0,a.originalHeight=0,a.index=0,a.degrees=0,a.names=null,a.values=null,a.page=t,a.name=r,t.regions.push(f(a)),a}return o(n)}(ee),oe=function(t){l(n,t);var e=d(n);function n(t,r){var a;return i(this,n),(a=e.call(this,t)).region=null,a.regionUVs=[],a.uvs=[],a.triangles=[],a.color=new E(1,1,1,1),a.width=0,a.height=0,a.hullLength=0,a.edges=[],a.parentMesh=null,a.sequence=null,a.tempColor=new E(0,0,0,0),a.path=r,a}return o(n,[{key:"updateRegion",value:function(){if(!this.region)throw new Error("Region not set.");var t=this.regionUVs;this.uvs&&this.uvs.length==t.length||(this.uvs=R.newFloatArray(t.length));var e=this.uvs,n=this.uvs.length,r=this.region.u,a=this.region.v,i=0,s=0;if(this.region instanceof se){var o=this.region,h=o.page.texture.getImage(),l=h.width,u=h.height;switch(o.degrees){case 90:r-=(o.originalHeight-o.offsetY-o.height)/l,a-=(o.originalWidth-o.offsetX-o.width)/u,i=o.originalHeight/l,s=o.originalWidth/u;for(var c=0;c= 0.");if(!n)throw new Error("name cannot be null.");this.index=e,this.name=n,this.parent=r}));!function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(ce||(ce={}));var ve,me,pe,ge=function(){function t(e,n,r){if(i(this,t),this.parent=null,this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.skeleton=n,this.parent=r,this.setToSetupPose()}return o(t,[{key:"isActive",value:function(){return this.active}},{key:"update",value:function(){this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)}},{key:"updateWorldTransform",value:function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)}},{key:"updateWorldTransformWith",value:function(t,e,n,r,a,i,s){this.ax=t,this.ay=e,this.arotation=n,this.ascaleX=r,this.ascaleY=a,this.ashearX=i,this.ashearY=s;var o=this.parent;if(!o){var h=this.skeleton,l=n+90+s,u=h.scaleX,c=h.scaleY;return this.a=I.cosDeg(n+i)*r*u,this.b=I.cosDeg(l)*a*u,this.c=I.sinDeg(n+i)*r*c,this.d=I.sinDeg(l)*a*c,this.worldX=t*u+h.x,void(this.worldY=e*c+h.y)}var f=o.a,d=o.b,v=o.c,m=o.d;switch(this.worldX=f*t+d*e+o.worldX,this.worldY=v*t+m*e+o.worldY,this.data.transformMode){case ce.Normal:var p=n+90+s,g=I.cosDeg(n+i)*r,y=I.cosDeg(p)*a,w=I.sinDeg(n+i)*r,k=I.sinDeg(p)*a;return this.a=f*g+d*w,this.b=f*y+d*k,this.c=v*g+m*w,void(this.d=v*y+m*k);case ce.OnlyTranslation:var b=n+90+s;this.a=I.cosDeg(n+i)*r,this.b=I.cosDeg(b)*a,this.c=I.sinDeg(n+i)*r,this.d=I.sinDeg(b)*a;break;case ce.NoRotationOrReflection:var x=f*f+v*v,E=0;x>1e-4?(x=Math.abs(f*m-d*v)/x,f/=this.skeleton.scaleX,d=(v/=this.skeleton.scaleY)*x,m=f*x,E=Math.atan2(v,f)*I.radDeg):(f=0,v=0,E=90-Math.atan2(m,d)*I.radDeg);var A=n+i-E,S=n+s-E+90,T=I.cosDeg(A)*r,R=I.cosDeg(S)*a,C=I.sinDeg(A)*r,M=I.sinDeg(S)*a;this.a=f*T-d*C,this.b=f*R-d*M,this.c=v*T+m*C,this.d=v*R+m*M;break;case ce.NoScale:case ce.NoScaleOrReflection:var F=I.cosDeg(n),Y=I.sinDeg(n),L=(f*F+d*Y)/this.skeleton.scaleX,X=(v*F+m*Y)/this.skeleton.scaleY,N=Math.sqrt(L*L+X*X);N>1e-5&&(N=1/N),L*=N,X*=N,N=Math.sqrt(L*L+X*X),this.data.transformMode==ce.NoScale&&f*m-d*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(N=-N);var P=Math.PI/2+Math.atan2(X,L),_=Math.cos(P)*N,O=Math.sin(P)*N,B=I.cosDeg(i)*r,D=I.cosDeg(90+s)*a,V=I.sinDeg(i)*r,U=I.sinDeg(90+s)*a;this.a=L*B+_*V,this.b=L*D+_*U,this.c=X*B+O*V,this.d=X*D+O*U}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY}},{key:"setToSetupPose",value:function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY}},{key:"getWorldRotationX",value:function(){return Math.atan2(this.c,this.a)*I.radDeg}},{key:"getWorldRotationY",value:function(){return Math.atan2(this.d,this.b)*I.radDeg}},{key:"getWorldScaleX",value:function(){return Math.sqrt(this.a*this.a+this.c*this.c)}},{key:"getWorldScaleY",value:function(){return Math.sqrt(this.b*this.b+this.d*this.d)}},{key:"updateAppliedTransform",value:function(){var t=this.parent;if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*I.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*I.radDeg);var e=t.a,n=t.b,r=t.c,a=t.d,i=1/(e*a-n*r),s=this.worldX-t.worldX,o=this.worldY-t.worldY;this.ax=s*a*i-o*n*i,this.ay=o*e*i-s*r*i;var h=i*a,l=i*e,u=i*n,c=i*r,f=h*this.a-u*this.c,d=h*this.b-u*this.d,v=l*this.c-c*this.a,m=l*this.d-c*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(f*f+v*v),this.ascaleX>1e-4){var p=f*m-d*v;this.ascaleY=p/this.ascaleX,this.ashearY=Math.atan2(f*d+v*m,p)*I.radDeg,this.arotation=Math.atan2(v,f)*I.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(d*d+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,d)*I.radDeg}},{key:"worldToLocal",value:function(t){var e=1/(this.a*this.d-this.b*this.c),n=t.x-this.worldX,r=t.y-this.worldY;return t.x=n*this.d*e-r*this.b*e,t.y=r*this.a*e-n*this.c*e,t}},{key:"localToWorld",value:function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t}},{key:"worldToLocalRotation",value:function(t){var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(this.a*e-this.c*n,this.d*n-this.b*e)*I.radDeg+this.rotation-this.shearX}},{key:"localToWorldRotation",value:function(t){t-=this.rotation-this.shearX;var e=I.sinDeg(t),n=I.cosDeg(t);return Math.atan2(n*this.c+e*this.d,n*this.a+e*this.b)*I.radDeg}},{key:"rotateWorld",value:function(t){var e=this.a,n=this.b,r=this.c,a=this.d,i=I.cosDeg(t),s=I.sinDeg(t);this.a=i*e-s*r,this.b=i*n-s*a,this.c=s*e+i*r,this.d=s*n+i*a}}]),t}(),ye=o((function t(e,n,r){i(this,t),this.name=e,this.order=n,this.skinRequired=r})),we=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ke;i(this,t),this.pathPrefix="",this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=e,this.pathPrefix=n,this.downloader=r}return o(t,[{key:"start",value:function(t){return this.toLoad++,this.pathPrefix+t}},{key:"success",value:function(t,e,n){this.toLoad--,this.loaded++,this.assets[e]=n,t&&t(e,n)}},{key:"error",value:function(t,e,n){this.toLoad--,this.loaded++,this.errors[e]=n,t&&t(e,n)}},{key:"loadAll",value:function(){var t=this;return new Promise((function(e,n){requestAnimationFrame((function r(){t.isLoadingComplete()?t.hasErrors()?n(t.errors):e(t):requestAnimationFrame(r)}))}))}},{key:"setRawDataURI",value:function(t,e){this.downloader.rawDataUris[this.pathPrefix+t]=e}},{key:"loadBinary",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadBinary(t,(function(r){e.success(n,t,r)}),(function(n,a){e.error(r,t,"Couldn't load binary ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"loadText",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadText(t,(function(r){e.success(n,t,r)}),(function(n,a){e.error(r,t,"Couldn't load text ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"loadJson",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};t=this.start(t),this.downloader.downloadJson(t,(function(r){e.success(n,t,r)}),(function(n,a){e.error(r,t,"Couldn't load JSON ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"loadTexture",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(t=this.start(t),!!("undefined"==typeof window||"undefined"==typeof navigator||!window.document))fetch(t,{mode:"cors"}).then((function(n){return n.ok?n.blob():(e.error(r,t,"Couldn't load image: ".concat(t)),null)})).then((function(t){return t?createImageBitmap(t,{premultiplyAlpha:"none",colorSpaceConversion:"none"}):null})).then((function(r){r&&e.success(n,t,e.textureLoader(r))}));else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(){e.success(n,t,e.textureLoader(a))},a.onerror=function(){e.error(r,t,"Couldn't load image: ".concat(t))},this.downloader.rawDataUris[t]&&(t=this.downloader.rawDataUris[t]),a.src=t}}},{key:"loadTextureAtlas",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=arguments.length>3?arguments[3]:void 0,i=t.lastIndexOf("/"),s=i>=0?t.substring(0,i+1):"";t=this.start(t),this.downloader.downloadText(t,(function(i){try{var o,h=new re(i),l=h.pages.length,u=!1,c=w(h.pages);try{var f=function(){var i=o.value;e.loadTexture(a?a[i.name]:s+i.name,(function(r,a){u||(i.setTexture(a),0==--l&&e.success(n,t,h))}),(function(n,a){u||e.error(r,t,"Couldn't load texture atlas ".concat(t," page image: ").concat(n)),u=!0}))};for(c.s();!(o=c.n()).done;)f()}catch(t){c.e(t)}finally{c.f()}}catch(n){e.error(r,t,"Couldn't parse texture atlas ".concat(t,": ").concat(n.message))}}),(function(n,a){e.error(r,t,"Couldn't load texture atlas ".concat(t,": status ").concat(n,", ").concat(a))}))}},{key:"get",value:function(t){return this.assets[this.pathPrefix+t]}},{key:"require",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];if(e)return e;var n=this.errors[t];throw Error("Asset not found: "+t+(n?"\n"+n:""))}},{key:"remove",value:function(t){t=this.pathPrefix+t;var e=this.assets[t];return e.dispose&&e.dispose(),delete this.assets[t],e}},{key:"removeAll",value:function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}}},{key:"isLoadingComplete",value:function(){return 0==this.toLoad}},{key:"getToLoad",value:function(){return this.toLoad}},{key:"getLoaded",value:function(){return this.loaded}},{key:"dispose",value:function(){this.removeAll()}},{key:"hasErrors",value:function(){return Object.keys(this.errors).length>0}},{key:"getErrors",value:function(){return this.errors}}]),t}(),ke=function(){function t(){i(this,t),this.callbacks={},this.rawDataUris={}}return o(t,[{key:"dataUriToString",value:function(t){if(!t.startsWith("data:"))throw new Error("Not a data URI.");var e=t.indexOf("base64,");return-1!=e?(e+=7,atob(t.substr(e))):t.substr(t.indexOf(",")+1)}},{key:"base64ToUint8Array",value:function(t){for(var e=window.atob(t),n=e.length,r=new Uint8Array(n),a=0;a180?f-=360:f<-180&&(f+=360);var b=t.ascaleX,x=t.ascaleY;if(r||a){switch(t.data.transformMode){case ce.NoScale:case ce.NoScaleOrReflection:d=e-t.worldX,v=n-t.worldY}var E=t.data.length*b,A=Math.sqrt(d*d+v*v);if(r&&AE&&E>1e-4){var S=(A/E-1)*s+1;b*=S,i&&(x*=S)}}t.updateWorldTransformWith(t.ax,t.ay,t.arotation+f*s,b,x,t.ashearX,t.ashearY)}},{key:"apply2",value:function(t,e,n,r,a,i,s,o,h){var l=t.ax,u=t.ay,c=t.ascaleX,f=t.ascaleY,d=c,v=f,m=e.ascaleX,p=0,g=0,y=0;c<0?(c=-c,p=180,y=-1):(p=0,y=1),f<0&&(f=-f,y=-y),m<0?(m=-m,g=180):g=0;var w=e.ax,k=0,b=0,x=0,E=t.a,A=t.b,S=t.c,T=t.d,R=Math.abs(c-f)<=1e-4;!R||i?(k=0,b=E*w+t.worldX,x=S*w+t.worldY):(b=E*w+A*(k=e.ay)+t.worldX,x=S*w+T*k+t.worldY);var C=t.parent;if(!C)throw new Error("IK parent must itself have a parent.");E=C.a,A=C.b,S=C.c;var M,F,Y=E*(T=C.d)-A*S,L=b-C.worldX,X=x-C.worldY,N=(L*T-X*A)*(Y=Math.abs(Y)<=1e-4?0:1/Y)-l,P=(X*E-L*S)*Y-u,_=Math.sqrt(N*N+P*P),O=e.data.length*m;if(_<1e-4)return this.apply1(t,n,r,!1,i,!1,h),void e.updateWorldTransformWith(w,k,0,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY);var B=((L=n-C.worldX)*T-(X=r-C.worldY)*A)*Y-l,D=(X*E-L*S)*Y-u,V=B*B+D*D;if(0!=o){o*=c*(m+1)*.5;var U=Math.sqrt(V),q=U-_-O*c+o;if(q>0){var W=Math.min(1,q/(2*o))-1;V=(B-=(W=(q-o*(1-W*W))/U)*B)*B+(D-=W*D)*D}}t:if(R){var j=(V-_*_-(O*=c)*O)/(2*_*O);j<-1?(j=-1,F=Math.PI*a):j>1?(j=1,F=0,i&&(d*=E=(Math.sqrt(V)/(_+O)-1)*h+1,s&&(v*=E))):F=Math.acos(j)*a,E=_+O*j,A=O*Math.sin(F),M=Math.atan2(D*E-B*A,B*E+D*A)}else{var G=(E=c*O)*E,z=(A=f*O)*A,H=Math.atan2(D,B),$=-2*z*_,J=z-G;if((T=$*$-4*J*(S=z*_*_+G*V-G*z))>=0){var K=Math.sqrt(T);$<0&&(K=-K);var Q=(K=.5*-($+K))/J,Z=S/K,tt=Math.abs(Q)=-1&&S<=1&&(S=Math.acos(S),(T=(L=E*Math.cos(S)+_)*L+(X=A*Math.sin(S))*X)ot&&(it=S,ot=T,st=L,ht=X)),V<=.5*(rt+ot)?(M=H-Math.atan2(at*a,nt),F=et*a):(M=H-Math.atan2(ht*a,st),F=it*a)}var lt=Math.atan2(k,w)*y,ut=t.arotation;(M=(M-lt)*I.radDeg+p-ut)>180?M-=360:M<-180&&(M+=360),t.updateWorldTransformWith(l,u,ut+M*h,d,v,0,0),ut=e.arotation,(F=((F+lt)*I.radDeg-e.ashearX)*y+g-ut)>180?F-=360:F<-180&&(F+=360),e.updateWorldTransformWith(w,k,ut+F*h,e.ascaleX,e.ascaleY,e.ashearX,e.ashearY)}}]),t}(),Ie=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,0,!1)).bones=new Array,r._target=null,r.bendDirection=1,r.compress=!1,r.stretch=!1,r.uniform=!1,r.mix=1,r.softness=0,r}return o(n,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}]),n}(ye),Ae=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,0,!1)).bones=new Array,r._target=null,r.positionMode=ve.Fixed,r.spacingMode=me.Fixed,r.rotateMode=pe.Chain,r.offsetRotation=0,r.position=0,r.spacing=0,r.mixRotate=0,r.mixX=0,r.mixY=0,r}return o(n,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("SlotData not set.")},set:function(t){this._target=t}}]),n}(ye);!function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(ve||(ve={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent",t[t.Proportional=3]="Proportional"}(me||(me={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(pe||(pe={}));var Se=function(){function t(e,n){if(i(this,t),this.position=0,this.spacing=0,this.mixRotate=0,this.mixX=0,this.mixY=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.bones=new Array;for(var r=0,a=e.bones.length;r0){k=u/k*d;for(var M=1;M0?I.degRad:-I.degRad}for(var j=0,G=3;j0){var tt=z.a,et=z.b,nt=z.c,rt=z.d,at=0,it=0,st=0;if(at=s?B[G-1]:0==c[j+1]?B[G+2]:Math.atan2(K,J),at-=Math.atan2(nt,tt),q){it=Math.cos(at),st=Math.sin(at);var ot=z.data.length;D+=(ot*(it*tt-st*nt)-J)*n,V+=(ot*(st*tt+it*nt)-K)*n}else at+=U;at>I.PI?at-=I.PI2:at<-I.PI&&(at+=I.PI2),at*=n,it=Math.cos(at),st=Math.sin(at),z.a=it*tt-st*nt,z.b=it*et-st*rt,z.c=st*tt+it*nt,z.d=st*et+it*rt}z.updateAppliedTransform()}}}}},{key:"computeWorldPositions",value:function(e,n,r){var a=this.target,i=this.position,s=this.spaces,o=R.setArraySize(this.positions,3*n+2),h=this.world,l=e.closed,u=e.worldVerticesLength,c=u/6,f=t.NONE;if(!e.constantSpeed){var d,v=e.lengths,m=v[c-=l?1:2];switch(this.data.positionMode==ve.Percent&&(i*=m),this.data.spacingMode){case me.Percent:d=m;break;case me.Proportional:d=m/n;break;default:d=1}h=R.setArraySize(this.world,8);for(var p=0,g=0,y=0;pm){f!=t.AFTER&&(f=t.AFTER,e.computeWorldVertices(a,u-6,4,h,0,2)),this.addAfterPosition(k-m,h,0,o,g);continue}}for(;;y++){var b=v[y];if(!(k>b)){if(0==y)k/=b;else{var x=v[y-1];k=(k-x)/(b-x)}break}}y!=f&&(f=y,l&&y==c?(e.computeWorldVertices(a,u-4,4,h,0,2),e.computeWorldVertices(a,0,4,h,4,2)):e.computeWorldVertices(a,6*y+2,8,h,0,2)),this.addCurvePosition(k,h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],o,g,r||p>0&&0==w)}return o}l?(u+=2,h=R.setArraySize(this.world,u),e.computeWorldVertices(a,2,u-4,h,0,2),e.computeWorldVertices(a,0,2,h,u-4,2),h[u-2]=h[0],h[u-1]=h[1]):(c--,u-=4,h=R.setArraySize(this.world,u),e.computeWorldVertices(a,2,u,h,0,2));for(var E,I=R.setArraySize(this.curves,c),A=0,S=h[0],T=h[1],C=0,M=0,F=0,Y=0,L=0,X=0,N=0,P=0,_=0,O=0,B=0,D=0,V=0,U=0,q=0,W=2;qA){this.addAfterPosition(Q-A,h,u-4,o,H);continue}}for(;;$++){var Z=I[$];if(!(Q>Z)){if(0==$)Q/=Z;else{var tt=I[$-1];Q=(Q-tt)/(Z-tt)}break}}if($!=f){f=$;var et=6*$;for(S=h[et],T=h[et+1],C=h[et+2],M=h[et+3],F=h[et+4],Y=h[et+5],B=2*(N=.03*(S-2*C+F))+(_=.006*(3*(C-F)-S+(L=h[et+6]))),D=2*(P=.03*(T-2*M+Y))+(O=.006*(3*(M-Y)-T+(X=h[et+7]))),V=.3*(C-S)+N+.16666667*_,U=.3*(M-T)+P+.16666667*O,G=Math.sqrt(V*V+U*U),j[0]=G,et=1;et<8;et++)V+=B,U+=D,B+=_,D+=O,G+=Math.sqrt(V*V+U*U),j[et]=G;V+=B,U+=D,G+=Math.sqrt(V*V+U*U),j[8]=G,V+=B+_,U+=D+O,G+=Math.sqrt(V*V+U*U),j[9]=G,J=0}for(Q*=G;;J++){var nt=j[J];if(!(Q>nt)){if(0==J)Q/=nt;else{var rt=j[J-1];Q=J+(Q-rt)/(nt-rt)}break}}this.addCurvePosition(.1*Q,S,T,C,M,F,Y,L,X,o,H,r||z>0&&0==K)}return o}},{key:"addBeforePosition",value:function(t,e,n,r,a){var i=e[n],s=e[n+1],o=e[n+2]-i,h=e[n+3]-s,l=Math.atan2(h,o);r[a]=i+t*Math.cos(l),r[a+1]=s+t*Math.sin(l),r[a+2]=l}},{key:"addAfterPosition",value:function(t,e,n,r,a){var i=e[n+2],s=e[n+3],o=i-e[n],h=s-e[n+1],l=Math.atan2(h,o);r[a]=i+t*Math.cos(l),r[a+1]=s+t*Math.sin(l),r[a+2]=l}},{key:"addCurvePosition",value:function(t,e,n,r,a,i,s,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(a-n,r-e));var f=t*t,d=f*t,v=1-t,m=v*v,p=m*v,g=v*t,y=3*g,w=v*y,k=y*t,b=e*p+r*w+i*k+o*d,x=n*p+a*w+s*k+h*d;l[u]=b,l[u+1]=x,c&&(l[u+2]=t<.001?Math.atan2(a-n,r-e):Math.atan2(x-(n*m+a*g*2+s*f),b-(e*m+r*g*2+i*f)))}}]),t}();Se.NONE=-1,Se.BEFORE=-2,Se.AFTER=-3,Se.epsilon=1e-5;var Te=function(){function t(e,n){if(i(this,t),this.darkColor=null,this.attachment=null,this.attachmentState=0,this.sequenceIndex=-1,this.deform=new Array,!e)throw new Error("data cannot be null.");if(!n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new E,this.darkColor=e.darkColor?new E:null,this.setToSetupPose()}return o(t,[{key:"getSkeleton",value:function(){return this.bone.skeleton}},{key:"getAttachment",value:function(){return this.attachment}},{key:"setAttachment",value:function(t){this.attachment!=t&&(t instanceof N&&this.attachment instanceof N&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)}},{key:"setToSetupPose",value:function(){this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null}}]),t}(),Re=function(){function t(e,n){if(i(this,t),this.mixRotate=0,this.mixX=0,this.mixY=0,this.mixScaleX=0,this.mixScaleY=0,this.mixShearY=0,this.temp=new F,this.active=!1,!e)throw new Error("data cannot be null.");if(!n)throw new Error("skeleton cannot be null.");this.data=e,this.mixRotate=e.mixRotate,this.mixX=e.mixX,this.mixY=e.mixY,this.mixScaleX=e.mixScaleX,this.mixScaleY=e.mixScaleY,this.mixShearY=e.mixShearY,this.bones=new Array;for(var r=0;r0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=(T.x-y.worldX)*e,y.worldY+=(T.y-y.worldY)*n}if(0!=r){var R=Math.sqrt(y.a*y.a+y.c*y.c);0!=R&&(R=(R+(Math.sqrt(h*h+u*u)-R+this.data.offsetScaleX)*r)/R),y.a*=R,y.c*=R}if(0!=a){var C=Math.sqrt(y.b*y.b+y.d*y.d);0!=C&&(C=(C+(Math.sqrt(l*l+c*c)-C+this.data.offsetScaleY)*a)/C),y.b*=C,y.d*=C}if(i>0){var M=y.b,F=y.d,Y=Math.atan2(F,M),L=Math.atan2(c,l)-Math.atan2(u,h)-(Y-Math.atan2(y.c,y.a));L>I.PI?L-=I.PI2:L<-I.PI&&(L+=I.PI2),L=Y+(L+v)*i;var X=Math.sqrt(M*M+F*F);y.b=Math.cos(L)*X,y.d=Math.sin(L)*X}y.updateAppliedTransform()}}},{key:"applyRelativeWorld",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,a=this.mixScaleY,i=this.mixShearY,s=0!=e||0!=n,o=this.target,h=o.a,l=o.b,u=o.c,c=o.d,f=h*c-l*u>0?I.degRad:-I.degRad,d=this.data.offsetRotation*f,v=this.data.offsetShearY*f,m=this.bones,p=0,g=m.length;pI.PI?E-=I.PI2:E<-I.PI&&(E+=I.PI2),E*=t;var A=Math.cos(E),S=Math.sin(E);y.a=A*w-S*b,y.b=A*k-S*x,y.c=S*w+A*b,y.d=S*k+A*x}if(s){var T=this.temp;o.localToWorld(T.set(this.data.offsetX,this.data.offsetY)),y.worldX+=T.x*e,y.worldY+=T.y*n}if(0!=r){var R=(Math.sqrt(h*h+u*u)-1+this.data.offsetScaleX)*r+1;y.a*=R,y.c*=R}if(0!=a){var C=(Math.sqrt(l*l+c*c)-1+this.data.offsetScaleY)*a+1;y.b*=C,y.d*=C}if(i>0){var M=Math.atan2(c,l)-Math.atan2(u,h);M>I.PI?M-=I.PI2:M<-I.PI&&(M+=I.PI2);var F=y.b,Y=y.d;M=Math.atan2(Y,F)+(M-I.PI/2+v)*i;var L=Math.sqrt(F*F+Y*Y);y.b=Math.cos(M)*L,y.d=Math.sin(M)*L}y.updateAppliedTransform()}}},{key:"applyAbsoluteLocal",value:function(){for(var t=this.mixRotate,e=this.mixX,n=this.mixY,r=this.mixScaleX,a=this.mixScaleY,i=this.mixShearY,s=this.target,o=this.bones,h=0,l=o.length;h2&&void 0!==arguments[2]?arguments[2]:new Array(2);if(!t)throw new Error("offset cannot be null.");if(!e)throw new Error("size cannot be null.");for(var r=this.drawOrder,a=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=0,l=r.length;h0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;i(this,t),this.slotIndex=e,this.name=n,this.attachment=r})),Le=function(){function t(e){if(i(this,t),this.attachments=new Array,this.bones=Array(),this.constraints=new Array,!e)throw new Error("name cannot be null.");this.name=e}return o(t,[{key:"setAttachment",value:function(t,e,n){if(!n)throw new Error("attachment cannot be null.");var r=this.attachments;t>=r.length&&(r.length=t+1),r[t]||(r[t]={}),r[t][e]=n}},{key:"addSkin",value:function(t){for(var e=0;e= 0.");if(!n)throw new Error("name cannot be null.");if(!r)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=r}));!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(Me||(Me={}));var Ne,Pe=function(t){l(n,t);var e=d(n);function n(t){var r;return i(this,n),(r=e.call(this,t,0,!1)).bones=new Array,r._target=null,r.mixRotate=0,r.mixX=0,r.mixY=0,r.mixScaleX=0,r.mixScaleY=0,r.mixShearY=0,r.offsetRotation=0,r.offsetX=0,r.offsetY=0,r.offsetScaleX=0,r.offsetScaleY=0,r.offsetShearY=0,r.relative=!1,r.local=!1,r}return o(n,[{key:"target",get:function(){if(this._target)return this._target;throw new Error("BoneData not set.")},set:function(t){this._target=t}}]),n}(ye),_e=function(){function t(e){i(this,t),this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=e}return o(t,[{key:"readSkeletonData",value:function(t){var e=this.scale,n=new Fe;n.name="";var r=new Oe(t),a=r.readInt32(),i=r.readInt32();n.hash=0==i&&0==a?null:i.toString(16)+a.toString(16),n.version=r.readString(),n.x=r.readFloat(),n.y=r.readFloat(),n.width=r.readFloat(),n.height=r.readFloat();var s=r.readBoolean();s&&(n.fps=r.readFloat(),n.imagesPath=r.readString(),n.audioPath=r.readString());var o=0;o=r.readInt(!0);for(var h=0;h>4,t.readFloat())}r.push(br)}}var Ar=t.readInt(!0);if(Ar>0){for(var Sr=new Mt(Ar),Tr=n.slots.length,Rr=0;Rr=0;Yr--)Fr[Yr]=-1;for(var Lr=R.newArray(Tr-Mr,0),Xr=0,Nr=0,Pr=0;Pr=0;Or--)-1==Fr[Or]&&(Fr[Or]=Lr[--Nr]);Sr.setFrame(Rr,Cr,Fr)}r.push(Sr)}var Br=t.readInt(!0);if(Br>0){for(var Dr=new Ct(Br),Vr=0;Vr1&&void 0!==arguments[1]?arguments[1]:new Array,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new DataView(e.buffer);i(this,t),this.strings=n,this.index=r,this.buffer=a}return o(t,[{key:"readByte",value:function(){return this.buffer.getInt8(this.index++)}},{key:"readUnsignedByte",value:function(){return this.buffer.getUint8(this.index++)}},{key:"readShort",value:function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t}},{key:"readInt32",value:function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t}},{key:"readInt",value:function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)}},{key:"readStringRef",value:function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]}},{key:"readString",value:function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&r)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&r)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(r),n++}}return e}},{key:"readFloat",value:function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t}},{key:"readBoolean",value:function(){return 0!=this.readByte()}}]),t}(),Be=o((function t(e,n,r,a,s){i(this,t),this.mesh=e,this.skin=n,this.slotIndex=r,this.parent=a,this.inheritTimeline=s})),De=o((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i(this,t),this.bones=e,this.vertices=n}));function Ve(t,e,n){for(var r=t.readFloat(),a=t.readFloat()*n,i=0,s=0,o=e.getFrameCount()-1;e.setFrame(i,r,a),i!=o;i++){var h=t.readFloat(),l=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(i);break;case vn:qe(t,e,s++,i,0,r,h,a,l,n)}r=h,a=l}return e}function Ue(t,e,n){for(var r=t.readFloat(),a=t.readFloat()*n,i=t.readFloat()*n,s=0,o=0,h=e.getFrameCount()-1;e.setFrame(s,r,a,i),s!=h;s++){var l=t.readFloat(),u=t.readFloat()*n,c=t.readFloat()*n;switch(t.readByte()){case dn:e.setStepped(s);break;case vn:qe(t,e,o++,s,0,r,l,a,u,n),qe(t,e,o++,s,1,r,l,i,c,n)}r=l,a=u,i=c}return e}function qe(t,e,n,r,a,i,s,o,h,l){e.setBezier(n,r,a,i,o,t.readFloat(),t.readFloat()*l,t.readFloat(),t.readFloat()*l,s,h)}!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(Ne||(Ne={}));var We,je=0,Ge=1,ze=2,He=3,$e=4,Je=5,Ke=6,Qe=7,Ze=8,tn=9,en=0,nn=1,rn=2,an=3,sn=4,on=5,hn=0,ln=1,un=0,cn=1,fn=2,dn=1,vn=2,mn=function(){function t(){i(this,t),this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new M((function(){return R.newFloatArray(16)}))}return o(t,[{key:"update",value:function(t,e){if(!t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,r=this.polygons,a=this.polygonPool,i=t.slots,s=i.length;n.length=0,a.freeAll(r),r.length=0;for(var o=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY}},{key:"aabbIntersectsSegment",value:function(t,e,n,r){var a=this.minX,i=this.minY,s=this.maxX,o=this.maxY;if(t<=a&&n<=a||e<=i&&r<=i||t>=s&&n>=s||e>=o&&r>=o)return!1;var h=(r-e)/(n-t),l=h*(a-t)+e;if(l>i&&li&&la&&ua&&ut.minX&&this.minYt.minY}},{key:"containsPoint",value:function(t,e){for(var n=this.polygons,r=0,a=n.length;r=n||l=n){var u=r[o];u+(n-h)/(l-h)*(r[i]-u)=u&&w<=d||w>=d&&w<=u)&&(w>=e&&w<=r||w>=r&&w<=e)){var k=(l*g-h*m)/y;if((k>=c&&k<=v||k>=v&&k<=c)&&(k>=n&&k<=a||k>=a&&k<=n))return!0}u=d,c=v}return!1}},{key:"getPolygon",value:function(t){if(!t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]}},{key:"getWidth",value:function(){return this.maxX-this.minX}},{key:"getHeight",value:function(){return this.maxY-this.minY}}]),t}(),pn=function(){function t(){i(this,t),this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new M((function(){return new Array})),this.polygonIndicesPool=new M((function(){return new Array}))}return o(t,[{key:"triangulate",value:function(e){var n=e,r=e.length>>1,a=this.indicesArray;a.length=0;for(var i=0;i3;){for(var u=r-1,c=0,f=1;;){t:if(!s[c]){for(var d=a[u]<<1,v=a[c]<<1,m=a[f]<<1,p=n[d],g=n[d+1],y=n[v],w=n[v+1],k=n[m],b=n[m+1],x=(f+1)%r;x!=u;x=(x+1)%r)if(s[x]){var E=a[x]<<1,I=n[E],A=n[E+1];if(t.positiveArea(k,b,p,g,I,A)&&t.positiveArea(p,g,y,w,I,A)&&t.positiveArea(y,w,k,b,I,A))break t}break}if(0==f){do{if(!s[c])break;c--}while(c>0);break}u=c,c=f,f=(f+1)%r}l.push(a[(r+c-1)%r]),l.push(a[c]),l.push(a[(c+1)%r]),a.splice(c,1),s.splice(c,1);var S=(--r+c-1)%r,T=c==r?0:c;s[S]=t.isConcave(S,r,n,a),s[T]=t.isConcave(T,r,n,a)}return 3==r&&(l.push(a[2]),l.push(a[0]),l.push(a[1])),l}},{key:"decompose",value:function(e,n){var r=e,a=this.convexPolygons;this.polygonPool.freeAll(a),a.length=0;var i=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(i),i.length=0;var s=this.polygonIndicesPool.obtain();s.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=n.length;u0?(a.push(o),i.push(s)):(this.polygonPool.free(o),this.polygonIndicesPool.free(s)),(o=this.polygonPool.obtain()).length=0,o.push(m),o.push(p),o.push(g),o.push(y),o.push(w),o.push(k),(s=this.polygonIndicesPool.obtain()).length=0,s.push(f),s.push(d),s.push(v),l=t.winding(m,p,g,y,w,k),h=f)}o.length>0&&(a.push(o),i.push(s));for(var A=0,S=a.length;A=0;$--)0==(o=a[$]).length&&(a.splice($,1),this.polygonPool.free(o),s=i[$],i.splice($,1),this.polygonIndicesPool.free(s));return a}}],[{key:"isConcave",value:function(t,e,n,r){var a=r[(e+t-1)%e]<<1,i=r[t]<<1,s=r[(t+1)%e]<<1;return!this.positiveArea(n[a],n[a+1],n[i],n[i+1],n[s],n[s+1])}},{key:"positiveArea",value:function(t,e,n,r,a,i){return t*(i-r)+n*(e-i)+a*(r-e)>=0}},{key:"winding",value:function(t,e,n,r,a,i){var s=n-t,o=r-e;return a*o-i*s+s*e-t*o>=0?1:-1}}]),t}(),gn=function(){function t(){i(this,t),this.triangulator=new pn,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array,this.clipAttachment=null,this.clippingPolygons=null}return o(t,[{key:"clipStart",value:function(e,n){if(this.clipAttachment)return 0;this.clipAttachment=n;var r=n.worldVerticesLength,a=R.setArraySize(this.clippingPolygon,r);n.computeWorldVertices(e,0,r,a,0,2);var i=this.clippingPolygon;t.makeClockwise(i);for(var s=this.clippingPolygons=this.triangulator.decompose(i,this.triangulator.triangulate(i)),o=0,h=s.length;o>1,V=this.clipOutput,U=R.setArraySize(l,F+D*d),q=0;q=2?(h=o,o=this.scratch):h=this.scratch,h.length=0,h.push(t),h.push(e),h.push(n),h.push(r),h.push(a),h.push(i),h.push(t),h.push(e),o.length=0;for(var c=s,f=s.length-4,d=0;;d+=2){for(var v=c[d],m=c[d+1],p=c[d+2],g=c[d+3],y=v-p,w=m-g,k=h,b=h.length-2,x=o.length,E=0;E0;if(y*(A-g)-w*(I-p)>0){if(R){o.push(S),o.push(T);continue}var C=T-A,M=S-I,F=C*(p-v)-M*(g-m);if(Math.abs(F)>1e-6){var Y=(M*(m-A)-C*(v-I))/F;o.push(v+(p-v)*Y),o.push(m+(g-m)*Y)}else o.push(v),o.push(m)}else if(R){var L=T-A,X=S-I,N=L*(p-v)-X*(g-m);if(Math.abs(N)>1e-6){var P=(X*(m-A)-L*(v-I))/N;o.push(v+(p-v)*P),o.push(m+(g-m)*P)}else o.push(v),o.push(m);o.push(S),o.push(T)}u=!0}if(x==o.length)return l.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var _=o;(o=h).length=0,h=_}if(l!=o){l.length=0;for(var O=0,B=o.length-2;O>1;l=0;lr--)-1==tr[lr]&&(tr[lr]=nr[--ar])}$n.setFrame(Kn,En(Zn,"time",0),tr)}a.push($n)}if(t.events){for(var ur=new Ct(t.events.length),cr=0,fr=0;fr)?=?)"),d("XRANGEIDENTIFIERLOOSE","".concat(h[l.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),d("XRANGEIDENTIFIER","".concat(h[l.NUMERICIDENTIFIER],"|x|X|\\*")),d("XRANGEPLAIN","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIER],")")+"(?:".concat(h[l.PRERELEASE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGEPLAINLOOSE","[v=\\s]*(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(h[l.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(h[l.PRERELEASELOOSE],")?").concat(h[l.BUILD],"?")+")?)?"),d("XRANGE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAIN],"$")),d("XRANGELOOSE","^".concat(h[l.GTLT],"\\s*").concat(h[l.XRANGEPLAINLOOSE],"$")),d("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),d("COERCERTL",h[l.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM","(\\s*)".concat(h[l.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",d("TILDE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAIN],"$")),d("TILDELOOSE","^".concat(h[l.LONETILDE]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("LONECARET","(?:\\^)"),d("CARETTRIM","(\\s*)".concat(h[l.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",d("CARET","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAIN],"$")),d("CARETLOOSE","^".concat(h[l.LONECARET]).concat(h[l.XRANGEPLAINLOOSE],"$")),d("COMPARATORLOOSE","^".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],")$|^$")),d("COMPARATOR","^".concat(h[l.GTLT],"\\s*(").concat(h[l.FULLPLAIN],")$|^$")),d("COMPARATORTRIM","(\\s*)".concat(h[l.GTLT],"\\s*(").concat(h[l.LOOSEPLAIN],"|").concat(h[l.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE","^\\s*(".concat(h[l.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAIN],")")+"\\s*$"),d("HYPHENRANGELOOSE","^\\s*(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(h[l.XRANGEPLAINLOOSE],")")+"\\s*$"),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ln,Ln.exports);var Xn=Ln.exports;Rn(Xn);var Nn=Object.freeze({loose:!0}),Pn=Object.freeze({}),_n=function(t){return t?"object"!==a(t)?Nn:t:Pn};Rn(_n);var On=/^[0-9]+$/,Bn=function(t,e){var n=On.test(t),r=On.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tUn)throw new TypeError("version is longer than ".concat(Un," characters"));Vn("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var r=e.trim().match(n.loose?Wn[jn.LOOSE]:Wn[jn.FULL]);if(!r)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>qn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>qn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>qn||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[a]&&(this.prerelease[a]++,a=-2);if(-1===a){if(e===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(e){var i=[e,r];!1===n&&(i=[e]),0===zn(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break;default:throw new Error("invalid increment argument: ".concat(t))}return this.raw=this.format(),this.build.length&&(this.raw+="+".concat(this.build.join("."))),this}}]),t}(),$n=Hn;Rn($n);var Jn=$n,Kn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t instanceof Jn)return t;try{return new Jn(t,e)}catch(t){if(!n)return null;throw t}};Rn(Kn);var Qn,Zn,tr=Kn,er=Rn((function(t,e){var n=tr(t,e);return n?n.version:null})),nr=$n,rr=Kn,ar=Xn.safeRe,ir=Xn.t,sr=Rn((function(t,e){if(t instanceof nr)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var r;(r=ar[ir.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),ar[ir.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;ar[ir.COERCERTL].lastIndex=-1}else n=t.match(ar[ir.COERCE]);return null===n?null:rr("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}));var or=hr;function hr(t){var e=this;if(e instanceof hr||(e=new hr),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var a=0;null!==r;a++)n=t(n,r.value,a),r=r.next;return n},hr.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==r;a--)n=t(n,r.value,a),r=r.prev;return n},hr.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},hr.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},hr.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new hr;if(ethis.length&&(e=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(e=this.length);for(var r=this.length,a=this.tail;null!==a&&r>e;r--)a=a.prev;for(;null!==a&&r>t;r--,a=a.prev)n.push(a.value);return n},hr.prototype.splice=function(t,e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,r=this.head;null!==r&&nthis[vr])return Cr(this,this[xr].get(t)),!1;var i=this[xr].get(t).value;return this[wr]&&(this[kr]||this[wr](t,i.value)),i.now=r,i.maxAge=n,i.value=e,this[mr]+=a-i.length,i.length=a,this.get(t),Rr(this),!0}var s=new Mr(t,e,a,r,n);return s.length>this[vr]?(this[wr]&&this[wr](t,e),!1):(this[mr]+=s.length,this[br].unshift(s),this[xr].set(t,this[br].head),Rr(this),!0)}},{key:"has",value:function(t){if(!this[xr].has(t))return!1;var e=this[xr].get(t).value;return!Tr(this,e)}},{key:"get",value:function(t){return Sr(this,t,!0)}},{key:"peek",value:function(t){return Sr(this,t,!1)}},{key:"pop",value:function(){var t=this[br].tail;return t?(Cr(this,t),t.value):null}},{key:"del",value:function(t){Cr(this,this[xr].get(t))}},{key:"load",value:function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],a=r.e||0;if(0===a)this.set(r.k,r.v);else{var i=a-e;i>0&&this.set(r.k,r.v,i)}}}},{key:"prune",value:function(){var t=this;this[xr].forEach((function(e,n){return Sr(t,n,!1)}))}}]),t}(),Sr=function(t,e,n){var r=t[xr].get(e);if(r){var a=r.value;if(Tr(t,a)){if(Cr(t,r),!t[gr])return}else n&&(t[Er]&&(r.value.now=Date.now()),t[br].unshiftNode(r));return a.value}},Tr=function(t,e){if(!e||!e.maxAge&&!t[yr])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[yr]&&n>t[yr]},Rr=function(t){if(t[mr]>t[vr])for(var e=t[br].tail;t[mr]>t[vr]&&null!==e;){var n=e.prev;Cr(t,e),e=n}},Cr=function(t,e){if(e){var n=e.value;t[wr]&&t[wr](n.key,n.value),t[mr]-=n.length,t[xr].delete(n.key),t[br].removeNode(e)}},Mr=o((function t(e,n,r,a,s){i(this,t),this.key=e,this.value=n,this.length=r,this.now=a,this.maxAge=s||0})),Fr=function(t,e,n,r){var a=n.value;Tr(t,a)&&(Cr(t,n),t[gr]||(a=void 0)),a&&e.call(r,a.value,a.key,t)},Yr=Ar;Rn(Yr);var Lr=$n,Xr=function(t,e,n){return new Lr(t,n).compare(new Lr(e,n))};Rn(Xr);var Nr=Xr,Pr=function(t,e,n){return 0===Nr(t,e,n)};Rn(Pr);var _r=Xr,Or=function(t,e,n){return 0!==_r(t,e,n)};Rn(Or);var Br=Xr,Dr=function(t,e,n){return Br(t,e,n)>0};Rn(Dr);var Vr=Xr,Ur=function(t,e,n){return Vr(t,e,n)>=0};Rn(Ur);var qr=Xr,Wr=function(t,e,n){return qr(t,e,n)<0};Rn(Wr);var jr=Xr,Gr=function(t,e,n){return jr(t,e,n)<=0};Rn(Gr);var zr,Hr,$r,Jr,Kr=Pr,Qr=Or,Zr=Dr,ta=Ur,ea=Wr,na=Gr,ra=function(t,e,n,r){switch(e){case"===":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t===n;case"!==":return"object"===a(t)&&(t=t.version),"object"===a(n)&&(n=n.version),t!==n;case"":case"=":case"==":return Kr(t,n,r);case"!=":return Qr(t,n,r);case">":return Zr(t,n,r);case">=":return ta(t,n,r);case"<":return ea(t,n,r);case"<=":return na(t,n,r);default:throw new TypeError("Invalid operator: ".concat(e))}};function aa(){if(Jr)return $r;Jr=1;var t=function(){function t(e,a){var s=this;if(i(this,t),a=n(a),e instanceof t)return e.loose===!!a.loose&&e.includePrerelease===!!a.includePrerelease?e:new t(e.raw,a);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(t){return s.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(this.raw));if(this.set.length>1){var o=this.set[0];if(this.set=this.set.filter((function(t){return!m(t[0])})),0===this.set.length)this.set=[o];else if(this.set.length>1){var h,l=w(this.set);try{for(l.s();!(h=l.n()).done;){var u=h.value;if(1===u.length&&g(u[0])){this.set=[u];break}}}catch(t){l.e(t)}finally{l.f()}}}this.format()}return o(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var n=this,i=((this.options.includePrerelease&&d)|(this.options.loose&&v))+":"+t,s=e.get(i);if(s)return s;var o=this.options.loose,g=o?h[l.HYPHENRANGELOOSE]:h[l.HYPHENRANGE];t=t.replace(g,M(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(h[l.COMPARATORTRIM],u),a("comparator trim",t),t=t.replace(h[l.TILDETRIM],c),a("tilde trim",t),t=t.replace(h[l.CARETTRIM],f),a("caret trim",t);var y=t.split(" ").map((function(t){return k(t,n.options)})).join(" ").split(/\s+/).map((function(t){return C(t,n.options)}));o&&(y=y.filter((function(t){return a("loose invalid filter",t,n.options),!!t.match(h[l.COMPARATORLOOSE])}))),a("range list",y);var b,x=new Map,E=y.map((function(t){return new r(t,n.options)})),I=w(E);try{for(I.s();!(b=I.n()).done;){var A=b.value;if(m(A))return[A];x.set(A.value,A)}}catch(t){I.e(t)}finally{I.f()}x.size>1&&x.has("")&&x.delete("");var S=p(x.values());return e.set(i,S),S}},{key:"intersects",value:function(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((function(t){return y(t,n)&&e.set.some((function(e){return y(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new s(t,this.options)}catch(t){return!1}for(var e=0;e")||!t.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!t.operator.startsWith("<"))&&(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))&&!(s(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))&&!(s(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}],[{key:"ANY",get:function(){return t}}]),e}();zr=e;var n=_n,r=Xn.safeRe,a=Xn.t,s=ra,h=Yn,l=$n,u=aa();return zr}(),a=Yn,s=$n,h=Xn.safeRe,l=Xn.t,u=Xn.comparatorTrimReplace,c=Xn.tildeTrimReplace,f=Xn.caretTrimReplace,d=Cn.FLAG_INCLUDE_PRERELEASE,v=Cn.FLAG_LOOSE,m=function(t){return"<0.0.0-0"===t.value},g=function(t){return""===t.value},y=function(t,e){for(var n=!0,r=t.slice(),a=r.pop();n&&r.length;)n=r.every((function(t){return a.intersects(t,e)})),a=r.pop();return n},k=function(t,e){return a("comp",t,e),t=I(t,e),a("caret",t),t=x(t,e),a("tildes",t),t=S(t,e),a("xrange",t),t=R(t,e),a("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},x=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){var n=e.loose?h[l.TILDELOOSE]:h[l.TILDE];return t.replace(n,(function(e,n,r,i,s){var o;return a("tilde",t,e,n,r,i,s),b(n)?o="":b(r)?o=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(i)?o=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):s?(a("replaceTilde pr",s),o=">=".concat(n,".").concat(r,".").concat(i,"-").concat(s," <").concat(n,".").concat(+r+1,".0-0")):o=">=".concat(n,".").concat(r,".").concat(i," <").concat(n,".").concat(+r+1,".0-0"),a("tilde return",o),o}))},I=function(t,e){return t.trim().split(/\s+/).map((function(t){return A(t,e)})).join(" ")},A=function(t,e){a("caret",t,e);var n=e.loose?h[l.CARETLOOSE]:h[l.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,i,s,o){var h;return a("caret",t,e,n,i,s,o),b(n)?h="":b(i)?h=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):b(s)?h="0"===n?">=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):o?(a("replaceCaret pr",o),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s,"-").concat(o," <").concat(+n+1,".0.0-0")):(a("no pr"),h="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(i,".").concat(+s+1,"-0"):">=".concat(n,".").concat(i,".").concat(s).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(s," <").concat(+n+1,".0.0-0")),a("caret return",h),h}))},S=function(t,e){return a("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return T(t,e)})).join(" ")},T=function(t,e){t=t.trim();var n=e.loose?h[l.XRANGELOOSE]:h[l.XRANGE];return t.replace(n,(function(n,r,i,s,o,h){a("xRange",t,n,r,i,s,o,h);var l=b(i),u=l||b(s),c=u||b(o),f=c;return"="===r&&f&&(r=""),h=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(s=0),o=0,">"===r?(r=">=",u?(i=+i+1,s=0,o=0):(s=+s+1,o=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),"<"===r&&(h="-0"),n="".concat(r+i,".").concat(s,".").concat(o).concat(h)):u?n=">=".concat(i,".0.0").concat(h," <").concat(+i+1,".0.0-0"):c&&(n=">=".concat(i,".").concat(s,".0").concat(h," <").concat(i,".").concat(+s+1,".0-0")),a("xRange return",n),n}))},R=function(t,e){return a("replaceStars",t,e),t.trim().replace(h[l.STAR],"")},C=function(t,e){return a("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?l.GTE0PRE:l.GTE0],"")},M=function(t){return function(e,n,r,a,i,s,o,h,l,u,c,f,d){return n=b(r)?"":b(a)?">=".concat(r,".0.0").concat(t?"-0":""):b(i)?">=".concat(r,".").concat(a,".0").concat(t?"-0":""):s?">=".concat(n):">=".concat(n).concat(t?"-0":""),h=b(l)?"":b(u)?"<".concat(+l+1,".0.0-0"):b(c)?"<".concat(l,".").concat(+u+1,".0-0"):f?"<=".concat(l,".").concat(u,".").concat(c,"-").concat(f):t?"<".concat(l,".").concat(u,".").concat(+c+1,"-0"):"<=".concat(h),"".concat(n," ").concat(h).trim()}},F=function(t,e,n){for(var i=0;i0){var o=t[s].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0};return $r}Rn(ra);var ia,sa,oa=aa(),ha=function(t,e,n){try{e=new oa(e,n)}catch(t){return!1}return e.test(t)},la={valid:er,coerce:sr,satisfies:Rn(ha),SEMVER_SPEC_VERSION:Mn.SEMVER_SPEC_VERSION},ua=0,ca=1,fa=2,da=[0,1,2,2,3,0],va=function(){function t(e,r,a,s){var o;if(i(this,t),h(this,"autoUpdate",!0),h(this,"skeleton",void 0),h(this,"states",void 0),this._app=e,this._position=new n.Vec3,1===re.length){var l,u=w((o=new re(r)).pages);try{for(u.s();!(l=u.n()).done;){var c=l.value;c.setTexture(new Tn(s[c.name]))}}catch(t){u.e(t)}finally{u.f()}}else o=new re(r,(function(t){return new Tn(s[t])}));var f=new yn(new fe(o));f.scale*=.01;var d=f.readSkeletonData(a);this.skeletonVersion=la.valid(la.coerce(d.version)),this._spine_3_6_0=la.satisfies(this.skeletonVersion,"<=3.6.0"),this._spine_3_7_99=la.satisfies(this.skeletonVersion,"<=3.7.99"),this._spine_4_0_X=la.satisfies(this.skeletonVersion,"~4.0.0"),this._spine_4_1_X=la.satisfies(this.skeletonVersion,"~4.1.23"),this.skeleton=new Ce(d),this.skeleton.updateWorldTransform(),this.stateData=new Kt(this.skeleton.data),this.states=[new _t(this.stateData)],this.clipper=new gn,this._node=new n.GraphNode,this._meshes=[],this._meshInstances=[],this._materials={},this._tint={},this._aabb=new n.BoundingBox,this._aabbTempArray=[],this._aabbTempOffset=new n.Vec2,this._aabbTempSize=new n.Vec2,this._renderCounts={vertexCount:0,indexCount:0},this._vertexFormat=null,this._vertexBuffer=null,this._indexBuffer=null,this._priority=0,this._timeScale=1,this._layers=[n.LAYERID_UI],this.init(),this._hidden=!1}return o(t,[{key:"destroy",value:function(){this.removeFromLayers();for(var t=0;t0&&this._renderCounts.vertexCount>0){this.skeleton.getBounds(this._aabbTempOffset,this._aabbTempSize,this._aabbTempArray),this._aabb.center=new n.Vec3(this._aabbTempOffset.x,this._aabbTempOffset.y,0),this._aabb.halfExtents=new n.Vec3(.5*this._aabbTempSize.x,.5*this._aabbTempSize.y,0),(!this._vertexBuffer||this._vertexBuffer.getNumVertices()0&&c.indices.length>0){t&&t!==c.material&&(this.SubmitBatch(e,r,t),t=c.material,e=s,r=0),t=c.material;var f=c.positions,d=c.vertexColor.r,v=c.vertexColor.g,m=c.vertexColor.b,p=c.vertexColor.a,g=c.uvs,y=void 0,w=f.length/2;for(y=0;y0){var a=new n.Mesh(this._app.graphicsDevice);a.vertexBuffer=this._vertexBuffer,a.indexBuffer[0]=this._indexBuffer,a.primitive[0].type=n.PRIMITIVE_TRIANGLES,a.primitive[0].base=t,a.primitive[0].count=e,a.primitive[0].indexed=!0,a.aabb=this._aabb,this._meshes.push(a);var i=new n.MeshInstance(a,this._materials[r],this._node);i.drawOrder=this.priority+this._meshInstances.length,i.visible=!this._hidden,this._meshInstances.push(i)}}},{key:"update",value:function(t){if(!this._hidden){var e;t*=this._timeScale;var n=this.states.length;for(e=0;e