UNPKG

pixi-dragonbones

Version:
1 lines 231 kB
"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 a in e)if(e.hasOwnProperty(a))t[a]=e[a]};return function(e,a){t(e,a);function r(){this.constructor=e}e.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();var dragonBones;(function(t){var e=function(){function e(a){this._clock=new t.WorldClock;this._events=[];this._objects=[];this._eventManager=null;this._eventManager=a;console.info("DragonBones: "+e.VERSION+"\nWebsite: http://dragonbones.com/\nSource and Demo: https://github.com/DragonBones/")}e.prototype.advanceTime=function(e){if(this._objects.length>0){for(var a=0,r=this._objects;a<r.length;a++){var i=r[a];i.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.7.000";e.yDown=true;e.debug=false;e.debugDraw=false;return e}();t.DragonBones=e})(dragonBones||(dragonBones={}));if(!console.warn){console.warn=function(){}}if(!console.assert){console.assert=function(){}}if(!Date.now){Date.now=function t(){return(new Date).getTime()}}var __extends=function(t,e){function a(){this.constructor=t}for(var r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}a.prototype=e.prototype,t.prototype=new a};if(typeof global==="undefined"&&typeof window!=="undefined"){var global=window}if(typeof exports==="object"&&typeof module==="object"){module.exports=dragonBones}else if(typeof define==="function"&&define["amd"]){define(["dragonBones"],function(){return dragonBones})}else if(typeof exports==="object"){exports=dragonBones}else if(typeof global!=="undefined"){global.dragonBones=dragonBones}var dragonBones;(function(t){var e=function(){function t(){this.hashCode=t._hashCode++;this._isInPool=false}t._returnObject=function(e){var a=String(e.constructor);var r=a in t._maxCountMap?t._maxCountMap[a]:t._defaultMaxCount;var i=t._poolsMap[a]=t._poolsMap[a]||[];if(i.length<r){if(!e._isInPool){e._isInPool=true;i.push(e)}else{console.warn("The object is already in the pool.")}}else{}};t.toString=function(){throw new Error};t.setMaxCount=function(e,a){if(a<0||a!==a){a=0}if(e!==null){var r=String(e);var i=r in t._poolsMap?t._poolsMap[r]:null;if(i!==null&&i.length>a){i.length=a}t._maxCountMap[r]=a}else{t._defaultMaxCount=a;for(var r in t._poolsMap){var i=t._poolsMap[r];if(i.length>a){i.length=a}if(r in t._maxCountMap){t._maxCountMap[r]=a}}}};t.clearPool=function(e){if(e===void 0){e=null}if(e!==null){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){r.length=0}}else{for(var i in t._poolsMap){var r=t._poolsMap[i];r.length=0}}};t.borrowObject=function(e){var a=String(e);var r=a in t._poolsMap?t._poolsMap[a]:null;if(r!==null&&r.length>0){var i=r.pop();i._isInPool=false;return i}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,a,r,i,n){if(t===void 0){t=1}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=1}if(i===void 0){i=0}if(n===void 0){n=0}this.a=t;this.b=e;this.c=a;this.d=r;this.tx=i;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 a=0;var r=0;var i=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;a+=this.b*t.d;r+=this.c*t.a;i+=this.c*t.b}if(t.b!==0||t.c!==0){a+=this.a*t.b;r+=this.d*t.c;n+=this.ty*t.c;s+=this.tx*t.b}this.a=e;this.b=a;this.c=r;this.d=i;this.tx=n;this.ty=s;return this};t.prototype.invert=function(){var t=this.a;var e=this.b;var a=this.c;var r=this.d;var i=this.tx;var n=this.ty;if(e===0&&a===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*i;this.ty=-r*n}return this}var s=t*r-e*a;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;a=this.c=-a*s;r=this.d=t*s;this.tx=-(o*i+a*n);this.ty=-(e*i+r*n);return this};t.prototype.transformPoint=function(t,e,a,r){if(r===void 0){r=false}a.x=this.a*t+this.c*e;a.y=this.b*t+this.d*e;if(!r){a.x+=this.tx;a.y+=this.ty}};t.prototype.transformRectangle=function(t,e){if(e===void 0){e=false}var a=this.a;var r=this.b;var i=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 _=a*l+i*h+s;var m=r*l+n*h+o;var p=a*u+i*h+s;var c=r*u+n*h+o;var d=a*u+i*f+s;var y=r*u+n*f+o;var v=a*l+i*f+s;var g=r*l+n*f+o;var D=0;if(_>p){D=_;_=p;p=D}if(d>v){D=d;d=v;v=D}t.x=Math.floor(_<d?_:d);t.width=Math.ceil((p>v?p:v)-t.x);if(m>c){D=m;m=c;c=D}if(y>g){D=y;y=g;g=D}t.y=Math.floor(m<y?m:y);t.height=Math.ceil((c>g?c:g)-t.y)};return t}();t.Matrix=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(){function t(t,e,a,r,i,n){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}if(i===void 0){i=1}if(n===void 0){n=1}this.x=t;this.y=e;this.skew=a;this.rotation=r;this.scaleX=i;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 a=this.scaleX,r=this.scaleY;var i=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>-i&&this.rotation<i?e.a/Math.cos(this.rotation):e.b/Math.sin(this.rotation);this.scaleY=n>-i&&n<i?e.d/Math.cos(n):-e.c/Math.sin(n);if(a>=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.rotation===0){t.a=1;t.b=0}else{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}t.tx=this.x;t.ty=this.y;return this};t.PI=Math.PI;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,a,r,i,n,s,o){if(t===void 0){t=1}if(e===void 0){e=1}if(a===void 0){a=1}if(r===void 0){r=1}if(i===void 0){i=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=a;this.blueMultiplier=r;this.alphaOffset=i;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,a,r){if(t===void 0){t=0}if(e===void 0){e=0}if(a===void 0){a=0}if(r===void 0){r=0}this.x=t;this.y=e;this.width=a;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 a=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=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.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.colorArray=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};return e}(t.BaseObject);t.DragonBonesData=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.aabb=new t.Rectangle;a.animationNames=[];a.sortedBones=[];a.sortedSlots=[];a.defaultActions=[];a.actions=[];a.bones={};a.slots={};a.constraints={};a.skins={};a.animations={};a.canvas=null;a.userData=null;return a}a.toString=function(){return"[class dragonBones.ArmatureData]"};a.prototype._onClear=function(){for(var t=0,e=this.defaultActions;t<e.length;t++){var a=e[t];a.returnToPool()}for(var r=0,i=this.actions;r<i.length;r++){var a=i[r];a.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};a.prototype.sortBones=function(){var t=this.sortedBones.length;if(t<=0){return}var e=this.sortedBones.concat();var a=0;var r=0;this.sortedBones.length=0;while(r<t){var i=e[a++];if(a>=t){a=0}if(this.sortedBones.indexOf(i)>=0){continue}var n=false;for(var s in this.constraints){var o=this.constraints[s];if(o.root===i&&this.sortedBones.indexOf(o.target)<0){n=true;break}}if(n){continue}if(i.parent!==null&&this.sortedBones.indexOf(i.parent)<0){continue}this.sortedBones.push(i);r++}};a.prototype.cacheFrames=function(t){if(this.cacheFrameRate>0){return}this.cacheFrameRate=t;for(var e in this.animations){this.animations[e].cacheFrames(this.cacheFrameRate)}};a.prototype.setCacheFrame=function(t,e){var a=this.parent.cachedFrames;var r=a.length;a.length+=10;a[r]=t.a;a[r+1]=t.b;a[r+2]=t.c;a[r+3]=t.d;a[r+4]=t.tx;a[r+5]=t.ty;a[r+6]=e.rotation;a[r+7]=e.skew;a[r+8]=e.scaleX;a[r+9]=e.scaleY;return r};a.prototype.getCacheFrame=function(t,e,a){var r=this.parent.cachedFrames;t.a=r[a];t.b=r[a+1];t.c=r[a+2];t.d=r[a+3];t.tx=r[a+4];t.ty=r[a+5];e.rotation=r[a+6];e.skew=r[a+7];e.scaleX=r[a+8];e.scaleY=r[a+9];e.x=t.tx;e.y=t.ty};a.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)};a.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)};a.prototype.addConstraint=function(t){if(t.name in this.constraints){console.warn("Same constraint: "+t.name);return}this.constraints[t.name]=t};a.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}};a.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}};a.prototype.addAction=function(t,e){if(e){this.defaultActions.push(t)}else{this.actions.push(t)}};a.prototype.getBone=function(t){return t in this.bones?this.bones[t]:null};a.prototype.getSlot=function(t){return t in this.slots?this.slots[t]:null};a.prototype.getConstraint=function(t){return t in this.constraints?this.constraints[t]:null};a.prototype.getSkin=function(t){return t in this.skins?this.skins[t]:null};a.prototype.getMesh=function(t,e,a){var r=this.getSkin(t);if(r===null){return null}return r.getDisplay(e,a)};a.prototype.getAnimation=function(t){return t in this.animations?this.animations[t]:null};return a}(t.BaseObject);t.ArmatureData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;a.userData=null;return a}a.toString=function(){return"[class dragonBones.BoneData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.inheritTranslation=false;this.inheritRotation=false;this.inheritScale=false;this.inheritReflection=false;this.type=0;this.length=0;this.alpha=1;this.name="";this.transform.identity();this.userData=null;this.parent=null};return a}(t.BaseObject);t.BoneData=a;var r=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.geometry=new t.GeometryData;return a}a.toString=function(){return"[class dragonBones.SurfaceData]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=1;this.segmentX=0;this.segmentY=0;this.geometry.clear()};return a}(a);t.SurfaceData=r;var i=function(e){__extends(a,e);function a(){var t=e!==null&&e.apply(this,arguments)||this;t.color=null;t.userData=null;return t}a.createColor=function(){return new t.ColorTransform};a.toString=function(){return"[class dragonBones.SlotData]"};a.prototype._onClear=function(){if(this.userData!==null){this.userData.returnToPool()}this.blendMode=0;this.displayIndex=0;this.zOrder=0;this.zIndex=0;this.alpha=1;this.name="";this.color=null;this.userData=null;this.parent=null};a.DEFAULT_COLOR=new t.ColorTransform;return a}(t.BaseObject);t.SlotData=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.order=0;this.name="";this.type=0;this.target=null;this.root=null;this.bone=null};return e}(t.BaseObject);t.ConstraintData=e;var a=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=a;var r=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.PathConstraintData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.pathSlot=null;this.pathDisplayData=null;this.bones.length=0;this.positionMode=0;this.spacingMode=1;this.rotateMode=1;this.position=0;this.spacing=0;this.rotateOffset=0;this.rotateMix=0;this.translateMix=0};e.prototype.AddBone=function(t){this.bones.push(t)};return e}(e);t.PathConstraintData=r})(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 a=0,r=e;a<r.length;a++){var i=r[a];if(i!==null){i.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 a=this.displays[t];a.push(e)};e.prototype.getDisplay=function(t,e){var a=this.getDisplays(t);if(a!==null){for(var r=0,i=a;r<i.length;r++){var n=i[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(){function t(){this.weight=null}t.prototype.clear=function(){if(!this.isShared&&this.weight!==null){this.weight.returnToPool()}this.isShared=false;this.inheritDeform=false;this.offset=0;this.data=null;this.weight=null};t.prototype.shareFrom=function(t){this.isShared=true;this.offset=t.offset;this.weight=t.weight};Object.defineProperty(t.prototype,"vertexCount",{get:function(){var t=this.data.intArray;return t[this.offset+0]},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"triangleCount",{get:function(){var t=this.data.intArray;return t[this.offset+1]},enumerable:true,configurable:true});return t}();t.GeometryData=e;var a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.transform=new t.Transform;return a}a.prototype._onClear=function(){this.name="";this.path="";this.transform.identity();this.parent=null};return a}(t.BaseObject);t.DisplayData=a;var r=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.pivot=new t.Point;return a}a.toString=function(){return"[class dragonBones.ImageDisplayData]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.type=0;this.pivot.clear();this.texture=null};return a}(a);t.ImageDisplayData=r;var i=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,a=this.actions;e<a.length;e++){var r=a[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}(a);t.ArmatureDisplayData=i;var n=function(t){__extends(a,t);function a(){var a=t!==null&&t.apply(this,arguments)||this;a.geometry=new e;return a}a.toString=function(){return"[class dragonBones.MeshDisplayData]"};a.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.geometry.clear();this.texture=null};return a}(a);t.MeshDisplayData=n;var s=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}(a);t.BoundingBoxDisplayData=s;var o=function(t){__extends(a,t);function a(){var a=t!==null&&t.apply(this,arguments)||this;a.geometry=new e;a.curveLengths=[];return a}a.toString=function(){return"[class dragonBones.PathDisplayData]"};a.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=4;this.closed=false;this.constantSpeed=false;this.geometry.clear();this.curveLengths.length=0};return a}(a);t.PathDisplayData=o;var l=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=l})(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 a=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,a,r,i,n){var s=0;if(t<a){s|=1}else if(t>i){s|=2}if(e<r){s|=4}else if(e>n){s|=8}return s};e.rectangleIntersectsSegment=function(t,a,r,i,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&&a>s&&a<l;var m=r>n&&r<o&&i>s&&i<l;if(_&&m){return-1}var p=0;var c=e._computeOutCode(t,a,n,s,o,l);var d=e._computeOutCode(r,i,n,s,o,l);while(true){if((c|d)===0){p=2;break}else if((c&d)!==0){break}var y=0;var v=0;var g=0;var D=c!==0?c:d;if((D&4)!==0){y=t+(r-t)*(s-a)/(i-a);v=s;if(f!==null){g=-Math.PI*.5}}else if((D&8)!==0){y=t+(r-t)*(l-a)/(i-a);v=l;if(f!==null){g=Math.PI*.5}}else if((D&2)!==0){v=a+(i-a)*(o-t)/(r-t);y=o;if(f!==null){g=0}}else if((D&1)!==0){v=a+(i-a)*(n-t)/(r-t);y=n;if(f!==null){g=Math.PI}}if(D===c){t=y;a=v;c=e._computeOutCode(t,a,n,s,o,l);if(f!==null){f.x=g}}else{r=y;i=v;d=e._computeOutCode(r,i,n,s,o,l);if(f!==null){f.y=g}}}if(p){if(_){p=2;if(h!==null){h.x=r;h.y=i}if(u!==null){u.x=r;u.y=r}if(f!==null){f.x=f.y+Math.PI}}else if(m){p=1;if(h!==null){h.x=t;h.y=a}if(u!==null){u.x=t;u.y=a}if(f!==null){f.y=f.x+Math.PI}}else{p=3;if(h!==null){h.x=t;h.y=a}if(u!==null){u.x=r;u.y=i}}}return p};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=0};e.prototype.containsPoint=function(t,e){var a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){return true}}return false};e.prototype.intersectsSegment=function(t,a,r,i,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,a,r,i,-l,-h,l,h,n,s,o);return u};return e}(e);t.RectangleBoundingBoxData=a;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,a,r,i,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 m=a-t;var p=r-e;var c=Math.sqrt(m*m+p*p);var d=m/c;var y=p/c;var v=(i-t)*d+(n-e)*y;var g=v*v;var D=t*t+e*e;var T=s*s;var b=T-D+g;var A=0;if(b>=0){var P=Math.sqrt(b);var S=v-P;var O=v+P;var x=S<0?-1:S<=c?0:1;var B=O<0?-1:O<=c?0:1;var E=x*B;if(E<0){return-1}else if(E===0){if(x===-1){A=2;a=t+O*d;r=(e+O*y)/f;if(l!==null){l.x=a;l.y=r}if(h!==null){h.x=a;h.y=r}if(u!==null){u.x=Math.atan2(r/T*_,a/T);u.y=u.x+Math.PI}}else if(B===1){A=1;t=t+S*d;e=(e+S*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+S*d;l.y=(e+S*y)/f;if(u!==null){u.x=Math.atan2(l.y/T*_,l.x/T)}}if(h!==null){h.x=t+O*d;h.y=(e+O*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 a=this.width*.5;if(t>=-a&&t<=a){var r=this.height*.5;if(e>=-r&&e<=r){e*=a/r;return Math.sqrt(t*t+e*e)<=a}}return false};e.prototype.intersectsSegment=function(t,a,r,i,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,a,r,i,0,0,this.width*.5,this.height*.5,n,s,o);return l};return e}(e);t.EllipseBoundingBoxData=r;var i=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.PolygonBoundingBoxData]"};e.polygonIntersectsSegment=function(t,e,a,r,i,n,s,o){if(n===void 0){n=null}if(s===void 0){s=null}if(o===void 0){o=null}if(t===a){t=a+1e-6}if(e===r){e=r+1e-6}var l=i.length;var h=t-a;var u=e-r;var f=t*r-e*a;var _=0;var m=i[l-2];var p=i[l-1];var c=0;var d=0;var y=0;var v=0;var g=0;var D=0;for(var T=0;T<l;T+=2){var b=i[T];var A=i[T+1];if(m===b){m=b+1e-4}if(p===A){p=A+1e-4}var P=m-b;var S=p-A;var O=m*A-p*b;var x=h*S-u*P;var B=(f*P-h*O)/x;if((B>=m&&B<=b||B>=b&&B<=m)&&(h===0||B>=t&&B<=a||B>=a&&B<=t)){var E=(f*S-u*O)/x;if((E>=p&&E<=A||E>=A&&E<=p)&&(u===0||E>=e&&E<=r||E>=r&&E<=e)){if(s!==null){var M=B-t;if(M<0){M=-M}if(_===0){c=M;d=M;y=B;v=E;g=B;D=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}}else{if(M<c){c=M;y=B;v=E;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5}}if(M>d){d=M;g=B;D=E;if(o!==null){o.y=Math.atan2(A-p,b-m)-Math.PI*.5}}}_++}else{y=B;v=E;g=B;D=E;_++;if(o!==null){o.x=Math.atan2(A-p,b-m)-Math.PI*.5;o.y=o.x}break}}}m=b;p=A}if(_===1){if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=y;s.y=v}if(o!==null){o.y=o.x+Math.PI}}else if(_>1){_++;if(n!==null){n.x=y;n.y=v}if(s!==null){s.x=g;s.y=D}}return _};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.type=2;this.x=0;this.y=0;this.vertices.length=0};e.prototype.containsPoint=function(t,e){var a=false;if(t>=this.x&&t<=this.width&&e>=this.y&&e<=this.height){for(var r=0,i=this.vertices.length,n=i-2;r<i;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){a=!a}}n=r}}return a};e.prototype.intersectsSegment=function(t,r,i,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(a.rectangleIntersectsSegment(t,r,i,n,this.x,this.y,this.x+this.width,this.y+this.height,null,null,null)!==0){h=e.polygonIntersectsSegment(t,r,i,n,this.vertices,s,o,l)}return h};return e}(e);t.PolygonBoundingBoxData=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.cachedFrames=[];e.boneTimelines={};e.slotTimelines={};e.constraintTimelines={};e.animationTimelines={};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,a=this.boneTimelines[t];e<a.length;e++){var r=a[e];r.returnToPool()}delete this.boneTimelines[t]}for(var t in this.slotTimelines){for(var i=0,n=this.slotTimelines[t];i<n.length;i++){var r=n[i];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.animationTimelines){for(var l=0,h=this.animationTimelines[t];l<h.length;l++){var r=h[l];r.returnToPool()}delete this.animationTimelines[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.blendType=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 a=0,r=this.cacheFrames.length;a<r;++a){this.cachedFrames[a]=false}for(var i=0,n=this.parent.sortedBones;i<n.length;i++){var s=n[i];var o=new Array(e);for(var a=0,r=o.length;a<r;++a){o[a]=-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 a=0,r=o.length;a<r;++a){o[a]=-1}this.slotCachedFrameIndices[u.name]=o}};e.prototype.addBoneTimeline=function(t,e){var a=t in this.boneTimelines?this.boneTimelines[t]:this.boneTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};e.prototype.addSlotTimeline=function(t,e){var a=t in this.slotTimelines?this.slotTimelines[t]:this.slotTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};e.prototype.addConstraintTimeline=function(t,e){var a=t in this.constraintTimelines?this.constraintTimelines[t]:this.constraintTimelines[t]=[];if(a.indexOf(e)<0){a.push(e)}};e.prototype.addAnimationTimeline=function(t,e){var a=t in this.animationTimelines?this.animationTimelines[t]:this.animationTimelines[t]=[];if(a.indexOf(e)<0){a.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.getAnimationTimelines=function(t){return t in this.animationTimelines?this.animationTimelines[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 a=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=a;var r=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.toString=function(){return"[class dragonBones.AnimationTimelineData]"};e.prototype._onClear=function(){t.prototype._onClear.call(this);this.x=0;this.y=0};return e}(a);t.AnimationTimelineData=r})(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.additive=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.additive=t.additive;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,a=this.boneMask.length;e<a;++e){this.boneMask[e]=t.boneMask[e]}};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 a=this.createTexture();a.copyFrom(t.textures[e]);this.textures[e]=a}};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 a=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.region=new t.Rectangle;a.frame=null;return a}a.createRectangle=function(){return new t.Rectangle};a.prototype._onClear=function(){this.rotated=false;this.name="";this.region.clear();this.parent=null;this.frame=null};a.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=a.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 a}(t.BaseObject);t.TextureData=a})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){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}a.toString=function(){return"[class dragonBones.Armature]"};a._onSortSlots=function(t,e){return t._zIndex*1e3+t._zOrder>e._zIndex*1e3+e._zOrder?1:-1};a.prototype._onClear=function(){if(this._clock!==null){this._clock.remove(this)}for(var t=0,e=this._bones;t<e.length;t++){var a=e[t];a.returnToPool()}for(var r=0,i=this._slots;r<i.length;r++){var n=i[r];n.returnToPool()}for(var s=0,o=this._constraints;s<o.length;s++){var l=o[s];l.returnToPool()}for(var h=0,u=this._actions;h<u.length;h++){var f=u[h];f.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._slotsDirty=true;this._zOrderDirty=false;this._zIndexDirty=false;this._alphaDirty=true;this._flipX=false;this._flipY=false;this._cacheFrameIndex=-1;this._alpha=1;this._globalAlpha=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};a.prototype._sortZOrder=function(t,e){var a=this._armatureData.sortedSlots;var r=t===null;if(this._zOrderDirty||!r){for(var i=0,n=a.length;i<n;++i){var s=r?i:t[e+i];if(s<0||s>=n){continue}var o=a[s];var l=this.getSlot(o.name);if(l!==null){l._setZOrder(i)}}this._slotsDirty=true;this._zOrderDirty=!r}};a.prototype._addBone=function(t){if(this._bones.indexOf(t)<0){this._bones.push(t)}};a.prototype._addSlot=function(t){if(this._slots.indexOf(t)<0){this._slots.push(t)}};a.prototype._addConstraint=function(t){if(this._constraints.indexOf(t)<0){this._constraints.push(t)}};a.prototype._bufferAction=function(t,e){if(this._actions.indexOf(t)<0){if(e){this._actions.push(t)}else{this._actions.unshift(t)}}};a.prototype.dispose=function(){if(this._armatureData!==null){this._lockUpdate=true;this._dragonBones.bufferObject(this)}};a.prototype.init=function(e,a,r,i){if(this._armatureData!==null){return}this._armatureData=e;this._animation=t.BaseObject.borrowObject(t.Animation);this._proxy=a;this._display=r;this._dragonBones=i;this._proxy.dbInit(this);this._animation.init(this);this._animation.animations=this._armatureData.animations};a.prototype.advanceTime=function(t){if(this._lockUpdate){return}this._lockUpdate=true;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._slotsDirty||this._zIndexDirty){this._slots.sort(a._onSortSlots);if(this._zIndexDirty){for(var r=0,i=this._slots.length;r<i;++r){this._slots[r]._setZOrder(r)}}this._slotsDirty=false;this._zIndexDirty=false}if(this._alphaDirty){this._alphaDirty=false;this._globalAlpha=this._alpha*(this._parent!==null?this._parent._globalAlpha:1);for(var n=0,s=this._bones;n<s.length;n++){var o=s[n];o._updateAlpha()}for(var l=0,h=this._slots;l<h.length;l++){var u=h[l];u._updateAlpha()}}if(this._cacheFrameIndex<0||this._cacheFrameIndex!==e){var r=0,i=0;for(r=0,i=this._bones.length;r<i;++r){this._bones[r].update(this._cacheFrameIndex)}for(r=0,i=this._slots.length;r<i;++r){this._slots[r].update(this._cacheFrameIndex)}}if(this._actions.length>0){for(var f=0,_=this._actions;f<_.length;f++){var m=_[f];var p=m.actionData;if(p!==null){if(p.type===0){if(m.slot!==null){var c=m.slot.childArmature;if(c!==null){c.animation.fadeIn(p.name)}}else if(m.bone!==null){for(var d=0,y=this.getSlots();d<y.length;d++){var u=y[d];if(u.parent===m.bone){var c=u.childArmature;if(c!==null){c.animation.fadeIn(p.name)}}}}else{this._animation.fadeIn(p.name)}}}m.returnToPool()}this._actions.length=0}this._lockUpdate=false;this._proxy.dbUpdate()};a.prototype.invalidUpdate=function(t,e){if(t===void 0){t=null}if(e===void 0){e=false}if(t!==null&&t.length>0){var a=this.getBone(t);if(a!==null){a.invalidUpdate();if(e){for(var r=0,i=this._slots;r<i.length;r++){var n=i[r];if(n.parent===a){n.invalidUpdate()}}}}}else{for(var s=0,o=this._bones;s<o.length;s++){var a=o[s];a.invalidUpdate()}if(e){for(var l=0,h=this._slots;l<h.length;l++){var n=h[l];n.invalidUpdate()}}}};a.prototype.containsPoint=function(t,e){for(var a=0,r=this._slots;a<r.length;a++){var i=r[a];if(i.containsPoint(t,e)){return i}}return null};a.prototype.intersectsSegment=function(t,e,a,r,i,n,s){if(i===void 0){i=null}if(n===void 0){n=null}if(s===void 0){s=null}var o=t===a;var l=0;var h=0;var u=0;var f=0;var _=0;var m=0;var p=0;var c=0;var d=null;var y=null;for(var v=0,g=this._slots;v<g.length;v++){var D=g[v];var T=D.intersectsSegment(t,e,a,r,i,n,s);if(T>0){if(i!==null||n!==null){if(i!==null){var b=o?i.y-e:i.x-t;if(b<0){b=-b}if(d===null||b<l){l=b;u=i.x;f=i.y;d=D;if(s){p=s.x}}}if(n!==null){var b=n.x-t;if(b<0){b=-b}if(y===null||b>h){h=b;_=n.x;m=n.y;y=D;if(s!==null){c=s.y}}}}else{d=D;break}}}if(d!==null&&i!==null){i.x=u;i.y=f;if(s!==null){s.x=p}}if(y!==null&&n!==null){n.x=_;n.y=m;if(s!==null){s.y=c}}return d};a.prototype.getBone=function(t){for(var e=0,a=this._bones;e<a.length;e++){var r=a[e];if(r.name===t){return r}}return null};a.prototype.getBoneByDisplay=function(t){var e=this.getSlotByDisplay(t);return e!==null?e.parent:null};a.prototype.getSlot=function(t){for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];if(r.name===t){return r}}return null};a.prototype.getSlotByDisplay=function(t){if(t!==null){for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];if(r.display===t){return r}}}return null};a.prototype.getBones=function(){return this._bones};a.prototype.getSlots=function(){return this._slots};Object.defineProperty(a.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(a.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(a.prototype,"cacheFrameRate",{get:function(){return this._armatureData.cacheFrameRate},set:function(t){if(this._armatureData.cacheFrameRate!==t){this._armatureData.cacheFrames(t);for(var e=0,a=this._slots;e<a.length;e++){var r=a[e];var i=r.childArmature;if(i!==null){i.cacheFrameRate=t}}}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"name",{get:function(){return this._armatureData.name},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"armatureData",{get:function(){return this._armatureData},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"animation",{get:function(){return this._animation},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"proxy",{get:function(){return this._proxy},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"eventDispatcher",{get:function(){return this._proxy},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"display",{get:function(){return this._display},enumerable:true,configurable:true});Object.defineProperty(a.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,a=this._slots;e<a.length;e++){var r=a[e];r.invalidUpdate();r.update(-1)}},enumerable:true,configurable:true});Object.defineProperty(a.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,a=this._slots;e<a.length;e++){var r=a[e];var i=r.childArmature;if(i!==null){i.clock=this._clock}}},enumerable:true,configurable:true});Object.defineProperty(a.prototype,"parent",{get:function(){return this._parent},enumerable:true,configurable:true});a.prototype.getDisplay=function(){return this._display};return a}(t.BaseObject);t.Armature=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.globalTransformMatrix=new t.Matrix;a.global=new t.Transform;a.offset=new t.Transform;return a}a.prototype._onClear=function(){this.globalTransformMatrix.identity();this.global.identity();this.offset.identity();this.origin=null;this.userData=null;this._globalDirty=false;this._alpha=1;this._globalAlpha=1;this._armature=null};a.prototype.updateGlobalTransform=function(){if(this._globalDirty){this._globalDirty=false;this.global.fromMatrix(this.globalTransformMatrix)}};Object.defineProperty(a.prototype,"armature",{get:function(){return this._armature},enumerable:true,configurable:true});a._helpMatrix=new t.Matrix;a._helpTransform=new t.Transform;a._helpPoint=new t.Point;return a}(t.BaseObject);t.TransformObject=e})(dragonBones||(dragonBones={}));var dragonBones;(function(t){var e=function(e){__extends(a,e);function a(){var a=e!==null&&e.apply(this,arguments)||this;a.animationPose=new t.Transform;return a}a.toString=function(){return"[class dragonBones.Bone]"};a.prototype._onClear=function(){e.prototype._onClear.call(this);this.offsetMode=1;this.animationPose.identity();this._transformDirty=false;this._childrenTransformDirty=false;this._localDirty=true;this._hasConstraint=false;this._visible=true;this._cachedFrameIndex=-1;this._boneData=null;this._parent=null;this._cachedFrameIndices=null};a.prototype._updateGlobalTransformMatrix=function(e){var a=this._boneData;var r=this.global;var i=this.globalTransformMatrix;var n=this.origin;var s=this.offset;var o=this.animationPose;var l=this._parent;var h=this._armature.flipX;var u=this._armature.flipY===t.DragonBones.yDown;var f=l!==null;var _=0;if(this.offsetMode===1){if(n!==null){r.x=n.x+s.x+o.x;r.y=n.y+s.y+o.y;r.skew=n.skew+s.skew+o.skew;r.rotation=n.rotation+s.rotation+o.rotation;r.scaleX=n.scaleX*s.scaleX*o.scaleX;r.scaleY=n.scaleY*s.scaleY*o.scaleY}else{r.copyFrom(s).add(o)}}else if(this.offsetMode===0){if(n!==null){r.copyFrom(n).add(o)}else{r.copyFrom(o)}}else{f=false;r.copyFrom(s)}if(f){var m=l._boneData.type===1;var p=m?l._bone:null;var c=m?l._getGlobalTransformMatrix(r.x,r.y):l.globalTransformMatrix;if(a.inheritScale&&(!m||p!==null)){if(m){if(a.inheritRotation){r.rotation+=l.global.rotation}p.updateGlobalTransform();r.scaleX*=p.global.scaleX;r.scaleY*=p.global.scaleY;c.transformPoint(r.x,r.y,r);r.toMatrix(i);if(a.inheritTranslation){r.x=i.tx;r.y=i.ty}else{i.tx=r.x;i.ty=r.y}}else{if(!a.inheritRotation){l.updateGlobalTransform();if(h&&u){_=r.rotation-(l.global.rotation+Math.PI)}else if(h){_=r.rotation+l.global.rotation+Math.PI}else if(u){_=r.rotation+l.global.rotation}else{_=r.rotation-l.global.rotation}r.rotation=_}r.toMatrix(i);i.concat(c);if(a.inheritTranslation){r.x=i.tx;r.y=i.ty}else{i.tx=r.x;i.ty=r.y}if(e){r.fromMatrix(i)}else{this._globalDirty=true}}}else{if(a.inheritTranslation){var d=r.x;var y=r.y;r.x=c.a*d+c.c*y+c.tx;r.y=c.b*d+c.d*y+c.ty}else{if(h){r.x=-r.x}if(u){r.y=-r.y}}if(a.inheritRotation){l.updateGlobalTransform();if(l.global.scaleX<0){_=r.rotation+l.global.rotation+Math.PI}else{_=r.rotation+l.global.rotation}if(c.a*c.d-c.b*c.c<0){_-=r.rotation*2;if(h!==u||a.inheritReflection){r.skew+=Math.PI}}r.rotation=_}else if(h||u){if(h&&u){_=r.rotation+Math.PI}else{if(h){_=Math.PI-r.rotation}else{_=-r.rotation}r.skew+=Math.PI}r.rotation=_}r.toMatrix(i)}}else{if(h||u){if(h){r.x=-r.x}if(u){r.y=-r.y}if(h&&u){_=r.rotation+Math.PI}else{if(h){_=Math.PI-r.rotation}else{_=-r.rotation}r.skew+=Math.PI}r.rotation=_}r.toMatrix(i)}};a.prototype._updateAlpha=function(){if(this._parent!==null){this._globalAlpha=this._alpha*this._parent._globalAlpha}else{this._globalAlpha=this._alpha*this._armature._globalAlpha}};a.prototype.init=function(t,e){if(this._boneData!==null){return}this._boneData=t;this._armature=e;this._alpha=this._boneData.alpha;if(this._boneData.parent!==null){this._parent=this._armature.getBone(this._boneData.parent.name)}this._armature._addBone(this);this.origin=this._boneData.transform};a.prototype.update=function(t){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 a=0,r=this._armature._constraints;a<r.length;a++){var i=r[a];if(i._root===this){i.update()}}}if(this._transformDirty||this._parent!==null&&this._parent._childrenTransformDirty){this._transformDirty=true;this._cachedFrameIndex=-1}else if(this._cachedFrameIndex>=0){this._transformDirty