dragonbones-runtime
Version:
the tools to build dragonbones file for diffrent framework
1 lines • 223 kB
JavaScript
"use strict";var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)if(e.hasOwnProperty(i))t[i]=e[i]};return function(e,i){t(e,i);function r(){this.constructor=e}e.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}();var dragonBones;(function(t){})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(i){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=i;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://www.dragonbones.com/\nSource: http://www.github.com/dragonbones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var i=0,r=this._objects;i<r.length;i++){var a=r[i];a.returnToPool()}this._objects.length=0}this._clock.advanceTime(e);if(this._events.length>0){for(var n=0;n<this._events.length;++n){var s=this._events[n];var o=s.armature;if(o._armatureData!==null){o.eventDispatcher.dispatchDBEvent(s.type,s);if(s.type===t.EventObject.SOUND_EVENT){this._eventManager.dispatchDBEvent(s.type,s)}}this.bufferObject(s)}this._events.length=0}};e.prototype.bufferEvent=function(t){if(this._events.indexOf(t)<0){this._events.push(t)}};e.prototype.bufferObject=function(t){if(this._objects.indexOf(t)<0){this._objects.push(t)}};Object.defineProperty(e.prototype,"clock",{get:function(){return this._clock},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"eventManager",{get:function(){return this._eventManager},enumerable:true,configurable:true});e.VERSION="5.6.1";e.yDown=true;e.debug=false;e.debugDraw=false;e.webAssembly=false;return e}();t.DragonBones=e;if(!console.warn){console.warn=function(){}}if(!console.assert){console.assert=function(){}}})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(){this.hashCode=t._hashCode++;this._isInPool=false}t._returnObject=function(e){var i=String(e.constructor);var r=i in t._maxCountMap?t._maxCountMap[i]:t._defaultMaxCount;var a=t._poolsMap[i]=t._poolsMap[i]||[];if(a.length<r){if(!e._isInPool){e._isInPool=true;a.push(e)}else{console.warn("The object is already in the pool.")}}else{}};t.toString=function(){throw new Error};t.setMaxCount=function(e,i){if(i<0||i!==i){i=0}if(e!==null){var r=String(e);var a=r in t._poolsMap?t._poolsMap[r]:null;if(a!==null&&a.length>i){a.length=i}t._maxCountMap[r]=i}else{t._defaultMaxCount=i;for(var r in t._poolsMap){var a=t._poolsMap[r];if(a.length>i){a.length=i}if(r in t._maxCountMap){t._maxCountMap[r]=i}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var i=String(e);var r=i in t._poolsMap?t._poolsMap[i]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var a in t._poolsMap){var r=t._poolsMap[a];r.length=0}}};t.borrowObject=function(e){var i=String(e);var r=i in t._poolsMap?t._poolsMap[i]:null;if(r!==null&&r.length>0){var a=r.pop();a._isInPool=false;return a}var n=new e;n._onClear();return n};t.prototype.returnToPool=function(){this._onClear();t._returnObject(this)};t._hashCode=0;t._defaultMaxCount=3e3;t._maxCountMap={};t._poolsMap={};return t}();t.BaseObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,i,r,a,n){if(t===void 0){t=1}if(e===void 0){e=0}if(i===void 0){i=0}if(r===void 0){r=1}if(a===void 0){a=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=i;this.d=r;this.tx=a;this.ty=n}t.prototype.toString=function(){return"[object dragonBones.Matrix] a:"+this.a+" b:"+this.b+" c:"+this.c+" d:"+this.d+" tx:"+this.tx+" ty:"+this.ty};t.prototype.copyFrom=function(t){this.a=t.a;this.b=t.b;this.c=t.c;this.d=t.d;this.tx=t.tx;this.ty=t.ty;return this};t.prototype.copyFromArray=function(t,e){if(e===void 0){e=0}this.a=t[e];this.b=t[e+1];this.c=t[e+2];this.d=t[e+3];this.tx=t[e+4];this.ty=t[e+5];return this};t.prototype.identity=function(){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this};t.prototype.concat=function(t){var e=this.a*t.a;var i=0;var r=0;var a=this.d*t.d;var n=this.tx*t.a+t.tx;var s=this.ty*t.d+t.ty;if(this.b!==0||this.c!==0){e+=this.b*t.c;i+=this.b*t.d;r+=this.c*t.a;a+=this.c*t.b}if(t.b!==0||t.c!==0){i+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=i;this.c=r;this.d=a;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var i=this.c;var r=this.d;var a=this.tx;var n=this.ty;if(e===0&&i===0){this.b=this.c=0;if(t===0||r===0){this.a=this.b=this.tx=this.ty=0}else{t=this.a=1/t;r=this.d=1/r;this.tx=-t*a;this.ty=-r*n}return this}var s=t*r-e*i;if(s===0){this.a=this.d=1;this.b=this.c=0;this.tx=this.ty=0;return this}s=1/s;var o=this.a=r*s;e=this.b=-e*s;i=this.c=-i*s;r=this.d=t*s;this.tx=-(o*a+i*n);this.ty=-(e*a+r*n);return this};t.prototype.transformPoint=function(t,e,i,r){if(r===void 0){r=false}i.x=this.a*t+this.c*e;i.y=this.b*t+this.d*e;if(!r){i.x+=this.tx;i.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var i=this.a;var r=this.b;var a=this.c;var n=this.d;var s=e?0:this.tx;var o=e?0:this.ty;var l=t.x;var h=t.y;var u=l+t.width;var f=h+t.height;var _=i*l+a*h+s;var c=r*l+n*h+o;var p=i*u+a*h+s;var m=r*u+n*h+o;var d=i*u+a*f+s;var y=r*u+n*f+o;var g=i*l+a*f+s;var v=r*l+n*f+o;var b=0;if(_>p){b=_;_=p;p=b}if(d>g){b=d;d=g;g=b}t.x=Math.floor(_<d?_:d);t.width=Math.ceil((p>g?p:g)-t.x);if(c>m){b=c;c=m;m=b}if(y>v){b=y;y=v;v=b}t.y=Math.floor(c<y?c:y);t.height=Math.ceil((m>v?m:v)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,i,r,a,n){if(t===void 0){t=0}if(e===void 0){e=0}if(i===void 0){i=0}if(r===void 0){r=0}if(a===void 0){a=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=i;this.rotation=r;this.scaleX=a;this.scaleY=n}t.normalizeRadian=function(t){t=(t+Math.PI)%(Math.PI*2);t+=t>0?-Math.PI:Math.PI;return t};t.prototype.toString=function(){return"[object dragonBones.Transform] x:"+this.x+" y:"+this.y+" skewX:"+this.skew*180/Math.PI+" skewY:"+this.rotation*180/Math.PI+" scaleX:"+this.scaleX+" scaleY:"+this.scaleY};t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.skew=t.skew;this.rotation=t.rotation;this.scaleX=t.scaleX;this.scaleY=t.scaleY;return this};t.prototype.identity=function(){this.x=this.y=0;this.skew=this.rotation=0;this.scaleX=this.scaleY=1;return this};t.prototype.add=function(t){this.x+=t.x;this.y+=t.y;this.skew+=t.skew;this.rotation+=t.rotation;this.scaleX*=t.scaleX;this.scaleY*=t.scaleY;return this};t.prototype.minus=function(t){this.x-=t.x;this.y-=t.y;this.skew-=t.skew;this.rotation-=t.rotation;this.scaleX/=t.scaleX;this.scaleY/=t.scaleY;return this};t.prototype.fromMatrix=function(e){var i=this.scaleX,r=this.scaleY;var a=t.PI_Q;this.x=e.tx;this.y=e.ty;this.rotation=Math.atan(e.b/e.a);var n=Math.atan(-e.c/e.d);this.scaleX=this.rotation>-a&&this.rotation<a?e.a/Math.cos(this.rotation):e.b/Math.sin(this.rotation);this.scaleY=n>-a&&n<a?e.d/Math.cos(n):-e.c/Math.sin(n);if(i>=0&&this.scaleX<0){this.scaleX=-this.scaleX;this.rotation=this.rotation-Math.PI}if(r>=0&&this.scaleY<0){this.scaleY=-this.scaleY;n=n-Math.PI}this.skew=n-this.rotation;return this};t.prototype.toMatrix=function(t){if(this.skew!==0||this.rotation!==0){t.a=Math.cos(this.rotation);t.b=Math.sin(this.rotation);if(this.skew===0){t.c=-t.b;t.d=t.a}else{t.c=-Math.sin(this.skew+this.rotation);t.d=Math.cos(this.skew+this.rotation)}if(this.scaleX!==1){t.a*=this.scaleX;t.b*=this.scaleX}if(this.scaleY!==1){t.c*=this.scaleY;t.d*=this.scaleY}}else{t.a=this.scaleX;t.b=0;t.c=0;t.d=this.scaleY}t.tx=this.x;t.ty=this.y;return this};t.PI_D=Math.PI*2;t.PI_H=Math.PI/2;t.PI_Q=Math.PI/4;t.RAD_DEG=180/Math.PI;t.DEG_RAD=Math.PI/180;return t}();t.Transform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,i,r,a,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(i===void 0){i=1}if(r===void 0){r=1}if(a===void 0){a=0}if(n===void 0){n=0}if(s===void 0){s=0}if(o===void 0){o=0}this.alphaMultiplier=t;this.redMultiplier=e;this.greenMultiplier=i;this.blueMultiplier=r;this.alphaOffset=a;this.redOffset=n;this.greenOffset=s;this.blueOffset=o}t.prototype.copyFrom=function(t){this.alphaMultiplier=t.alphaMultiplier;this.redMultiplier=t.redMultiplier;this.greenMultiplier=t.greenMultiplier;this.blueMultiplier=t.blueMultiplier;this.alphaOffset=t.alphaOffset;this.redOffset=t.redOffset;this.greenOffset=t.greenOffset;this.blueOffset=t.blueOffset};t.prototype.identity=function(){this.alphaMultiplier=this.redMultiplier=this.greenMultiplier=this.blueMultiplier=1;this.alphaOffset=this.redOffset=this.greenOffset=this.blueOffset=0};return t}();t.ColorTransform=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e){if(t===void 0){t=0}if(e===void 0){e=0}this.x=t;this.y=e}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y};t.prototype.clear=function(){this.x=this.y=0};return t}();t.Point=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,i,r){if(t===void 0){t=0}if(e===void 0){e=0}if(i===void 0){i=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=i;this.height=r}t.prototype.copyFrom=function(t){this.x=t.x;this.y=t.y;this.width=t.width;this.height=t.height};t.prototype.clear=function(){this.x=this.y=0;this.width=this.height=0};return t}();t.Rectangle=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ints=[];e.floats=[];e.strings=[];return e}e.toString=function(){return"[class dragonBones.UserData]"};e.prototype._onClear=function(){this.ints.length=0;this.floats.length=0;this.strings.length=0};e.prototype.addInt=function(t){this.ints.push(t)};e.prototype.addFloat=function(t){this.floats.push(t)};e.prototype.addString=function(t){this.strings.push(t)};e.prototype.getInt=function(t){if(t===void 0){t=0}return t>=0&&t<this.ints.length?this.ints[t]:0};e.prototype.getFloat=function(t){if(t===void 0){t=0}return t>=0&&t<this.floats.length?this.floats[t]:0};e.prototype.getString=function(t){if(t===void 0){t=0}return t>=0&&t<this.strings.length?this.strings[t]:""};return e}(t.BaseObject);t.UserData=e;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.data=null;return e}e.toString=function(){return"[class dragonBones.ActionData]"};e.prototype._onClear=function(){if(this.data!==null){this.data.returnToPool()}this.type=0;this.name="";this.bone=null;this.slot=null;this.data=null};return e}(t.BaseObject);t.ActionData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.frameIndices=[];e.cachedFrames=[];e.armatureNames=[];e.armatures={};e.userData=null;return e}e.toString=function(){return"[class dragonBones.DragonBonesData]"};e.prototype._onClear=function(){for(var t in this.armatures){this.armatures[t].returnToPool();delete this.armatures[t]}if(this.userData!==null){this.userData.returnToPool()}this.autoSearch=false;this.frameRate=0;this.version="";this.name="";this.stage=null;this.frameIndices.length=0;this.cachedFrames.length=0;this.armatureNames.length=0;this.binary=null;this.intArray=null;this.floatArray=null;this.frameIntArray=null;this.frameFloatArray=null;this.frameArray=null;this.timelineArray=null;this.userData=null};e.prototype.addArmature=function(t){if(t.name in this.armatures){console.warn("Same armature: "+t.name);return}t.parent=this;this.armatures[t.name]=t;this.armatureNames.push(t.name)};e.prototype.getArmature=function(t){return t in this.armatures?this.armatures[t]:null};e.prototype.dispose=function(){console.warn("已废弃");this.returnToPool()};return e}(t.BaseObject);t.DragonBonesData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.aabb=new t.Rectangle;i.animationNames=[];i.sortedBones=[];i.sortedSlots=[];i.defaultActions=[];i.actions=[];i.bones={};i.slots={};i.constraints={};i.skins={};i.animations={};i.canvas=null;i.userData=null;return i}i.toString=function(){return"[class dragonBones.ArmatureData]"};i.prototype._onClear=function(){for(var t=0,e=this.defaultActions;t<e.length;t++){var i=e[t];i.returnToPool()}for(var r=0,a=this.actions;r<a.length;r++){var i=a[r];i.returnToPool()}for(var n in this.bones){this.bones[n].returnToPool();delete this.bones[n]}for(var n in this.slots){this.slots[n].returnToPool();delete this.slots[n]}for(var n in this.constraints){this.constraints[n].returnToPool();delete this.constraints[n]}for(var n in this.skins){this.skins[n].returnToPool();delete this.skins[n]}for(var n in this.animations){this.animations[n].returnToPool();delete this.animations[n]}if(this.canvas!==null){this.canvas.returnToPool()}if(this.userData!==null){this.userData.returnToPool()}this.type=0;this.frameRate=0;this.cacheFrameRate=0;this.scale=1;this.name="";this.aabb.clear();this.animationNames.length=0;this.sortedBones.length=0;this.sortedSlots.length=0;this.defaultActions.length=0;this.actions.length=0;this.defaultSkin=null;this.defaultAnimation=null;this.canvas=null;this.userData=null;this.parent=null};i.prototype.sortBones=function(){var t=this.sortedBones.length;if(t<=0){return}var e=this.sortedBones.concat();var i=0;var r=0;this.sortedBones.length=0;while(r<t){var a=e[i++];if(i>=t){i=0}if(this.sortedBones.indexOf(a)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===a&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(a.parent!==null&&this.sortedBones.indexOf(a.parent)<0){continue}this.sortedBones.push(a);r++}};i.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};i.prototype.setCacheFrame=function(t,e){var i=this.parent.cachedFrames;var r=i.length;i.length+=10;i[r]=t.a;i[r+1]=t.b;i[r+2]=t.c;i[r+3]=t.d;i[r+4]=t.tx;i[r+5]=t.ty;i[r+6]=e.rotation;i[r+7]=e.skew;i[r+8]=e.scaleX;i[r+9]=e.scaleY;return r};i.prototype.getCacheFrame=function(t,e,i){var r=this.parent.cachedFrames;t.a=r[i];t.b=r[i+1];t.c=r[i+2];t.d=r[i+3];t.tx=r[i+4];t.ty=r[i+5];e.rotation=r[i+6];e.skew=r[i+7];e.scaleX=r[i+8];e.scaleY=r[i+9];e.x=t.tx;e.y=t.ty};i.prototype.addBone=function(t){if(t.name in this.bones){console.warn("Same bone: "+t.name);return}this.bones[t.name]=t;this.sortedBones.push(t)};i.prototype.addSlot=function(t){if(t.name in this.slots){console.warn("Same slot: "+t.name);return}this.slots[t.name]=t;this.sortedSlots.push(t)};i.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};i.prototype.addSkin=function(t){if(t.name in this.skins){console.warn("Same skin: "+t.name);return}t.parent=this;this.skins[t.name]=t;if(this.defaultSkin===null){this.defaultSkin=t}if(t.name==="default"){this.defaultSkin=t}};i.prototype.addAnimation=function(t){if(t.name in this.animations){console.warn("Same animation: "+t.name);return}t.parent=this;this.animations[t.name]=t;this.animationNames.push(t.name);if(this.defaultAnimation===null){this.defaultAnimation=t}};i.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};i.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};i.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};i.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};i.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};i.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return i}(t.BaseObject);t.ArmatureData=e;var i=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.transform=new t.Transform;i.userData=null;return i}i.toString=function(){return"[class dragonBones.BoneData]"};i.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.length=0;this.name="";this.transform.identity();this.userData=null;this.parent=null};return i}(t.BaseObject);t.BoneData=i;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];return e}e.toString=function(){return"[class dragonBones.SurfaceData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.vertexCountX=0;this.vertexCountY=0;this.vertices.length=0};return e}(i);t.SurfaceData=r;var a=function(e){__extends(i,e);function i(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}i.createColor=function(){return new t.ColorTransform};i.toString=function(){return"[class dragonBones.SlotData]"};i.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.name="";this.color=null;this.userData=null;this.parent=null};i.DEFAULT_COLOR=new t.ColorTransform;return i}(t.BaseObject);t.SlotData=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.CanvasData]"};e.prototype._onClear=function(){this.hasBackground=false;this.color=0;this.x=0;this.y=0;this.width=0;this.height=0};return e}(t.BaseObject);t.CanvasData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.displays={};return e}e.toString=function(){return"[class dragonBones.SkinData]"};e.prototype._onClear=function(){for(var t in this.displays){var e=this.displays[t];for(var i=0,r=e;i<r.length;i++){var a=r[i];if(a!==null){a.returnToPool()}}delete this.displays[t]}this.name="";this.parent=null};e.prototype.addDisplay=function(t,e){if(!(t in this.displays)){this.displays[t]=[]}if(e!==null){e.parent=this}var i=this.displays[t];i.push(e)};e.prototype.getDisplay=function(t,e){var i=this.getDisplays(t);if(i!==null){for(var r=0,a=i;r<a.length;r++){var n=a[r];if(n!==null&&n.name===e){return n}}}return null};e.prototype.getDisplays=function(t){if(!(t in this.displays)){return null}return this.displays[t]};return e}(t.BaseObject);t.SkinData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.order=0;this.name="";this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.scaleEnabled=false;this.bendPositive=false;this.weight=1};return e}(e);t.IKConstraintData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.transform=new t.Transform;return i}i.prototype._onClear=function(){this.name="";this.path="";this.transform.identity();this.parent=null};return i}(t.BaseObject);t.DisplayData=e;var i=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.pivot=new t.Point;return i}i.toString=function(){return"[class dragonBones.ImageDisplayData]"};i.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=0;this.pivot.clear();this.texture=null};return i}(e);t.ImageDisplayData=i;var r=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.actions=[];return e}e.toString=function(){return"[class dragonBones.ArmatureDisplayData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);for(var e=0,i=this.actions;e<i.length;e++){var r=i[e];r.returnToPool()}this.type=1;this.inheritAnimation=false;this.actions.length=0;this.armature=null};e.prototype.addAction=function(t){this.actions.push(t)};return e}(e);t.ArmatureDisplayData=r;var a=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.weight=null;return e}e.toString=function(){return"[class dragonBones.MeshDisplayData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);if(this.weight!==null){this.weight.returnToPool()}this.type=2;this.inheritAnimation=false;this.offset=0;this.weight=null};return e}(i);t.MeshDisplayData=a;var n=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.boundingBox=null;return e}e.toString=function(){return"[class dragonBones.BoundingBoxDisplayData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);if(this.boundingBox!==null){this.boundingBox.returnToPool()}this.type=3;this.boundingBox=null};return e}(e);t.BoundingBoxDisplayData=n;var s=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.bones=[];return e}e.toString=function(){return"[class dragonBones.WeightData]"};e.prototype._onClear=function(){this.count=0;this.offset=0;this.bones.length=0};e.prototype.addBone=function(t){this.bones.push(t)};return e}(t.BaseObject);t.WeightData=s})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.color=0;this.width=0;this.height=0};return e}(t.BaseObject);t.BoundingBoxData=e;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.RectangleBoundingBoxData]"};e._computeOutCode=function(t,e,i,r,a,n){var s=0;if(t<i){s|=1}else if(t>a){s|=2}if(e<r){s|=4}else if(e>n){s|=8}return s};e.rectangleIntersectsSegment=function(t,i,r,a,n,s,o,l,h,u,f){if(h===void 0){h=null}if(u===void 0){u=null}if(f===void 0){f=null}var _=t>n&&t<o&&i>s&&i<l;var c=r>n&&r<o&&a>s&&a<l;if(_&&c){return-1}var p=0;var m=e._computeOutCode(t,i,n,s,o,l);var d=e._computeOutCode(r,a,n,s,o,l);while(true){if((m|d)===0){p=2;break}else if((m&d)!==0){break}var y=0;var g=0;var v=0;var b=m!==0?m:d;if((b&4)!==0){y=t+(r-t)*(s-i)/(a-i);g=s;if(f!==null){v=-Math.PI*.5}}else if((b&8)!==0){y=t+(r-t)*(l-i)/(a-i);g=l;if(f!==null){v=Math.PI*.5}}else if((b&2)!==0){g=i+(a-i)*(o-t)/(r-t);y=o;if(f!==null){v=0}}else if((b&1)!==0){g=i+(a-i)*(n-t)/(r-t);y=n;if(f!==null){v=Math.PI}}if(b===m){t=y;i=g;m=e._computeOutCode(t,i,n,s,o,l);if(f!==null){f.x=v}}else{r=y;a=g;d=e._computeOutCode(r,a,n,s,o,l);if(f!==null){f.y=v}}}if(p){if(_){p=2;if(h!==null){h.x=r;h.y=a}if(u!==null){u.x=r;u.y=r}if(f!==null){f.x=f.y+Math.PI}}else if(c){p=1;if(h!==null){h.x=t;h.y=i}if(u!==null){u.x=t;u.y=i}if(f!==null){f.y=f.x+Math.PI}}else{p=3;if(h!==null){h.x=t;h.y=i}if(u!==null){u.x=r;u.y=a}}}return p};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=0};e.prototype.containsPoint=function(t,e){var i=this.width*.5;if(t>=-i&&t<=i){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,i,r,a,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=this.width*.5;var h=this.height*.5;var u=e.rectangleIntersectsSegment(t,i,r,a,-l,-h,l,h,n,s,o);return u};return e}(e);t.RectangleBoundingBoxData=i;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EllipseData]"};e.ellipseIntersectsSegment=function(t,e,i,r,a,n,s,o,l,h,u){if(l===void 0){l=null}if(h===void 0){h=null}if(u===void 0){u=null}var f=s/o;var _=f*f;e*=f;r*=f;var c=i-t;var p=r-e;var m=Math.sqrt(c*c+p*p);var d=c/m;var y=p/m;var g=(a-t)*d+(n-e)*y;var v=g*g;var b=t*t+e*e;var T=s*s;var D=T-b+v;var A=0;if(D>=0){var x=Math.sqrt(D);var O=g-x;var S=g+x;var E=O<0?-1:O<=m?0:1;var B=S<0?-1:S<=m?0:1;var M=E*B;if(M<0){return-1}else if(M===0){if(E===-1){A=2;i=t+S*d;r=(e+S*y)/f;if(l!==null){l.x=i;l.y=r}if(h!==null){h.x=i;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,i/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+O*d;e=(e+O*y)/f;if(l!==null){l.x=t;l.y=e}if(h!==null){h.x=t;h.y=e}if(u!==null){u.x=Math.atan2(e/T*_,t/T);u.y=u.x+Math.PI}}else{A=3;if(l!==null){l.x=t+O*d;l.y=(e+O*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+S*d;h.y=(e+S*y)/f;if(u!==null){u.y=Math.atan2(h.y/T*_,h.x/T)}}}}}return A};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=1};e.prototype.containsPoint=function(t,e){var i=this.width*.5;if(t>=-i&&t<=i){var r=this.height*.5;if(e>=-r&&e<=r){e*=i/r;return Math.sqrt(t*t+e*e)<=i}}return false};e.prototype.intersectsSegment=function(t,i,r,a,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}var l=e.ellipseIntersectsSegment(t,i,r,a,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var a=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.vertices=[];e.weight=null;return e}e.toString=function(){return"[class dragonBones.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,i,r,a,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===i){t=i+1e-6}if(e===r){e=r+1e-6}var l=a.length;var h=t-i;var u=e-r;var f=t*r-e*i;var _=0;var c=a[l-2];var p=a[l-1];var m=0;var d=0;var y=0;var g=0;var v=0;var b=0;for(var T=0;T<l;T+=2){var D=a[T];var A=a[T+1];if(c===D){c=D+1e-4}if(p===A){p=A+1e-4}var x=c-D;var O=p-A;var S=c*A-p*D;var E=h*O-u*x;var B=(f*x-h*S)/E;if((B>=c&&B<=D||B>=D&&B<=c)&&(h===0||B>=t&&B<=i||B>=i&&B<=t)){var M=(f*O-u*S)/E;if((M>=p&&M<=A||M>=A&&M<=p)&&(u===0||M>=e&&M<=r||M>=r&&M<=e)){if(s!==null){var w=B-t;if(w<0){w=-w}if(_===0){m=w;d=w;y=B;g=M;v=B;b=M;if(o!==null){o.x=Math.atan2(A-p,D-c)-Math.PI*.5;o.y=o.x}}else{if(w<m){m=w;y=B;g=M;if(o!==null){o.x=Math.atan2(A-p,D-c)-Math.PI*.5}}if(w>d){d=w;v=B;b=M;if(o!==null){o.y=Math.atan2(A-p,D-c)-Math.PI*.5}}}_++}else{y=B;g=M;v=B;b=M;_++;if(o!==null){o.x=Math.atan2(A-p,D-c)-Math.PI*.5;o.y=o.x}break}}}c=D;p=A}if(_===1){if(n!==null){n.x=y;n.y=g}if(s!==null){s.x=y;s.y=g}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=g}if(s!==null){s.x=v;s.y=b}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);if(this.weight!==null){this.weight.returnToPool()}this.type=2;this.x=0;this.y=0;this.vertices.length=0;this.weight=null};e.prototype.containsPoint=function(t,e){var i=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,a=this.vertices.length,n=a-2;r<a;r+=2){var s=this.vertices[n+1];var o=this.vertices[r+1];if(o<e&&s>=e||s<e&&o>=e){var l=this.vertices[n];var h=this.vertices[r];if((e-o)*(l-h)/(s-o)+h<t){i=!i}}n=r}}return i};e.prototype.intersectsSegment=function(t,r,a,n,s,o,l){if(s===void 0){s=null}if(o===void 0){o=null}if(l===void 0){l=null}var h=0;if(i.rectangleIntersectsSegment(t,r,a,n,this.x,this.y,this.width,this.height,null,null,null)!==0){h=e.polygonIntersectsSegment(t,r,a,n,this.vertices,s,o,l)}return h};return e}(e);t.PolygonBoundingBoxData=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.cachedFrames=[];e.boneTimelines={};e.slotTimelines={};e.constraintTimelines={};e.boneCachedFrameIndices={};e.slotCachedFrameIndices={};e.actionTimeline=null;e.zOrderTimeline=null;return e}e.toString=function(){return"[class dragonBones.AnimationData]"};e.prototype._onClear=function(){for(var t in this.boneTimelines){for(var e=0,i=this.boneTimelines[t];e<i.length;e++){var r=i[e];r.returnToPool()}delete this.boneTimelines[t]}for(var t in this.slotTimelines){for(var a=0,n=this.slotTimelines[t];a<n.length;a++){var r=n[a];r.returnToPool()}delete this.slotTimelines[t]}for(var t in this.constraintTimelines){for(var s=0,o=this.constraintTimelines[t];s<o.length;s++){var r=o[s];r.returnToPool()}delete this.constraintTimelines[t]}for(var t in this.boneCachedFrameIndices){delete this.boneCachedFrameIndices[t]}for(var t in this.slotCachedFrameIndices){delete this.slotCachedFrameIndices[t]}if(this.actionTimeline!==null){this.actionTimeline.returnToPool()}if(this.zOrderTimeline!==null){this.zOrderTimeline.returnToPool()}this.frameIntOffset=0;this.frameFloatOffset=0;this.frameOffset=0;this.frameCount=0;this.playTimes=0;this.duration=0;this.scale=1;this.fadeInTime=0;this.cacheFrameRate=0;this.name="";this.cachedFrames.length=0;this.actionTimeline=null;this.zOrderTimeline=null;this.parent=null};e.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=Math.max(Math.ceil(t*this.scale),1);var e=Math.ceil(this.cacheFrameRate*this.duration)+1;this.cachedFrames.length=e;for(var i=0,r=this.cacheFrames.length;i<r;++i){this.cachedFrames[i]=false}for(var a=0,n=this.parent.sortedBones;a<n.length;a++){var s=n[a];var o=new Array(e);for(var i=0,r=o.length;i<r;++i){o[i]=-1}this.boneCachedFrameIndices[s.name]=o}for(var l=0,h=this.parent.sortedSlots;l<h.length;l++){var u=h[l];var o=new Array(e);for(var i=0,r=o.length;i<r;++i){o[i]=-1}this.slotCachedFrameIndices[u.name]=o}};e.prototype.addBoneTimeline=function(t,e){var i=t.name in this.boneTimelines?this.boneTimelines[t.name]:this.boneTimelines[t.name]=[];if(i.indexOf(e)<0){i.push(e)}};e.prototype.addSlotTimeline=function(t,e){var i=t.name in this.slotTimelines?this.slotTimelines[t.name]:this.slotTimelines[t.name]=[];if(i.indexOf(e)<0){i.push(e)}};e.prototype.addConstraintTimeline=function(t,e){var i=t.name in this.constraintTimelines?this.constraintTimelines[t.name]:this.constraintTimelines[t.name]=[];if(i.indexOf(e)<0){i.push(e)}};e.prototype.getBoneTimelines=function(t){return t in this.boneTimelines?this.boneTimelines[t]:null};e.prototype.getSlotTimelines=function(t){return t in this.slotTimelines?this.slotTimelines[t]:null};e.prototype.getConstraintTimelines=function(t){return t in this.constraintTimelines?this.constraintTimelines[t]:null};e.prototype.getBoneCachedFrameIndices=function(t){return t in this.boneCachedFrameIndices?this.boneCachedFrameIndices[t]:null};e.prototype.getSlotCachedFrameIndices=function(t){return t in this.slotCachedFrameIndices?this.slotCachedFrameIndices[t]:null};return e}(t.BaseObject);t.AnimationData=e;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.TimelineData]"};e.prototype._onClear=function(){this.type=10;this.offset=0;this.frameIndicesOffset=-1};return e}(t.BaseObject);t.TimelineData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.boneMask=[];return e}e.toString=function(){return"[class dragonBones.AnimationConfig]"};e.prototype._onClear=function(){this.pauseFadeOut=true;this.fadeOutMode=4;this.fadeOutTweenType=1;this.fadeOutTime=-1;this.actionEnabled=true;this.additiveBlending=false;this.displayControl=true;this.pauseFadeIn=true;this.resetToPose=true;this.fadeInTweenType=1;this.playTimes=-1;this.layer=0;this.position=0;this.duration=-1;this.timeScale=-100;this.weight=1;this.fadeInTime=-1;this.autoFadeOutTime=-1;this.name="";this.animation="";this.group="";this.boneMask.length=0};e.prototype.clear=function(){this._onClear()};e.prototype.copyFrom=function(t){this.pauseFadeOut=t.pauseFadeOut;this.fadeOutMode=t.fadeOutMode;this.autoFadeOutTime=t.autoFadeOutTime;this.fadeOutTweenType=t.fadeOutTweenType;this.actionEnabled=t.actionEnabled;this.additiveBlending=t.additiveBlending;this.displayControl=t.displayControl;this.pauseFadeIn=t.pauseFadeIn;this.resetToPose=t.resetToPose;this.playTimes=t.playTimes;this.layer=t.layer;this.position=t.position;this.duration=t.duration;this.timeScale=t.timeScale;this.fadeInTime=t.fadeInTime;this.fadeOutTime=t.fadeOutTime;this.fadeInTweenType=t.fadeInTweenType;this.weight=t.weight;this.name=t.name;this.animation=t.animation;this.group=t.group;this.boneMask.length=t.boneMask.length;for(var e=0,i=this.boneMask.length;e<i;++e){this.boneMask[e]=t.boneMask[e]}};e.prototype.containsBoneMask=function(t){return this.boneMask.length===0||this.boneMask.indexOf(t)>=0};e.prototype.addBoneMask=function(t,e,i){if(i===void 0){i=true}var r=t.getBone(e);if(r===null){return}if(this.boneMask.indexOf(e)<0){this.boneMask.push(e)}if(i){for(var a=0,n=t.getBones();a<n.length;a++){var s=n[a];if(this.boneMask.indexOf(s.name)<0&&r.contains(s)){this.boneMask.push(s.name)}}}};e.prototype.removeBoneMask=function(t,e,i){if(i===void 0){i=true}var r=this.boneMask.indexOf(e);if(r>=0){this.boneMask.splice(r,1)}if(i){var a=t.getBone(e);if(a!==null){if(this.boneMask.length>0){for(var n=0,s=t.getBones();n<s.length;n++){var o=s[n];var l=this.boneMask.indexOf(o.name);if(l>=0&&a.contains(o)){this.boneMask.splice(l,1)}}}else{for(var h=0,u=t.getBones();h<u.length;h++){var o=u[h];if(o===a){continue}if(!a.contains(o)){this.boneMask.push(o.name)}}}}}};return e}(t.BaseObject);t.AnimationConfig=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.textures={};return e}e.prototype._onClear=function(){for(var t in this.textures){this.textures[t].returnToPool();delete this.textures[t]}this.autoSearch=false;this.width=0;this.height=0;this.scale=1;this.name="";this.imagePath=""};e.prototype.copyFrom=function(t){this.autoSearch=t.autoSearch;this.scale=t.scale;this.width=t.width;this.height=t.height;this.name=t.name;this.imagePath=t.imagePath;for(var e in this.textures){this.textures[e].returnToPool();delete this.textures[e]}for(var e in t.textures){var i=this.createTexture();i.copyFrom(t.textures[e]);this.textures[e]=i}};e.prototype.addTexture=function(t){if(t.name in this.textures){console.warn("Same texture: "+t.name);return}t.parent=this;this.textures[t.name]=t};e.prototype.getTexture=function(t){return t in this.textures?this.textures[t]:null};return e}(t.BaseObject);t.TextureAtlasData=e;var i=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.region=new t.Rectangle;i.frame=null;return i}i.createRectangle=function(){return new t.Rectangle};i.prototype._onClear=function(){this.rotated=false;this.name="";this.region.clear();this.parent=null;this.frame=null};i.prototype.copyFrom=function(t){this.rotated=t.rotated;this.name=t.name;this.region.copyFrom(t.region);this.parent=t.parent;if(this.frame===null&&t.frame!==null){this.frame=i.createRectangle()}else if(this.frame!==null&&t.frame===null){this.frame=null}if(this.frame!==null&&t.frame!==null){this.frame.copyFrom(t.frame)}};return i}(t.BaseObject);t.TextureData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var t=e!==null&&e.apply(this,arguments)||this;t._bones=[];t._slots=[];t._constraints=[];t._actions=[];t._animation=null;t._proxy=null;t._replaceTextureAtlasData=null;t._clock=null;return t}i.toString=function(){return"[class dragonBones.Armature]"};i._onSortSlots=function(t,e){return t._zOrder>e._zOrder?1:-1};i.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t<e.length;t++){var i=e[t];i.returnToPool()}for(var r=0,a=this._slots;r<a.length;r++){var n=a[r];n.returnToPool()}for(var s=0,o=this._constraints;s<o.length;s++){var l=o[s];l.returnToPool()}if(this._animation!==null){this._animation.returnToPool()}if(this._proxy!==null){this._proxy.dbClear()}if(this._replaceTextureAtlasData!==null){this._replaceTextureAtlasData.returnToPool()}this.inheritAnimation=true;this.userData=null;this._lockUpdate=false;this._bonesDirty=false;this._slotsDirty=false;this._zOrderDirty=false;this._flipX=false;this._flipY=false;this._cacheFrameIndex=-1;this._bones.length=0;this._slots.length=0;this._constraints.length=0;this._actions.length=0;this._armatureData=null;this._animation=null;this._proxy=null;this._display=null;this._replaceTextureAtlasData=null;this._replacedTexture=null;this._dragonBones=null;this._clock=null;this._parent=null};i.prototype._sortBones=function(){var t=this._bones.length;if(t<=0){return}var e=this._bones.concat();var i=0;var r=0;this._bones.length=0;while(r<t){var a=e[i++];if(i>=t){i=0}if(this._bones.indexOf(a)>=0){continue}if(a._hasConstraint){var n=false;for(var s=0,o=this._constraints;s<o.length;s++){var l=o[s];if(l._root===a&&this._bones.indexOf(l._target)<0){n=true;break}}if(n){continue}}if(a.parent!==null&&this._bones.indexOf(a.parent)<0){continue}this._bones.push(a);r++}};i.prototype._sortSlots=function(){this._slots.sort(i._onSortSlots)};i.prototype._sortZOrder=function(t,e){var i=this._armatureData.sortedSlots;var r=t===null;if(this._zOrderDirty||!r){for(var a=0,n=i.length;a<n;++a){var s=r?a:t[e+a];if(s<0||s>=n){continue}var o=i[s];var l=this.getSlot(o.name);if(l!==null){l._setZorder(a)}}this._slotsDirty=true;this._zOrderDirty=!r}};i.prototype._addBoneToBoneList=function(t){if(this._bones.indexOf(t)<0){this._bonesDirty=true;this._bones.push(t)}};i.prototype._removeBoneFromBoneList=function(t){var e=this._bones.indexOf(t);if(e>=0){this._bones.splice(e,1)}};i.prototype._addSlotToSlotList=function(t){if(this._slots.indexOf(t)<0){this._slotsDirty=true;this._slots.push(t)}};i.prototype._removeSlotFromSlotList=function(t){var e=this._slots.indexOf(t);if(e>=0){this._slots.splice(e,1)}};i.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};i.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};i.prototype.init=function(e,i,r,a){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=i;this._display=r;this._dragonBones=a;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};i.prototype.advanceTime=function(t){if(this._lockUpdate){return}if(this._armatureData===null){console.warn("The armature has been disposed.");return}else if(this._armatureData.parent===null){console.warn("The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear().");return}var e=this._cacheFrameIndex;this._animation.advanceTime(t);if(this._bonesDirty){this._bonesDirty=false;this._sortBones()}if(this._slotsDirty){this._slotsDirty=false;this._sortSlots()}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var i=0,r=0;for(i=0,r=this._bones.length;i<r;++i){this._bones[i].update(this._cacheFrameIndex)}for(i=0,r=this._slots.length;i<r;++i){this._slots[i].update(this._cacheFrameIndex)}}if(this._actions.length>0){this._lockUpdate=true;for(var a=0,n=this._actions;a<n.length;a++){var s=n[a];if(s.type===0){this._animation.fadeIn(s.name)}}this._actions.length=0;this._lockUpdate=false}this._proxy.dbUpdate()};i.prototype.invalidUpdate=function(t,e){if(t===void 0){t=null}if(e===void 0){e=false}if(t!==null&&t.length>0){var i=this.getBone(t);if(i!==null){i.invalidUpdate();if(e){for(var r=0,a=this._slots;r<a.length;r++){var n=a[r];if(n.parent===i){n.invalidUpdate()}}}}}else{for(var s=0,o=this._bones;s<o.length;s++){var i=o[s];i.invalidUpdate()}if(e){for(var l=0,h=this._slots;l<h.length;l++){var n=h[l];n.invalidUpdate()}}}};i.prototype.containsPoint=function(t,e){for(var i=0,r=this._slots;i<r.length;i++){var a=r[i];if(a.containsPoint(t,e)){return a}}return null};i.prototype.intersectsSegment=function(t,e,i,r,a,n,s){if(a===void 0){a=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=t===i;var l=0;var h=0;var u=0;var f=0;var _=0;var c=0;var p=0;var m=0;var d=null;var y=null;for(var g=0,v=this._slots;g<v.length;g++){var b=v[g];var T=b.intersectsSegment(t,e,i,r,a,n,s);if(T>0){if(a!==null||n!==null){if(a!==null){var D=o?a.y-e:a.x-t;if(D<0){D=-D}if(d===null||D<l){l=D;u=a.x;f=a.y;d=b;if(s){p=s.x}}}if(n!==null){var D=n.x-t;if(D<0){D=-D}if(y===null||D>h){h=D;_=n.x;c=n.y;y=b;if(s!==null){m=s.y}}}}else{d=b;break}}}if(d!==null&&a!==null){a.x=u;a.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=c;if(s!==null){s.y=m}}return d};i.prototype.getBone=function(t){for(var e=0,i=this._bones;e<i.length;e++){var r=i[e];if(r.name===t){return r}}return null};i.prototype.getBoneByDisplay=function(t){var e=this.getSlotByDisplay(t);return e!==null?e.parent:null};i.prototype.getSlot=function(t){for(var e=0,i=this._slots;e<i.length;e++){var r=i[e];if(r.name===t){return r}}return null};i.prototype.getSlotByDisplay=function(t){if(t!==null){for(var e=0,i=this._slots;e<i.length;e++){var r=i[e];if(r.display===t){return r}}}return null};i.prototype.addBone=function(t,e){console.assert(t!==null);t._setArmature(this);t._setParent(e.length>0?this.getBone(e):null)};i.prototype.addSlot=function(t,e){var i=this.getBone(e);console.assert(t!==null&&i!==null);t._setArmature(this);t._setParent(i)};i.prototype.addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};i.prototype.removeBone=function(t){console.assert(t!==null&&t.armature===this);t._setParent(null);t._setArmature(null)};i.prototype.removeSlot=function(t){console.assert(t!==null&&t.armature===this);t._setParent(null);t._setArmature(null)};i.prototype.getBones=function(){return this._bones};i.prototype.getSlots=function(){return this._slots};Object.defineProperty(i.prototype,"flipX",{get:function(){return this._flipX},set:function(t){if(this._flipX===t){return}this._flipX=t;this.invalidUpdate()},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"flipY",{get:function(){return this._flipY},set:function(t){if(this._flipY===t){return}this._flipY=t;this.invalidUpdate()},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"cacheFrameRate",{get:function(){return this._armatureData.cacheFrameRate},set:function(t){if(this._armatureData.cacheFrameRate!==t){this._armatureData.cacheFrames(t);for(var e=0,i=this._slots;e<i.length;e++){var r=i[e];var a=r.childArmature;if(a!==null){a.cacheFrameRate=t}}}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"name",{get:function(){return this._armatureData.name},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"armatureData",{get:function(){return this._armatureData},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animation",{get:function(){return this._animation},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"proxy",{get:function(){return this._proxy},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"eventDispatcher",{get:function(){return this._proxy},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"display",{get:function(){return this._display},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"replacedTexture",{get:function(){return this._replacedTexture},set:function(t){if(this._replacedTexture===t){return}if(this._replaceTextureAtlasData!==null){this._replaceTextureAtlasData.returnToPool();this._replaceTextureAtlasData=null}this._replacedTexture=t;for(var e=0,i=this._slots;e<i.length;e++){var r=i[e];r.invalidUpdate();r.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock===t){return}if(this._clock!==null){this._clock.remove(this)}this._clock=t;if(this._clock){this._clock.add(this)}for(var e=0,i=this._slots;e<i.length;e++){var r=i[e];var a=r.childArmature;if(a!==null){a.clock=this._clock}}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},enumerable:true,configurable:true});i.prototype.replaceTexture=function(t){this.replacedTexture=t};i.prototype.hasEventListener=function(t){return this._proxy.hasDBEventListener(t)};i.prototype.addEventListener=function(t,e,i){this._proxy.addDBEventListener(t,e,i)};i.prototype.removeEventListener=function(t,e,i){this._proxy.removeDBEventListener(t,e,i)};i.prototype.enableAnimationCache=function(t){this.cacheFrameRate=t};i.prototype.getDisplay=function(){return this._display};return i}(t.BaseObject);t.Armature=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.globalTransformMatrix=new t.Matrix;i.global=new t.Transform;i.offset=new t.Transform;return i}i.prototype._onClear=function(){this.globalTransformMatrix.identity();this.global.identity();this.offset.identity();this.origin=null;this.userData=null;this._globalDirty=false;this._armature=null;this._parent=null};i.prototype._setArmature=function(t){this._armature=t};i.prototype._setParent=function(t){this._parent=t};i.prototype.updateGlobalTransform=function(){if(this._globalDirty){this._globalDirty=false;this.global.fromMatrix(this.globalTransformMatrix)}};Object.defineProperty(i.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},enumerable:true,configurable:true});i._helpMatrix=new t.Matrix;i._helpTransform=new t.Transform;i._helpPoint=new t.Point;return i}(t.BaseObject);t.TransformObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.animationPose=new t.Transform;return i}i.toString=function(){return"[class dragonBones.Bone]"};i.prototype._onClear=function(){e.prototype._onClear.call(this);this.offsetMode=1;this.animationPose.identity();this._transformDirty=false;this._childrenTransformDirty=false;this._blendDirty=false;this._localDirty=true;this._hasConstraint=false;this._visible=true;this._cachedFrameIndex=-1;this._blendLayer=0;this._blendLeftWeight=1;this._blendLayerWeight=0;this._boneData=null;this._cachedFrameIndices=null};i.prototype._updateGlobalTransformMatrix=function(e){var i=this._armature.flipX;var r=this._armature.flipY===t.DragonBones.yDown;var a=this._parent!==null;var n=0;var s=this.global;var o=this.globalTransformMatrix;if(this.offsetMode===1){s.x=this.origin.x+this.offset.x+this.animationPose.x;s.y=this.origin.y+this.offset.y+this.animationPose.y;s.skew=this.origin.skew+this.offset.skew+this.animationPose.skew;s.rotation=this.origin.rotation+this.offset.rotation+this.animationPose.rotation;s.scaleX=this.origin.scaleX*this.offset.scaleX*this.animationPose.scaleX;s.scaleY=this.origin.scaleY*this.offset.scaleY*this.animationPose.scaleY}else if(this.offsetMode===0){s.copyFrom(this.origin).add(this.animationPose)}else{a=false;s.copyFrom(this.offset)}if(a){var l=this._parent.globalTransformMatrix;if(this._boneData.inheritScale){if(!this._boneData.inheritRotation){this._parent.updateGlobalTransform();if(i&&r){n=s.rotation-(this._parent.global.rotation+Math.PI)}else if(i){n=s.rotation+this._parent.global.rotation+Math.PI}else if(r){n=s.rotation+this._parent.global.rotation}else{n=s.rotation-this._parent.global.rotation}s.rotation=n}s.toMatrix(o);o.concat(l);if(this._boneData.inheritTranslation){s.x=o.tx;s.y=o.ty}else{o.tx=s.x;o.ty=s.y}if(e){s.fromMatrix(o)}else{this._globalDirty=true}}else{if(this._boneData.inheritTranslation){var h=s.x;var u=s.y;s.x=l.a*h+l.c*u+l.tx;s.y=l.d*u+l.b*h+l.ty}else{if(i){s.x=-s.x}if(r){s.y=-s.y}}if(this._boneData.inheritRotation){this._parent.updateGlobalTransform();if(this._parent.global.scaleX<0){n=s.rotation+this._parent.global.rotation+Math.PI}else{n=s.rotation+this._parent.global.rotation}if(l.a*l.d-l.b*l.c<0){n-=s.rotation*2;if(i!==r||this._boneData.inheritReflection){s.skew+=Math.PI}}s.rotation=n}else if(i||r){if(i&&r){n=s.rotation+Math.PI}else{if(i){n=Math.PI-s.rotation}else{n=-s.rotation}s.skew+=Math.PI}s.rotation=n}s.toMatrix(o)}}else{if(i||r){if(i){s.x=-s.x}if(r){s.y=-s.y}if(i&&r){n=s.rotation+Math.PI}else{if(i){n=Math.PI-s.rotation}else{n=-s.rotation}s.skew+=Math.PI}s.rotation=n}s.toMatrix(o)}};i.prototype._setArmature=function(t){if(this._armature===t){return}var e=null;var i=null;if(this._armature!==null){e=this.getSlots();i=this.getBones();this._armature._removeBoneFromBoneList(this)}this._armature=t;if(this._armature!==null){this._armature._addBoneToBoneList(this)}if(e!==null){for(var r=0,a=e;r<a.length;r++){var n=a[r];if(n.parent===this){n._setArmature(this._armature)}}}if(i!==null){for(var s=0,o=i;s<o.length;s++){var l=o[s];if(l.parent===this){l._setArmature(this._armature)}}}};i.prototype.init=function(t){if(this._boneData!==null){return}this._boneData=t;this.origin=this._boneData.transform};i.prototype.update=function(t){this._blendDirty=false;if(t>=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else{if(this._hasConstraint){for(var i=0,r=this._armature._constraints;i<r.length;i++){var a=r[i];if(a._root===this){a.update()}}}if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}}else{if(this._hasConstraint){for(var n=0,s=this._armature._constraints;n<s.length;n++){var a=s[n];if(a._root===this){a.update()}}}if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}}if(this._transformDirty){this._transformDirty=false;this._childrenTransformDirty=true;if(this._cachedFrameIndex<0){var o=t>=0;if(this._localDirty){this._updateGlobalTransformMatrix(o)}if(o&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}}else if(this._childrenTransformDirty){this._childrenTransformDirty=false}this._localDirty=true};i.prototype.updateByConstraint=function(){if(this._localDirty){this._localDirty=false;if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._updateGlobalTransformMatrix(true)}this._transformDirty=true}};i.prototype.invalidUpdate=function(){this._transformDirty=true};i.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.parent}return e===this};Object.defineProperty(i.prototype,"boneData",{get:function(){return this._boneData},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;for(var e=0,i=this._armature.getSlots();e<i.length;e++){var r=i[e];if(r._parent===this){r._updateVisible()}}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"name",{get:function(){return this._boneData.name},enumerable:true,configurable:true});i.prototype.getBones=function(){var t=new Array;for(var e=0,i=this._armature.getBones();e<i.length;e++){var r=i[e];if(r.parent===this){t.push(r)}}return t};i.prototype.getSlots=function(){var t=new Array;for(var e=0,i=this._armature.getSlots();e<i.length;e++){var r=i[e];if(r.parent===this){t.push(r)}}return t};Object.defineProperty(i.prototype,"slot",{get:function(){for(var t=0,e=this._armature.getSlots();t<e.length;t++){var i=e[t];if(i.parent===this){return i}}return null},enumerable:true,configurable:true});return i}(t.TransformObject);t.Bone=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i._localMatrix=new t.Matrix;i._colorTransform=new t.ColorTransform;i._ffdVertices=[];i._displayDatas=[];i._displayList=[];i._meshBones=[];i._rawDisplay=null;i._meshDisplay=null;return i}i.prototype._onClear=function(){e.prototype._onClear.call(this);var i=[];for(var r=0,a=this._displayList;r<a.length;r++){var n=a[r];if(n!==null&&n!==this._rawDisplay&&n!==this._meshDisplay&&i.indexOf(n)<0){i.push(n)}}for(var s=0,o=i;s<o.length;s++){var n=o[s];if(n instanceof t.Armature){n.dispose()}else{this._disposeDisplay(n)}}if(this._meshDisplay!==null&&this._meshDisplay!==this._rawDisplay){this._disposeDisplay(this._meshDisplay)}if(this._rawDisplay!==null){this._disposeDisplay(this._rawDisplay)}this.displayController=null;this._displayDirty=false;this._zOrderDirty=false;this._blendModeDirty=false;this._colorDirty=false;this._meshDirty=false;this._transformDirty=false;this._skinedMeshTransformDirty=false;this._visible=true;this._blendMode=0;this._displayIndex=-1;this._animationDisplayIndex=-1;this._zOrder=0;this._cachedFrameIndex=-1;this._pivotX=0;this._pivotY=0;this._localMatrix.identity();this._colorTransform.identity();this._ffdVertices.length=0;this._displayList.length=0;this._displayDatas.length=0;this._meshBones.length=0;this._slotData=null;this._rawDisplayDatas=null;this._displayData=null;this._textureData=null;this._meshData=null;this._boundingBoxData=null;this._rawDisplay=null;this._meshDisplay=null;this._display=null;this._childArmature=null;this._cachedFrameIndices=null};i.prototype._updateDisplayData=function(){var t=this._displayData;var e=this._textureData;var r=this._meshData;var a=this._displayIndex>=0&&this._rawDisplayDatas!==null&&this._displayIndex<this._rawDisplayDatas.length?this._rawDisplayDatas[this._displayIndex]:null;if(this._displayIndex>=0&&this._displayIndex<this._displayDatas.length){this._displayData=this._displayDatas[this._displayIndex]}else{this._displayData=null}if(this._displayData!==null){if(this._displayData.type===0||this._displayData.type===2){this._textureData=this._displayData.texture;if(this._displayData.type===2){this._meshData=this._displayData}else if(a!==null&&a.type===2){this._meshData=a}else{this._meshData=null}}else{this._textureData=null;this._meshData=null}}else{this._textureData=null;this._meshData=null}if(this._displayData!==null&&this._displayData.type===3){this._boundingBoxData=this._displayData.boundingBox}else if(a!==null&&a.type===3){this._boundingBoxData=a.boundingBox}else{this._boundingBoxData=null}if(this._displayData!==t||this._textureData!==e||this._meshData!==r){if(this._meshData!==null){this._pivotX=0;this._pivotY=0}else if(this._textureData!==null){var n=this._displayData;var s=this._textureData.parent.scale*this._armature._armatureData.scale;var o=this._textureData.frame;this._pivotX=n.pivot.x;this._pivotY=n.pivot.y;var l=o!==null?o:this._textureData.region;var h=l.width;var u=l.height;if(this._textureData.rotated&&o===null){h=l.height;u=l.width}this._pivotX*=h*s;this._pivotY*=u*s;if(o!==null){this._pivotX+=o.x*s;this._pivotY+=o.y*s}}else{this._pivotX=0;this._pivotY=0}if(this._meshData!==r){if(this._meshData!==null){if(this._meshData.weight!==null){this._ffdVertices.length=this._meshData.weight.count*2;this._meshBones.length=this._meshData.weight.bones.length;for(var f=0,_=this._meshBones.length;f<_;++f){this._meshBones[f]=this._armature.getBone(this._meshData.weight.bones[f].name)}}else{var c=this._meshData.parent.parent.parent.intArray[this._meshData.offset+0];this._ffdVertices.length=c*2;this._meshBones.length=0}for(var f=0,_=this._ffdVertices.length;f<_;++f){this._ffdVertices[f]=0}this._meshDirty=true}else{this._ffdVertices.length=0;this._meshBones.length=0}}else if(this._meshData!==null&&this._textureData!==e){this._meshDirty=true}if(this._displayData!==null&&a!==null&&this._displayData!==a&&this._meshData===null){a.transform.toMatrix(i._helpMatrix);i._helpMatrix.invert();i._helpMatrix.transformPoint(0,0,i._helpPoint);this._pivotX-=i._helpPoint.x;this._pivotY-=i._helpPoint.y;this._displayData.transform.toMatrix(i._helpMatrix);i._helpMatrix.invert();i._helpMatrix.transformPoint(0,0,i._helpPoint);this._pivotX+=i._helpPoint.x;this._pivotY+=i._helpPoint.y}if(a!==null){this.origin=a.transform}else if(this._displayData!==null){this.origin=this._displayData.transform}this._displayDirty=true;this._transformDirty=true;this._skinedMeshTransformDirty=true}};i.prototype._updateDisplay=function(){var e=this._display!==null?this._display:this._rawDisplay;var i=this._childArmature;if(this._displayIndex>=0&&this._displayIndex<this._displayList.length){this._display=this._displayList[this._displayIndex];if(this._display!==null&&this._display instanceof t.Armature){this._childArmature=this._display;this._display=this._childArmature.display}else{this._childArmature=null}}else{this._display=null;this._childArmature=null}var r=this._display!==null?this._display:this._rawDisplay;if(r!==e){this._onUpdateDisplay();this._replaceDisplay(e);this._visibleDirty=true;this._blendModeDirty=true;this._colorDirty=true}if(r===this._rawDisplay||r===this._meshDisplay){this._updateFrame()}if(this._childArmature!==i){if(i!==null){i._parent=null;i.clock=null;if(i.inheritAnimation){i.animation.reset()}}if(this._childArmature!==null){this._childArmature._parent=this;this._childArmature.clock=this._armature.clock;if(this._childArmature.inheritAnimation){if(this._childArmature.cacheFrameRate===0){var a=this._armature.cacheFrameRate;if(a!==0){this._childArmature.cacheFrameRate=a}}var n=null;if(this._displayData!==null&&this._displayData.type===1){n=this._displayData.actions}else{var s=this._displayIndex>=0&&this._rawDisplayDatas!==null&&this._displayIndex<this._rawDisplayDatas.length?this._rawDisplayDatas[this._displayIndex]:null;if(s!==null&&s.type===1){n=s.actions}}if(n!==null&&n.length>0){for(var o=0,l=n;o<l.length;o++){var h=l[o];this._childArmature._bufferAction(h,false)}}else{this._childArmature.animation.play()}}}}};i.prototype._updateGlobalTransformMatrix=function(t){this.globalTransformMatrix.copyFrom(this._localMatrix);this.globalTransformMatrix.concat(this._parent.globalTransformMatrix);if(t){this.global.fromMatrix(this.globalTransformMatrix)}else{this._globalDirty=true}};i.prototype._isMeshBonesUpdate=function(){for(var t=0,e=this._meshBones;t<e.length;t++){var i=e[t];if(i!==null&&i._childrenTransformDirty){return true}}return false};i.prototype._setArmature=function(t){if(this._armature===t){return}if(this._armature!==null){this._armature._removeSlotFromSlotList(this)}this._armature=t;this._onUpdateDisplay();if(this._armature!==null){this._armature._addSlotToSlotList(this);this._addDisplay()}else{this._removeDisplay()}};i.prototype._setDisplayIndex=function(t,e){if(e===void 0){e=false}if(e){if(this._animationDisplayIndex===t){return false}this._animationDisplayIndex=t}if(this._displayIndex===t){return false}this._displayIndex=t;this._displayDirty=true;this._updateDisplayData();return this._displayDirty};i.prototype._setZorder=function(t){if(this._zOrder===t){}this._zOrder=t;this._zOrderDirty=true;return this._zOrderDirty};i.prototype._setColor=function(t){this._colorTransform.copyFrom(t);this._colorDirty=true;return this._colorDirty};i.prototype._setDisplayList=function(e){if(e!==null&&e.length>0){if(this._displayList.length!==e.length){this._displayList.length=e.length}for(var i=0,r=e.length;i<r;++i){var a=e[i];if(a!==null&&a!==this._rawDisplay&&a!==this._meshDisplay&&!(a instanceof t.Armature)&&this._displayList.indexOf(a)<0){this._initDisplay(a)}this._displayList[i]=a}}else if(this._displayList.length>0){this._displayList.length=0}if(this._displayIndex>=0&&this._displayIndex<this._displayList.length){this._displayDirty=this._display!==this._displayList[this._displayIndex]}else{this._displayDirty=this._display!==null}this._updateDisplayData();return this._displayDirty};i.prototype.init=function(t,e,i,r){if(this._slotData!==null){return}this._slotData=t;this._visibleDirty=true;this._blendModeDirty=true;this._colorDirty=true;this._blendMode=this._slotData.blendMode;this._zOrder=this._slotData.zOrder;this._colorTransform.copyFrom(this._slotData.color);this._rawDisplay=i;this._meshDisplay=r;this.rawDisplayDatas=e};i.prototype.update=function(t){if(this._displayDirty){this._displayDirty=false;this._updateDisplay();if(this._transformDirty){if(this.origin!==null){this.global.copyFrom(this.origin).add(this.offset).toMatrix(this._localMatrix)}else{this.global.copyFrom(this.offset).toMatrix(this._localMatrix)}}}if(this._zOrderDirty){this._zOrderDirty=false;this._updateZOrder()}if(t>=0&&this._cachedFrameIndices!==null){var e=this._cachedFrameIndices[t];if(e>=0&&this._cachedFrameIndex===e){this._transformDirty=false}else if(e>=0){this._transformDirty=true;this._cachedFrameIndex=e}else if(this._transformDirty||this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty=false;this._cachedFrameIndices[t]=this._cachedFrameIndex}else{this._transformDirty=true;this._cachedFrameIndex=-1}}else if(this._transformDirty||this._parent._childrenTransformDirty){t=-1;this._transformDirty=true;this._cachedFrameIndex=-1}if(this._display===null){return}if(this._visibleDirty){this._visibleDirty=false;this._updateVisible()}if(this._blendModeDirty){this._blendModeDirty=false;this._updateBlendMode()}if(this._colorDirty){this._colorDirty=false;this._updateColor()}if(this._meshData!==null&&this._display===this._meshDisplay){var i=this._meshData.weight!==null;if(this._meshDirty||i&&this._isMeshBonesUpdate()){this._meshDirty=false;this._updateMesh()}if(i){if(this._transformDirty&&this._skinedMeshTransformDirty){this._transformDirty=false;this._skinedMeshTransformDirty=false;this._updateTransform(true)}return}}if(this._transformDirty){this._transformDirty=false;if(this._cachedFrameIndex<0){var r=t>=0;this._updateGlobalTransformMatrix(r);if(r&&this._cachedFrameIndices!==null){this._cachedFrameIndex=this._cachedFrameIndices[t]=this._armature._armatureData.setCacheFrame(this.globalTransformMatrix,this.global)}}else{this._armature._armatureData.getCacheFrame(this.globalTransformMatrix,this.global,this._cachedFrameIndex)}this._updateTransform(false)}};i.prototype.updateTransformAndMatrix=function(){if(this._transformDirty){this._transformDirty=false;this._updateGlobalTransformMatrix(false)}};i.prototype.replaceDisplayData=function(t,e){if(e===void 0){e=-1}if(e<0){if(this._displayIndex<0){e=0}else{e=this._displayIndex}}if(this._displayDatas.length<=e){this._displayDatas.length=e+1;for(var i=0,r=this._displayDatas.length;i<r;++i){if(!this._displayDatas[i]){this._displayDatas[i]=null}}}this._displayDatas[e]=t};i.prototype.containsPoint=function(t,e){if(this._boundingBoxData===null){return false}this.updateTransformAndMatrix();i._helpMatrix.copyFrom(this.globalTransformMatrix);i._helpMatrix.invert();i._helpMatrix.transformPoint(t,e,i._helpPoint);return this._boundingBoxData.containsPoint(i._helpPoint.x,i._helpPoint.y)};i.prototype.intersectsSegment=function(t,e,r,a,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(this._boundingBoxData===null){return 0}this.updateTransformAndMatrix();i._helpMatrix.copyFrom(this.globalTransformMatrix);i._helpMatrix.invert();i._helpMatrix.transformPoint(t,e,i._helpPoint);t=i._helpPoint.x;e=i._helpPoint.y;i._helpMatrix.transformPoint(r,a,i._helpPoint);r=i._helpPoint.x;a=i._helpPoint.y;var l=this._boundingBoxData.intersectsSegment(t,e,r,a,n,s,o);if(l>0){if(l===1||l===2){if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n);if(s!==null){s.x=n.x;s.y=n.y}}else if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}else{if(n!==null){this.globalTransformMatrix.transformPoint(n.x,n.y,n)}if(s!==null){this.globalTransformMatrix.transformPoint(s.x,s.y,s)}}if(o!==null){this.globalTransformMatrix.transformPoint(Math.cos(o.x),Math.sin(o.x),i._helpPoint,true);o.x=Math.atan2(i._helpPoint.y,i._helpPoint.x);this.globalTransformMatrix.transformPoint(Math.cos(o.y),Math.sin(o.y),i._helpPoint,true);o.y=Math.atan2(i._helpPoint.y,i._helpPoint.x)}}return l};i.prototype.invalidUpdate=function(){this._displayDirty=true;this._transformDirty=true};Object.defineProperty(i.prototype,"visible",{get:function(){return this._visible},set:function(t){if(this._visible===t){return}this._visible=t;this._updateVisible()},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"displayIndex",{get:function(){return this._displayIndex},set:function(t){if(this._setDisplayIndex(t)){this.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"name",{get:function(){return this._slotData.name},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"displayList",{get:function(){return this._displayList.concat()},set:function(e){var i=this._displayList.concat();var r=new Array;if(this._setDisplayList(e)){this.update(-1)}for(var a=0,n=i;a<n.length;a++){var s=n[a];if(s!==null&&s!==this._rawDisplay&&s!==this._meshDisplay&&this._displayList.indexOf(s)<0&&r.indexOf(s)<0){r.push(s)}}for(var o=0,l=r;o<l.length;o++){var s=l[o];if(s instanceof t.Armature){s.dispose()}else{this._disposeDisplay(s)}}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"slotData",{get:function(){return this._slotData},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"rawDisplayDatas",{get:function(){return this._rawDisplayDatas},set:function(t){if(this._rawDisplayDatas===t){return}this._displayDirty=true;this._rawDisplayDatas=t;if(this._rawDisplayDatas){this._displayDatas.length=this._rawDisplayDatas.length;for(var e=0,i=this._displayDatas.length;e<i;++e){this._displayDatas[e]=this._rawDisplayDatas[e]}}else{this._displayDatas.length=0}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"boundingBoxData",{get:function(){return this._boundingBoxData},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"rawDisplay",{get:function(){return this._rawDisplay},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"meshDisplay",{get:function(){return this._meshDisplay},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"display",{get:function(){return this._display},set:function(t){if(this._display===t){return}var e=this._displayList.length;if(this._displayIndex<0&&e===0){this._displayIndex=0}if(this._displayIndex<0){return}else{var i=this.displayList;if(e<=this._displayIndex){i.length=this._displayIndex+1}i[this._displayIndex]=t;this.displayList=i}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"childArmature",{get:function(){return this._childArmature},set:function(t){if(this._childArmature===t){return}this.display=t},enumerable:true,configurable:true});i.prototype.getDisplay=function(){return this.display};i.prototype.setDisplay=function(t){this.display=t};return i}(t.TransformObject);t.Slot=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.prototype._onClear=function(){this._armature=null;this._target=null;this._root=null;this._bone=null};Object.defineProperty(i.prototype,"name",{get:function(){return this._constraintData.name},enumerable:true,configurable:true});i._helpMatrix=new t.Matrix;i._helpTransform=new t.Transform;i._helpPoint=new t.Point;return i}(t.BaseObject);t.Constraint=e;var i=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.toString=function(){return"[class dragonBones.IKConstraint]"};i.prototype._onClear=function(){e.prototype._onClear.call(this);this._scaleEnabled=false;this._bendPositive=false;this._weight=1;this._constraintData=null};i.prototype._computeA=function(){var t=this._target.global;var e=this._root.global;var i=this._root.globalTransformMatrix;var r=Math.atan2(t.y-e.y,t.x-e.x);if(e.scaleX<0){r+=Math.PI}e.rotation+=(r-e.rotation)*this._weight;e.toMatrix(i)};i.prototype._computeB=function(){var e=this._bone._boneData.length;var i=this._root;var r=this._target.global;var a=i.global;var n=this._bone.global;var s=this._bone.globalTransformMatrix;var o=s.a*e;var l=s.b*e;var h=o*o+l*l;var u=Math.sqrt(h);var f=n.x-a.x;var _=n.y-a.y;var c=f*f+_*_;var p=Math.sqrt(c);var m=n.rotation;var d=a.rotation;var y=Math.atan2(_,f);f=r.x-a.x;_=r.y-a.y;var g=f*f+_*_;var v=Math.sqrt(g);var b=0;if(u+p<=v||v+u<=p||v+p<=u){b=Math.atan2(r.y-a.y,r.x-a.x);if(u+p<=v){}else if(p<u){b+=Math.PI}}else{var T=(c-h+g)/(2*g);var D=Math.sqrt(c-T*T*g)/v;var A=a.x+f*T;var x=a.y+_*T;var O=-_*D;var S=f*D;var E=false;if(i._parent!==null){var B=i._parent.globalTransformMatrix;E=B.a*B.d-B.b*B.c<0}if(E!==this._bendPositive){n.x=A-O;n.y=x-S}else{n.x=A+O;n.y=x+S}b=Math.atan2(n.y-a.y,n.x-a.x)}var M=t.Transform.normalizeRadian(b-y);a.rotation=d+M*this._weight;a.toMatrix(i.globalTransformMatrix);var w=y+M*this._weight;n.x=a.x+Math.cos(w)*p;n.y=a.y+Math.sin(w)*p;var P=Math.atan2(r.y-n.y,r.x-n.x);if(n.scaleX<0){P+=Math.PI}n.rotation=a.rotation+m-d+t.Transform.normalizeRadian(P-M-m)*this._weight;n.toMatrix(s)};i.prototype.init=function(t,e){if(this._constraintData!==null){return}this._constraintData=t;this._armature=e;this._target=this._armature.getBone(this._constraintData.target.name);this._root=this._armature.getBone(this._constraintData.root.name);this._bone=this._constraintData.bone!==null?this._armature.getBone(this._constraintData.bone.name):null;{var i=this._constraintData;this._scaleEnabled=i.scaleEnabled;this._bendPositive=i.bendPositive;this._weight=i.weight}this._root._hasConstraint=true};i.prototype.update=function(){this._root.updateByConstraint();if(this._bone!==null){this._bone.updateByConstraint();this._computeB()}else{this._computeA()}};i.prototype.invalidUpdate=function(){this._root.invalidUpdate();if(this._bone!==null){this._bone.invalidUpdate()}};return i}(e);t.IKConstraint=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t){if(t===void 0){t=-1}this.time=0;this.timeScale=1;this._animatebles=[];this._clock=null;if(t<0){this.time=(new Date).getTime()*.001}else{this.time=t}}t.prototype.advanceTime=function(t){if(t!==t){t=0}if(t<0){t=(new Date).getTime()*.001-this.time}if(this.timeScale!==1){t*=this.timeScale}if(t<0){this.time-=t}else{this.time+=t}if(t===0){return}var e=0,i=0,r=this._animatebles.length;for(;e<r;++e){var a=this._animatebles[e];if(a!==null){if(i>0){this._animatebles[e-i]=a;this._animatebles[e]=null}a.advanceTime(t)}else{i++}}if(i>0){r=this._animatebles.length;for(;e<r;++e){var n=this._animatebles[e];if(n!==null){this._animatebles[e-i]=n}else{i++}}this._animatebles.length-=i}};t.prototype.contains=function(t){if(t===this){return false}var e=t;while(e!==this&&e!==null){e=e.clock}return e===this};t.prototype.add=function(t){if(this._animatebles.indexOf(t)<0){this._animatebles.push(t);t.clock=this}};t.prototype.remove=function(t){var e=this._animatebles.indexOf(t);if(e>=0){this._animatebles[e]=null;t.clock=null}};t.prototype.clear=function(){for(var t=0,e=this._animatebles;t<e.length;t++){var i=e[t];if(i!==null){i.clock=null}}};Object.defineProperty(t.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock===t){return}if(this._clock!==null){this._clock.remove(this)}this._clock=t;if(this._clock!==null){this._clock.add(this)}},enumerable:true,configurable:true});t.clock=new t;return t}();t.WorldClock=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var t=e!==null&&e.apply(this,arguments)||this;t._animationNames=[];t._animationStates=[];t._animations={};t._animationConfig=null;return t}i.toString=function(){return"[class dragonBones.Animation]"};i.prototype._onClear=function(){for(var t=0,e=this._animationStates;t<e.length;t++){var i=e[t];i.returnToPool()}for(var r in this._animations){delete this._animations[r]}if(this._animationConfig!==null){this._animationConfig.returnToPool()}this.timeScale=1;this._animationDirty=false;this._inheritTimeScale=1;this._animationNames.length=0;this._animationStates.length=0;this._armature=null;this._animationConfig=null;this._lastAnimationState=null};i.prototype._fadeOut=function(t){switch(t.fadeOutMode){case 1:for(var e=0,i=this._animationStates;e<i.length;e++){var r=i[e];if(r.layer===t.layer){r.fadeOut(t.fadeOutTime,t.pauseFadeOut)}}break;case 2:for(var a=0,n=this._animationStates;a<n.length;a++){var r=n[a];if(r.group===t.group){r.fadeOut(t.fadeOutTime,t.pauseFadeOut)}}break;case 3:for(var s=0,o=this._animationStates;s<o.length;s++){var r=o[s];if(r.layer===t.layer&&r.group===t.group){r.fadeOut(t.fadeOutTime,t.pauseFadeOut)}}break;case 4:for(var l=0,h=this._animationStates;l<h.length;l++){var r=h[l];r.fadeOut(t.fadeOutTime,t.pauseFadeOut)}break;case 0:case 5:default:break}};i.prototype.init=function(e){if(this._armature!==null){return}this._armature=e;this._animationConfig=t.BaseObject.borrowObject(t.AnimationConfig)};i.prototype.advanceTime=function(t){if(t<0){t=-t}if(this._armature.inheritAnimation&&this._armature._parent!==null){this._inheritTimeScale=this._armature._parent._armature.animation._inheritTimeScale*this.timeScale}else{this._inheritTimeScale=this.timeScale}if(this._inheritTimeScale!==1){t*=this._inheritTimeScale}var e=this._animationStates.length;if(e===1){var i=this._animationStates[0];if(i._fadeState>0&&i._subFadeState>0){this._armature._dragonBones.bufferObject(i);this._animationStates.length=0;this._lastAnimationState=null}else{var r=i._animationData;var a=r.cacheFrameRate;if(this._animationDirty&&a>0){this._animationDirty=false;for(var n=0,s=this._armature.getBones();n<s.length;n++){var o=s[n];o._cachedFrameIndices=r.getBoneCachedFrameIndices(o.name)}for(var l=0,h=this._armature.getSlots();l<h.length;l++){var u=h[l];u._cachedFrameIndices=r.getSlotCachedFrameIndices(u.name)}}i.advanceTime(t,a)}}else if(e>1){for(var f=0,_=0;f<e;++f){var i=this._animationStates[f];if(i._fadeState>0&&i._subFadeState>0){_++;this._armature._dragonBones.bufferObject(i);this._animationDirty=true;if(this._lastAnimationState===i){this._lastAnimationState=null}}else{if(_>0){this._animationStates[f-_]=i}i.advanceTime(t,0)}if(f===e-1&&_>0){this._animationStates.length-=_;if(this._lastAnimationState===null&&this._animationStates.length>0){this._lastAnimationState=this._animationStates[this._animationStates.length-1]}}}this._armature._cacheFrameIndex=-1}else{this._armature._cacheFrameIndex=-1}};i.prototype.reset=function(){for(var t=0,e=this._animationStates;t<e.length;t++){var i=e[t];i.returnToPool()}this._animationDirty=false;this._animationConfig.clear();this._animationStates.length=0;this._lastAnimationState=null};i.prototype.stop=function(t){if(t===void 0){t=null}if(t!==null){var e=this.getState(t);if(e!==null){e.stop()}}else{for(var i=0,r=this._animationStates;i<r.length;i++){var e=r[i];e.stop()}}};i.prototype.playConfig=function(e){var i=e.animation;if(!(i in this._animations)){console.warn("Non-existent animation.\n","DragonBones name: "+this._armature.armatureData.parent.name,"Armature name: "+this._armature.name,"Animation name: "+i);return null}var r=this._animations[i];if(e.fadeOutMode===5){for(var a=0,n=this._animationStates;a<n.length;a++){var s=n[a];if(s._animationData===r){return s}}}if(this._animationStates.length===0){e.fadeInTime=0}else if(e.fadeInTime<0){e.fadeInTime=r.fadeInTime}if(e.fadeOutTime<0){e.fadeOutTime=e.fadeInTime}if(e.timeScale<=-100){e.timeScale=1/r.scale}if(r.frameCount>1){if(e.position<0){e.position%=r.duration;e.position=r.duration-e.position}else if(e.position===r.duration){e.position-=1e-6}else if(e.position>r.duration){e.position%=r.duration}if(e.duration>0&&e.position+e.duration>r.duration){e.duration=r.duration-e.position}if(e.playTimes<0){e.playTimes=r.playTimes}}else{e.playTimes=1;e.position=0;if(e.duration>0){e.duration=0}}if(e.duration===0){e.duration=-1}this._fadeOut(e);var o=t.BaseObject.borrowObject(t.AnimationState);o.init(this._armature,r,e);this._animationDirty=true;this._armature._cacheFrameIndex=-1;if(this._animationStates.length>0){var l=false;for(var h=0,u=this._animationStates.length;h<u;++h){if(o.layer>=this._animationStates[h].layer){}else{l=true;this._animationStates.splice(h,0,o);break}}if(!l){this._animationStates.push(o)}}else{this._animationStates.push(o)}for(var f=0,_=this._armature.getSlots();f<_.length;f++){var c=_[f];var p=c.childArmature;if(p!==null&&p.inheritAnimation&&p.animation.hasAnimation(i)&&p.animation.getState(i)===null){p.animation.fadeIn(i)}}if(e.fadeInTime<=0){this._armature.advanceTime(0)}this._lastAnimationState=o;return o};i.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t!==null?t:"";if(t!==null&&t.length>0){this.playConfig(this._animationConfig)}else if(this._lastAnimationState===null){var i=this._armature.armatureData.defaultAnimation;if(i!==null){this._animationConfig.animation=i.name;this.playConfig(this._animationConfig)}}else if(!this._lastAnimationState.isPlaying&&!this._lastAnimationState.isCompleted){this._lastAnimationState.play()}else{this._animationConfig.animation=this._lastAnimationState.name;this.playConfig(this._animationConfig)}return this._lastAnimationState};i.prototype.fadeIn=function(t,e,i,r,a,n){if(e===void 0){e=-1}if(i===void 0){i=-1}if(r===void 0){r=0}if(a===void 0){a=null}if(n===void 0){n=3}this._animationConfig.clear();this._animationConfig.fadeOutMode=n;this._animationConfig.playTimes=i;this._animationConfig.layer=r;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=a!==null?a:"";return this.playConfig(this._animationConfig)};i.prototype.gotoAndPlayByTime=function(t,e,i){if(e===void 0){e=0}if(i===void 0){i=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=i;this._animationConfig.position=e;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;return this.playConfig(this._animationConfig)};i.prototype.gotoAndPlayByFrame=function(t,e,i){if(e===void 0){e=0}if(i===void 0){i=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=i;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*e/r.frameCount}return this.playConfig(this._animationConfig)};i.prototype.gotoAndPlayByProgress=function(t,e,i){if(e===void 0){e=0}if(i===void 0){i=-1}this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.playTimes=i;this._animationConfig.fadeInTime=0;this._animationConfig.animation=t;var r=t in this._animations?this._animations[t]:null;if(r!==null){this._animationConfig.position=r.duration*(e>0?e:0)}return this.playConfig(this._animationConfig)};i.prototype.gotoAndStopByTime=function(t,e){if(e===void 0){e=0}var i=this.gotoAndPlayByTime(t,e,1);if(i!==null){i.stop()}return i};i.prototype.gotoAndStopByFrame=function(t,e){if(e===void 0){e=0}var i=this.gotoAndPlayByFrame(t,e,1);if(i!==null){i.stop()}return i};i.prototype.gotoAndStopByProgress=function(t,e){if(e===void 0){e=0}var i=this.gotoAndPlayByProgress(t,e,1);if(i!==null){i.stop()}return i};i.prototype.getState=function(t){var e=this._animationStates.length;while(e--){var i=this._animationStates[e];if(i.name===t){return i}}return null};i.prototype.hasAnimation=function(t){return t in this._animations};i.prototype.getStates=function(){return this._animationStates};Object.defineProperty(i.prototype,"isPlaying",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++){var i=e[t];if(i.isPlaying){return true}}return false},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"isCompleted",{get:function(){for(var t=0,e=this._animationStates;t<e.length;t++){var i=e[t];if(!i.isCompleted){return false}}return this._animationStates.length>0},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"lastAnimationName",{get:function(){return this._lastAnimationState!==null?this._lastAnimationState.name:""},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animationNames",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animations",{get:function(){return this._animations},set:function(t){if(this._animations===t){return}this._animationNames.length=0;for(var e in this._animations){delete this._animations[e]}for(var e in t){this._animationNames.push(e);this._animations[e]=t[e]}},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animationConfig",{get:function(){this._animationConfig.clear();return this._animationConfig},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"lastAnimationState",{get:function(){return this._lastAnimationState},enumerable:true,configurable:true});i.prototype.gotoAndPlay=function(t,e,i,r,a,n,s,o,l){if(e===void 0){e=-1}if(i===void 0){i=-1}if(r===void 0){r=-1}if(a===void 0){a=0}if(n===void 0){n=null}if(s===void 0){s=3}if(o===void 0){o=true}if(l===void 0){l=true}o;l;this._animationConfig.clear();this._animationConfig.resetToPose=true;this._animationConfig.fadeOutMode=s;this._animationConfig.playTimes=r;this._animationConfig.layer=a;this._animationConfig.fadeInTime=e;this._animationConfig.animation=t;this._animationConfig.group=n!==null?n:"";var h=this._animations[t];if(h&&i>0){this._animationConfig.timeScale=h.duration/i}return this.playConfig(this._animationConfig)};i.prototype.gotoAndStop=function(t,e){if(e===void 0){e=0}return this.gotoAndStopByTime(t,e)};Object.defineProperty(i.prototype,"animationList",{get:function(){return this._animationNames},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animationDataList",{get:function(){var t=[];for(var e=0,i=this._animationNames.length;e<i;++e){t.push(this._animations[this._animationNames[e]])}return t},enumerable:true,configurable:true});return i}(t.BaseObject);t.Animation=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;t._boneMask=[];t._boneTimelines=[];t._slotTimelines=[];t._constraintTimelines=[];t._poseTimelines=[];t._bonePoses={};t._actionTimeline=null;t._zOrderTimeline=null;return t}r.toString=function(){return"[class dragonBones.AnimationState]"};r.prototype._onClear=function(){for(var t=0,e=this._boneTimelines;t<e.length;t++){var i=e[t];i.returnToPool()}for(var r=0,a=this._slotTimelines;r<a.length;r++){var i=a[r];i.returnToPool()}for(var n=0,s=this._constraintTimelines;n<s.length;n++){var i=s[n];i.returnToPool()}for(var o in this._bonePoses){this._bonePoses[o].returnToPool();delete this._bonePoses[o]}if(this._actionTimeline!==null){this._actionTimeline.returnToPool()}if(this._zOrderTimeline!==null){this._zOrderTimeline.returnToPool()}this.actionEnabled=false;this.additiveBlending=false;this.displayControl=false;this.resetToPose=false;this.playTimes=1;this.layer=0;this.timeScale=1;this.weight=1;this.autoFadeOutTime=0;this.fadeTotalTime=0;this.name="";this.group="";this._timelineDirty=true;this._playheadState=0;this._fadeState=-1;this._subFadeState=-1;this._position=0;this._duration=0;this._fadeTime=0;this._time=0;this._fadeProgress=0;this._weightResult=0;this._boneMask.length=0;this._boneTimelines.length=0;this._slotTimelines.length=0;this._constraintTimelines.length=0;this._poseTimelines.length=0;this._animationData=null;this._armature=null;this._actionTimeline=null;this._zOrderTimeline=null};r.prototype._updateTimelines=function(){{var e={};for(var r=0,a=this._boneTimelines;r<a.length;r++){var n=a[r];var s=n.bone.name;if(!(s in e)){e[s]=[]}e[s].push(n)}for(var o=0,l=this._armature.getBones();o<l.length;o++){var h=l[o];var s=h.name;if(!this.containsBoneMask(s)){continue}var u=this._animationData.getBoneTimelines(s);if(s in e){delete e[s]}else{var f=s in this._bonePoses?this._bonePoses[s]:this._bonePoses[s]=t.BaseObject.borrowObject(i);if(u!==null){for(var _=0,c=u;_<c.length;_++){var p=c[_];switch(p.type){case 10:{var n=t.BaseObject.borrowObject(t.BoneAllTimelineState);n.bone=h;n.bonePose=f;n.init(this._armature,this,p);this._boneTimelines.push(n);break}case 11:{var n=t.BaseObject.borrowObject(t.BoneTranslateTimelineState);n.bone=h;n.bonePose=f;n.init(this._armature,this,p);this._boneTimelines.push(n);break}case 12:{var n=t.BaseObject.borrowObject(t.BoneRotateTimelineState);n.bone=h;n.bonePose=f;n.init(this._armature,this,p);this._boneTimelines.push(n);break}case 13:{var n=t.BaseObject.borrowObject(t.BoneScaleTimelineState);n.bone=h;n.bonePose=f;n.init(this._armature,this,p);this._boneTimelines.push(n);break}default:break}}}else if(this.resetToPose){var n=t.BaseObject.borrowObject(t.BoneAllTimelineState);n.bone=h;n.bonePose=f;n.init(this._armature,this,null);this._boneTimelines.push(n);this._poseTimelines.push(n)}}}for(var m in e){for(var d=0,y=e[m];d<y.length;d++){var n=y[d];this._boneTimelines.splice(this._boneTimelines.indexOf(n),1);n.returnToPool()}}}{var g={};var v=[];for(var b=0,T=this._slotTimelines;b<T.length;b++){var n=T[b];var s=n.slot.name;if(!(s in g)){g[s]=[]}g[s].push(n)}for(var D=0,A=this._armature.getSlots();D<A.length;D++){var x=A[D];var O=x.parent.name;if(!this.containsBoneMask(O)){continue}var s=x.name;var u=this._animationData.getSlotTimelines(s);if(s in g){delete g[s]}else{var S=false;var E=false;v.length=0;if(u!==null){for(var B=0,M=u;B<M.length;B++){var p=M[B];switch(p.type){case 20:{var n=t.BaseObject.borrowObject(t.SlotDislayTimelineState);n.slot=x;n.init(this._armature,this,p);this._slotTimelines.push(n);S=true;break}case 21:{var n=t.BaseObject.borrowObject(t.SlotColorTimelineState);n.slot=x;n.init(this._armature,this,p);this._slotTimelines.push(n);E=true;break}case 22:{var n=t.BaseObject.borrowObject(t.SlotFFDTimelineState);n.slot=x;n.init(this._armature,this,p);this._slotTimelines.push(n);v.push(n.meshOffset);break}default:break}}}if(this.resetToPose){if(!S){var n=t.BaseObject.borrowObject(t.SlotDislayTimelineState);n.slot=x;n.init(this._armature,this,null);this._slotTimelines.push(n);this._poseTimelines.push(n)}if(!E){var n=t.BaseObject.borrowObject(t.SlotColorTimelineState);n.slot=x;n.init(this._armature,this,null);this._slotTimelines.push(n);this._poseTimelines.push(n)}if(x.rawDisplayDatas!==null){for(var w=0,P=x.rawDisplayDatas;w<P.length;w++){var C=P[w];if(C!==null&&C.type===2){var I=C.offset;if(v.indexOf(I)<0){var n=t.BaseObject.borrowObject(t.SlotFFDTimelineState);n.meshOffset=I;n.slot=x;n.init(this._armature,this,null);this._slotTimelines.push(n);this._poseTimelines.push(n)}}}}}}}for(var m in g){for(var F=0,N=g[m];F<N.length;F++){var n=N[F];this._slotTimelines.splice(this._slotTimelines.indexOf(n),1);n.returnToPool()}}}{var R={};for(var j=0,k=this._constraintTimelines;j<k.length;j++){var n=k[j];var s=n.constraint.name;if(!(s in R)){R[s]=[]}R[s].push(n)}for(var L=0,U=this._armature._constraints;L<U.length;L++){var Y=U[L];var s=Y.name;var u=this._animationData.getConstraintTimelines(s);if(s in R){delete R[s]}else{if(u!==null){for(var V=0,$=u;V<$.length;V++){var p=$[V];switch(p.type){case 30:{var n=t.BaseObject.borrowObject(t.IKConstraintTimelineState);n.constraint=Y;n.init(this._armature,this,p);this._constraintTimelines.push(n);break}default:break}}}else if(this.resetToPose){var n=t.BaseObject.borrowObject(t.IKConstraintTimelineState);n.constraint=Y;n.init(this._armature,this,null);this._constraintTimelines.push(n);this._poseTimelines.push(n)}}}for(var m in R){for(var X=0,H=R[m];X<H.length;X++){var n=H[X];this._constraintTimelines.splice(this._constraintTimelines.indexOf(n),1);n.returnToPool()}}}};r.prototype._advanceFadeTime=function(e){var i=this._fadeState>0;if(this._subFadeState<0){this._subFadeState=0;var r=i?t.EventObject.FADE_OUT:t.EventObject.FADE_IN;if(this._armature.eventDispatcher.hasDBEventListener(r)){var a=t.BaseObject.borrowObject(t.EventObject);a.type=r;a.armature=this._armature;a.animationState=this;this._armature._dragonBones.bufferEvent(a)}}if(e<0){e=-e}this._fadeTime+=e;if(this._fadeTime>=this.fadeTotalTime){this._subFadeState=1;this._fadeProgress=i?0:1}else if(this._fadeTime>0){this._fadeProgress=i?1-this._fadeTime/this.fadeTotalTime:this._fadeTime/this.fadeTotalTime}else{this._fadeProgress=i?1:0}if(this._subFadeState>0){if(!i){this._playheadState|=1;this._fadeState=0}var r=i?t.EventObject.FADE_OUT_COMPLETE:t.EventObject.FADE_IN_COMPLETE;if(this._armature.eventDispatcher.hasDBEventListener(r)){var a=t.BaseObject.borrowObject(t.EventObject);a.type=r;a.armature=this._armature;a.animationState=this;this._armature._dragonBones.bufferEvent(a)}}};r.prototype._blendBoneTimline=function(t){var e=this._weightResult>0?this._weightResult:-this._weightResult;var i=t.bone;var r=t.bonePose.result;var a=i.animationPose;if(!i._blendDirty){i._blendDirty=true;i._blendLayer=this.layer;i._blendLayerWeight=e;i._blendLeftWeight=1;a.x=r.x*e;a.y=r.y*e;a.rotation=r.rotation*e;a.skew=r.skew*e;a.scaleX=(r.scaleX-1)*e+1;a.scaleY=(r.scaleY-1)*e+1}else{e*=i._blendLeftWeight;i._blendLayerWeight+=e;a.x+=r.x*e;a.y+=r.y*e;a.rotation+=r.rotation*e;a.skew+=r.skew*e;a.scaleX+=(r.scaleX-1)*e;a.scaleY+=(r.scaleY-1)*e}if(this._fadeState!==0||this._subFadeState!==0){i._transformDirty=true}};r.prototype.init=function(e,i,r){if(this._armature!==null){return}this._armature=e;this._animationData=i;this.resetToPose=r.resetToPose;this.additiveBlending=r.additiveBlending;this.displayControl=r.displayControl;this.actionEnabled=r.actionEnabled;this.layer=r.layer;this.playTimes=r.playTimes;this.timeScale=r.timeScale;this.fadeTotalTime=r.fadeInTime;this.autoFadeOutTime=r.autoFadeOutTime;this.weight=r.weight;this.name=r.name.length>0?r.name:r.animation;this.group=r.group;if(r.pauseFadeIn){this._playheadState=2}else{this._playheadState=3}if(r.duration<0){this._position=0;this._duration=this._animationData.duration;if(r.position!==0){if(this.timeScale>=0){this._time=r.position}else{this._time=r.position-this._duration}}else{this._time=0}}else{this._position=r.position;this._duration=r.duration;this._time=0}if(this.timeScale<0&&this._time===0){this._time=-1e-6}if(this.fadeTotalTime<=0){this._fadeProgress=.999999}if(r.boneMask.length>0){this._boneMask.length=r.boneMask.length;for(var a=0,n=this._boneMask.length;a<n;++a){this._boneMask[a]=r.boneMask[a]}}this._actionTimeline=t.BaseObject.borrowObject(t.ActionTimelineState);this._actionTimeline.init(this._armature,this,this._animationData.actionTimeline);this._actionTimeline.currentTime=this._time;if(this._actionTimeline.currentTime<0){this._actionTimeline.currentTime=this._duration-this._actionTimeline.currentTime}if(this._animationData.zOrderTimeline!==null){this._zOrderTimeline=t.BaseObject.borrowObject(t.ZOrderTimelineState);this._zOrderTimeline.init(this._armature,this,this._animationData.zOrderTimeline)}};r.prototype.advanceTime=function(e,i){if(this._fadeState!==0||this._subFadeState!==0){this._advanceFadeTime(e)}if(this._playheadState===3){if(this.timeScale!==1){e*=this.timeScale}this._time+=e}if(this._timelineDirty){this._timelineDirty=false;this._updateTimelines()}if(this.weight===0){return}var r=this._fadeState===0&&i>0;var a=true;var n=true;var s=this._time;this._weightResult=this.weight*this._fadeProgress;if(this._actionTimeline.playState<=0){this._actionTimeline.update(s)}if(r){var o=i*2;this._actionTimeline.currentTime=Math.floor(this._actionTimeline.currentTime*o)/o}if(this._zOrderTimeline!==null&&this._zOrderTimeline.playState<=0){this._zOrderTimeline.update(s)}if(r){var l=Math.floor(this._actionTimeline.currentTime*i);if(this._armature._cacheFrameIndex===l){a=false;n=false}else{this._armature._cacheFrameIndex=l;if(this._animationData.cachedFrames[l]){n=false}else{this._animationData.cachedFrames[l]=true}}}if(a){if(n){var h=null;var u=null;for(var f=0,_=this._boneTimelines.length;f<_;++f){var c=this._boneTimelines[f];if(h!==c.bone){if(h!==null){this._blendBoneTimline(u);if(h._blendDirty){if(h._blendLeftWeight>0){if(h._blendLayer!==this.layer){if(h._blendLayerWeight>=h._blendLeftWeight){h._blendLeftWeight=0;h=null}else{h._blendLayer=this.layer;h._blendLeftWeight-=h._blendLayerWeight;h._blendLayerWeight=0}}}else{h=null}}}h=c.bone}if(h!==null){if(c.playState<=0){c.update(s)}if(f===_-1){this._blendBoneTimline(c)}else{u=c}}}}if(this.displayControl){for(var f=0,_=this._slotTimelines.length;f<_;++f){var c=this._slotTimelines[f];var p=c.slot.displayController;if(p===null||p===this.name||p===this.group){if(c.playState<=0){c.update(s)}}}}for(var f=0,_=this._constraintTimelines.length;f<_;++f){var c=this._constraintTimelines[f];if(c.playState<=0){c.update(s)}}}if(this._fadeState===0){if(this._subFadeState>0){this._subFadeState=0;if(this._poseTimelines.length>0){for(var m=0,d=this._poseTimelines;m<d.length;m++){var c=d[m];if(c instanceof t.BoneTimelineState){var y=this._boneTimelines.indexOf(c);this._boneTimelines.splice(y,1)}else if(c instanceof t.SlotTimelineState){var y=this._slotTimelines.indexOf(c);this._slotTimelines.splice(y,1)}else if(c instanceof t.ConstraintTimelineState){var y=this._constraintTimelines.indexOf(c);this._constraintTimelines.splice(y,1)}c.returnToPool()}this._poseTimelines.length=0}}if(this._actionTimeline.playState>0){if(this.autoFadeOutTime>=0){this.fadeOut(this.autoFadeOutTime)}}}};r.prototype.play=function(){this._playheadState=3};r.prototype.stop=function(){this._playheadState&=1};r.prototype.fadeOut=function(t,e){if(e===void 0){e=true}if(t<0){t=0}if(e){this._playheadState&=2}if(this._fadeState>0){if(t>this.fadeTotalTime-this._fadeTime){return}}else{this._fadeState=1;this._subFadeState=-1;if(t<=0||this._fadeProgress<=0){this._fadeProgress=1e-6}for(var i=0,r=this._boneTimelines;i<r.length;i++){var a=r[i];a.fadeOut()}for(var n=0,s=this._slotTimelines;n<s.length;n++){var a=s[n];a.fadeOut()}}this.displayControl=false;this.fadeTotalTime=this._fadeProgress>1e-6?t/this._fadeProgress:0;this._fadeTime=this.fadeTotalTime*(1-this._fadeProgress)};r.prototype.containsBoneMask=function(t){return this._boneMask.length===0||this._boneMask.indexOf(t)>=0};r.prototype.addBoneMask=function(t,e){if(e===void 0){e=true}var i=this._armature.getBone(t);if(i===null){return}if(this._boneMask.indexOf(t)<0){this._boneMask.push(t)}if(e){for(var r=0,a=this._armature.getBones();r<a.length;r++){var n=a[r];if(this._boneMask.indexOf(n.name)<0&&i.contains(n)){this._boneMask.push(n.name)}}}this._timelineDirty=true};r.prototype.removeBoneMask=function(t,e){if(e===void 0){e=true}var i=this._boneMask.indexOf(t);if(i>=0){this._boneMask.splice(i,1)}if(e){var r=this._armature.getBone(t);if(r!==null){var a=this._armature.getBones();if(this._boneMask.length>0){for(var n=0,s=a;n<s.length;n++){var o=s[n];var l=this._boneMask.indexOf(o.name);if(l>=0&&r.contains(o)){this._boneMask.splice(l,1)}}}else{for(var h=0,u=a;h<u.length;h++){var o=u[h];if(o===r){continue}if(!r.contains(o)){this._boneMask.push(o.name)}}}}}this._timelineDirty=true};r.prototype.removeAllBoneMask=function(){this._boneMask.length=0;this._timelineDirty=true};Object.defineProperty(r.prototype,"isFadeIn",{get:function(){return this._fadeState<0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isFadeOut",{get:function(){return this._fadeState>0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isFadeComplete",{get:function(){return this._fadeState===0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isPlaying",{get:function(){return(this._playheadState&2)!==0&&this._actionTimeline.playState<=0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"isCompleted",{get:function(){return this._actionTimeline.playState>0},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentPlayTimes",{get:function(){return this._actionTimeline.currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"totalTime",{get:function(){return this._duration},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"currentTime",{get:function(){return this._actionTimeline.currentTime},set:function(t){var e=this._actionTimeline.currentPlayTimes-(this._actionTimeline.playState>0?1:0);if(t<0||this._duration<t){t=t%this._duration+e*this._duration;if(t<0){t+=this._duration}}if(this.playTimes>0&&e===this.playTimes-1&&t===this._duration){t=this._duration-1e-6}if(this._time===t){return}this._time=t;this._actionTimeline.setCurrentTime(this._time);if(this._zOrderTimeline!==null){this._zOrderTimeline.playState=-1}for(var i=0,r=this._boneTimelines;i<r.length;i++){var a=r[i];a.playState=-1}for(var n=0,s=this._slotTimelines;n<s.length;n++){var a=s[n];a.playState=-1}},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"animationData",{get:function(){return this._animationData},enumerable:true,configurable:true});return r}(t.BaseObject);t.AnimationState=e;var i=function(e){__extends(i,e);function i(){var i=e!==null&&e.apply(this,arguments)||this;i.current=new t.Transform;i.delta=new t.Transform;i.result=new t.Transform;return i}i.toString=function(){return"[class dragonBones.BonePose]"};i.prototype._onClear=function(){this.current.identity();this.delta.identity();this.result.identity()};return i}(t.BaseObject);t.BonePose=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){this.playState=-1;this.currentPlayTimes=-1;this.currentTime=-1;this._tweenState=0;this._frameRate=0;this._frameValueOffset=0;this._frameCount=0;this._frameOffset=0;this._frameIndex=-1;this._frameRateR=0;this._position=0;this._duration=0;this._timeScale=1;this._timeOffset=0;this._dragonBonesData=null;this._animationData=null;this._timelineData=null;this._armature=null;this._animationState=null;this._actionTimeline=null;this._frameArray=null;this._frameIntArray=null;this._frameFloatArray=null;this._timelineArray=null;this._frameIndices=null};e.prototype._setCurrentTime=function(t){var e=this.playState;var i=this.currentPlayTimes;var r=this.currentTime;if(this._actionTimeline!==null&&this._frameCount<=1){this.playState=this._actionTimeline.playState>=0?1:-1;this.currentPlayTimes=1;this.currentTime=this._actionTimeline.currentTime}else if(this._actionTimeline===null||this._timeScale!==1||this._timeOffset!==0){var a=this._animationState.playTimes;var n=a*this._duration;t*=this._timeScale;if(this._timeOffset!==0){t+=this._timeOffset*this._animationData.duration}if(a>0&&(t>=n||t<=-n)){if(this.playState<=0&&this._animationState._playheadState===3){this.playState=1}this.currentPlayTimes=a;if(t<0){this.currentTime=0}else{this.currentTime=this._duration}}else{if(this.playState!==0&&this._animationState._playheadState===3){this.playState=0}if(t<0){t=-t;this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=this._duration-t%this._duration}else{this.currentPlayTimes=Math.floor(t/this._duration);this.currentTime=t%this._duration}}this.currentTime+=this._position}else{this.playState=this._actionTimeline.playState;this.currentPlayTimes=this._actionTimeline.currentPlayTimes;this.currentTime=this._actionTimeline.currentTime}if(this.currentPlayTimes===i&&this.currentTime===r){return false}if(e<0&&this.playState!==e||this.playState<=0&&this.currentPlayTimes!==i){this._frameIndex=-1}return true};e.prototype.init=function(t,e,i){this._armature=t;this._animationState=e;this._timelineData=i;this._actionTimeline=this._animationState._actionTimeline;if(this===this._actionTimeline){this._actionTimeline=null}this._animationData=this._animationState._animationData;this._frameRate=this._animationData.parent.frameRate;this._frameRateR=1/this._frameRate;this._position=this._animationState._position;this._duration=this._animationState._duration;this._dragonBonesData=this._animationData.parent.parent;if(this._timelineData!==null){this._frameIntArray=this._dragonBonesData.frameIntArray;this._frameFloatArray=this._dragonBonesData.frameFloatArray;this._frameArray=this._dragonBonesData.frameArray;this._timelineArray=this._dragonBonesData.timelineArray;this._frameIndices=this._dragonBonesData.frameIndices;this._frameCount=this._timelineArray[this._timelineData.offset+2];this._frameValueOffset=this._timelineArray[this._timelineData.offset+4];this._timeScale=100/this._timelineArray[this._timelineData.offset+0];this._timeOffset=this._timelineArray[this._timelineData.offset+1]*.01}};e.prototype.fadeOut=function(){};e.prototype.update=function(t){if(this._setCurrentTime(t)){if(this._frameCount>1){var e=Math.floor(this.currentTime*this._frameRate);var i=this._frameIndices[this._timelineData.frameIndicesOffset+e];if(this._frameIndex!==i){this._frameIndex=i;this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex];this._onArriveAtFrame()}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5]}this._onArriveAtFrame()}if(this._tweenState!==0){this._onUpdateFrame()}}};return e}(t.BaseObject);t.TimelineState=e;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e._getEasingValue=function(t,e,i){var r=e;switch(t){case 3:r=Math.pow(e,2);break;case 4:r=1-Math.pow(1-e,2);break;case 5:r=.5*(1-Math.cos(e*Math.PI));break}return(r-e)*i+e};e._getEasingCurveValue=function(t,e,i,r){if(t<=0){return 0}else if(t>=1){return 1}var a=i+1;var n=Math.floor(t*a);var s=n===0?0:e[r+n-1];var o=n===a-1?1e4:e[r+n];return(s+(o-s)*(t*a-n))*1e-4};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._tweenType=0;this._curveCount=0;this._framePosition=0;this._frameDurationR=0;this._tweenProgress=0;this._tweenEasing=0};e.prototype._onArriveAtFrame=function(){if(this._frameCount>1&&(this._frameIndex!==this._frameCount-1||this._animationState.playTimes===0||this._animationState.currentPlayTimes<this._animationState.playTimes-1)){this._tweenType=this._frameArray[this._frameOffset+1];this._tweenState=this._tweenType===0?1:2;if(this._tweenType===2){this._curveCount=this._frameArray[this._frameOffset+2]}else if(this._tweenType!==0&&this._tweenType!==1){this._tweenEasing=this._frameArray[this._frameOffset+2]*.01}this._framePosition=this._frameArray[this._frameOffset]*this._frameRateR;if(this._frameIndex===this._frameCount-1){this._frameDurationR=1/(this._animationData.duration-this._framePosition)}else{var t=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+this._frameIndex+1];var e=this._frameArray[t]*this._frameRateR-this._framePosition;if(e>0){this._frameDurationR=1/e}else{this._frameDurationR=0}}}else{this._tweenState=1}};e.prototype._onUpdateFrame=function(){if(this._tweenState===2){this._tweenProgress=(this.currentTime-this._framePosition)*this._frameDurationR;if(this._tweenType===2){this._tweenProgress=e._getEasingCurveValue(this._tweenProgress,this._frameArray,this._curveCount,this._frameOffset+3)}else if(this._tweenType!==1){this._tweenProgress=e._getEasingValue(this._tweenType,this._tweenProgress,this._tweenEasing)}}else{this._tweenProgress=0}};return e}(e);t.TweenTimelineState=i;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.bone=null;this.bonePose=null};return e}(i);t.BoneTimelineState=r;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.slot=null};return e}(i);t.SlotTimelineState=a;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype._onClear=function(){t.prototype._onClear.call(this);this.constraint=null};return e}(i);t.ConstraintTimelineState=n})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.toString=function(){return"[class dragonBones.ActionTimelineState]"};i.prototype._onCrossFrame=function(e){var i=this._armature.eventDispatcher;if(this._animationState.actionEnabled){var r=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5+e];var a=this._frameArray[r+1];var n=this._animationData.parent.actions;for(var s=0;s<a;++s){var o=this._frameArray[r+2+s];var l=n[o];if(l.type===0){if(l.slot!==null){var h=this._armature.getSlot(l.slot.name);if(h!==null){var u=h.childArmature;if(u!==null){u._bufferAction(l,true)}}}else if(l.bone!==null){for(var f=0,_=this._armature.getSlots();f<_.length;f++){var h=_[f];var u=h.childArmature;if(u!==null&&h.parent._boneData===l.bone){u._bufferAction(l,true)}}}else{this._armature._bufferAction(l,true)}}else{var c=l.type===10?t.EventObject.FRAME_EVENT:t.EventObject.SOUND_EVENT;if(l.type===11||i.hasDBEventListener(c)){var p=t.BaseObject.borrowObject(t.EventObject);p.time=this._frameArray[r]/this._frameRate;p.type=c;p.name=l.name;p.data=l.data;p.armature=this._armature;p.animationState=this._animationState;if(l.bone!==null){p.bone=this._armature.getBone(l.bone.name)}if(l.slot!==null){p.slot=this._armature.getSlot(l.slot.name)}this._armature._dragonBones.bufferEvent(p)}}}}};i.prototype._onArriveAtFrame=function(){};i.prototype._onUpdateFrame=function(){};i.prototype.update=function(e){var i=this.playState;var r=this.currentPlayTimes;var a=this.currentTime;if(this._setCurrentTime(e)){var n=this._armature.eventDispatcher;if(i<0){if(this.playState!==i){if(this._animationState.displayControl&&this._animationState.resetToPose){this._armature._sortZOrder(null,0)}r=this.currentPlayTimes;if(n.hasDBEventListener(t.EventObject.START)){var s=t.BaseObject.borrowObject(t.EventObject);s.type=t.EventObject.START;s.armature=this._armature;s.animationState=this._animationState;this._armature._dragonBones.bufferEvent(s)}}else{return}}var o=this._animationState.timeScale<0;var l=null;var h=null;if(this.currentPlayTimes!==r){if(n.hasDBEventListener(t.EventObject.LOOP_COMPLETE)){l=t.BaseObject.borrowObject(t.EventObject);l.type=t.EventObject.LOOP_COMPLETE;l.armature=this._armature;l.animationState=this._animationState}if(this.playState>0){if(n.hasDBEventListener(t.EventObject.COMPLETE)){h=t.BaseObject.borrowObject(t.EventObject);h.type=t.EventObject.COMPLETE;h.armature=this._armature;h.animationState=this._animationState}}}if(this._frameCount>1){var u=this._timelineData;var f=Math.floor(this.currentTime*this._frameRate);var _=this._frameIndices[u.frameIndicesOffset+f];if(this._frameIndex!==_){var c=this._frameIndex;this._frameIndex=_;if(this._timelineArray!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[u.offset+5+this._frameIndex];if(o){if(c<0){var p=Math.floor(a*this._frameRate);c=this._frameIndices[u.frameIndicesOffset+p];if(this.currentPlayTimes===r){if(c===_){c=-1}}}while(c>=0){var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+c];var d=this._frameArray[m]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(c)}if(l!==null&&c===0){this._armature._dragonBones.bufferEvent(l);l=null}if(c>0){c--}else{c=this._frameCount-1}if(c===_){break}}}else{if(c<0){var p=Math.floor(a*this._frameRate);c=this._frameIndices[u.frameIndicesOffset+p];var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+c];var d=this._frameArray[m]/this._frameRate;if(this.currentPlayTimes===r){if(a<=d){if(c>0){c--}else{c=this._frameCount-1}}else if(c===_){c=-1}}}while(c>=0){if(c<this._frameCount-1){c++}else{c=0}var m=this._animationData.frameOffset+this._timelineArray[u.offset+5+c];var d=this._frameArray[m]/this._frameRate;if(this._position<=d&&d<=this._position+this._duration){this._onCrossFrame(c)}if(l!==null&&c===0){this._armature._dragonBones.bufferEvent(l);l=null}if(c===_){break}}}}}}else if(this._frameIndex<0){this._frameIndex=0;if(this._timelineData!==null){this._frameOffset=this._animationData.frameOffset+this._timelineArray[this._timelineData.offset+5];var d=this._frameArray[this._frameOffset]/this._frameRate;if(this.currentPlayTimes===r){if(a<=d){this._onCrossFrame(this._frameIndex)}}else if(this._position<=d){if(!o&&l!==null){this._armature._dragonBones.bufferEvent(l);l=null}this._onCrossFrame(this._frameIndex)}}}if(l!==null){this._armature._dragonBones.bufferEvent(l)}if(h!==null){this._armature._dragonBones.bufferEvent(h)}}};i.prototype.setCurrentTime=function(t){this._setCurrentTime(t);this._frameIndex=-1};return i}(t.TimelineState);t.ActionTimelineState=e;var i=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.ZOrderTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this._frameArray[this._frameOffset+1];if(t>0){this._armature._sortZOrder(this._frameArray,this._frameOffset+2)}else{this._armature._sortZOrder(null,0)}}};e.prototype._onUpdateFrame=function(){};return e}(t.TimelineState);t.ZOrderTimelineState=i;var r=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.toString=function(){return"[class dragonBones.BoneAllTimelineState]"};i.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*6;var i=this._armature._armatureData.scale;var r=this._frameFloatArray;var a=this.bonePose.current;var n=this.bonePose.delta;a.x=r[t++]*i;a.y=r[t++]*i;a.rotation=r[t++];a.skew=r[t++];a.scaleX=r[t++];a.scaleY=r[t++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){t=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[t++]*i-a.x;n.y=r[t++]*i-a.y;n.rotation=r[t++]-a.rotation;n.skew=r[t++]-a.skew;n.scaleX=r[t++]-a.scaleX;n.scaleY=r[t++]-a.scaleY}else{n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}}else{var a=this.bonePose.current;var n=this.bonePose.delta;a.x=0;a.y=0;a.rotation=0;a.skew=0;a.scaleX=1;a.scaleY=1;n.x=0;n.y=0;n.rotation=0;n.skew=0;n.scaleX=0;n.scaleY=0}};i.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var i=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=t.x+i.x*this._tweenProgress;r.y=t.y+i.y*this._tweenProgress;r.rotation=t.rotation+i.rotation*this._tweenProgress;r.skew=t.skew+i.skew*this._tweenProgress;r.scaleX=t.scaleX+i.scaleX*this._tweenProgress;r.scaleY=t.scaleY+i.scaleY*this._tweenProgress};i.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return i}(t.BoneTimelineState);t.BoneAllTimelineState=r;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneTranslateTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var i=this._armature._armatureData.scale;var r=this._frameFloatArray;var a=this.bonePose.current;var n=this.bonePose.delta;a.x=r[e++]*i;a.y=r[e++]*i;if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}n.x=r[e++]*i-a.x;n.y=r[e++]*i-a.y}else{n.x=0;n.y=0}}else{var a=this.bonePose.current;var n=this.bonePose.delta;a.x=0;a.y=0;n.x=0;n.y=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var i=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.x=e.x+i.x*this._tweenProgress;r.y=e.y+i.y*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneTranslateTimelineState=a;var n=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.toString=function(){return"[class dragonBones.BoneRotateTimelineState]"};i.prototype._onArriveAtFrame=function(){e.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var t=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var i=this._frameFloatArray;var r=this.bonePose.current;var a=this.bonePose.delta;r.rotation=i[t++];r.skew=i[t++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){t=this._animationData.frameFloatOffset+this._frameValueOffset}a.rotation=i[t++]-r.rotation;a.skew=i[t++]-r.skew}else{a.rotation=0;a.skew=0}}else{var r=this.bonePose.current;var a=this.bonePose.delta;r.rotation=0;r.skew=0;a.rotation=0;a.skew=0}};i.prototype._onUpdateFrame=function(){e.prototype._onUpdateFrame.call(this);var t=this.bonePose.current;var i=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.rotation=t.rotation+i.rotation*this._tweenProgress;r.skew=t.skew+i.skew*this._tweenProgress};i.prototype.fadeOut=function(){var e=this.bonePose.result;e.rotation=t.Transform.normalizeRadian(e.rotation);e.skew=t.Transform.normalizeRadian(e.skew)};return i}(t.BoneTimelineState);t.BoneRotateTimelineState=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.BoneScaleTimelineState]"};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*2;var i=this._frameFloatArray;var r=this.bonePose.current;var a=this.bonePose.delta;r.scaleX=i[e++];r.scaleY=i[e++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){e=this._animationData.frameFloatOffset+this._frameValueOffset}a.scaleX=i[e++]-r.scaleX;a.scaleY=i[e++]-r.scaleY}else{a.scaleX=0;a.scaleY=0}}else{var r=this.bonePose.current;var a=this.bonePose.delta;r.scaleX=1;r.scaleY=1;a.scaleX=0;a.scaleY=0}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);var e=this.bonePose.current;var i=this.bonePose.delta;var r=this.bonePose.result;this.bone._transformDirty=true;if(this._tweenState!==2){this._tweenState=0}r.scaleX=e.scaleX+i.scaleX*this._tweenProgress;r.scaleY=e.scaleY+i.scaleY*this._tweenProgress};return e}(t.BoneTimelineState);t.BoneScaleTimelineState=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.SlotDislayTimelineState]"};e.prototype._onArriveAtFrame=function(){if(this.playState>=0){var t=this._timelineData!==null?this._frameArray[this._frameOffset+1]:this.slot._slotData.displayIndex;if(this.slot.displayIndex!==t){this.slot._setDisplayIndex(t,true)}}};return e}(t.SlotTimelineState);t.SlotDislayTimelineState=o;var l=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[0,0,0,0,0,0,0,0];e._delta=[0,0,0,0,0,0,0,0];e._result=[0,0,0,0,0,0,0,0];return e}e.toString=function(){return"[class dragonBones.SlotColorTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._dirty=false};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._dragonBonesData.intArray;var i=this._frameIntArray;var r=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex*1;var a=i[r];if(a<0){a+=32767}this._current[0]=e[a++];this._current[1]=e[a++];this._current[2]=e[a++];this._current[3]=e[a++];this._current[4]=e[a++];this._current[5]=e[a++];this._current[6]=e[a++];this._current[7]=e[a++];if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){a=i[this._animationData.frameIntOffset+this._frameValueOffset]}else{a=i[r+1*1]}if(a<0){a+=32767}this._delta[0]=e[a++]-this._current[0];this._delta[1]=e[a++]-this._current[1];this._delta[2]=e[a++]-this._current[2];this._delta[3]=e[a++]-this._current[3];this._delta[4]=e[a++]-this._current[4];this._delta[5]=e[a++]-this._current[5];this._delta[6]=e[a++]-this._current[6];this._delta[7]=e[a++]-this._current[7]}}else{var n=this.slot._slotData.color;this._current[0]=n.alphaMultiplier*100;this._current[1]=n.redMultiplier*100;this._current[2]=n.greenMultiplier*100;this._current[3]=n.blueMultiplier*100;this._current[4]=n.alphaOffset;this._current[5]=n.redOffset;this._current[6]=n.greenOffset;this._current[7]=n.blueOffset}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);this._dirty=true;if(this._tweenState!==2){this._tweenState=0}this._result[0]=(this._current[0]+this._delta[0]*this._tweenProgress)*.01;this._result[1]=(this._current[1]+this._delta[1]*this._tweenProgress)*.01;this._result[2]=(this._current[2]+this._delta[2]*this._tweenProgress)*.01;this._result[3]=(this._current[3]+this._delta[3]*this._tweenProgress)*.01;this._result[4]=this._current[4]+this._delta[4]*this._tweenProgress;this._result[5]=this._current[5]+this._delta[5]*this._tweenProgress;this._result[6]=this._current[6]+this._delta[6]*this._tweenProgress;this._result[7]=this._current[7]+this._delta[7]*this._tweenProgress};e.prototype.fadeOut=function(){this._tweenState=0;this._dirty=false};e.prototype.update=function(e){t.prototype.update.call(this,e);if(this._tweenState!==0||this._dirty){var i=this.slot._colorTransform;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){if(i.alphaMultiplier!==this._result[0]||i.redMultiplier!==this._result[1]||i.greenMultiplier!==this._result[2]||i.blueMultiplier!==this._result[3]||i.alphaOffset!==this._result[4]||i.redOffset!==this._result[5]||i.greenOffset!==this._result[6]||i.blueOffset!==this._result[7]){var r=Math.pow(this._animationState._fadeProgress,4);i.alphaMultiplier+=(this._result[0]-i.alphaMultiplier)*r;i.redMultiplier+=(this._result[1]-i.redMultiplier)*r;i.greenMultiplier+=(this._result[2]-i.greenMultiplier)*r;i.blueMultiplier+=(this._result[3]-i.blueMultiplier)*r;i.alphaOffset+=(this._result[4]-i.alphaOffset)*r;i.redOffset+=(this._result[5]-i.redOffset)*r;i.greenOffset+=(this._result[6]-i.greenOffset)*r;i.blueOffset+=(this._result[7]-i.blueOffset)*r;this.slot._colorDirty=true}}else if(this._dirty){this._dirty=false;if(i.alphaMultiplier!==this._result[0]||i.redMultiplier!==this._result[1]||i.greenMultiplier!==this._result[2]||i.blueMultiplier!==this._result[3]||i.alphaOffset!==this._result[4]||i.redOffset!==this._result[5]||i.greenOffset!==this._result[6]||i.blueOffset!==this._result[7]){i.alphaMultiplier=this._result[0];i.redMultiplier=this._result[1];i.greenMultiplier=this._result[2];i.blueMultiplier=this._result[3];i.alphaOffset=this._result[4];i.redOffset=this._result[5];i.greenOffset=this._result[6];i.blueOffset=this._result[7];this.slot._colorDirty=true}}}};return e}(t.SlotTimelineState);t.SlotColorTimelineState=l;var h=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e._current=[];e._delta=[];e._result=[];return e}e.toString=function(){return"[class dragonBones.SlotFFDTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.meshOffset=0;this._dirty=false;this._frameFloatOffset=0;this._valueCount=0;this._ffdCount=0;this._valueOffset=0;this._current.length=0;this._delta.length=0;this._result.length=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);if(this._timelineData!==null){var e=this._animationData.frameFloatOffset+this._frameValueOffset+this._frameIndex*this._valueCount;var i=this._armature._armatureData.scale;var r=this._frameFloatArray;if(this._tweenState===2){var a=e+this._valueCount;if(this._frameIndex===this._frameCount-1){a=this._animationData.frameFloatOffset+this._frameValueOffset}for(var n=0;n<this._valueCount;++n){this._delta[n]=r[a+n]*i-(this._current[n]=r[e+n]*i)}}else{for(var n=0;n<this._valueCount;++n){this._current[n]=r[e+n]*i}}}else{for(var n=0;n<this._valueCount;++n){this._current[n]=0}}};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);this._dirty=true;if(this._tweenState!==2){this._tweenState=0}for(var e=0;e<this._valueCount;++e){this._result[e]=this._current[e]+this._delta[e]*this._tweenProgress}};e.prototype.init=function(e,i,r){t.prototype.init.call(this,e,i,r);if(this._timelineData!==null){var a=this._animationData.frameIntOffset+this._timelineArray[this._timelineData.offset+3];this.meshOffset=this._frameIntArray[a+0];this._ffdCount=this._frameIntArray[a+1];this._valueCount=this._frameIntArray[a+2];this._valueOffset=this._frameIntArray[a+3];this._frameFloatOffset=this._frameIntArray[a+4]+this._animationData.frameFloatOffset}else{this._valueCount=0}this._current.length=this._valueCount;this._delta.length=this._valueCount;this._result.length=this._valueCount;for(var n=0;n<this._valueCount;++n){this._delta[n]=0}};e.prototype.fadeOut=function(){this._tweenState=0;this._dirty=false};e.prototype.update=function(e){if(this.slot._meshData===null||this.slot._meshData.offset!==this.meshOffset){return}t.prototype.update.call(this,e);if(this._tweenState!==0||this._dirty){var i=this.slot._ffdVertices;if(this._timelineData!==null){if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){var r=Math.pow(this._animationState._fadeProgress,2);for(var a=0;a<this._ffdCount;++a){if(a<this._valueOffset){i[a]+=(this._frameFloatArray[this._frameFloatOffset+a]-i[a])*r}else if(a<this._valueOffset+this._valueCount){i[a]+=(this._result[a-this._valueOffset]-i[a])*r}else{i[a]+=(this._frameFloatArray[this._frameFloatOffset+a-this._valueCount]-i[a])*r}}this.slot._meshDirty=true}else if(this._dirty){this._dirty=false;for(var a=0;a<this._ffdCount;++a){if(a<this._valueOffset){i[a]=this._frameFloatArray[this._frameFloatOffset+a]}else if(a<this._valueOffset+this._valueCount){i[a]=this._result[a-this._valueOffset]}else{i[a]=this._frameFloatArray[this._frameFloatOffset+a-this._valueCount]}}this.slot._meshDirty=true}}else{this._ffdCount=i.length;if(this._animationState._fadeState!==0||this._animationState._subFadeState!==0){var r=Math.pow(this._animationState._fadeProgress,2);for(var a=0;a<this._ffdCount;++a){i[a]+=(0-i[a])*r}this.slot._meshDirty=true}else if(this._dirty){this._dirty=false;for(var a=0;a<this._ffdCount;++a){i[a]=0}this.slot._meshDirty=true}}}};return e}(t.SlotTimelineState);t.SlotFFDTimelineState=h;var u=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.IKConstraintTimelineState]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this._current=0;this._delta=0};e.prototype._onArriveAtFrame=function(){t.prototype._onArriveAtFrame.call(this);var e=this.constraint;if(this._timelineData!==null){var i=this._animationData.frameIntOffset+this._frameValueOffset+this._frameIndex*2;var r=this._frameIntArray;var a=r[i++]!==0;this._current=r[i++]*.01;if(this._tweenState===2){if(this._frameIndex===this._frameCount-1){i=this._animationData.frameIntOffset+this._frameValueOffset}this._delta=r[i+1]*.01-this._current}else{this._delta=0}e._bendPositive=a}else{var n=e._constraintData;this._current=n.weight;this._delta=0;e._bendPositive=n.bendPositive}e.invalidUpdate()};e.prototype._onUpdateFrame=function(){t.prototype._onUpdateFrame.call(this);if(this._tweenState!==2){this._tweenState=0}var e=this.constraint;e._weight=this._current+this._delta*this._tweenProgress;e.invalidUpdate()};return e}(t.ConstraintTimelineState);t.IKConstraintTimelineState=u})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.EventObject]"};e.prototype._onClear=function(){this.time=0;this.type="";this.name="";this.armature=null;this.bone=null;this.slot=null;this.animationState=null;this.data=null};e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FADE_IN="fadeIn";e.FADE_IN_COMPLETE="fadeInComplete";e.FADE_OUT="fadeOut";e.FADE_OUT_COMPLETE="fadeOutComplete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(t.BaseObject);t.EventObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(){}e._getArmatureType=function(t){switch(t.toLowerCase()){case"stage":return 2;case"armature":return 0;case"movieclip":return 1;default:return 0}};e._getDisplayType=function(t){switch(t.toLowerCase()){case"image":return 0;case"mesh":return 2;case"armature":return 1;case"boundingbox":return 3;default:return 0}};e._getBoundingBoxType=function(t){switch(t.toLowerCase()){case"rectangle":return 0;case"ellipse":return 1;case"polygon":return 2;default:return 0}};e._getActionType=function(t){switch(t.toLowerCase()){case"play":return 0;case"frame":return 10;case"sound":return 11;default:return 0}};e._getBlendMode=function(t){switch(t.toLowerCase()){case"normal":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"overlay":return 11;case"screen":return 12;case"subtract":return 13;default:return 0}};e.parseDragonBonesData=function(e){if(e instanceof ArrayBuffer){return t.BinaryDataParser.getInstance().parseDragonBonesData(e)}else{return t.ObjectDataParser.getInstance().parseDragonBonesData(e)}};e.parseTextureAtlasData=function(i,r){if(r===void 0){r=1}console.warn("已废弃");var a={};var n=i[e.SUB_TEXTURE];for(var s=0,o=n.length;s<o;s++){var l=n[s];var h=l[e.NAME];var u=new t.Rectangle;var f=null;u.x=l[e.X]/r;u.y=l[e.Y]/r;u.width=l[e.WIDTH]/r;u.height=l[e.HEIGHT]/r;if(e.FRAME_WIDTH in l){f=new t.Rectangle;f.x=l[e.FRAME_X]/r;f.y=l[e.FRAME_Y]/r;f.width=l[e.FRAME_WIDTH]/r;f.height=l[e.FRAME_HEIGHT]/r}a[h]={region:u,frame:f,rotated:false}}return a};e.DATA_VERSION_2_3="2.3";e.DATA_VERSION_3_0="3.0";e.DATA_VERSION_4_0="4.0";e.DATA_VERSION_4_5="4.5";e.DATA_VERSION_5_0="5.0";e.DATA_VERSION_5_5="5.5";e.DATA_VERSION=e.DATA_VERSION_5_5;e.DATA_VERSIONS=[e.DATA_VERSION_4_0,e.DATA_VERSION_4_5,e.DATA_VERSION_5_0,e.DATA_VERSION_5_5];e.TEXTURE_ATLAS="textureAtlas";e.SUB_TEXTURE="SubTexture";e.FORMAT="format";e.IMAGE_PATH="imagePath";e.WIDTH="width";e.HEIGHT="height";e.ROTATED="rotated";e.FRAME_X="frameX";e.FRAME_Y="frameY";e.FRAME_WIDTH="frameWidth";e.FRAME_HEIGHT="frameHeight";e.DRADON_BONES="dragonBones";e.USER_DATA="userData";e.ARMATURE="armature";e.BONE="bone";e.SLOT="slot";e.CONSTRAINT="constraint";e.IK="ik";e.SKIN="skin";e.DISPLAY="display";e.ANIMATION="animation";e.Z_ORDER="zOrder";e.FFD="ffd";e.FRAME="frame";e.TRANSLATE_FRAME="translateFrame";e.ROTATE_FRAME="rotateFrame";e.SCALE_FRAME="scaleFrame";e.DISPLAY_FRAME="displayFrame";e.COLOR_FRAME="colorFrame";e.DEFAULT_ACTIONS="defaultActions";e.ACTIONS="actions";e.EVENTS="events";e.INTS="ints";e.FLOATS="floats";e.STRINGS="strings";e.CANVAS="canvas";e.TRANSFORM="transform";e.PIVOT="pivot";e.AABB="aabb";e.COLOR="color";e.VERSION="version";e.COMPATIBLE_VERSION="compatibleVersion";e.FRAME_RATE="frameRate";e.TYPE="type";e.SUB_TYPE="subType";e.NAME="name";e.PARENT="parent";e.TARGET="target";e.STAGE="stage";e.SHARE="share";e.PATH="path";e.LENGTH="length";e.DISPLAY_INDEX="displayIndex";e.BLEND_MODE="blendMode";e.INHERIT_TRANSLATION="inheritTranslation";e.INHERIT_ROTATION="inheritRotation";e.INHERIT_SCALE="inheritScale";e.INHERIT_REFLECTION="inheritReflection";e.INHERIT_ANIMATION="inheritAnimation";e.INHERIT_FFD="inheritFFD";e.BEND_POSITIVE="bendPositive";e.CHAIN="chain";e.WEIGHT="weight";e.FADE_IN_TIME="fadeInTime";e.PLAY_TIMES="playTimes";e.SCALE="scale";e.OFFSET="offset";e.POSITION="position";e.DURATION="duration";e.TWEEN_EASING="tweenEasing";e.TWEEN_ROTATE="tweenRotate";e.TWEEN_SCALE="tweenScale";e.CLOCK_WISE="clockwise";e.CURVE="curve";e.SOUND="sound";e.EVENT="event";e.ACTION="action";e.X="x";e.Y="y";e.SKEW_X="skX";e.SKEW_Y="skY";e.SCALE_X="scX";e.SCALE_Y="scY";e.VALUE="value";e.ROTATE="rotate";e.SKEW="skew";e.ALPHA_OFFSET="aO";e.RED_OFFSET="rO";e.GREEN_OFFSET="gO";e.BLUE_OFFSET="bO";e.ALPHA_MULTIPLIER="aM";e.RED_MULTIPLIER="rM";e.GREEN_MULTIPLIER="gM";e.BLUE_MULTIPLIER="bM";e.UVS="uvs";e.VERTICES="vertices";e.TRIANGLES="triangles";e.WEIGHTS="weights";e.SLOT_POSE="slotPose";e.BONE_POSE="bonePose";e.GOTO_AND_PLAY="gotoAndPlay";e.DEFAULT_NAME="default";return e}();t.DataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var i=e!==null&&e.apply(this,arguments)||this;i._rawTextureAtlasIndex=0;i._rawBones=[];i._data=null;i._armature=null;i._bone=null;i._slot=null;i._skin=null;i._mesh=null;i._animation=null;i._timeline=null;i._rawTextureAtlases=null;i._defaultColorOffset=-1;i._prevClockwise=0;i._prevRotation=0;i._helpMatrixA=new t.Matrix;i._helpMatrixB=new t.Matrix;i._helpTransform=new t.Transform;i._helpColorTransform=new t.ColorTransform;i._helpPoint=new t.Point;i._helpArray=[];i._intArray=[];i._floatArray=[];i._frameIntArray=[];i._frameFloatArray=[];i._frameArray=[];i._timelineArray=[];i._actionFrames=[];i._weightSlotPose={};i._weightBonePoses={};i._cacheBones={};i._cacheMeshs={};i._slotChildActions={};return i}r._getBoolean=function(t,e,i){if(e in t){var r=t[e];var a=typeof r;if(a==="boolean"){return r}else if(a==="string"){switch(r){case"0":case"NaN":case"":case"false":case"null":case"undefined":return false;default:return true}}else{return!!r}}return i};r._getNumber=function(t,e,i){if(e in t){var r=t[e];if(r===null||r==="NaN"){return i}return+r||0}return i};r._getString=function(e,i,r){if(i in e){var a=e[i];var n=typeof a;if(n==="string"){if(t.DragonBones.webAssembly){for(var s=0,o=a.length;s<o;++s){if(a.charCodeAt(s)>255){return encodeURI(a)}}}return a}return String(a)}return r};r.prototype._getCurvePoint=function(t,e,i,r,a,n,s,o,l,h){var u=1-l;var f=u*u;var _=l*l;var c=u*f;var p=3*l*f;var m=3*u*_;var d=l*_;h.x=c*t+p*i+m*a+d*s;h.y=c*e+p*r+m*n+d*o};r.prototype._samplingEasingCurve=function(t,e){var i=t.length;var r=-2;for(var a=0,n=e.length;a<n;++a){var s=(a+1)/(n+1);while((r+6<i?t[r+6]:1)<s){r+=6}var o=r>=0&&r+6<i;var l=o?t[r]:0;var h=o?t[r+1]:0;var u=t[r+2];var f=t[r+3];var _=t[r+4];var c=t[r+5];var p=o?t[r+6]:1;var m=o?t[r+7]:1;var d=0;var y=1;while(y-d>1e-4){var g=(y+d)*.5;this._getCurvePoint(l,h,u,f,_,c,p,m,g,this._helpPoint);if(s-this._helpPoint.x>0){d=g}else{y=g}}e[a]=this._helpPoint.y}};r.prototype._parseActionDataInFrame=function(t,e,i,a){if(r.EVENT in t){this._mergeActionFrame(t[r.EVENT],e,10,i,a)}if(r.SOUND in t){this._mergeActionFrame(t[r.SOUND],e,11,i,a)}if(r.ACTION in t){this._mergeActionFrame(t[r.ACTION],e,0,i,a)}if(r.EVENTS in t){this._mergeActionFrame(t[r.EVENTS],e,10,i,a)}if(r.ACTIONS in t){this._mergeActionFrame(t[r.ACTIONS],e,0,i,a)}};r.prototype._mergeActionFrame=function(e,r,a,n,s){var o=t.DragonBones.webAssembly?this._armature.actions.size():this._armature.actions.length;var l=this._parseActionData(e,a,n,s);var h=0;var u=null;for(var f=0,_=l;f<_.length;f++){var c=_[f];this._armature.addAction(c,false)}if(this._actionFrames.length===0){u=new i;u.frameStart=0;this._actionFrames.push(u);u=null}for(var p=0,m=this._actionFrames;p<m.length;p++){var d=m[p];if(d.frameStart===r){u=d;break}else if(d.frameStart>r){break}h++}if(u===null){u=new i;u.frameStart=r;this._actionFrames.splice(h+1,0,u)}for(var y=0;y<l.length;++y){u.actions.push(o+y)}};r.prototype._parseArmature=function(e,i){var a=t.BaseObject.borrowObject(t.ArmatureData);a.name=r._getString(e,r.NAME,"");a.frameRate=r._getNumber(e,r.FRAME_RATE,this._data.frameRate);a.scale=i;if(r.TYPE in e&&typeof e[r.TYPE]==="string"){a.type=r._getArmatureType(e[r.TYPE])}else{a.type=r._getNumber(e,r.TYPE,0)}if(a.frameRate===0){a.frameRate=24}this._armature=a;if(r.CANVAS in e){var n=e[r.CANVAS];var s=t.BaseObject.borrowObject(t.CanvasData);if(r.COLOR in n){s.hasBackground=true}else{s.hasBackground=false}s.color=r._getNumber(n,r.COLOR,0);s.x=r._getNumber(n,r.X,0)*a.scale;s.y=r._getNumber(n,r.Y,0)*a.scale;s.width=r._getNumber(n,r.WIDTH,0)*a.scale;s.height=r._getNumber(n,r.HEIGHT,0)*a.scale;a.canvas=s}if(r.AABB in e){var o=e[r.AABB];a.aabb.x=r._getNumber(o,r.X,0)*a.scale;a.aabb.y=r._getNumber(o,r.Y,0)*a.scale;a.aabb.width=r._getNumber(o,r.WIDTH,0)*a.scale;a.aabb.height=r._getNumber(o,r.HEIGHT,0)*a.scale}if(r.BONE in e){var l=e[r.BONE];for(var h=0,u=l;h<u.length;h++){var f=u[h];var _=r._getString(f,r.PARENT,"");var c=this._parseBone(f);if(_.length>0){var p=a.getBone(_);if(p!==null){c.parent=p}else{if(!(_ in this._cacheBones)){this._cacheBones[_]=[]}this._cacheBones[_].push(c)}}if(c.name in this._cacheBones){for(var m=0,d=this._cacheBones[c.name];m<d.length;m++){var y=d[m];y.parent=c}delete this._cacheBones[c.name]}a.addBone(c);this._rawBones.push(c)}}if(r.IK in e){var g=e[r.IK];for(var v=0,b=g;v<b.length;v++){var T=b[v];var D=this._parseIKConstraint(T);if(D){a.addConstraint(D)}}}a.sortBones();if(r.SLOT in e){var A=0;var x=e[r.SLOT];for(var O=0,S=x;O<S.length;O++){var E=S[O];a.addSlot(this._parseSlot(E,A++))}}if(r.SKIN in e){var B=e[r.SKIN];for(var M=0,w=B;M<w.length;M++){var P=w[M];a.addSkin(this._parseSkin(P))}}for(var C in this._cacheMeshs){var I=a.getSkin(C);if(I===null){continue}var F=this._cacheMeshs[C];for(var N in F){var R=F[N];for(var j in R){var k=I.getDisplay(N,j);if(k===null){continue}for(var L=0,U=R[j];L<U.length;L++){var Y=U[L];Y.offset=k.offset;Y.weight=k.weight}}}}if(r.ANIMATION in e){var V=e[r.ANIMATION];for(var $=0,X=V;$<X.length;$++){var H=X[$];var W=this._parseAnimation(H);a.addAnimation(W)}}if(r.DEFAULT_ACTIONS in e){var z=this._parseActionData(e[r.DEFAULT_ACTIONS],0,null,null);for(var G=0,K=z;G<K.length;G++){var Z=K[G];a.addAction(Z,true);if(Z.type===0){var W=a.getAnimation(Z.name);if(W!==null){a.defaultAnimation=W}}}}if(r.ACTIONS in e){var z=this._parseActionData(e[r.ACTIONS],0,null,null);for(var q=0,J=z;q<J.length;q++){var Z=J[q];a.addAction(Z,false)}}this._rawBones.length=0;this._armature=null;for(var Q in this._weightSlotPose){delete this._weightSlotPose[Q]}for(var Q in this._weightBonePoses){delete this._weightBonePoses[Q]}for(var Q in this._cacheMeshs){delete this._cacheMeshs[Q]}for(var Q in this._cacheBones){delete this._cacheBones[Q]}for(var Q in this._slotChildActions){delete this._slotChildActions[Q]}return a};r.prototype._parseBone=function(e){var i=t.BaseObject.borrowObject(t.BoneData);i.inheritTranslation=r._getBoolean(e,r.INHERIT_TRANSLATION,true);i.inheritRotation=r._getBoolean(e,r.INHERIT_ROTATION,true);i.inheritScale=r._getBoolean(e,r.INHERIT_SCALE,true);i.inheritReflection=r._getBoolean(e,r.INHERIT_REFLECTION,true);i.length=r._getNumber(e,r.LENGTH,0)*this._armature.scale;i.name=r._getString(e,r.NAME,"");if(r.TRANSFORM in e){this._parseTransform(e[r.TRANSFORM],i.transform,this._armature.scale)}return i};r.prototype._parseIKConstraint=function(e){var i=this._armature.getBone(r._getString(e,r.BONE,""));if(i===null){return null}var a=this._armature.getBone(r._getString(e,r.TARGET,""));if(a===null){return null}var n=t.BaseObject.borrowObject(t.IKConstraintData);n.scaleEnabled=r._getBoolean(e,r.SCALE,false);n.bendPositive=r._getBoolean(e,r.BEND_POSITIVE,true);n.weight=r._getNumber(e,r.WEIGHT,1);n.name=r._getString(e,r.NAME,"");n.target=a;var s=r._getNumber(e,r.CHAIN,0);if(s>0&&i.parent!==null){n.root=i.parent;n.bone=i}else{n.root=i;n.bone=null}return n};r.prototype._parseSlot=function(e,i){var a=t.BaseObject.borrowObject(t.SlotData);a.displayIndex=r._getNumber(e,r.DISPLAY_INDEX,0);a.zOrder=i;a.name=r._getString(e,r.NAME,"");a.parent=this._armature.getBone(r._getString(e,r.PARENT,""));if(r.BLEND_MODE in e&&typeof e[r.BLEND_MODE]==="string"){a.blendMode=r._getBlendMode(e[r.BLEND_MODE])}else{a.blendMode=r._getNumber(e,r.BLEND_MODE,0)}if(r.COLOR in e){a.color=t.SlotData.createColor();this._parseColorTransform(e[r.COLOR],a.color)}else{a.color=t.SlotData.DEFAULT_COLOR}if(r.ACTIONS in e){this._slotChildActions[a.name]=this._parseActionData(e[r.ACTIONS],0,null,null)}return a};r.prototype._parseSkin=function(e){var i=t.BaseObject.borrowObject(t.SkinData);i.name=r._getString(e,r.NAME,r.DEFAULT_NAME);if(i.name.length===0){i.name=r.DEFAULT_NAME}if(r.SLOT in e){var a=e[r.SLOT];this._skin=i;for(var n=0,s=a;n<s.length;n++){var o=s[n];var l=r._getString(o,r.NAME,"");var h=this._armature.getSlot(l);if(h!==null){this._slot=h;if(r.DISPLAY in o){var u=o[r.DISPLAY];for(var f=0,_=u;f<_.length;f++){var c=_[f];i.addDisplay(l,this._parseDisplay(c))}}this._slot=null}}this._skin=null}return i};r.prototype._parseDisplay=function(e){var i=r._getString(e,r.NAME,"");var a=r._getString(e,r.PATH,"");var n=0;var s=null;if(r.TYPE in e&&typeof e[r.TYPE]==="string"){n=r._getDisplayType(e[r.TYPE])}else{n=r._getNumber(e,r.TYPE,n)}switch(n){case 0:var o=s=t.BaseObject.borrowObject(t.ImageDisplayData);o.name=i;o.path=a.length>0?a:i;this._parsePivot(e,o);break;case 1:var l=s=t.BaseObject.borrowObject(t.ArmatureDisplayData);l.name=i;l.path=a.length>0?a:i;l.inheritAnimation=true;if(r.ACTIONS in e){var h=this._parseActionData(e[r.ACTIONS],0,null,null);for(var u=0,f=h;u<f.length;u++){var _=f[u];l.addAction(_)}}else if(this._slot.name in this._slotChildActions){var c=this._skin.getDisplays(this._slot.name);if(c===null?this._slot.displayIndex===0:this._slot.displayIndex===c.length){for(var p=0,m=this._slotChildActions[this._slot.name];p<m.length;p++){var _=m[p];l.addAction(_)}delete this._slotChildActions[this._slot.name]}}break;case 2:var d=r._getString(e,r.SHARE,"");var y=s=t.BaseObject.borrowObject(t.MeshDisplayData);y.name=i;y.path=a.length>0?a:i;y.inheritAnimation=r._getBoolean(e,r.INHERIT_FFD,true);this._parsePivot(e,y);if(d.length>0){var g=r._getString(e,r.SKIN,"");var v=this._slot.name;if(g.length===0){g=r.DEFAULT_NAME}if(!(g in this._cacheMeshs)){this._cacheMeshs[g]={}}var b=this._cacheMeshs[g];if(!(v in b)){b[v]={}}var T=b[v];if(!(d in T)){T[d]=[]}T[d].push(y)}else{this._parseMesh(e,y)}break;case 3:var D=this._parseBoundingBox(e);if(D!==null){var A=s=t.BaseObject.borrowObject(t.BoundingBoxDisplayData);A.name=i;A.path=a.length>0?a:i;A.boundingBox=D}break}if(s!==null){if(r.TRANSFORM in e){this._parseTransform(e[r.TRANSFORM],s.transform,this._armature.scale)}}return s};r.prototype._parsePivot=function(t,e){if(r.PIVOT in t){var i=t[r.PIVOT];e.pivot.x=r._getNumber(i,r.X,0);e.pivot.y=r._getNumber(i,r.Y,0)}else{e.pivot.x=.5;e.pivot.y=.5}};r.prototype._parseMesh=function(e,i){var a=e[r.VERTICES];var n=e[r.UVS];var s=e[r.TRIANGLES];var o=Math.floor(a.length/2);var l=Math.floor(s.length/3);var h=this._floatArray.length;var u=h+o*2;var f=this._intArray.length;i.offset=f;this._intArray.length+=1+1+1+1+l*3;this._intArray[f+0]=o;this._intArray[f+1]=l;this._intArray[f+2]=h;for(var _=0,c=l*3;_<c;++_){this._intArray[f+4+_]=s[_]}this._floatArray.length+=o*2+o*2;for(var _=0,c=o*2;_<c;++_){this._floatArray[h+_]=a[_];this._floatArray[u+_]=n[_]}if(r.WEIGHTS in e){var p=e[r.WEIGHTS];var m=e[r.SLOT_POSE];var d=e[r.BONE_POSE];var y=this._armature.sortedBones;var g=new Array;var v=Math.floor(d.length/7);var b=this._floatArray.length;var T=Math.floor(p.length-o)/2;var D=this._intArray.length;var A=t.BaseObject.borrowObject(t.WeightData);A.count=T;A.offset=D;g.length=v;this._intArray.length+=1+1+v+o+T;this._intArray[D+1]=b;for(var _=0;_<v;++_){var x=d[_*7];var O=this._rawBones[x];A.addBone(O);g[_]=x;this._intArray[D+2+_]=y.indexOf(O)}this._floatArray.length+=T*3;this._helpMatrixA.copyFromArray(m,0);for(var _=0,S=0,E=D+2+v,B=b;_<o;++_){var M=_*2;var w=this._intArray[E++]=p[S++];var P=this._floatArray[h+M];var C=this._floatArray[h+M+1];this._helpMatrixA.transformPoint(P,C,this._helpPoint);P=this._helpPoint.x;C=this._helpPoint.y;for(var I=0;I<w;++I){var x=p[S++];var F=g.indexOf(x);this._helpMatrixB.copyFromArray(d,F*7+1);this._helpMatrixB.invert();this._helpMatrixB.transformPoint(P,C,this._helpPoint);this._intArray[E++]=F;this._floatArray[B++]=p[S++];this._floatArray[B++]=this._helpPoint.x;this._floatArray[B++]=this._helpPoint.y}}i.weight=A;var N=this._skin.name+"_"+this._slot.name+"_"+i.name;this._weightSlotPose[N]=m;this._weightBonePoses[N]=d}};r.prototype._parseBoundingBox=function(e){var i=null;var a=0;if(r.SUB_TYPE in e&&typeof e[r.SUB_TYPE]==="string"){a=r._getBoundingBoxType(e[r.SUB_TYPE])}else{a=r._getNumber(e,r.SUB_TYPE,a)}switch(a){case 0:i=t.BaseObject.borrowObject(t.RectangleBoundingBoxData);break;case 1:i=t.BaseObject.borrowObject(t.EllipseBoundingBoxData);break;case 2:i=this._parsePolygonBoundingBox(e);break}if(i!==null){i.color=r._getNumber(e,r.COLOR,0);if(i.type===0||i.type===1){i.width=r._getNumber(e,r.WIDTH,0);i.height=r._getNumber(e,r.HEIGHT,0)}}return i};r.prototype._parsePolygonBoundingBox=function(e){var i=t.BaseObject.borrowObject(t.PolygonBoundingBoxData);if(r.VERTICES in e){var a=e[r.VERTICES];var n=i.vertices;if(t.DragonBones.webAssembly){n.resize(a.length,0)}else{n.length=a.length}for(var s=0,o=a.length;s<o;s+=2){var l=a[s];var h=a[s+1];if(t.DragonBones.webAssembly){n.set(s,l);n.set(s+1,h)}else{n[s]=l;n[s+1]=h}if(s===0){i.x=l;i.y=h;i.width=l;i.height=h}else{if(l<i.x){i.x=l}else if(l>i.width){i.width=l}if(h<i.y){i.y=h}else if(h>i.height){i.height=h}}}}else{console.warn("Data error.\n Please reexport DragonBones Data to fixed the bug.")}return i};r.prototype._parseAnimation=function(e){var i=t.BaseObject.borrowObject(t.AnimationData);i.frameCount=Math.max(r._getNumber(e,r.DURATION,1),1);i.playTimes=r._getNumber(e,r.PLAY_TIMES,1);i.duration=i.frameCount/this._armature.frameRate;i.fadeInTime=r._getNumber(e,r.FADE_IN_TIME,0);i.scale=r._getNumber(e,r.SCALE,1);i.name=r._getString(e,r.NAME,r.DEFAULT_NAME);if(i.name.length===0){i.name=r.DEFAULT_NAME}i.frameIntOffset=this._frameIntArray.length;i.frameFloatOffset=this._frameFloatArray.length;i.frameOffset=this._frameArray.length;this._animation=i;if(r.FRAME in e){var a=e[r.FRAME];var n=a.length;if(n>0){for(var s=0,o=0;s<n;++s){var l=a[s];this._parseActionDataInFrame(l,o,null,null);o+=r._getNumber(l,r.DURATION,1)}}}if(r.Z_ORDER in e){this._animation.zOrderTimeline=this._parseTimeline(e[r.Z_ORDER],null,r.FRAME,1,false,false,0,this._parseZOrderFrame)}if(r.BONE in e){var h=e[r.BONE];for(var u=0,f=h;u<f.length;u++){var _=f[u];this._parseBoneTimeline(_)}}if(r.SLOT in e){var h=e[r.SLOT];for(var c=0,p=h;c<p.length;c++){var _=p[c];this._parseSlotTimeline(_)}}if(r.FFD in e){var h=e[r.FFD];for(var m=0,d=h;m<d.length;m++){var _=d[m];var y=r._getString(_,r.SKIN,"");var g=r._getString(_,r.SLOT,"");var v=r._getString(_,r.NAME,"");if(y.length===0){y=r.DEFAULT_NAME}this._skin=this._armature.getSkin(y);if(this._skin===null){continue}this._slot=this._armature.getSlot(g);this._mesh=this._skin.getDisplay(g,v);if(this._skin===null||this._slot===null||this._mesh===null){continue}var b=this._parseTimeline(_,null,r.FRAME,22,false,true,0,this._parseSlotFFDFrame);if(b!==null){this._animation.addSlotTimeline(this._slot,b)}this._skin=null;this._slot=null;this._mesh=null}}if(r.IK in e){var h=e[r.IK];for(var T=0,D=h;T<D.length;T++){var _=D[T];var A=r._getString(_,r.NAME,"");var x=this._armature.getConstraint(A);if(x===null){continue}var O=this._parseTimeline(_,null,r.FRAME,30,true,false,2,this._parseIKConstraintFrame);if(O!==null){this._animation.addConstraintTimeline(x,O)}}}if(this._actionFrames.length>0){this._animation.actionTimeline=this._parseTimeline(null,this._actionFrames,"",0,false,false,0,this._parseActionFrame);this._actionFrames.length=0}this._animation=null;return i};r.prototype._parseTimeline=function(e,a,n,s,o,l,h,u){if(e!==null&&n.length>0&&n in e){a=e[n]}if(a===null){return null}var f=a.length;if(f===0){return null}var _=this._frameIntArray.length;var c=this._frameFloatArray.length;var p=t.BaseObject.borrowObject(t.TimelineData);var m=this._timelineArray.length;this._timelineArray.length+=1+1+1+1+1+f;if(e!==null){this._timelineArray[m+0]=Math.round(r._getNumber(e,r.SCALE,1)*100);this._timelineArray[m+1]=Math.round(r._getNumber(e,r.OFFSET,0)*100)}else{this._timelineArray[m+0]=100;this._timelineArray[m+1]=0}this._timelineArray[m+2]=f;this._timelineArray[m+3]=h;if(o){this._timelineArray[m+4]=_-this._animation.frameIntOffset}else if(l){this._timelineArray[m+4]=c-this._animation.frameFloatOffset}else{this._timelineArray[m+4]=0}this._timeline=p;p.type=s;p.offset=m;if(f===1){p.frameIndicesOffset=-1;this._timelineArray[m+5+0]=u.call(this,a[0],0,0)-this._animation.frameOffset}else{var d=this._animation.frameCount+1;var y=this._data.frameIndices;var g=0;if(t.DragonBones.webAssembly){g=y.size();y.resize(g+d,0)}else{g=y.length;y.length+=d}p.frameIndicesOffset=g;for(var v=0,b=0,T=0,D=0;v<d;++v){if(T+D<=v&&b<f){var A=a[b];T=v;if(b===f-1){D=this._animation.frameCount-T}else{if(A instanceof i){D=this._actionFrames[b+1].frameStart-T}else{D=r._getNumber(A,r.DURATION,1)}}this._timelineArray[m+5+b]=u.call(this,A,T,D)-this._animation.frameOffset;b++}if(t.DragonBones.webAssembly){y.set(g+v,b-1)}else{y[g+v]=b-1}}}this._timeline=null;return p};r.prototype._parseBoneTimeline=function(t){var e=this._armature.getBone(r._getString(t,r.NAME,""));if(e===null){return}this._bone=e;this._slot=this._armature.getSlot(this._bone.name);if(r.TRANSLATE_FRAME in t){var i=this._parseTimeline(t,null,r.TRANSLATE_FRAME,11,false,true,2,this._parseBoneTranslateFrame);if(i!==null){this._animation.addBoneTimeline(e,i)}}if(r.ROTATE_FRAME in t){var i=this._parseTimeline(t,null,r.ROTATE_FRAME,12,false,true,2,this._parseBoneRotateFrame);if(i!==null){this._animation.addBoneTimeline(e,i)}}if(r.SCALE_FRAME in t){var i=this._parseTimeline(t,null,r.SCALE_FRAME,13,false,true,2,this._parseBoneScaleFrame);if(i!==null){this._animation.addBoneTimeline(e,i)}}if(r.FRAME in t){var i=this._parseTimeline(t,null,r.FRAME,10,false,true,6,this._parseBoneAllFrame);if(i!==null){this._animation.addBoneTimeline(e,i)}}this._bone=null;this._slot=null};r.prototype._parseSlotTimeline=function(t){var e=this._armature.getSlot(r._getString(t,r.NAME,""));if(e===null){return}this._slot=e;var i=null;if(r.DISPLAY_FRAME in t){i=this._parseTimeline(t,null,r.DISPLAY_FRAME,20,false,false,0,this._parseSlotDisplayFrame)}else{i=this._parseTimeline(t,null,r.FRAME,20,false,false,0,this._parseSlotDisplayFrame)}if(i!==null){this._animation.addSlotTimeline(e,i)}var a=null;if(r.COLOR_FRAME in t){a=this._parseTimeline(t,null,r.COLOR_FRAME,21,true,false,1,this._parseSlotColorFrame)}else{a=this._parseTimeline(t,null,r.FRAME,21,true,false,1,this._parseSlotColorFrame)}if(a!==null){this._animation.addSlotTimeline(e,a)}this._slot=null};r.prototype._parseFrame=function(t,e,i){t;i;var r=this._frameArray.length;this._frameArray.length+=1;this._frameArray[r+0]=e;return r};r.prototype._parseTweenFrame=function(t,e,i){var a=this._parseFrame(t,e,i);if(i>0){if(r.CURVE in t){var n=i+1;this._helpArray.length=n;this._samplingEasingCurve(t[r.CURVE],this._helpArray);this._frameArray.length+=1+1+this._helpArray.length;this._frameArray[a+1]=2;this._frameArray[a+2]=n;for(var s=0;s<n;++s){this._frameArray[a+3+s]=Math.round(this._helpArray[s]*1e4)}}else{var o=-2;var l=o;if(r.TWEEN_EASING in t){l=r._getNumber(t,r.TWEEN_EASING,o)}if(l===o){this._frameArray.length+=1;this._frameArray[a+1]=0}else if(l===0){this._frameArray.length+=1;this._frameArray[a+1]=1}else if(l<0){this._frameArray.length+=1+1;this._frameArray[a+1]=3;this._frameArray[a+2]=Math.round(-l*100)}else if(l<=1){this._frameArray.length+=1+1;this._frameArray[a+1]=4;this._frameArray[a+2]=Math.round(l*100)}else{this._frameArray.length+=1+1;this._frameArray[a+1]=5;this._frameArray[a+2]=Math.round(l*100-100)}}}else{this._frameArray.length+=1;this._frameArray[a+1]=0}return a};r.prototype._parseActionFrame=function(t,e,i){i;var r=this._frameArray.length;var a=t.actions.length;this._frameArray.length+=1+1+a;this._frameArray[r+0]=e;this._frameArray[r+0+1]=a;for(var n=0;n<a;++n){this._frameArray[r+0+2+n]=t.actions[n]}return r};r.prototype._parseZOrderFrame=function(t,e,i){var a=this._parseFrame(t,e,i);if(r.Z_ORDER in t){var n=t[r.Z_ORDER];if(n.length>0){var s=this._armature.sortedSlots.length;var o=new Array(s-n.length/2);var l=new Array(s);for(var h=0;h<o.length;++h){o[h]=0}for(var u=0;u<s;++u){l[u]=-1}var f=0;var _=0;for(var c=0,p=n.length;c<p;c+=2){var m=n[c];var d=n[c+1];while(f!==m){o[_++]=f++}l[f+d]=f++}while(f<s){o[_++]=f++}this._frameArray.length+=1+s;this._frameArray[a+1]=s;var y=s;while(y--){if(l[y]===-1){this._frameArray[a+2+y]=o[--_]||0}else{this._frameArray[a+2+y]=l[y]||0}}return a}}this._frameArray.length+=1;this._frameArray[a+1]=0;return a};r.prototype._parseBoneAllFrame=function(e,i,a){this._helpTransform.identity();if(r.TRANSFORM in e){this._parseTransform(e[r.TRANSFORM],this._helpTransform,1)}var n=this._helpTransform.rotation;if(i!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,r.TWEEN_ROTATE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,i,a);var o=this._frameFloatArray.length;this._frameFloatArray.length+=6;this._frameFloatArray[o++]=this._helpTransform.x;this._frameFloatArray[o++]=this._helpTransform.y;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=this._helpTransform.skew;this._frameFloatArray[o++]=this._helpTransform.scaleX;this._frameFloatArray[o++]=this._helpTransform.scaleY;this._parseActionDataInFrame(e,i,this._bone,this._slot);return s};r.prototype._parseBoneTranslateFrame=function(t,e,i){var a=this._parseTweenFrame(t,e,i);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r._getNumber(t,r.X,0);this._frameFloatArray[n++]=r._getNumber(t,r.Y,0);return a};r.prototype._parseBoneRotateFrame=function(e,i,a){var n=r._getNumber(e,r.ROTATE,0)*t.Transform.DEG_RAD;if(i!==0){if(this._prevClockwise===0){n=this._prevRotation+t.Transform.normalizeRadian(n-this._prevRotation)}else{if(this._prevClockwise>0?n>=this._prevRotation:n<=this._prevRotation){this._prevClockwise=this._prevClockwise>0?this._prevClockwise-1:this._prevClockwise+1}n=this._prevRotation+n-this._prevRotation+t.Transform.PI_D*this._prevClockwise}}this._prevClockwise=r._getNumber(e,r.CLOCK_WISE,0);this._prevRotation=n;var s=this._parseTweenFrame(e,i,a);var o=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[o++]=n;this._frameFloatArray[o++]=r._getNumber(e,r.SKEW,0)*t.Transform.DEG_RAD;return s};r.prototype._parseBoneScaleFrame=function(t,e,i){var a=this._parseTweenFrame(t,e,i);var n=this._frameFloatArray.length;this._frameFloatArray.length+=2;this._frameFloatArray[n++]=r._getNumber(t,r.X,1);this._frameFloatArray[n++]=r._getNumber(t,r.Y,1);return a};r.prototype._parseSlotDisplayFrame=function(t,e,i){var a=this._parseFrame(t,e,i);this._frameArray.length+=1;if(r.VALUE in t){this._frameArray[a+1]=r._getNumber(t,r.VALUE,0)}else{this._frameArray[a+1]=r._getNumber(t,r.DISPLAY_INDEX,0)}this._parseActionDataInFrame(t,e,this._slot.parent,this._slot);return a};r.prototype._parseSlotColorFrame=function(t,e,i){var a=this._parseTweenFrame(t,e,i);var n=-1;if(r.VALUE in t||r.COLOR in t){var s=r.VALUE in t?t[r.VALUE]:t[r.COLOR];for(var o in s){o;this._parseColorTransform(s,this._helpColorTransform);n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=Math.round(this._helpColorTransform.alphaMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.redMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.greenMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.blueMultiplier*100);this._intArray[n++]=Math.round(this._helpColorTransform.alphaOffset);this._intArray[n++]=Math.round(this._helpColorTransform.redOffset);this._intArray[n++]=Math.round(this._helpColorTransform.greenOffset);this._intArray[n++]=Math.round(this._helpColorTransform.blueOffset);n-=8;break}}if(n<0){if(this._defaultColorOffset<0){this._defaultColorOffset=n=this._intArray.length;this._intArray.length+=8;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=100;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0;this._intArray[n++]=0}n=this._defaultColorOffset}var l=this._frameIntArray.length;this._frameIntArray.length+=1;this._frameIntArray[l]=n;return a};r.prototype._parseSlotFFDFrame=function(t,e,i){var a=this._frameFloatArray.length;var n=this._parseTweenFrame(t,e,i);var s=r.VERTICES in t?t[r.VERTICES]:null;var o=r._getNumber(t,r.OFFSET,0);var l=this._intArray[this._mesh.offset+0];var h=this._skin.name+"_"+this._slot.name+"_"+this._mesh.name;var u=0;var f=0;var _=0;var c=0;if(this._mesh.weight!==null){var p=this._weightSlotPose[h];this._helpMatrixA.copyFromArray(p,0);this._frameFloatArray.length+=this._mesh.weight.count*2;_=this._mesh.weight.offset+2+this._mesh.weight.bones.length}else{this._frameFloatArray.length+=l*2}for(var m=0;m<l*2;m+=2){if(s===null){u=0;f=0}else{if(m<o||m-o>=s.length){u=0}else{u=s[m-o]}if(m+1<o||m+1-o>=s.length){f=0}else{f=s[m+1-o]}}if(this._mesh.weight!==null){var d=this._weightBonePoses[h];var y=this._intArray[_++];this._helpMatrixA.transformPoint(u,f,this._helpPoint,true);u=this._helpPoint.x;f=this._helpPoint.y;for(var g=0;g<y;++g){var v=this._intArray[_++];this._helpMatrixB.copyFromArray(d,v*7+1);this._helpMatrixB.invert();this._helpMatrixB.transformPoint(u,f,this._helpPoint,true);this._frameFloatArray[a+c++]=this._helpPoint.x;this._frameFloatArray[a+c++]=this._helpPoint.y}}else{this._frameFloatArray[a+m]=u;this._frameFloatArray[a+m+1]=f}}if(e===0){var b=this._frameIntArray.length;this._frameIntArray.length+=1+1+1+1+1;this._frameIntArray[b+0]=this._mesh.offset;this._frameIntArray[b+1]=this._frameFloatArray.length-a;this._frameIntArray[b+2]=this._frameFloatArray.length-a;this._frameIntArray[b+3]=0;this._frameIntArray[b+4]=a;this._timelineArray[this._timeline.offset+3]=b-this._animation.frameIntOffset}return n};r.prototype._parseIKConstraintFrame=function(t,e,i){var a=this._parseTweenFrame(t,e,i);var n=this._frameIntArray.length;this._frameIntArray.length+=2;this._frameIntArray[n++]=r._getBoolean(t,r.BEND_POSITIVE,true)?1:0;this._frameIntArray[n++]=Math.round(r._getNumber(t,r.WEIGHT,1)*100);return a};r.prototype._parseActionData=function(e,i,a,n){var s=new Array;if(typeof e==="string"){var o=t.BaseObject.borrowObject(t.ActionData);o.type=i;o.name=e;o.bone=a;o.slot=n;s.push(o)}else if(e instanceof Array){for(var l=0,h=e;l<h.length;l++){var u=h[l];var o=t.BaseObject.borrowObject(t.ActionData);if(r.GOTO_AND_PLAY in u){o.type=0;o.name=r._getString(u,r.GOTO_AND_PLAY,"")}else{if(r.TYPE in u&&typeof u[r.TYPE]==="string"){o.type=r._getActionType(u[r.TYPE])}else{o.type=r._getNumber(u,r.TYPE,i)}o.name=r._getString(u,r.NAME,"")}if(r.BONE in u){var f=r._getString(u,r.BONE,"");o.bone=this._armature.getBone(f)}else{o.bone=a}if(r.SLOT in u){var _=r._getString(u,r.SLOT,"");o.slot=this._armature.getSlot(_)}else{o.slot=n}var c=null;if(r.INTS in u){if(c===null){c=t.BaseObject.borrowObject(t.UserData)}var p=u[r.INTS];for(var m=0,d=p;m<d.length;m++){var y=d[m];c.addInt(y)}}if(r.FLOATS in u){if(c===null){c=t.BaseObject.borrowObject(t.UserData)}var g=u[r.FLOATS];for(var v=0,b=g;v<b.length;v++){var y=b[v];c.addFloat(y)}}if(r.STRINGS in u){if(c===null){c=t.BaseObject.borrowObject(t.UserData)}var T=u[r.STRINGS];for(var D=0,A=T;D<A.length;D++){var y=A[D];c.addString(y)}}o.data=c;s.push(o)}}return s};r.prototype._parseTransform=function(e,i,a){i.x=r._getNumber(e,r.X,0)*a;i.y=r._getNumber(e,r.Y,0)*a;if(r.ROTATE in e||r.SKEW in e){i.rotation=t.Transform.normalizeRadian(r._getNumber(e,r.ROTATE,0)*t.Transform.DEG_RAD);i.skew=t.Transform.normalizeRadian(r._getNumber(e,r.SKEW,0)*t.Transform.DEG_RAD)}else if(r.SKEW_X in e||r.SKEW_Y in e){i.rotation=t.Transform.normalizeRadian(r._getNumber(e,r.SKEW_Y,0)*t.Transform.DEG_RAD);i.skew=t.Transform.normalizeRadian(r._getNumber(e,r.SKEW_X,0)*t.Transform.DEG_RAD)-i.rotation}i.scaleX=r._getNumber(e,r.SCALE_X,1);i.scaleY=r._getNumber(e,r.SCALE_Y,1)};r.prototype._parseColorTransform=function(t,e){e.alphaMultiplier=r._getNumber(t,r.ALPHA_MULTIPLIER,100)*.01;e.redMultiplier=r._getNumber(t,r.RED_MULTIPLIER,100)*.01;e.greenMultiplier=r._getNumber(t,r.GREEN_MULTIPLIER,100)*.01;e.blueMultiplier=r._getNumber(t,r.BLUE_MULTIPLIER,100)*.01;e.alphaOffset=r._getNumber(t,r.ALPHA_OFFSET,0);e.redOffset=r._getNumber(t,r.RED_OFFSET,0);e.greenOffset=r._getNumber(t,r.GREEN_OFFSET,0);e.blueOffset=r._getNumber(t,r.BLUE_OFFSET,0)};r.prototype._parseArray=function(t){t;this._intArray.length=0;this._floatArray.length=0;this._frameIntArray.length=0;this._frameFloatArray.length=0;this._frameArray.length=0;this._timelineArray.length=0};r.prototype._modifyArray=function(){if(this._intArray.length%Int16Array.BYTES_PER_ELEMENT!==0){this._intArray.push(0)}if(this._frameIntArray.length%Int16Array.BYTES_PER_ELEMENT!==0){this._frameIntArray.push(0)}if(this._frameArray.length%Int16Array.BYTES_PER_ELEMENT!==0){this._frameArray.push(0)}if(this._timelineArray.length%Uint16Array.BYTES_PER_ELEMENT!==0){this._timelineArray.push(0)}var e=this._intArray.length*Int16Array.BYTES_PER_ELEMENT;var i=this._floatArray.length*Float32Array.BYTES_PER_ELEMENT;var r=this._frameIntArray.length*Int16Array.BYTES_PER_ELEMENT;var a=this._frameFloatArray.length*Float32Array.BYTES_PER_ELEMENT;var n=this._frameArray.length*Int16Array.BYTES_PER_ELEMENT;var s=this._timelineArray.length*Uint16Array.BYTES_PER_ELEMENT;var o=e+i+r+a+n+s;if(t.DragonBones.webAssembly){var l=t.webAssemblyModule.HEAP16.buffer;var h=t.webAssemblyModule._malloc(o);var u=new Int16Array(l,h,this._intArray.length);var f=new Float32Array(l,h+e,this._floatArray.length);var _=new Int16Array(l,h+e+i,this._frameIntArray.length);var c=new Float32Array(l,h+e+i+r,this._frameFloatArray.length);var p=new Int16Array(l,h+e+i+r+a,this._frameArray.length);var m=new Uint16Array(l,h+e+i+r+a+n,this._timelineArray.length);for(var d=0,y=this._intArray.length;d<y;++d){u[d]=this._intArray[d]}for(var d=0,y=this._floatArray.length;d<y;++d){f[d]=this._floatArray[d]}for(var d=0,y=this._frameIntArray.length;d<y;++d){_[d]=this._frameIntArray[d]}for(var d=0,y=this._frameFloatArray.length;d<y;++d){c[d]=this._frameFloatArray[d]}for(var d=0,y=this._frameArray.length;d<y;++d){p[d]=this._frameArray[d]}for(var d=0,y=this._timelineArray.length;d<y;++d){m[d]=this._timelineArray[d]}t.webAssemblyModule.setDataBinary(this._data,h,e,i,r,a,n,s)}else{var g=new ArrayBuffer(o);var u=new Int16Array(g,0,this._intArray.length);var f=new Float32Array(g,e,this._floatArray.length);var _=new Int16Array(g,e+i,this._frameIntArray.length);var c=new Float32Array(g,e+i+r,this._frameFloatArray.length);var p=new Int16Array(g,e+i+r+a,this._frameArray.length);var m=new Uint16Array(g,e+i+r+a+n,this._timelineArray.length);for(var d=0,y=this._intArray.length;d<y;++d){u[d]=this._intArray[d]}for(var d=0,y=this._floatArray.length;d<y;++d){f[d]=this._floatArray[d]}for(var d=0,y=this._frameIntArray.length;d<y;++d){_[d]=this._frameIntArray[d]}for(var d=0,y=this._frameFloatArray.length;d<y;++d){c[d]=this._frameFloatArray[d]}for(var d=0,y=this._frameArray.length;d<y;++d){p[d]=this._frameArray[d]}for(var d=0,y=this._timelineArray.length;d<y;++d){m[d]=this._timelineArray[d]}this._data.binary=g;this._data.intArray=u;this._data.floatArray=f;this._data.frameIntArray=_;this._data.frameFloatArray=c;this._data.frameArray=p;this._data.timelineArray=m}this._defaultColorOffset=-1};r.prototype.parseDragonBonesData=function(e,i){if(i===void 0){i=1}console.assert(e!==null&&e!==undefined,"Data error.");var a=r._getString(e,r.VERSION,"");var n=r._getString(e,r.COMPATIBLE_VERSION,"");if(r.DATA_VERSIONS.indexOf(a)>=0||r.DATA_VERSIONS.indexOf(n)>=0){var s=t.BaseObject.borrowObject(t.DragonBonesData);s.version=a;s.name=r._getString(e,r.NAME,"");s.frameRate=r._getNumber(e,r.FRAME_RATE,24);if(s.frameRate===0){s.frameRate=24}if(r.ARMATURE in e){this._data=s;this._parseArray(e);var o=e[r.ARMATURE];for(var l=0,h=o;l<h.length;l++){var u=h[l];s.addArmature(this._parseArmature(u,i))}if(!this._data.binary){this._modifyArray()}if(r.STAGE in e){s.stage=s.getArmature(r._getString(e,r.STAGE,""))}else if(s.armatureNames.length>0){s.stage=s.getArmature(s.armatureNames[0])}this._data=null}if(r.TEXTURE_ATLAS in e){this._rawTextureAtlases=e[r.TEXTURE_ATLAS]}return s}else{console.assert(false,"Nonsupport data version: "+a+"\n"+"Please convert DragonBones data to support version.\n"+"Read more: https://github.com/DragonBones/Tools/")}return null};r.prototype.parseTextureAtlasData=function(e,i,a){if(a===void 0){a=1}console.assert(e!==undefined);if(e===null){if(this._rawTextureAtlases===null||this._rawTextureAtlases.length===0){return false}var n=this._rawTextureAtlases[this._rawTextureAtlasIndex++];this.parseTextureAtlasData(n,i,a);if(this._rawTextureAtlasIndex>=this._rawTextureAtlases.length){this._rawTextureAtlasIndex=0;this._rawTextureAtlases=null}return true}i.width=r._getNumber(e,r.WIDTH,0);i.height=r._getNumber(e,r.HEIGHT,0);i.scale=a===1?1/r._getNumber(e,r.SCALE,1):a;i.name=r._getString(e,r.NAME,"");i.imagePath=r._getString(e,r.IMAGE_PATH,"");if(r.SUB_TEXTURE in e){var s=e[r.SUB_TEXTURE];for(var o=0,l=s.length;o<l;++o){var h=s[o];var u=i.createTexture();u.rotated=r._getBoolean(h,r.ROTATED,false);u.name=r._getString(h,r.NAME,"");u.region.x=r._getNumber(h,r.X,0);u.region.y=r._getNumber(h,r.Y,0);u.region.width=r._getNumber(h,r.WIDTH,0);u.region.height=r._getNumber(h,r.HEIGHT,0);var f=r._getNumber(h,r.FRAME_WIDTH,-1);var _=r._getNumber(h,r.FRAME_HEIGHT,-1);if(f>0&&_>0){u.frame=t.TextureData.createRectangle();u.frame.x=r._getNumber(h,r.FRAME_X,0);u.frame.y=r._getNumber(h,r.FRAME_Y,0);u.frame.width=f;u.frame.height=_}i.addTexture(u)}}return true};r.getInstance=function(){if(r._objectDataParserInstance===null){r._objectDataParserInstance=new r}return r._objectDataParserInstance};r._objectDataParserInstance=null;return r}(t.DataParser);t.ObjectDataParser=e;var i=function(){function t(){this.frameStart=0;this.actions=[]}return t}();t.ActionFrame=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}i.prototype._inRange=function(t,e,i){return e<=t&&t<=i};i.prototype._decodeUTF8=function(t){var e=-1;var i=-1;var r=65533;var a=0;var n="";var s;var o=0;var l=0;var h=0;var u=0;while(t.length>a){var f=t[a++];if(f===e){if(l!==0){s=r}else{s=i}}else{if(l===0){if(this._inRange(f,0,127)){s=f}else{if(this._inRange(f,194,223)){l=1;u=128;o=f-192}else if(this._inRange(f,224,239)){l=2;u=2048;o=f-224}else if(this._inRange(f,240,244)){l=3;u=65536;o=f-240}else{}o=o*Math.pow(64,l);s=null}}else if(!this._inRange(f,128,191)){o=0;l=0;h=0;u=0;a--;s=f}else{h+=1;o=o+(f-128)*Math.pow(64,l-h);if(h!==l){s=null}else{var _=o;var c=u;o=0;l=0;h=0;u=0;if(this._inRange(_,c,1114111)&&!this._inRange(_,55296,57343)){s=_}else{s=f}}}}if(s!==null&&s!==i){if(s<=65535){if(s>0)n+=String.fromCharCode(s)}else{s-=65536;n+=String.fromCharCode(55296+(s>>10&1023));n+=String.fromCharCode(56320+(s&1023))}}}return n};i.prototype._getUTF16Key=function(t){for(var e=0,i=t.length;e<i;++e){if(t.charCodeAt(e)>255){return encodeURI(t)}}return t};i.prototype._parseBinaryTimeline=function(e,i,r){if(r===void 0){r=null}var a=r!==null?r:t.BaseObject.borrowObject(t.TimelineData);a.type=e;a.offset=i;this._timeline=a;var n=this._timelineArrayBuffer[a.offset+2];if(n===1){a.frameIndicesOffset=-1}else{var s=0;var o=this._animation.frameCount+1;var l=this._data.frameIndices;if(t.DragonBones.webAssembly){s=l.size();l.resize(s+o,0)}else{s=l.length;l.length+=o}a.frameIndicesOffset=s;for(var h=0,u=0,f=0,_=0;h<o;++h){if(f+_<=h&&u<n){f=this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[a.offset+5+u]];if(u===n-1){_=this._animation.frameCount-f}else{_=this._frameArrayBuffer[this._animation.frameOffset+this._timelineArrayBuffer[a.offset+5+u+1]]-f}u++}if(t.DragonBones.webAssembly){l.set(s+h,u-1)}else{l[s+h]=u-1}}}this._timeline=null;return a};i.prototype._parseMesh=function(e,i){i.offset=e[t.ObjectDataParser.OFFSET];var r=this._intArrayBuffer[i.offset+3];if(r>=0){var a=t.BaseObject.borrowObject(t.WeightData);var n=this._intArrayBuffer[i.offset+0];var s=this._intArrayBuffer[r+0];a.offset=r;for(var o=0;o<s;++o){var l=this._intArrayBuffer[r+2+o];a.addBone(this._rawBones[l])}var h=r+2+s;var u=0;for(var o=0,f=n;o<f;++o){var _=this._intArrayBuffer[h++];u+=_;h+=_}a.count=u;i.weight=a}};i.prototype._parseAnimation=function(e){var i=t.BaseObject.borrowObject(t.AnimationData);i.frameCount=Math.max(t.ObjectDataParser._getNumber(e,t.ObjectDataParser.DURATION,1),1);i.playTimes=t.ObjectDataParser._getNumber(e,t.ObjectDataParser.PLAY_TIMES,1);i.duration=i.frameCount/this._armature.frameRate;i.fadeInTime=t.ObjectDataParser._getNumber(e,t.ObjectDataParser.FADE_IN_TIME,0);i.scale=t.ObjectDataParser._getNumber(e,t.ObjectDataParser.SCALE,1);i.name=t.ObjectDataParser._getString(e,t.ObjectDataParser.NAME,t.ObjectDataParser.DEFAULT_NAME);if(i.name.length===0){i.name=t.ObjectDataParser.DEFAULT_NAME}var r=e[t.ObjectDataParser.OFFSET];i.frameIntOffset=r[0];i.frameFloatOffset=r[1];i.frameOffset=r[2];this._animation=i;if(t.ObjectDataParser.ACTION in e){i.actionTimeline=this._parseBinaryTimeline(0,e[t.ObjectDataParser.ACTION])}if(t.ObjectDataParser.Z_ORDER in e){i.zOrderTimeline=this._parseBinaryTimeline(1,e[t.ObjectDataParser.Z_ORDER])}if(t.ObjectDataParser.BONE in e){var a=e[t.ObjectDataParser.BONE];for(var n in a){var s=a[n];if(t.DragonBones.webAssembly){n=this._getUTF16Key(n)}var o=this._armature.getBone(n);if(o===null){continue}for(var l=0,h=s.length;l<h;l+=2){var u=s[l];var f=s[l+1];var _=this._parseBinaryTimeline(u,f);this._animation.addBoneTimeline(o,_)}}}if(t.ObjectDataParser.SLOT in e){var a=e[t.ObjectDataParser.SLOT];for(var n in a){var s=a[n];if(t.DragonBones.webAssembly){n=this._getUTF16Key(n)}var c=this._armature.getSlot(n);if(c===null){continue}for(var l=0,h=s.length;l<h;l+=2){var u=s[l];var f=s[l+1];var _=this._parseBinaryTimeline(u,f);this._animation.addSlotTimeline(c,_)}}}if(t.ObjectDataParser.CONSTRAINT in e){var a=e[t.ObjectDataParser.CONSTRAINT];for(var n in a){var s=a[n];if(t.DragonBones.webAssembly){n=this._getUTF16Key(n)}var p=this._armature.getConstraint(n);if(p===null){continue}for(var l=0,h=s.length;l<h;l+=2){var u=s[l];var f=s[l+1];var _=this._parseBinaryTimeline(u,f);this._animation.addConstraintTimeline(p,_)}}}this._animation=null;return i};i.prototype._parseArray=function(e){var i=e[t.ObjectDataParser.OFFSET];var r=i[1];var a=i[3];var n=i[5];var s=i[7];var o=i[9];var l=i[11];var h=new Int16Array(this._binary,this._binaryOffset+i[0],r/Int16Array.BYTES_PER_ELEMENT);var u=new Float32Array(this._binary,this._binaryOffset+i[2],a/Float32Array.BYTES_PER_ELEMENT);var f=new Int16Array(this._binary,this._binaryOffset+i[4],n/Int16Array.BYTES_PER_ELEMENT);var _=new Float32Array(this._binary,this._binaryOffset+i[6],s/Float32Array.BYTES_PER_ELEMENT);var c=new Int16Array(this._binary,this._binaryOffset+i[8],o/Int16Array.BYTES_PER_ELEMENT);var p=new Uint16Array(this._binary,this._binaryOffset+i[10],l/Uint16Array.BYTES_PER_ELEMENT);if(t.DragonBones.webAssembly){var m=r+a+n+s+o+l;var d=t.webAssemblyModule._malloc(m);var y=new Uint8Array(this._binary,this._binaryOffset,m/Uint8Array.BYTES_PER_ELEMENT);var g=new Uint8Array(t.webAssemblyModule.HEAP16.buffer,d,y.length);for(var v=0,b=y.length;v<b;++v){g[v]=y[v]}t.webAssemblyModule.setDataBinary(this._data,d,r,a,n,s,o,l);this._intArrayBuffer=h;this._floatArrayBuffer=u;this._frameIntArrayBuffer=f;this._frameFloatArrayBuffer=_;this._frameArrayBuffer=c;this._timelineArrayBuffer=p}else{this._data.binary=this._binary;this._data.intArray=this._intArrayBuffer=h;this._data.floatArray=this._floatArrayBuffer=u;this._data.frameIntArray=this._frameIntArrayBuffer=f;this._data.frameFloatArray=this._frameFloatArrayBuffer=_;this._data.frameArray=this._frameArrayBuffer=c;this._data.timelineArray=this._timelineArrayBuffer=p}};i.prototype.parseDragonBonesData=function(t,i){if(i===void 0){i=1}console.assert(t!==null&&t!==undefined&&t instanceof ArrayBuffer,"Data error.");var r=new Uint8Array(t,0,8);if(r[0]!=="D".charCodeAt(0)||r[1]!=="B".charCodeAt(0)||r[2]!=="D".charCodeAt(0)||r[3]!=="T".charCodeAt(0)){console.assert(false,"Nonsupport data.");return null}var a=new Uint32Array(t,8,1)[0];var n=new Uint8Array(t,8+4,a);var s=this._decodeUTF8(n);var o=JSON.parse(s);this._binaryOffset=8+4+a;this._binary=t;return e.prototype.parseDragonBonesData.call(this,o,i)};i.getInstance=function(){if(i._binaryDataParserInstance===null){i._binaryDataParserInstance=new i}return i._binaryDataParserInstance};i._binaryDataParserInstance=null;return i}(t.ObjectDataParser);t.BinaryDataParser=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function e(i){if(i===void 0){i=null}this.autoSearch=false;this._dragonBonesDataMap={};this._textureAtlasDataMap={};this._dragonBones=null;this._dataParser=null;if(e._objectParser===null){e._objectParser=new t.ObjectDataParser}if(e._binaryParser===null){e._binaryParser=new t.BinaryDataParser}this._dataParser=i!==null?i:e._objectParser}e.prototype._isSupportMesh=function(){return true};e.prototype._getTextureData=function(t,e){if(t in this._textureAtlasDataMap){for(var i=0,r=this._textureAtlasDataMap[t];i<r.length;i++){var a=r[i];var n=a.getTexture(e);if(n!==null){return n}}}if(this.autoSearch){for(var s in this._textureAtlasDataMap){for(var o=0,l=this._textureAtlasDataMap[s];o<l.length;o++){var a=l[o];if(a.autoSearch){var n=a.getTexture(e);if(n!==null){return n}}}}}return null};e.prototype._fillBuildArmaturePackage=function(t,e,i,r,a){var n=null;var s=null;if(e.length>0){if(e in this._dragonBonesDataMap){n=this._dragonBonesDataMap[e];s=n.getArmature(i)}}if(s===null&&(e.length===0||this.autoSearch)){for(var o in this._dragonBonesDataMap){n=this._dragonBonesDataMap[o];if(e.length===0||n.autoSearch){s=n.getArmature(i);if(s!==null){e=o;break}}}}if(s!==null){t.dataName=e;t.textureAtlasName=a;t.data=n;t.armature=s;t.skin=null;if(r.length>0){t.skin=s.getSkin(r);if(t.skin===null&&this.autoSearch){for(var o in this._dragonBonesDataMap){var l=this._dragonBonesDataMap[o];var h=l.getArmature(r);if(h!==null){t.skin=h.defaultSkin;break}}}}if(t.skin===null){t.skin=s.defaultSkin}return true}return false};e.prototype._buildBones=function(e,i){for(var r=0,a=e.armature.sortedBones;r<a.length;r++){var n=a[r];var s=t.BaseObject.borrowObject(t.Bone);s.init(n);if(n.parent!==null){i.addBone(s,n.parent.name)}else{i.addBone(s,"")}}var o=e.armature.constraints;for(var l in o){var h=o[l];var u=t.BaseObject.borrowObject(t.IKConstraint);u.init(h,i);i.addConstraint(u)}};e.prototype._buildSlots=function(e,i){var r=e.skin;var a=e.armature.defaultSkin;if(r===null||a===null){return}var n={};for(var s in a.displays){var o=a.getDisplays(s);n[s]=o}if(r!==a){for(var s in r.displays){var o=r.getDisplays(s);n[s]=o}}for(var l=0,h=e.armature.sortedSlots;l<h.length;l++){var u=h[l];var o=u.name in n?n[u.name]:null;var f=this._buildSlot(e,u,o,i);i.addSlot(f,u.parent.name);if(o!==null){var _=new Array;for(var c=0,p=t.DragonBones.webAssembly?o.size():o.length;c<p;++c){var m=t.DragonBones.webAssembly?o.get(c):o[c];if(m!==null){_.push(this._getSlotDisplay(e,m,null,f))}else{_.push(null)}}f._setDisplayList(_)}f._setDisplayIndex(u.displayIndex,true)}};e.prototype._buildChildArmature=function(t,e,i){e;return this.buildArmature(i.path,t!==null?t.dataName:"","",t!==null?t.textureAtlasName:"")};e.prototype._getSlotDisplay=function(t,e,i,r){var a=t!==null?t.dataName:e.parent.parent.parent.name;var n=null;switch(e.type){case 0:{var s=e;if(s.texture===null){s.texture=this._getTextureData(a,e.path)}else if(t!==null&&t.textureAtlasName.length>0){s.texture=this._getTextureData(t.textureAtlasName,e.path)}if(i!==null&&i.type===2&&this._isSupportMesh()){n=r.meshDisplay}else{n=r.rawDisplay}break}case 2:{var o=e;if(o.texture===null){o.texture=this._getTextureData(a,o.path)}else if(t!==null&&t.textureAtlasName.length>0){o.texture=this._getTextureData(t.textureAtlasName,o.path)}if(this._isSupportMesh()){n=r.meshDisplay}else{n=r.rawDisplay}break}case 1:{var l=e;var h=this._buildChildArmature(t,r,e);if(h!==null){h.inheritAnimation=l.inheritAnimation;if(!h.inheritAnimation){var u=l.actions.length>0?l.actions:h.armatureData.defaultActions;if(u.length>0){for(var f=0,_=u;f<_.length;f++){var c=_[f];h._bufferAction(c,true)}}else{h.animation.play()}}l.armature=h.armatureData}n=h;break}case 3:break;default:break}return n};e.prototype.parseDragonBonesData=function(t,i,r){if(i===void 0){i=null}if(r===void 0){r=1}var a=t instanceof ArrayBuffer?e._binaryParser:this._dataParser;var n=a.parseDragonBonesData(t,r);while(true){var s=this._buildTextureAtlasData(null,null);if(a.parseTextureAtlasData(null,s,r)){this.addTextureAtlasData(s,i)}else{s.returnToPool();break}}if(n!==null){this.addDragonBonesData(n,i)}return n};e.prototype.parseTextureAtlasData=function(t,e,i,r){if(i===void 0){i=null}if(r===void 0){r=1}var a=this._buildTextureAtlasData(null,null);this._dataParser.parseTextureAtlasData(t,a,r);this._buildTextureAtlasData(a,e||null);this.addTextureAtlasData(a,i);return a};e.prototype.updateTextureAtlasData=function(t,e){var i=this.getTextureAtlasData(t);if(i!==null){for(var r=0,a=i.length;r<a;++r){if(r<e.length){this._buildTextureAtlasData(i[r],e[r])}}}};e.prototype.getDragonBonesData=function(t){return t in this._dragonBonesDataMap?this._dragonBonesDataMap[t]:null};e.prototype.addDragonBonesData=function(t,e){if(e===void 0){e=null}e=e!==null?e:t.name;if(e in this._dragonBonesDataMap){if(this._dragonBonesDataMap[e]===t){return}console.warn("Can not add same name data: "+e);return}this._dragonBonesDataMap[e]=t};e.prototype.removeDragonBonesData=function(t,e){if(e===void 0){e=true}if(t in this._dragonBonesDataMap){if(e){this._dragonBones.bufferObject(this._dragonBonesDataMap[t])}delete this._dragonBonesDataMap[t]}};e.prototype.getTextureAtlasData=function(t){return t in this._textureAtlasDataMap?this._textureAtlasDataMap[t]:null};e.prototype.addTextureAtlasData=function(t,e){if(e===void 0){e=null}e=e!==null?e:t.name;var i=e in this._textureAtlasDataMap?this._textureAtlasDataMap[e]:this._textureAtlasDataMap[e]=[];if(i.indexOf(t)<0){i.push(t)}};e.prototype.removeTextureAtlasData=function(t,e){if(e===void 0){e=true}if(t in this._textureAtlasDataMap){var i=this._textureAtlasDataMap[t];if(e){for(var r=0,a=i;r<a.length;r++){var n=a[r];this._dragonBones.bufferObject(n)}}delete this._textureAtlasDataMap[t]}};e.prototype.getArmatureData=function(t,e){if(e===void 0){e=""}var r=new i;if(!this._fillBuildArmaturePackage(r,e,t,"","")){return null}return r.armature};e.prototype.clear=function(t){if(t===void 0){t=true}for(var e in this._dragonBonesDataMap){if(t){this._dragonBones.bufferObject(this._dragonBonesDataMap[e])}delete this._dragonBonesDataMap[e]}for(var e in this._textureAtlasDataMap){if(t){var i=this._textureAtlasDataMap[e];for(var r=0,a=i;r<a.length;r++){var n=a[r];this._dragonBones.bufferObject(n)}}delete this._textureAtlasDataMap[e]}};e.prototype.buildArmature=function(t,e,r,a){if(e===void 0){e=""}if(r===void 0){r=""}if(a===void 0){a=""}var n=new i;if(!this._fillBuildArmaturePackage(n,e||"",t,r||"",a||"")){console.warn("No armature data: "+t+", "+(e!==null?e:""));return null}var s=this._buildArmature(n);this._buildBones(n,s);this._buildSlots(n,s);s.invalidUpdate(null,true);s.advanceTime(0);return s};e.prototype.replaceDisplay=function(e,i,r){if(r===void 0){r=-1}if(r<0){r=e.displayIndex}if(r<0){r=0}e.replaceDisplayData(i,r);var a=e.displayList;if(a.length<=r){a.length=r+1;for(var n=0,s=a.length;n<s;++n){if(!a[n]){a[n]=null}}}if(i!==null){var o=e.rawDisplayDatas;var l=null;if(o){if(t.DragonBones.webAssembly){if(r<o.size()){l=o.get(r)}}else{if(r<o.length){l=o[r]}}}a[r]=this._getSlotDisplay(null,i,l,e)}else{a[r]=null}e.displayList=a};e.prototype.replaceSlotDisplay=function(t,e,i,r,a,n){if(n===void 0){n=-1}var s=this.getArmatureData(e,t||"");if(!s||!s.defaultSkin){return false}var o=s.defaultSkin.getDisplay(i,r);if(!o){return false}this.replaceDisplay(a,o,n);return true};e.prototype.replaceSlotDisplayList=function(e,i,r,a){var n=this.getArmatureData(i,e||"");if(!n||!n.defaultSkin){return false}var s=n.defaultSkin.getDisplays(r);if(!s){return false}var o=0;for(var l=0,h=t.DragonBones.webAssembly?s.size():s.length;l<h;++l){var u=t.DragonBones.webAssembly?s.get(l):s[l];this.replaceDisplay(a,u,o++)}return true};e.prototype.replaceSkin=function(e,i,r,a){if(r===void 0){r=false}if(a===void 0){a=null}var n=false;var s=i.parent.defaultSkin;for(var o=0,l=e.getSlots();o<l.length;o++){var h=l[o];if(a!==null&&a.indexOf(h.name)>=0){continue}var u=i.getDisplays(h.name);if(!u){if(s!==null&&i!==s){u=s.getDisplays(h.name)}if(!u){if(r){h.rawDisplayDatas=null;h.displayList=[]}continue}}var f=t.DragonBones.webAssembly?u.size():u.length;var _=h.displayList;_.length=f;for(var c=0,p=f;c<p;++c){var m=t.DragonBones.webAssembly?u.get(c):u[c];if(m!==null){_[c]=this._getSlotDisplay(null,m,null,h)}else{_[c]=null}}n=true;h.rawDisplayDatas=u;h.displayList=_}return n};e.prototype.replaceAnimation=function(e,i,r){if(r===void 0){r=true}var a=i.defaultSkin;if(a===null){return false}if(r){e.animation.animations=i.animations}else{var n=e.animation.animations;var s={};for(var o in n){s[o]=n[o]}for(var o in i.animations){s[o]=i.animations[o]}e.animation.animations=s}for(var l=0,h=e.getSlots();l<h.length;l++){var u=h[l];var f=0;for(var _=0,c=u.displayList;_<c.length;_++){var p=c[_];if(p instanceof t.Armature){var m=a.getDisplays(u.name);if(m!==null&&f<(t.DragonBones.webAssembly?m.size():m.length)){var d=t.DragonBones.webAssembly?m.get(f):m[f];if(d!==null&&d.type===1){var y=this.getArmatureData(d.path,d.parent.parent.parent.name);if(y){this.replaceAnimation(p,y,r)}}}}f++}}return true};e.prototype.getAllDragonBonesData=function(){return this._dragonBonesDataMap};e.prototype.getAllTextureAtlasData=function(){return this._textureAtlasDataMap};Object.defineProperty(e.prototype,"clock",{get:function(){return this._dragonBones.clock},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"dragonBones",{get:function(){return this._dragonBones},enumerable:true,configurable:true});e.prototype.changeSkin=function(t,e,i){if(i===void 0){i=null}return this.replaceSkin(t,e,false,i)};e.prototype.copyAnimationsToArmature=function(t,e,i,r,a){if(i===void 0){i=""}if(r===void 0){r=""}if(a===void 0){a=true}i;var n=this.getArmatureData(e,r);if(!n){return false}return this.replaceAnimation(t,n,a)};e._objectParser=null;e._binaryParser=null;return e}();t.BaseFactory=e;var i=function(){function t(){this.dataName="";this.textureAtlasName="";this.skin=null}return t}();t.BuildArmaturePackage=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;t._renderTexture=null;return t}r.toString=function(){return"[class dragonBones.EgretTextureAtlasData]"};r.prototype._onClear=function(){e.prototype._onClear.call(this);if(this.disposeEnabled&&this._renderTexture!==null){this._renderTexture.dispose()}this.disposeEnabled=false;this._renderTexture=null};r.prototype.createTexture=function(){return t.BaseObject.borrowObject(i)};Object.defineProperty(r.prototype,"renderTexture",{get:function(){return this._renderTexture},set:function(e){if(this._renderTexture===e){return}this._renderTexture=e;if(this._renderTexture!==null){var i=this._renderTexture.bitmapData;var r=this.width>0?this.width:i.width;var a=this.height>0?this.height:i.height;for(var n in this.textures){var s=egret.$TextureScaleFactor;var o=this.textures[n];var l=o.region.width;var h=o.region.height;if(o.renderTexture===null){o.renderTexture=new egret.Texture}if(t.EgretFactory._isV5){o.renderTexture["$bitmapData"]=i}else{o.renderTexture._bitmapData=i}if(o.rotated){o.renderTexture.$initData(o.region.x*s,o.region.y*s,h*s,l*s,0,0,h*s,l*s,r,a,o.rotated)}else{o.renderTexture.$initData(o.region.x*s,o.region.y*s,l*s,h*s,0,0,l*s,h*s,r,a)}}}else{for(var n in this.textures){var o=this.textures[n];o.renderTexture=null}}},enumerable:true,configurable:true});r.prototype.dispose=function(){console.warn("已废弃。");this.returnToPool()};Object.defineProperty(r.prototype,"texture",{get:function(){console.warn("已废弃。");return this.renderTexture},enumerable:true,configurable:true});return r}(t.TextureAtlasData);t.EgretTextureAtlasData=e;var i=function(t){__extends(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.renderTexture=null;return e}e.toString=function(){return"[class dragonBones.EgretTextureData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);if(this.renderTexture!==null){}this.renderTexture=null};return e}(t.TextureData);t.EgretTextureData=i})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(i.prototype,"eventObject",{get:function(){return this.data},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animationName",{get:function(){var t=this.eventObject.animationState;return t!==null?t.name:""},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"armature",{get:function(){return this.eventObject.armature},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"bone",{get:function(){return this.eventObject.bone},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"slot",{get:function(){return this.eventObject.slot},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"animationState",{get:function(){return this.eventObject.animationState},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"frameLabel",{get:function(){return this.eventObject.name},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"sound",{get:function(){return this.eventObject.name},enumerable:true,configurable:true});Object.defineProperty(i.prototype,"movementID",{get:function(){return this.animationName},enumerable:true,configurable:true});i.START=t.EventObject.START;i.LOOP_COMPLETE=t.EventObject.LOOP_COMPLETE;i.COMPLETE=t.EventObject.COMPLETE;i.FADE_IN=t.EventObject.FADE_IN;i.FADE_IN_COMPLETE=t.EventObject.FADE_IN_COMPLETE;i.FADE_OUT=t.EventObject.FADE_OUT;i.FADE_OUT_COMPLETE=t.EventObject.FADE_OUT_COMPLETE;i.FRAME_EVENT=t.EventObject.FRAME_EVENT;i.SOUND_EVENT=t.EventObject.SOUND_EVENT;i.ANIMATION_FRAME_EVENT=t.EventObject.FRAME_EVENT;i.BONE_FRAME_EVENT=t.EventObject.FRAME_EVENT;i.MOVEMENT_FRAME_EVENT=t.EventObject.FRAME_EVENT;i.SOUND=t.EventObject.SOUND_EVENT;return i}(egret.Event);t.EgretEvent=e;var i=function(i){__extends(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;t.debugDraw=false;t._batchEnabled=!__global["nativeRender"];t._childDirty=true;t._debugDraw=false;t._disposeProxy=false;t._armature=null;t._bounds=null;t._debugDrawer=null;return t}r._cleanBeforeRender=function(){};r.prototype.dbInit=function(t){this._armature=t;if(this._batchEnabled){this.$renderNode=new egret.sys.GroupNode;this.$renderNode.cleanBeforeRender=r._cleanBeforeRender}};r.prototype.dbClear=function(){this._armature=null;this._bounds=null;this._debugDrawer=null};r.prototype.dbUpdate=function(){var e=t.DragonBones.debugDraw||this.debugDraw;if(e||this._debugDraw){this._debugDraw=e;if(this._debugDraw){if(this._debugDrawer===null){this._debugDrawer=new egret.Sprite}this.addChild(this._debugDrawer);this._debugDrawer.graphics.clear();for(var i=0,r=this._armature.getBones();i<r.length;i++){var a=r[i];var n=a.boneData.length;var s=a.globalTransformMatrix.tx;var o=a.globalTransformMatrix.ty;var l=s+a.globalTransformMatrix.a*n;var h=o+a.globalTransformMatrix.b*n;this._debugDrawer.graphics.lineStyle(2,65535,.7);this._debugDrawer.graphics.moveTo(s,o);this._debugDrawer.graphics.lineTo(l,h);this._debugDrawer.graphics.lineStyle(0,0,0);this._debugDrawer.graphics.beginFill(65535,.7);this._debugDrawer.graphics.drawCircle(s,o,3);this._debugDrawer.graphics.endFill()}for(var u=0,f=this._armature.getSlots();u<f.length;u++){var _=f[u];var c=_.boundingBoxData;if(c!==null){var p=this._debugDrawer.getChildByName(_.name);if(p===null){p=new egret.Shape;p.name=_.name;this._debugDrawer.addChild(p)}p.graphics.clear();p.graphics.beginFill(c.color?c.color:16711935,.3);switch(c.type){case 0:p.graphics.drawRect(-c.width*.5,-c.height*.5,c.width,c.height);break;case 1:p.graphics.drawEllipse(-c.width*.5,-c.height*.5,c.width,c.height);break;case 2:var m=c.vertices;for(var d=0;d<m.length;d+=2){if(d===0){p.graphics.moveTo(m[d],m[d+1])}else{p.graphics.lineTo(m[d],m[d+1])}}break;default:break}p.graphics.endFill();_.updateTransformAndMatrix();_.updateGlobalTransform();p.$setMatrix(_.globalTransformMatrix,true)}else{var p=this._debugDrawer.getChildByName(_.name);if(p!==null){this._debugDrawer.removeChild(p)}}}}else if(this._debugDrawer!==null&&this._debugDrawer.parent===this){this.removeChild(this._debugDrawer)}}if(!t.EgretFactory._isV5&&this._batchEnabled&&this._childDirty){this.$invalidateContentBounds()}};r.prototype.dispose=function(t){if(t===void 0){t=true}this._disposeProxy=t;if(this._armature!==null){this._armature.dispose();this._armature=null}};r.prototype.dispatchDBEvent=function(t,r){var a=egret.Event.create(e,t);a.data=r;i.prototype.dispatchEvent.call(this,a);egret.Event.release(a)};r.prototype.hasDBEventListener=function(t){return this.hasEventListener(t)};r.prototype.addDBEventListener=function(t,e,i){this.addEventListener(t,e,i)};r.prototype.removeDBEventListener=function(t,e,i){this.removeEventListener(t,e,i)};r.prototype.disableBatch=function(){if(!this._batchEnabled||!this._armature){return}for(var t=0,e=this._armature.getSlots();t<e.length;t++){var i=e[t];var r=i._meshData?i.meshDisplay:i.rawDisplay;if(!i.display&&r===i.meshDisplay){r=i.rawDisplay}var a=r.$renderNode;if(a.matrix){r.$setMatrix(i.globalTransformMatrix,false)}this.addChild(r)}this._batchEnabled=false;this.$renderNode.cleanBeforeRender=null;this.$renderNode=null;this.armature.invalidUpdate(null,true)};Object.defineProperty(r.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});Object.defineProperty(r.prototype,"animation",{get:function(){return this._armature.animation},enumerable:true,configurable:true});r.prototype.$measureContentBounds=function(e){if(this._batchEnabled&&this._armature){if(this._childDirty){this._childDirty=false;var r=true;var a=new egret.Rectangle;for(var n=0,s=this._armature.getSlots();n<s.length;n++){var o=s[n];var l=o.display;if(!l||!l.$renderNode){continue}var h=l.$renderNode.matrix;if(l===o.meshDisplay){var u=l.$renderNode.vertices;if(u&&u.length>0){a.setTo(999999,999999,-999999,-999999);for(var f=0,_=u.length;f<_;f+=2){var c=u[f];var p=u[f+1];if(a.x>c)a.x=c;if(a.width<c)a.width=c;if(a.y>p)a.y=p;if(a.height<p)a.height=p}a.width-=a.x;a.height-=a.y}else{continue}}else{var m=o._displayDatas[o.displayIndex];if(m&&m instanceof t.ImageDisplayData&&m.texture){var d=m.texture.parent.scale;a.x=0;a.y=0;a.width=m.texture.region.width*d;a.height=m.texture.region.height*d}else{continue}}h.$transformBounds(a);var y=a.x;var g=a.y;var v=a.x+a.width;var b=a.y+a.height;if(r){r=false;e.x=y;e.y=g;e.width=v;e.height=b}else{if(y<e.x){e.x=y}if(g<e.y){e.y=g}if(v>e.width){e.width=v}if(b>e.height){e.height=b}}}e.width-=e.x;e.height-=e.y;if(t.EgretFactory._isV5){if(this._bounds===null){this._bounds=new egret.Rectangle}this._bounds.copyFrom(e)}}else if(t.EgretFactory._isV5){if(this._bounds===null){this._bounds=new egret.Rectangle}e.copyFrom(this._bounds)}return e}return i.prototype.$measureContentBounds.call(this,e)};r.prototype.hasEvent=function(t){return this.hasDBEventListener(t)};r.prototype.addEvent=function(t,e,i){this.addDBEventListener(t,e,i)};r.prototype.removeEvent=function(t,e,i){this.removeDBEventListener(t,e,i)};r.prototype.advanceTimeBySelf=function(e){if(e){this._armature.clock=t.EgretFactory.factory.clock}else{this._armature.clock=null}};return r}(egret.DisplayObjectContainer);t.EgretArmatureDisplay=i;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.Event=r;var a=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.ArmatureEvent=a;var n=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.AnimationEvent=n;var s=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.FrameEvent=s;var o=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(e);t.SoundEvent=o;var l=function(e){__extends(i,e);function i(i,r,a){if(a===void 0){a=1}var n=e.call(this)||this;console.warn("已废弃");n._onClear();t.ObjectDataParser.getInstance().parseTextureAtlasData(r,n,a);n.renderTexture=i;return n}i.toString=function(){return"[class dragonBones.EgretTextureAtlas]"};return i}(t.EgretTextureAtlasData);t.EgretTextureAtlas=l;var h=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(l);t.EgretSheetAtlas=h;var u=function(){function e(){}e.getInstance=function(){console.warn("已废弃");return t.EgretFactory.factory.soundEventManager};return e}();t.SoundEventManager=u;var f=function(){function t(){console.warn("已废弃")}return t}();t.AnimationCacheManager=f})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(){var t=e!==null&&e.apply(this,arguments)||this;t.transformUpdateEnabled=false;t._armatureDisplay=null;t._renderDisplay=null;t._colorFilter=null;return t}i.toString=function(){return"[class dragonBones.EgretSlot]"};i.prototype.init=function(i,r,a,n){e.prototype.init.call(this,i,r,a,n);if(t.EgretFactory._isV5){this._updateTransform=this._updateTransformV5}else{this._updateTransform=this._updateTransformV4}};i.prototype._onClear=function(){e.prototype._onClear.call(this);this._armatureDisplay=null;this._renderDisplay=null;this._colorFilter=null};i.prototype._initDisplay=function(t){t};i.prototype._disposeDisplay=function(t){t};i.prototype._onUpdateDisplay=function(){this._armatureDisplay=this._armature.display;this._renderDisplay=this._display!==null?this._display:this._rawDisplay;if(t.EgretFactory._isV5){if(this._renderDisplay===this._rawDisplay&&!(this._renderDisplay.$renderNode instanceof egret.sys.BitmapNode)){this._renderDisplay.$renderNode=new egret.sys.BitmapNode}}if(this._armatureDisplay._batchEnabled){if(this._renderDisplay!==this._rawDisplay&&this._renderDisplay!==this._meshDisplay){this._armatureDisplay.disableBatch()}else{var e=this._renderDisplay.$renderNode;if(!e.matrix){e.matrix=new egret.Matrix}}}};i.prototype._addDisplay=function(){if(this._armatureDisplay._batchEnabled){this._armatureDisplay.$renderNode.addNode(this._renderDisplay.$renderNode)}else{this._armatureDisplay.addChild(this._renderDisplay)}};i.prototype._replaceDisplay=function(t){var e=t;if(this._armatureDisplay._batchEnabled){var i=this._armatureDisplay.$renderNode.drawData;i[i.indexOf(e.$renderNode)]=this._renderDisplay.$renderNode}else{this._armatureDisplay.addChild(this._renderDisplay);this._armatureDisplay.swapChildren(this._renderDisplay,e);this._armatureDisplay.removeChild(e)}};i.prototype._removeDisplay=function(){if(this._armatureDisplay._batchEnabled){var t=this._armatureDisplay.$renderNode.drawData;t.splice(t.indexOf(this._renderDisplay.$renderNode),1)}else{this._renderDisplay.parent.removeChild(this._renderDisplay)}};i.prototype._updateZOrder=function(){if(this._armatureDisplay._batchEnabled){var t=this._armatureDisplay.$renderNode.drawData;t[this._zOrder]=this._renderDisplay.$renderNode}else{var e=this._armatureDisplay.getChildIndex(this._renderDisplay);if(e===this._zOrder){return}this._armatureDisplay.addChildAt(this._renderDisplay,this._zOrder)}};i.prototype._updateVisible=function(){var t=this._parent.visible&&this._visible;if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.alpha=t?1:0}else{this._renderDisplay.visible=t}};i.prototype._updateBlendMode=function(){switch(this._blendMode){case 0:this._renderDisplay.blendMode=egret.BlendMode.NORMAL;break;case 1:this._renderDisplay.blendMode=egret.BlendMode.ADD;break;case 5:this._renderDisplay.blendMode=egret.BlendMode.ERASE;break;default:break}if(this._armatureDisplay._batchEnabled){var t=this._renderDisplay.$renderNode;t.blendMode=egret.sys.blendModeToNumber(this._renderDisplay.blendMode)}};i.prototype._updateColor=function(){if(this._colorTransform.redMultiplier!==1||this._colorTransform.greenMultiplier!==1||this._colorTransform.blueMultiplier!==1||this._colorTransform.redOffset!==0||this._colorTransform.greenOffset!==0||this._colorTransform.blueOffset!==0||this._colorTransform.alphaOffset!==0){if(this._colorFilter===null){this._colorFilter=new egret.ColorMatrixFilter}var t=this._colorFilter.matrix;t[0]=this._colorTransform.redMultiplier;t[6]=this._colorTransform.greenMultiplier;t[12]=this._colorTransform.blueMultiplier;t[18]=this._colorTransform.alphaMultiplier;t[4]=this._colorTransform.redOffset;t[9]=this._colorTransform.greenOffset;t[14]=this._colorTransform.blueOffset;t[19]=this._colorTransform.alphaOffset;this._colorFilter.matrix=t;if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.filter=this._colorFilter;e.alpha=1}var i=this._renderDisplay.filters;if(!i){i=[]}if(i.indexOf(this._colorFilter)<0){i.push(this._colorFilter)}this._renderDisplay.filters=i;this._renderDisplay.$setAlpha(1)}else{if(this._armatureDisplay._batchEnabled){var e=this._renderDisplay.$renderNode;e.filter=null;e.alpha=this._colorTransform.alphaMultiplier}this._renderDisplay.filters=null;this._renderDisplay.$setAlpha(this._colorTransform.alphaMultiplier)}};i.prototype._updateFrame=function(){var e=this._display===this._meshDisplay?this._meshData:null;var i=this._textureData;if(this._displayIndex>=0&&this._display!==null&&i!==null){if(this._armature.replacedTexture!==null&&this._rawDisplayDatas!==null&&this._rawDisplayDatas.indexOf(this._displayData)>=0){var r=i.parent;if(this._armature._replaceTextureAtlasData===null){r=t.BaseObject.borrowObject(t.EgretTextureAtlasData);r.copyFrom(i.parent);r.renderTexture=this._armature.replacedTexture;this._armature._replaceTextureAtlasData=r}else{r=this._armature._replaceTextureAtlasData}i=r.getTexture(i.name)}if(i.renderTexture!==null){if(e!==null){var a=e.parent.parent.parent;var n=a.intArray;var s=a.floatArray;var o=n[e.offset+0];var l=n[e.offset+1];var h=n[e.offset+2];if(h<0){h+=65536}var u=h+o*2;var f=this._renderDisplay;var _=f.$renderNode;_.uvs.length=o*2;_.vertices.length=o*2;_.indices.length=l*3;for(var c=0,p=o*2;c<p;++c){_.vertices[c]=s[h+c];_.uvs[c]=s[u+c]}for(var c=0;c<l*3;++c){_.indices[c]=n[e.offset+4+c]}if(this._armatureDisplay._batchEnabled){var m=i.renderTexture;var d=this._renderDisplay.$renderNode;egret.sys.RenderNode.prototype.cleanBeforeRender.call(d);if(t.EgretFactory._isV5){d.image=m["$bitmapData"]}else{d.image=m._bitmapData}if(t.EgretFactory._isV5){d.image=m["$bitmapData"];d.drawMesh(m.$bitmapX,m.$bitmapY,m.$bitmapWidth,m.$bitmapHeight,m.$offsetX,m.$offsetY,m.textureWidth,m.textureHeight);d.imageWidth=m.$sourceWidth;d.imageHeight=m.$sourceHeight}else{d.image=m._bitmapData;d.drawMesh(m._bitmapX,m._bitmapY,m._bitmapWidth,m._bitmapHeight,m._offsetX,m._offsetY,m.textureWidth,m.textureHeight);d.imageWidth=m._sourceWidth;d.imageHeight=m._sourceHeight}this._blendModeDirty=true;this._colorDirty=true}f.texture=i.renderTexture;f.$setAnchorOffsetX(this._pivotX);f.$setAnchorOffsetY(this._pivotY);f.$updateVertices();if(!t.EgretFactory._isV5){f.$invalidateTransform()}}else{var y=i.parent.scale*this._armature._armatureData.scale;var g=(i.rotated?i.region.height:i.region.width)*y;var v=(i.rotated?i.region.width:i.region.height)*y;var b=this._renderDisplay;var m=i.renderTexture;b.texture=m;if(this._armatureDisplay._batchEnabled){var d=this._renderDisplay.$renderNode;egret.sys.RenderNode.prototype.cleanBeforeRender.call(d);if(t.EgretFactory._isV5){d.image=m["$bitmapData"];d.drawImage(m.$bitmapX,m.$bitmapY,m.$bitmapWidth,m.$bitmapHeight,m.$offsetX,m.$offsetY,g,v);d.imageWidth=m.$sourceWidth;d.imageHeight=m.$sourceHeight}else{d.image=m._bitmapData;d.drawImage(m._bitmapX,m._bitmapY,m._bitmapWidth,m._bitmapHeight,m._offsetX,m._offsetY,g,v);d.imageWidth=m._sourceWidth;d.imageHeight=m._sourceHeight}this._blendModeDirty=true;this._colorDirty=true}else{b.width=g;b.height=v}b.$setAnchorOffsetX(this._pivotX);b.$setAnchorOffsetY(this._pivotY)}this._visibleDirty=true;return}}if(this._armatureDisplay._batchEnabled){this._renderDisplay.$renderNode.image=null}var T=this._renderDisplay;T.$setBitmapData(null);T.x=0;T.y=0;T.visible=false};i.prototype._updateMesh=function(){var e=this._ffdVertices.length>0;var i=this._armature._armatureData.scale;var r=this._meshData;var a=r.weight;var n=this._renderDisplay;var s=n.$renderNode;if(a!==null){var o=r.parent.parent.parent;var l=o.intArray;var h=o.floatArray;var u=l[r.offset+0];var f=l[a.offset+1];if(f<0){f+=65536}for(var _=0,c=0,p=a.offset+2+a.bones.length,m=f,d=0;_<u;++_){var y=l[p++];var g=0,v=0;for(var b=0;b<y;++b){var T=l[p++];var D=this._meshBones[T];if(D!==null){var A=D.globalTransformMatrix;var x=h[m++];var O=h[m++]*i;var S=h[m++]*i;if(e){O+=this._ffdVertices[d++];S+=this._ffdVertices[d++]}g+=(A.a*O+A.c*S+A.tx)*x;v+=(A.b*O+A.d*S+A.ty)*x}}s.vertices[c++]=g;s.vertices[c++]=v}n.$updateVertices();if(!t.EgretFactory._isV5){n.$invalidateTransform()}}else if(e){var o=r.parent.parent.parent;var l=o.intArray;var h=o.floatArray;var u=l[r.offset+0];var E=l[r.offset+2];if(E<0){E+=65536}for(var _=0,B=u*2;_<B;++_){s.vertices[_]=h[E+_]*i+this._ffdVertices[_]}n.$updateVertices();if(!t.EgretFactory._isV5){n.$invalidateTransform()}}if(this._armatureDisplay._batchEnabled){this._armatureDisplay._childDirty=true}};i.prototype._updateTransform=function(t){t;throw new Error};i.prototype._updateTransformV4=function(t){if(t){if(this._armatureDisplay._batchEnabled){this._armatureDisplay._childDirty=true;var e=this._renderDisplay.$renderNode.matrix;e.a=1;e.b=0;e.c=0;e.d=1;e.tx=0;e.ty=0}else{egret.$TempMatrix.identity();this._renderDisplay.$setMatrix(egret.$TempMatrix,this.transformUpdateEnabled)}}else{var i=this.globalTransformMatrix;if(this._armatureDisplay._batchEnabled){this._armatureDisplay._childDirty=true;var e=this._renderDisplay.$renderNode.matrix;e.a=i.a;e.b=i.b;e.c=i.c;e.d=i.d;e.tx=this.globalTransformMatrix.tx-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY);e.ty=this.globalTransformMatrix.ty-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY)}else if(this.transformUpdateEnabled){this._renderDisplay.$setMatrix(i,true)}else{var r=this._renderDisplay.$DisplayObject;var e=r[6];e.a=this.globalTransformMatrix.a;e.b=this.globalTransformMatrix.b;e.c=this.globalTransformMatrix.c;e.d=this.globalTransformMatrix.d;e.tx=this.globalTransformMatrix.tx;e.ty=this.globalTransformMatrix.ty;this._renderDisplay.$removeFlags(8);this._renderDisplay.$invalidatePosition()}}};i.prototype._updateTransformV5=function(t){if(t){egret.$TempMatrix.identity();this._renderDisplay.$setMatrix(egret.$TempMatrix,this.transformUpdateEnabled)}else{var e=this.globalTransformMatrix;if(this._armatureDisplay._batchEnabled){this._armatureDisplay._childDirty=true;var i=this._renderDisplay.$renderNode.matrix;i.a=e.a;i.b=e.b;i.c=e.c;i.d=e.d;i.tx=this.globalTransformMatrix.tx-(this.globalTransformMatrix.a*this._pivotX+this.globalTransformMatrix.c*this._pivotY);i.ty=this.globalTransformMatrix.ty-(this.globalTransformMatrix.b*this._pivotX+this.globalTransformMatrix.d*this._pivotY)}else{this._renderDisplay.$setMatrix(e,this.transformUpdateEnabled)}}};return i}(t.Slot);t.EgretSlot=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(i,e);function i(r){if(r===void 0){r=null}var a=e.call(this,r)||this;if(i._dragonBonesInstance===null){i._isV5=Number(egret.Capabilities.engineVersion.substr(0,3))>=5.1;var n=new t.EgretArmatureDisplay;i._dragonBonesInstance=new t.DragonBones(n);i._dragonBonesInstance.clock.time=egret.getTimer()*.001;egret.startTick(i._clockHandler,i)}a._dragonBones=i._dragonBonesInstance;return a}i._clockHandler=function(t){t*=.001;var e=i._dragonBonesInstance.clock;var r=t-e.time;i._dragonBonesInstance.advanceTime(r);e.time=t;return false};Object.defineProperty(i,"factory",{get:function(){if(i._factory===null){i._factory=new i}return i._factory},enumerable:true,configurable:true});i.prototype._isSupportMesh=function(){if(egret.Capabilities.renderMode==="webgl"||egret.Capabilities.runtimeType===egret.RuntimeType.NATIVE){return true}console.warn("Canvas can not support mesh, please change renderMode to webgl.");return false};i.prototype._buildTextureAtlasData=function(e,i){if(e!==null){if(i instanceof egret.Texture){e.renderTexture=i}else{var r=new egret.Texture;r.bitmapData=new egret.BitmapData(i);e.disposeEnabled=true;e.renderTexture=r}}else{e=t.BaseObject.borrowObject(t.EgretTextureAtlasData)}return e};i.prototype._buildArmature=function(e){var i=t.BaseObject.borrowObject(t.Armature);var r=new t.EgretArmatureDisplay;i.init(e.armature,r,r,this._dragonBones);return i};i.prototype._buildSlot=function(e,i,r,a){e;a;var n=t.BaseObject.borrowObject(t.EgretSlot);n.init(i,r,new egret.Bitmap,new egret.Mesh);return n};i.prototype.buildArmatureDisplay=function(t,e,i,r){if(e===void 0){e=""}if(i===void 0){i=""}if(r===void 0){r=""}var a=this.buildArmature(t,e||"",i||"",r||"");if(a!==null){this._dragonBones.clock.add(a);return a.display}return null};i.prototype.getTextureDisplay=function(t,e){if(e===void 0){e=null}var i=this._getTextureData(e!==null?e:"",t);if(i!==null&&i.renderTexture!==null){var r=i.renderTexture;var a=new egret.Bitmap(r);a.width=r.textureWidth*i.parent.scale;a.height=r.textureHeight*i.parent.scale;return a}return null};Object.defineProperty(i.prototype,"soundEventManager",{get:function(){return this._dragonBones.eventManager},enumerable:true,configurable:true});Object.defineProperty(i,"clock",{get:function(){return i.factory.clock},enumerable:true,configurable:true});i.prototype.addSkeletonData=function(t,e){if(e===void 0){e=null}console.warn("已废弃");this.addDragonBonesData(t,e)};i.prototype.getSkeletonData=function(t){console.warn("已废弃");return this.getDragonBonesData(t)};i.prototype.removeSkeletonData=function(t){console.warn("已废弃");this.removeDragonBonesData(t)};i.prototype.addTextureAtlas=function(t,e){if(e===void 0){e=null}console.warn("已废弃");this.addTextureAtlasData(t,e)};i.prototype.getTextureAtlas=function(t){console.warn("已废弃");return this.getTextureAtlasData(t)};i.prototype.removeTextureAtlas=function(t){console.warn("已废弃");this.removeTextureAtlasData(t)};i.prototype.buildFastArmature=function(t,e,i){if(e===void 0){e=""}if(i===void 0){i=""}console.warn("已废弃");return this.buildArmature(t,e||"",i||"")};i.prototype.dispose=function(){console.warn("已废弃");this.clear()};i._isV5=false;i._dragonBonesInstance=null;i._factory=null;return i}(t.BaseFactory);t.EgretFactory=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=new egret.Rectangle;var i=new egret.Matrix;var r={};function a(t,e){for(var i=0,r=t.length;i<r;++i){var a=t[i];if(a.name===e){return a}}return null}function n(t){if(t.groupName){var e=r[t.groupName];if(e){var i=a(e.movie||e.animation,t.movieName);if(i){t.groupConfig=e;t.movieConfig=i;return true}}}if(!t.groupName){for(var n in r){var e=r[n];if(!t.groupName){var i=a(e.movie||e.animation,t.movieName);if(i){t.groupName=n;t.groupConfig=e;t.movieConfig=i;return true}}}}return false}function s(t){return t in r}t.hasMovieGroup=s;function o(t,e,i){if(i===void 0){i=null}if(t){var a=new egret.ByteArray(t);a.endian=egret.Endian.LITTLE_ENDIAN;a.position=8;var n=JSON.parse(a.readUTF());n.offset=a.position;n.arrayBuffer=t;n.textures=[];var s=n.offset%4;if(s){n.offset+=4-s}for(var o=0,l=n.position.length;o<l;o+=3){switch(o/3){case 1:n.displayFrameArray=new Int16Array(n.arrayBuffer,n.offset+n.position[o],n.position[o+1]/n.position[o+2]);break;case 2:n.rectangleArray=new Float32Array(n.arrayBuffer,n.offset+n.position[o],n.position[o+1]/n.position[o+2]);break;case 3:n.transformArray=new Float32Array(n.arrayBuffer,n.offset+n.position[o],n.position[o+1]/n.position[o+2]);break;case 4:n.colorArray=new Int16Array(n.arrayBuffer,n.offset+n.position[o],n.position[o+1]/n.position[o+2]);break}}i=i||n.name;if(r[i]){console.warn("Replace group: "+i)}r[i]=n;if(e instanceof Array){for(var o=0,l=e.length;o<l;++o){var h=e[o];n.textures.push(h)}}else{n.textures.push(e)}}else{throw new Error}}t.addMovieGroup=o;function l(t){var e=r[t];if(e){delete r[t]}}t.removeMovieGroup=l;function h(){for(var t in r){delete r[t]}}t.removeAllMovieGroup=h;function u(e,i){if(i===void 0){i=null}var r={movieName:e,groupName:i};if(n(r)){var a=new p(r);a.clock=t.EgretFactory.factory.clock;return a}else{console.warn("No movie named: "+e)}return null}t.buildMovie=u;function f(t){var e=r[t];if(e){var i=[];var a=e.movie||e.animation;for(var n=0,s=a.length;n<s;++n){i.push(a[n].name)}return i}else{console.warn("No group named: "+t)}return null}t.getMovieNames=f;var _=function(t){__extends(e,t);function e(e){var i=t.call(this,e)||this;i.name="";i.slotName="";i.clipName="";return i}Object.defineProperty(e.prototype,"armature",{get:function(){return this.movie},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"bone",{get:function(){return null},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"animationState",{get:function(){return{name:this.clipName}},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"frameLabel",{get:function(){return this.name},enumerable:true,configurable:true});Object.defineProperty(e.prototype,"movementID",{get:function(){return this.clipName},enumerable:true,configurable:true});e.START="start";e.LOOP_COMPLETE="loopComplete";e.COMPLETE="complete";e.FRAME_EVENT="frameEvent";e.SOUND_EVENT="soundEvent";return e}(egret.Event);t.MovieEvent=_;var c=function(t){__extends(e,t);function e(e){var i=t.call(this)||this;i.displayIndex=-1;i.colorIndex=-1;i.transformIndex=-1;i.rawDisplay=new egret.Bitmap;i.childMovies={};i.displayConfig=null;i.childMovie=null;i.colorFilter=null;i.display=i.rawDisplay;i.config=e;i.rawDisplay.name=i.config.name;if(!i.config.blendMode){i.config.blendMode=0}return i}e.prototype.dispose=function(){this.rawDisplay=null;this.childMovies=null;this.config=null;this.displayConfig=null;this.display=null;this.childMovie=null;this.colorFilter=null};return e}(egret.HashObject);var p=function(r){__extends(a,r);function a(t){var e=r.call(this)||this;e.timeScale=1;e.clipTimeScale=1;e._batchEnabled=true;e._isLockDispose=false;e._isDelayDispose=false;e._isStarted=false;e._isPlaying=false;e._isReversing=false;e._isCompleted=false;e._playTimes=0;e._time=0;e._currentTime=0;e._currentPlayTimes=0;e._cacheFrameIndex=0;e._frameSize=0;e._cacheRectangle=null;e._clock=null;e._currentFrameConfig=null;e._clipNames=[];e._slots=[];e._childMovies=[];e._groupConfig=t.groupConfig;e._config=t.movieConfig;e._batchEnabled=!(e._config.isNested||e._config.hasChildAnimation);if(e._batchEnabled){e.$renderNode=new egret.sys.GroupNode;e.$renderNode.cleanBeforeRender=a._cleanBeforeRender}e._clipNames.length=0;for(var i=0,n=e._config.clip.length;i<n;++i){e._clipNames.push(e._config.clip[i].name)}for(var i=0,n=e._config.slot.length;i<n;++i){var s=new c(e._config.slot[i]);e._updateSlotBlendMode(s);e._slots.push(s);if(e._batchEnabled){e.$renderNode.addNode(s.rawDisplay.$renderNode)}else{e.addChild(s.rawDisplay)}}e._frameSize=(1+1)*e._slots.length;e.name=e._config.name;e.play();e.advanceTime(1e-6);e.stop();return e}a._cleanBeforeRender=function(){};a.prototype._configToEvent=function(t,e){e.movie=this;e.clipName=this._clipConfig.name;e.name=t.name;e.slotName=t.slot||""};a.prototype._onCrossFrame=function(e){for(var i=0,r=e.actionAndEvent.length;i<r;++i){var a=e.actionAndEvent[i];if(a){switch(a.type){case 11:if(t.EgretFactory.factory.soundEventManager.hasEventListener(_.SOUND_EVENT)){var n=egret.Event.create(_,_.SOUND_EVENT);this._configToEvent(a,n);t.EgretFactory.factory.soundEventManager.dispatchEvent(n);egret.Event.release(n)}break;case 10:if(this.hasEventListener(_.FRAME_EVENT)){var s=egret.Event.create(_,_.FRAME_EVENT);this._configToEvent(a,s);this.dispatchEvent(s);egret.Event.release(s)}break;case 0:if(a.slot){var o=this._getSlot(a.slot);if(o&&o.childMovie){o.childMovie.play(a.name)}}else{this.play(a.name)}break}}}};a.prototype._updateSlotBlendMode=function(t){var e="";switch(t.config.blendMode){case 0:e=egret.BlendMode.NORMAL;break;case 1:e=egret.BlendMode.ADD;break;case 5:e=egret.BlendMode.ERASE;break;default:break}if(e){if(this._batchEnabled){t.display.$renderNode.blendMode=egret.sys.blendModeToNumber(e)}else{t.display.blendMode=e}}};a.prototype._updateSlotColor=function(t,e,i,r,a,n,s,o,l){if(i!==1||r!==1||a!==1||s!==0||o!==0||l!==0||n!==0){if(!t.colorFilter){t.colorFilter=new egret.ColorMatrixFilter}var h=t.colorFilter.matrix;h[0]=i;h[6]=r;h[12]=a;h[18]=e;h[4]=s;h[9]=o;h[14]=l;h[19]=n;t.colorFilter.matrix=h;if(this._batchEnabled){t.display.$renderNode.filter=t.colorFilter;t.display.$renderNode.alpha=1}else{var u=t.display.filters;if(!u){u=[]}if(u.indexOf(t.colorFilter)<0){u.push(t.colorFilter)}t.display.filters=u;t.display.$setAlpha(1)}}else{if(t.colorFilter){t.colorFilter=null}if(this._batchEnabled){t.display.$renderNode.filter=null;t.display.$renderNode.alpha=e}else{t.display.filters=null;t.display.$setAlpha(e)}}};a.prototype._updateSlotDisplay=function(e){var i=e.display||e.rawDisplay;var r=e.childMovie;if(e.displayIndex>=0){e.displayConfig=this._groupConfig.display[e.displayIndex];if(e.displayConfig.type===1){var a=e.displayConfig.name in e.childMovies?e.childMovies[e.displayConfig.name]:null;if(!a){a=u(e.displayConfig.name,this._groupConfig.name);if(a){e.childMovies[e.displayConfig.name]=a}}if(a){e.display=a;e.childMovie=a}else{e.display=e.rawDisplay;e.childMovie=null}}else{e.display=e.rawDisplay;e.childMovie=null}}else{e.displayConfig=null;e.display=e.rawDisplay;e.childMovie=null}if(e.display!==i){if(i){this.addChild(e.display);this.swapChildren(e.display,i);this.removeChild(i)}this._updateSlotBlendMode(e)}if(e.display===e.rawDisplay){if(e.displayConfig&&e.displayConfig.regionIndex!==null&&e.displayConfig.regionIndex!==undefined){if(!e.displayConfig.texture){var n=this._groupConfig.textures[e.displayConfig.textureIndex||0];var s=e.displayConfig.regionIndex*4;var o=this._groupConfig.rectangleArray[s];var l=this._groupConfig.rectangleArray[s+1];var h=this._groupConfig.rectangleArray[s+2];var f=this._groupConfig.rectangleArray[s+3];e.displayConfig.texture=new egret.Texture;if(t.EgretFactory._isV5){e.displayConfig.texture["$bitmapData"]=n["$bitmapData"]}else{e.displayConfig.texture._bitmapData=n._bitmapData}e.displayConfig.texture.$initData(o,l,Math.min(h,n.textureWidth-o),Math.min(f,n.textureHeight-l),0,0,Math.min(h,n.textureWidth-o),Math.min(f,n.textureHeight-l),n.textureWidth,n.textureHeight)}if(this._batchEnabled){var _=e.displayConfig.texture;var c=e.rawDisplay.$renderNode;egret.sys.RenderNode.prototype.cleanBeforeRender.call(e.rawDisplay.$renderNode);if(t.EgretFactory._isV5){c.image=_["$bitmapData"];c.drawImage(_.$bitmapX,_.$bitmapY,_.$bitmapWidth,_.$bitmapHeight,_.$offsetX,_.$offsetY,_.textureWidth,_.textureHeight);c.imageWidth=_._sourceWidth;c.imageHeight=_._sourceHeight}else{c.image=_._bitmapData;c.drawImage(_._bitmapX,_._bitmapY,_._bitmapWidth,_._bitmapHeight,_._offsetX,_._offsetY,_.textureWidth,_.textureHeight);c.imageWidth=_._sourceWidth;c.imageHeight=_._sourceHeight}}else{e.rawDisplay.visible=true;e.rawDisplay.$setBitmapData(e.displayConfig.texture)}}else{if(this._batchEnabled){e.rawDisplay.$renderNode.image=null}else{e.rawDisplay.visible=false;e.rawDisplay.$setBitmapData(null)}}}if(e.childMovie!==r){if(r){r.stop();this._childMovies.slice(this._childMovies.indexOf(r),1)}if(e.childMovie){if(this._childMovies.indexOf(e.childMovie)<0){this._childMovies.push(e.childMovie)}if(e.config.action){e.childMovie.play(e.config.action)}else{e.childMovie.play(e.childMovie._config.action)}}}};a.prototype._getSlot=function(t){for(var e=0,i=this._slots.length;e<i;++e){var r=this._slots[e];if(r.config.name===t){return r}}return null};a.prototype.$render=function(){if(this._batchEnabled){}else{r.prototype.$render.call(this)}};a.prototype.$measureContentBounds=function(t){if(this._batchEnabled&&this._cacheRectangle){t.setTo(this._cacheRectangle.x,this._cacheRectangle.y,this._cacheRectangle.width-this._cacheRectangle.x,this._cacheRectangle.height-this._cacheRectangle.y)}else{r.prototype.$measureContentBounds.call(this,t)}};a.prototype.$doAddChild=function(t,e,i){if(this._batchEnabled){console.warn("Can not add child.");return null}return r.prototype.$doAddChild.call(this,t,e,i)};a.prototype.$doRemoveChild=function(t,e){if(this._batchEnabled){console.warn("Can not remove child.");return null}return r.prototype.$doRemoveChild.call(this,t,e)};a.prototype.dispose=function(){if(this._isLockDispose){this._isDelayDispose=true}else{if(this._clock){this._clock.remove(this)}if(this._slots){for(var t=0,e=this._slots.length;t<e;++t){this._slots[t].dispose()}}this._isPlaying=false;this._cacheRectangle=null;this._clock=null;this._groupConfig=null;this._config=null;this._clipConfig=null;this._currentFrameConfig=null;this._clipArray=null;this._clipNames=null;this._slots=null;this._childMovies=null}};a.prototype.advanceTime=function(t){if(this._isPlaying){this._isLockDispose=true;if(t<0){t=-t}t*=this.timeScale;this._time+=t*this.clipTimeScale;var r=this._clipConfig.duration;var a=r*this._playTimes;var n=this._time;var s=this._currentPlayTimes;if(this._playTimes>0&&(n>=a||n<=-a)){this._isCompleted=true;s=this._playTimes;if(n<0){n=0}else{n=r}}else{this._isCompleted=false;if(n<0){s=Math.floor(-n/r);n=r- -n%r}else{s=Math.floor(n/r);n%=r}if(this._playTimes>0&&s>this._playTimes){s=this._playTimes}}if(this._currentTime===n){return}var o=Math.floor(n*this._clipConfig.cacheTimeToFrameScale);if(this._cacheFrameIndex!==o){this._cacheFrameIndex=o;var l=this._groupConfig.displayFrameArray;var h=this._groupConfig.transformArray;var u=this._groupConfig.colorArray;var f=true;var c=false;var p=false;var m=this._cacheRectangle;this._cacheRectangle=this._clipConfig.cacheRectangles[this._cacheFrameIndex];if(this._batchEnabled&&!this._cacheRectangle){p=true;this._cacheRectangle=new egret.Rectangle;this._clipConfig.cacheRectangles[this._cacheFrameIndex]=this._cacheRectangle}for(var d=0,y=this._slots.length;d<y;++d){var g=this._slots[d];var v=this._frameSize*this._cacheFrameIndex+d*2;if(v>=this._clipArray.length){v=this._frameSize*(this._cacheFrameIndex-1)+d*2}var b=this._clipArray[v]*2;if(b>=0){var T=l[b];var D=l[b+1]*8;var A=this._clipArray[v+1]*6;var x=false;if(g.displayIndex!==T){g.displayIndex=T;x=true;this._updateSlotDisplay(g)}if(g.colorIndex!==D||x){g.colorIndex=D;if(g.colorIndex>=0){this._updateSlotColor(g,u[D]*.01,u[D+1]*.01,u[D+2]*.01,u[D+3]*.01,u[D+4],u[D+5],u[D+6],u[D+7])}else{this._updateSlotColor(g,1,1,1,1,0,0,0,0)}}c=true;if(g.transformIndex!==A){g.transformIndex=A;if(this._batchEnabled){var O=g.display.$renderNode.matrix;if(!O){O=g.display.$renderNode.matrix=new egret.Matrix}O.a=h[A];O.b=h[A+1];O.c=h[A+2];O.d=h[A+3];O.tx=h[A+4];O.ty=h[A+5]}else{i.a=h[A];i.b=h[A+1];i.c=h[A+2];i.d=h[A+3];i.tx=h[A+4];i.ty=h[A+5];g.display.$setMatrix(i)}}if(this._batchEnabled&&p&&g.displayConfig){var O=g.display.$renderNode.matrix;e.x=0;e.y=0;e.width=g.displayConfig.texture.textureWidth;e.height=g.displayConfig.texture.textureHeight;O.$transformBounds(e);if(f){f=false;this._cacheRectangle.x=e.x;this._cacheRectangle.width=e.x+e.width;this._cacheRectangle.y=e.y;this._cacheRectangle.height=e.y+e.height}else{this._cacheRectangle.x=Math.min(this._cacheRectangle.x,e.x);this._cacheRectangle.width=Math.max(this._cacheRectangle.width,e.x+e.width);this._cacheRectangle.y=Math.min(this._cacheRectangle.y,e.y);this._cacheRectangle.height=Math.max(this._cacheRectangle.height,e.y+e.height)}}}else if(g.displayIndex!==-1){g.displayIndex=-1;this._updateSlotDisplay(g)}}if(this._cacheRectangle){if(c&&p&&f&&m){this._cacheRectangle.x=m.x;this._cacheRectangle.y=m.y;this._cacheRectangle.width=m.width;this._cacheRectangle.height=m.height}this.$invalidateContentBounds()}}if(this._isCompleted){this._isPlaying=false}if(!this._isStarted){this._isStarted=true;if(this.hasEventListener(_.START)){var S=egret.Event.create(_,_.START);S.movie=this;S.clipName=this._clipConfig.name;S.name="";S.slotName="";this.dispatchEvent(S)}}this._isReversing=this._currentTime>n&&this._currentPlayTimes===s;this._currentTime=n;var E=this._clipConfig.frame?this._clipConfig.frame.length:0;if(E>0){var B=Math.floor(this._currentTime*this._config.frameRate);var M=this._groupConfig.frame[this._clipConfig.frame[B]];if(this._currentFrameConfig!==M){if(E>1){var w=this._currentFrameConfig;this._currentFrameConfig=M;if(!w){var P=Math.floor(this._currentTime*this._config.frameRate);w=this._groupConfig.frame[this._clipConfig.frame[P]];if(this._isReversing){}else{if(this._currentTime<=w.position||this._currentPlayTimes!==s){w=this._groupConfig.frame[w.prev]}}}if(this._isReversing){while(w!==M){this._onCrossFrame(w);w=this._groupConfig.frame[w.prev]}}else{while(w!==M){w=this._groupConfig.frame[w.next];this._onCrossFrame(w)}}}else{this._currentFrameConfig=M;if(this._currentFrameConfig){this._onCrossFrame(this._currentFrameConfig)}}}}if(this._currentPlayTimes!==s){this._currentPlayTimes=s;if(this.hasEventListener(_.LOOP_COMPLETE)){var C=egret.Event.create(_,_.LOOP_COMPLETE);C.movie=this;C.clipName=this._clipConfig.name;C.name="";C.slotName="";this.dispatchEvent(C);egret.Event.release(C)}if(this._isCompleted&&this.hasEventListener(_.COMPLETE)){var I=egret.Event.create(_,_.COMPLETE);I.movie=this;I.clipName=this._clipConfig.name;I.name="";I.slotName="";this.dispatchEvent(I);egret.Event.release(I)}}}this._isLockDispose=false;if(this._isDelayDispose){this.dispose()}};a.prototype.play=function(t,e){if(t===void 0){t=null}if(e===void 0){e=-1}if(t){var i=null;for(var r=0,a=this._config.clip.length;r<a;++r){var n=this._config.clip[r];if(n.name===t){i=n}}if(i){this._clipConfig=i;this._clipArray=new Int16Array(this._groupConfig.arrayBuffer,this._groupConfig.offset+this._groupConfig.position[0]+this._clipConfig.p,this._clipConfig.s/this._groupConfig.position[2]);if(!this._clipConfig.cacheRectangles){this._clipConfig.cacheRectangles=[]}this._isPlaying=true;this._isStarted=false;this._isCompleted=false;if(e<0||e!==e){this._playTimes=this._clipConfig.playTimes}else{this._playTimes=e}this._time=0;this._currentTime=0;this._currentPlayTimes=0;this._cacheFrameIndex=-1;this._currentFrameConfig=null;this._cacheRectangle=null;this.clipTimeScale=1/this._clipConfig.scale}else{console.warn("No clip in movie.",this._config.name,t)}}else if(this._clipConfig){if(this._isPlaying||this._isCompleted){this.play(this._clipConfig.name,this._playTimes)}else{this._isPlaying=true}}else if(this._config.action){this.play(this._config.action,e)}};a.prototype.stop=function(){this._isPlaying=false};a.prototype.gotoAndPlay=function(t,e,i){if(t===void 0){t=null}if(i===void 0){i=-1}e%=this._clipConfig.duration;if(e<0){e+=this._clipConfig.duration}this.play(t,i);this._time=e;this._currentTime=e};a.prototype.gotoAndStop=function(t,e){if(t===void 0){t=null}e%=this._clipConfig.duration;if(e<0){e+=this._clipConfig.duration}this.play(t,1);this._time=e;this._currentTime=e;this.advanceTime(.001);this.stop()};a.prototype.hasClip=function(t){for(var e=0,i=this._config.clip.length;e<i;++e){var r=this._config.clip[e];if(r.name===t){return true}}return false};Object.defineProperty(a.prototype,"isPlaying",{get:function(){return this._isPlaying&&!this._isCompleted},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"isComplete",{get:function(){return this._isCompleted},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"currentTime",{get:function(){return this._currentTime},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"totalTime",{get:function(){return this._clipConfig?this._clipConfig.duration:0},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"currentPlayTimes",{get:function(){return this._currentPlayTimes},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"playTimes",{get:function(){return this._playTimes},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"groupName",{get:function(){return this._groupConfig.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"clipName",{get:function(){return this._clipConfig?this._clipConfig.name:""},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"clipNames",{get:function(){return this._clipNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"clock",{get:function(){return this._clock},set:function(t){if(this._clock===t){return}var e=this._clock;if(e){e.remove(this)}this._clock=t;if(this._clock){this._clock.add(this)}},enumerable:true,configurable:true});a.prototype.advanceTimeBySelf=function(e){if(e){this.clock=t.EgretFactory.clock}else{this.clock=null}};Object.defineProperty(a.prototype,"display",{get:function(){return this},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animation",{get:function(){return this},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"armature",{get:function(){return this},enumerable:true,configurable:true});a.prototype.getAnimation=function(){return this};a.prototype.getArmature=function(){return this};a.prototype.getDisplay=function(){return this};a.prototype.hasAnimation=function(t){return this.hasClip(t)};a.prototype.invalidUpdate=function(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}t};Object.defineProperty(a.prototype,"lastAnimationName",{get:function(){return this.clipName},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationNames",{get:function(){return this.clipNames},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animationList",{get:function(){return this.clipNames},enumerable:true,configurable:true});return a}(egret.DisplayObjectContainer);t.Movie=p})(dragonBones||(dragonBones={}));